impact-nova 1.7.27 → 1.7.29

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.
@@ -1,13 +1,13 @@
1
1
  import { jsx as e, jsxs as h, Fragment as T } from "react/jsx-runtime";
2
- import { useState as A, useEffect as J } from "react";
3
- import { cn as g } from "../../../../lib/utils.js";
4
- import { useGridHeader as Q } from "./context/grid-header-context.js";
5
- import { HeaderInfo as W } from "./components/header-info.js";
6
- import { Checkbox as X } from "../../checkbox.js";
7
- import { TruncatedText as Y } from "./components/truncated-text.js";
8
- import { HeaderSearchInput as $ } from "./header-search-input.js";
2
+ import { useState as F, useEffect as W } from "react";
3
+ import { cn as C } from "../../../../lib/utils.js";
4
+ import { useGridHeader as X } from "./context/grid-header-context.js";
5
+ import { HeaderInfo as Y } from "./components/header-info.js";
6
+ import { Checkbox as $ } from "../../checkbox.js";
7
+ import { TruncatedText as ee } from "./components/truncated-text.js";
8
+ import { HeaderSearchInput as te } from "./header-search-input.js";
9
9
  import { useImpactNovaI18n as V } from "../../../../i18n/ImpactNovaI18nContext.js";
10
- const ee = () => /* @__PURE__ */ h(T, { children: [
10
+ const re = () => /* @__PURE__ */ h(T, { children: [
11
11
  /* @__PURE__ */ e("span", { className: "sort-asc-icon inline-flex transition-colors text-content-tertiary hover:text-brand-variant-hover", children: /* @__PURE__ */ h(
12
12
  "svg",
13
13
  {
@@ -50,61 +50,61 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
50
50
  children: /* @__PURE__ */ e("path", { d: "M7.85714 10.8967V5.44444H6.42857V10.8967H4.28571L7.14286 14L10 10.8967H7.85714ZM2.85714 0L0 3.10333H2.14286V8.55556H3.57143V3.10333H5.71429L2.85714 0ZM7.85714 10.8967V5.44444H6.42857V10.8967H4.28571L7.14286 14L10 10.8967H7.85714ZM2.85714 0L0 3.10333H2.14286V8.55556H3.57143V3.10333H5.71429L2.85714 0Z", fill: "currentColor" })
51
51
  }
52
52
  ) })
53
- ] }), te = ({ api: r }) => {
54
- const { t } = V(), [C, H] = A(!1), [S, s] = A(!1);
55
- J(() => {
56
- if (!r) return;
57
- const m = r.getGridOption?.("rowModelType") === "serverSide", x = () => {
53
+ ] }), ne = ({ api: n }) => {
54
+ const { t } = V(), [p, H] = F(!1), [S, c] = F(!1);
55
+ W(() => {
56
+ if (!n) return;
57
+ const u = n.getGridOption?.("rowModelType") === "serverSide", x = () => {
58
58
  let l = !1, i = !1;
59
- if (m) {
60
- const f = r.getServerSideSelectionState?.();
59
+ if (u) {
60
+ const f = n.getServerSideSelectionState?.();
61
61
  if (f) {
62
- const { selectAll: c, toggledNodes: b } = f, w = b && b.length > 0;
63
- c && !w ? (l = !0, i = !1) : c && w || !c && w ? (l = !1, i = !0) : (l = !1, i = !1);
62
+ const { selectAll: d, toggledNodes: b } = f, w = b && b.length > 0;
63
+ d && !w ? (l = !0, i = !1) : d && w || !d && w ? (l = !1, i = !0) : (l = !1, i = !1);
64
64
  }
65
65
  } else {
66
- const f = r.getSelectedRows().length, c = r.getDisplayedRowCount();
67
- f === 0 ? (l = !1, i = !1) : f === c && c > 0 ? (l = !0, i = !1) : (l = !1, i = !0);
66
+ const f = n.getSelectedRows().length, d = n.getDisplayedRowCount();
67
+ f === 0 ? (l = !1, i = !1) : f === d && d > 0 ? (l = !0, i = !1) : (l = !1, i = !0);
68
68
  }
69
- H(l), s(i);
69
+ H(l), c(i);
70
70
  };
71
71
  x();
72
- const u = () => {
72
+ const m = () => {
73
73
  x();
74
74
  };
75
- return r.addEventListener("selectionChanged", u), r.addEventListener("modelUpdated", u), () => {
76
- r.removeEventListener("selectionChanged", u), r.removeEventListener("modelUpdated", u);
75
+ return n.addEventListener("selectionChanged", m), n.addEventListener("modelUpdated", m), () => {
76
+ n.removeEventListener("selectionChanged", m), n.removeEventListener("modelUpdated", m);
77
77
  };
78
- }, [r]);
79
- const a = (m) => {
80
- m === !0 ? r.selectAll() : r.deselectAll();
78
+ }, [n]);
79
+ const s = (u) => {
80
+ u === !0 ? n.selectAll() : n.deselectAll();
81
81
  };
82
82
  return /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(
83
- X,
83
+ $,
84
84
  {
85
- checked: S ? "indeterminate" : C,
86
- onCheckedChange: (m) => {
87
- a(m);
85
+ checked: S ? "indeterminate" : p,
86
+ onCheckedChange: (u) => {
87
+ s(u);
88
88
  },
89
89
  "aria-label": t("aria.toggleSelection"),
90
90
  className: "m-0"
91
91
  }
92
92
  ) });
93
- }, me = (r) => {
93
+ }, fe = (n) => {
94
94
  const {
95
95
  displayName: t,
96
- enableSorting: C,
96
+ enableSorting: p,
97
97
  enableMenu: H,
98
98
  progressSort: S,
99
- column: s,
100
- api: a,
101
- handleInlineSearch: m,
99
+ column: c,
100
+ api: s,
101
+ handleInlineSearch: u,
102
102
  handleClearSearchInline: x,
103
- onColumnSearchClick: u,
103
+ onColumnSearchClick: m,
104
104
  onAdvanceSearchClick: l,
105
105
  toggleAdvanceSearch: i,
106
106
  isSearchable: f = !1,
107
- advanceSearchEnabled: c = !1,
107
+ advanceSearchEnabled: d = !1,
108
108
  // Select params
109
109
  selectOptions: b,
110
110
  isMultiSelect: w,
@@ -116,9 +116,9 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
116
116
  enableSpaceSplitting: B,
117
117
  enableBooleanParsing: E,
118
118
  enableDateParsing: R
119
- } = r, d = Q(), { t: N } = V(), n = s.getColDef(), p = s.getColId(), k = s.isFilterActive(), j = s.getSort(), y = s.getSortIndex(), O = !!j, z = y != null && (y > 0 || a.getColumnState().filter((o) => o.sort).length > 1), G = O && z, I = n?.filter || "agTextColumnFilter", v = I === "agNumberColumnFilter" || (Array.isArray(n?.type) ? n.type.some((o) => o === "number" || o === "numericColumn") : n?.type === "number" || n?.type === "numericColumn");
120
- I === "agDateColumnFilter" || (Array.isArray(n?.type) ? n.type.includes("dateColumn") : n?.type);
121
- const L = a.getGridOption("context")?.activeSearchColumnId === p, M = ![
119
+ } = n, a = X(), { t: N } = V(), o = c.getColDef(), g = c.getColId(), k = c.isFilterActive(), j = c.getSort(), y = c.getSortIndex(), O = !!j, z = y != null && (y > 0 || s.getColumnState().filter((r) => r.sort).length > 1), G = O && z, I = o?.filter || "agTextColumnFilter", v = I === "agNumberColumnFilter" || (Array.isArray(o?.type) ? o.type.some((r) => r === "number" || r === "numericColumn") : o?.type === "number" || o?.type === "numericColumn");
120
+ I === "agDateColumnFilter" || (Array.isArray(o?.type) ? o.type.includes("dateColumn") : o?.type);
121
+ const M = s.getGridOption("context")?.activeSearchColumnId === g, U = a?.activeMenuColumnId === g, L = ![
122
122
  "agTextColumnFilter",
123
123
  "agNumberColumnFilter",
124
124
  "agDateColumnFilter",
@@ -128,32 +128,34 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
128
128
  // Defaults to text/set
129
129
  void 0
130
130
  // Defaults to text
131
- ].includes(n?.filter), F = (o) => {
132
- o.stopPropagation(), C && S && S(o.shiftKey);
133
- }, U = (o) => {
134
- if (o.stopPropagation(), u && u(r), M) {
135
- a.showColumnFilter ? a.showColumnFilter(p) : a.showColumnMenu(p);
131
+ ].includes(o?.filter), A = (r) => {
132
+ r.stopPropagation(), p && S && S(r.shiftKey);
133
+ }, K = (r) => {
134
+ if (r.stopPropagation(), m && m(n), L) {
135
+ s.showColumnFilter ? s.showColumnFilter(g) : s.showColumnMenu(g);
136
136
  return;
137
137
  }
138
- d && (L ? d.closeSearch() : d.openSearch(p));
139
- }, K = (o) => /* @__PURE__ */ e("span", { onClick: (q) => q.stopPropagation(), children: /* @__PURE__ */ e(
140
- W,
138
+ a && (M ? a.closeSearch() : a.openSearch(g));
139
+ }, q = (r) => {
140
+ r.preventDefault(), r.stopPropagation(), a && a.openMenu(g, r.currentTarget, "column");
141
+ }, J = (r) => /* @__PURE__ */ e("span", { onClick: (Q) => Q.stopPropagation(), children: /* @__PURE__ */ e(
142
+ Y,
141
143
  {
142
- ...r,
143
- className: o
144
+ ...n,
145
+ className: r
144
146
  }
145
147
  ) });
146
- return L && d && !M ? /* @__PURE__ */ e(
147
- $,
148
+ return M && a && !L ? /* @__PURE__ */ e(
149
+ te,
148
150
  {
149
- column: s,
150
- api: a,
151
- onClose: () => d.closeSearch(),
152
- handleInlineSearch: m,
153
- handleClearSearchInline: x ? () => x(r) : void 0,
151
+ column: c,
152
+ api: s,
153
+ onClose: () => a.closeSearch(),
154
+ handleInlineSearch: u,
155
+ handleClearSearchInline: x ? () => x(n) : void 0,
154
156
  onAdvanceSearchClick: l,
155
157
  toggleAdvanceSearch: i,
156
- advanceSearchEnabled: c,
158
+ advanceSearchEnabled: d,
157
159
  selectOptions: b,
158
160
  isMultiSelect: w,
159
161
  onSelectScrollToBottom: D,
@@ -167,70 +169,71 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
167
169
  ) : /* @__PURE__ */ h(
168
170
  "div",
169
171
  {
170
- className: g(
172
+ className: C(
171
173
  "ag-header-cell-label flex items-center w-full group min-w-0 h-full",
172
174
  v ? "flex-row-reverse" : "flex-row",
173
175
  // Center the content area if it's a selection column
174
- n?.headerCheckboxSelection && (!t || t.trim() === "") ? "justify-center" : ""
176
+ o?.headerCheckboxSelection && (!t || t.trim() === "") ? "justify-center" : ""
175
177
  ),
176
- "data-selection-column": n?.headerCheckboxSelection && (!t || t.trim() === "") ? "true" : void 0,
178
+ "data-selection-column": o?.headerCheckboxSelection && (!t || t.trim() === "") ? "true" : void 0,
179
+ onContextMenu: q,
177
180
  children: [
178
181
  /* @__PURE__ */ e(
179
182
  "div",
180
183
  {
181
- className: g(
184
+ className: C(
182
185
  "ag-header-cell-text relative group flex min-w-0",
183
186
  // Use items-start for non-numeric to allow 2-line text expansion
184
187
  v ? "items-center" : "items-start",
185
188
  // Remove flex-1 if we are centering via parent's justify-center
186
- !(n?.headerCheckboxSelection && (!t || t.trim() === "")) && "flex-1",
189
+ !(o?.headerCheckboxSelection && (!t || t.trim() === "")) && "flex-1",
187
190
  v ? "flex-row-reverse" : "flex-row",
188
- C ? "sortable cursor-pointer" : ""
191
+ p ? "sortable cursor-pointer" : ""
189
192
  ),
190
- onClick: C ? F : void 0,
191
- children: /* @__PURE__ */ h("div", { className: g(
193
+ onClick: p ? A : void 0,
194
+ children: /* @__PURE__ */ h("div", { className: C(
192
195
  "flex min-w-0",
193
196
  // Use items-start for non-numeric to allow 2-line text expansion
194
197
  v ? "flex-row-reverse items-center" : "flex-row items-start",
195
198
  // If it's a checkbox-only header, ensure it shrinks to content for centering
196
- n?.headerCheckboxSelection && (!t || t.trim() === "") ? "justify-center items-center" : "gap-1 flex-1"
199
+ o?.headerCheckboxSelection && (!t || t.trim() === "") ? "justify-center items-center" : "gap-1 flex-1"
197
200
  ), children: [
198
- n?.headerCheckboxSelection && /* @__PURE__ */ e(te, { api: a }),
199
- t && t.trim() !== "" && t !== N("gridHeader.selection") && /* @__PURE__ */ e(Y, { text: t }),
200
- t && t.trim() !== "" && K(g(
201
+ o?.headerCheckboxSelection && /* @__PURE__ */ e(ne, { api: s }),
202
+ t && t.trim() !== "" && t !== N("gridHeader.selection") && /* @__PURE__ */ e(ee, { text: t }),
203
+ t && t.trim() !== "" && J(C(
201
204
  "text-content-tertiary hover:text-brand-variant-hover transition-colors",
202
205
  v ? "mr-1" : "ml-1"
203
206
  ))
204
207
  ] })
205
208
  }
206
209
  ),
207
- !(n?.headerCheckboxSelection && (!t || t.trim() === "")) && /* @__PURE__ */ h(
210
+ !(o?.headerCheckboxSelection && (!t || t.trim() === "")) && /* @__PURE__ */ h(
208
211
  "div",
209
212
  {
210
- className: g(
213
+ className: C(
211
214
  "flex items-center shrink-0 group gap-1",
212
215
  v ? "flex-row-reverse" : "flex-row"
213
216
  ),
214
217
  children: [
215
- C && /* @__PURE__ */ h(
218
+ p && /* @__PURE__ */ h(
216
219
  "div",
217
220
  {
218
221
  className: "ag-sort-indicator-container cursor-pointer flex items-center",
219
- onClick: F,
222
+ onClick: A,
220
223
  children: [
221
224
  G && /* @__PURE__ */ e("span", { className: "ag-sort-order text-[10px] font-bold text-content-tertiary mr-0.5", children: y + 1 }),
222
- /* @__PURE__ */ e("span", { className: "ag-sort-indicator-icon", children: /* @__PURE__ */ e(ee, {}) })
225
+ /* @__PURE__ */ e("span", { className: "ag-sort-indicator-icon", children: /* @__PURE__ */ e(re, {}) })
223
226
  ]
224
227
  }
225
228
  ),
226
229
  f && /* @__PURE__ */ h(
227
230
  "span",
228
231
  {
229
- className: g(
232
+ className: C(
230
233
  "relative cursor-pointer flex items-center shrink-0 duration-200 text-content-tertiary hover:text-brand-variant-hover transition-colors",
231
234
  k ? "opacity-100 w-auto" : "opacity-0 w-0 overflow-hidden group-hover:opacity-100 group-hover:w-auto"
232
235
  ),
233
- onClick: U,
236
+ onClick: K,
234
237
  title: N(k ? "gridHeader.activeFilter" : "gridHeader.search"),
235
238
  children: [
236
239
  /* @__PURE__ */ e("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z", fill: "currentColor" }) }),
@@ -238,15 +241,15 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
238
241
  ]
239
242
  }
240
243
  ),
241
- H && !n?.suppressHeaderMenuButton && /* @__PURE__ */ e("div", { className: "custom-ag-header-icons relative", children: /* @__PURE__ */ e(
244
+ H && !o?.suppressHeaderMenuButton && /* @__PURE__ */ e("div", { className: "custom-ag-header-icons relative", children: /* @__PURE__ */ e(
242
245
  "button",
243
246
  {
244
- className: g(
247
+ className: C(
245
248
  "custom-ag-menu-icon-button cursor-pointer flex items-center shrink-0 overflow-hidden transition-colors duration-200 outline-none focus:outline-none focus:ring-0 text-content-tertiary hover:text-brand-variant-hover",
246
- d?.activeMenuColumnId === p ? "opacity-100 w-auto" : "w-0 opacity-0 group-hover:w-auto group-hover:opacity-100"
249
+ U ? "opacity-100 w-auto" : "w-0 opacity-0 group-hover:w-auto group-hover:opacity-100"
247
250
  ),
248
- onClick: (o) => {
249
- o.stopPropagation(), d && d.openMenu(p, o.currentTarget);
251
+ onClick: (r) => {
252
+ r.stopPropagation(), a && a.openMenu(g, r.currentTarget);
250
253
  },
251
254
  children: /* @__PURE__ */ e("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ e("path", { d: "M14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18ZM14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12ZM14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6Z", fill: "currentColor" }) })
252
255
  }
@@ -259,5 +262,5 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
259
262
  );
260
263
  };
261
264
  export {
262
- me as CustomHeader
265
+ fe as CustomHeader
263
266
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as m, jsxs as ne } from "react/jsx-runtime";
2
- import { lazy as re, useRef as H, useState as C, useCallback as v, useMemo as y, useEffect as oe, Suspense as le } from "react";
2
+ import { lazy as re, useRef as b, useState as j, useCallback as v, useMemo as C, useEffect as oe, Suspense as le } from "react";
3
3
  import { ModuleRegistry as ie, AllCommunityModule as se, ValidationModule as ue } from "ag-grid-community";
4
4
  import { AllEnterpriseModule as ce } from "ag-grid-enterprise";
5
5
  import { AgGridReact as ae } from "ag-grid-react";
@@ -13,13 +13,13 @@ import { AG_GRID_VALUE_FORMATTERS as ye } from "./value-formatters.js";
13
13
  /* empty css */
14
14
  const be = re(() => import("./headers/advanced-filter/advanced-filter-dialog.js"));
15
15
  ie.registerModules([se, ce, ue]);
16
- const x = "", w = "", _ = (s) => {
16
+ const x = "", I = "", H = (s) => {
17
17
  if (!s) return;
18
18
  const r = s.cellRendererParams?.splits;
19
19
  if (Array.isArray(r) && r.length > 0) return r;
20
20
  const l = s.cellEditorParams?.splits;
21
21
  if (Array.isArray(l) && l.length > 0) return l;
22
- }, K = (s, r) => {
22
+ }, _ = (s, r) => {
23
23
  const l = [];
24
24
  for (const g of r) {
25
25
  const f = g?.field?.split(".").pop();
@@ -44,13 +44,13 @@ const x = "", w = "", _ = (s) => {
44
44
  l.push("");
45
45
  }
46
46
  return l;
47
- }, W = (s) => {
47
+ }, V = (s) => {
48
48
  if (typeof navigator < "u" && navigator.clipboard?.writeText) {
49
- navigator.clipboard.writeText(s).catch(() => V(s));
49
+ navigator.clipboard.writeText(s).catch(() => K(s));
50
50
  return;
51
51
  }
52
- V(s);
53
- }, V = (s) => {
52
+ K(s);
53
+ }, K = (s) => {
54
54
  if (typeof document > "u") return;
55
55
  const r = document.createElement("textarea");
56
56
  r.value = s, r.setAttribute("readonly", ""), r.style.position = "fixed", r.style.top = "0", r.style.left = "0", r.style.opacity = "0", r.style.pointerEvents = "none", document.body.appendChild(r);
@@ -69,11 +69,28 @@ function De({
69
69
  onGridReady: a,
70
70
  ...u
71
71
  }) {
72
- const c = H(null), h = H(null), [F, k] = C(null), [O, E] = C(!1), [G, T] = C(null), [U, I] = C(!1), [j, P] = C(null), [$, D] = C(null), L = v((e) => {
73
- if (!c.current) return;
74
- const t = ge(e);
75
- c.current.setFilterModel(t), c.current.onFilterChanged();
76
- }, []), S = y(() => ({
72
+ const c = b(null), h = b(null), [F, w] = j(null), [P, E] = j(!1), [O, D] = j(null), [W, L] = j(!1), M = b(null), T = b(null), S = b(null), U = v(() => [], []), $ = C(() => ({
73
+ numericColumn: {
74
+ cellClass: "ag-right-aligned-cell",
75
+ headerClass: "ag-right-aligned-header",
76
+ filter: "agNumberColumnFilter"
77
+ },
78
+ currency: {
79
+ cellClass: "ag-right-aligned-cell",
80
+ headerClass: "ag-right-aligned-header",
81
+ filter: "agNumberColumnFilter",
82
+ valueFormatter: (e) => e.value != null ? `$${Number(e.value).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : ""
83
+ },
84
+ percentage: {
85
+ cellClass: "ag-right-aligned-cell",
86
+ headerClass: "ag-right-aligned-header",
87
+ filter: "agNumberColumnFilter",
88
+ valueFormatter: (e) => e.value != null ? `${Number(e.value).toFixed(2)}%` : ""
89
+ },
90
+ dateColumn: {
91
+ filter: "agDateColumnFilter"
92
+ }
93
+ }), []), A = C(() => ({
77
94
  openSearch: (e) => {
78
95
  if (!c.current) return;
79
96
  const t = c.current.getGridOption("context") || {};
@@ -85,23 +102,31 @@ function De({
85
102
  c.current.setGridOption("context", { ...e, activeSearchColumnId: null }), c.current.refreshHeader();
86
103
  },
87
104
  openAdvancedFilter: (e) => {
88
- T(e || null), E(!0);
105
+ D(e || null), E(!0);
89
106
  },
90
107
  closeAdvancedFilter: () => {
91
- E(!1), T(null);
108
+ E(!1), D(null);
92
109
  },
93
110
  applyAdvancedFilter: (e) => {
94
- L(e);
111
+ if (!c.current) return;
112
+ const t = ge(e);
113
+ c.current.setFilterModel(t), c.current.onFilterChanged();
95
114
  },
96
- openMenu: (e, t) => {
97
- P(e), D(t), I(!0);
115
+ openMenu: (e, t, o = "column") => {
116
+ M.current = e, T.current = t, S.current = o, L(!0);
98
117
  },
99
118
  closeMenu: () => {
100
- I(!1), P(null), D(null);
119
+ M.current = null, T.current = null, S.current = null, L(!1);
101
120
  },
102
- activeMenuColumnId: j
103
- }), [L, j]), q = v((e) => {
104
- c.current = e.api, k(e.api);
121
+ // Getters read from refs - O(1) per header, no memory allocation
122
+ get activeMenuColumnId() {
123
+ return M.current;
124
+ },
125
+ get activeMenuVariant() {
126
+ return S.current;
127
+ }
128
+ }), []), q = v((e) => {
129
+ c.current = e.api, w(e.api);
105
130
  const t = e.api.getGridOption("context") || {};
106
131
  e.api.setGridOption("context", { ...t, activeSearchColumnId: null }), a && a(e);
107
132
  }, [a]);
@@ -119,7 +144,7 @@ function De({
119
144
  };
120
145
  return e.addEventListener("keydown", t, !0), () => e.removeEventListener("keydown", t, !0);
121
146
  }, []);
122
- const z = y(() => ({
147
+ const z = C(() => ({
123
148
  headerComponent: pe,
124
149
  // Default cell renderer wraps text in a span so display:flex centering
125
150
  // and text-overflow:ellipsis both work (ellipsis doesn't work on
@@ -146,13 +171,13 @@ function De({
146
171
  headerComponentParams: {
147
172
  ...r?.headerComponentParams
148
173
  }
149
- }), [r]), J = y(() => ({
174
+ }), [r]), J = C(() => ({
150
175
  headerGroupComponent: fe,
151
176
  ...l,
152
177
  headerGroupComponentParams: {
153
178
  ...l?.headerGroupComponentParams
154
179
  }
155
- }), [l]), X = y(() => ({
180
+ }), [l]), X = C(() => ({
156
181
  ...ye,
157
182
  // Always available - value formatters
158
183
  ...u.components,
@@ -162,14 +187,14 @@ function De({
162
187
  }), [f, u.components]), B = v((e) => {
163
188
  const t = e.value;
164
189
  if (t == null || typeof t != "object") return t;
165
- const o = _(e.column?.getColDef());
190
+ const o = H(e.column?.getColDef());
166
191
  if (o && o.length > 0) {
167
- const n = K(t, o);
192
+ const n = _(t, o);
168
193
  if (o.length === 1) {
169
- const d = o[0]?.field?.split(".").pop(), b = d ? t[d] : void 0;
170
- return b && typeof b == "object" && "value" in b ? b.value ?? "" : n[0];
194
+ const d = o[0]?.field?.split(".").pop(), y = d ? t[d] : void 0;
195
+ return y && typeof y == "object" && "value" in y ? y.value ?? "" : n[0];
171
196
  }
172
- return w + n.join(x);
197
+ return I + n.join(x);
173
198
  }
174
199
  const i = Object.entries(t).map(([, n]) => n && typeof n == "object" && "value" in n ? n.value : typeof n != "object" && typeof n < "u" ? n : null).filter((n) => n != null);
175
200
  return i.length === 0 ? "" : i.length === 1 ? i[0] : i.join(x);
@@ -186,8 +211,8 @@ function De({
186
211
  return e.value;
187
212
  }, []), Y = v((e) => {
188
213
  const t = e?.data ?? "";
189
- if (!t.includes(x) && !t.includes(w)) {
190
- W(t);
214
+ if (!t.includes(x) && !t.includes(I)) {
215
+ V(t);
191
216
  return;
192
217
  }
193
218
  const o = [], i = t.split(`
@@ -198,25 +223,25 @@ function De({
198
223
  o.push("");
199
224
  continue;
200
225
  }
201
- const A = d.split(" ").map((p) => p.startsWith(w) ? { isSplit: !0, slots: p.slice(1).split(x) } : { isSplit: !1, slots: p.split(x) }), N = Math.max(1, ...A.map((p) => p.slots.length));
226
+ const k = d.split(" ").map((p) => p.startsWith(I) ? { isSplit: !0, slots: p.slice(1).split(x) } : { isSplit: !1, slots: p.split(x) }), N = Math.max(1, ...k.map((p) => p.slots.length));
202
227
  if (N === 1) {
203
- o.push(A.map((p) => p.slots[0] ?? "").join(" "));
228
+ o.push(k.map((p) => p.slots[0] ?? "").join(" "));
204
229
  continue;
205
230
  }
206
231
  for (let p = 0; p < N; p++) {
207
- const te = A.map((R) => !R.isSplit && R.slots.length === 1 ? R.slots[0] : R.slots[p] ?? "");
232
+ const te = k.map((G) => !G.isSplit && G.slots.length === 1 ? G.slots[0] : G.slots[p] ?? "");
208
233
  o.push(te.join(" "));
209
234
  }
210
235
  }
211
- W(o.join(`
236
+ V(o.join(`
212
237
  `));
213
- }, []), M = v((e) => {
238
+ }, []), R = v((e) => {
214
239
  const t = e.value;
215
240
  if (t == null) return "";
216
241
  if (typeof t != "object") return String(t);
217
- const o = _(e.column?.getColDef());
242
+ const o = H(e.column?.getColDef());
218
243
  if (o && o.length > 0) {
219
- const n = K(t, o);
244
+ const n = _(t, o);
220
245
  return o.length === 1 ? n[0] : n.join(`
221
246
  `);
222
247
  }
@@ -232,14 +257,14 @@ function De({
232
257
  }
233
258
  return i.length === 0 ? "" : i.length === 1 ? i[0] : i.join(`
234
259
  `);
235
- }, []), Z = y(() => ({
236
- processCellCallback: M,
260
+ }, []), Z = C(() => ({
261
+ processCellCallback: R,
237
262
  ...u.defaultCsvExportParams ?? {}
238
- }), [M, u.defaultCsvExportParams]), ee = y(() => ({
239
- processCellCallback: M,
263
+ }), [R, u.defaultCsvExportParams]), ee = C(() => ({
264
+ processCellCallback: R,
240
265
  ...u.defaultExcelExportParams ?? {}
241
- }), [M, u.defaultExcelExportParams]);
242
- return /* @__PURE__ */ ne(me.Provider, { value: S, children: [
266
+ }), [R, u.defaultExcelExportParams]);
267
+ return /* @__PURE__ */ ne(me.Provider, { value: A, children: [
243
268
  /* @__PURE__ */ m("div", { ref: h, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ m(
244
269
  ae,
245
270
  {
@@ -257,52 +282,33 @@ function De({
257
282
  suppressHeaderFocus: !1,
258
283
  suppressFocusAfterRefresh: !0,
259
284
  suppressGroupRowsSticky: !0,
260
- columnTypes: {
261
- numericColumn: {
262
- cellClass: "ag-right-aligned-cell",
263
- headerClass: "ag-right-aligned-header",
264
- filter: "agNumberColumnFilter"
265
- },
266
- currency: {
267
- cellClass: "ag-right-aligned-cell",
268
- headerClass: "ag-right-aligned-header",
269
- filter: "agNumberColumnFilter",
270
- valueFormatter: (e) => e.value != null ? `$${Number(e.value).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : ""
271
- },
272
- percentage: {
273
- cellClass: "ag-right-aligned-cell",
274
- headerClass: "ag-right-aligned-header",
275
- filter: "agNumberColumnFilter",
276
- valueFormatter: (e) => e.value != null ? `${Number(e.value).toFixed(2)}%` : ""
277
- },
278
- dateColumn: {
279
- filter: "agDateColumnFilter"
280
- }
281
- },
285
+ columnTypes: $,
282
286
  ...u,
283
287
  defaultCsvExportParams: Z,
284
- defaultExcelExportParams: ee
288
+ defaultExcelExportParams: ee,
289
+ getMainMenuItems: U
285
290
  }
286
291
  ) }),
287
292
  s,
288
293
  /* @__PURE__ */ m(
289
294
  xe,
290
295
  {
291
- isOpen: O,
292
- columnId: G,
296
+ isOpen: P,
297
+ columnId: O,
293
298
  gridApi: F,
294
- onClose: S.closeAdvancedFilter,
295
- onApply: S.applyAdvancedFilter
299
+ onClose: A.closeAdvancedFilter,
300
+ onApply: A.applyAdvancedFilter
296
301
  }
297
302
  ),
298
303
  /* @__PURE__ */ m(
299
304
  Fe,
300
305
  {
301
- isOpen: U,
302
- columnId: j,
306
+ isOpen: W,
307
+ columnId: M.current,
303
308
  gridApi: F,
304
- anchor: $,
305
- onClose: S.closeMenu
309
+ anchor: T.current,
310
+ variant: S.current,
311
+ onClose: A.closeMenu
306
312
  }
307
313
  )
308
314
  ] });
@@ -317,7 +323,7 @@ function xe({
317
323
  if (!s || !r || !l) return null;
318
324
  const a = l.getColumn(r);
319
325
  if (!a) return null;
320
- const u = a.getColDef(), c = u.headerComponentParams, h = he(u), F = h.text !== -1 || h.number !== -1 || h.date !== -1, k = h.set !== -1, E = u.filter === "agMultiColumnFilter" && (F || k) ? "multi" : u.filter === "agNumberColumnFilter" ? "number" : u.filter === "agDateColumnFilter" ? "date" : u.filter === "agSetColumnFilter" || c?.selectOptions ? "select" : "text", G = Ce(l.getFilterModel());
326
+ const u = a.getColDef(), c = u.headerComponentParams, h = he(u), F = h.text !== -1 || h.number !== -1 || h.date !== -1, w = h.set !== -1, E = u.filter === "agMultiColumnFilter" && (F || w) ? "multi" : u.filter === "agNumberColumnFilter" ? "number" : u.filter === "agDateColumnFilter" ? "date" : u.filter === "agSetColumnFilter" || c?.selectOptions ? "select" : "text", O = Ce(l.getFilterModel());
321
327
  return /* @__PURE__ */ m(le, { fallback: null, children: /* @__PURE__ */ m(
322
328
  be,
323
329
  {
@@ -329,7 +335,7 @@ function xe({
329
335
  columnType: E,
330
336
  selectOptions: c?.selectOptions,
331
337
  isMultiSelect: c?.isMultiSelect,
332
- initialModel: G,
338
+ initialModel: O,
333
339
  api: l
334
340
  }
335
341
  ) });
@@ -339,7 +345,8 @@ function Fe({
339
345
  columnId: r,
340
346
  gridApi: l,
341
347
  anchor: g,
342
- onClose: f
348
+ variant: f,
349
+ onClose: a
343
350
  }) {
344
351
  return !s || !r || !l ? null : /* @__PURE__ */ m(
345
352
  ve,
@@ -348,7 +355,8 @@ function Fe({
348
355
  columnId: r,
349
356
  gridApi: l,
350
357
  anchor: g,
351
- onClose: f
358
+ variant: f || "column",
359
+ onClose: a
352
360
  }
353
361
  );
354
362
  }