@thibezer/ui-components-kit 1.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +92 -0
- package/LICENSE +21 -21
- package/README.md +150 -14
- package/dist/botao.cjs +1 -1
- package/dist/botao.js +1 -1
- package/dist/camadas.cjs +65 -65
- package/dist/camadas.js +762 -729
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +105 -146
- package/dist/canvas.js +5132 -1199
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-botao/ui-botao.d.ts +15 -0
- package/dist/components/ui-camadas/camadas-persistencia.d.ts +4 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +10 -0
- package/dist/components/ui-campo-texto/ui-campo-texto.d.ts +5 -0
- package/dist/components/ui-canvas-cad/cad-estilos-externos.d.ts +16 -0
- package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +4 -0
- package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +262 -0
- package/dist/components/ui-canvas-cad/cad-ferramentas-barra.d.ts +15 -0
- package/dist/components/ui-canvas-cad/cad-snap.d.ts +32 -0
- package/dist/components/ui-canvas-cad/cad-toolbar-painel.d.ts +1 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +143 -0
- package/dist/components/ui-lista-flutuante/lista-flutuante-posicionamento.d.ts +2 -0
- package/dist/components/ui-lista-flutuante/ui-lista-flutuante.d.ts +1 -0
- package/dist/components/ui-modal/modal-pilha.d.ts +3 -0
- package/dist/components/ui-modal/ui-modal.d.ts +19 -4
- package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +3 -0
- package/dist/components/ui-tabela/tabela-atributos-sync.d.ts +3 -0
- package/dist/components/ui-tabela/tabela-corpo.d.ts +2 -0
- package/dist/components/ui-tabela/tabela-localizador.d.ts +8 -1
- package/dist/components/ui-tabela/tabela-orquestrador-dados.d.ts +4 -0
- package/dist/components/ui-tabela/tabela-renderizador.d.ts +1 -0
- package/dist/components/ui-tabela/tabela-selecao.d.ts +21 -6
- package/dist/components/ui-tabela/tipos.d.ts +6 -0
- package/dist/components/ui-tabela/ui-tabela.d.ts +56 -2
- package/dist/components/ui-tabela-propriedades/avaliador-expressao.d.ts +0 -5
- package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +17 -1
- package/dist/components/ui-tabela-propriedades/propriedades-flutuante.d.ts +2 -0
- package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +10 -1
- package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +3 -1
- package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +5 -1
- package/dist/components/ui-tooltip/ui-tooltip.d.ts +15 -0
- package/dist/core/alvo-digitavel.d.ts +1 -0
- package/dist/core/form-submissao.d.ts +16 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/parts.d.ts +6 -0
- package/dist/core/rotulo.d.ts +6 -0
- package/dist/core/svg-seguro.d.ts +10 -0
- package/dist/core/ui-bus.d.ts +13 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +14 -12
- package/dist/custom-elements.json +32905 -0
- package/dist/data.cjs +1 -1
- package/dist/data.js +51 -46
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +3 -3
- package/dist/form-submissao-C-SPRKgT.js +61 -0
- package/dist/form-submissao-DxKO5MHI.cjs +1 -0
- package/dist/forms.cjs +1 -1
- package/dist/forms.js +2 -2
- package/dist/gerencigeo-canvas/canvas_interacao.d.ts +18 -0
- package/dist/gerencigeo-canvas/feature_adapters.d.ts +35 -0
- package/dist/gerencigeo-canvas/feature_algoritmos.d.ts +45 -0
- package/dist/gerencigeo-canvas/feature_amostra.d.ts +4 -0
- package/dist/gerencigeo-canvas/feature_caixa.d.ts +19 -0
- package/dist/gerencigeo-canvas/feature_cluster.d.ts +61 -0
- package/dist/gerencigeo-canvas/feature_cursores.d.ts +17 -0
- package/dist/gerencigeo-canvas/feature_desenho.d.ts +53 -0
- package/dist/gerencigeo-canvas/feature_desenho_controle.d.ts +91 -0
- package/dist/gerencigeo-canvas/feature_edicao_ops.d.ts +19 -0
- package/dist/gerencigeo-canvas/feature_editor_vertices.d.ts +62 -0
- package/dist/gerencigeo-canvas/feature_formas.d.ts +7 -0
- package/dist/gerencigeo-canvas/feature_hud.d.ts +23 -0
- package/dist/gerencigeo-canvas/feature_indice.d.ts +36 -0
- package/dist/gerencigeo-canvas/feature_metricas.d.ts +16 -0
- package/dist/gerencigeo-canvas/feature_popup.d.ts +31 -0
- package/dist/gerencigeo-canvas/feature_selecao.d.ts +38 -0
- package/dist/gerencigeo-canvas/feature_simplificacao.d.ts +14 -0
- package/dist/gerencigeo-canvas/feature_snap.d.ts +25 -0
- package/dist/gerencigeo-canvas/feature_types.d.ts +86 -0
- package/dist/gerencigeo-canvas/feature_versoes.d.ts +19 -0
- package/dist/gerencigeo-canvas/index.d.ts +21 -0
- package/dist/gerencigeo-canvas/layer_hit_test.d.ts +30 -0
- package/dist/gerencigeo-canvas/layer_manager.d.ts +11 -3
- package/dist/gerencigeo-canvas/layer_pane_ops.d.ts +9 -0
- package/dist/gerencigeo-canvas/mapa_controller.d.ts +1 -0
- package/dist/gerencigeo-canvas/mapa_pontos_shapes.d.ts +24 -5
- package/dist/gerencigeo-canvas/renderers/feicoes_renderer.d.ts +89 -0
- package/dist/gerencigeo-canvas/renderers/vector_points_renderer.d.ts +1 -0
- package/dist/gerencigeo-canvas/renderers/vector_polygons_renderer.d.ts +2 -2
- package/dist/gerencigeo-canvas/types.d.ts +12 -0
- package/dist/gerencigeo-canvas/utils.d.ts +3 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +117 -112
- package/dist/leaflet-DcO7uRC-.cjs +1 -0
- package/dist/{leaflet-DkaFZYc5.js → leaflet-PPDKB6Dd.js} +37 -37
- package/dist/mapa.cjs +4 -4
- package/dist/mapa.js +2 -2
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/parts-CaoQiCfI.js +7 -0
- package/dist/parts-vQa2873h.cjs +1 -0
- package/dist/register.cjs +1 -1
- package/dist/register.js +12 -12
- package/dist/seletor-mapa-base.cjs +16 -16
- package/dist/seletor-mapa-base.js +111 -61
- package/dist/svg-seguro-BsbNQqpd.js +50 -0
- package/dist/svg-seguro-C76iLlAZ.cjs +1 -0
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +41 -36
- package/dist/tipos-elementos.d.ts +1232 -0
- package/dist/tipos-react.d.ts +113 -0
- package/dist/tipos-vue.d.ts +1201 -0
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/ui-badge-BxT-sDmV.cjs +28 -0
- package/dist/ui-badge-C0eKBI8E.js +183 -0
- package/dist/ui-botao-OGJV6Vfk.js +165 -0
- package/dist/ui-botao-psS1juof.cjs +12 -0
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +16 -0
- package/dist/{ui-campo-texto-B_JF6POq.js → ui-campo-texto-Uu2dJE_0.js} +81 -63
- package/dist/{ui-card-Bhm6k91e.cjs → ui-card-B86lJXTP.cjs} +7 -7
- package/dist/{ui-card-BJ8SmvVf.js → ui-card-C_o5_0cB.js} +14 -14
- package/dist/ui-kit.css +1 -1
- package/dist/ui-modal-CvGFGh1h.cjs +18 -0
- package/dist/ui-modal-DBOtSTbR.js +238 -0
- package/dist/{ui-paleta-ferramentas-Bpp4XBVg.js → ui-paleta-ferramentas-CEZYcN4J.js} +18 -27
- package/dist/{ui-paleta-ferramentas-B6dJ0O6K.cjs → ui-paleta-ferramentas-Dbj1kBS9.cjs} +6 -6
- package/dist/ui-segmented-D6b6zxVs.cjs +19 -0
- package/dist/{ui-segmented-C8wuycjJ.js → ui-segmented-wUraId2e.js} +68 -67
- package/dist/ui-skeleton-DI4_9WOX.js +428 -0
- package/dist/ui-skeleton-elhKIh2B.cjs +33 -0
- package/dist/{ui-switch-CO9MoS8x.js → ui-switch-BcOqOkiV.js} +92 -62
- package/dist/ui-switch-D7iPKDj-.cjs +53 -0
- package/dist/ui-tabela-propriedades-BBr5sqki.cjs +145 -0
- package/dist/ui-tabela-propriedades-Boy7I5yW.js +2412 -0
- package/dist/{ui-toast-CwUmiqyG.js → ui-toast-Bp_NlM5G.js} +51 -51
- package/dist/ui-toast-DGTZKne5.cjs +20 -0
- package/dist/zero-js-triggers-C_KrvFOQ.js +244 -0
- package/dist/zero-js-triggers-C_gtaojZ.cjs +1 -0
- package/package.json +27 -7
- package/dist/leaflet-Cw6tqYFh.cjs +0 -1
- package/dist/ui-badge-92yelKls.js +0 -183
- package/dist/ui-badge-B95jSECC.cjs +0 -28
- package/dist/ui-botao-BShEouvi.js +0 -124
- package/dist/ui-botao-DF1yuUUD.cjs +0 -12
- package/dist/ui-campo-texto-BCh5HyCM.cjs +0 -16
- package/dist/ui-modal-Bi4isGYh.cjs +0 -18
- package/dist/ui-modal-DV-pw2x1.js +0 -194
- package/dist/ui-segmented-NC5cBXLh.cjs +0 -19
- package/dist/ui-skeleton-B3xQyn0Z.js +0 -396
- package/dist/ui-skeleton-D42oQufF.cjs +0 -33
- package/dist/ui-switch-C6o4yZUF.cjs +0 -53
- package/dist/ui-tabela-propriedades-7yJ9g7ti.cjs +0 -145
- package/dist/ui-tabela-propriedades-D-XKNVwK.js +0 -2078
- package/dist/ui-toast-CQBqvUm3.cjs +0 -20
- package/dist/zero-js-triggers-DdESy0tk.js +0 -205
- package/dist/zero-js-triggers-QGD7FOTv.cjs +0 -1
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
var C = Object.defineProperty;
|
|
2
|
+
var S = (n, l, t) => l in n ? C(n, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[l] = t;
|
|
3
|
+
var s = (n, l, t) => S(n, typeof l != "symbol" ? l + "" : l, t);
|
|
4
|
+
import { L } from "./listener-bag-DQgv7OON.js";
|
|
5
|
+
import { d as h, S as x } from "./ssr-safe-5cWfJP-s.js";
|
|
6
|
+
const N = ':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-drawer__backdrop{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#000000a6;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:calc(var(--ui-z-drawer, 700) - 1);opacity:0;pointer-events:none;transition:opacity .25s ease}:host([aberto]) .ui-drawer__backdrop,:host([open]) .ui-drawer__backdrop{opacity:1;pointer-events:auto}.ui-drawer__painel{position:fixed;z-index:var(--ui-z-drawer, 700);background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));box-shadow:var(--ui-sombra-lg, 0 16px 40px rgba(0, 0, 0, .7));display:flex;flex-direction:column;opacity:0;visibility:hidden;pointer-events:none;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .2s ease,visibility .2s ease;box-sizing:border-box;color:var(--ui-cor-texto, #e1e1e6)}:host(:not([posicao])) .ui-drawer__painel,:host([posicao="direita"]) .ui-drawer__painel,:host([position="right"]) .ui-drawer__painel{top:0;right:0;bottom:0;width:var(--ui-drawer-largura, 480px);max-width:92vw;height:100vh;transform:translate(100%);border-left:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16))}:host([aberto]:not([posicao])) .ui-drawer__painel,:host([open]:not([posicao])) .ui-drawer__painel,:host([aberto][posicao="direita"]) .ui-drawer__painel,:host([open][posicao="direita"]) .ui-drawer__painel,:host([aberto][position="right"]) .ui-drawer__painel,:host([open][position="right"]) .ui-drawer__painel{transform:translate(0);opacity:1;visibility:visible;pointer-events:auto}:host([posicao="esquerda"]) .ui-drawer__painel,:host([position="left"]) .ui-drawer__painel{top:0;left:0;bottom:0;width:var(--ui-drawer-largura, 480px);max-width:92vw;height:100vh;transform:translate(-100%);border-right:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16))}:host([aberto][posicao="esquerda"]) .ui-drawer__painel,:host([open][posicao="esquerda"]) .ui-drawer__painel,:host([aberto][position="left"]) .ui-drawer__painel,:host([open][position="left"]) .ui-drawer__painel{transform:translate(0);opacity:1;visibility:visible;pointer-events:auto}:host([posicao="baixo"]) .ui-drawer__painel,:host([position="bottom"]) .ui-drawer__painel{bottom:0;left:0;right:0;width:100vw;max-height:85vh;transform:translateY(100%);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-top-left-radius:14px;border-top-right-radius:14px}:host([aberto][posicao="baixo"]) .ui-drawer__painel,:host([open][posicao="baixo"]) .ui-drawer__painel,:host([aberto][position="bottom"]) .ui-drawer__painel,:host([open][position="bottom"]) .ui-drawer__painel{transform:translateY(0);opacity:1;visibility:visible;pointer-events:auto}:host([posicao="cima"]) .ui-drawer__painel,:host([position="top"]) .ui-drawer__painel{top:0;left:0;right:0;width:100vw;max-height:85vh;transform:translateY(-100%);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-bottom-left-radius:14px;border-bottom-right-radius:14px}:host([aberto][posicao="cima"]) .ui-drawer__painel,:host([open][posicao="cima"]) .ui-drawer__painel,:host([aberto][position="top"]) .ui-drawer__painel,:host([open][position="top"]) .ui-drawer__painel{transform:translateY(0);opacity:1;visibility:visible;pointer-events:auto}.ui-drawer__header{padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));flex-shrink:0}.ui-drawer__titulo-container{display:flex;flex-direction:column;gap:2px}.ui-drawer__titulo{margin:0;font-size:16px;font-weight:600;color:var(--ui-cor-texto, #ffffff)}.ui-drawer__descricao{margin:0;font-size:13px;color:var(--ui-cor-texto-secundario, #888899)}.ui-drawer__close{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-size:16px;cursor:pointer;padding:6px;border-radius:6px;line-height:1;display:flex;align-items:center;justify-content:center;transition:color .15s ease,background-color .15s ease}.ui-drawer__close svg,.ui-drawer__close ::slotted(svg){shape-rendering:geometricPrecision}.ui-drawer__close:hover{color:var(--ui-cor-texto, #ffffff);background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-drawer__close:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-primaria, #00E08A)}.ui-drawer__body{padding:20px;overflow-y:auto;flex:1;box-sizing:border-box}.ui-drawer__footer{padding:14px 20px;border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));display:flex;align-items:center;justify-content:flex-end;gap:10px;background-color:var(--ui-cor-fundo-recuado, rgba(0, 0, 0, .15));flex-shrink:0}@starting-style{:host([aberto]:not([posicao])) .ui-drawer__painel,:host([open]:not([posicao])) .ui-drawer__painel,:host([aberto][posicao="direita"]) .ui-drawer__painel,:host([open][posicao="direita"]) .ui-drawer__painel{transform:translate(100%);opacity:0}:host([aberto][posicao="esquerda"]) .ui-drawer__painel,:host([open][posicao="esquerda"]) .ui-drawer__painel{transform:translate(-100%);opacity:0}:host([aberto][posicao="baixo"]) .ui-drawer__painel,:host([open][posicao="baixo"]) .ui-drawer__painel{transform:translateY(100%);opacity:0}:host([aberto]) .ui-drawer__backdrop,:host([open]) .ui-drawer__backdrop{opacity:0}}', g = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), ui-campo-texto, ui-botao, ui-botao-primario, ui-checkbox, ui-switch, ui-lista-flutuante, ui-radio, ui-select, ui-segmented';
|
|
7
|
+
function _(n, l) {
|
|
8
|
+
let t = Array.from(n.querySelectorAll(g));
|
|
9
|
+
t = t.filter((i) => {
|
|
10
|
+
try {
|
|
11
|
+
return window.getComputedStyle(i).display !== "none";
|
|
12
|
+
} catch {
|
|
13
|
+
return !0;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const e = n.querySelectorAll("slot"), o = [];
|
|
17
|
+
return e.forEach((i) => {
|
|
18
|
+
i.assignedElements({ flatten: !0 }).forEach((a) => {
|
|
19
|
+
a instanceof HTMLElement && (a.matches(g) && o.push(a), o.push(...Array.from(a.querySelectorAll(g))));
|
|
20
|
+
});
|
|
21
|
+
}), [...t, ...o].filter((i) => !i.hasAttribute("disabled") && i.getAttribute("aria-hidden") !== "true");
|
|
22
|
+
}
|
|
23
|
+
function q(n) {
|
|
24
|
+
if (typeof document > "u") return !0;
|
|
25
|
+
const l = Array.from(
|
|
26
|
+
document.querySelectorAll("ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]")
|
|
27
|
+
);
|
|
28
|
+
return l[l.length - 1] === n;
|
|
29
|
+
}
|
|
30
|
+
function z(n, l, t, e) {
|
|
31
|
+
if (l.length === 0) {
|
|
32
|
+
n.preventDefault();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const o = l[0], i = l[l.length - 1], r = t.getRootNode(), a = r == null ? void 0 : r.activeElement;
|
|
36
|
+
n.shiftKey ? (a === o || !t.contains(a) && !e.contains(a)) && (n.preventDefault(), i.focus()) : (a === i || !t.contains(a) && !e.contains(a)) && (n.preventDefault(), o.focus());
|
|
37
|
+
}
|
|
38
|
+
function M() {
|
|
39
|
+
if (typeof document > "u") return;
|
|
40
|
+
document.querySelectorAll(
|
|
41
|
+
"ui-modal[aberto], ui-modal[open], ui-dialog[aberto], ui-dialog[open], ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]"
|
|
42
|
+
).length > 0 ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
|
|
43
|
+
}
|
|
44
|
+
class b extends x {
|
|
45
|
+
constructor() {
|
|
46
|
+
super();
|
|
47
|
+
s(this, "backdropElement");
|
|
48
|
+
s(this, "painelElement");
|
|
49
|
+
s(this, "tituloElement");
|
|
50
|
+
s(this, "descricaoElement");
|
|
51
|
+
s(this, "closeElement");
|
|
52
|
+
s(this, "listeners", new L());
|
|
53
|
+
s(this, "_elementoGatilho", null);
|
|
54
|
+
s(this, "_focables", []);
|
|
55
|
+
s(this, "handleSlotChange", () => {
|
|
56
|
+
this.syncState();
|
|
57
|
+
});
|
|
58
|
+
s(this, "handleBackdropClick", (t) => {
|
|
59
|
+
t.stopPropagation(), this.hasAttribute("estatico") || this.hasAttribute("static") || this.fechar();
|
|
60
|
+
});
|
|
61
|
+
s(this, "handleCloseClick", (t) => {
|
|
62
|
+
t.stopPropagation(), this.fechar();
|
|
63
|
+
});
|
|
64
|
+
s(this, "handleKeyDown", (t) => {
|
|
65
|
+
this.aberto && q(this) && (t.key === "Escape" ? this.hasAttribute("estatico") || this.hasAttribute("static") || (this.fechar(), t.stopImmediatePropagation()) : t.key === "Tab" && (this._focables = _(this.shadowRoot), z(t, this._focables, this, this.shadowRoot)));
|
|
66
|
+
});
|
|
67
|
+
const t = this.attachShadow({ mode: "open" });
|
|
68
|
+
t.innerHTML = `
|
|
69
|
+
<style>${N}</style>
|
|
70
|
+
<div class="ui-drawer__backdrop" part="fundo"></div>
|
|
71
|
+
<aside class="ui-drawer__painel" part="painel" role="dialog" aria-modal="true" tabindex="-1">
|
|
72
|
+
<div class="ui-drawer__header" part="cabecalho">
|
|
73
|
+
<div class="ui-drawer__titulo-container">
|
|
74
|
+
<h3 class="ui-drawer__titulo" part="titulo"></h3>
|
|
75
|
+
<p class="ui-drawer__descricao" part="descricao" style="display: none;"></p>
|
|
76
|
+
</div>
|
|
77
|
+
<button type="button" class="ui-drawer__close" part="fechar" aria-label="Fechar painel lateral" title="Fechar">✕</button>
|
|
78
|
+
</div>
|
|
79
|
+
<div class="ui-drawer__body" part="corpo">
|
|
80
|
+
<slot></slot>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="ui-drawer__footer" part="rodape">
|
|
83
|
+
<slot name="rodape"></slot>
|
|
84
|
+
<slot name="footer"></slot>
|
|
85
|
+
</div>
|
|
86
|
+
</aside>
|
|
87
|
+
`, this.backdropElement = t.querySelector(".ui-drawer__backdrop"), this.painelElement = t.querySelector(".ui-drawer__painel"), this.tituloElement = t.querySelector(".ui-drawer__titulo"), this.descricaoElement = t.querySelector(".ui-drawer__descricao"), this.closeElement = t.querySelector(".ui-drawer__close");
|
|
88
|
+
}
|
|
89
|
+
static get observedAttributes() {
|
|
90
|
+
return [
|
|
91
|
+
"aberto",
|
|
92
|
+
"open",
|
|
93
|
+
"posicao",
|
|
94
|
+
"position",
|
|
95
|
+
"titulo",
|
|
96
|
+
"title",
|
|
97
|
+
"descricao",
|
|
98
|
+
"description",
|
|
99
|
+
"largura",
|
|
100
|
+
"width",
|
|
101
|
+
"estatico",
|
|
102
|
+
"static"
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
connectedCallback() {
|
|
106
|
+
this.listeners.cleanup(), this.listeners.add(this.backdropElement, "click", this.handleBackdropClick), this.listeners.add(this.closeElement, "click", this.handleCloseClick), this.listeners.add(window, "keydown", this.handleKeyDown), this.shadowRoot.querySelectorAll("slot").forEach((e) => {
|
|
107
|
+
this.listeners.add(e, "slotchange", this.handleSlotChange);
|
|
108
|
+
}), this.syncState();
|
|
109
|
+
}
|
|
110
|
+
disconnectedCallback() {
|
|
111
|
+
this.listeners.cleanup(), b.atualizarScrollLock();
|
|
112
|
+
}
|
|
113
|
+
attributeChangedCallback(t, e, o) {
|
|
114
|
+
(t === "aberto" || t === "open") && o !== null && (document.activeElement && document.activeElement !== document.body && (this._elementoGatilho = document.activeElement), setTimeout(() => {
|
|
115
|
+
this._focables = _(this.shadowRoot), this._focables.length > 0 ? this._focables[0].focus() : this.painelElement.focus();
|
|
116
|
+
}, 0)), this.syncState();
|
|
117
|
+
}
|
|
118
|
+
get aberto() {
|
|
119
|
+
return this.hasAttribute("aberto") || this.hasAttribute("open");
|
|
120
|
+
}
|
|
121
|
+
set aberto(t) {
|
|
122
|
+
t ? this.setAttribute("aberto", "") : (this.removeAttribute("aberto"), this.removeAttribute("open")), this.syncState();
|
|
123
|
+
}
|
|
124
|
+
get posicao() {
|
|
125
|
+
const t = (this.getAttribute("posicao") || this.getAttribute("position") || "direita").toLowerCase();
|
|
126
|
+
return t === "esquerda" || t === "left" ? "esquerda" : t === "baixo" || t === "bottom" ? "baixo" : t === "cima" || t === "top" ? "cima" : "direita";
|
|
127
|
+
}
|
|
128
|
+
set posicao(t) {
|
|
129
|
+
this.setAttribute("posicao", t);
|
|
130
|
+
}
|
|
131
|
+
abrir() {
|
|
132
|
+
this.aberto || (document.activeElement && document.activeElement !== document.body && (this._elementoGatilho = document.activeElement), this.aberto = !0, this.dispatchEvent(
|
|
133
|
+
new CustomEvent("ui-abrir", {
|
|
134
|
+
bubbles: !0,
|
|
135
|
+
composed: !0
|
|
136
|
+
})
|
|
137
|
+
), setTimeout(() => {
|
|
138
|
+
this._focables = _(this.shadowRoot), this._focables.length > 0 ? this._focables[0].focus() : this.painelElement.focus();
|
|
139
|
+
}, 0));
|
|
140
|
+
}
|
|
141
|
+
fechar() {
|
|
142
|
+
this.aberto && (this.aberto = !1, this.dispatchEvent(
|
|
143
|
+
new CustomEvent("ui-fechar", {
|
|
144
|
+
bubbles: !0,
|
|
145
|
+
composed: !0
|
|
146
|
+
})
|
|
147
|
+
), this._elementoGatilho && (this._elementoGatilho.focus(), this._elementoGatilho = null));
|
|
148
|
+
}
|
|
149
|
+
alternar() {
|
|
150
|
+
this.aberto ? this.fechar() : this.abrir();
|
|
151
|
+
}
|
|
152
|
+
syncState() {
|
|
153
|
+
var a, c;
|
|
154
|
+
const t = this.aberto, e = this.getAttribute("titulo") || this.getAttribute("title") || "", o = this.getAttribute("descricao") || this.getAttribute("description") || "", i = this.getAttribute("largura") || this.getAttribute("width"), r = (a = this.shadowRoot) == null ? void 0 : a.querySelector(".ui-drawer__footer");
|
|
155
|
+
if (this.painelElement.setAttribute("aria-hidden", String(!t)), e ? (this.tituloElement.textContent = e, this.tituloElement.style.display = "block") : this.tituloElement.style.display = "none", o ? (this.descricaoElement.textContent = o, this.descricaoElement.style.display = "block") : this.descricaoElement.style.display = "none", i ? this.style.setProperty("--ui-drawer-largura", isNaN(Number(i)) ? i : `${i}px`) : this.style.removeProperty("--ui-drawer-largura"), r) {
|
|
156
|
+
const u = Array.from(((c = this.shadowRoot) == null ? void 0 : c.querySelectorAll('slot[name="rodape"], slot[name="footer"]')) || []).some((p) => p.assignedNodes({ flatten: !0 }).some((f) => f.nodeType === Node.ELEMENT_NODE || f.textContent && f.textContent.trim() !== "")) || this.querySelector('[slot="rodape"], [slot="footer"]') !== null;
|
|
157
|
+
r.style.display = u ? "flex" : "none";
|
|
158
|
+
}
|
|
159
|
+
b.atualizarScrollLock();
|
|
160
|
+
}
|
|
161
|
+
static atualizarScrollLock() {
|
|
162
|
+
M();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
class T extends b {
|
|
166
|
+
}
|
|
167
|
+
class D extends b {
|
|
168
|
+
}
|
|
169
|
+
class $ extends b {
|
|
170
|
+
}
|
|
171
|
+
h("ui-drawer", b);
|
|
172
|
+
h("ui-sheet", T);
|
|
173
|
+
h("ui-painel-lateral", D);
|
|
174
|
+
h("ui-gaveta", $);
|
|
175
|
+
const O = ":host{display:inline-flex;position:relative;align-items:center;justify-content:center;vertical-align:middle;box-sizing:border-box;--ui-tooltip-texto-distancia: 260px;--ui-tooltip-seta-espaco: 70px}.ui-tooltip__bubble{position:fixed;z-index:var(--ui-z-tooltip, 1200);padding:6px 10px;border-radius:6px;font-size:11px;font-weight:500;background-color:var(--ui-cor-fundo-elevado, #1e1e24);color:var(--ui-cor-texto, #e1e1e6);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));box-shadow:var(--ui-sombra-md, 0 4px 16px rgba(0, 0, 0, .5));white-space:normal;max-width:var(--ui-tooltip-texto-distancia, 260px);width:max-content;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .15s ease,visibility .15s ease;line-height:1.35;box-sizing:border-box;-webkit-user-select:none;user-select:none;margin:0}.ui-tooltip__bubble[popover]{margin:0;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));background-color:var(--ui-cor-fundo-elevado, #1e1e24);color:var(--ui-cor-texto, #e1e1e6);padding:6px 10px;overflow:visible;max-width:var(--ui-tooltip-texto-distancia, 260px);width:max-content;white-space:normal}.ui-tooltip__texto{display:inline-block;max-width:100%}.ui-tooltip__arrow{position:absolute;width:0;height:0;border-style:solid}.ui-tooltip--topo .ui-tooltip__arrow{bottom:-5px;left:50%;transform:translate(-50%);border-width:5px 5px 0 5px;border-color:var(--ui-cor-fundo-elevado, #1e1e24) transparent transparent transparent}.ui-tooltip--baixo .ui-tooltip__arrow{top:-5px;left:50%;transform:translate(-50%);border-width:0 5px 5px 5px;border-color:transparent transparent var(--ui-cor-fundo-elevado, #1e1e24) transparent}.ui-tooltip--esquerda .ui-tooltip__arrow{right:-5px;top:50%;transform:translateY(-50%);border-width:5px 0 5px 5px;border-color:transparent transparent transparent var(--ui-cor-fundo-elevado, #1e1e24)}.ui-tooltip--direita .ui-tooltip__arrow{left:-5px;top:50%;transform:translateY(-50%);border-width:5px 5px 5px 0;border-color:transparent var(--ui-cor-fundo-elevado, #1e1e24) transparent transparent}.ui-tooltip--visivel .ui-tooltip__bubble{opacity:1;visibility:visible;pointer-events:auto;transform:scale(1)}@starting-style{.ui-tooltip--visivel .ui-tooltip__bubble,.ui-tooltip__bubble:popover-open{opacity:0;transform:scale(.94)}}", R = 120;
|
|
176
|
+
class E extends x {
|
|
177
|
+
constructor() {
|
|
178
|
+
super();
|
|
179
|
+
s(this, "containerElement");
|
|
180
|
+
s(this, "bubbleElement");
|
|
181
|
+
s(this, "_posicionamentoAtivo", !1);
|
|
182
|
+
s(this, "_timerOcultar", null);
|
|
183
|
+
/** Gatilho que recebeu `aria-description` deste tooltip (para remover depois). */
|
|
184
|
+
s(this, "_gatilhoDescrito", null);
|
|
185
|
+
s(this, "posicionarBubble", () => {
|
|
186
|
+
if (!this.aberto) return;
|
|
187
|
+
const t = this.getBoundingClientRect(), e = this.bubbleElement.getBoundingClientRect(), o = this.getAttribute("posicao") || this.getAttribute("position") || "topo";
|
|
188
|
+
let i = "topo";
|
|
189
|
+
["topo", "top"].includes(o) ? i = "topo" : ["baixo", "bottom"].includes(o) ? i = "baixo" : ["esquerda", "left"].includes(o) ? i = "esquerda" : ["direita", "right"].includes(o) && (i = "direita");
|
|
190
|
+
let r = 0, a = 0;
|
|
191
|
+
const c = 8;
|
|
192
|
+
i === "topo" ? (r = t.top - e.height - c, a = t.left + t.width / 2 - e.width / 2) : i === "baixo" ? (r = t.bottom + c, a = t.left + t.width / 2 - e.width / 2) : i === "esquerda" ? (r = t.top + t.height / 2 - e.height / 2, a = t.left - e.width - c) : i === "direita" && (r = t.top + t.height / 2 - e.height / 2, a = t.right + c), a = Math.max(8, Math.min(a, window.innerWidth - e.width - 8)), r = Math.max(8, Math.min(r, window.innerHeight - e.height - 8)), this.bubbleElement.style.top = `${Math.round(r)}px`, this.bubbleElement.style.left = `${Math.round(a)}px`;
|
|
193
|
+
});
|
|
194
|
+
s(this, "handleMouseEnter", () => {
|
|
195
|
+
const t = this.getAttribute("gatilho") || this.getAttribute("trigger") || "hover";
|
|
196
|
+
(t === "hover" || t === "passar-mouse") && (this.cancelarOcultar(), this.mostrar());
|
|
197
|
+
});
|
|
198
|
+
s(this, "handleMouseLeave", () => {
|
|
199
|
+
const t = this.getAttribute("gatilho") || this.getAttribute("trigger") || "hover";
|
|
200
|
+
(t === "hover" || t === "passar-mouse") && (this.cancelarOcultar(), this._timerOcultar = setTimeout(() => {
|
|
201
|
+
this._timerOcultar = null, this.ocultar();
|
|
202
|
+
}, R));
|
|
203
|
+
});
|
|
204
|
+
/**
|
|
205
|
+
* Escape fecha o tooltip sem mover o foco (WCAG 1.4.13). Ouvido na captura e interrompido,
|
|
206
|
+
* para que dentro de um modal o primeiro Escape feche só o tooltip.
|
|
207
|
+
*/
|
|
208
|
+
s(this, "handleEscape", (t) => {
|
|
209
|
+
t.key !== "Escape" || !this.aberto || (t.stopPropagation(), this.cancelarOcultar(), this.ocultar());
|
|
210
|
+
});
|
|
211
|
+
s(this, "handleClick", (t) => {
|
|
212
|
+
const e = this.getAttribute("gatilho") || this.getAttribute("trigger") || "hover", o = window.matchMedia("(pointer: coarse)").matches;
|
|
213
|
+
(e === "clique" || e === "click" || o) && (t.stopPropagation(), this.aberto = !this.aberto);
|
|
214
|
+
});
|
|
215
|
+
s(this, "handleClickOutside", (t) => {
|
|
216
|
+
t.composedPath().includes(this) || this.ocultar();
|
|
217
|
+
});
|
|
218
|
+
const t = this.attachShadow({ mode: "open" });
|
|
219
|
+
t.innerHTML = `
|
|
220
|
+
<style>${O}</style>
|
|
221
|
+
<div class="ui-tooltip ui-tooltip--topo">
|
|
222
|
+
<slot></slot>
|
|
223
|
+
<div class="ui-tooltip__bubble" part="balao" role="tooltip" popover="manual">
|
|
224
|
+
<span class="ui-tooltip__texto" part="texto"></span>
|
|
225
|
+
<slot name="conteudo"></slot>
|
|
226
|
+
<span class="ui-tooltip__arrow" part="seta"></span>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
`, this.containerElement = t.querySelector(".ui-tooltip"), this.bubbleElement = t.querySelector(".ui-tooltip__bubble"), t.querySelectorAll("slot").forEach((e) => e.addEventListener("slotchange", () => this.sincronizarDescricao()));
|
|
230
|
+
}
|
|
231
|
+
static get observedAttributes() {
|
|
232
|
+
return [
|
|
233
|
+
"texto",
|
|
234
|
+
"text",
|
|
235
|
+
"posicao",
|
|
236
|
+
"position",
|
|
237
|
+
"gatilho",
|
|
238
|
+
"trigger",
|
|
239
|
+
"aberto",
|
|
240
|
+
"open",
|
|
241
|
+
"disabled"
|
|
242
|
+
];
|
|
243
|
+
}
|
|
244
|
+
connectedCallback() {
|
|
245
|
+
this.addEventListener("mouseenter", this.handleMouseEnter), this.addEventListener("mouseleave", this.handleMouseLeave), this.addEventListener("focusin", this.handleMouseEnter), this.addEventListener("focusout", this.handleMouseLeave), this.addEventListener("click", this.handleClick), this.syncState();
|
|
246
|
+
}
|
|
247
|
+
disconnectedCallback() {
|
|
248
|
+
this.removeEventListener("mouseenter", this.handleMouseEnter), this.removeEventListener("mouseleave", this.handleMouseLeave), this.removeEventListener("focusin", this.handleMouseEnter), this.removeEventListener("focusout", this.handleMouseLeave), this.removeEventListener("click", this.handleClick), document.removeEventListener("click", this.handleClickOutside), document.removeEventListener("keydown", this.handleEscape, !0), this.cancelarOcultar(), this.removerDescricao(), this._posicionamentoAtivo && (this._posicionamentoAtivo = !1, window.removeEventListener("scroll", this.posicionarBubble, { capture: !0 }), window.removeEventListener("resize", this.posicionarBubble)), this.ocultar();
|
|
249
|
+
}
|
|
250
|
+
attributeChangedCallback(t, e, o) {
|
|
251
|
+
this.syncState();
|
|
252
|
+
}
|
|
253
|
+
get aberto() {
|
|
254
|
+
return this.hasAttribute("aberto") || this.hasAttribute("open");
|
|
255
|
+
}
|
|
256
|
+
set aberto(t) {
|
|
257
|
+
t ? this.setAttribute("aberto", "") : (this.removeAttribute("aberto"), this.removeAttribute("open")), this.syncState();
|
|
258
|
+
}
|
|
259
|
+
get disabled() {
|
|
260
|
+
return this.hasAttribute("disabled");
|
|
261
|
+
}
|
|
262
|
+
set disabled(t) {
|
|
263
|
+
t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this.syncState();
|
|
264
|
+
}
|
|
265
|
+
mostrar() {
|
|
266
|
+
this.disabled || (this.aberto = !0);
|
|
267
|
+
}
|
|
268
|
+
ocultar() {
|
|
269
|
+
this.aberto = !1;
|
|
270
|
+
}
|
|
271
|
+
syncState() {
|
|
272
|
+
var a;
|
|
273
|
+
const t = this.aberto, e = this.getAttribute("posicao") || this.getAttribute("position") || "topo", o = this.getAttribute("texto") || this.getAttribute("text") || "", i = (a = this.shadowRoot) == null ? void 0 : a.querySelector(".ui-tooltip__texto");
|
|
274
|
+
let r = "topo";
|
|
275
|
+
if (["topo", "top"].includes(e) ? r = "topo" : ["baixo", "bottom"].includes(e) ? r = "baixo" : ["esquerda", "left"].includes(e) ? r = "esquerda" : ["direita", "right"].includes(e) && (r = "direita"), this.containerElement.className = `ui-tooltip ui-tooltip--${r}`, i && (o ? (i.textContent = o, i.style.display = "inline") : i.style.display = "none"), this.sincronizarDescricao(), t) {
|
|
276
|
+
if (document.addEventListener("click", this.handleClickOutside), document.addEventListener("keydown", this.handleEscape, !0), typeof this.bubbleElement.showPopover == "function")
|
|
277
|
+
try {
|
|
278
|
+
this.bubbleElement.showPopover();
|
|
279
|
+
} catch {
|
|
280
|
+
}
|
|
281
|
+
this.containerElement.classList.add("ui-tooltip--visivel"), requestAnimationFrame(() => {
|
|
282
|
+
this.posicionarBubble();
|
|
283
|
+
}), this._posicionamentoAtivo || (this._posicionamentoAtivo = !0, window.addEventListener("scroll", this.posicionarBubble, { capture: !0, passive: !0 }), window.addEventListener("resize", this.posicionarBubble, { passive: !0 }));
|
|
284
|
+
} else {
|
|
285
|
+
if (document.removeEventListener("click", this.handleClickOutside), document.removeEventListener("keydown", this.handleEscape, !0), typeof this.bubbleElement.hidePopover == "function")
|
|
286
|
+
try {
|
|
287
|
+
this.bubbleElement.hidePopover();
|
|
288
|
+
} catch {
|
|
289
|
+
}
|
|
290
|
+
this.containerElement.classList.remove("ui-tooltip--visivel"), this._posicionamentoAtivo && (this._posicionamentoAtivo = !1, window.removeEventListener("scroll", this.posicionarBubble, { capture: !0 }), window.removeEventListener("resize", this.posicionarBubble));
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
cancelarOcultar() {
|
|
294
|
+
this._timerOcultar && (clearTimeout(this._timerOcultar), this._timerOcultar = null);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* O balão vive no Shadow DOM, fora do alcance de `aria-describedby` do gatilho (light DOM).
|
|
298
|
+
* O texto é exposto como `aria-description` no gatilho, sem sobrescrever uma descrição do consumidor.
|
|
299
|
+
*/
|
|
300
|
+
sincronizarDescricao() {
|
|
301
|
+
var i;
|
|
302
|
+
if (!this.isConnected) {
|
|
303
|
+
this.removerDescricao();
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
const t = Array.from(this.children).find((r) => !r.hasAttribute("slot")), e = (this.getAttribute("texto") || this.getAttribute("text") || ((i = this.querySelector('[slot="conteudo"]')) == null ? void 0 : i.textContent) || "").replace(/\s+/g, " ").trim();
|
|
307
|
+
this._gatilhoDescrito && this._gatilhoDescrito !== t && this.removerDescricao(), !(!t || this._gatilhoDescrito !== t && (t.hasAttribute("aria-describedby") || t.hasAttribute("aria-description"))) && (e && !this.disabled ? (t.setAttribute("aria-description", e), this._gatilhoDescrito = t) : this.removerDescricao());
|
|
308
|
+
}
|
|
309
|
+
removerDescricao() {
|
|
310
|
+
var t;
|
|
311
|
+
(t = this._gatilhoDescrito) == null || t.removeAttribute("aria-description"), this._gatilhoDescrito = null;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
class P extends E {
|
|
315
|
+
}
|
|
316
|
+
h("ui-tooltip", E);
|
|
317
|
+
h("ui-popover", P);
|
|
318
|
+
const B = ":host{display:block;box-sizing:border-box}:host([inline]){display:inline-block}.ui-skeleton{background:var(--ui-cor-fundo-elevado, #1e1e24);background-image:linear-gradient(90deg,#fff0,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent),#fff0);background-size:200% 100%;background-repeat:no-repeat;border-radius:var(--ui-raio-borda, 6px);position:relative;overflow:hidden;box-sizing:border-box;animation:ui-skeleton-shimmer 1.6s ease-in-out infinite}@keyframes ui-skeleton-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.ui-skeleton--pulso{background-image:none;animation:ui-skeleton-pulse 1.8s ease-in-out infinite}@keyframes ui-skeleton-pulse{0%,to{opacity:1}50%{opacity:.45}}.ui-skeleton--estatico{animation:none;background-image:none}.ui-skeleton--texto{height:1.1em;border-radius:var(--ui-raio-sm, 4px)}.ui-skeleton--circular{border-radius:50%!important;aspect-ratio:1;width:var(--ui-skeleton-largura, 40px);height:var(--ui-skeleton-altura, 40px)}.ui-skeleton--retangular{border-radius:var(--ui-raio-borda, 6px);min-height:20px}.ui-skeleton__linhas{display:flex;flex-direction:column;gap:8px;width:100%}.ui-skeleton__linhas .ui-skeleton{width:100%}.ui-skeleton__linhas .ui-skeleton:last-child:not(:first-child){width:65%}.ui-skeleton--card{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:var(--ui-raio-borda, 10px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));background:var(--ui-cor-fundo-card, #18181c);animation:none}.ui-skeleton__card-media{width:100%;height:120px;border-radius:6px}.ui-skeleton__card-header{display:flex;align-items:center;gap:10px}.ui-skeleton__card-avatar{width:36px;height:36px;border-radius:50%;flex-shrink:0}.ui-skeleton__card-title{width:50%;height:16px}@media (prefers-reduced-motion: reduce){.ui-skeleton{animation:none!important;background-image:none!important;opacity:.7}}";
|
|
319
|
+
class A extends x {
|
|
320
|
+
constructor() {
|
|
321
|
+
super();
|
|
322
|
+
s(this, "rootElement");
|
|
323
|
+
const t = this.attachShadow({ mode: "open" });
|
|
324
|
+
t.innerHTML = `
|
|
325
|
+
<style>${B}</style>
|
|
326
|
+
<div class="ui-skeleton-container" role="status" aria-label="Carregando..."></div>
|
|
327
|
+
`, this.rootElement = t.querySelector(".ui-skeleton-container");
|
|
328
|
+
}
|
|
329
|
+
static get observedAttributes() {
|
|
330
|
+
return [
|
|
331
|
+
"variante",
|
|
332
|
+
"variant",
|
|
333
|
+
"largura",
|
|
334
|
+
"width",
|
|
335
|
+
"altura",
|
|
336
|
+
"height",
|
|
337
|
+
"raio",
|
|
338
|
+
"radius",
|
|
339
|
+
"linhas",
|
|
340
|
+
"lines",
|
|
341
|
+
"count",
|
|
342
|
+
"animado",
|
|
343
|
+
"animated"
|
|
344
|
+
];
|
|
345
|
+
}
|
|
346
|
+
connectedCallback() {
|
|
347
|
+
this.hasAttribute("aria-hidden") || this.setAttribute("aria-hidden", "true"), this.syncState();
|
|
348
|
+
}
|
|
349
|
+
attributeChangedCallback(t, e, o) {
|
|
350
|
+
this.syncState();
|
|
351
|
+
}
|
|
352
|
+
get variante() {
|
|
353
|
+
const t = (this.getAttribute("variante") || this.getAttribute("variant") || "texto").toLowerCase();
|
|
354
|
+
return t === "circulo" || t === "circular" ? "circular" : t === "retangulo" || t === "retangular" ? "retangular" : t === "card" ? "card" : "texto";
|
|
355
|
+
}
|
|
356
|
+
set variante(t) {
|
|
357
|
+
this.setAttribute("variante", t);
|
|
358
|
+
}
|
|
359
|
+
get animado() {
|
|
360
|
+
const t = (this.getAttribute("animado") || this.getAttribute("animated") || "shimmer").toLowerCase();
|
|
361
|
+
return t === "pulse" || t === "pulso" ? "pulso" : t === "none" || t === "nenhum" || t === "estatico" ? "nenhum" : "shimmer";
|
|
362
|
+
}
|
|
363
|
+
set animado(t) {
|
|
364
|
+
this.setAttribute("animado", t);
|
|
365
|
+
}
|
|
366
|
+
get linhas() {
|
|
367
|
+
const t = parseInt(this.getAttribute("linhas") || this.getAttribute("lines") || this.getAttribute("count") || "1", 10);
|
|
368
|
+
return isNaN(t) || t < 1 ? 1 : t;
|
|
369
|
+
}
|
|
370
|
+
set linhas(t) {
|
|
371
|
+
this.setAttribute("linhas", String(t));
|
|
372
|
+
}
|
|
373
|
+
syncState() {
|
|
374
|
+
const t = this.variante, e = this.animado, o = this.getAttribute("largura") || this.getAttribute("width"), i = this.getAttribute("altura") || this.getAttribute("height"), r = this.getAttribute("raio") || this.getAttribute("radius"), a = this.linhas;
|
|
375
|
+
this.rootElement.innerHTML = "";
|
|
376
|
+
const c = e === "pulso" ? "ui-skeleton--pulso" : e === "nenhum" ? "ui-skeleton--estatico" : "";
|
|
377
|
+
if (t === "card") {
|
|
378
|
+
const u = document.createElement("div");
|
|
379
|
+
u.className = "ui-skeleton ui-skeleton--card";
|
|
380
|
+
const p = document.createElement("div");
|
|
381
|
+
p.className = `ui-skeleton ui-skeleton__card-media ${c}`;
|
|
382
|
+
const d = document.createElement("div");
|
|
383
|
+
d.className = "ui-skeleton__card-header";
|
|
384
|
+
const f = document.createElement("div");
|
|
385
|
+
f.className = `ui-skeleton ui-skeleton__card-avatar ${c}`;
|
|
386
|
+
const w = document.createElement("div");
|
|
387
|
+
w.className = `ui-skeleton ui-skeleton__card-title ${c}`, d.appendChild(f), d.appendChild(w);
|
|
388
|
+
const v = document.createElement("div");
|
|
389
|
+
v.className = "ui-skeleton__linhas";
|
|
390
|
+
for (let y = 0; y < 2; y++) {
|
|
391
|
+
const k = document.createElement("div");
|
|
392
|
+
k.className = `ui-skeleton ui-skeleton--texto ${c}`, v.appendChild(k);
|
|
393
|
+
}
|
|
394
|
+
u.appendChild(p), u.appendChild(d), u.appendChild(v), this.rootElement.appendChild(u);
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
if (a > 1 && t === "texto") {
|
|
398
|
+
const u = document.createElement("div");
|
|
399
|
+
u.className = "ui-skeleton__linhas";
|
|
400
|
+
for (let p = 0; p < a; p++) {
|
|
401
|
+
const d = document.createElement("div");
|
|
402
|
+
d.className = `ui-skeleton ui-skeleton--texto ${c}`, i && (d.style.height = isNaN(Number(i)) ? i : `${i}px`), r && (d.style.borderRadius = isNaN(Number(r)) ? r : `${r}px`), u.appendChild(d);
|
|
403
|
+
}
|
|
404
|
+
o && (u.style.width = isNaN(Number(o)) ? o : `${o}px`), this.rootElement.appendChild(u);
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
const m = document.createElement("div");
|
|
408
|
+
m.className = `ui-skeleton ui-skeleton--${t} ${c}`.trim(), o && (m.style.width = isNaN(Number(o)) ? o : `${o}px`), i && (m.style.height = isNaN(Number(i)) ? i : `${i}px`), r && (m.style.borderRadius = isNaN(Number(r)) ? r : `${r}px`), this.rootElement.appendChild(m);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
class F extends A {
|
|
412
|
+
}
|
|
413
|
+
h("ui-skeleton", A);
|
|
414
|
+
h("ui-esqueleto", F);
|
|
415
|
+
export {
|
|
416
|
+
b as U,
|
|
417
|
+
F as a,
|
|
418
|
+
$ as b,
|
|
419
|
+
D as c,
|
|
420
|
+
P as d,
|
|
421
|
+
T as e,
|
|
422
|
+
A as f,
|
|
423
|
+
E as g,
|
|
424
|
+
M as h,
|
|
425
|
+
z as i,
|
|
426
|
+
q as j,
|
|
427
|
+
_ as o
|
|
428
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";var M=Object.defineProperty;var D=(n,l,t)=>l in n?M(n,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[l]=t;var s=(n,l,t)=>D(n,typeof l!="symbol"?l+"":l,t);const $=require("./listener-bag-D5omxZ9h.cjs"),d=require("./ssr-safe-CiHD1adl.cjs"),O=':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-drawer__backdrop{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#000000a6;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:calc(var(--ui-z-drawer, 700) - 1);opacity:0;pointer-events:none;transition:opacity .25s ease}:host([aberto]) .ui-drawer__backdrop,:host([open]) .ui-drawer__backdrop{opacity:1;pointer-events:auto}.ui-drawer__painel{position:fixed;z-index:var(--ui-z-drawer, 700);background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));box-shadow:var(--ui-sombra-lg, 0 16px 40px rgba(0, 0, 0, .7));display:flex;flex-direction:column;opacity:0;visibility:hidden;pointer-events:none;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .2s ease,visibility .2s ease;box-sizing:border-box;color:var(--ui-cor-texto, #e1e1e6)}:host(:not([posicao])) .ui-drawer__painel,:host([posicao="direita"]) .ui-drawer__painel,:host([position="right"]) .ui-drawer__painel{top:0;right:0;bottom:0;width:var(--ui-drawer-largura, 480px);max-width:92vw;height:100vh;transform:translate(100%);border-left:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16))}:host([aberto]:not([posicao])) .ui-drawer__painel,:host([open]:not([posicao])) .ui-drawer__painel,:host([aberto][posicao="direita"]) .ui-drawer__painel,:host([open][posicao="direita"]) .ui-drawer__painel,:host([aberto][position="right"]) .ui-drawer__painel,:host([open][position="right"]) .ui-drawer__painel{transform:translate(0);opacity:1;visibility:visible;pointer-events:auto}:host([posicao="esquerda"]) .ui-drawer__painel,:host([position="left"]) .ui-drawer__painel{top:0;left:0;bottom:0;width:var(--ui-drawer-largura, 480px);max-width:92vw;height:100vh;transform:translate(-100%);border-right:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16))}:host([aberto][posicao="esquerda"]) .ui-drawer__painel,:host([open][posicao="esquerda"]) .ui-drawer__painel,:host([aberto][position="left"]) .ui-drawer__painel,:host([open][position="left"]) .ui-drawer__painel{transform:translate(0);opacity:1;visibility:visible;pointer-events:auto}:host([posicao="baixo"]) .ui-drawer__painel,:host([position="bottom"]) .ui-drawer__painel{bottom:0;left:0;right:0;width:100vw;max-height:85vh;transform:translateY(100%);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-top-left-radius:14px;border-top-right-radius:14px}:host([aberto][posicao="baixo"]) .ui-drawer__painel,:host([open][posicao="baixo"]) .ui-drawer__painel,:host([aberto][position="bottom"]) .ui-drawer__painel,:host([open][position="bottom"]) .ui-drawer__painel{transform:translateY(0);opacity:1;visibility:visible;pointer-events:auto}:host([posicao="cima"]) .ui-drawer__painel,:host([position="top"]) .ui-drawer__painel{top:0;left:0;right:0;width:100vw;max-height:85vh;transform:translateY(-100%);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-bottom-left-radius:14px;border-bottom-right-radius:14px}:host([aberto][posicao="cima"]) .ui-drawer__painel,:host([open][posicao="cima"]) .ui-drawer__painel,:host([aberto][position="top"]) .ui-drawer__painel,:host([open][position="top"]) .ui-drawer__painel{transform:translateY(0);opacity:1;visibility:visible;pointer-events:auto}.ui-drawer__header{padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));flex-shrink:0}.ui-drawer__titulo-container{display:flex;flex-direction:column;gap:2px}.ui-drawer__titulo{margin:0;font-size:16px;font-weight:600;color:var(--ui-cor-texto, #ffffff)}.ui-drawer__descricao{margin:0;font-size:13px;color:var(--ui-cor-texto-secundario, #888899)}.ui-drawer__close{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-size:16px;cursor:pointer;padding:6px;border-radius:6px;line-height:1;display:flex;align-items:center;justify-content:center;transition:color .15s ease,background-color .15s ease}.ui-drawer__close svg,.ui-drawer__close ::slotted(svg){shape-rendering:geometricPrecision}.ui-drawer__close:hover{color:var(--ui-cor-texto, #ffffff);background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-drawer__close:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-primaria, #00E08A)}.ui-drawer__body{padding:20px;overflow-y:auto;flex:1;box-sizing:border-box}.ui-drawer__footer{padding:14px 20px;border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));display:flex;align-items:center;justify-content:flex-end;gap:10px;background-color:var(--ui-cor-fundo-recuado, rgba(0, 0, 0, .15));flex-shrink:0}@starting-style{:host([aberto]:not([posicao])) .ui-drawer__painel,:host([open]:not([posicao])) .ui-drawer__painel,:host([aberto][posicao="direita"]) .ui-drawer__painel,:host([open][posicao="direita"]) .ui-drawer__painel{transform:translate(100%);opacity:0}:host([aberto][posicao="esquerda"]) .ui-drawer__painel,:host([open][posicao="esquerda"]) .ui-drawer__painel{transform:translate(-100%);opacity:0}:host([aberto][posicao="baixo"]) .ui-drawer__painel,:host([open][posicao="baixo"]) .ui-drawer__painel{transform:translateY(100%);opacity:0}:host([aberto]) .ui-drawer__backdrop,:host([open]) .ui-drawer__backdrop{opacity:0}}',_='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), ui-campo-texto, ui-botao, ui-botao-primario, ui-checkbox, ui-switch, ui-lista-flutuante, ui-radio, ui-select, ui-segmented';function v(n,l){let t=Array.from(n.querySelectorAll(_));t=t.filter(i=>{try{return window.getComputedStyle(i).display!=="none"}catch{return!0}});const e=n.querySelectorAll("slot"),o=[];return e.forEach(i=>{i.assignedElements({flatten:!0}).forEach(a=>{a instanceof HTMLElement&&(a.matches(_)&&o.push(a),o.push(...Array.from(a.querySelectorAll(_))))})}),[...t,...o].filter(i=>!i.hasAttribute("disabled")&&i.getAttribute("aria-hidden")!=="true")}function A(n){if(typeof document>"u")return!0;const l=Array.from(document.querySelectorAll("ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]"));return l[l.length-1]===n}function C(n,l,t,e){if(l.length===0){n.preventDefault();return}const o=l[0],i=l[l.length-1],r=t.getRootNode(),a=r==null?void 0:r.activeElement;n.shiftKey?(a===o||!t.contains(a)&&!e.contains(a))&&(n.preventDefault(),i.focus()):(a===i||!t.contains(a)&&!e.contains(a))&&(n.preventDefault(),o.focus())}function S(){if(typeof document>"u")return;document.querySelectorAll("ui-modal[aberto], ui-modal[open], ui-dialog[aberto], ui-dialog[open], ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]").length>0?document.body.style.overflow="hidden":document.body.style.overflow=""}class p extends d.SafeHTMLElement{constructor(){super();s(this,"backdropElement");s(this,"painelElement");s(this,"tituloElement");s(this,"descricaoElement");s(this,"closeElement");s(this,"listeners",new $.ListenerBag);s(this,"_elementoGatilho",null);s(this,"_focables",[]);s(this,"handleSlotChange",()=>{this.syncState()});s(this,"handleBackdropClick",t=>{t.stopPropagation(),this.hasAttribute("estatico")||this.hasAttribute("static")||this.fechar()});s(this,"handleCloseClick",t=>{t.stopPropagation(),this.fechar()});s(this,"handleKeyDown",t=>{this.aberto&&A(this)&&(t.key==="Escape"?this.hasAttribute("estatico")||this.hasAttribute("static")||(this.fechar(),t.stopImmediatePropagation()):t.key==="Tab"&&(this._focables=v(this.shadowRoot),C(t,this._focables,this,this.shadowRoot)))});const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
2
|
+
<style>${O}</style>
|
|
3
|
+
<div class="ui-drawer__backdrop" part="fundo"></div>
|
|
4
|
+
<aside class="ui-drawer__painel" part="painel" role="dialog" aria-modal="true" tabindex="-1">
|
|
5
|
+
<div class="ui-drawer__header" part="cabecalho">
|
|
6
|
+
<div class="ui-drawer__titulo-container">
|
|
7
|
+
<h3 class="ui-drawer__titulo" part="titulo"></h3>
|
|
8
|
+
<p class="ui-drawer__descricao" part="descricao" style="display: none;"></p>
|
|
9
|
+
</div>
|
|
10
|
+
<button type="button" class="ui-drawer__close" part="fechar" aria-label="Fechar painel lateral" title="Fechar">✕</button>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="ui-drawer__body" part="corpo">
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="ui-drawer__footer" part="rodape">
|
|
16
|
+
<slot name="rodape"></slot>
|
|
17
|
+
<slot name="footer"></slot>
|
|
18
|
+
</div>
|
|
19
|
+
</aside>
|
|
20
|
+
`,this.backdropElement=t.querySelector(".ui-drawer__backdrop"),this.painelElement=t.querySelector(".ui-drawer__painel"),this.tituloElement=t.querySelector(".ui-drawer__titulo"),this.descricaoElement=t.querySelector(".ui-drawer__descricao"),this.closeElement=t.querySelector(".ui-drawer__close")}static get observedAttributes(){return["aberto","open","posicao","position","titulo","title","descricao","description","largura","width","estatico","static"]}connectedCallback(){this.listeners.cleanup(),this.listeners.add(this.backdropElement,"click",this.handleBackdropClick),this.listeners.add(this.closeElement,"click",this.handleCloseClick),this.listeners.add(window,"keydown",this.handleKeyDown),this.shadowRoot.querySelectorAll("slot").forEach(e=>{this.listeners.add(e,"slotchange",this.handleSlotChange)}),this.syncState()}disconnectedCallback(){this.listeners.cleanup(),p.atualizarScrollLock()}attributeChangedCallback(t,e,o){(t==="aberto"||t==="open")&&o!==null&&(document.activeElement&&document.activeElement!==document.body&&(this._elementoGatilho=document.activeElement),setTimeout(()=>{this._focables=v(this.shadowRoot),this._focables.length>0?this._focables[0].focus():this.painelElement.focus()},0)),this.syncState()}get aberto(){return this.hasAttribute("aberto")||this.hasAttribute("open")}set aberto(t){t?this.setAttribute("aberto",""):(this.removeAttribute("aberto"),this.removeAttribute("open")),this.syncState()}get posicao(){const t=(this.getAttribute("posicao")||this.getAttribute("position")||"direita").toLowerCase();return t==="esquerda"||t==="left"?"esquerda":t==="baixo"||t==="bottom"?"baixo":t==="cima"||t==="top"?"cima":"direita"}set posicao(t){this.setAttribute("posicao",t)}abrir(){this.aberto||(document.activeElement&&document.activeElement!==document.body&&(this._elementoGatilho=document.activeElement),this.aberto=!0,this.dispatchEvent(new CustomEvent("ui-abrir",{bubbles:!0,composed:!0})),setTimeout(()=>{this._focables=v(this.shadowRoot),this._focables.length>0?this._focables[0].focus():this.painelElement.focus()},0))}fechar(){this.aberto&&(this.aberto=!1,this.dispatchEvent(new CustomEvent("ui-fechar",{bubbles:!0,composed:!0})),this._elementoGatilho&&(this._elementoGatilho.focus(),this._elementoGatilho=null))}alternar(){this.aberto?this.fechar():this.abrir()}syncState(){var a,c;const t=this.aberto,e=this.getAttribute("titulo")||this.getAttribute("title")||"",o=this.getAttribute("descricao")||this.getAttribute("description")||"",i=this.getAttribute("largura")||this.getAttribute("width"),r=(a=this.shadowRoot)==null?void 0:a.querySelector(".ui-drawer__footer");if(this.painelElement.setAttribute("aria-hidden",String(!t)),e?(this.tituloElement.textContent=e,this.tituloElement.style.display="block"):this.tituloElement.style.display="none",o?(this.descricaoElement.textContent=o,this.descricaoElement.style.display="block"):this.descricaoElement.style.display="none",i?this.style.setProperty("--ui-drawer-largura",isNaN(Number(i))?i:`${i}px`):this.style.removeProperty("--ui-drawer-largura"),r){const u=Array.from(((c=this.shadowRoot)==null?void 0:c.querySelectorAll('slot[name="rodape"], slot[name="footer"]'))||[]).some(b=>b.assignedNodes({flatten:!0}).some(f=>f.nodeType===Node.ELEMENT_NODE||f.textContent&&f.textContent.trim()!==""))||this.querySelector('[slot="rodape"], [slot="footer"]')!==null;r.style.display=u?"flex":"none"}p.atualizarScrollLock()}static atualizarScrollLock(){S()}}class L extends p{}class q extends p{}class N extends p{}d.definirCustomElement("ui-drawer",p);d.definirCustomElement("ui-sheet",L);d.definirCustomElement("ui-painel-lateral",q);d.definirCustomElement("ui-gaveta",N);const P=":host{display:inline-flex;position:relative;align-items:center;justify-content:center;vertical-align:middle;box-sizing:border-box;--ui-tooltip-texto-distancia: 260px;--ui-tooltip-seta-espaco: 70px}.ui-tooltip__bubble{position:fixed;z-index:var(--ui-z-tooltip, 1200);padding:6px 10px;border-radius:6px;font-size:11px;font-weight:500;background-color:var(--ui-cor-fundo-elevado, #1e1e24);color:var(--ui-cor-texto, #e1e1e6);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));box-shadow:var(--ui-sombra-md, 0 4px 16px rgba(0, 0, 0, .5));white-space:normal;max-width:var(--ui-tooltip-texto-distancia, 260px);width:max-content;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .15s ease,visibility .15s ease;line-height:1.35;box-sizing:border-box;-webkit-user-select:none;user-select:none;margin:0}.ui-tooltip__bubble[popover]{margin:0;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));background-color:var(--ui-cor-fundo-elevado, #1e1e24);color:var(--ui-cor-texto, #e1e1e6);padding:6px 10px;overflow:visible;max-width:var(--ui-tooltip-texto-distancia, 260px);width:max-content;white-space:normal}.ui-tooltip__texto{display:inline-block;max-width:100%}.ui-tooltip__arrow{position:absolute;width:0;height:0;border-style:solid}.ui-tooltip--topo .ui-tooltip__arrow{bottom:-5px;left:50%;transform:translate(-50%);border-width:5px 5px 0 5px;border-color:var(--ui-cor-fundo-elevado, #1e1e24) transparent transparent transparent}.ui-tooltip--baixo .ui-tooltip__arrow{top:-5px;left:50%;transform:translate(-50%);border-width:0 5px 5px 5px;border-color:transparent transparent var(--ui-cor-fundo-elevado, #1e1e24) transparent}.ui-tooltip--esquerda .ui-tooltip__arrow{right:-5px;top:50%;transform:translateY(-50%);border-width:5px 0 5px 5px;border-color:transparent transparent transparent var(--ui-cor-fundo-elevado, #1e1e24)}.ui-tooltip--direita .ui-tooltip__arrow{left:-5px;top:50%;transform:translateY(-50%);border-width:5px 5px 5px 0;border-color:transparent var(--ui-cor-fundo-elevado, #1e1e24) transparent transparent}.ui-tooltip--visivel .ui-tooltip__bubble{opacity:1;visibility:visible;pointer-events:auto;transform:scale(1)}@starting-style{.ui-tooltip--visivel .ui-tooltip__bubble,.ui-tooltip__bubble:popover-open{opacity:0;transform:scale(.94)}}",I=120;class x extends d.SafeHTMLElement{constructor(){super();s(this,"containerElement");s(this,"bubbleElement");s(this,"_posicionamentoAtivo",!1);s(this,"_timerOcultar",null);s(this,"_gatilhoDescrito",null);s(this,"posicionarBubble",()=>{if(!this.aberto)return;const t=this.getBoundingClientRect(),e=this.bubbleElement.getBoundingClientRect(),o=this.getAttribute("posicao")||this.getAttribute("position")||"topo";let i="topo";["topo","top"].includes(o)?i="topo":["baixo","bottom"].includes(o)?i="baixo":["esquerda","left"].includes(o)?i="esquerda":["direita","right"].includes(o)&&(i="direita");let r=0,a=0;const c=8;i==="topo"?(r=t.top-e.height-c,a=t.left+t.width/2-e.width/2):i==="baixo"?(r=t.bottom+c,a=t.left+t.width/2-e.width/2):i==="esquerda"?(r=t.top+t.height/2-e.height/2,a=t.left-e.width-c):i==="direita"&&(r=t.top+t.height/2-e.height/2,a=t.right+c),a=Math.max(8,Math.min(a,window.innerWidth-e.width-8)),r=Math.max(8,Math.min(r,window.innerHeight-e.height-8)),this.bubbleElement.style.top=`${Math.round(r)}px`,this.bubbleElement.style.left=`${Math.round(a)}px`});s(this,"handleMouseEnter",()=>{const t=this.getAttribute("gatilho")||this.getAttribute("trigger")||"hover";(t==="hover"||t==="passar-mouse")&&(this.cancelarOcultar(),this.mostrar())});s(this,"handleMouseLeave",()=>{const t=this.getAttribute("gatilho")||this.getAttribute("trigger")||"hover";(t==="hover"||t==="passar-mouse")&&(this.cancelarOcultar(),this._timerOcultar=setTimeout(()=>{this._timerOcultar=null,this.ocultar()},I))});s(this,"handleEscape",t=>{t.key!=="Escape"||!this.aberto||(t.stopPropagation(),this.cancelarOcultar(),this.ocultar())});s(this,"handleClick",t=>{const e=this.getAttribute("gatilho")||this.getAttribute("trigger")||"hover",o=window.matchMedia("(pointer: coarse)").matches;(e==="clique"||e==="click"||o)&&(t.stopPropagation(),this.aberto=!this.aberto)});s(this,"handleClickOutside",t=>{t.composedPath().includes(this)||this.ocultar()});const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
21
|
+
<style>${P}</style>
|
|
22
|
+
<div class="ui-tooltip ui-tooltip--topo">
|
|
23
|
+
<slot></slot>
|
|
24
|
+
<div class="ui-tooltip__bubble" part="balao" role="tooltip" popover="manual">
|
|
25
|
+
<span class="ui-tooltip__texto" part="texto"></span>
|
|
26
|
+
<slot name="conteudo"></slot>
|
|
27
|
+
<span class="ui-tooltip__arrow" part="seta"></span>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
`,this.containerElement=t.querySelector(".ui-tooltip"),this.bubbleElement=t.querySelector(".ui-tooltip__bubble"),t.querySelectorAll("slot").forEach(e=>e.addEventListener("slotchange",()=>this.sincronizarDescricao()))}static get observedAttributes(){return["texto","text","posicao","position","gatilho","trigger","aberto","open","disabled"]}connectedCallback(){this.addEventListener("mouseenter",this.handleMouseEnter),this.addEventListener("mouseleave",this.handleMouseLeave),this.addEventListener("focusin",this.handleMouseEnter),this.addEventListener("focusout",this.handleMouseLeave),this.addEventListener("click",this.handleClick),this.syncState()}disconnectedCallback(){this.removeEventListener("mouseenter",this.handleMouseEnter),this.removeEventListener("mouseleave",this.handleMouseLeave),this.removeEventListener("focusin",this.handleMouseEnter),this.removeEventListener("focusout",this.handleMouseLeave),this.removeEventListener("click",this.handleClick),document.removeEventListener("click",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscape,!0),this.cancelarOcultar(),this.removerDescricao(),this._posicionamentoAtivo&&(this._posicionamentoAtivo=!1,window.removeEventListener("scroll",this.posicionarBubble,{capture:!0}),window.removeEventListener("resize",this.posicionarBubble)),this.ocultar()}attributeChangedCallback(t,e,o){this.syncState()}get aberto(){return this.hasAttribute("aberto")||this.hasAttribute("open")}set aberto(t){t?this.setAttribute("aberto",""):(this.removeAttribute("aberto"),this.removeAttribute("open")),this.syncState()}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this.syncState()}mostrar(){this.disabled||(this.aberto=!0)}ocultar(){this.aberto=!1}syncState(){var a;const t=this.aberto,e=this.getAttribute("posicao")||this.getAttribute("position")||"topo",o=this.getAttribute("texto")||this.getAttribute("text")||"",i=(a=this.shadowRoot)==null?void 0:a.querySelector(".ui-tooltip__texto");let r="topo";if(["topo","top"].includes(e)?r="topo":["baixo","bottom"].includes(e)?r="baixo":["esquerda","left"].includes(e)?r="esquerda":["direita","right"].includes(e)&&(r="direita"),this.containerElement.className=`ui-tooltip ui-tooltip--${r}`,i&&(o?(i.textContent=o,i.style.display="inline"):i.style.display="none"),this.sincronizarDescricao(),t){if(document.addEventListener("click",this.handleClickOutside),document.addEventListener("keydown",this.handleEscape,!0),typeof this.bubbleElement.showPopover=="function")try{this.bubbleElement.showPopover()}catch{}this.containerElement.classList.add("ui-tooltip--visivel"),requestAnimationFrame(()=>{this.posicionarBubble()}),this._posicionamentoAtivo||(this._posicionamentoAtivo=!0,window.addEventListener("scroll",this.posicionarBubble,{capture:!0,passive:!0}),window.addEventListener("resize",this.posicionarBubble,{passive:!0}))}else{if(document.removeEventListener("click",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscape,!0),typeof this.bubbleElement.hidePopover=="function")try{this.bubbleElement.hidePopover()}catch{}this.containerElement.classList.remove("ui-tooltip--visivel"),this._posicionamentoAtivo&&(this._posicionamentoAtivo=!1,window.removeEventListener("scroll",this.posicionarBubble,{capture:!0}),window.removeEventListener("resize",this.posicionarBubble))}}cancelarOcultar(){this._timerOcultar&&(clearTimeout(this._timerOcultar),this._timerOcultar=null)}sincronizarDescricao(){var i;if(!this.isConnected){this.removerDescricao();return}const t=Array.from(this.children).find(r=>!r.hasAttribute("slot")),e=(this.getAttribute("texto")||this.getAttribute("text")||((i=this.querySelector('[slot="conteudo"]'))==null?void 0:i.textContent)||"").replace(/\s+/g," ").trim();this._gatilhoDescrito&&this._gatilhoDescrito!==t&&this.removerDescricao(),!(!t||this._gatilhoDescrito!==t&&(t.hasAttribute("aria-describedby")||t.hasAttribute("aria-description")))&&(e&&!this.disabled?(t.setAttribute("aria-description",e),this._gatilhoDescrito=t):this.removerDescricao())}removerDescricao(){var t;(t=this._gatilhoDescrito)==null||t.removeAttribute("aria-description"),this._gatilhoDescrito=null}}class z extends x{}d.definirCustomElement("ui-tooltip",x);d.definirCustomElement("ui-popover",z);const R=":host{display:block;box-sizing:border-box}:host([inline]){display:inline-block}.ui-skeleton{background:var(--ui-cor-fundo-elevado, #1e1e24);background-image:linear-gradient(90deg,#fff0,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent),#fff0);background-size:200% 100%;background-repeat:no-repeat;border-radius:var(--ui-raio-borda, 6px);position:relative;overflow:hidden;box-sizing:border-box;animation:ui-skeleton-shimmer 1.6s ease-in-out infinite}@keyframes ui-skeleton-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.ui-skeleton--pulso{background-image:none;animation:ui-skeleton-pulse 1.8s ease-in-out infinite}@keyframes ui-skeleton-pulse{0%,to{opacity:1}50%{opacity:.45}}.ui-skeleton--estatico{animation:none;background-image:none}.ui-skeleton--texto{height:1.1em;border-radius:var(--ui-raio-sm, 4px)}.ui-skeleton--circular{border-radius:50%!important;aspect-ratio:1;width:var(--ui-skeleton-largura, 40px);height:var(--ui-skeleton-altura, 40px)}.ui-skeleton--retangular{border-radius:var(--ui-raio-borda, 6px);min-height:20px}.ui-skeleton__linhas{display:flex;flex-direction:column;gap:8px;width:100%}.ui-skeleton__linhas .ui-skeleton{width:100%}.ui-skeleton__linhas .ui-skeleton:last-child:not(:first-child){width:65%}.ui-skeleton--card{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:var(--ui-raio-borda, 10px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));background:var(--ui-cor-fundo-card, #18181c);animation:none}.ui-skeleton__card-media{width:100%;height:120px;border-radius:6px}.ui-skeleton__card-header{display:flex;align-items:center;gap:10px}.ui-skeleton__card-avatar{width:36px;height:36px;border-radius:50%;flex-shrink:0}.ui-skeleton__card-title{width:50%;height:16px}@media (prefers-reduced-motion: reduce){.ui-skeleton{animation:none!important;background-image:none!important;opacity:.7}}";class w extends d.SafeHTMLElement{constructor(){super();s(this,"rootElement");const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
31
|
+
<style>${R}</style>
|
|
32
|
+
<div class="ui-skeleton-container" role="status" aria-label="Carregando..."></div>
|
|
33
|
+
`,this.rootElement=t.querySelector(".ui-skeleton-container")}static get observedAttributes(){return["variante","variant","largura","width","altura","height","raio","radius","linhas","lines","count","animado","animated"]}connectedCallback(){this.hasAttribute("aria-hidden")||this.setAttribute("aria-hidden","true"),this.syncState()}attributeChangedCallback(t,e,o){this.syncState()}get variante(){const t=(this.getAttribute("variante")||this.getAttribute("variant")||"texto").toLowerCase();return t==="circulo"||t==="circular"?"circular":t==="retangulo"||t==="retangular"?"retangular":t==="card"?"card":"texto"}set variante(t){this.setAttribute("variante",t)}get animado(){const t=(this.getAttribute("animado")||this.getAttribute("animated")||"shimmer").toLowerCase();return t==="pulse"||t==="pulso"?"pulso":t==="none"||t==="nenhum"||t==="estatico"?"nenhum":"shimmer"}set animado(t){this.setAttribute("animado",t)}get linhas(){const t=parseInt(this.getAttribute("linhas")||this.getAttribute("lines")||this.getAttribute("count")||"1",10);return isNaN(t)||t<1?1:t}set linhas(t){this.setAttribute("linhas",String(t))}syncState(){const t=this.variante,e=this.animado,o=this.getAttribute("largura")||this.getAttribute("width"),i=this.getAttribute("altura")||this.getAttribute("height"),r=this.getAttribute("raio")||this.getAttribute("radius"),a=this.linhas;this.rootElement.innerHTML="";const c=e==="pulso"?"ui-skeleton--pulso":e==="nenhum"?"ui-skeleton--estatico":"";if(t==="card"){const u=document.createElement("div");u.className="ui-skeleton ui-skeleton--card";const b=document.createElement("div");b.className=`ui-skeleton ui-skeleton__card-media ${c}`;const h=document.createElement("div");h.className="ui-skeleton__card-header";const f=document.createElement("div");f.className=`ui-skeleton ui-skeleton__card-avatar ${c}`;const y=document.createElement("div");y.className=`ui-skeleton ui-skeleton__card-title ${c}`,h.appendChild(f),h.appendChild(y);const g=document.createElement("div");g.className="ui-skeleton__linhas";for(let E=0;E<2;E++){const k=document.createElement("div");k.className=`ui-skeleton ui-skeleton--texto ${c}`,g.appendChild(k)}u.appendChild(b),u.appendChild(h),u.appendChild(g),this.rootElement.appendChild(u);return}if(a>1&&t==="texto"){const u=document.createElement("div");u.className="ui-skeleton__linhas";for(let b=0;b<a;b++){const h=document.createElement("div");h.className=`ui-skeleton ui-skeleton--texto ${c}`,i&&(h.style.height=isNaN(Number(i))?i:`${i}px`),r&&(h.style.borderRadius=isNaN(Number(r))?r:`${r}px`),u.appendChild(h)}o&&(u.style.width=isNaN(Number(o))?o:`${o}px`),this.rootElement.appendChild(u);return}const m=document.createElement("div");m.className=`ui-skeleton ui-skeleton--${t} ${c}`.trim(),o&&(m.style.width=isNaN(Number(o))?o:`${o}px`),i&&(m.style.height=isNaN(Number(i))?i:`${i}px`),r&&(m.style.borderRadius=isNaN(Number(r))?r:`${r}px`),this.rootElement.appendChild(m)}}class T extends w{}d.definirCustomElement("ui-skeleton",w);d.definirCustomElement("ui-esqueleto",T);exports.UIDrawer=p;exports.UIEsqueleto=T;exports.UIGaveta=N;exports.UIPainelLateral=q;exports.UIPopover=z;exports.UISheet=L;exports.UISkeleton=w;exports.UITooltip=x;exports.atualizarScrollLockDrawer=S;exports.gerenciarTabTrap=C;exports.isTopMostDrawer=A;exports.obterElementosFocaveis=v;
|