impact-nova 1.7.28 → 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.
@@ -6,6 +6,8 @@ interface ColumnSettingsMenuProps {
6
6
  columnId: string;
7
7
  gridApi: GridApi;
8
8
  anchor: HTMLElement | null;
9
+ /** Variant determines menu items shown: 'column' shows full menu, 'group' shows only Choose/Reset Columns */
10
+ variant?: 'column' | 'group';
9
11
  }
10
12
  export declare const ColumnSettingsMenu: React.FC<ColumnSettingsMenuProps>;
11
13
  export {};
@@ -1,114 +1,154 @@
1
- import { jsxs as r, jsx as e, Fragment as j } from "react/jsx-runtime";
1
+ import { jsxs as r, jsx as e, Fragment as V } from "react/jsx-runtime";
2
2
  import "react";
3
- import { Settings as F, Checkmark as h, Search as _ } from "../../../../../icons/index.js";
4
- import { DropdownMenu as E, DropdownMenuTrigger as G, DropdownMenuContent as q, DropdownMenuLabel as v, DropdownMenuSeparator as z, DropdownMenuSub as p, DropdownMenuSubTrigger as f, DropdownMenuSubContent as g, DropdownMenuItem as a } from "../../../dropdown-menu.js";
5
- import { useGridHeader as L } from "../context/grid-header-context.js";
6
- import { useImpactNovaI18n as R } from "../../../../../i18n/ImpactNovaI18nContext.js";
7
- const U = ({
8
- isOpen: M,
9
- onClose: c,
10
- columnId: l,
3
+ import { Settings as B, Checkmark as h, Search as W } from "../../../../../icons/index.js";
4
+ import { DropdownMenu as A, DropdownMenuTrigger as _, DropdownMenuContent as F, DropdownMenuItem as i, DropdownMenuLabel as P, DropdownMenuSeparator as T, DropdownMenuSub as f, DropdownMenuSubTrigger as g, DropdownMenuSubContent as C } from "../../../dropdown-menu.js";
5
+ import { useGridHeader as I } from "../context/grid-header-context.js";
6
+ import { useImpactNovaI18n as J } from "../../../../../i18n/ImpactNovaI18nContext.js";
7
+ const $ = ({
8
+ isOpen: x,
9
+ onClose: a,
10
+ columnId: c,
11
11
  gridApi: s,
12
- anchor: O
12
+ anchor: j,
13
+ variant: d = "column"
13
14
  }) => {
14
- const { t } = R(), C = L(), o = s.getColumn(l);
15
- if (!o) return null;
16
- const i = o.getColDef(), x = o.getSort(), S = o.getPinned(), A = i?.sortable !== !1, y = i?.filter || "agTextColumnFilter", H = y === "agNumberColumnFilter" || (Array.isArray(i?.type) ? i.type.includes("numericColumn") : i?.type === "numericColumn"), b = y === "agDateColumnFilter" || (Array.isArray(i?.type) ? i.type.includes("dateColumn") : i?.type === "dateColumn"), u = (n) => {
15
+ const { t: n } = J(), S = I(), u = d === "column" ? s.getColumn(c) : null;
16
+ if (d === "column" && !u) return null;
17
+ const l = u?.getColDef(), b = u?.getSort(), w = u?.getPinned(), q = d === "column" && l?.sortable !== !1, y = l?.filter || "agTextColumnFilter", H = y === "agNumberColumnFilter" || (Array.isArray(l?.type) ? l.type.includes("numericColumn") : l?.type === "numericColumn"), k = y === "agDateColumnFilter" || (Array.isArray(l?.type) ? l.type.includes("dateColumn") : l?.type === "dateColumn"), E = s.getGridOption("suppressRowVirtualisation") !== !0, m = (t) => {
17
18
  queueMicrotask(() => {
18
19
  s.applyColumnState({
19
- state: [{ colId: l, sort: n }],
20
+ state: [{ colId: c, sort: t }],
20
21
  defaultState: { sort: null }
21
22
  });
22
- }), c();
23
- }, m = (n) => {
23
+ }), a();
24
+ }, p = (t) => {
24
25
  queueMicrotask(() => {
25
26
  s.applyColumnState({
26
- state: [{ colId: l, pinned: n }]
27
+ state: [{ colId: c, pinned: t }]
27
28
  });
28
- }), c();
29
- }, w = (n) => {
30
- n ? s.autoSizeAllColumns() : s.autoSizeColumns([l]), c();
31
- }, P = () => {
32
- const n = s.getGridOption("context") || {};
33
- s.setGridOption("context", { ...n, activeSearchColumnId: l }), s.refreshHeader(), c();
34
- }, T = () => {
35
- const n = i?.headerComponentParams;
36
- n?.onAdvanceSearchClick ? n.onAdvanceSearchClick(o) : n?.toggleAdvanceSearch ? n.toggleAdvanceSearch(l) : C && C.openAdvancedFilter(l), c();
37
- }, d = O?.getBoundingClientRect(), D = i?.headerComponentParams, N = D?.isSearchable, k = D?.advanceSearchEnabled;
38
- return /* @__PURE__ */ r(E, { open: M, onOpenChange: (n) => !n && c(), children: [
39
- d && /* @__PURE__ */ e(G, { asChild: !0, children: /* @__PURE__ */ e(
29
+ }), a();
30
+ }, N = (t) => {
31
+ t ? s.autoSizeAllColumns() : s.autoSizeColumns([c]), a();
32
+ }, D = () => {
33
+ queueMicrotask(() => {
34
+ s.showColumnChooser();
35
+ }), a();
36
+ }, z = () => {
37
+ queueMicrotask(() => {
38
+ s.resetColumnState();
39
+ }), a();
40
+ }, G = () => {
41
+ const t = s.getGridOption("context") || {};
42
+ s.setGridOption("context", { ...t, activeSearchColumnId: c }), s.refreshHeader(), a();
43
+ }, R = () => {
44
+ const t = l?.headerComponentParams;
45
+ t?.onAdvanceSearchClick ? t.onAdvanceSearchClick(u) : t?.toggleAdvanceSearch ? t.toggleAdvanceSearch(c) : S && S.openAdvancedFilter(c), a();
46
+ }, o = j?.getBoundingClientRect(), v = l?.headerComponentParams, M = d === "column" && v?.isSearchable, O = d === "column" && v?.advanceSearchEnabled, L = n(E ? "gridHeader.autosizeAllVisibleColumns" : "gridHeader.autosizeAllColumns");
47
+ return d === "group" ? /* @__PURE__ */ r(A, { open: x, onOpenChange: (t) => !t && a(), children: [
48
+ o && /* @__PURE__ */ e(_, { asChild: !0, children: /* @__PURE__ */ e(
49
+ "div",
50
+ {
51
+ style: {
52
+ position: "fixed",
53
+ left: o.left,
54
+ top: o.top,
55
+ width: o.width,
56
+ height: o.height,
57
+ pointerEvents: "none",
58
+ visibility: "hidden"
59
+ }
60
+ }
61
+ ) }),
62
+ /* @__PURE__ */ e(
63
+ F,
64
+ {
65
+ align: "end",
66
+ side: "bottom",
67
+ sideOffset: 5,
68
+ className: "w-[200px] p-2 rounded-[8px] border-none !shadow-[0px_0px_2px_0px_rgba(0,0,0,0.25)]",
69
+ onCloseAutoFocus: (t) => t.preventDefault(),
70
+ children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
71
+ /* @__PURE__ */ e(i, { onClick: D, children: n("gridHeader.chooseColumns") }),
72
+ /* @__PURE__ */ e(i, { onClick: z, children: n("gridHeader.resetColumns") })
73
+ ] })
74
+ }
75
+ )
76
+ ] }) : /* @__PURE__ */ r(A, { open: x, onOpenChange: (t) => !t && a(), children: [
77
+ o && /* @__PURE__ */ e(_, { asChild: !0, children: /* @__PURE__ */ e(
40
78
  "div",
41
79
  {
42
80
  style: {
43
81
  position: "fixed",
44
- left: d.left,
45
- top: d.top,
46
- width: d.width,
47
- height: d.height,
82
+ left: o.left,
83
+ top: o.top,
84
+ width: o.width,
85
+ height: o.height,
48
86
  pointerEvents: "none",
49
87
  visibility: "hidden"
50
88
  }
51
89
  }
52
90
  ) }),
53
91
  /* @__PURE__ */ e(
54
- q,
92
+ F,
55
93
  {
56
94
  align: "end",
57
95
  side: "bottom",
58
96
  sideOffset: 5,
59
97
  className: "w-[200px] p-2 rounded-[8px] border-none !shadow-[0px_0px_2px_0px_rgba(0,0,0,0.25)]",
60
- onCloseAutoFocus: (n) => n.preventDefault(),
98
+ onCloseAutoFocus: (t) => t.preventDefault(),
61
99
  children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
62
- /* @__PURE__ */ r(v, { className: "flex items-center gap-2 text-content-tertiary", children: [
63
- /* @__PURE__ */ e(F, { size: "xs" }),
100
+ /* @__PURE__ */ r(P, { className: "flex items-center gap-2 text-content-tertiary", children: [
101
+ /* @__PURE__ */ e(B, { size: "xs" }),
64
102
  " ",
65
- t("gridHeader.columnSettings")
103
+ n("gridHeader.columnSettings")
66
104
  ] }),
67
- /* @__PURE__ */ e(z, {}),
68
- A && /* @__PURE__ */ r(p, { children: [
69
- /* @__PURE__ */ e(f, { inset: !0, children: t("gridHeader.sort") }),
70
- /* @__PURE__ */ r(g, { sideOffset: 10, alignOffset: -5, children: [
71
- /* @__PURE__ */ e(a, { onClick: () => u("asc"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
72
- /* @__PURE__ */ e("span", { children: t(H ? "gridHeader.sortAscNumber" : b ? "gridHeader.sortAscDate" : "gridHeader.sortAscText") }),
73
- x === "asc" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-content-tertiary" })
105
+ /* @__PURE__ */ e(T, {}),
106
+ q && /* @__PURE__ */ r(f, { children: [
107
+ /* @__PURE__ */ e(g, { inset: !0, children: n("gridHeader.sort") }),
108
+ /* @__PURE__ */ r(C, { sideOffset: 10, alignOffset: -5, children: [
109
+ /* @__PURE__ */ e(i, { onClick: () => m("asc"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
110
+ /* @__PURE__ */ e("span", { children: n(H ? "gridHeader.sortAscNumber" : k ? "gridHeader.sortAscDate" : "gridHeader.sortAscText") }),
111
+ b === "asc" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-content-tertiary" })
74
112
  ] }) }),
75
- /* @__PURE__ */ e(a, { onClick: () => u("desc"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
76
- /* @__PURE__ */ e("span", { children: t(H ? "gridHeader.sortDescNumber" : b ? "gridHeader.sortDescDate" : "gridHeader.sortDescText") }),
77
- x === "desc" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-content-tertiary" })
113
+ /* @__PURE__ */ e(i, { onClick: () => m("desc"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
114
+ /* @__PURE__ */ e("span", { children: n(H ? "gridHeader.sortDescNumber" : k ? "gridHeader.sortDescDate" : "gridHeader.sortDescText") }),
115
+ b === "desc" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-content-tertiary" })
78
116
  ] }) }),
79
- /* @__PURE__ */ e(a, { onClick: () => u(null), children: /* @__PURE__ */ e("span", { children: t("gridHeader.reset") }) })
117
+ /* @__PURE__ */ e(i, { onClick: () => m(null), children: /* @__PURE__ */ e("span", { children: n("gridHeader.reset") }) })
80
118
  ] })
81
119
  ] }),
82
- /* @__PURE__ */ r(p, { children: [
83
- /* @__PURE__ */ e(f, { inset: !0, children: t("gridHeader.freezeColumn") }),
84
- /* @__PURE__ */ r(g, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
85
- /* @__PURE__ */ e(a, { onClick: () => m("left"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
86
- /* @__PURE__ */ e("span", { children: t("gridHeader.pinLeft") }),
87
- S === "left" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-content-tertiary" })
120
+ /* @__PURE__ */ r(f, { children: [
121
+ /* @__PURE__ */ e(g, { inset: !0, children: n("gridHeader.freezeColumn") }),
122
+ /* @__PURE__ */ r(C, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
123
+ /* @__PURE__ */ e(i, { onClick: () => p("left"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
124
+ /* @__PURE__ */ e("span", { children: n("gridHeader.pinLeft") }),
125
+ w === "left" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-content-tertiary" })
88
126
  ] }) }),
89
- /* @__PURE__ */ e(a, { onClick: () => m("right"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
90
- /* @__PURE__ */ e("span", { children: t("gridHeader.pinRight") }),
91
- S === "right" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-content-tertiary" })
127
+ /* @__PURE__ */ e(i, { onClick: () => p("right"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
128
+ /* @__PURE__ */ e("span", { children: n("gridHeader.pinRight") }),
129
+ w === "right" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-content-tertiary" })
92
130
  ] }) }),
93
- /* @__PURE__ */ e(a, { onClick: () => m(null), children: /* @__PURE__ */ e("span", { children: t("gridHeader.noPin") }) })
131
+ /* @__PURE__ */ e(i, { onClick: () => p(null), children: /* @__PURE__ */ e("span", { children: n("gridHeader.noPin") }) })
94
132
  ] })
95
133
  ] }),
96
- /* @__PURE__ */ r(p, { children: [
97
- /* @__PURE__ */ e(f, { inset: !0, children: t("gridHeader.columnWidth") }),
98
- /* @__PURE__ */ r(g, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
99
- /* @__PURE__ */ e(a, { onClick: () => w(!1), children: t("gridHeader.autosizeThisColumn") }),
100
- /* @__PURE__ */ e(a, { onClick: () => w(!0), children: t("gridHeader.autosizeAllColumns") })
134
+ /* @__PURE__ */ r(f, { children: [
135
+ /* @__PURE__ */ e(g, { inset: !0, children: n("gridHeader.columnWidth") }),
136
+ /* @__PURE__ */ r(C, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
137
+ /* @__PURE__ */ e(i, { onClick: () => N(!1), children: n("gridHeader.autosizeThisColumn") }),
138
+ /* @__PURE__ */ e(i, { onClick: () => N(!0), children: L })
101
139
  ] })
102
140
  ] }),
103
- (N || k) && /* @__PURE__ */ r(j, { children: [
104
- /* @__PURE__ */ e(z, {}),
105
- /* @__PURE__ */ r(v, { className: "flex items-center gap-2 text-content-tertiary", children: [
106
- /* @__PURE__ */ e(_, { size: "xs" }),
141
+ /* @__PURE__ */ e(i, { inset: !0, onClick: D, children: n("gridHeader.chooseColumns") }),
142
+ /* @__PURE__ */ e(i, { inset: !0, onClick: z, children: n("gridHeader.resetColumns") }),
143
+ (M || O) && /* @__PURE__ */ r(V, { children: [
144
+ /* @__PURE__ */ e(T, {}),
145
+ /* @__PURE__ */ r(P, { className: "flex items-center gap-2 text-content-tertiary", children: [
146
+ /* @__PURE__ */ e(W, { size: "xs" }),
107
147
  " ",
108
- t("gridHeader.searchOptions")
148
+ n("gridHeader.searchOptions")
109
149
  ] }),
110
- N && /* @__PURE__ */ e(a, { inset: !0, onClick: P, children: t("gridHeader.search") }),
111
- k && /* @__PURE__ */ e(a, { inset: !0, onClick: T, children: t("gridHeader.advanceSearch") })
150
+ M && /* @__PURE__ */ e(i, { inset: !0, onClick: G, children: n("gridHeader.search") }),
151
+ O && /* @__PURE__ */ e(i, { inset: !0, onClick: R, children: n("gridHeader.advanceSearch") })
112
152
  ] })
113
153
  ] })
114
154
  }
@@ -116,5 +156,5 @@ const U = ({
116
156
  ] });
117
157
  };
118
158
  export {
119
- U as ColumnSettingsMenu
159
+ $ as ColumnSettingsMenu
120
160
  };
@@ -19,12 +19,14 @@ export interface GridHeaderContextValue {
19
19
  closeAdvancedFilter: () => void;
20
20
  /** Apply a new advanced filter model (updates state AND applies to grid) */
21
21
  applyAdvancedFilter: (model: AdvancedFilterModel | null) => void;
22
- /** Open column settings menu for a specific column */
23
- openMenu: (columnId: string, anchor: HTMLElement) => void;
22
+ /** Open column settings menu for a specific column or group */
23
+ openMenu: (columnId: string, anchor: HTMLElement, variant?: 'column' | 'group') => void;
24
24
  /** Close the column settings menu */
25
25
  closeMenu: () => void;
26
26
  /** ID of the column that currently has the settings menu open */
27
27
  activeMenuColumnId: string | null;
28
+ /** Variant of the active menu ('column' for regular columns, 'group' for column groups) */
29
+ activeMenuVariant: 'column' | 'group' | null;
28
30
  }
29
31
  export declare const GridHeaderContext: import('react').Context<GridHeaderContextValue>;
30
32
  /**
@@ -1,40 +1,47 @@
1
- import { jsxs as p, jsx as a } from "react/jsx-runtime";
2
- import { ChevronRight as m } from "../../../../icons/index.js";
3
- import { cn as x } from "../../../../lib/utils.js";
4
- import { HeaderInfo as f } from "./components/header-info.js";
5
- import { TruncatedText as u } from "./components/truncated-text.js";
6
- const y = (t) => {
1
+ import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
+ import { ChevronRight as x } from "../../../../icons/index.js";
3
+ import { cn as g } from "../../../../lib/utils.js";
4
+ import { HeaderInfo as h } from "./components/header-info.js";
5
+ import { TruncatedText as N } from "./components/truncated-text.js";
6
+ import { useGridHeader as E } from "./context/grid-header-context.js";
7
+ const H = (n) => {
7
8
  const {
8
- displayName: i,
9
+ displayName: l,
9
10
  showInfoIcon: c = !1,
10
11
  columnGroup: e,
11
- setExpanded: n
12
- } = t, o = e ? e.isExpanded() : !1, r = e ? e.isExpandable() : !1, d = (l) => {
13
- l && l.stopPropagation(), n && e && n(!o);
14
- }, s = i || "";
15
- return !s && c === !1 ? null : /* @__PURE__ */ p(
12
+ setExpanded: a
13
+ } = n, r = E(), s = e ? e.isExpanded() : !1, i = e ? e.isExpandable() : !1, p = (t) => {
14
+ t && t.stopPropagation(), a && e && a(!s);
15
+ }, m = (t) => {
16
+ if (t.preventDefault(), t.stopPropagation(), r && e) {
17
+ const u = e.getGroupId() || "group";
18
+ r.openMenu(u, t.currentTarget, "group");
19
+ }
20
+ }, d = l || "";
21
+ return !d && c === !1 ? null : /* @__PURE__ */ f(
16
22
  "div",
17
23
  {
18
24
  className: "ag-header-group-cell-label ag-sticky-label flex items-center h-full cursor-pointer select-none",
19
- onClick: r ? d : void 0,
25
+ onClick: i ? p : void 0,
26
+ onContextMenu: m,
20
27
  role: "presentation",
21
28
  children: [
22
- /* @__PURE__ */ a(
23
- u,
29
+ /* @__PURE__ */ o(
30
+ N,
24
31
  {
25
- text: s,
32
+ text: d,
26
33
  className: "ag-header-group-text font-bold text-content"
27
34
  }
28
35
  ),
29
- /* @__PURE__ */ a(f, { ...t, className: "ml-1" }),
30
- r && /* @__PURE__ */ a("span", { className: x(
36
+ /* @__PURE__ */ o(h, { ...n, className: "ml-1" }),
37
+ i && /* @__PURE__ */ o("span", { className: g(
31
38
  "ag-header-icon ag-header-expand-icon ml-[6px] flex items-center justify-center transition-transform duration-200",
32
- o ? "ag-header-expand-icon-expanded rotate-180" : "ag-header-expand-icon-collapsed"
33
- ), children: /* @__PURE__ */ a(m, { size: 16, className: "text-content-tertiary" }) })
39
+ s ? "ag-header-expand-icon-expanded rotate-180" : "ag-header-expand-icon-collapsed"
40
+ ), children: /* @__PURE__ */ o(x, { size: 16, className: "text-content-tertiary" }) })
34
41
  ]
35
42
  }
36
43
  );
37
44
  };
38
45
  export {
39
- y as CustomHeaderGroup
46
+ H as CustomHeaderGroup
40
47
  };
@@ -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
  }
@@ -4,12 +4,13 @@ import { ChevronLeftIcon as ye, ChevronRightIcon as Ne } from "lucide-react";
4
4
  import { getDefaultClassNames as Be, DayPicker as Fe } from "react-day-picker";
5
5
  import { cn as u } from "../../lib/utils.js";
6
6
  import { Button as I } from "./button.js";
7
+ import "./button-variants.js";
7
8
  import ue from "./select/select.js";
8
9
  import { FISCAL_PATTERNS as Ke, resolveWeekSelection as We } from "../../lib/fiscal-calendar.js";
9
10
  import { getIntlLocale as qe, getDateFnsLocale as Ge } from "../../i18n/getDateFnsLocale.js";
10
11
  import { useImpactNovaI18n as Je } from "../../i18n/ImpactNovaI18nContext.js";
11
12
  const de = d.createContext(0);
12
- function lt({
13
+ function ot({
13
14
  className: le,
14
15
  classNames: J,
15
16
  showOutsideDays: y = !1,
@@ -785,6 +786,6 @@ function Qe({
785
786
  );
786
787
  }
787
788
  export {
788
- lt as Calendar,
789
+ ot as Calendar,
789
790
  Qe as CalendarDayButton
790
791
  };
@@ -239,11 +239,15 @@ export interface GridHeaderMessages {
239
239
  columnWidth: string;
240
240
  autosizeThisColumn: string;
241
241
  autosizeAllColumns: string;
242
+ autosizeAllVisibleColumns: string;
242
243
  searchOptions: string;
243
244
  advanceSearch: string;
244
245
  clickForDetails: string;
245
246
  information: string;
246
247
  noInformationAvailable: string;
248
+ columnOptions: string;
249
+ chooseColumns: string;
250
+ resetColumns: string;
247
251
  }
248
252
  export interface ImpactNovaMessages {
249
253
  calendar: CalendarMessages;
@@ -80,7 +80,7 @@ const e = {
80
80
  dropHere: "Drop here",
81
81
  releaseToDrop: "Release to drop",
82
82
  dragHere: "Drag here"
83
- }, r = {
83
+ }, n = {
84
84
  frozenColumns: "Frozen Columns",
85
85
  scrollableColumns: "Scrollable Columns",
86
86
  searchColumnsPlaceholder: "Search columns...",
@@ -135,7 +135,7 @@ const e = {
135
135
  toggle: "Toggle",
136
136
  more: "More",
137
137
  loading: "Loading"
138
- }, n = {
138
+ }, r = {
139
139
  cancel: "Cancel",
140
140
  confirm: "Confirm"
141
141
  }, c = {
@@ -210,20 +210,24 @@ const e = {
210
210
  columnWidth: "Column width",
211
211
  autosizeThisColumn: "Autosize This Column",
212
212
  autosizeAllColumns: "Autosize All Columns",
213
+ autosizeAllVisibleColumns: "Autosize All Visible Columns",
213
214
  searchOptions: "Search Options",
214
215
  advanceSearch: "Advance Search",
215
216
  clickForDetails: "Click for details",
216
217
  information: "Information",
217
- noInformationAvailable: "No information available for this column."
218
+ noInformationAvailable: "No information available for this column.",
219
+ columnOptions: "Column Options",
220
+ chooseColumns: "Choose Columns",
221
+ resetColumns: "Reset Columns"
218
222
  }, v = {
219
223
  calendar: e,
220
224
  datePicker: t,
221
225
  filter: a,
222
226
  select: o,
223
227
  nestedList: s,
224
- dataTable: r,
228
+ dataTable: n,
225
229
  aria: i,
226
- prompt: n,
230
+ prompt: r,
227
231
  filterStrip: c,
228
232
  filterPanel: d,
229
233
  advancedFilter: f,
@@ -210,6 +210,10 @@ const e = {
210
210
  columnWidth: "Spaltenbreite",
211
211
  autosizeThisColumn: "Diese Spalte anpassen",
212
212
  autosizeAllColumns: "Alle Spalten anpassen",
213
+ autosizeAllVisibleColumns: "Alle sichtbaren Spalten anpassen",
214
+ columnOptions: "Spaltenoptionen",
215
+ chooseColumns: "Spalten auswählen",
216
+ resetColumns: "Spalten zurücksetzen",
213
217
  searchOptions: "Suchoptionen",
214
218
  advanceSearch: "Erweiterte Suche",
215
219
  clickForDetails: "Klicken für Details",
@@ -210,6 +210,10 @@ const e = {
210
210
  columnWidth: "Ancho de columna",
211
211
  autosizeThisColumn: "Ajustar esta columna",
212
212
  autosizeAllColumns: "Ajustar todas las columnas",
213
+ autosizeAllVisibleColumns: "Ajustar todas las columnas visibles",
214
+ columnOptions: "Opciones de columna",
215
+ chooseColumns: "Elegir columnas",
216
+ resetColumns: "Restablecer columnas",
213
217
  searchOptions: "Opciones de búsqueda",
214
218
  advanceSearch: "Búsqueda avanzada",
215
219
  clickForDetails: "Clic para más detalles",
@@ -210,6 +210,10 @@ const e = {
210
210
  columnWidth: "कॉलम चौड़ाई",
211
211
  autosizeThisColumn: "इस कॉलम का आकार स्वचालित करें",
212
212
  autosizeAllColumns: "सभी कॉलम का आकार स्वचालित करें",
213
+ autosizeAllVisibleColumns: "सभी दृश्य कॉलम का आकार स्वचालित करें",
214
+ columnOptions: "कॉलम विकल्प",
215
+ chooseColumns: "कॉलम चुनें",
216
+ resetColumns: "कॉलम रीसेट करें",
213
217
  searchOptions: "खोज विकल्प",
214
218
  advanceSearch: "उन्नत खोज",
215
219
  clickForDetails: "विवरण के लिए क्लिक करें",
@@ -210,6 +210,10 @@ const e = {
210
210
  columnWidth: "ಕಾಲಮ್ ಅಗಲ",
211
211
  autosizeThisColumn: "ಈ ಕಾಲಮ್ ಸ್ವಯಂ-ಗಾತ್ರ",
212
212
  autosizeAllColumns: "ಎಲ್ಲಾ ಕಾಲಮ್‌ಗಳು ಸ್ವಯಂ-ಗಾತ್ರ",
213
+ autosizeAllVisibleColumns: "ಎಲ್ಲಾ ದೃಶ್ಯ ಕಾಲಮ್‌ಗಳನ್ನು ಸ್ವಯಂ-ಗಾತ್ರ ಮಾಡಿ",
214
+ columnOptions: "ಕಾಲಮ್ ಆಯ್ಕೆಗಳು",
215
+ chooseColumns: "ಕಾಲಮ್‌ಗಳನ್ನು ಆರಿಸಿ",
216
+ resetColumns: "ಕಾಲಮ್‌ಗಳನ್ನು ಮರುಹೊಂದಿಸಿ",
213
217
  searchOptions: "ಹುಡುಕಾಟ ಆಯ್ಕೆಗಳು",
214
218
  advanceSearch: "ಸುಧಾರಿತ ಹುಡುಕಾಟ",
215
219
  clickForDetails: "ವಿವರಗಳಿಗಾಗಿ ಕ್ಲಿಕ್ ಮಾಡಿ",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impact-nova",
3
- "version": "1.7.28",
3
+ "version": "1.7.29",
4
4
  "description": "Enterprise-grade React design system built with React 19, Vite, Tailwind CSS, and Radix UI. Built-in internationalization (i18n) and comprehensive UI component library for scalable, accessible, and performant applications.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",