@efds-ui/behavior 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +192 -2
  3. package/dist/balloon-entry.d.ts +8 -0
  4. package/dist/balloon-entry.js +1 -0
  5. package/dist/cep-DWPro2E9.js +154 -0
  6. package/dist/components/accordion.d.ts +7 -0
  7. package/dist/components/agenda.d.ts +28 -0
  8. package/dist/components/alert.d.ts +8 -0
  9. package/dist/components/avatar.d.ts +15 -0
  10. package/dist/components/banner.d.ts +10 -0
  11. package/dist/components/button-busy.d.ts +8 -0
  12. package/dist/components/cep.d.ts +17 -0
  13. package/dist/components/combobox.d.ts +13 -0
  14. package/dist/components/command.d.ts +28 -0
  15. package/dist/components/conditional.d.ts +19 -0
  16. package/dist/components/confirm.d.ts +9 -0
  17. package/dist/components/copy.d.ts +11 -0
  18. package/dist/components/cropper.d.ts +14 -0
  19. package/dist/components/datepicker.d.ts +6 -0
  20. package/dist/components/dialogs.d.ts +35 -0
  21. package/dist/components/dirty-guard.d.ts +15 -0
  22. package/dist/components/dropdown.d.ts +9 -0
  23. package/dist/components/filter-bar.d.ts +24 -0
  24. package/dist/components/format.d.ts +12 -0
  25. package/dist/components/gallery.d.ts +11 -0
  26. package/dist/components/image-shared.d.ts +11 -0
  27. package/dist/components/image.d.ts +13 -0
  28. package/dist/components/loader.d.ts +69 -0
  29. package/dist/components/lookup.d.ts +18 -0
  30. package/dist/components/mask.d.ts +18 -0
  31. package/dist/components/modal.d.ts +16 -0
  32. package/dist/components/notifications.d.ts +16 -0
  33. package/dist/components/number.d.ts +14 -0
  34. package/dist/components/otp.d.ts +13 -0
  35. package/dist/components/page-messages.d.ts +39 -0
  36. package/dist/components/password.d.ts +11 -0
  37. package/dist/components/popover.d.ts +11 -0
  38. package/dist/components/select-readonly.d.ts +8 -0
  39. package/dist/components/session.d.ts +48 -0
  40. package/dist/components/sidebar.d.ts +10 -0
  41. package/dist/components/sortable.d.ts +3 -0
  42. package/dist/components/status-region.d.ts +1 -0
  43. package/dist/components/table-export.d.ts +21 -0
  44. package/dist/components/table-filter.d.ts +9 -0
  45. package/dist/components/table.d.ts +13 -0
  46. package/dist/components/tabs.d.ts +8 -0
  47. package/dist/components/theme-color.d.ts +10 -0
  48. package/dist/components/timepicker.d.ts +15 -0
  49. package/dist/components/toast.d.ts +30 -0
  50. package/dist/components/tooltip.d.ts +13 -0
  51. package/dist/components/tree.d.ts +12 -0
  52. package/dist/components/upload.d.ts +10 -0
  53. package/dist/components/wizard.d.ts +15 -0
  54. package/dist/config-DFz_FB2q.js +310 -0
  55. package/dist/core/cep.d.ts +36 -0
  56. package/dist/core/config.d.ts +303 -0
  57. package/dist/core/data.d.ts +22 -0
  58. package/dist/core/date.d.ts +46 -0
  59. package/dist/core/dom.d.ts +28 -0
  60. package/dist/core/drag.d.ts +66 -0
  61. package/dist/core/error-slot.d.ts +14 -0
  62. package/dist/core/fields.d.ts +53 -0
  63. package/dist/core/format.d.ts +53 -0
  64. package/dist/core/mask.d.ts +70 -0
  65. package/dist/core/position.d.ts +55 -0
  66. package/dist/core/registry.d.ts +14 -0
  67. package/dist/core/status.d.ts +10 -0
  68. package/dist/create-theme-BCnL4ZqE.js +205 -0
  69. package/dist/cropper-controller-BERlfnDt.js +565 -0
  70. package/dist/csv-BeXMUO2r.js +19 -0
  71. package/dist/data-C-IJ0iTV.js +52 -0
  72. package/dist/eds-behavior-core.js +1 -0
  73. package/dist/eds-behavior.js +7 -0
  74. package/dist/export/afm.d.ts +12 -0
  75. package/dist/export/csv.d.ts +13 -0
  76. package/dist/export/download.d.ts +4 -0
  77. package/dist/export/formats/csv.d.ts +6 -0
  78. package/dist/export/formats/csv.js +8 -0
  79. package/dist/export/formats/json.d.ts +6 -0
  80. package/dist/export/formats/json.js +8 -0
  81. package/dist/export/formats/pdf.d.ts +6 -0
  82. package/dist/export/formats/pdf.js +8 -0
  83. package/dist/export/formats/xlsx.d.ts +6 -0
  84. package/dist/export/formats/xlsx.js +8 -0
  85. package/dist/export/index.d.ts +16 -0
  86. package/dist/export/json.d.ts +7 -0
  87. package/dist/export/model.d.ts +76 -0
  88. package/dist/export/pdf.d.ts +3 -0
  89. package/dist/export/types.d.ts +32 -0
  90. package/dist/export/xlsx.d.ts +23 -0
  91. package/dist/export/zip.d.ts +9 -0
  92. package/dist/export-C7NzFSaG.js +20 -0
  93. package/dist/export-entry.d.ts +10 -0
  94. package/dist/export-entry.js +8 -0
  95. package/dist/fields-entry.d.ts +9 -0
  96. package/dist/fields-entry.js +1 -0
  97. package/dist/format-DYcDCukc.js +150 -0
  98. package/dist/format-entry.d.ts +6 -0
  99. package/dist/format-entry.js +3 -0
  100. package/dist/iife-boot.d.ts +3 -0
  101. package/dist/image/canvas.d.ts +49 -0
  102. package/dist/image/cropper-controller.d.ts +47 -0
  103. package/dist/image/gallery-logic.d.ts +20 -0
  104. package/dist/image/math.d.ts +78 -0
  105. package/dist/image/srcset.d.ts +48 -0
  106. package/dist/image-entry.d.ts +14 -0
  107. package/dist/image-entry.js +1 -0
  108. package/dist/index-core.d.ts +3 -0
  109. package/dist/index.d.ts +35 -0
  110. package/dist/index.js +6147 -0
  111. package/dist/init-with.d.ts +8 -0
  112. package/dist/json-DsaGwmbJ.js +13 -0
  113. package/dist/mask-BIBbLhPB.js +258 -0
  114. package/dist/mask-entry.d.ts +6 -0
  115. package/dist/mask-entry.js +1 -0
  116. package/dist/model-DBuawlqz.js +191 -0
  117. package/dist/pdf-BevPZal3.js +1143 -0
  118. package/dist/setup.d.ts +76 -0
  119. package/dist/theme/create-theme.d.ts +61 -0
  120. package/dist/theme-entry.d.ts +6 -0
  121. package/dist/theme-entry.js +1 -0
  122. package/dist/tooltip-wRy96rs_.js +326 -0
  123. package/dist/xlsx-6qfA69o5.js +117 -0
  124. package/package.json +80 -3
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Núcleo comum das duas compilações do pacote: a completa (`index.ts`) e a "core" sem
3
+ * exportador e sem máscara (`index-core.ts`, `dist/eds-behavior-core.js`).
4
+ */
5
+ import { resetCepUrl, resetLocale, resetMessages, defaultMessages, type Messages } from './core/config';
6
+ import { initAlert } from './components/alert';
7
+ import { initButtonBusy } from './components/button-busy';
8
+ import { initSelectReadonly } from './components/select-readonly';
9
+ import { initConfirm } from './components/confirm';
10
+ import { initCombobox } from './components/combobox';
11
+ import { initDatepicker } from './components/datepicker';
12
+ import { initNativeAlert } from './components/dialogs';
13
+ import { initDropdown } from './components/dropdown';
14
+ import { initLoader, loader, type LoaderOptions } from './components/loader';
15
+ import { initModal } from './components/modal';
16
+ import { initSidebar } from './components/sidebar';
17
+ import { initTable } from './components/table';
18
+ import { initTableFilter } from './components/table-filter';
19
+ import { initTabs } from './components/tabs';
20
+ import { initToast, toast } from './components/toast';
21
+ import { initUpload } from './components/upload';
22
+ import { initSortable } from './components/sortable';
23
+ import { initTree } from './components/tree';
24
+ import { initAccordion } from './components/accordion';
25
+ import { initFilterBar } from './components/filter-bar';
26
+ import { initPopover } from './components/popover';
27
+ import { initTooltip } from './components/tooltip';
28
+ import { initWizard } from './components/wizard';
29
+ import { initNumber } from './components/number';
30
+ import { initLookup } from './components/lookup';
31
+ import { initOtp } from './components/otp';
32
+ import { initPassword } from './components/password';
33
+ import { initAvatar } from './components/avatar';
34
+ import { initImage } from './components/image';
35
+ import { initBanner } from './components/banner';
36
+ import { initTimepicker } from './components/timepicker';
37
+ export interface BehaviorOptions {
38
+ /**
39
+ * Locale BCP 47 (padrão `pt-BR`): ordem de texto da Table, nomes de mês e dia do DatePicker e
40
+ * formato de datas e números do exportador (e o `/Lang` do PDF). Os textos seguem em `messages`.
41
+ */
42
+ locale?: string;
43
+ /** Textos (pt-BR por padrão) trocados por idioma. */
44
+ messages?: Partial<Messages>;
45
+ /** Configuração do PageLoader. */
46
+ loader?: LoaderOptions;
47
+ /**
48
+ * Só em `init`: troca `window.alert` por `EDS.alert` (não bloqueia) até o `destroy`.
49
+ * `confirm` e `prompt` nativos nunca são trocados.
50
+ */
51
+ nativeAlert?: boolean;
52
+ /**
53
+ * Serviço de consulta de CEP, com `{cep}` no lugar dos 8 dígitos (ex.:
54
+ * `https://viacep.com.br/ws/{cep}/json/`). **Vazio por padrão: nenhuma chamada externa** sem o
55
+ * autor escolher o serviço. Só vale na compilação completa (`data-eds-cep`).
56
+ */
57
+ cepUrl?: string;
58
+ }
59
+ /** Configura locale, textos e loader. Pode ser chamado antes ou depois de `init`. */
60
+ export declare function configure(options: BehaviorOptions): void;
61
+ export { defaultMessages, resetCepUrl, resetLocale, resetMessages };
62
+ export { session, initSession } from './components/session';
63
+ export { markClean } from './components/dirty-guard';
64
+ export { copyText } from './components/copy';
65
+ export type { Messages, LoaderOptions };
66
+ export type { LoaderHideReason, LoaderMode, LoaderRequestOptions, LoaderTrigger, } from './components/loader';
67
+ export type { ToastOptions, ToastVariant } from './components/toast';
68
+ export { alert, confirm, prompt } from './components/dialogs';
69
+ export type { DialogInputType, DialogOptions, DialogVariant } from './components/dialogs';
70
+ export type { ComboboxOption } from './components/combobox';
71
+ export { avatarInitials, avatarTone } from './components/avatar';
72
+ export type { SortDirection } from './components/table';
73
+ export type { TreeChangeAction, TreeNodeData } from './components/tree';
74
+ export type { FilterChange } from './components/filter-bar';
75
+ export type { Placement } from './core/position';
76
+ export { initAlert, initButtonBusy, initCombobox, initConfirm, initDatepicker, initDropdown, initLoader, initModal, initNativeAlert, initSelectReadonly, initSidebar, initTable, initTableFilter, initTabs, initToast, initUpload, initSortable, initTree, initAccordion, initFilterBar, initPopover, initTooltip, initWizard, initLookup, initNumber, initOtp, initPassword, initAvatar, initImage, initBanner, initTimepicker, loader, toast, };
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Tema por cor da organização (white-label): `createTheme('#0F766E')` gera a escala de acento
3
+ * `--eds-accent-50..900` do eixo `data-theme` a partir de uma cor, em OKLCH, com contraste AA
4
+ * garantido nos tokens de ação nos dois modos. Os componentes não mudam: só o eixo tema.
5
+ *
6
+ * Os valores de cinza (texto sobre a ação, superfícies) são os do core, usados só para medir o
7
+ * contraste; a função não lê o CSS da página.
8
+ */
9
+ export type ThemeStep = '50' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
10
+ export interface ContrastCheck {
11
+ /** Identificador estável (ex.: `light-action-text`). */
12
+ id: string;
13
+ /** O que foi medido, em português. */
14
+ label: string;
15
+ mode: 'light' | 'dark';
16
+ foreground: string;
17
+ background: string;
18
+ ratio: number;
19
+ /** Mínimo exigido (4.5 para texto, 3 para componente gráfico). */
20
+ min: number;
21
+ pass: boolean;
22
+ }
23
+ export interface ThemeResult {
24
+ /** Valor do `data-theme` (padrão `custom`). */
25
+ name: string;
26
+ /** Cor informada, normalizada (`#RRGGBB`). */
27
+ input: string;
28
+ /** Escala `--eds-accent-*` por degrau. */
29
+ scale: Record<ThemeStep, string>;
30
+ /** As mesmas variáveis, por nome de token. */
31
+ tokens: Record<string, string>;
32
+ /** CSS pronto: `@layer eds.tokens { [data-theme="custom"] { ... } }`. */
33
+ css: string;
34
+ /** Contrastes medidos nos dois modos. */
35
+ checks: ContrastCheck[];
36
+ /** `true` quando a cor informada precisou mudar de luminosidade para passar. */
37
+ adjusted: boolean;
38
+ }
39
+ export interface ThemeOptions {
40
+ /** Valor de `data-theme`. Padrão: `custom`. */
41
+ name?: string;
42
+ }
43
+ /** Normaliza `#RGB`, `#RRGGBB` (com ou sem `#`) para `#RRGGBB` maiúsculo; `null` se inválido. */
44
+ export declare function normalizeHex(input: string): string | null;
45
+ /** Razão de contraste (WCAG) entre duas cores `#RRGGBB`. */
46
+ export declare function contrastRatio(a: string, b: string): number;
47
+ /**
48
+ * Gera o tema por cor. Lança `TypeError` se `hex` não for `#RGB` ou `#RRGGBB`. A cor entra
49
+ * como 500 quando já passa no contraste; senão fica mais escura, só o necessário (`adjusted`).
50
+ */
51
+ export declare function createTheme(hex: string, options?: ThemeOptions): ThemeResult;
52
+ /**
53
+ * Aplica o tema num elemento (padrão `<html>`): `data-theme` e as variáveis `--eds-accent-*`
54
+ * em `style` (valem sobre qualquer folha, sem `<style>`, compatível com CSP). Devolve o
55
+ * resultado e `remove()`, que desfaz tudo e volta ao `data-theme` anterior. O `data-mode` do
56
+ * elemento continua valendo; numa subárvore, declare `data-mode` junto.
57
+ */
58
+ export declare function applyTheme(hex: string, element?: HTMLElement, options?: ThemeOptions): {
59
+ result: ThemeResult;
60
+ remove: () => void;
61
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Entrada `@efds-ui/behavior/theme`: tema por cor da organização (`createTheme`, `applyTheme`),
3
+ * funções puras sem `init`, para HTML e React.
4
+ */
5
+ export { applyTheme, contrastRatio, createTheme, normalizeHex } from './theme/create-theme';
6
+ export type { ContrastCheck, ThemeOptions, ThemeResult, ThemeStep } from './theme/create-theme';
@@ -0,0 +1 @@
1
+ export { t as applyTheme, n as contrastRatio, r as createTheme, i as normalizeHex } from "./create-theme-BCnL4ZqE.js";
@@ -0,0 +1,326 @@
1
+ // src/core/dom.ts
2
+ var e = 0;
3
+ function t(t) {
4
+ return e += 1, `eds-${t}-${e}`;
5
+ }
6
+ function n(e, n) {
7
+ return e.id ||= t(n), e.id;
8
+ }
9
+ function r(e, t, n, r = !1) {
10
+ return e.dispatchEvent(new CustomEvent(`eds:${t}`, {
11
+ bubbles: !0,
12
+ cancelable: r,
13
+ detail: n
14
+ }));
15
+ }
16
+ var i = "a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
17
+ function a(e) {
18
+ return !e || !e.isConnected ? !1 : (e.focus(), document.activeElement === e);
19
+ }
20
+ function o(e, t) {
21
+ try {
22
+ return e.matches(t);
23
+ } catch {
24
+ return !1;
25
+ }
26
+ }
27
+ function s(e) {
28
+ try {
29
+ typeof e.showPopover == "function" && !o(e, ":popover-open") && e.showPopover();
30
+ } catch {}
31
+ }
32
+ function c(e) {
33
+ try {
34
+ typeof e.hidePopover == "function" && o(e, ":popover-open") && e.hidePopover();
35
+ } catch {}
36
+ }
37
+ var l = "http://www.w3.org/2000/svg";
38
+ function u() {
39
+ let e = document.createElementNS(l, "svg");
40
+ e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("width", "1em"), e.setAttribute("height", "1em"), e.setAttribute("fill", "none"), e.setAttribute("stroke", "currentColor"), e.setAttribute("stroke-width", "2"), e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("aria-hidden", "true"), e.setAttribute("focusable", "false");
41
+ let t = document.createElementNS(l, "path");
42
+ return t.setAttribute("d", "M18 6L6 18M6 6l12 12"), e.append(t), e;
43
+ }
44
+ function d(e, t) {
45
+ if (typeof ResizeObserver > "u") return () => void 0;
46
+ let n = () => {
47
+ e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight ? (e.tabIndex = 0, e.setAttribute("role", "region"), e.setAttribute("aria-labelledby", t())) : (e.removeAttribute("tabindex"), e.removeAttribute("role"), e.removeAttribute("aria-labelledby"));
48
+ }, r = new ResizeObserver(n);
49
+ return r.observe(e), e.firstElementChild && r.observe(e.firstElementChild), n(), () => r.disconnect();
50
+ }
51
+ function f(e, t, n) {
52
+ let r = (e.getAttribute("aria-describedby") ?? "").split(/\s+/).filter(Boolean).filter((e) => e !== t);
53
+ n && r.push(t), r.length > 0 ? e.setAttribute("aria-describedby", r.join(" ")) : e.removeAttribute("aria-describedby");
54
+ }
55
+ // src/core/registry.ts
56
+ var p = /* @__PURE__ */ new WeakMap();
57
+ function m(e, t) {
58
+ let n = /* @__PURE__ */ new Map(), r = (e, t) => {
59
+ let r = p.get(t);
60
+ if (r?.has(e.name)) return;
61
+ r || (r = /* @__PURE__ */ new Set(), p.set(t, r)), r.add(e.name);
62
+ let i = e.bind(t) ?? (() => void 0), a = n.get(t);
63
+ a || (a = /* @__PURE__ */ new Map(), n.set(t, a)), a.set(e, i);
64
+ }, i = t.map((e) => e.selector).join(","), a = (e) => {
65
+ let n = [];
66
+ e instanceof HTMLElement && n.push(e);
67
+ try {
68
+ for (let t of e.querySelectorAll(i)) n.push(t);
69
+ } catch {
70
+ for (let r of t) for (let t of e.querySelectorAll(r.selector)) n.push(t);
71
+ }
72
+ for (let e of n) for (let n of t) o(e, n.selector) && r(n, e);
73
+ }, s = (e) => {
74
+ let t = n.get(e);
75
+ if (t) {
76
+ for (let [n, r] of t) r(), p.get(e)?.delete(n.name);
77
+ n.delete(e);
78
+ }
79
+ };
80
+ a(e);
81
+ let c = e, l = new MutationObserver((e) => {
82
+ let t = /* @__PURE__ */ new Set(), r = [];
83
+ for (let n of e) {
84
+ for (let e of n.removedNodes) r.push(e);
85
+ for (let e of n.addedNodes) e instanceof HTMLElement && t.add(e);
86
+ }
87
+ for (let e of t) for (let n = e.parentElement; n; n = n.parentElement) if (t.has(n)) {
88
+ t.delete(e);
89
+ break;
90
+ }
91
+ for (let e of t) e.isConnected && a(e);
92
+ if (r.length > 0 && n.size > 0) for (let e of r) {
93
+ if (!(e instanceof HTMLElement)) continue;
94
+ let t = [e];
95
+ try {
96
+ for (let n of e.querySelectorAll(i)) t.push(n);
97
+ } catch {
98
+ for (let r of n.keys()) e.contains(r) && t.push(r);
99
+ }
100
+ for (let e of t) n.has(e) && !c.contains(e) && s(e);
101
+ }
102
+ });
103
+ return l.observe(c, {
104
+ childList: !0,
105
+ subtree: !0
106
+ }), () => {
107
+ l.disconnect();
108
+ for (let e of [...n.keys()]) s(e);
109
+ };
110
+ }
111
+ function h(e) {
112
+ let t = 0, n = null;
113
+ return () => {
114
+ t === 0 && (n = e()), t += 1;
115
+ let r = !1;
116
+ return () => {
117
+ r || (r = !0, --t, t === 0 && (n?.(), n = null));
118
+ };
119
+ };
120
+ }
121
+ // src/core/position.ts
122
+ function g(e) {
123
+ return e === "top" || e === "bottom" || e === "start" || e === "end";
124
+ }
125
+ var _ = {
126
+ top: "bottom",
127
+ bottom: "top",
128
+ start: "end",
129
+ end: "start"
130
+ }, v = (e, t, n) => Math.max(t, Math.min(e, Math.max(t, n)));
131
+ function y(e, t) {
132
+ let { anchor: n, viewport: r, margin: i, gap: a } = e;
133
+ switch (b(t, e.rtl)) {
134
+ case "top": return n.top - a - i;
135
+ case "bottom": return r.height - (n.top + n.height) - a - i;
136
+ case "left": return n.left - a - i;
137
+ default: return r.width - (n.left + n.width) - a - i;
138
+ }
139
+ }
140
+ function b(e, t) {
141
+ return e === "top" || e === "bottom" ? e : e === "start" === t ? "right" : "left";
142
+ }
143
+ function x(e, t) {
144
+ return t === "top" || t === "bottom" ? e.size.height : e.size.width;
145
+ }
146
+ function S(e) {
147
+ let t = e.placement;
148
+ if (y(e, t) < x(e, t)) {
149
+ let n = _[t];
150
+ y(e, n) > y(e, t) && (t = n);
151
+ }
152
+ let { anchor: n, size: r, viewport: i, gap: a, margin: o } = e, s = b(t, e.rtl), c, l;
153
+ return s === "top" || s === "bottom" ? (l = s === "top" ? n.top - a - r.height : n.top + n.height + a, c = e.align === "center" ? n.left + n.width / 2 - r.width / 2 : e.rtl ? n.left + n.width - r.width : n.left) : (c = s === "left" ? n.left - a - r.width : n.left + n.width + a, l = e.align === "center" ? n.top + n.height / 2 - r.height / 2 : n.top), c = v(c, o, i.width - r.width - o), l = v(l, o, i.height - r.height - o), {
154
+ x: Math.round(c),
155
+ y: Math.round(l),
156
+ placement: t
157
+ };
158
+ }
159
+ function C(e) {
160
+ let t = e.getBoundingClientRect();
161
+ return {
162
+ left: t.left,
163
+ top: t.top,
164
+ width: t.width,
165
+ height: t.height
166
+ };
167
+ }
168
+ function w(e) {
169
+ return getComputedStyle(e).direction === "rtl";
170
+ }
171
+ function T(e, t, n, r, i, a) {
172
+ let o = t.getBoundingClientRect(), s = S({
173
+ anchor: C(e),
174
+ size: {
175
+ width: o.width,
176
+ height: o.height
177
+ },
178
+ viewport: {
179
+ width: window.innerWidth,
180
+ height: window.innerHeight
181
+ },
182
+ placement: r,
183
+ gap: a,
184
+ align: i,
185
+ rtl: w(e),
186
+ margin: 4
187
+ });
188
+ return t.style.setProperty(`--_${n}-x`, `${s.x}px`), t.style.setProperty(`--_${n}-y`, `${s.y}px`), t.setAttribute("data-placement", s.placement), s;
189
+ }
190
+ function E(e, t, n, r, i) {
191
+ let a = t.getBoundingClientRect(), o = C(e), s = w(e), c = S({
192
+ anchor: o,
193
+ size: {
194
+ width: a.width,
195
+ height: a.height
196
+ },
197
+ viewport: {
198
+ width: window.innerWidth,
199
+ height: window.innerHeight
200
+ },
201
+ placement: r,
202
+ gap: i,
203
+ align: "center",
204
+ rtl: s,
205
+ margin: 4
206
+ }), l = b(c.placement, s), u = o.left + o.width / 2, d = o.top + o.height / 2, f = l === "left" ? o.left : l === "right" ? o.left + o.width : u, p = l === "top" ? o.top : l === "bottom" ? o.top + o.height : d;
207
+ t.style.setProperty(`--_${n}-x`, `${Math.round(f)}px`), t.style.setProperty(`--_${n}-y`, `${Math.round(p)}px`);
208
+ let m = l === "top" || l === "bottom", h = m ? u - a.width / 2 : d - a.height / 2, g = Math.round((m ? c.x : c.y) - h);
209
+ return t.style.setProperty(`--_${n}-dx`, m ? `${g}px` : "0px"), t.style.setProperty(`--_${n}-dy`, m ? "0px" : `${g}px`), t.setAttribute("data-placement", c.placement), {
210
+ x: f,
211
+ y: p,
212
+ placement: c.placement
213
+ };
214
+ }
215
+ function D(e) {
216
+ let t = 0, n = () => {
217
+ if (typeof requestAnimationFrame != "function") return e();
218
+ t ||= requestAnimationFrame(() => {
219
+ t = 0, e();
220
+ });
221
+ };
222
+ return window.addEventListener("scroll", n, !0), window.addEventListener("resize", n), () => {
223
+ window.removeEventListener("scroll", n, !0), window.removeEventListener("resize", n), t && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(t), t = 0;
224
+ };
225
+ }
226
+ // src/components/popover.ts
227
+ var O = 8, k = {
228
+ name: "popover",
229
+ selector: "[data-eds-popover][popovertarget]",
230
+ bind(e) {
231
+ let t = e.ownerDocument, n = e.getAttribute("popovertarget") ?? "", i = n ? t.getElementById(n) : null;
232
+ if (!i) return;
233
+ let a = e.getAttribute("data-eds-popover") || i.getAttribute("data-placement"), s = g(a) ? a : "bottom", l = (e) => {
234
+ let t = e?.newState;
235
+ return t ? t === "open" : o(i, ":popover-open");
236
+ }, u = null, d = () => {
237
+ l() && T(e, i, "popover", s, "start", O);
238
+ }, f = (t) => {
239
+ if (t.newState !== "open") return;
240
+ let n = C(e);
241
+ i.style.setProperty("--_popover-x", `${Math.round(n.left)}px`), i.style.setProperty("--_popover-y", `${Math.round(n.top + n.height + O)}px`);
242
+ }, p = (n) => {
243
+ let a = l(n);
244
+ if (e.setAttribute("aria-expanded", String(a)), a) {
245
+ d(), u ??= D(d), r(i, "popover-open", { trigger: e });
246
+ return;
247
+ }
248
+ u?.(), u = null;
249
+ let o = t.activeElement;
250
+ (!o || o === t.body || i.contains(o)) && e.isConnected && e.focus(), r(i, "popover-close", { trigger: e });
251
+ };
252
+ return i.addEventListener("beforetoggle", f), i.addEventListener("toggle", p), e.setAttribute("aria-expanded", String(l())), l() && (d(), u = D(d)), () => {
253
+ i.removeEventListener("beforetoggle", f), i.removeEventListener("toggle", p), u?.(), u = null, c(i);
254
+ };
255
+ }
256
+ };
257
+ function A(e = document) {
258
+ return m(e, [k]);
259
+ }
260
+ // src/components/tooltip.ts
261
+ var j = 300, M = 120, N = 8;
262
+ function P(e) {
263
+ try {
264
+ return e.matches(":focus-visible");
265
+ } catch {
266
+ return !0;
267
+ }
268
+ }
269
+ function F(e) {
270
+ let t = e.ownerDocument, n = e.getAttribute("data-eds-tooltip"), r = [...n && !g(n) ? [n] : [], ...(e.getAttribute("aria-describedby") ?? "").split(/\s+/)];
271
+ for (let e of r) {
272
+ if (!e) continue;
273
+ let n = t.getElementById(e);
274
+ if (n && (n.classList.contains("eds-tooltip") || n.getAttribute("role") === "tooltip")) return n;
275
+ }
276
+ return null;
277
+ }
278
+ var I = {
279
+ name: "tooltip",
280
+ selector: "[data-eds-tooltip]",
281
+ bind(e) {
282
+ let t = F(e);
283
+ if (!t) return;
284
+ let n = e.ownerDocument;
285
+ if (t.hasAttribute("popover") || t.setAttribute("popover", "manual"), t.hasAttribute("role") || t.setAttribute("role", "tooltip"), t.id) {
286
+ let n = (e.getAttribute("aria-describedby") ?? "").split(/\s+/).filter(Boolean);
287
+ n.includes(t.id) || e.setAttribute("aria-describedby", [...n, t.id].join(" "));
288
+ }
289
+ let r = e.getAttribute("data-eds-tooltip") || t.getAttribute("data-placement"), i = g(r) ? r : "top", a = !1, l = !1, u = !1, d = !1, f = !1, p = null, m = null, h = null, _ = (e) => {
290
+ e && clearTimeout(e);
291
+ }, v = () => {
292
+ f && E(e, t, "tooltip", i, N);
293
+ }, y = () => {
294
+ p = null, !f && e.isConnected && (f = !0, s(t), v(), h = D(v));
295
+ }, b = () => {
296
+ m = null, _(p), p = null, f && (f = !1, h?.(), h = null, c(t));
297
+ }, x = () => {
298
+ a || u || l || (d = !1), !d && (a || l || u) ? (_(m), m = null, !f && !p && (p = setTimeout(y, u || l ? 0 : 300))) : (_(p), p = null, f && !m ? m = setTimeout(b, M) : f || _(m));
299
+ }, S = (e) => {
300
+ e.pointerType !== "touch" && (a = !0, x());
301
+ }, C = () => {
302
+ a = !1, x();
303
+ }, w = () => {
304
+ l = !0, x();
305
+ }, T = () => {
306
+ l = !1, x();
307
+ }, O = () => {
308
+ P(e) && (u = !0, x());
309
+ }, k = () => {
310
+ u = !1, x();
311
+ }, A = (e) => {
312
+ e.key === "Escape" && f && (d = !0, _(m), b(), e.preventDefault());
313
+ }, j = () => {
314
+ f && (d = !0, b());
315
+ }, I = (e) => {
316
+ e.newState === "closed" && f && !o(t, ":popover-open") && (f = !1, h?.(), h = null);
317
+ };
318
+ return e.addEventListener("pointerenter", S), e.addEventListener("pointerleave", C), e.addEventListener("focusin", O), e.addEventListener("focusout", k), e.addEventListener("pointerdown", j), t.addEventListener("pointerenter", w), t.addEventListener("pointerleave", T), t.addEventListener("toggle", I), n.addEventListener("keydown", A, !0), () => {
319
+ e.removeEventListener("pointerenter", S), e.removeEventListener("pointerleave", C), e.removeEventListener("focusin", O), e.removeEventListener("focusout", k), e.removeEventListener("pointerdown", j), t.removeEventListener("pointerenter", w), t.removeEventListener("pointerleave", T), t.removeEventListener("toggle", I), n.removeEventListener("keydown", A, !0), _(p), _(m), b();
320
+ };
321
+ }
322
+ };
323
+ function L(e = document) {
324
+ return m(e, [I]);
325
+ }
326
+ export { t as _, k as a, i as c, r as d, n as f, s as g, o as h, A as i, u as l, c as m, L as n, m as o, a as p, I as r, h as s, j as t, f as u, d as v };
@@ -0,0 +1,117 @@
1
+ import { o as e } from "./config-DFz_FB2q.js";
2
+ import { a as t, c as n, s as r, t as i } from "./model-DBuawlqz.js";
3
+ // src/export/zip.ts
4
+ var a = (() => {
5
+ let e = /* @__PURE__ */ new Uint32Array(256);
6
+ for (let t = 0; t < 256; t += 1) {
7
+ let n = t;
8
+ for (let e = 0; e < 8; e += 1) n = n & 1 ? 3988292384 ^ n >>> 1 : n >>> 1;
9
+ e[t] = n >>> 0;
10
+ }
11
+ return e;
12
+ })();
13
+ function o(e) {
14
+ let t = 4294967295;
15
+ for (let n = 0; n < e.length; n += 1) t = (a[(t ^ (e[n] ?? 0)) & 255] ?? 0) ^ t >>> 8;
16
+ return (t ^ 4294967295) >>> 0;
17
+ }
18
+ function s(e, t = /* @__PURE__ */ new Date()) {
19
+ let n = new TextEncoder(), r = Math.max(1980, t.getFullYear()), i = t.getHours() << 11 | t.getMinutes() << 5 | t.getSeconds() >> 1, a = r - 1980 << 9 | t.getMonth() + 1 << 5 | t.getDate(), s = e.map((e) => ({
20
+ ...e,
21
+ nameBytes: n.encode(e.name),
22
+ crc: o(e.data)
23
+ })), c = s.reduce((e, t) => e + 30 + t.nameBytes.length + t.data.length, 0), l = s.reduce((e, t) => e + 46 + t.nameBytes.length, 0), u = new Uint8Array(c + l + 22), d = new DataView(u.buffer), f = 0, p = [];
24
+ for (let e of s) p.push(f), d.setUint32(f, 67324752, !0), d.setUint16(f + 4, 20, !0), d.setUint16(f + 6, 2048, !0), d.setUint16(f + 8, 0, !0), d.setUint16(f + 10, i, !0), d.setUint16(f + 12, a, !0), d.setUint32(f + 14, e.crc, !0), d.setUint32(f + 18, e.data.length, !0), d.setUint32(f + 22, e.data.length, !0), d.setUint16(f + 26, e.nameBytes.length, !0), d.setUint16(f + 28, 0, !0), u.set(e.nameBytes, f + 30), u.set(e.data, f + 30 + e.nameBytes.length), f += 30 + e.nameBytes.length + e.data.length;
25
+ let m = f;
26
+ return s.forEach((e, t) => {
27
+ d.setUint32(f, 33639248, !0), d.setUint16(f + 4, 20, !0), d.setUint16(f + 6, 20, !0), d.setUint16(f + 8, 2048, !0), d.setUint16(f + 10, 0, !0), d.setUint16(f + 12, i, !0), d.setUint16(f + 14, a, !0), d.setUint32(f + 16, e.crc, !0), d.setUint32(f + 20, e.data.length, !0), d.setUint32(f + 24, e.data.length, !0), d.setUint16(f + 28, e.nameBytes.length, !0), d.setUint16(f + 30, 0, !0), d.setUint16(f + 32, 0, !0), d.setUint16(f + 34, 0, !0), d.setUint16(f + 36, 0, !0), d.setUint32(f + 38, 0, !0), d.setUint32(f + 42, p[t] ?? 0, !0), u.set(e.nameBytes, f + 46), f += 46 + e.nameBytes.length;
28
+ }), d.setUint32(f, 101010256, !0), d.setUint16(f + 4, 0, !0), d.setUint16(f + 6, 0, !0), d.setUint16(f + 8, s.length, !0), d.setUint16(f + 10, s.length, !0), d.setUint32(f + 12, f - m, !0), d.setUint32(f + 16, m, !0), d.setUint16(f + 20, 0, !0), u;
29
+ }
30
+ // src/export/xlsx.ts
31
+ var c = "http://schemas.openxmlformats.org/spreadsheetml/2006/main", l = "http://schemas.openxmlformats.org/officeDocument/2006/relationships", u = "http://schemas.openxmlformats.org/package/2006/relationships", d = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n", f = 1048576, p = 16384, m = {
32
+ header: 1,
33
+ headerRight: 2,
34
+ integer: 3,
35
+ decimal2: 4,
36
+ decimalMany: 5,
37
+ currency: 6,
38
+ date: 7,
39
+ dateTime: 8,
40
+ percent: 9
41
+ }, h = /[\u0000-\u0008\u000B\u000C\u000E-\u001F￾￿]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, g = (e) => e.replace(h, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
42
+ function _(t) {
43
+ let n = e().exportSheet, r = Array.from((t ?? "").replace(/[[\]:*?/\\\u0000-\u001f]/g, " ")).join("").replace(/\s+/g, " ").trim(), i = Array.from(r).slice(0, 31).join("").replace(/^'+|'+$/g, "").trim();
44
+ return i === "" ? n.slice(0, 31) : i;
45
+ }
46
+ function v(e) {
47
+ let t = e, n = "";
48
+ do
49
+ n = String.fromCharCode(65 + t % 26) + n, t = Math.floor(t / 26) - 1;
50
+ while (t >= 0);
51
+ return n;
52
+ }
53
+ function y(e) {
54
+ let t = Date.UTC(e.year, e.month - 1, e.day, e.hour, e.minute, e.second) - Date.UTC(1899, 11, 30);
55
+ return Number((t / 864e5).toFixed(9));
56
+ }
57
+ function b(e) {
58
+ let t = Math.abs(e).toFixed(6).replace(/0+$/, ""), n = t.indexOf(".");
59
+ return n < 0 ? 0 : t.length - n - 1;
60
+ }
61
+ function x(e) {
62
+ return t(e).datePattern.map((e) => "literal" in e ? e.literal.replace(/[^/.-]/g, (e) => `\\${e}`) : e.part === "d" ? "dd" : e.part === "m" ? "mm" : "yyyy").join("");
63
+ }
64
+ function S(e) {
65
+ let t = x(e), n = (e, t) => `<numFmt numFmtId="${e}" formatCode="${g(t)}"/>`, r = (e, t = "", n = 0, r = 0, i = 0) => `<xf numFmtId="${e}" fontId="${n}" fillId="${r}" borderId="${i}" xfId="0"${e ? " applyNumberFormat=\"1\"" : ""}${n ? " applyFont=\"1\"" : ""}${r ? " applyFill=\"1\"" : ""}${i ? " applyBorder=\"1\"" : ""}` + (t ? ` applyAlignment="1">${t}</xf>` : "/>");
66
+ return `${d}<styleSheet xmlns="${c}"><numFmts count="4">${n(164, "\"R$\"\\ #,##0.00")}${n(165, t)}${n(166, `${t}\\ hh:mm`)}${n(167, "#,##0.######")}</numFmts><fonts count="2"><font><sz val="11"/><name val="Calibri"/><family val="2"/></font><font><b/><sz val="11"/><name val="Calibri"/><family val="2"/></font></fonts><fills count="3"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill><fill><patternFill patternType="solid"><fgColor rgb="FFF1F5F9"/><bgColor indexed="64"/></patternFill></fill></fills><borders count="2"><border><left/><right/><top/><bottom/><diagonal/></border><border><left/><right/><top/><bottom style="thin"><color rgb="FF94A3B8"/></bottom><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="10">` + r(0) + r(0, "", 1, 2, 1) + r(0, "<alignment horizontal=\"right\"/>", 1, 2, 1) + r(3) + r(4) + r(167) + r(164) + r(165) + r(166) + r(10) + "</cellXfs><cellStyles count=\"1\"><cellStyle name=\"Normal\" xfId=\"0\" builtinId=\"0\"/></cellStyles></styleSheet>";
67
+ }
68
+ var C = (e) => e.type === "number" || e.type === "currency" || e.type === "percent";
69
+ function w(e, t = {}) {
70
+ let { columns: a, rows: o } = r(e), h = n(t.locale);
71
+ if (a.length > p) throw RangeError(`XLSX aceita no máximo ${p} colunas.`);
72
+ if (o.length + 1 > f) throw RangeError(`XLSX aceita no máximo ${f} linhas.`);
73
+ let x = /* @__PURE__ */ new Map(), w = 0, T = (e) => {
74
+ w += 1;
75
+ let t = x.get(e);
76
+ return t === void 0 && (t = x.size, x.set(e, t)), t;
77
+ }, E = a.map((e, t) => {
78
+ if (e.type === "currency") return m.currency;
79
+ if (e.type === "percent") return m.percent;
80
+ let n = 0;
81
+ for (let e of o) {
82
+ let r = e[t];
83
+ r?.kind === "number" && (n = Math.max(n, b(r.value)));
84
+ }
85
+ return n === 0 ? m.integer : n <= 2 ? m.decimal2 : m.decimalMany;
86
+ }), D = a.map((e) => Array.from(e.label).length * 1.15), O = [], k = a.map((e, t) => `<c r="${v(t)}1" s="${C(e) ? m.headerRight : m.header}" t="s"><v>${T(e.label)}</v></c>`).join("");
87
+ O.push(`<row r="1">${k}</row>`), o.forEach((e, t) => {
88
+ let n = t + 2, r = [];
89
+ e.forEach((e, t) => {
90
+ let o = a[t];
91
+ if (!o || e.kind === "empty") return;
92
+ let s = `${v(t)}${n}`, c = i(e, o.type, "view", h), l = Math.max(...c.split(/\r\n|\r|\n/).map((e) => Array.from(e).length));
93
+ if (D[t] = Math.max(D[t] ?? 0, l), e.kind === "number") r.push(`<c r="${s}" s="${E[t] ?? 0}"><v>${e.value}</v></c>`);
94
+ else if (e.kind === "date" && y(e) >= 61) {
95
+ let t = e.time ? m.dateTime : m.date;
96
+ r.push(`<c r="${s}" s="${t}"><v>${y(e)}</v></c>`);
97
+ } else r.push(`<c r="${s}" t="s"><v>${T(c)}</v></c>`);
98
+ }), O.push(`<row r="${n}">${r.join("")}</row>`);
99
+ });
100
+ let A = v(Math.max(0, a.length - 1)), j = `A1:${A}${o.length + 1}`, M = `${d}<worksheet xmlns="${c}" xmlns:r="${l}"><dimension ref="${j}"/><sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft" activeCell="A2" sqref="A2"/></sheetView></sheetViews><sheetFormatPr defaultRowHeight="15"/>${a.length > 0 ? `<cols>${a.map((e, t) => {
101
+ let n = Math.min(60, Math.max(8, Math.ceil((D[t] ?? 0) + 2)));
102
+ return `<col min="${t + 1}" max="${t + 1}" width="${n}" customWidth="1"/>`;
103
+ }).join("")}</cols>` : ""}<sheetData>${O.join("")}</sheetData>` + (a.length > 0 ? `<autoFilter ref="${j}"/>` : "") + "<pageMargins left=\"0.7\" right=\"0.7\" top=\"0.75\" bottom=\"0.75\" header=\"0.3\" footer=\"0.3\"/></worksheet>", N = `${d}<sst xmlns="${c}" count="${w}" uniqueCount="${x.size}">` + Array.from(x.keys()).map((e) => `<si><t xml:space="preserve">${g(e)}</t></si>`).join("") + "</sst>", P = _(t.sheetName ?? t.title), F = `'${P.replace(/'/g, "''")}'`, I = a.length > 0 ? `<definedNames><definedName name="_xlnm._FilterDatabase" localSheetId="0" hidden="1">${g(F)}!$A$1:$${A}$${o.length + 1}</definedName></definedNames>` : "", L = `${d}<workbook xmlns="${c}" xmlns:r="${l}"><bookViews><workbookView/></bookViews><sheets><sheet name="${g(P)}" sheetId="1" r:id="rId1"/></sheets>${I}</workbook>`, R = (e, t, n) => `<Relationship Id="${e}" Type="${l}/${t}" Target="${n}"/>`, z = "application/vnd.openxmlformats-officedocument.spreadsheetml", B = new TextEncoder(), V = (e, t) => ({
104
+ name: e,
105
+ data: B.encode(t)
106
+ });
107
+ return s([
108
+ V("[Content_Types].xml", `${d}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="${z}.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="${z}.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="${z}.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="${z}.sharedStrings+xml"/></Types>`),
109
+ V("_rels/.rels", `${d}<Relationships xmlns="${u}">${R("rId1", "officeDocument", "xl/workbook.xml")}</Relationships>`),
110
+ V("xl/workbook.xml", L),
111
+ V("xl/_rels/workbook.xml.rels", `${d}<Relationships xmlns="${u}">` + R("rId1", "worksheet", "worksheets/sheet1.xml") + R("rId2", "styles", "styles.xml") + R("rId3", "sharedStrings", "sharedStrings.xml") + "</Relationships>"),
112
+ V("xl/worksheets/sheet1.xml", M),
113
+ V("xl/styles.xml", S(h)),
114
+ V("xl/sharedStrings.xml", N)
115
+ ], t.now ?? /* @__PURE__ */ new Date());
116
+ }
117
+ export { w as t };