@thibezer/ui-components-kit 2.24.0 → 2.24.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.
Files changed (150) hide show
  1. package/CHANGELOG.md +69 -1
  2. package/dist/botao.cjs +12 -1
  3. package/dist/botao.js +162 -3
  4. package/dist/camadas.cjs +311 -1
  5. package/dist/camadas.js +3244 -148
  6. package/dist/campo-texto.cjs +16 -1
  7. package/dist/campo-texto.js +308 -7
  8. package/dist/canvas.cjs +22 -22
  9. package/dist/canvas.js +230 -233
  10. package/dist/card.cjs +20 -1
  11. package/dist/card.js +145 -2
  12. package/dist/components/ui-canvas-prancha/index.d.ts +1 -1
  13. package/dist/components/ui-canvas-prancha/prancha-teclado.d.ts +18 -0
  14. package/dist/components/ui-canvas-prancha/ui-canvas-prancha-base.d.ts +4 -0
  15. package/dist/components/ui-card/ui-card.d.ts +4 -0
  16. package/dist/components/ui-editor-prancha/editor-modos.d.ts +10 -0
  17. package/dist/components/ui-editor-prancha/editor-tipos.d.ts +4 -0
  18. package/dist/components/ui-editor-prancha/index.d.ts +1 -0
  19. package/dist/components/ui-editor-prancha/ui-editor-prancha.d.ts +39 -6
  20. package/dist/core.cjs +1 -1
  21. package/dist/core.js +44 -55
  22. package/dist/{cores-utils-BrdynxRd.js → cores-utils-DMyqWvZh.js} +2 -2
  23. package/dist/cores.cjs +32 -1
  24. package/dist/cores.js +300 -13
  25. package/dist/custom-elements.json +33962 -33439
  26. package/dist/data.cjs +28 -1
  27. package/dist/data.js +286 -99
  28. package/dist/{feature_caixa-2Sxv3tGa.js → feature_caixa-BVc5LenS.js} +42 -42
  29. package/dist/{feature_desenho-BVHivWIB.js → feature_desenho-CC8Mp5Gp.js} +2 -2
  30. package/dist/feedback.cjs +52 -1
  31. package/dist/feedback.js +655 -25
  32. package/dist/forms.cjs +66 -1
  33. package/dist/forms.js +1216 -39
  34. package/dist/{geometria-px-DUs5FgLE.js → geometria-px-DHMPUsxC.js} +47 -47
  35. package/dist/index.cjs +67 -1
  36. package/dist/index.js +1476 -274
  37. package/dist/kit-base-CGqj9aiD.cjs +2 -0
  38. package/dist/kit-base-_THn4w3u.js +1079 -0
  39. package/dist/mapa.cjs +5 -5
  40. package/dist/mapa.js +16 -17
  41. package/dist/modal.cjs +18 -1
  42. package/dist/modal.js +235 -29
  43. package/dist/motor.js +49 -49
  44. package/dist/prancha-nucleo.cjs +3 -1
  45. package/dist/prancha-nucleo.js +3120 -277
  46. package/dist/prancha.cjs +38 -1
  47. package/dist/prancha.js +3233 -228
  48. package/dist/register.cjs +1 -1
  49. package/dist/register.js +3 -20
  50. package/dist/seletor-mapa-base.cjs +13 -13
  51. package/dist/seletor-mapa-base.js +3 -5
  52. package/dist/tabela.cjs +142 -1
  53. package/dist/tabela.js +3773 -92
  54. package/dist/tipos-elementos.d.ts +5 -1
  55. package/dist/tipos-vue.d.ts +4 -1
  56. package/dist/tools.cjs +16 -1
  57. package/dist/tools.js +1564 -26
  58. package/dist/ui-seletor-cor-BGw8SBPm.cjs +83 -0
  59. package/dist/{ui-seletor-cor-Cd8jkzXG.js → ui-seletor-cor-B_twSm-V.js} +8 -9
  60. package/dist/utils-ClVgqVyJ.cjs +1 -0
  61. package/dist/utils-DrHoxxmf.js +83 -0
  62. package/package.json +43 -2
  63. package/dist/acessibilidade-CSzX-DkG.cjs +0 -1
  64. package/dist/acessibilidade-CUlSXc2X.js +0 -38
  65. package/dist/altura-controle-ukMRPckR.cjs +0 -1
  66. package/dist/altura-controle-vxQiXG4q.js +0 -62
  67. package/dist/alvo-digitavel-CzCvNVQ3.js +0 -23
  68. package/dist/alvo-digitavel-DbH0hYFf.cjs +0 -1
  69. package/dist/degrade-CIxvOTUv.cjs +0 -1
  70. package/dist/degrade-gDa5sW__.js +0 -119
  71. package/dist/feature_caixa-CnYPKVFS.cjs +0 -1
  72. package/dist/feature_caixa-DCs9ZeSk.js +0 -1038
  73. package/dist/feature_historico-BAIYk1Me.cjs +0 -3
  74. package/dist/feature_historico-C4h9y5fu.js +0 -3039
  75. package/dist/form-atalhos-7JTYvumA.cjs +0 -1
  76. package/dist/form-atalhos-DDTlpgaB.js +0 -203
  77. package/dist/form-erros-CwPz7Jr4.cjs +0 -1
  78. package/dist/form-erros-DT5HklfD.js +0 -184
  79. package/dist/form-submissao-C-SPRKgT.js +0 -61
  80. package/dist/form-submissao-DxKO5MHI.cjs +0 -1
  81. package/dist/form-validacao-BlQFxUVj.js +0 -104
  82. package/dist/form-validacao-DIeyQVH5.cjs +0 -1
  83. package/dist/geometria-px-DKrWq_XY.js +0 -639
  84. package/dist/leaflet-CEPcxGWV.cjs +0 -1
  85. package/dist/leaflet-DOq10gfg.js +0 -84
  86. package/dist/leaflet-loader-94z5VsdY.cjs +0 -2
  87. package/dist/leaflet-loader-Cjcdgj5R.js +0 -21
  88. package/dist/listener-bag-D5omxZ9h.cjs +0 -1
  89. package/dist/listener-bag-DQgv7OON.js +0 -34
  90. package/dist/motor-By2te6PZ.js +0 -1400
  91. package/dist/motor-CkMxd378.cjs +0 -1
  92. package/dist/opcoes-CupvWVIm.js +0 -24
  93. package/dist/opcoes-vdAUY5OI.cjs +0 -1
  94. package/dist/parts-CaoQiCfI.js +0 -7
  95. package/dist/parts-vQa2873h.cjs +0 -1
  96. package/dist/prancha-paleta-BZ-9QDgh.js +0 -5276
  97. package/dist/prancha-paleta-Bb24vP71.cjs +0 -17
  98. package/dist/ssr-safe-5cWfJP-s.js +0 -10
  99. package/dist/ssr-safe-CiHD1adl.cjs +0 -1
  100. package/dist/svg-seguro-ChVJ2L2z.js +0 -74
  101. package/dist/svg-seguro-J2RM1Ssf.cjs +0 -1
  102. package/dist/ui-badge-DE58YSBY.cjs +0 -28
  103. package/dist/ui-badge-KgmI3jOD.js +0 -201
  104. package/dist/ui-botao-Dz8YvmiA.cjs +0 -12
  105. package/dist/ui-botao-zLkcMMyP.js +0 -168
  106. package/dist/ui-bus-CUd99VJi.js +0 -177
  107. package/dist/ui-bus-XqBLlTYQ.cjs +0 -1
  108. package/dist/ui-camadas-DoHPnbQm.js +0 -3133
  109. package/dist/ui-camadas-Vx7wYD4D.cjs +0 -311
  110. package/dist/ui-campo-texto-Dliyt9qr.cjs +0 -16
  111. package/dist/ui-campo-texto-btevggO3.js +0 -379
  112. package/dist/ui-card-7IEYbCN0.js +0 -150
  113. package/dist/ui-card-Bx8EyzYY.cjs +0 -20
  114. package/dist/ui-card-DFnRp9bl.js +0 -146
  115. package/dist/ui-card-DrWVJQKw.cjs +0 -20
  116. package/dist/ui-controle-cores-B1w_Yl69.cjs +0 -32
  117. package/dist/ui-controle-cores-BRjMvmMn.js +0 -291
  118. package/dist/ui-controle-cores-BcH9k2Fa.js +0 -292
  119. package/dist/ui-controle-cores-CvSTP6gJ.cjs +0 -32
  120. package/dist/ui-editor-prancha-CIngI6yI.js +0 -2886
  121. package/dist/ui-editor-prancha-DorSe6sC.cjs +0 -31
  122. package/dist/ui-linha-2kY7TNUJ.cjs +0 -38
  123. package/dist/ui-linha-B4mBRm1x.cjs +0 -61
  124. package/dist/ui-linha-DTEIIww4.js +0 -1167
  125. package/dist/ui-linha-KFF86FW5.js +0 -752
  126. package/dist/ui-modal-BrXzVZ65.js +0 -216
  127. package/dist/ui-modal-lARKzEVZ.cjs +0 -18
  128. package/dist/ui-paleta-ferramentas-Bu6JaT0s.js +0 -1245
  129. package/dist/ui-paleta-ferramentas-D3Jhwt26.cjs +0 -21
  130. package/dist/ui-paleta-ferramentas-DebHYiwd.js +0 -1615
  131. package/dist/ui-paleta-ferramentas-Dgejtluh.js +0 -1423
  132. package/dist/ui-paleta-ferramentas-hzyo8wBt.cjs +0 -22
  133. package/dist/ui-paleta-ferramentas-jWuICjW8.cjs +0 -22
  134. package/dist/ui-seletor-cor-0RLjcME6.cjs +0 -83
  135. package/dist/ui-seletor-cor-CMuuW-Ym.cjs +0 -83
  136. package/dist/ui-seletor-cor-DFIQ1sin.js +0 -405
  137. package/dist/ui-skeleton-BLEV6h3k.js +0 -653
  138. package/dist/ui-skeleton-B_XTaGrX.cjs +0 -52
  139. package/dist/ui-switch-BXIDwC-Y.cjs +0 -66
  140. package/dist/ui-switch-Ctxk-jKS.js +0 -1212
  141. package/dist/ui-tabela-CXxqbwXv.cjs +0 -7
  142. package/dist/ui-tabela-Cd0vOwnT.js +0 -1459
  143. package/dist/ui-tabela-propriedades-C5cIF5ES.js +0 -3779
  144. package/dist/ui-tabela-propriedades-CJyo568n.js +0 -3517
  145. package/dist/ui-tabela-propriedades-D96Djx-q.cjs +0 -136
  146. package/dist/ui-tabela-propriedades-Wa34hfIr.cjs +0 -142
  147. package/dist/ui-tabela-propriedades-ahQhQauu.js +0 -2329
  148. package/dist/ui-tabela-propriedades-w9JWhjHy.cjs +0 -142
  149. package/dist/zero-js-triggers-CJT988bR.js +0 -83
  150. package/dist/zero-js-triggers-CgM9IIQB.cjs +0 -1
@@ -1,752 +0,0 @@
1
- var z = Object.defineProperty;
2
- var C = (r, a, t) => a in r ? z(r, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[a] = t;
3
- var l = (r, a, t) => C(r, typeof a != "symbol" ? a + "" : a, t);
4
- import { d as p, S as f } from "./ssr-safe-5cWfJP-s.js";
5
- import { e as g, a as v, b as I } from "./opcoes-CupvWVIm.js";
6
- import { A as x, a as _ } from "./degrade-gDa5sW__.js";
7
- import { F as E } from "./ui-campo-texto-btevggO3.js";
8
- import { L as w } from "./listener-bag-DQgv7OON.js";
9
- import { a as q } from "./parts-CaoQiCfI.js";
10
- import { b, c as T } from "./altura-controle-vxQiXG4q.js";
11
- const O = ':host{display:block;box-sizing:border-box;margin:0;padding:0;color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){display:inline-block}.ui-texto{margin:0;padding:0;box-sizing:border-box;font-family:inherit;color:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;overflow-wrap:break-word}.ui-texto--h1{font-size:var(--ui-tamanho-h1, clamp(24px, 4vw, 36px));font-weight:var(--ui-peso-negrito, 700);line-height:var(--ui-altura-linha-titulo, 1.25);letter-spacing:-.5px}.ui-texto--h2{font-size:var(--ui-tamanho-h2, clamp(20px, 3vw, 28px));font-weight:var(--ui-peso-seminegrito, 600);line-height:var(--ui-altura-linha-titulo, 1.25);letter-spacing:-.3px}.ui-texto--h3{font-size:var(--ui-tamanho-h3, clamp(18px, 2.4vw, 24px));font-weight:var(--ui-peso-seminegrito, 600);line-height:var(--ui-altura-linha-titulo, 1.25)}.ui-texto--h4{font-size:var(--ui-tamanho-h4, clamp(16px, 2vw, 20px));font-weight:var(--ui-peso-medio, 500);line-height:var(--ui-altura-linha-titulo, 1.25)}.ui-texto--h5{font-size:var(--ui-tamanho-h5, clamp(14px, 1.6vw, 18px));font-weight:var(--ui-peso-medio, 500);line-height:var(--ui-altura-linha-titulo, 1.25)}.ui-texto--h6{font-size:var(--ui-tamanho-h6, clamp(13px, 1.2vw, 16px));font-weight:var(--ui-peso-seminegrito, 600);line-height:var(--ui-altura-linha-titulo, 1.25);text-transform:uppercase;letter-spacing:.5px}.ui-texto--corpo{font-size:var(--ui-tamanho-corpo, 14px);font-weight:var(--ui-peso-normal, 400);line-height:var(--ui-altura-linha-corpo, 1.5)}.ui-texto--corpo-sm{font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-normal, 400);line-height:var(--ui-altura-linha-corpo, 1.5)}.ui-texto--caption{font-size:var(--ui-tamanho-caption, 11px);font-weight:var(--ui-peso-normal, 400);line-height:var(--ui-altura-linha-compacta, 1.2);color:var(--ui-cor-texto-secundario, #888899)}.ui-texto--codigo{font-family:var(--ui-fonte-codigo, monospace);font-size:var(--ui-tamanho-codigo, 12px);font-weight:var(--ui-peso-normal, 400);line-height:var(--ui-altura-linha-corpo, 1.5);background:var(--ui-cor-fundo-elevado, #1a1a1e);padding:2px 6px;border-radius:var(--ui-raio-sm, 4px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12))}.ui-texto--cor-primaria{color:var(--ui-cor-primaria, #00E08A)}.ui-texto--cor-secundaria{color:var(--ui-cor-texto-secundario, #888899)}.ui-texto--cor-destaque{color:var(--ui-cor-destaque, #00E08A)}.ui-texto--cor-erro{color:var(--ui-cor-texto-erro, #ff5555)}.ui-texto--cor-sucesso{color:var(--ui-cor-texto-sucesso, #00E08A)}.ui-texto--cor-alerta{color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-texto--peso-normal{font-weight:var(--ui-peso-normal, 400)!important}.ui-texto--peso-medio{font-weight:var(--ui-peso-medio, 500)!important}.ui-texto--peso-seminegrito{font-weight:var(--ui-peso-seminegrito, 600)!important}.ui-texto--peso-negrito{font-weight:var(--ui-peso-negrito, 700)!important}.ui-texto--alinhamento-esquerda{text-align:left}.ui-texto--alinhamento-centro{text-align:center}.ui-texto--alinhamento-direita{text-align:right}.ui-texto--alinhamento-justificado{text-align:justify;-webkit-hyphens:auto;hyphens:auto}.ui-texto--truncar{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.ui-texto--linhas{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--ui-texto-linhas, 3);line-clamp:var(--ui-texto-linhas, 3);overflow:hidden}@media print{.ui-texto--linhas{-webkit-line-clamp:unset;line-clamp:unset;display:block;overflow:visible}}:host(.degrade) .ui-texto:not(.ui-texto--codigo),:host(.ui-degrade) .ui-texto:not(.ui-texto--codigo),:host(.gradiente) .ui-texto:not(.ui-texto--codigo),:host(.ui-gradiente) .ui-texto:not(.ui-texto--codigo),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])) .ui-texto:not(.ui-texto--codigo),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])) .ui-texto:not(.ui-texto--codigo),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])) .ui-texto:not(.ui-texto--codigo),.ui-texto[data-degrade=ativo]:not(.ui-texto--codigo){background:var(--ui-degrade-interno, var(--ui-texto-fundo, var(--ui-gradiente-texto, var(--ui-gradiente-primario))));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}:host(.degrade) .ui-texto--codigo,:host(.ui-degrade) .ui-texto--codigo,:host(.gradiente) .ui-texto--codigo,:host(.ui-gradiente) .ui-texto--codigo,.ui-texto--codigo[data-degrade=ativo]{background:var(--ui-degrade-interno, var(--ui-texto-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-elevado, #1a1a1e))))}', A = ["h1", "h2", "h3", "h4", "h5", "h6", "corpo", "corpo-sm", "caption", "codigo"], L = ["primaria", "secundaria", "destaque", "erro", "sucesso", "alerta"], D = ["normal", "medio", "seminegrito", "negrito"], N = ["esquerda", "centro", "direita", "justificado"], M = /* @__PURE__ */ new Set([
12
- "p",
13
- "span",
14
- "div",
15
- "h1",
16
- "h2",
17
- "h3",
18
- "h4",
19
- "h5",
20
- "h6",
21
- "small",
22
- "code",
23
- "strong",
24
- "em",
25
- "label",
26
- "blockquote",
27
- "pre",
28
- "b",
29
- "i"
30
- ]), j = 50;
31
- class V extends f {
32
- constructor() {
33
- super();
34
- l(this, "container", null);
35
- l(this, "shadow", null);
36
- if (typeof this.attachShadow == "function" && typeof document < "u") {
37
- this.shadow = this.attachShadow({ mode: "open" });
38
- const t = document.createElement("p");
39
- t.className = "ui-texto ui-texto--corpo", t.setAttribute("part", "base"), t.appendChild(document.createElement("slot")), this.container = t, this.shadow.innerHTML = `<style>${O}</style>`, this.shadow.appendChild(t);
40
- }
41
- }
42
- static get observedAttributes() {
43
- return ["variante", "tag", "cor", "peso", "alinhamento", "truncar", "linhas", ...x];
44
- }
45
- connectedCallback() {
46
- this.render();
47
- }
48
- attributeChangedCallback(t, i, e) {
49
- this.render();
50
- }
51
- resolveTag() {
52
- const t = this.getAttribute("tag");
53
- if (t) {
54
- const e = t.toLowerCase().trim();
55
- if (M.has(e))
56
- return e;
57
- console.warn(`[ui-texto] Tag "${t}" não permitida ou inválida. Utilizando fallback semântico.`);
58
- }
59
- const i = g(this.getAttribute("variante"), A, "corpo");
60
- switch (i) {
61
- case "h1":
62
- case "h2":
63
- case "h3":
64
- case "h4":
65
- case "h5":
66
- case "h6":
67
- return i;
68
- case "caption":
69
- return "small";
70
- case "codigo":
71
- return "code";
72
- case "corpo-sm":
73
- case "corpo":
74
- default:
75
- return "p";
76
- }
77
- }
78
- render() {
79
- const { container: t, shadow: i } = this;
80
- if (!t || !i) return;
81
- const e = this.resolveTag(), o = g(this.getAttribute("variante"), A, "corpo"), s = v(this.getAttribute("cor"), L), n = v(this.getAttribute("peso"), D), u = v(this.getAttribute("alinhamento"), N), d = this.hasAttribute("truncar"), h = d ? 0 : I(this.getAttribute("linhas"), 1, j, 0);
82
- let c = t;
83
- t.tagName.toLowerCase() !== e && (c = document.createElement(e), c.setAttribute("part", "base"), c.appendChild(document.createElement("slot")), i.replaceChild(c, t), this.container = c);
84
- const m = ["ui-texto", `ui-texto--${o}`];
85
- s && m.push(`ui-texto--cor-${s}`), n && m.push(`ui-texto--peso-${n}`), u && m.push(`ui-texto--alinhamento-${u}`), d && m.push("ui-texto--truncar"), h > 0 && m.push("ui-texto--linhas"), c.className = m.join(" "), h > 0 ? c.style.setProperty("--ui-texto-linhas", String(h)) : c.style.removeProperty("--ui-texto-linhas"), _(this, c);
86
- }
87
- }
88
- p("ui-texto", V);
89
- const $ = ':host{display:inline-block;box-sizing:border-box;vertical-align:middle}:host([largura-total]),:host([full-width]){display:block;width:100%}.ui-texto-editavel{position:relative;display:inline-flex;align-items:center;box-sizing:border-box;width:100%}.ui-texto-editavel__botao{display:inline-flex;align-items:center;justify-content:flex-start;gap:var(--ui-espaco-xs, 4px);width:100%;height:var(--ui-campo-altura, 34px);min-height:var(--ui-campo-altura, 34px);box-sizing:border-box;padding:0 12px;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);background:var(--ui-cor-botao-secundario-fundo, #1e1e24);color:var(--ui-cor-texto, #e1e1e6);font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:clamp(11px,.85rem,13px);font-weight:500;line-height:1.2;text-align:left;-webkit-user-select:none;user-select:none;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background-color .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease}.ui-texto-editavel__botao:hover:not(:disabled){background:var(--ui-cor-botao-secundario-hover, #2a2a34);border-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 24%,transparent)}.ui-texto-editavel__botao: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-texto-editavel__texto{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.ui-texto-editavel__texto--placeholder{color:var(--ui-cor-texto-silenciado, rgba(255, 255, 255, .45));font-style:italic}.ui-texto-editavel__input{display:inline-block;width:100%;height:var(--ui-campo-altura, 34px);min-height:var(--ui-campo-altura, 34px);box-sizing:border-box;padding:0 11px;border:1px solid var(--ui-cor-primaria, #00E08A);border-radius:var(--ui-raio-borda, 6px);background:var(--ui-cor-campo-fundo, #121217);color:var(--ui-cor-texto, #ffffff);font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:clamp(11px,.85rem,13px);font-weight:500;line-height:1.2;outline:none;box-shadow:0 0 0 1px var(--ui-cor-primaria, #00E08A),0 0 0 3px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent);transition:border-color .15s ease,box-shadow .15s ease}.ui-texto-editavel__input::selection{background:var(--ui-cor-primaria, #00E08A);color:#000}.ui-texto-editavel[data-modo=leitura] .ui-texto-editavel__input,.ui-texto-editavel[data-modo=edicao] .ui-texto-editavel__botao{display:none!important}.ui-texto-editavel--sm .ui-texto-editavel__botao,.ui-texto-editavel--sm .ui-texto-editavel__input{height:var(--ui-campo-altura-sm, 28px);min-height:var(--ui-campo-altura-sm, 28px);font-size:11px;padding-left:8px;padding-right:8px}.ui-texto-editavel--lg .ui-texto-editavel__botao,.ui-texto-editavel--lg .ui-texto-editavel__input{height:var(--ui-campo-altura-lg, 42px);min-height:var(--ui-campo-altura-lg, 42px);font-size:15px;padding-left:14px;padding-right:14px}.ui-texto-editavel--primario .ui-texto-editavel__botao,.ui-texto-editavel--primary .ui-texto-editavel__botao{background:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000);border-color:transparent;font-weight:600}.ui-texto-editavel--primario .ui-texto-editavel__botao:hover:not(:disabled),.ui-texto-editavel--primary .ui-texto-editavel__botao:hover:not(:disabled){filter:brightness(1.1)}.ui-texto-editavel--ghost .ui-texto-editavel__botao,.ui-texto-editavel--terciario .ui-texto-editavel__botao{background:transparent;color:var(--ui-cor-texto, #e1e1e6);border-color:transparent}.ui-texto-editavel--ghost .ui-texto-editavel__botao:hover:not(:disabled),.ui-texto-editavel--terciario .ui-texto-editavel__botao:hover:not(:disabled){background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-texto-editavel--outline .ui-texto-editavel__botao,.ui-texto-editavel--borda .ui-texto-editavel__botao{background:transparent;color:var(--ui-cor-texto, #e1e1e6);border-color:var(--ui-cor-borda, rgba(255, 255, 255, .2))}.ui-texto-editavel--outline .ui-texto-editavel__botao:hover:not(:disabled),.ui-texto-editavel--borda .ui-texto-editavel__botao:hover:not(:disabled){background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .06));border-color:var(--ui-cor-primaria, #00E08A)}.ui-texto-editavel--texto .ui-texto-editavel__botao,.ui-texto-editavel--plano .ui-texto-editavel__botao{background:transparent;border-color:transparent;padding:0 4px;height:auto;min-height:unset;border-radius:4px}.ui-texto-editavel--texto .ui-texto-editavel__botao:hover:not(:disabled),.ui-texto-editavel--plano .ui-texto-editavel__botao:hover:not(:disabled){background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .06));border-color:color-mix(in srgb,var(--ui-cor-borda, #ffffff) 15%,transparent)}.ui-texto-editavel--destaque .ui-texto-editavel__botao{background:var(--ui-cor-destaque, var(--ui-cor-primaria, #00E08A));color:var(--ui-cor-texto-sobre-primaria, #000000);border-color:transparent}.ui-texto-editavel--destrutivo .ui-texto-editavel__botao{background:var(--ui-cor-botao-destrutivo-fundo, #ff4444);color:var(--ui-cor-botao-destrutivo-texto, #ffffff);border-color:transparent}:host([disabled]){pointer-events:none;opacity:.55;cursor:not-allowed}.ui-texto-editavel__botao:disabled{cursor:not-allowed;opacity:.55}:host([readonly]) .ui-texto-editavel__botao,:host([somente-leitura]) .ui-texto-editavel__botao{cursor:default}', F = [
90
- "valor",
91
- "value",
92
- "placeholder",
93
- "variante",
94
- "tamanho",
95
- "disabled",
96
- "desabilitado",
97
- "readonly",
98
- "somente-leitura",
99
- "ao-perder-foco",
100
- "obrigatorio",
101
- "maxlength",
102
- "limite-caracteres",
103
- "name",
104
- "nome"
105
- ];
106
- function B(r) {
107
- return `
108
- <style>${r}</style>
109
- <div class="ui-texto-editavel ui-texto-editavel--secundario" data-modo="leitura" part="base">
110
- <button
111
- class="ui-texto-editavel__botao"
112
- part="botao"
113
- type="button"
114
- aria-description="Pressione Enter ou clique duas vezes para editar"
115
- >
116
- <span class="ui-texto-editavel__texto" part="texto"></span>
117
- </button>
118
- <input
119
- class="ui-texto-editavel__input"
120
- part="input"
121
- type="text"
122
- autocomplete="off"
123
- spellcheck="false"
124
- />
125
- </div>
126
- `;
127
- }
128
- function P(r, a) {
129
- (r.key === "Enter" || r.key === "F2") && (r.preventDefault(), r.stopPropagation(), a());
130
- }
131
- function R(r, a, t) {
132
- r.key === "Enter" ? (r.preventDefault(), r.stopPropagation(), a()) : r.key === "Escape" ? (r.preventDefault(), r.stopPropagation(), t()) : r.key === "Tab" && a();
133
- }
134
- class k extends E {
135
- constructor() {
136
- super();
137
- l(this, "container");
138
- l(this, "botaoElement");
139
- l(this, "textoElement");
140
- l(this, "inputElement");
141
- l(this, "_modo", "leitura");
142
- l(this, "_concluindo", !1);
143
- l(this, "_valorInterno", "");
144
- l(this, "_valorOriginalAoEditar", "");
145
- l(this, "listeners", new w());
146
- // === Handlers de Eventos ===
147
- l(this, "handleDuploClique", (t) => {
148
- t.stopPropagation(), !(this.disabled || this.readOnly) && this.editar();
149
- });
150
- l(this, "handleKeyDownBotao", (t) => {
151
- this.disabled || this.readOnly || P(t, () => this.editar());
152
- });
153
- l(this, "handleKeyDownInput", (t) => {
154
- R(
155
- t,
156
- () => this.salvar(),
157
- () => this.cancelar()
158
- );
159
- });
160
- l(this, "handleBlurInput", () => {
161
- if (this._concluindo || this._modo !== "edicao") return;
162
- const t = this.aoPerderFoco;
163
- t === "cancelar" ? this.cancelar() : t === "salvar" && this.salvar();
164
- });
165
- const t = this.attachShadow({ mode: "open", delegatesFocus: !0 });
166
- t.innerHTML = B($), this.container = t.querySelector(".ui-texto-editavel"), this.botaoElement = t.querySelector(".ui-texto-editavel__botao"), this.textoElement = t.querySelector(".ui-texto-editavel__texto"), this.inputElement = t.querySelector(".ui-texto-editavel__input"), this._valorInterno = this.getAttribute("valor") ?? this.getAttribute("value") ?? "";
167
- }
168
- static get observedAttributes() {
169
- return F;
170
- }
171
- connectedCallback() {
172
- this.listeners.cleanup(), this.listeners.add(this.botaoElement, "dblclick", this.handleDuploClique), this.listeners.add(this.botaoElement, "keydown", this.handleKeyDownBotao), this.listeners.add(this.inputElement, "keydown", this.handleKeyDownInput), this.listeners.add(this.inputElement, "blur", this.handleBlurInput), this.syncState();
173
- }
174
- disconnectedCallback() {
175
- this.listeners.cleanup();
176
- }
177
- attributeChangedCallback(t, i, e) {
178
- (t === "valor" || t === "value") && e !== null && this._modo === "leitura" && (this._valorInterno = e), this.syncState();
179
- }
180
- // === API Pública Programática ===
181
- /** Entra no modo de edição se o componente não estiver desabilitado ou em somente leitura. */
182
- editar() {
183
- this._modo === "edicao" || this.disabled || this.readOnly || (this._modo = "edicao", this._valorOriginalAoEditar = this._valorInterno, this.inputElement.value = this._valorInterno, this.container.setAttribute("data-modo", "edicao"), requestAnimationFrame(() => {
184
- this.inputElement.focus(), this.inputElement.select();
185
- }), this.dispararEventoModo());
186
- }
187
- /**
188
- * Salva as alterações feitas no modo de edição e retorna ao modo leitura.
189
- * Dispara `ui-salvar` (cancelável com preventDefault()).
190
- */
191
- salvar() {
192
- if (this._modo !== "edicao" || this._concluindo) return !1;
193
- this._concluindo = !0;
194
- const i = this.inputElement.value.trim();
195
- if (this.obrigatorio && i === "")
196
- return this._concluindo = !1, this.cancelar(), !1;
197
- const e = this._valorOriginalAoEditar;
198
- if (i !== e) {
199
- const o = new CustomEvent("ui-salvar", {
200
- bubbles: !0,
201
- composed: !0,
202
- cancelable: !0,
203
- detail: { valor: i, valorAnterior: e }
204
- });
205
- if (!this.dispatchEvent(o))
206
- return this._concluindo = !1, !1;
207
- this._valorInterno = i, this.setAttribute("valor", i), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 }));
208
- }
209
- return this._modo = "leitura", this.container.setAttribute("data-modo", "leitura"), this.syncState(), requestAnimationFrame(() => {
210
- this.botaoElement.focus();
211
- }), this.dispararEventoModo(), this._concluindo = !1, !0;
212
- }
213
- /** Cancela as alterações e restaura o valor prévio à edição. */
214
- cancelar() {
215
- this._modo !== "edicao" || this._concluindo || (this._concluindo = !0, this.inputElement.value = this._valorOriginalAoEditar, this._modo = "leitura", this.container.setAttribute("data-modo", "leitura"), this.syncState(), this.dispatchEvent(
216
- new CustomEvent("ui-cancelar", {
217
- bubbles: !0,
218
- composed: !0,
219
- detail: { valor: this._valorInterno }
220
- })
221
- ), requestAnimationFrame(() => {
222
- this.botaoElement.focus();
223
- }), this.dispararEventoModo(), this._concluindo = !1);
224
- }
225
- /** Informa se o componente está atualmente no modo de edição. */
226
- estaEditando() {
227
- return this._modo === "edicao";
228
- }
229
- dispararEventoModo() {
230
- this.dispatchEvent(
231
- new CustomEvent("ui-modo-alterado", {
232
- bubbles: !0,
233
- composed: !0,
234
- detail: { modo: this._modo }
235
- })
236
- );
237
- }
238
- // === Sincronização do DOM & Form-Associated ===
239
- syncState() {
240
- const t = this._valorInterno, i = this.placeholder;
241
- t.trim() !== "" ? (this.textoElement.textContent = t, this.textoElement.classList.remove("ui-texto-editavel__texto--placeholder")) : (this.textoElement.textContent = i, this.textoElement.classList.add("ui-texto-editavel__texto--placeholder"));
242
- const e = this.variante, o = this.tamanho;
243
- this.container.className = `ui-texto-editavel ui-texto-editavel--${e} ui-texto-editavel--${o}`;
244
- const s = this.disabled;
245
- this.botaoElement.disabled = s, this.inputElement.disabled = s;
246
- const n = this.maxlength;
247
- n !== null && n > 0 ? this.inputElement.maxLength = n : this.inputElement.removeAttribute("maxlength"), this.atualizarValidade();
248
- }
249
- atualizarValidade() {
250
- this.internals && typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this._valorInterno);
251
- }
252
- // === Getters e Setters ===
253
- get valor() {
254
- return this._valorInterno;
255
- }
256
- set valor(t) {
257
- this._valorInterno = t ?? "", this.setAttribute("valor", this._valorInterno), this.syncState();
258
- }
259
- get value() {
260
- return this.valor;
261
- }
262
- set value(t) {
263
- this.valor = t;
264
- }
265
- get placeholder() {
266
- return this.getAttribute("placeholder") || "Clique duas vezes para editar";
267
- }
268
- set placeholder(t) {
269
- t ? this.setAttribute("placeholder", t) : this.removeAttribute("placeholder"), this.syncState();
270
- }
271
- get variante() {
272
- return this.getAttribute("variante") || "secundario";
273
- }
274
- set variante(t) {
275
- t ? this.setAttribute("variante", t) : this.removeAttribute("variante"), this.syncState();
276
- }
277
- get tamanho() {
278
- return this.getAttribute("tamanho") || "md";
279
- }
280
- set tamanho(t) {
281
- t ? this.setAttribute("tamanho", t) : this.removeAttribute("tamanho"), this.syncState();
282
- }
283
- get disabled() {
284
- return this._formDisabled || this.hasAttribute("disabled") || this.hasAttribute("desabilitado");
285
- }
286
- set disabled(t) {
287
- t ? this.setAttribute("disabled", "") : (this.removeAttribute("disabled"), this.removeAttribute("desabilitado")), this.syncState();
288
- }
289
- get readOnly() {
290
- return this.hasAttribute("readonly") || this.hasAttribute("somente-leitura");
291
- }
292
- set readOnly(t) {
293
- t ? this.setAttribute("readonly", "") : (this.removeAttribute("readonly"), this.removeAttribute("somente-leitura"));
294
- }
295
- get obrigatorio() {
296
- return this.hasAttribute("obrigatorio") || this.hasAttribute("required");
297
- }
298
- set obrigatorio(t) {
299
- t ? this.setAttribute("obrigatorio", "") : (this.removeAttribute("obrigatorio"), this.removeAttribute("required"));
300
- }
301
- get aoPerderFoco() {
302
- const t = this.getAttribute("ao-perder-foco");
303
- return t === "cancelar" || t === "ignorar" ? t : "salvar";
304
- }
305
- set aoPerderFoco(t) {
306
- this.setAttribute("ao-perder-foco", t);
307
- }
308
- get maxlength() {
309
- const t = this.getAttribute("maxlength") ?? this.getAttribute("limite-caracteres");
310
- if (!t) return null;
311
- const i = parseInt(t, 10);
312
- return isNaN(i) ? null : i;
313
- }
314
- set maxlength(t) {
315
- t !== null && t >= 0 ? this.setAttribute("maxlength", String(t)) : (this.removeAttribute("maxlength"), this.removeAttribute("limite-caracteres")), this.syncState();
316
- }
317
- }
318
- l(k, "formAssociated", !0);
319
- p("ui-texto-editavel", k);
320
- const H = ':host{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);vertical-align:middle;position:relative}.ui-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--ui-tamanho-avatar, 36px);height:var(--ui-tamanho-avatar, 36px);min-width:var(--ui-tamanho-avatar, 36px);min-height:var(--ui-tamanho-avatar, 36px);border-radius:50%;background:var(--ui-degrade-interno, var(--ui-avatar-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-elevado, #22222a))));color:var(--ui-cor-primaria, #00E08A);font-weight:600;font-size:var(--ui-avatar-font-size, 14px);-webkit-user-select:none;user-select:none;box-sizing:border-box;overflow:hidden;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));line-height:1}.ui-avatar__img{width:100%;height:100%;object-fit:cover;display:block}.ui-avatar--quadrado{border-radius:8px}.ui-avatar__status{position:absolute;bottom:0;right:0;width:25%;height:25%;min-width:8px;min-height:8px;max-width:14px;max-height:14px;border-radius:50%;border:2px solid var(--ui-cor-fundo-card, #121214);box-sizing:border-box}.ui-avatar__status--online{background:var(--ui-cor-primaria, #00E08A)}.ui-avatar__status--offline{background:#889}.ui-avatar__status--ausente{background:#ffb86c}.ui-avatar__status--ocupado{background:#f55}.ui-avatar--xs{--ui-tamanho-avatar: 20px;--ui-avatar-font-size: 10px}.ui-avatar--sm{--ui-tamanho-avatar: 28px;--ui-avatar-font-size: 11px}.ui-avatar--md{--ui-tamanho-avatar: 36px;--ui-avatar-font-size: 14px}.ui-avatar--lg{--ui-tamanho-avatar: 48px;--ui-avatar-font-size: 18px}.ui-avatar--xl{--ui-tamanho-avatar: 64px;--ui-avatar-font-size: 24px}:host(.squarecircle) .ui-avatar,:host(.squarecircles) .ui-avatar,:host(.ui-squarecircle) .ui-avatar,:host(.ui-squarecircles) .ui-avatar,.ui-avatar--squarecircle{border-radius:var(--ui-raio-squircle, 24%)}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-elevado: var(--ui-gradiente-elevado)}', y = ["xs", "sm", "md", "lg", "xl"], U = ["online", "offline", "ausente", "ocupado"], K = 8, X = 512;
321
- class G extends f {
322
- constructor() {
323
- super();
324
- l(this, "avatarElement");
325
- l(this, "statusElement");
326
- /** O que este componente escreveu em aria-label / aria-hidden (para distinguir do que o consumidor definiu). */
327
- l(this, "_rotuloAuto", null);
328
- l(this, "_ocultoAuto", !1);
329
- l(this, "_sincronizando", !1);
330
- const t = this.attachShadow({ mode: "open" });
331
- t.innerHTML = `
332
- <style>${H}</style>
333
- <div class="ui-avatar" part="base">
334
- <span class="ui-avatar__content" part="conteudo"></span>
335
- </div>
336
- <span class="ui-avatar__status" part="status" style="display: none;"></span>
337
- `, this.avatarElement = t.querySelector(".ui-avatar"), this.statusElement = t.querySelector(".ui-avatar__status");
338
- }
339
- static get observedAttributes() {
340
- return [
341
- "src",
342
- "nome",
343
- "name",
344
- "tamanho",
345
- "size",
346
- "formato",
347
- "status",
348
- "aria-label",
349
- ...x
350
- ];
351
- }
352
- connectedCallback() {
353
- this.syncState();
354
- }
355
- attributeChangedCallback(t, i, e) {
356
- this._sincronizando || this.syncState();
357
- }
358
- /** Iniciais por ponto de código (emoji e caracteres fora do BMP não são cortados ao meio). */
359
- extrairIniciais(t) {
360
- const i = t.trim().split(/\s+/).filter(Boolean);
361
- if (i.length === 0) return "?";
362
- if (i.length === 1)
363
- return Array.from(i[0]).slice(0, 2).join("").toUpperCase();
364
- const e = Array.from(i[0])[0], o = Array.from(i[i.length - 1])[0];
365
- return (e + o).toUpperCase();
366
- }
367
- lerNome() {
368
- return this.getAttribute("nome") || this.getAttribute("name") || "";
369
- }
370
- /**
371
- * Nome acessível: com nome, o host é uma imagem nomeada ("Ana, online"); sem nome, é decorativo.
372
- * Um `aria-label`/`aria-hidden` definido pelo consumidor nunca é sobrescrito.
373
- */
374
- sincronizarAcessibilidade(t, i) {
375
- const e = this.getAttribute("aria-label"), o = e !== null && e !== this._rotuloAuto, s = this.hasAttribute("aria-hidden") && !this._ocultoAuto;
376
- if (!(o || s)) {
377
- if (this._sincronizando = !0, t) {
378
- const n = i ? `${t}, ${i}` : t;
379
- this.setAttribute("role", "img"), this.setAttribute("aria-label", n), this._rotuloAuto = n, this.removeAttribute("aria-hidden"), this._ocultoAuto = !1;
380
- } else
381
- this._rotuloAuto !== null && this.removeAttribute("aria-label"), this._rotuloAuto = null, this.removeAttribute("role"), this.setAttribute("aria-hidden", "true"), this._ocultoAuto = !0;
382
- this._sincronizando = !1;
383
- }
384
- }
385
- syncState() {
386
- const t = this.getAttribute("src"), i = this.lerNome(), e = (this.getAttribute("tamanho") || this.getAttribute("size") || "md").trim().toLowerCase(), o = this.getAttribute("formato"), s = v(this.getAttribute("status"), U);
387
- this.avatarElement.className = "ui-avatar";
388
- const n = v(e, y), u = parseInt(e, 10);
389
- n ? (this.avatarElement.classList.add(`ui-avatar--${n}`), this.avatarElement.style.removeProperty("--ui-tamanho-avatar")) : Number.isFinite(u) && u >= K && u <= X ? this.avatarElement.style.setProperty("--ui-tamanho-avatar", `${u}px`) : (this.avatarElement.classList.add(`ui-avatar--${g(null, y, "md")}`), this.avatarElement.style.removeProperty("--ui-tamanho-avatar")), o === "quadrado" ? this.avatarElement.classList.add("ui-avatar--quadrado") : (o === "squarecircle" || o === "squarecircles" || o === "squircle") && this.avatarElement.classList.add("ui-avatar--squarecircle"), _(this, this.avatarElement);
390
- const d = this.avatarElement.querySelector(".ui-avatar__content");
391
- if (d)
392
- if (t) {
393
- const h = d.querySelector("img");
394
- if (h && h.getAttribute("src") === t)
395
- h.alt = "";
396
- else {
397
- d.textContent = "";
398
- const c = document.createElement("img");
399
- c.className = "ui-avatar__img", c.src = t, c.alt = "", c.onerror = () => {
400
- this.renderFallback(d, this.lerNome());
401
- }, d.appendChild(c);
402
- }
403
- } else
404
- d.textContent = "", this.renderFallback(d, i);
405
- this.sincronizarAcessibilidade(i, s), s ? (this.statusElement.className = `ui-avatar__status ui-avatar__status--${s}`, this.statusElement.style.display = "block", this.statusElement.setAttribute("aria-hidden", "true")) : this.statusElement.style.display = "none";
406
- }
407
- renderFallback(t, i) {
408
- i ? t.textContent = this.extrairIniciais(i) : t.innerHTML = `
409
- <svg viewBox="0 0 24 24" width="60%" height="60%" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
410
- <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
411
- <circle cx="12" cy="7" r="4"></circle>
412
- </svg>
413
- `;
414
- }
415
- }
416
- p("ui-avatar", G);
417
- class Q {
418
- constructor(a, t) {
419
- l(this, "rafId", null);
420
- l(this, "resizeObserver");
421
- this.trackElement = a, this.indicadorElement = t;
422
- }
423
- iniciarObserver(a, t) {
424
- typeof ResizeObserver < "u" && (this.resizeObserver = new ResizeObserver(() => {
425
- this.atualizar(), t && t();
426
- }), this.resizeObserver.observe(a));
427
- }
428
- destruir() {
429
- this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0), this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
430
- }
431
- atualizar() {
432
- this.rafId !== null && cancelAnimationFrame(this.rafId), this.rafId = requestAnimationFrame(() => {
433
- this.rafId = null;
434
- const a = this.trackElement.querySelector(".ui-segmented__item--ativo");
435
- if (!a) {
436
- this.indicadorElement.style.opacity = "0";
437
- return;
438
- }
439
- const t = this.indicadorElement.parentElement, i = a.getBoundingClientRect(), e = t == null ? void 0 : t.getBoundingClientRect();
440
- let o, s;
441
- if (t && e && i.width > 0 && e.width > 0) {
442
- const n = t.clientLeft || 0;
443
- o = Number((i.left - e.left - n).toFixed(2)), s = Number(i.width.toFixed(2));
444
- } else
445
- o = Math.round(a.offsetLeft), s = Math.round(a.offsetWidth);
446
- this.indicadorElement.style.transform = `translateX(${o}px)`, this.indicadorElement.style.width = `${s}px`, this.indicadorElement.style.opacity = "1";
447
- });
448
- }
449
- }
450
- function W(r, a, t, i) {
451
- if (t) return;
452
- const e = Array.from(
453
- a.querySelectorAll(".ui-segmented__item:not(:disabled)")
454
- );
455
- if (e.length === 0) return;
456
- const o = e.findIndex((u) => u.classList.contains("ui-segmented__item--ativo"));
457
- let s = o;
458
- if (r.key === "ArrowRight" || r.key === "ArrowDown")
459
- r.preventDefault(), s = (o + 1) % e.length;
460
- else if (r.key === "ArrowLeft" || r.key === "ArrowUp")
461
- r.preventDefault(), s = (o - 1 + e.length) % e.length;
462
- else if (r.key === "Home")
463
- r.preventDefault(), s = 0;
464
- else if (r.key === "End")
465
- r.preventDefault(), s = e.length - 1;
466
- else
467
- return;
468
- const n = e[s];
469
- if (n && n.dataset.indice) {
470
- const u = parseInt(n.dataset.indice, 10);
471
- i(u);
472
- }
473
- }
474
- const J = ':host{display:inline-flex;vertical-align:middle;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([largura-total]),:host([full-width]){display:block;width:100%}.ui-segmented{--_altura: var(--ui-campo-altura, 34px);--_moldura: 3px;display:inline-flex;position:relative;height:var(--_altura);background:var(--ui-degrade-interno, var(--ui-segmented-fundo, var(--ui-fundo-superficie, var(--ui-cor-fundo, #0b0b0d))));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);padding:var(--_moldura);box-sizing:border-box;-webkit-user-select:none;user-select:none;gap:2px;align-items:center}.ui-segmented--full{display:flex;width:100%}.ui-segmented--full .ui-segmented__item{flex:1}.ui-segmented--sm{--_moldura: 2px}.ui-segmented--sm .ui-segmented__item{font-size:12px;padding:0 8px}.ui-segmented--md .ui-segmented__item{font-size:13px;padding:0 14px}.ui-segmented--lg{--_moldura: 4px}.ui-segmented--lg .ui-segmented__item{font-size:14px;padding:0 18px}.ui-segmented__indicador{position:absolute;top:var(--_moldura);bottom:var(--_moldura);left:0;box-sizing:border-box;background:var(--ui-segmented-indicador-fundo, var(--ui-fundo-card, var(--ui-cor-fundo-card, #1e1e24)));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:calc(var(--ui-raio-borda, 8px) - 2px);box-shadow:var(--ui-sombra-sm, 0 2px 8px rgba(0, 0, 0, .4));pointer-events:none;transition:transform .22s cubic-bezier(.16,1,.3,1),width .22s cubic-bezier(.16,1,.3,1),opacity .15s ease;z-index:1;opacity:0}.ui-segmented__item{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:6px;background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-family:inherit;font-weight:500;cursor:pointer;border-radius:calc(var(--ui-raio-borda, 8px) - 2px);line-height:1;white-space:nowrap;transition:color .15s ease;box-sizing:border-box;height:calc(var(--_altura) - 2px - 2 * var(--_moldura))}.ui-segmented__item:hover:not(:disabled){color:var(--ui-cor-texto, #e1e1e6)}.ui-segmented__item--ativo{color:var(--ui-cor-texto, #ffffff)!important;font-weight:600}.ui-segmented__item:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-primaria, #00E08A)}.ui-segmented__item:disabled{opacity:.35;cursor:not-allowed}.ui-segmented__icone{display:inline-flex;align-items:center;justify-content:center;line-height:1}.ui-segmented__icone ui-icone,.ui-segmented__icone svg{shape-rendering:geometricPrecision;display:inline-flex;align-items:center;justify-content:center}@media (max-width: 640px){.ui-segmented{--_altura: max(var(--ui-campo-altura, 34px), 38px)}}:host(.degrade),:host(.ui-degrade),:host(.gradiente),:host(.ui-gradiente),:host([degrade]:not([degrade="false"]):not([degrade="none"]):not([degrade="0"]):not([degrade="off"])),:host([gradiente]:not([gradiente="false"]):not([gradiente="none"]):not([gradiente="0"]):not([gradiente="off"])),:host([gradient]:not([gradient="false"]):not([gradient="none"]):not([gradient="0"]):not([gradient="off"])){--ui-fundo-superficie: var(--ui-gradiente-superficie);--ui-fundo-card: var(--ui-gradiente-card)}', Y = [
475
- "valor",
476
- "value",
477
- "name",
478
- "disabled",
479
- "tamanho",
480
- "size",
481
- "densidade",
482
- "altura",
483
- "height",
484
- "largura-total",
485
- "full-width",
486
- "obrigatorio",
487
- "required",
488
- "mensagem-validacao",
489
- ...x
490
- ];
491
- function Z() {
492
- return `
493
- <style>${J}</style>
494
- <div class="ui-segmented ui-segmented--md" part="base" role="radiogroup">
495
- <div class="ui-segmented__indicador" part="indicador"></div>
496
- <div class="ui-segmented__track" style="display: contents;"></div>
497
- <slot style="display: none;"></slot>
498
- </div>
499
- `;
500
- }
501
- function tt(r, a, t, i, e) {
502
- const o = document.createElement("button");
503
- o.type = "button", o.role = "radio", o.className = "ui-segmented__item", o.setAttribute("part", r.valor === t ? "opcao opcao-selecionada" : "opcao"), o.dataset.valor = r.valor, o.dataset.indice = String(a);
504
- const s = r.valor === t;
505
- if (o.setAttribute("aria-checked", String(s)), o.tabIndex = s ? 0 : -1, s && o.classList.add("ui-segmented__item--ativo"), (i || r.disabled) && (o.disabled = !0), r.icone) {
506
- const u = document.createElement("span");
507
- u.className = "ui-segmented__icone";
508
- const d = document.createElement("ui-icone");
509
- d.setAttribute("nome", r.icone), d.setAttribute("tamanho", "14"), u.appendChild(d), o.appendChild(u);
510
- }
511
- const n = document.createElement("span");
512
- return n.className = "ui-segmented__texto", n.textContent = r.rotulo, o.appendChild(n), o.addEventListener("click", (u) => {
513
- u.stopPropagation(), e();
514
- }), o;
515
- }
516
- class S extends E {
517
- constructor() {
518
- super();
519
- l(this, "rootElement");
520
- l(this, "trackElement");
521
- l(this, "indicadorElement");
522
- l(this, "slotElement");
523
- l(this, "_opcoes", []);
524
- l(this, "_defaultValue", "");
525
- l(this, "listeners", new w());
526
- l(this, "indicadorController");
527
- l(this, "handleSlotChange", () => {
528
- this._opcoes.length === 0 && this.carregarOpcoes();
529
- });
530
- l(this, "handleKeyDown", (t) => {
531
- W(t, this.trackElement, this.disabled, (i) => {
532
- this.selecionarIndice(i);
533
- });
534
- });
535
- const t = this.attachShadow({ mode: "open" });
536
- t.innerHTML = Z(), this.rootElement = t.querySelector(".ui-segmented"), this.indicadorElement = t.querySelector(".ui-segmented__indicador"), this.trackElement = t.querySelector(".ui-segmented__track"), this.slotElement = t.querySelector("slot"), this.indicadorController = new Q(
537
- this.trackElement,
538
- this.indicadorElement
539
- );
540
- }
541
- static get observedAttributes() {
542
- return Y;
543
- }
544
- connectedCallback() {
545
- this.listeners.cleanup(), this.listeners.add(this.rootElement, "keydown", this.handleKeyDown), this.listeners.add(this.slotElement, "slotchange", this.handleSlotChange), this._defaultValue || (this._defaultValue = this.getAttribute("valor") || this.getAttribute("value") || ""), this.indicadorController.iniciarObserver(this.rootElement), this.carregarOpcoes(), this.syncState();
546
- }
547
- disconnectedCallback() {
548
- this.listeners.cleanup(), this.indicadorController.destruir();
549
- }
550
- attributeChangedCallback(t, i, e) {
551
- i !== e && (t === "valor" || t === "value" ? this.atualizarSelecao(e || "") : this.syncState());
552
- }
553
- // === Ciclo de Vida Form-Associated Custom Elements (W3C FACE) ===
554
- formResetCallback() {
555
- this.valor = this._defaultValue, this.syncState();
556
- }
557
- formStateRestoreCallback(t, i) {
558
- typeof t == "string" && (this.valor = t), this.syncState();
559
- }
560
- get type() {
561
- return "select-one";
562
- }
563
- atualizarValidade() {
564
- if (!this.internals || typeof this.internals.setValidity != "function") return;
565
- if (this.disabled) {
566
- this.internals.setValidity({});
567
- return;
568
- }
569
- if (this._customErrorMessage) {
570
- this.internals.setValidity({ customError: !0 }, this._customErrorMessage, this.rootElement);
571
- return;
572
- }
573
- if ((this.hasAttribute("obrigatorio") || this.hasAttribute("required")) && (!this.valor || this.valor.trim() === "")) {
574
- const i = this.getAttribute("mensagem-validacao") || "Selecione uma opção.";
575
- this.internals.setValidity({ valueMissing: !0 }, i, this.rootElement);
576
- return;
577
- }
578
- this.internals.setValidity({});
579
- }
580
- get valor() {
581
- return this.getAttribute("valor") || this.getAttribute("value") || "";
582
- }
583
- set valor(t) {
584
- this.setAttribute("valor", t), this.atualizarSelecao(t);
585
- }
586
- get value() {
587
- return this.valor;
588
- }
589
- set value(t) {
590
- this.valor = t;
591
- }
592
- get name() {
593
- return this.getAttribute("name") || "";
594
- }
595
- set name(t) {
596
- this.setAttribute("name", t);
597
- }
598
- get disabled() {
599
- return this.hasAttribute("disabled") || this._formDisabled;
600
- }
601
- set disabled(t) {
602
- t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
603
- }
604
- get opcoes() {
605
- return this._opcoes;
606
- }
607
- set opcoes(t) {
608
- this._opcoes = Array.isArray(t) ? t : [], this.renderizarOpcoes();
609
- }
610
- carregarOpcoes() {
611
- const t = this.slotElement.assignedElements();
612
- if (t.length > 0) {
613
- const i = [];
614
- t.forEach((e) => {
615
- var o, s;
616
- if (e instanceof HTMLElement) {
617
- const n = e.getAttribute("valor") || e.getAttribute("value") || e.getAttribute("data-value") || ((o = e.textContent) == null ? void 0 : o.trim()) || "", u = e.getAttribute("label") || e.getAttribute("rotulo") || ((s = e.textContent) == null ? void 0 : s.trim()) || n, d = e.getAttribute("icone") || e.getAttribute("icon") || void 0, h = e.hasAttribute("disabled");
618
- i.push({ valor: n, rotulo: u, icone: d, disabled: h });
619
- }
620
- }), this._opcoes = i, this.renderizarOpcoes();
621
- }
622
- }
623
- renderizarOpcoes() {
624
- this.trackElement.innerHTML = "";
625
- const t = this.valor, i = this.disabled;
626
- this._opcoes.forEach((o, s) => {
627
- const n = tt(
628
- o,
629
- s,
630
- t,
631
- i,
632
- () => this.selecionarIndice(s)
633
- );
634
- this.trackElement.appendChild(n);
635
- });
636
- const e = this.required || this.hasAttribute("sem-selecao-inicial");
637
- !t && this._opcoes.length > 0 && !e ? this.selecionarIndice(0, !1) : this.indicadorController.atualizar(), this.atualizarValidade();
638
- }
639
- selecionarIndice(t, i = !0) {
640
- var s, n;
641
- if (this.disabled) return;
642
- const e = this._opcoes[t];
643
- if (!e || e.disabled) return;
644
- const o = this.valor;
645
- this.setAttribute("valor", e.valor), this.internals && ((n = (s = this.internals).setFormValue) == null || n.call(s, e.valor)), this.atualizarSelecao(e.valor), i && o !== e.valor && (this.dispatchEvent(
646
- new CustomEvent("ui-change", {
647
- detail: { valor: e.valor, rotulo: e.rotulo, indice: t },
648
- bubbles: !0,
649
- composed: !0
650
- })
651
- ), this.dispatchEvent(
652
- new CustomEvent("ui-selecionar", {
653
- detail: { valor: e.valor, rotulo: e.rotulo, indice: t },
654
- bubbles: !0,
655
- composed: !0
656
- })
657
- ));
658
- }
659
- atualizarSelecao(t) {
660
- var e, o;
661
- Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach((s) => {
662
- const n = s.dataset.valor === t;
663
- s.classList.toggle("ui-segmented__item--ativo", n), q(s, "opcao-selecionada", n), s.setAttribute("aria-checked", String(n)), s.tabIndex = n ? 0 : -1, n && s.focus();
664
- }), this.internals && ((o = (e = this.internals).setFormValue) == null || o.call(e, t)), this.indicadorController.atualizar(), this.atualizarValidade();
665
- }
666
- syncState() {
667
- b(this);
668
- const t = T(
669
- this.getAttribute("tamanho") ?? this.getAttribute("size") ?? this.getAttribute("densidade")
670
- ) ?? "md", i = this.hasAttribute("largura-total") || this.hasAttribute("full-width"), e = this.disabled;
671
- this.rootElement.className = `ui-segmented ui-segmented--${t}`, i && this.rootElement.classList.add("ui-segmented--full"), _(this, this.rootElement), this.rootElement.setAttribute("aria-disabled", String(e)), Array.from(this.trackElement.querySelectorAll(".ui-segmented__item")).forEach((s) => {
672
- s.disabled = e;
673
- }), this.indicadorController.atualizar(), this.atualizarValidade();
674
- }
675
- }
676
- class et extends S {
677
- }
678
- p("ui-segmented", S);
679
- p("ui-segmento", et);
680
- const it = ':host{--_espaco: var(--ui-espaco-sm, 8px);display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:var(--ui-linha-espaco, var(--_espaco));box-sizing:border-box;min-width:0;max-width:100%}:host([inline]){display:inline-flex;vertical-align:middle}:host([hidden]){display:none}:host([sem-quebra]){flex-wrap:nowrap}:host([espaco="nenhum"]){--_espaco: 0}:host([espaco="xs"]){--_espaco: var(--ui-espaco-xs, 4px)}:host([espaco="sm"]){--_espaco: var(--ui-espaco-sm, 8px)}:host([espaco="md"]){--_espaco: var(--ui-espaco-md, 16px)}:host([espaco="lg"]){--_espaco: var(--ui-espaco-lg, 24px)}:host([alinhar="inicio"]){align-items:flex-start}:host([alinhar="centro"]){align-items:center}:host([alinhar="fim"]){align-items:flex-end}:host([alinhar="esticar"]){align-items:stretch}:host([justificar="centro"]){justify-content:center}:host([justificar="fim"]){justify-content:flex-end}:host([justificar="entre"]){justify-content:space-between}:host([justificar="ao-redor"]){justify-content:space-around}::slotted(*){flex:0 0 auto;width:auto;max-width:100%;margin-top:0;margin-bottom:0}::slotted(ui-campo-texto),::slotted(ui-input),::slotted(ui-lista-flutuante),::slotted(ui-select){flex:1 1 var(--ui-linha-campo-base, 12rem);min-width:0}::slotted([expandir]){flex:1 1 0;min-width:0}';
681
- class at extends f {
682
- static get observedAttributes() {
683
- return ["tamanho", "size", "densidade", "altura", "height"];
684
- }
685
- constructor() {
686
- super();
687
- const a = this.attachShadow({ mode: "open" });
688
- a.innerHTML = `<style>${it}</style><slot></slot>`;
689
- }
690
- connectedCallback() {
691
- b(this);
692
- }
693
- attributeChangedCallback(a, t, i) {
694
- t !== i && b(this);
695
- }
696
- lerTexto(a) {
697
- return this.getAttribute(a);
698
- }
699
- definirTexto(a, t) {
700
- t == null || t === "" ? this.removeAttribute(a) : this.setAttribute(a, String(t));
701
- }
702
- get tamanho() {
703
- return this.lerTexto("tamanho");
704
- }
705
- set tamanho(a) {
706
- this.definirTexto("tamanho", a);
707
- }
708
- get altura() {
709
- return this.lerTexto("altura");
710
- }
711
- set altura(a) {
712
- this.definirTexto("altura", a === null ? null : String(a));
713
- }
714
- get alinhar() {
715
- return this.lerTexto("alinhar");
716
- }
717
- set alinhar(a) {
718
- this.definirTexto("alinhar", a);
719
- }
720
- get justificar() {
721
- return this.lerTexto("justificar");
722
- }
723
- set justificar(a) {
724
- this.definirTexto("justificar", a);
725
- }
726
- get espaco() {
727
- return this.lerTexto("espaco");
728
- }
729
- set espaco(a) {
730
- this.definirTexto("espaco", a);
731
- }
732
- get semQuebra() {
733
- return this.hasAttribute("sem-quebra");
734
- }
735
- set semQuebra(a) {
736
- this.toggleAttribute("sem-quebra", !!a);
737
- }
738
- }
739
- p("ui-linha", at);
740
- export {
741
- Y as A,
742
- Q as S,
743
- G as U,
744
- at as a,
745
- S as b,
746
- et as c,
747
- V as d,
748
- k as e,
749
- tt as f,
750
- Z as g,
751
- W as t
752
- };