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.
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.d.ts +2 -0
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +112 -72
- package/dist/components/ui/ag-grid-react/headers/context/grid-header-context.d.ts +4 -2
- package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +28 -21
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +86 -83
- package/dist/components/ui/ag-grid-react/index.js +87 -79
- package/dist/components/ui/calendar.js +3 -2
- package/dist/i18n/defaultMessages.d.ts +4 -0
- package/dist/i18n/defaultMessages.js +9 -5
- package/dist/i18n/locales/de.js +4 -0
- package/dist/i18n/locales/es.js +4 -0
- package/dist/i18n/locales/hi.js +4 -0
- package/dist/i18n/locales/kn.js +4 -0
- package/package.json +1 -1
|
@@ -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
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as V } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Settings as
|
|
4
|
-
import { DropdownMenu as
|
|
5
|
-
import { useGridHeader as
|
|
6
|
-
import { useImpactNovaI18n as
|
|
7
|
-
const
|
|
8
|
-
isOpen:
|
|
9
|
-
onClose:
|
|
10
|
-
columnId:
|
|
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:
|
|
12
|
+
anchor: j,
|
|
13
|
+
variant: d = "column"
|
|
13
14
|
}) => {
|
|
14
|
-
const { t } =
|
|
15
|
-
if (!
|
|
16
|
-
const
|
|
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:
|
|
20
|
+
state: [{ colId: c, sort: t }],
|
|
20
21
|
defaultState: { sort: null }
|
|
21
22
|
});
|
|
22
|
-
}),
|
|
23
|
-
},
|
|
23
|
+
}), a();
|
|
24
|
+
}, p = (t) => {
|
|
24
25
|
queueMicrotask(() => {
|
|
25
26
|
s.applyColumnState({
|
|
26
|
-
state: [{ colId:
|
|
27
|
+
state: [{ colId: c, pinned: t }]
|
|
27
28
|
});
|
|
28
|
-
}),
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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:
|
|
45
|
-
top:
|
|
46
|
-
width:
|
|
47
|
-
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
|
-
|
|
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: (
|
|
98
|
+
onCloseAutoFocus: (t) => t.preventDefault(),
|
|
61
99
|
children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
|
|
62
|
-
/* @__PURE__ */ r(
|
|
63
|
-
/* @__PURE__ */ e(
|
|
100
|
+
/* @__PURE__ */ r(P, { className: "flex items-center gap-2 text-content-tertiary", children: [
|
|
101
|
+
/* @__PURE__ */ e(B, { size: "xs" }),
|
|
64
102
|
" ",
|
|
65
|
-
|
|
103
|
+
n("gridHeader.columnSettings")
|
|
66
104
|
] }),
|
|
67
|
-
/* @__PURE__ */ e(
|
|
68
|
-
|
|
69
|
-
/* @__PURE__ */ e(
|
|
70
|
-
/* @__PURE__ */ r(
|
|
71
|
-
/* @__PURE__ */ e(
|
|
72
|
-
/* @__PURE__ */ e("span", { children:
|
|
73
|
-
|
|
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(
|
|
76
|
-
/* @__PURE__ */ e("span", { children:
|
|
77
|
-
|
|
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(
|
|
117
|
+
/* @__PURE__ */ e(i, { onClick: () => m(null), children: /* @__PURE__ */ e("span", { children: n("gridHeader.reset") }) })
|
|
80
118
|
] })
|
|
81
119
|
] }),
|
|
82
|
-
/* @__PURE__ */ r(
|
|
83
|
-
/* @__PURE__ */ e(
|
|
84
|
-
/* @__PURE__ */ r(
|
|
85
|
-
/* @__PURE__ */ e(
|
|
86
|
-
/* @__PURE__ */ e("span", { children:
|
|
87
|
-
|
|
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(
|
|
90
|
-
/* @__PURE__ */ e("span", { children:
|
|
91
|
-
|
|
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(
|
|
131
|
+
/* @__PURE__ */ e(i, { onClick: () => p(null), children: /* @__PURE__ */ e("span", { children: n("gridHeader.noPin") }) })
|
|
94
132
|
] })
|
|
95
133
|
] }),
|
|
96
|
-
/* @__PURE__ */ r(
|
|
97
|
-
/* @__PURE__ */ e(
|
|
98
|
-
/* @__PURE__ */ r(
|
|
99
|
-
/* @__PURE__ */ e(
|
|
100
|
-
/* @__PURE__ */ e(
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
148
|
+
n("gridHeader.searchOptions")
|
|
109
149
|
] }),
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
import { ChevronRight as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { HeaderInfo as
|
|
5
|
-
import { TruncatedText as
|
|
6
|
-
|
|
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:
|
|
9
|
+
displayName: l,
|
|
9
10
|
showInfoIcon: c = !1,
|
|
10
11
|
columnGroup: e,
|
|
11
|
-
setExpanded:
|
|
12
|
-
} =
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
|
|
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:
|
|
25
|
+
onClick: i ? p : void 0,
|
|
26
|
+
onContextMenu: m,
|
|
20
27
|
role: "presentation",
|
|
21
28
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
|
|
29
|
+
/* @__PURE__ */ o(
|
|
30
|
+
N,
|
|
24
31
|
{
|
|
25
|
-
text:
|
|
32
|
+
text: d,
|
|
26
33
|
className: "ag-header-group-text font-bold text-content"
|
|
27
34
|
}
|
|
28
35
|
),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
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
|
-
|
|
33
|
-
), children: /* @__PURE__ */
|
|
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
|
-
|
|
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
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useGridHeader as
|
|
5
|
-
import { HeaderInfo as
|
|
6
|
-
import { Checkbox as
|
|
7
|
-
import { TruncatedText as
|
|
8
|
-
import { HeaderSearchInput as
|
|
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
|
|
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
|
-
] }),
|
|
54
|
-
const { t } = V(), [
|
|
55
|
-
|
|
56
|
-
if (!
|
|
57
|
-
const
|
|
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 (
|
|
60
|
-
const f =
|
|
59
|
+
if (u) {
|
|
60
|
+
const f = n.getServerSideSelectionState?.();
|
|
61
61
|
if (f) {
|
|
62
|
-
const { selectAll:
|
|
63
|
-
|
|
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 =
|
|
67
|
-
f === 0 ? (l = !1, i = !1) : f ===
|
|
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),
|
|
69
|
+
H(l), c(i);
|
|
70
70
|
};
|
|
71
71
|
x();
|
|
72
|
-
const
|
|
72
|
+
const m = () => {
|
|
73
73
|
x();
|
|
74
74
|
};
|
|
75
|
-
return
|
|
76
|
-
|
|
75
|
+
return n.addEventListener("selectionChanged", m), n.addEventListener("modelUpdated", m), () => {
|
|
76
|
+
n.removeEventListener("selectionChanged", m), n.removeEventListener("modelUpdated", m);
|
|
77
77
|
};
|
|
78
|
-
}, [
|
|
79
|
-
const
|
|
80
|
-
|
|
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
|
-
|
|
83
|
+
$,
|
|
84
84
|
{
|
|
85
|
-
checked: S ? "indeterminate" :
|
|
86
|
-
onCheckedChange: (
|
|
87
|
-
|
|
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
|
-
},
|
|
93
|
+
}, fe = (n) => {
|
|
94
94
|
const {
|
|
95
95
|
displayName: t,
|
|
96
|
-
enableSorting:
|
|
96
|
+
enableSorting: p,
|
|
97
97
|
enableMenu: H,
|
|
98
98
|
progressSort: S,
|
|
99
|
-
column:
|
|
100
|
-
api:
|
|
101
|
-
handleInlineSearch:
|
|
99
|
+
column: c,
|
|
100
|
+
api: s,
|
|
101
|
+
handleInlineSearch: u,
|
|
102
102
|
handleClearSearchInline: x,
|
|
103
|
-
onColumnSearchClick:
|
|
103
|
+
onColumnSearchClick: m,
|
|
104
104
|
onAdvanceSearchClick: l,
|
|
105
105
|
toggleAdvanceSearch: i,
|
|
106
106
|
isSearchable: f = !1,
|
|
107
|
-
advanceSearchEnabled:
|
|
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
|
-
} =
|
|
120
|
-
I === "agDateColumnFilter" || (Array.isArray(
|
|
121
|
-
const
|
|
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(
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
if (
|
|
135
|
-
|
|
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
|
-
|
|
139
|
-
},
|
|
140
|
-
|
|
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
|
-
...
|
|
143
|
-
className:
|
|
144
|
+
...n,
|
|
145
|
+
className: r
|
|
144
146
|
}
|
|
145
147
|
) });
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
+
return M && a && !L ? /* @__PURE__ */ e(
|
|
149
|
+
te,
|
|
148
150
|
{
|
|
149
|
-
column:
|
|
150
|
-
api:
|
|
151
|
-
onClose: () =>
|
|
152
|
-
handleInlineSearch:
|
|
153
|
-
handleClearSearchInline: x ? () => x(
|
|
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:
|
|
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:
|
|
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
|
-
|
|
176
|
+
o?.headerCheckboxSelection && (!t || t.trim() === "") ? "justify-center" : ""
|
|
175
177
|
),
|
|
176
|
-
"data-selection-column":
|
|
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:
|
|
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
|
-
!(
|
|
189
|
+
!(o?.headerCheckboxSelection && (!t || t.trim() === "")) && "flex-1",
|
|
187
190
|
v ? "flex-row-reverse" : "flex-row",
|
|
188
|
-
|
|
191
|
+
p ? "sortable cursor-pointer" : ""
|
|
189
192
|
),
|
|
190
|
-
onClick:
|
|
191
|
-
children: /* @__PURE__ */ h("div", { className:
|
|
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
|
-
|
|
199
|
+
o?.headerCheckboxSelection && (!t || t.trim() === "") ? "justify-center items-center" : "gap-1 flex-1"
|
|
197
200
|
), children: [
|
|
198
|
-
|
|
199
|
-
t && t.trim() !== "" && t !== N("gridHeader.selection") && /* @__PURE__ */ e(
|
|
200
|
-
t && t.trim() !== "" &&
|
|
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
|
-
!(
|
|
210
|
+
!(o?.headerCheckboxSelection && (!t || t.trim() === "")) && /* @__PURE__ */ h(
|
|
208
211
|
"div",
|
|
209
212
|
{
|
|
210
|
-
className:
|
|
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
|
-
|
|
218
|
+
p && /* @__PURE__ */ h(
|
|
216
219
|
"div",
|
|
217
220
|
{
|
|
218
221
|
className: "ag-sort-indicator-container cursor-pointer flex items-center",
|
|
219
|
-
onClick:
|
|
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(
|
|
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:
|
|
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:
|
|
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 && !
|
|
244
|
+
H && !o?.suppressHeaderMenuButton && /* @__PURE__ */ e("div", { className: "custom-ag-header-icons relative", children: /* @__PURE__ */ e(
|
|
242
245
|
"button",
|
|
243
246
|
{
|
|
244
|
-
className:
|
|
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
|
-
|
|
249
|
+
U ? "opacity-100 w-auto" : "w-0 opacity-0 group-hover:w-auto group-hover:opacity-100"
|
|
247
250
|
),
|
|
248
|
-
onClick: (
|
|
249
|
-
|
|
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
|
-
|
|
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
|
|
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 = "",
|
|
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
|
-
},
|
|
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
|
-
},
|
|
47
|
+
}, V = (s) => {
|
|
48
48
|
if (typeof navigator < "u" && navigator.clipboard?.writeText) {
|
|
49
|
-
navigator.clipboard.writeText(s).catch(() =>
|
|
49
|
+
navigator.clipboard.writeText(s).catch(() => K(s));
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
},
|
|
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 =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
105
|
+
D(e || null), E(!0);
|
|
89
106
|
},
|
|
90
107
|
closeAdvancedFilter: () => {
|
|
91
|
-
E(!1),
|
|
108
|
+
E(!1), D(null);
|
|
92
109
|
},
|
|
93
110
|
applyAdvancedFilter: (e) => {
|
|
94
|
-
|
|
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
|
-
|
|
115
|
+
openMenu: (e, t, o = "column") => {
|
|
116
|
+
M.current = e, T.current = t, S.current = o, L(!0);
|
|
98
117
|
},
|
|
99
118
|
closeMenu: () => {
|
|
100
|
-
|
|
119
|
+
M.current = null, T.current = null, S.current = null, L(!1);
|
|
101
120
|
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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 =
|
|
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 =
|
|
174
|
+
}), [r]), J = C(() => ({
|
|
150
175
|
headerGroupComponent: fe,
|
|
151
176
|
...l,
|
|
152
177
|
headerGroupComponentParams: {
|
|
153
178
|
...l?.headerGroupComponentParams
|
|
154
179
|
}
|
|
155
|
-
}), [l]), X =
|
|
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 =
|
|
190
|
+
const o = H(e.column?.getColDef());
|
|
166
191
|
if (o && o.length > 0) {
|
|
167
|
-
const n =
|
|
192
|
+
const n = _(t, o);
|
|
168
193
|
if (o.length === 1) {
|
|
169
|
-
const d = o[0]?.field?.split(".").pop(),
|
|
170
|
-
return
|
|
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
|
|
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(
|
|
190
|
-
|
|
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
|
|
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(
|
|
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 =
|
|
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
|
-
|
|
236
|
+
V(o.join(`
|
|
212
237
|
`));
|
|
213
|
-
}, []),
|
|
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 =
|
|
242
|
+
const o = H(e.column?.getColDef());
|
|
218
243
|
if (o && o.length > 0) {
|
|
219
|
-
const n =
|
|
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 =
|
|
236
|
-
processCellCallback:
|
|
260
|
+
}, []), Z = C(() => ({
|
|
261
|
+
processCellCallback: R,
|
|
237
262
|
...u.defaultCsvExportParams ?? {}
|
|
238
|
-
}), [
|
|
239
|
-
processCellCallback:
|
|
263
|
+
}), [R, u.defaultCsvExportParams]), ee = C(() => ({
|
|
264
|
+
processCellCallback: R,
|
|
240
265
|
...u.defaultExcelExportParams ?? {}
|
|
241
|
-
}), [
|
|
242
|
-
return /* @__PURE__ */ ne(me.Provider, { value:
|
|
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:
|
|
292
|
-
columnId:
|
|
296
|
+
isOpen: P,
|
|
297
|
+
columnId: O,
|
|
293
298
|
gridApi: F,
|
|
294
|
-
onClose:
|
|
295
|
-
onApply:
|
|
299
|
+
onClose: A.closeAdvancedFilter,
|
|
300
|
+
onApply: A.applyAdvancedFilter
|
|
296
301
|
}
|
|
297
302
|
),
|
|
298
303
|
/* @__PURE__ */ m(
|
|
299
304
|
Fe,
|
|
300
305
|
{
|
|
301
|
-
isOpen:
|
|
302
|
-
columnId:
|
|
306
|
+
isOpen: W,
|
|
307
|
+
columnId: M.current,
|
|
303
308
|
gridApi: F,
|
|
304
|
-
anchor:
|
|
305
|
-
|
|
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,
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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:
|
|
228
|
+
dataTable: n,
|
|
225
229
|
aria: i,
|
|
226
|
-
prompt:
|
|
230
|
+
prompt: r,
|
|
227
231
|
filterStrip: c,
|
|
228
232
|
filterPanel: d,
|
|
229
233
|
advancedFilter: f,
|
package/dist/i18n/locales/de.js
CHANGED
|
@@ -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",
|
package/dist/i18n/locales/es.js
CHANGED
|
@@ -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",
|
package/dist/i18n/locales/hi.js
CHANGED
|
@@ -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/dist/i18n/locales/kn.js
CHANGED
|
@@ -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.
|
|
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",
|