@thibezer/ui-components-kit 2.17.0 → 2.17.2
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 +23 -0
- package/dist/camadas.cjs +85 -86
- package/dist/camadas.js +1380 -1331
- package/dist/components/ui-camadas/camadas-colecao.d.ts +3 -0
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +3 -1
- package/dist/components/ui-camadas/camadas-selecao-api.d.ts +1 -0
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +2 -2
- package/dist/custom-elements.json +19922 -19922
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/register.cjs +1 -1
- package/dist/register.js +2 -2
- package/dist/{ui-controle-cores-Bq_XUrIQ.cjs → ui-controle-cores-B1w_Yl69.cjs} +1 -1
- package/dist/{ui-controle-cores-BtA6yzu3.js → ui-controle-cores-BRjMvmMn.js} +1 -1
- package/dist/ui-seletor-cor-CMuuW-Ym.cjs +83 -0
- package/dist/ui-seletor-cor-DFIQ1sin.js +405 -0
- package/package.json +1 -1
- package/dist/form-validacao-BIOXxt-1.js +0 -140
- package/dist/form-validacao-ytRYSF3E.cjs +0 -1
- package/dist/gerencigeo-canvas/layer_defaults.d.ts +0 -3
- package/dist/gerencigeo-canvas/layer_instance_ops.d.ts +0 -6
- package/dist/gerencigeo-canvas/layer_state_ops.d.ts +0 -6
- package/dist/leaflet-DcO7uRC-.cjs +0 -1
- package/dist/leaflet-PPDKB6Dd.js +0 -69
- package/dist/motor-BCWqlv3e.cjs +0 -1
- package/dist/motor-CXjQjVba.js +0 -1386
- package/dist/svg-seguro-BsbNQqpd.js +0 -50
- package/dist/svg-seguro-C76iLlAZ.cjs +0 -1
- package/dist/ui-badge-1UU8vT-b.js +0 -198
- package/dist/ui-badge-B5J_c5P5.js +0 -197
- package/dist/ui-badge-BxT-sDmV.cjs +0 -28
- package/dist/ui-badge-C0eKBI8E.js +0 -183
- package/dist/ui-badge-CKKKPdt8.cjs +0 -28
- package/dist/ui-badge-DC4y6Dik.cjs +0 -28
- package/dist/ui-botao-BOOnP8ds.cjs +0 -12
- package/dist/ui-botao-D24oXySA.cjs +0 -12
- package/dist/ui-botao-DfqSivHl.js +0 -165
- package/dist/ui-botao-Dsj08jjw.js +0 -165
- package/dist/ui-botao-OGJV6Vfk.js +0 -165
- package/dist/ui-botao-bU_bf6SU.js +0 -166
- package/dist/ui-botao-psS1juof.cjs +0 -12
- package/dist/ui-botao-xTbH5mpH.cjs +0 -12
- package/dist/ui-campo-texto-19tIrmBK.js +0 -377
- package/dist/ui-campo-texto-CH8mzX61.cjs +0 -16
- package/dist/ui-campo-texto-Cnn2UAkS.cjs +0 -16
- package/dist/ui-campo-texto-DVU_sWV1.cjs +0 -16
- package/dist/ui-campo-texto-Uu2dJE_0.js +0 -379
- package/dist/ui-campo-texto-W5M0gNE4.js +0 -377
- package/dist/ui-card-0wu4rjEX.cjs +0 -20
- package/dist/ui-card-B86lJXTP.cjs +0 -20
- package/dist/ui-card-BYyYxxY1.cjs +0 -20
- package/dist/ui-card-C_o5_0cB.js +0 -111
- package/dist/ui-card-CojoGXaT.js +0 -144
- package/dist/ui-card-DRtpOo3l.js +0 -143
- package/dist/ui-controle-cores-B4R6ct4I.js +0 -291
- package/dist/ui-controle-cores-BS0WYPdi.js +0 -572
- package/dist/ui-controle-cores-C8um-If9.cjs +0 -32
- package/dist/ui-controle-cores-CHMKGemo.cjs +0 -141
- package/dist/ui-controle-cores-C_cVXxCn.js +0 -291
- package/dist/ui-controle-cores-CuDFS8Y8.cjs +0 -32
- package/dist/ui-controle-cores-Dog7ERYv.js +0 -697
- package/dist/ui-controle-cores-Er6ZcQ7U.cjs +0 -111
- package/dist/ui-linha-BxhEBn27.js +0 -749
- package/dist/ui-linha-C306zxWG.cjs +0 -19
- package/dist/ui-linha-C_azWkcG.js +0 -517
- package/dist/ui-linha-CcalUBDw.cjs +0 -38
- package/dist/ui-linha-DAz6DBcl.cjs +0 -38
- package/dist/ui-linha-DkxwMhD-.js +0 -749
- package/dist/ui-modal-4nU-tXjO.cjs +0 -18
- package/dist/ui-modal-BkYvNP0G.js +0 -214
- package/dist/ui-modal-BwB9fksp.js +0 -214
- package/dist/ui-modal-CUNbpbZ1.cjs +0 -18
- package/dist/ui-modal-CvGFGh1h.cjs +0 -18
- package/dist/ui-modal-DBOtSTbR.js +0 -238
- package/dist/ui-paleta-ferramentas-BXXrI1Y7.js +0 -1233
- package/dist/ui-paleta-ferramentas-CEZYcN4J.js +0 -624
- package/dist/ui-paleta-ferramentas-CU4icLl0.js +0 -1171
- package/dist/ui-paleta-ferramentas-Ccmo-rB5.cjs +0 -21
- package/dist/ui-paleta-ferramentas-CsPMTY0G.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DLwZHIDv.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DNN5i6nL.js +0 -860
- package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +0 -18
- package/dist/ui-paleta-ferramentas-DbwdWVtT.js +0 -1173
- package/dist/ui-paleta-ferramentas-bvqxj1Yd.cjs +0 -21
- package/dist/ui-segmented-D6b6zxVs.cjs +0 -19
- package/dist/ui-segmented-DyF5YLsV.js +0 -418
- package/dist/ui-segmented-rn9RxRGM.cjs +0 -19
- package/dist/ui-segmented-wUraId2e.js +0 -412
- package/dist/ui-seletor-cor-C4U2eqxY.cjs +0 -82
- package/dist/ui-seletor-cor-D2_C6Aor.js +0 -391
- package/dist/ui-seletor-cor-DPKqf5wb.cjs +0 -82
- package/dist/ui-seletor-cor-FYtRccnK.js +0 -396
- package/dist/ui-skeleton-B2Rgrv8o.js +0 -648
- package/dist/ui-skeleton-DEHwpDqa.js +0 -648
- package/dist/ui-skeleton-DI4_9WOX.js +0 -428
- package/dist/ui-skeleton-DiOxTBZK.cjs +0 -52
- package/dist/ui-skeleton-SPYqku8P.cjs +0 -52
- package/dist/ui-skeleton-W9uwIceA.js +0 -585
- package/dist/ui-skeleton-elhKIh2B.cjs +0 -33
- package/dist/ui-skeleton-sIphhOSx.cjs +0 -52
- package/dist/ui-switch-BL-x_-SM.js +0 -1202
- package/dist/ui-switch-BcOqOkiV.js +0 -856
- package/dist/ui-switch-C0i_3QXu.cjs +0 -66
- package/dist/ui-switch-D7iPKDj-.cjs +0 -53
- package/dist/ui-switch-DAIgOhqr.cjs +0 -66
- package/dist/ui-switch-_F8yubdX.js +0 -1203
- package/dist/ui-tabela-propriedades-2bq2nX-b.js +0 -3202
- package/dist/ui-tabela-propriedades-8IAYmk3P.cjs +0 -142
- package/dist/ui-tabela-propriedades-B8AwlpqL.cjs +0 -141
- package/dist/ui-tabela-propriedades-BBr5sqki.cjs +0 -145
- package/dist/ui-tabela-propriedades-BecPqC-e.cjs +0 -141
- package/dist/ui-tabela-propriedades-BoYXzP5Z.js +0 -3191
- package/dist/ui-tabela-propriedades-BokvDD3b.js +0 -2648
- package/dist/ui-tabela-propriedades-Boy7I5yW.js +0 -2412
- package/dist/ui-tabela-propriedades-C-PeuW1i.cjs +0 -141
- package/dist/ui-tabela-propriedades-C5YYnod1.js +0 -3053
- package/dist/ui-tabela-propriedades-CnfW9DZG.cjs +0 -142
- package/dist/ui-tabela-propriedades-CyPyKXtB.js +0 -3013
- package/dist/ui-tabela-propriedades-DWOKznMN.cjs +0 -142
- package/dist/ui-tabela-propriedades-Df9ajC6M.js +0 -2648
- package/dist/ui-tabela-propriedades-DqvPilK_.cjs +0 -142
- package/dist/ui-tabela-propriedades-DuaC4sFX.js +0 -2767
- package/dist/ui-toast-Bp_NlM5G.js +0 -156
- package/dist/ui-toast-DGTZKne5.cjs +0 -20
- package/dist/zero-js-triggers-C_KrvFOQ.js +0 -244
- package/dist/zero-js-triggers-C_gtaojZ.cjs +0 -1
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
var d = Object.defineProperty;
|
|
2
|
-
var p = (i, a, t) => a in i ? d(i, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[a] = t;
|
|
3
|
-
var r = (i, a, t) => p(i, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
-
import { L as h } from "./listener-bag-DQgv7OON.js";
|
|
5
|
-
import { d as c, S as b } from "./ssr-safe-5cWfJP-s.js";
|
|
6
|
-
const f = ':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-alerta{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-radius:var(--ui-raio-borda, 8px);border:1px solid transparent;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box;position:relative;transition:opacity .2s ease,transform .2s ease;line-height:1.4}.ui-alerta__icone{display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:2px;line-height:1}.ui-alerta__icone svg,.ui-alerta__icone ::slotted(svg),.ui-alerta__icone ::slotted(ui-icone){shape-rendering:geometricPrecision}.ui-alerta__conteudo{flex:1}.ui-alerta__titulo{font-size:14px;font-weight:600;margin:0 0 2px;line-height:1.2}.ui-alerta__mensagem{font-size:13px;margin:0;opacity:.9}.ui-alerta__close{background:transparent;border:none;color:currentColor;opacity:.7;font-size:14px;cursor:pointer;padding:2px 6px;border-radius:var(--ui-raio-sm, 4px);line-height:1;flex-shrink:0;margin-top:-2px;margin-right:-4px;transition:opacity .15s ease,background-color .15s ease}.ui-alerta__close:hover{opacity:1;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 15%,transparent)}.ui-alerta--sucesso{background-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 30%,transparent);color:var(--ui-cor-texto-sucesso, #00E08A)}.ui-alerta--sucesso .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--erro{background-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 30%,transparent);color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta--erro .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--alerta{background-color:color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 30%,transparent);color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-alerta--alerta .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--info{background-color:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 30%,transparent);color:var(--ui-cor-texto-info, #33b5ff)}.ui-alerta--info .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta__acoes{display:flex;align-items:center;flex-shrink:0;margin-left:4px}.ui-alerta__botao-acao{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 16%,transparent);color:inherit;font-family:inherit;font-size:12px;font-weight:600;padding:4px 10px;border-radius:5px;cursor:pointer;line-height:1;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;transition:background-color .15s ease,border-color .15s ease,transform .1s ease}.ui-alerta__botao-acao:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent)}.ui-alerta__botao-acao:active{transform:scale(.96)}.ui-alerta__botao-acao: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-alerta__botao-acao--primario{background:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 15%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 35%,transparent);color:var(--ui-cor-primaria, #00E08A)}.ui-alerta__botao-acao--primario:hover{background:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 25%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 50%,transparent)}.ui-alerta__botao-acao--destrutivo{background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 15%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 35%,transparent);color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta__botao-acao--destrutivo:hover{background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 25%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 50%,transparent)}:host(ui-toast){display:block;width:100%;box-sizing:border-box;pointer-events:auto;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .25s ease}.ui-toast__banner{box-shadow:var(--ui-sombra-lg, 0 10px 30px rgba(0, 0, 0, .3)),0 0 0 1px var(--ui-cor-borda, rgba(255, 255, 255, .1));animation:ui-toast-slide .3s cubic-bezier(.16,1,.3,1);position:relative;overflow:hidden;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}.ui-toast__banner.ui-alerta--sucesso{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-sucesso, #00E08A) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 40%,transparent)}.ui-toast__banner.ui-alerta--erro{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-erro, #ff5555) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 40%,transparent)}.ui-toast__banner.ui-alerta--alerta{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-alerta, #ffb86c) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 40%,transparent)}.ui-toast__banner.ui-alerta--info{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-info, #33b5ff) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 40%,transparent)}.ui-toast__progresso{position:absolute;bottom:0;left:0;right:0;height:2px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);overflow:hidden}.ui-toast__progresso-barra{width:100%;height:100%;background:currentColor;opacity:.7;transform-origin:left;animation:ui-toast-timer linear forwards}:host(ui-toast:hover) .ui-toast__progresso-barra,:host(ui-toast:focus-within) .ui-toast__progresso-barra{animation-play-state:paused}@keyframes ui-toast-timer{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@keyframes ui-toast-slide{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@starting-style{:host(ui-toast){opacity:0;transform:translateY(12px) scale(.96)}}', l = {
|
|
7
|
-
sucesso: '<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg>',
|
|
8
|
-
erro: '<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>',
|
|
9
|
-
alerta: '<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>',
|
|
10
|
-
info: '<svg viewBox="0 0 24 24" width="20" height="20" 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="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>'
|
|
11
|
-
};
|
|
12
|
-
class u extends b {
|
|
13
|
-
constructor() {
|
|
14
|
-
super();
|
|
15
|
-
r(this, "alertaElement");
|
|
16
|
-
r(this, "iconeElement");
|
|
17
|
-
r(this, "tituloElement");
|
|
18
|
-
r(this, "mensagemElement");
|
|
19
|
-
r(this, "mensagemTextoElement");
|
|
20
|
-
r(this, "closeElement");
|
|
21
|
-
r(this, "acoesElement");
|
|
22
|
-
r(this, "botaoAcaoElement");
|
|
23
|
-
r(this, "progressoContainer");
|
|
24
|
-
r(this, "progressoBarra");
|
|
25
|
-
r(this, "listeners", new h());
|
|
26
|
-
const t = this.attachShadow({ mode: "open" });
|
|
27
|
-
t.innerHTML = `
|
|
28
|
-
<style>${f}</style>
|
|
29
|
-
<div class="ui-alerta" part="base" role="alert">
|
|
30
|
-
<span class="ui-alerta__icone" part="icone"></span>
|
|
31
|
-
<div class="ui-alerta__conteudo" part="conteudo">
|
|
32
|
-
<h4 class="ui-alerta__titulo" part="titulo" style="display: none;"></h4>
|
|
33
|
-
<p class="ui-alerta__mensagem" part="mensagem">
|
|
34
|
-
<span class="ui-alerta__mensagem-texto" style="display: none;"></span>
|
|
35
|
-
<slot></slot>
|
|
36
|
-
</p>
|
|
37
|
-
</div>
|
|
38
|
-
<div class="ui-alerta__acoes" style="display: none;">
|
|
39
|
-
<button type="button" class="ui-alerta__botao-acao" part="acao"></button>
|
|
40
|
-
</div>
|
|
41
|
-
<button class="ui-alerta__close" part="fechar" type="button" aria-label="Fechar alerta" style="display: none;" title="Fechar">✕</button>
|
|
42
|
-
<div class="ui-toast__progresso" part="progresso" style="display: none;">
|
|
43
|
-
<div class="ui-toast__progresso-barra"></div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
`, this.alertaElement = t.querySelector(".ui-alerta"), this.iconeElement = t.querySelector(".ui-alerta__icone"), this.tituloElement = t.querySelector(".ui-alerta__titulo"), this.mensagemElement = t.querySelector(".ui-alerta__mensagem"), this.mensagemTextoElement = t.querySelector(".ui-alerta__mensagem-texto"), this.closeElement = t.querySelector(".ui-alerta__close"), this.acoesElement = t.querySelector(".ui-alerta__acoes"), this.botaoAcaoElement = t.querySelector(".ui-alerta__botao-acao"), this.progressoContainer = t.querySelector(".ui-toast__progresso"), this.progressoBarra = t.querySelector(".ui-toast__progresso-barra");
|
|
47
|
-
}
|
|
48
|
-
static get observedAttributes() {
|
|
49
|
-
return [
|
|
50
|
-
"tipo",
|
|
51
|
-
"variante",
|
|
52
|
-
"variant",
|
|
53
|
-
"titulo",
|
|
54
|
-
"title",
|
|
55
|
-
"mensagem",
|
|
56
|
-
"fechavel",
|
|
57
|
-
"dismissible"
|
|
58
|
-
];
|
|
59
|
-
}
|
|
60
|
-
connectedCallback() {
|
|
61
|
-
this.listeners.cleanup(), this.listeners.add(this.closeElement, "click", () => this.fechar()), this.syncState();
|
|
62
|
-
}
|
|
63
|
-
disconnectedCallback() {
|
|
64
|
-
this.listeners.cleanup();
|
|
65
|
-
}
|
|
66
|
-
attributeChangedCallback(t, o, e) {
|
|
67
|
-
this.syncState();
|
|
68
|
-
}
|
|
69
|
-
fechar() {
|
|
70
|
-
this.dispatchEvent(
|
|
71
|
-
new CustomEvent("ui-fechar", {
|
|
72
|
-
bubbles: !0,
|
|
73
|
-
composed: !0
|
|
74
|
-
})
|
|
75
|
-
), this.remove();
|
|
76
|
-
}
|
|
77
|
-
syncState() {
|
|
78
|
-
const t = this.getAttribute("tipo") || this.getAttribute("variante") || this.getAttribute("variant") || "info", o = this.getAttribute("titulo") || this.getAttribute("title"), e = this.getAttribute("mensagem"), s = this.hasAttribute("fechavel") || this.hasAttribute("dismissible");
|
|
79
|
-
this.alertaElement.className = `ui-alerta ui-alerta--${t}`;
|
|
80
|
-
const m = l[t] || l.info;
|
|
81
|
-
this.iconeElement.innerHTML = m, o ? (this.tituloElement.textContent = o, this.tituloElement.style.display = "block") : (this.tituloElement.style.display = "none", this.tituloElement.textContent = ""), e ? (this.mensagemTextoElement.textContent = e, this.mensagemTextoElement.style.display = "inline") : (this.mensagemTextoElement.style.display = "none", this.mensagemTextoElement.textContent = ""), s ? this.closeElement.style.display = "block" : this.closeElement.style.display = "none";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
c("ui-alerta", u);
|
|
85
|
-
class n extends u {
|
|
86
|
-
constructor() {
|
|
87
|
-
super(...arguments);
|
|
88
|
-
r(this, "timerId", null);
|
|
89
|
-
r(this, "tempoRestante", 4e3);
|
|
90
|
-
r(this, "inicioTimestamp", 0);
|
|
91
|
-
r(this, "isPausado", !1);
|
|
92
|
-
r(this, "acaoConfig");
|
|
93
|
-
r(this, "containerRef", null);
|
|
94
|
-
r(this, "handleAcaoClick", (t) => {
|
|
95
|
-
var o, e, s;
|
|
96
|
-
t.stopPropagation(), (o = this.acaoConfig) != null && o.onClick && this.acaoConfig.onClick(t), this.dispatchEvent(
|
|
97
|
-
new CustomEvent("ui-toast-acao", {
|
|
98
|
-
detail: {
|
|
99
|
-
rotulo: (e = this.acaoConfig) == null ? void 0 : e.rotulo,
|
|
100
|
-
tipo: (s = this.acaoConfig) == null ? void 0 : s.tipo
|
|
101
|
-
},
|
|
102
|
-
bubbles: !0,
|
|
103
|
-
composed: !0
|
|
104
|
-
})
|
|
105
|
-
), this.fechar();
|
|
106
|
-
});
|
|
107
|
-
r(this, "pausarTimer", () => {
|
|
108
|
-
if (this.isPausado || this.tempoRestante <= 0) return;
|
|
109
|
-
this.isPausado = !0, this.timerId && (clearTimeout(this.timerId), this.timerId = null);
|
|
110
|
-
const t = Date.now() - this.inicioTimestamp;
|
|
111
|
-
this.tempoRestante = Math.max(0, this.tempoRestante - t), this.progressoBarra.style.animationPlayState = "paused";
|
|
112
|
-
});
|
|
113
|
-
r(this, "retomarTimer", () => {
|
|
114
|
-
!this.isPausado || this.tempoRestante <= 0 || (this.isPausado = !1, this.progressoBarra.style.animationPlayState = "running", this.iniciarTimer(Math.max(this.tempoRestante, 300)));
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
configurarAcao(t) {
|
|
118
|
-
this.acaoConfig = t, this.botaoAcaoElement.textContent = t.rotulo, this.acoesElement.style.display = "flex";
|
|
119
|
-
const o = t.tipo || "primario";
|
|
120
|
-
this.botaoAcaoElement.className = `ui-alerta__botao-acao ui-alerta__botao-acao--${o}`;
|
|
121
|
-
}
|
|
122
|
-
connectedCallback() {
|
|
123
|
-
super.connectedCallback(), this.containerRef = this.parentElement, this.alertaElement.classList.add("ui-toast__banner"), this.acaoConfig && this.listeners.add(this.botaoAcaoElement, "click", this.handleAcaoClick);
|
|
124
|
-
const t = this.getAttribute("duracao") || this.getAttribute("duration") || "4000", o = parseInt(t, 10);
|
|
125
|
-
this.tempoRestante = isNaN(o) ? 4e3 : o, this.tempoRestante > 0 ? (this.progressoContainer.style.display = "block", this.progressoBarra.style.animationDuration = `${this.tempoRestante}ms`, this.getAttribute("pausar-no-hover") !== "false" && (this.listeners.add(this, "mouseenter", this.pausarTimer), this.listeners.add(this, "mouseleave", this.retomarTimer), this.listeners.add(this, "focusin", this.pausarTimer), this.listeners.add(this, "focusout", this.retomarTimer)), this.iniciarTimer(this.tempoRestante)) : this.progressoContainer.style.display = "none";
|
|
126
|
-
}
|
|
127
|
-
fechar() {
|
|
128
|
-
const t = this.parentElement || this.containerRef;
|
|
129
|
-
super.fechar(), t && t.id.startsWith("ui-toast-container-") && t.children.length === 0 && t.remove();
|
|
130
|
-
}
|
|
131
|
-
disconnectedCallback() {
|
|
132
|
-
super.disconnectedCallback(), this.timerId && (clearTimeout(this.timerId), this.timerId = null), this.containerRef && this.containerRef.id.startsWith("ui-toast-container-") && this.containerRef.children.length === 0 && (this.containerRef.remove(), this.containerRef = null);
|
|
133
|
-
}
|
|
134
|
-
iniciarTimer(t) {
|
|
135
|
-
this.timerId && clearTimeout(this.timerId), this.inicioTimestamp = Date.now(), this.timerId = setTimeout(() => {
|
|
136
|
-
this.fechar();
|
|
137
|
-
}, t);
|
|
138
|
-
}
|
|
139
|
-
static obterContainer(t) {
|
|
140
|
-
const o = `ui-toast-container-${t}`;
|
|
141
|
-
let e = document.getElementById(o);
|
|
142
|
-
return e || (e = document.createElement("div"), e.id = o, e.style.position = "fixed", e.style.setProperty("z-index", "var(--ui-z-toast, 1100)"), e.style.display = "flex", e.style.gap = "10px", e.style.maxWidth = "400px", e.style.width = "calc(100vw - 32px)", e.style.pointerEvents = "none", e.style.boxSizing = "border-box", e.style.transition = "all 0.2s ease", t === "top-right" ? (e.style.top = "20px", e.style.right = "20px", e.style.flexDirection = "column") : t === "top-left" ? (e.style.top = "20px", e.style.left = "20px", e.style.flexDirection = "column") : t === "bottom-left" ? (e.style.bottom = "20px", e.style.left = "20px", e.style.flexDirection = "column-reverse") : t === "top-center" ? (e.style.top = "20px", e.style.left = "50%", e.style.transform = "translateX(-50%)", e.style.flexDirection = "column") : t === "bottom-center" ? (e.style.bottom = "20px", e.style.left = "50%", e.style.transform = "translateX(-50%)", e.style.flexDirection = "column-reverse") : (e.style.bottom = "20px", e.style.right = "20px", e.style.flexDirection = "column-reverse"), document.body.appendChild(e)), e;
|
|
143
|
-
}
|
|
144
|
-
// Utilitário estático para disparo imperativo de Toasts de qualquer lugar no código
|
|
145
|
-
static notificar(t) {
|
|
146
|
-
if (typeof document > "u") return null;
|
|
147
|
-
const o = t.posicao || "bottom-right", e = document.createElement("ui-toast");
|
|
148
|
-
return t.tipo && e.setAttribute("tipo", t.tipo), t.titulo && e.setAttribute("titulo", t.titulo), t.mensagem && e.setAttribute("mensagem", t.mensagem), t.duracao !== void 0 && e.setAttribute("duracao", String(t.duracao)), t.pausarNoHover === !1 && e.setAttribute("pausar-no-hover", "false"), e.setAttribute("posicao", o), t.fechavel !== !1 && e.setAttribute("fechavel", ""), t.acao && e.configurarAcao(t.acao), n.obterContainer(o).appendChild(e), e;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
c("ui-toast", n);
|
|
152
|
-
export {
|
|
153
|
-
l as I,
|
|
154
|
-
u as U,
|
|
155
|
-
n as a
|
|
156
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var p=(i,a,t)=>a in i?d(i,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[a]=t;var r=(i,a,t)=>p(i,typeof a!="symbol"?a+"":a,t);const h=require("./listener-bag-D5omxZ9h.cjs"),c=require("./ssr-safe-CiHD1adl.cjs"),b=':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-alerta{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-radius:var(--ui-raio-borda, 8px);border:1px solid transparent;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box;position:relative;transition:opacity .2s ease,transform .2s ease;line-height:1.4}.ui-alerta__icone{display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:2px;line-height:1}.ui-alerta__icone svg,.ui-alerta__icone ::slotted(svg),.ui-alerta__icone ::slotted(ui-icone){shape-rendering:geometricPrecision}.ui-alerta__conteudo{flex:1}.ui-alerta__titulo{font-size:14px;font-weight:600;margin:0 0 2px;line-height:1.2}.ui-alerta__mensagem{font-size:13px;margin:0;opacity:.9}.ui-alerta__close{background:transparent;border:none;color:currentColor;opacity:.7;font-size:14px;cursor:pointer;padding:2px 6px;border-radius:var(--ui-raio-sm, 4px);line-height:1;flex-shrink:0;margin-top:-2px;margin-right:-4px;transition:opacity .15s ease,background-color .15s ease}.ui-alerta__close:hover{opacity:1;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 15%,transparent)}.ui-alerta--sucesso{background-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 30%,transparent);color:var(--ui-cor-texto-sucesso, #00E08A)}.ui-alerta--sucesso .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--erro{background-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 30%,transparent);color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta--erro .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--alerta{background-color:color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 30%,transparent);color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-alerta--alerta .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--info{background-color:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 30%,transparent);color:var(--ui-cor-texto-info, #33b5ff)}.ui-alerta--info .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta__acoes{display:flex;align-items:center;flex-shrink:0;margin-left:4px}.ui-alerta__botao-acao{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 16%,transparent);color:inherit;font-family:inherit;font-size:12px;font-weight:600;padding:4px 10px;border-radius:5px;cursor:pointer;line-height:1;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;transition:background-color .15s ease,border-color .15s ease,transform .1s ease}.ui-alerta__botao-acao:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent)}.ui-alerta__botao-acao:active{transform:scale(.96)}.ui-alerta__botao-acao: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-alerta__botao-acao--primario{background:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 15%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 35%,transparent);color:var(--ui-cor-primaria, #00E08A)}.ui-alerta__botao-acao--primario:hover{background:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 25%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 50%,transparent)}.ui-alerta__botao-acao--destrutivo{background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 15%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 35%,transparent);color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta__botao-acao--destrutivo:hover{background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 25%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 50%,transparent)}:host(ui-toast){display:block;width:100%;box-sizing:border-box;pointer-events:auto;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .25s ease}.ui-toast__banner{box-shadow:var(--ui-sombra-lg, 0 10px 30px rgba(0, 0, 0, .3)),0 0 0 1px var(--ui-cor-borda, rgba(255, 255, 255, .1));animation:ui-toast-slide .3s cubic-bezier(.16,1,.3,1);position:relative;overflow:hidden;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}.ui-toast__banner.ui-alerta--sucesso{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-sucesso, #00E08A) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 40%,transparent)}.ui-toast__banner.ui-alerta--erro{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-erro, #ff5555) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 40%,transparent)}.ui-toast__banner.ui-alerta--alerta{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-alerta, #ffb86c) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 40%,transparent)}.ui-toast__banner.ui-alerta--info{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-info, #33b5ff) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 40%,transparent)}.ui-toast__progresso{position:absolute;bottom:0;left:0;right:0;height:2px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);overflow:hidden}.ui-toast__progresso-barra{width:100%;height:100%;background:currentColor;opacity:.7;transform-origin:left;animation:ui-toast-timer linear forwards}:host(ui-toast:hover) .ui-toast__progresso-barra,:host(ui-toast:focus-within) .ui-toast__progresso-barra{animation-play-state:paused}@keyframes ui-toast-timer{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@keyframes ui-toast-slide{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@starting-style{:host(ui-toast){opacity:0;transform:translateY(12px) scale(.96)}}',l={sucesso:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg>',erro:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>',alerta:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>',info:'<svg viewBox="0 0 24 24" width="20" height="20" 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="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>'};class u extends c.SafeHTMLElement{constructor(){super();r(this,"alertaElement");r(this,"iconeElement");r(this,"tituloElement");r(this,"mensagemElement");r(this,"mensagemTextoElement");r(this,"closeElement");r(this,"acoesElement");r(this,"botaoAcaoElement");r(this,"progressoContainer");r(this,"progressoBarra");r(this,"listeners",new h.ListenerBag);const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
2
|
-
<style>${b}</style>
|
|
3
|
-
<div class="ui-alerta" part="base" role="alert">
|
|
4
|
-
<span class="ui-alerta__icone" part="icone"></span>
|
|
5
|
-
<div class="ui-alerta__conteudo" part="conteudo">
|
|
6
|
-
<h4 class="ui-alerta__titulo" part="titulo" style="display: none;"></h4>
|
|
7
|
-
<p class="ui-alerta__mensagem" part="mensagem">
|
|
8
|
-
<span class="ui-alerta__mensagem-texto" style="display: none;"></span>
|
|
9
|
-
<slot></slot>
|
|
10
|
-
</p>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="ui-alerta__acoes" style="display: none;">
|
|
13
|
-
<button type="button" class="ui-alerta__botao-acao" part="acao"></button>
|
|
14
|
-
</div>
|
|
15
|
-
<button class="ui-alerta__close" part="fechar" type="button" aria-label="Fechar alerta" style="display: none;" title="Fechar">✕</button>
|
|
16
|
-
<div class="ui-toast__progresso" part="progresso" style="display: none;">
|
|
17
|
-
<div class="ui-toast__progresso-barra"></div>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
`,this.alertaElement=t.querySelector(".ui-alerta"),this.iconeElement=t.querySelector(".ui-alerta__icone"),this.tituloElement=t.querySelector(".ui-alerta__titulo"),this.mensagemElement=t.querySelector(".ui-alerta__mensagem"),this.mensagemTextoElement=t.querySelector(".ui-alerta__mensagem-texto"),this.closeElement=t.querySelector(".ui-alerta__close"),this.acoesElement=t.querySelector(".ui-alerta__acoes"),this.botaoAcaoElement=t.querySelector(".ui-alerta__botao-acao"),this.progressoContainer=t.querySelector(".ui-toast__progresso"),this.progressoBarra=t.querySelector(".ui-toast__progresso-barra")}static get observedAttributes(){return["tipo","variante","variant","titulo","title","mensagem","fechavel","dismissible"]}connectedCallback(){this.listeners.cleanup(),this.listeners.add(this.closeElement,"click",()=>this.fechar()),this.syncState()}disconnectedCallback(){this.listeners.cleanup()}attributeChangedCallback(t,o,e){this.syncState()}fechar(){this.dispatchEvent(new CustomEvent("ui-fechar",{bubbles:!0,composed:!0})),this.remove()}syncState(){const t=this.getAttribute("tipo")||this.getAttribute("variante")||this.getAttribute("variant")||"info",o=this.getAttribute("titulo")||this.getAttribute("title"),e=this.getAttribute("mensagem"),s=this.hasAttribute("fechavel")||this.hasAttribute("dismissible");this.alertaElement.className=`ui-alerta ui-alerta--${t}`;const m=l[t]||l.info;this.iconeElement.innerHTML=m,o?(this.tituloElement.textContent=o,this.tituloElement.style.display="block"):(this.tituloElement.style.display="none",this.tituloElement.textContent=""),e?(this.mensagemTextoElement.textContent=e,this.mensagemTextoElement.style.display="inline"):(this.mensagemTextoElement.style.display="none",this.mensagemTextoElement.textContent=""),s?this.closeElement.style.display="block":this.closeElement.style.display="none"}}c.definirCustomElement("ui-alerta",u);class n extends u{constructor(){super(...arguments);r(this,"timerId",null);r(this,"tempoRestante",4e3);r(this,"inicioTimestamp",0);r(this,"isPausado",!1);r(this,"acaoConfig");r(this,"containerRef",null);r(this,"handleAcaoClick",t=>{var o,e,s;t.stopPropagation(),(o=this.acaoConfig)!=null&&o.onClick&&this.acaoConfig.onClick(t),this.dispatchEvent(new CustomEvent("ui-toast-acao",{detail:{rotulo:(e=this.acaoConfig)==null?void 0:e.rotulo,tipo:(s=this.acaoConfig)==null?void 0:s.tipo},bubbles:!0,composed:!0})),this.fechar()});r(this,"pausarTimer",()=>{if(this.isPausado||this.tempoRestante<=0)return;this.isPausado=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null);const t=Date.now()-this.inicioTimestamp;this.tempoRestante=Math.max(0,this.tempoRestante-t),this.progressoBarra.style.animationPlayState="paused"});r(this,"retomarTimer",()=>{!this.isPausado||this.tempoRestante<=0||(this.isPausado=!1,this.progressoBarra.style.animationPlayState="running",this.iniciarTimer(Math.max(this.tempoRestante,300)))})}configurarAcao(t){this.acaoConfig=t,this.botaoAcaoElement.textContent=t.rotulo,this.acoesElement.style.display="flex";const o=t.tipo||"primario";this.botaoAcaoElement.className=`ui-alerta__botao-acao ui-alerta__botao-acao--${o}`}connectedCallback(){super.connectedCallback(),this.containerRef=this.parentElement,this.alertaElement.classList.add("ui-toast__banner"),this.acaoConfig&&this.listeners.add(this.botaoAcaoElement,"click",this.handleAcaoClick);const t=this.getAttribute("duracao")||this.getAttribute("duration")||"4000",o=parseInt(t,10);this.tempoRestante=isNaN(o)?4e3:o,this.tempoRestante>0?(this.progressoContainer.style.display="block",this.progressoBarra.style.animationDuration=`${this.tempoRestante}ms`,this.getAttribute("pausar-no-hover")!=="false"&&(this.listeners.add(this,"mouseenter",this.pausarTimer),this.listeners.add(this,"mouseleave",this.retomarTimer),this.listeners.add(this,"focusin",this.pausarTimer),this.listeners.add(this,"focusout",this.retomarTimer)),this.iniciarTimer(this.tempoRestante)):this.progressoContainer.style.display="none"}fechar(){const t=this.parentElement||this.containerRef;super.fechar(),t&&t.id.startsWith("ui-toast-container-")&&t.children.length===0&&t.remove()}disconnectedCallback(){super.disconnectedCallback(),this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.containerRef&&this.containerRef.id.startsWith("ui-toast-container-")&&this.containerRef.children.length===0&&(this.containerRef.remove(),this.containerRef=null)}iniciarTimer(t){this.timerId&&clearTimeout(this.timerId),this.inicioTimestamp=Date.now(),this.timerId=setTimeout(()=>{this.fechar()},t)}static obterContainer(t){const o=`ui-toast-container-${t}`;let e=document.getElementById(o);return e||(e=document.createElement("div"),e.id=o,e.style.position="fixed",e.style.setProperty("z-index","var(--ui-z-toast, 1100)"),e.style.display="flex",e.style.gap="10px",e.style.maxWidth="400px",e.style.width="calc(100vw - 32px)",e.style.pointerEvents="none",e.style.boxSizing="border-box",e.style.transition="all 0.2s ease",t==="top-right"?(e.style.top="20px",e.style.right="20px",e.style.flexDirection="column"):t==="top-left"?(e.style.top="20px",e.style.left="20px",e.style.flexDirection="column"):t==="bottom-left"?(e.style.bottom="20px",e.style.left="20px",e.style.flexDirection="column-reverse"):t==="top-center"?(e.style.top="20px",e.style.left="50%",e.style.transform="translateX(-50%)",e.style.flexDirection="column"):t==="bottom-center"?(e.style.bottom="20px",e.style.left="50%",e.style.transform="translateX(-50%)",e.style.flexDirection="column-reverse"):(e.style.bottom="20px",e.style.right="20px",e.style.flexDirection="column-reverse"),document.body.appendChild(e)),e}static notificar(t){if(typeof document>"u")return null;const o=t.posicao||"bottom-right",e=document.createElement("ui-toast");return t.tipo&&e.setAttribute("tipo",t.tipo),t.titulo&&e.setAttribute("titulo",t.titulo),t.mensagem&&e.setAttribute("mensagem",t.mensagem),t.duracao!==void 0&&e.setAttribute("duracao",String(t.duracao)),t.pausarNoHover===!1&&e.setAttribute("pausar-no-hover","false"),e.setAttribute("posicao",o),t.fechavel!==!1&&e.setAttribute("fechavel",""),t.acao&&e.configurarAcao(t.acao),n.obterContainer(o).appendChild(e),e}}c.definirCustomElement("ui-toast",n);exports.ICONES_ALERTA=l;exports.UIAlerta=u;exports.UIToast=n;
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
var v = Object.defineProperty;
|
|
2
|
-
var E = (o, e, t) => e in o ? v(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
-
var m = (o, e, t) => E(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { a as A } from "./ui-toast-Bp_NlM5G.js";
|
|
5
|
-
class I {
|
|
6
|
-
constructor() {
|
|
7
|
-
m(this, "listeners", /* @__PURE__ */ new Map());
|
|
8
|
-
m(this, "_observandoSistema", !1);
|
|
9
|
-
this.observarTemaDoSistema();
|
|
10
|
-
}
|
|
11
|
-
on(e, t) {
|
|
12
|
-
return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(t), () => this.off(e, t);
|
|
13
|
-
}
|
|
14
|
-
once(e, t) {
|
|
15
|
-
const r = (u) => {
|
|
16
|
-
this.off(e, r), t(u);
|
|
17
|
-
};
|
|
18
|
-
this.on(e, r);
|
|
19
|
-
}
|
|
20
|
-
off(e, t) {
|
|
21
|
-
const r = this.listeners.get(e);
|
|
22
|
-
r && (r.delete(t), r.size === 0 && this.listeners.delete(e));
|
|
23
|
-
}
|
|
24
|
-
emit(e, t) {
|
|
25
|
-
const r = this.listeners.get(e);
|
|
26
|
-
r && r.forEach((u) => {
|
|
27
|
-
try {
|
|
28
|
-
u(t);
|
|
29
|
-
} catch (f) {
|
|
30
|
-
console.error(`[UIBus] Erro ao executar ouvinte do evento "${e}":`, f);
|
|
31
|
-
}
|
|
32
|
-
}), typeof window < "u" && window.dispatchEvent(
|
|
33
|
-
new CustomEvent(`uibus:${e}`, {
|
|
34
|
-
detail: t,
|
|
35
|
-
bubbles: !0,
|
|
36
|
-
composed: !0
|
|
37
|
-
})
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
/* ====================================================
|
|
41
|
-
Métodos de Atalho e Ações de Alta Produtividade
|
|
42
|
-
==================================================== */
|
|
43
|
-
/**
|
|
44
|
-
* Abre um modal pelo seu ID no documento.
|
|
45
|
-
*/
|
|
46
|
-
abrirModal(e) {
|
|
47
|
-
if (typeof document > "u") return !1;
|
|
48
|
-
const t = document.getElementById(e);
|
|
49
|
-
return t && typeof t.abrir == "function" ? (t.abrir(), this.emit("modal:aberto", { id: e }), !0) : t ? (t.setAttribute("aberto", ""), this.emit("modal:aberto", { id: e }), !0) : (console.warn(`[UIBus] Modal com ID "${e}" não encontrado no DOM.`), !1);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Fecha um modal pelo seu ID ou todos os modais abertos se nenhum ID for passado.
|
|
53
|
-
* Retorna `false` se o modal não existir ou continuar aberto (`bloquear-fechamento`).
|
|
54
|
-
*/
|
|
55
|
-
fecharModal(e) {
|
|
56
|
-
if (typeof document > "u") return !1;
|
|
57
|
-
if (e) {
|
|
58
|
-
const t = document.getElementById(e);
|
|
59
|
-
return t && typeof t.fechar == "function" ? (t.fechar(), t.hasAttribute("aberto") || t.hasAttribute("open") ? !1 : (this.emit("modal:fechado", { id: e }), !0)) : t ? (t.removeAttribute("aberto"), t.removeAttribute("open"), this.emit("modal:fechado", { id: e }), !0) : !1;
|
|
60
|
-
} else
|
|
61
|
-
return document.querySelectorAll(
|
|
62
|
-
"ui-modal[aberto], ui-modal[open], ui-dialog[aberto], ui-dialog[open]"
|
|
63
|
-
).forEach((r) => {
|
|
64
|
-
typeof r.fechar == "function" ? r.fechar() : (r.removeAttribute("aberto"), r.removeAttribute("open"));
|
|
65
|
-
}), this.emit("modal:fechado-todos"), !0;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Abre um painel lateral (drawer / sheet) pelo seu ID no documento.
|
|
69
|
-
*/
|
|
70
|
-
abrirDrawer(e) {
|
|
71
|
-
if (typeof document > "u") return !1;
|
|
72
|
-
const t = document.getElementById(e);
|
|
73
|
-
return t && typeof t.abrir == "function" ? (t.abrir(), this.emit("drawer:aberto", { id: e }), !0) : t ? (t.setAttribute("aberto", ""), this.emit("drawer:aberto", { id: e }), !0) : (console.warn(`[UIBus] Drawer com ID "${e}" não encontrado no DOM.`), !1);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Fecha um painel lateral (drawer / sheet) pelo seu ID ou todos se nenhum for passado.
|
|
77
|
-
*/
|
|
78
|
-
fecharDrawer(e) {
|
|
79
|
-
if (typeof document > "u") return !1;
|
|
80
|
-
if (e) {
|
|
81
|
-
const t = document.getElementById(e);
|
|
82
|
-
return t && typeof t.fechar == "function" ? (t.fechar(), this.emit("drawer:fechado", { id: e }), !0) : t ? (t.removeAttribute("aberto"), t.removeAttribute("open"), this.emit("drawer:fechado", { id: e }), !0) : !1;
|
|
83
|
-
} else
|
|
84
|
-
return document.querySelectorAll(
|
|
85
|
-
"ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]"
|
|
86
|
-
).forEach((r) => {
|
|
87
|
-
typeof r.fechar == "function" ? r.fechar() : (r.removeAttribute("aberto"), r.removeAttribute("open"));
|
|
88
|
-
}), this.emit("drawer:fechado-todos"), !0;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Dispara uma notificação toast flutuante inteligente.
|
|
92
|
-
*/
|
|
93
|
-
notificar(e) {
|
|
94
|
-
typeof e == "string" ? A.notificar({ mensagem: e, tipo: "info" }) : A.notificar(e);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Copia um texto para a área de transferência do usuário e exibe feedback opcional.
|
|
98
|
-
*/
|
|
99
|
-
async copiar(e, t) {
|
|
100
|
-
if (typeof navigator > "u" || !navigator.clipboard)
|
|
101
|
-
return !1;
|
|
102
|
-
try {
|
|
103
|
-
return await navigator.clipboard.writeText(e), t !== void 0 && this.notificar({
|
|
104
|
-
tipo: "sucesso",
|
|
105
|
-
mensagem: t || "Copiado para a área de transferência!"
|
|
106
|
-
}), this.emit("clipboard:copiado", { texto: e }), !0;
|
|
107
|
-
} catch (r) {
|
|
108
|
-
return console.error("[UIBus] Falha ao copiar texto:", r), this.notificar({
|
|
109
|
-
tipo: "erro",
|
|
110
|
-
mensagem: "Não foi possível copiar o texto."
|
|
111
|
-
}), !1;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Altera a densidade visual global do kit (compacta, normal ou relaxada).
|
|
116
|
-
*/
|
|
117
|
-
definirDensidade(e) {
|
|
118
|
-
let t = 34;
|
|
119
|
-
typeof e == "number" ? t = Math.max(15, e) : e === "compacta" ? t = 26 : e === "relaxada" ? t = 42 : t = 34, !(typeof document > "u") && (document.documentElement.style.setProperty("--ui-altura-minima", `${t}px`), document.documentElement.style.setProperty("--ui-campo-altura", `${t}px`), document.documentElement.setAttribute("data-ui-densidade", typeof e == "string" ? e : "custom"), this.emit("densidade:alterada", { densidade: e, alturaPx: t }));
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Tema em vigor: o forçado na raiz (`data-tema`, `data-theme`, `.dark`/`.light`)
|
|
123
|
-
* ou, sem nenhum, o do sistema operacional (`prefers-color-scheme`).
|
|
124
|
-
*/
|
|
125
|
-
obterTema() {
|
|
126
|
-
if (typeof document > "u") return "escuro";
|
|
127
|
-
const e = w(document.documentElement);
|
|
128
|
-
return e || (T() ? "claro" : "escuro");
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Define o tema global. Sem argumento, alterna o tema em vigor;
|
|
132
|
-
* `'auto'` remove o tema forçado e volta a seguir o sistema operacional.
|
|
133
|
-
*/
|
|
134
|
-
definirTema(e) {
|
|
135
|
-
if (typeof document > "u") return e === "claro" ? "claro" : "escuro";
|
|
136
|
-
const t = document.documentElement;
|
|
137
|
-
if (e === "auto")
|
|
138
|
-
t.removeAttribute("data-tema"), t.removeAttribute("data-theme"), t.classList.remove("dark", "light");
|
|
139
|
-
else {
|
|
140
|
-
const u = e || (this.obterTema() === "escuro" ? "claro" : "escuro");
|
|
141
|
-
t.setAttribute("data-tema", u), t.classList.toggle("dark", u === "escuro"), t.classList.toggle("light", u === "claro");
|
|
142
|
-
}
|
|
143
|
-
const r = this.obterTema();
|
|
144
|
-
return this.emit("tema:alterado", { tema: r }), r;
|
|
145
|
-
}
|
|
146
|
-
/** Com o tema seguindo o SO, avisa `tema:alterado` quando o usuário troca o tema do sistema. */
|
|
147
|
-
observarTemaDoSistema() {
|
|
148
|
-
var e, t;
|
|
149
|
-
this._observandoSistema || typeof window > "u" || typeof window.matchMedia != "function" || (this._observandoSistema = !0, (t = (e = window.matchMedia("(prefers-color-scheme: light)")).addEventListener) == null || t.call(e, "change", () => {
|
|
150
|
-
w(document.documentElement) || this.emit("tema:alterado", { tema: this.obterTema() });
|
|
151
|
-
}));
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
function w(o) {
|
|
155
|
-
const e = o.getAttribute("data-tema") || o.getAttribute("data-theme");
|
|
156
|
-
return e === "escuro" || e === "dark" ? "escuro" : e === "claro" || e === "light" ? "claro" : o.classList.contains("dark") ? "escuro" : o.classList.contains("light") ? "claro" : null;
|
|
157
|
-
}
|
|
158
|
-
function T() {
|
|
159
|
-
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: light)").matches;
|
|
160
|
-
}
|
|
161
|
-
const n = new I();
|
|
162
|
-
let y = !1;
|
|
163
|
-
function x(o) {
|
|
164
|
-
if (o.hasAttribute("disabled") || o.hasAttribute("carregando") || o.getAttribute("aria-disabled") === "true" || o.localName.startsWith("ui-") && o.hasAttribute("loading")) return !0;
|
|
165
|
-
try {
|
|
166
|
-
return o.matches(":disabled");
|
|
167
|
-
} catch {
|
|
168
|
-
return !1;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
function B() {
|
|
172
|
-
y || typeof document > "u" || (y = !0, document.addEventListener("click", (o) => {
|
|
173
|
-
const e = o.composedPath ? o.composedPath() : [o.target], t = "[target-modal], [modal-alvo], [dismiss-modal], [fechar-modal], [target-drawer], [drawer-alvo], [dismiss-drawer], [fechar-drawer], [toast-sucesso], [toast-erro], [toast-alerta], [toast-info], [copiar-texto], [alternar-tema], [definir-densidade], [limpar-form]";
|
|
174
|
-
let r = null;
|
|
175
|
-
for (const i of e)
|
|
176
|
-
if (i instanceof HTMLElement && i.matches(t)) {
|
|
177
|
-
r = i;
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
if (!r || x(r)) return;
|
|
181
|
-
const u = r.getAttribute("target-modal") || r.getAttribute("modal-alvo");
|
|
182
|
-
if (u && n.abrirModal(u), r.hasAttribute("dismiss-modal") || r.hasAttribute("fechar-modal")) {
|
|
183
|
-
const i = r.getAttribute("dismiss-modal") || r.getAttribute("fechar-modal");
|
|
184
|
-
if (i && i !== "")
|
|
185
|
-
n.fecharModal(i);
|
|
186
|
-
else {
|
|
187
|
-
let s = null;
|
|
188
|
-
for (const a of e)
|
|
189
|
-
if (a instanceof HTMLElement && (a.matches("ui-modal, ui-dialog") || a.tagName === "UI-MODAL" || a.tagName === "UI-DIALOG")) {
|
|
190
|
-
s = a;
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
s && (typeof s.fechar == "function" ? s.fechar() : (s.removeAttribute("aberto"), s.removeAttribute("open")));
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
const f = r.getAttribute("target-drawer") || r.getAttribute("drawer-alvo");
|
|
197
|
-
if (f && n.abrirDrawer(f), r.hasAttribute("dismiss-drawer") || r.hasAttribute("fechar-drawer")) {
|
|
198
|
-
const i = r.getAttribute("dismiss-drawer") || r.getAttribute("fechar-drawer");
|
|
199
|
-
if (i && i !== "")
|
|
200
|
-
n.fecharDrawer(i);
|
|
201
|
-
else {
|
|
202
|
-
let s = null;
|
|
203
|
-
for (const a of e)
|
|
204
|
-
if (a instanceof HTMLElement && (a.matches("ui-drawer, ui-sheet, ui-painel-lateral, ui-gaveta") || a.tagName.startsWith("UI-DRAWER") || a.tagName.startsWith("UI-SHEET"))) {
|
|
205
|
-
s = a;
|
|
206
|
-
break;
|
|
207
|
-
}
|
|
208
|
-
s && (typeof s.fechar == "function" ? s.fechar() : (s.removeAttribute("aberto"), s.removeAttribute("open")));
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
const d = r.getAttribute("toast-sucesso");
|
|
212
|
-
d && n.notificar({ tipo: "sucesso", mensagem: d });
|
|
213
|
-
const l = r.getAttribute("toast-erro");
|
|
214
|
-
l && n.notificar({ tipo: "erro", mensagem: l });
|
|
215
|
-
const h = r.getAttribute("toast-alerta");
|
|
216
|
-
h && n.notificar({ tipo: "alerta", mensagem: h });
|
|
217
|
-
const b = r.getAttribute("toast-info");
|
|
218
|
-
b && n.notificar({ tipo: "info", mensagem: b });
|
|
219
|
-
const c = r.getAttribute("copiar-texto");
|
|
220
|
-
if (c !== null) {
|
|
221
|
-
let i = c;
|
|
222
|
-
if (c.startsWith("#") || c.startsWith(".") || c.match(/^[a-zA-Z0-9_-]+$/))
|
|
223
|
-
try {
|
|
224
|
-
let a = null;
|
|
225
|
-
c.startsWith("#") || c.startsWith(".") ? a = document.querySelector(c) : a = document.getElementById(c) || document.querySelector(`#${c}`), a && (i = a.value !== void 0 && a.value !== null ? a.value : a.textContent || "");
|
|
226
|
-
} catch {
|
|
227
|
-
}
|
|
228
|
-
const s = r.getAttribute("copiar-mensagem") || "Copiado com sucesso!";
|
|
229
|
-
n.copiar(i, s);
|
|
230
|
-
}
|
|
231
|
-
r.hasAttribute("alternar-tema") && n.definirTema();
|
|
232
|
-
const p = r.getAttribute("definir-densidade");
|
|
233
|
-
p && n.definirDensidade(p);
|
|
234
|
-
const g = r.getAttribute("limpar-form");
|
|
235
|
-
if (g) {
|
|
236
|
-
const i = document.getElementById(g);
|
|
237
|
-
i && typeof i.reset == "function" && (i.reset(), n.notificar({ tipo: "info", mensagem: "Formulário limpo." }));
|
|
238
|
-
}
|
|
239
|
-
}));
|
|
240
|
-
}
|
|
241
|
-
export {
|
|
242
|
-
n as U,
|
|
243
|
-
B as i
|
|
244
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var v=Object.defineProperty;var E=(o,e,t)=>e in o?v(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var m=(o,e,t)=>E(o,typeof e!="symbol"?e+"":e,t);const A=require("./ui-toast-DGTZKne5.cjs");class I{constructor(){m(this,"listeners",new Map);m(this,"_observandoSistema",!1);this.observarTemaDoSistema()}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}once(e,t){const r=u=>{this.off(e,r),t(u)};this.on(e,r)}off(e,t){const r=this.listeners.get(e);r&&(r.delete(t),r.size===0&&this.listeners.delete(e))}emit(e,t){const r=this.listeners.get(e);r&&r.forEach(u=>{try{u(t)}catch(f){console.error(`[UIBus] Erro ao executar ouvinte do evento "${e}":`,f)}}),typeof window<"u"&&window.dispatchEvent(new CustomEvent(`uibus:${e}`,{detail:t,bubbles:!0,composed:!0}))}abrirModal(e){if(typeof document>"u")return!1;const t=document.getElementById(e);return t&&typeof t.abrir=="function"?(t.abrir(),this.emit("modal:aberto",{id:e}),!0):t?(t.setAttribute("aberto",""),this.emit("modal:aberto",{id:e}),!0):(console.warn(`[UIBus] Modal com ID "${e}" não encontrado no DOM.`),!1)}fecharModal(e){if(typeof document>"u")return!1;if(e){const t=document.getElementById(e);return t&&typeof t.fechar=="function"?(t.fechar(),t.hasAttribute("aberto")||t.hasAttribute("open")?!1:(this.emit("modal:fechado",{id:e}),!0)):t?(t.removeAttribute("aberto"),t.removeAttribute("open"),this.emit("modal:fechado",{id:e}),!0):!1}else return document.querySelectorAll("ui-modal[aberto], ui-modal[open], ui-dialog[aberto], ui-dialog[open]").forEach(r=>{typeof r.fechar=="function"?r.fechar():(r.removeAttribute("aberto"),r.removeAttribute("open"))}),this.emit("modal:fechado-todos"),!0}abrirDrawer(e){if(typeof document>"u")return!1;const t=document.getElementById(e);return t&&typeof t.abrir=="function"?(t.abrir(),this.emit("drawer:aberto",{id:e}),!0):t?(t.setAttribute("aberto",""),this.emit("drawer:aberto",{id:e}),!0):(console.warn(`[UIBus] Drawer com ID "${e}" não encontrado no DOM.`),!1)}fecharDrawer(e){if(typeof document>"u")return!1;if(e){const t=document.getElementById(e);return t&&typeof t.fechar=="function"?(t.fechar(),this.emit("drawer:fechado",{id:e}),!0):t?(t.removeAttribute("aberto"),t.removeAttribute("open"),this.emit("drawer:fechado",{id:e}),!0):!1}else return document.querySelectorAll("ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]").forEach(r=>{typeof r.fechar=="function"?r.fechar():(r.removeAttribute("aberto"),r.removeAttribute("open"))}),this.emit("drawer:fechado-todos"),!0}notificar(e){typeof e=="string"?A.UIToast.notificar({mensagem:e,tipo:"info"}):A.UIToast.notificar(e)}async copiar(e,t){if(typeof navigator>"u"||!navigator.clipboard)return!1;try{return await navigator.clipboard.writeText(e),t!==void 0&&this.notificar({tipo:"sucesso",mensagem:t||"Copiado para a área de transferência!"}),this.emit("clipboard:copiado",{texto:e}),!0}catch(r){return console.error("[UIBus] Falha ao copiar texto:",r),this.notificar({tipo:"erro",mensagem:"Não foi possível copiar o texto."}),!1}}definirDensidade(e){let t=34;typeof e=="number"?t=Math.max(15,e):e==="compacta"?t=26:e==="relaxada"?t=42:t=34,!(typeof document>"u")&&(document.documentElement.style.setProperty("--ui-altura-minima",`${t}px`),document.documentElement.style.setProperty("--ui-campo-altura",`${t}px`),document.documentElement.setAttribute("data-ui-densidade",typeof e=="string"?e:"custom"),this.emit("densidade:alterada",{densidade:e,alturaPx:t}))}obterTema(){if(typeof document>"u")return"escuro";const e=w(document.documentElement);return e||(T()?"claro":"escuro")}definirTema(e){if(typeof document>"u")return e==="claro"?"claro":"escuro";const t=document.documentElement;if(e==="auto")t.removeAttribute("data-tema"),t.removeAttribute("data-theme"),t.classList.remove("dark","light");else{const u=e||(this.obterTema()==="escuro"?"claro":"escuro");t.setAttribute("data-tema",u),t.classList.toggle("dark",u==="escuro"),t.classList.toggle("light",u==="claro")}const r=this.obterTema();return this.emit("tema:alterado",{tema:r}),r}observarTemaDoSistema(){var e,t;this._observandoSistema||typeof window>"u"||typeof window.matchMedia!="function"||(this._observandoSistema=!0,(t=(e=window.matchMedia("(prefers-color-scheme: light)")).addEventListener)==null||t.call(e,"change",()=>{w(document.documentElement)||this.emit("tema:alterado",{tema:this.obterTema()})}))}}function w(o){const e=o.getAttribute("data-tema")||o.getAttribute("data-theme");return e==="escuro"||e==="dark"?"escuro":e==="claro"||e==="light"?"claro":o.classList.contains("dark")?"escuro":o.classList.contains("light")?"claro":null}function T(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: light)").matches}const n=new I;let y=!1;function S(o){if(o.hasAttribute("disabled")||o.hasAttribute("carregando")||o.getAttribute("aria-disabled")==="true"||o.localName.startsWith("ui-")&&o.hasAttribute("loading"))return!0;try{return o.matches(":disabled")}catch{return!1}}function x(){y||typeof document>"u"||(y=!0,document.addEventListener("click",o=>{const e=o.composedPath?o.composedPath():[o.target],t="[target-modal], [modal-alvo], [dismiss-modal], [fechar-modal], [target-drawer], [drawer-alvo], [dismiss-drawer], [fechar-drawer], [toast-sucesso], [toast-erro], [toast-alerta], [toast-info], [copiar-texto], [alternar-tema], [definir-densidade], [limpar-form]";let r=null;for(const i of e)if(i instanceof HTMLElement&&i.matches(t)){r=i;break}if(!r||S(r))return;const u=r.getAttribute("target-modal")||r.getAttribute("modal-alvo");if(u&&n.abrirModal(u),r.hasAttribute("dismiss-modal")||r.hasAttribute("fechar-modal")){const i=r.getAttribute("dismiss-modal")||r.getAttribute("fechar-modal");if(i&&i!=="")n.fecharModal(i);else{let s=null;for(const a of e)if(a instanceof HTMLElement&&(a.matches("ui-modal, ui-dialog")||a.tagName==="UI-MODAL"||a.tagName==="UI-DIALOG")){s=a;break}s&&(typeof s.fechar=="function"?s.fechar():(s.removeAttribute("aberto"),s.removeAttribute("open")))}}const f=r.getAttribute("target-drawer")||r.getAttribute("drawer-alvo");if(f&&n.abrirDrawer(f),r.hasAttribute("dismiss-drawer")||r.hasAttribute("fechar-drawer")){const i=r.getAttribute("dismiss-drawer")||r.getAttribute("fechar-drawer");if(i&&i!=="")n.fecharDrawer(i);else{let s=null;for(const a of e)if(a instanceof HTMLElement&&(a.matches("ui-drawer, ui-sheet, ui-painel-lateral, ui-gaveta")||a.tagName.startsWith("UI-DRAWER")||a.tagName.startsWith("UI-SHEET"))){s=a;break}s&&(typeof s.fechar=="function"?s.fechar():(s.removeAttribute("aberto"),s.removeAttribute("open")))}}const d=r.getAttribute("toast-sucesso");d&&n.notificar({tipo:"sucesso",mensagem:d});const l=r.getAttribute("toast-erro");l&&n.notificar({tipo:"erro",mensagem:l});const h=r.getAttribute("toast-alerta");h&&n.notificar({tipo:"alerta",mensagem:h});const b=r.getAttribute("toast-info");b&&n.notificar({tipo:"info",mensagem:b});const c=r.getAttribute("copiar-texto");if(c!==null){let i=c;if(c.startsWith("#")||c.startsWith(".")||c.match(/^[a-zA-Z0-9_-]+$/))try{let a=null;c.startsWith("#")||c.startsWith(".")?a=document.querySelector(c):a=document.getElementById(c)||document.querySelector(`#${c}`),a&&(i=a.value!==void 0&&a.value!==null?a.value:a.textContent||"")}catch{}const s=r.getAttribute("copiar-mensagem")||"Copiado com sucesso!";n.copiar(i,s)}r.hasAttribute("alternar-tema")&&n.definirTema();const p=r.getAttribute("definir-densidade");p&&n.definirDensidade(p);const g=r.getAttribute("limpar-form");if(g){const i=document.getElementById(g);i&&typeof i.reset=="function"&&(i.reset(),n.notificar({tipo:"info",mensagem:"Formulário limpo."}))}}))}exports.UIBus=n;exports.initZeroJSTriggers=x;
|