impact-nova 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +9 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +71 -56
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.d.ts +9 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +51 -31
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +3 -3
- package/dist/components/ui/ag-grid-react/headers/components/header-info.js +38 -36
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +114 -108
- package/dist/components/ui/ag-grid-react/theme.d.ts +1 -1
- package/dist/components/ui/ag-grid-react/theme.js +1 -1
- package/package.json +9 -3
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { ICellEditorParams } from 'ag-grid-community';
|
|
2
3
|
import { SplitConfig, SubCellComponentProps } from '../types';
|
|
4
|
+
export interface CommonParams {
|
|
5
|
+
cellRenderer?: string | React.ComponentType<SubCellComponentProps>;
|
|
6
|
+
cellEditor?: string | React.ComponentType<SubCellComponentProps>;
|
|
7
|
+
cellRendererParams?: Record<string, unknown>;
|
|
8
|
+
cellEditorParams?: Record<string, unknown>;
|
|
9
|
+
}
|
|
3
10
|
export interface SplitCellEditorProps extends Omit<ICellEditorParams, 'context'> {
|
|
4
11
|
splits: SplitConfig[];
|
|
12
|
+
commonParams?: CommonParams;
|
|
5
13
|
context?: {
|
|
6
14
|
frameworkComponents?: Record<string, React.ComponentType<SubCellComponentProps>>;
|
|
7
15
|
};
|
|
8
16
|
}
|
|
9
|
-
export declare const SplitCellEditor:
|
|
17
|
+
export declare const SplitCellEditor: React.ForwardRefExoticComponent<SplitCellEditorProps & React.RefAttributes<unknown>>;
|
|
@@ -1,85 +1,100 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { AG_GRID_VALUE_FORMATTERS as
|
|
4
|
-
const
|
|
5
|
-
const { splits: a, data:
|
|
6
|
-
Object.keys(i.current).length === 0 && a &&
|
|
7
|
-
const o =
|
|
8
|
-
let
|
|
9
|
-
for (const
|
|
10
|
-
i.current[
|
|
11
|
-
})
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as v, useRef as x, useImperativeHandle as N } from "react";
|
|
3
|
+
import { AG_GRID_VALUE_FORMATTERS as S } from "../../value-formatters.js";
|
|
4
|
+
const w = v((p, y) => {
|
|
5
|
+
const { splits: a, commonParams: c, data: s, node: E, api: g, column: m, context: h, stopEditing: R } = p, i = x({});
|
|
6
|
+
Object.keys(i.current).length === 0 && a && s && a.forEach((r) => {
|
|
7
|
+
const o = r.field.split(".");
|
|
8
|
+
let t = s;
|
|
9
|
+
for (const e of o) t = t?.[e];
|
|
10
|
+
i.current[r.field] = t && typeof t == "object" && "value" in t ? t.value : t;
|
|
11
|
+
});
|
|
12
|
+
const C = (r) => c ? {
|
|
13
|
+
...r,
|
|
14
|
+
cellRenderer: r.cellRenderer ?? c.cellRenderer,
|
|
15
|
+
cellEditor: r.cellEditor ?? c.cellEditor,
|
|
16
|
+
cellRendererParams: {
|
|
17
|
+
...c.cellRendererParams,
|
|
18
|
+
...r.cellRendererParams
|
|
19
|
+
},
|
|
20
|
+
cellEditorParams: {
|
|
21
|
+
...c.cellEditorParams,
|
|
22
|
+
...r.cellEditorParams
|
|
23
|
+
}
|
|
24
|
+
} : r;
|
|
25
|
+
N(y, () => ({
|
|
12
26
|
getValue() {
|
|
13
|
-
const
|
|
14
|
-
return Object.entries(i.current).forEach(([o,
|
|
15
|
-
const
|
|
16
|
-
let l =
|
|
17
|
-
for (let n = 0; n <
|
|
18
|
-
l[
|
|
19
|
-
l[
|
|
20
|
-
}),
|
|
27
|
+
const r = JSON.parse(JSON.stringify(s));
|
|
28
|
+
return Object.entries(i.current).forEach(([o, t]) => {
|
|
29
|
+
const e = o.split(".");
|
|
30
|
+
let l = r;
|
|
31
|
+
for (let n = 0; n < e.length - 1; n++)
|
|
32
|
+
l[e[n]] || (l[e[n]] = {}), l = l[e[n]];
|
|
33
|
+
l[e[e.length - 1]] = t;
|
|
34
|
+
}), r;
|
|
21
35
|
},
|
|
22
36
|
isCancelBeforeStart: () => !1,
|
|
23
37
|
isCancelAfterEnd: () => !1,
|
|
24
38
|
isPopup: () => !1
|
|
25
39
|
}));
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
29
|
-
if (typeof
|
|
30
|
-
return
|
|
31
|
-
const l = typeof
|
|
40
|
+
const P = m?.getColDef().type === "number", b = (r, o, t) => {
|
|
41
|
+
const e = r.valueFormatter;
|
|
42
|
+
if (!e) return o;
|
|
43
|
+
if (typeof e == "function")
|
|
44
|
+
return e({ value: o, data: t });
|
|
45
|
+
const l = typeof e == "string" ? e : e.type, n = S[l];
|
|
32
46
|
if (n) {
|
|
33
|
-
const
|
|
47
|
+
const d = {
|
|
34
48
|
value: o,
|
|
35
|
-
data:
|
|
36
|
-
node:
|
|
37
|
-
api:
|
|
38
|
-
context:
|
|
39
|
-
column:
|
|
49
|
+
data: t,
|
|
50
|
+
node: E,
|
|
51
|
+
api: g,
|
|
52
|
+
context: h,
|
|
53
|
+
column: m,
|
|
40
54
|
colDef: {
|
|
41
|
-
...
|
|
42
|
-
...typeof
|
|
43
|
-
...
|
|
55
|
+
...m?.getColDef(),
|
|
56
|
+
...typeof e == "object" ? e : {},
|
|
57
|
+
...r
|
|
44
58
|
}
|
|
45
59
|
};
|
|
46
|
-
return n(
|
|
60
|
+
return n(d);
|
|
47
61
|
}
|
|
48
62
|
return o;
|
|
49
63
|
};
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
return /* @__PURE__ */ f("div", { style: { display: "grid", gridTemplateRows: `repeat(${a.length}, 1fr)`, height: "100%", width: "100%" }, children: a.map((r, o) => {
|
|
65
|
+
const t = C(r);
|
|
66
|
+
let e = t.cellEditor || t.cellRenderer;
|
|
67
|
+
if (typeof e == "string") {
|
|
68
|
+
const u = g?.getGridOption("components");
|
|
69
|
+
e = h?.frameworkComponents?.[e] || u?.[e];
|
|
55
70
|
}
|
|
56
|
-
const
|
|
57
|
-
return /* @__PURE__ */
|
|
71
|
+
const l = t.type === "number" || t.type !== "text" && P, n = i.current[r.field], d = e;
|
|
72
|
+
return /* @__PURE__ */ f(
|
|
58
73
|
"div",
|
|
59
74
|
{
|
|
60
|
-
className: `flex items-center min-h-0 max-h-full overflow-hidden ${
|
|
75
|
+
className: `flex items-center min-h-0 max-h-full overflow-hidden ${l ? "justify-end" : ""}`,
|
|
61
76
|
style: { borderBottom: o === a.length - 1 ? "none" : "1px solid #d9dde7" },
|
|
62
|
-
children:
|
|
63
|
-
|
|
77
|
+
children: t.editable && d ? /* @__PURE__ */ f(
|
|
78
|
+
d,
|
|
64
79
|
{
|
|
65
|
-
...
|
|
66
|
-
...
|
|
67
|
-
...
|
|
68
|
-
value:
|
|
69
|
-
onValueChange: (
|
|
70
|
-
i.current[
|
|
80
|
+
...p,
|
|
81
|
+
...t.cellEditorParams,
|
|
82
|
+
...t.cellRendererParams,
|
|
83
|
+
value: n,
|
|
84
|
+
onValueChange: (u) => {
|
|
85
|
+
i.current[r.field] = u;
|
|
71
86
|
},
|
|
72
87
|
suppressAutoFocus: o !== 0,
|
|
73
|
-
colDef: { ...
|
|
74
|
-
stopEditing:
|
|
88
|
+
colDef: { ...t, field: r.field },
|
|
89
|
+
stopEditing: R
|
|
75
90
|
}
|
|
76
|
-
) : /* @__PURE__ */
|
|
91
|
+
) : /* @__PURE__ */ f("div", { className: `w-full px-2 text-gray-500 ${l ? "text-right" : ""}`, children: b(t, n, s) })
|
|
77
92
|
},
|
|
78
93
|
o
|
|
79
94
|
);
|
|
80
95
|
}) });
|
|
81
96
|
});
|
|
82
|
-
|
|
97
|
+
w.displayName = "SplitCellEditor";
|
|
83
98
|
export {
|
|
84
|
-
|
|
99
|
+
w as SplitCellEditor
|
|
85
100
|
};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ICellRendererParams } from 'ag-grid-enterprise';
|
|
2
|
+
import { ICellRendererParams, GridApi } from 'ag-grid-enterprise';
|
|
3
3
|
import { SplitConfig, SubCellComponentProps } from './types';
|
|
4
|
+
export interface CommonParams {
|
|
5
|
+
cellRenderer?: string | React.ComponentType<SubCellComponentProps>;
|
|
6
|
+
cellEditor?: string | React.ComponentType<SubCellComponentProps>;
|
|
7
|
+
cellRendererParams?: Record<string, unknown>;
|
|
8
|
+
cellEditorParams?: Record<string, unknown>;
|
|
9
|
+
}
|
|
4
10
|
export interface SplitCellRendererProps extends ICellRendererParams {
|
|
5
11
|
splits: SplitConfig[];
|
|
12
|
+
commonParams?: CommonParams;
|
|
13
|
+
api: GridApi;
|
|
6
14
|
context: {
|
|
7
15
|
frameworkComponents?: Record<string, React.ComponentType<SubCellComponentProps>>;
|
|
8
16
|
};
|
|
@@ -1,58 +1,78 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
const
|
|
4
|
-
const { splits: n,
|
|
5
|
-
if (!n || !Array.isArray(n)) return null;
|
|
6
|
-
const
|
|
7
|
-
|
|
3
|
+
const w = (s) => {
|
|
4
|
+
const { splits: n, commonParams: a, data: d, node: m, api: p, column: i, context: u } = s;
|
|
5
|
+
if (console.log("splits", n), !n || !Array.isArray(n)) return null;
|
|
6
|
+
const g = d?._isPinned === !0, C = (e) => a ? {
|
|
7
|
+
...e,
|
|
8
|
+
cellRenderer: e.cellRenderer ?? a.cellRenderer,
|
|
9
|
+
cellEditor: e.cellEditor ?? a.cellEditor,
|
|
10
|
+
cellRendererParams: {
|
|
11
|
+
...a.cellRendererParams,
|
|
12
|
+
...e.cellRendererParams
|
|
13
|
+
},
|
|
14
|
+
cellEditorParams: {
|
|
15
|
+
...a.cellEditorParams,
|
|
16
|
+
...e.cellEditorParams
|
|
17
|
+
}
|
|
18
|
+
} : e, h = (e, r) => r.split(".").reduce((t, l) => t?.[l], e), y = (e, r, t) => {
|
|
19
|
+
const l = i?.getColDef().valueFormatter;
|
|
8
20
|
if (typeof l == "function") {
|
|
9
|
-
const
|
|
21
|
+
const o = {
|
|
10
22
|
value: r,
|
|
11
23
|
data: t,
|
|
12
|
-
node:
|
|
24
|
+
node: m,
|
|
13
25
|
context: u,
|
|
14
|
-
column:
|
|
26
|
+
column: i,
|
|
15
27
|
// Merge split properties (like decimals, formatType) into colDef
|
|
16
28
|
// so the parent formatter can access them
|
|
17
29
|
colDef: {
|
|
18
|
-
...
|
|
30
|
+
...i?.getColDef(),
|
|
19
31
|
...e,
|
|
20
32
|
field: e.field
|
|
21
33
|
},
|
|
22
34
|
// Include required ValueFormatterParams properties from props
|
|
23
|
-
api:
|
|
35
|
+
api: s.api
|
|
24
36
|
};
|
|
25
|
-
return l(
|
|
37
|
+
return l(o);
|
|
38
|
+
}
|
|
39
|
+
return r;
|
|
40
|
+
}, v = (e) => {
|
|
41
|
+
const r = e.cellRenderer;
|
|
42
|
+
if (typeof r == "string") {
|
|
43
|
+
const t = p?.getGridOption("components");
|
|
44
|
+
return u?.frameworkComponents?.[r] || t?.[r];
|
|
26
45
|
}
|
|
27
46
|
return r;
|
|
28
47
|
};
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
return /* @__PURE__ */ c("div", { style: { display: "grid", gridTemplateRows: `repeat(${n.length}, 1fr)`, height: "100%", width: "100%" }, children: n?.map((e, r) => {
|
|
49
|
+
const t = C(e);
|
|
50
|
+
let l = h(d, e.field);
|
|
51
|
+
l && typeof l == "object" && "value" in l && !Array.isArray(l) && (l = l.value);
|
|
52
|
+
const o = y(t, l, d), R = o != null ? String(o) : "", f = v(t);
|
|
53
|
+
return console.log("CellComponent", f), /* @__PURE__ */ c(
|
|
34
54
|
"div",
|
|
35
55
|
{
|
|
36
56
|
className: "flex items-center overflow-hidden",
|
|
37
57
|
"data-split-index": r,
|
|
38
|
-
style: { borderBottom:
|
|
39
|
-
children:
|
|
40
|
-
|
|
58
|
+
style: { borderBottom: g || r === n.length - 1 ? "none" : "1px solid #d9dde7" },
|
|
59
|
+
children: f ? /* @__PURE__ */ c(
|
|
60
|
+
f,
|
|
41
61
|
{
|
|
42
|
-
...
|
|
43
|
-
...
|
|
44
|
-
value:
|
|
45
|
-
colDef: { ...
|
|
46
|
-
valueFormatted: typeof
|
|
47
|
-
onValueChange: (
|
|
48
|
-
|
|
62
|
+
...s,
|
|
63
|
+
...t.cellRendererParams,
|
|
64
|
+
value: l,
|
|
65
|
+
colDef: { ...t, field: e.field },
|
|
66
|
+
valueFormatted: typeof o == "string" ? o : void 0,
|
|
67
|
+
onValueChange: (P) => {
|
|
68
|
+
i && m && m.setDataValue(i.getColId(), { ...d, [e.field]: P });
|
|
49
69
|
}
|
|
50
70
|
}
|
|
51
|
-
) : /* @__PURE__ */
|
|
71
|
+
) : /* @__PURE__ */ c(
|
|
52
72
|
"div",
|
|
53
73
|
{
|
|
54
74
|
className: "w-full h-full flex items-center ag-cell-inner-padding overflow-hidden text-ellipsis whitespace-nowrap",
|
|
55
|
-
title:
|
|
75
|
+
title: R,
|
|
56
76
|
children: "no component found"
|
|
57
77
|
}
|
|
58
78
|
)
|
|
@@ -61,7 +81,7 @@ const y = (d) => {
|
|
|
61
81
|
);
|
|
62
82
|
}) });
|
|
63
83
|
};
|
|
64
|
-
|
|
84
|
+
w.displayName = "SplitCellRenderer";
|
|
65
85
|
export {
|
|
66
|
-
|
|
86
|
+
w as SplitCellRenderer
|
|
67
87
|
};
|
|
@@ -116,7 +116,7 @@ const E = {
|
|
|
116
116
|
Array.isArray(a) ? o(e.id, { value: a.map((r) => r.value) }) : o(e.id, { value: a?.value || "" });
|
|
117
117
|
},
|
|
118
118
|
isMulti: u !== void 0 ? u : !0,
|
|
119
|
-
dropdownZIndex:
|
|
119
|
+
dropdownZIndex: 320,
|
|
120
120
|
placeholder: u === !1 ? "Select value" : "Select values...",
|
|
121
121
|
className: "w-full",
|
|
122
122
|
menuPortalTarget: document.body
|
|
@@ -165,7 +165,7 @@ const E = {
|
|
|
165
165
|
const r = a;
|
|
166
166
|
r && o(e.id, { operator: r.value });
|
|
167
167
|
},
|
|
168
|
-
dropdownZIndex:
|
|
168
|
+
dropdownZIndex: 320,
|
|
169
169
|
placeholder: "Operator",
|
|
170
170
|
className: "w-full",
|
|
171
171
|
menuPortalTarget: document.body
|
|
@@ -197,7 +197,7 @@ const E = {
|
|
|
197
197
|
const t = e;
|
|
198
198
|
t && S(t.value);
|
|
199
199
|
},
|
|
200
|
-
dropdownZIndex:
|
|
200
|
+
dropdownZIndex: 320,
|
|
201
201
|
className: "h-8",
|
|
202
202
|
menuPortalTarget: document.body,
|
|
203
203
|
isClearable: !1
|
|
@@ -1,93 +1,95 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as p, Fragment as h } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u } from "react";
|
|
3
3
|
import { cn as f } from "../../../../../lib/utils.js";
|
|
4
4
|
import { Info as I } from "../../../../../icons/index.js";
|
|
5
|
-
import { LazyTooltip as
|
|
5
|
+
import { LazyTooltip as d } from "./lazy-tooltip.js";
|
|
6
6
|
import { InfoModal as g } from "./info-modal.js";
|
|
7
|
-
const
|
|
8
|
-
const o = (
|
|
9
|
-
|
|
7
|
+
const m = ({ onClick: n, className: r }) => {
|
|
8
|
+
const o = (i) => {
|
|
9
|
+
i.stopPropagation(), n && n(i);
|
|
10
10
|
};
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ t(
|
|
12
12
|
"span",
|
|
13
13
|
{
|
|
14
14
|
className: f(
|
|
15
15
|
"cursor-pointer flex items-center justify-center shrink-0 w-6 h-6 rounded-md transition-all duration-200 text-[#60697D] hover:bg-slate-100 active:bg-slate-200",
|
|
16
|
-
|
|
16
|
+
r
|
|
17
17
|
),
|
|
18
18
|
onClick: o,
|
|
19
19
|
role: "button",
|
|
20
|
-
children: /* @__PURE__ */
|
|
20
|
+
children: /* @__PURE__ */ t(I, { size: 16 })
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
23
|
}, C = ({
|
|
24
|
-
content:
|
|
25
|
-
className:
|
|
24
|
+
content: n,
|
|
25
|
+
className: r,
|
|
26
26
|
onInfoClick: o
|
|
27
|
-
}) => /* @__PURE__ */
|
|
28
|
-
infoData:
|
|
29
|
-
className:
|
|
27
|
+
}) => /* @__PURE__ */ t(d, { content: n, children: /* @__PURE__ */ t(m, { onClick: o, className: r }) }), k = ({
|
|
28
|
+
infoData: n,
|
|
29
|
+
className: r,
|
|
30
30
|
onInfoClick: o
|
|
31
31
|
}) => {
|
|
32
|
-
const [
|
|
33
|
-
|
|
32
|
+
const [i, a] = u(!1), l = (e) => {
|
|
33
|
+
e.stopPropagation(), a(!0);
|
|
34
34
|
};
|
|
35
35
|
return /* @__PURE__ */ p(h, { children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
36
|
+
/* @__PURE__ */ t(d, { content: "Click for details", children: /* @__PURE__ */ t(
|
|
37
|
+
m,
|
|
38
38
|
{
|
|
39
|
-
onClick: (
|
|
40
|
-
l(
|
|
39
|
+
onClick: (e) => {
|
|
40
|
+
l(e), o && o(e);
|
|
41
41
|
},
|
|
42
42
|
className: f(
|
|
43
43
|
"hover:bg-slate-200 hover:shadow-sm hover:text-[#3649C6] hover:-translate-y-0.5 active:scale-95",
|
|
44
|
-
|
|
44
|
+
r
|
|
45
45
|
)
|
|
46
46
|
}
|
|
47
47
|
) }),
|
|
48
|
-
|
|
48
|
+
i && n && // Stop propagation to prevent the click from bubbling to the header group
|
|
49
|
+
// regardless of whether the modal is portaled or not.
|
|
50
|
+
/* @__PURE__ */ t("div", { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ t(
|
|
49
51
|
g,
|
|
50
52
|
{
|
|
51
|
-
open:
|
|
53
|
+
open: i,
|
|
52
54
|
onClose: () => a(!1),
|
|
53
|
-
data:
|
|
55
|
+
data: n
|
|
54
56
|
}
|
|
55
|
-
)
|
|
57
|
+
) })
|
|
56
58
|
] });
|
|
57
|
-
}, j = (
|
|
59
|
+
}, j = (n) => {
|
|
58
60
|
const {
|
|
59
|
-
showInfoIcon:
|
|
61
|
+
showInfoIcon: r,
|
|
60
62
|
displayName: o,
|
|
61
|
-
displayMode:
|
|
63
|
+
displayMode: i = "tooltip",
|
|
62
64
|
infoTooltip: a,
|
|
63
65
|
infoData: l,
|
|
64
|
-
className:
|
|
66
|
+
className: e,
|
|
65
67
|
onInfoClick: s
|
|
66
|
-
} =
|
|
67
|
-
if (!
|
|
68
|
+
} = n;
|
|
69
|
+
if (!r || !o || o.trim() === "") return null;
|
|
68
70
|
const c = () => {
|
|
69
|
-
s && s(
|
|
71
|
+
s && s(n);
|
|
70
72
|
};
|
|
71
|
-
return
|
|
73
|
+
return i === "modal" ? /* @__PURE__ */ t(
|
|
72
74
|
k,
|
|
73
75
|
{
|
|
74
76
|
infoData: l,
|
|
75
77
|
displayName: o,
|
|
76
|
-
className:
|
|
78
|
+
className: e,
|
|
77
79
|
onInfoClick: c
|
|
78
80
|
}
|
|
79
|
-
) : /* @__PURE__ */
|
|
81
|
+
) : /* @__PURE__ */ t(
|
|
80
82
|
C,
|
|
81
83
|
{
|
|
82
84
|
content: a || `Info about ${o}`,
|
|
83
|
-
className:
|
|
85
|
+
className: e,
|
|
84
86
|
onInfoClick: c
|
|
85
87
|
}
|
|
86
88
|
);
|
|
87
89
|
};
|
|
88
90
|
export {
|
|
89
91
|
j as HeaderInfo,
|
|
90
|
-
|
|
92
|
+
m as InfoIconTrigger,
|
|
91
93
|
k as ModalInfoTrigger,
|
|
92
94
|
C as TooltipInfoTrigger
|
|
93
95
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useGridHeader as
|
|
5
|
-
import { HeaderInfo as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { useState as M, useEffect as z } from "react";
|
|
3
|
+
import { cn as m } from "../../../../lib/utils.js";
|
|
4
|
+
import { useGridHeader as G } from "./context/grid-header-context.js";
|
|
5
|
+
import { HeaderInfo as U } from "./components/header-info.js";
|
|
6
|
+
import { Checkbox as K } from "../../checkbox.js";
|
|
7
|
+
import { HeaderSearchInput as q } from "./header-search-input.js";
|
|
8
|
+
const J = () => /* @__PURE__ */ a(j, { children: [
|
|
9
|
+
/* @__PURE__ */ e("span", { className: "sort-asc-icon inline-flex transition-colors text-[#60697D] hover:text-[#3649C6]", children: /* @__PURE__ */ a(
|
|
9
10
|
"svg",
|
|
10
11
|
{
|
|
11
12
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -20,7 +21,7 @@ const q = () => /* @__PURE__ */ i(z, { children: [
|
|
|
20
21
|
]
|
|
21
22
|
}
|
|
22
23
|
) }),
|
|
23
|
-
/* @__PURE__ */ e("span", { className: "sort-desc-icon inline-flex transition-colors text-[#60697D] hover:text-[#3649C6]", children: /* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ e("span", { className: "sort-desc-icon inline-flex transition-colors text-[#60697D] hover:text-[#3649C6]", children: /* @__PURE__ */ a(
|
|
24
25
|
"svg",
|
|
25
26
|
{
|
|
26
27
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -47,62 +48,67 @@ const q = () => /* @__PURE__ */ i(z, { children: [
|
|
|
47
48
|
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" })
|
|
48
49
|
}
|
|
49
50
|
) })
|
|
50
|
-
] }),
|
|
51
|
-
const
|
|
52
|
-
return
|
|
51
|
+
] }), Q = ({ api: t }) => {
|
|
52
|
+
const [g, f] = M(!1), [H, w] = M(!1);
|
|
53
|
+
return z(() => {
|
|
53
54
|
if (!t) return;
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
const l = t.getGridOption?.("rowModelType") === "serverSide", x = () => {
|
|
56
|
+
let n = !1, i = !1;
|
|
57
|
+
if (l) {
|
|
58
|
+
const u = t.getServerSideSelectionState?.();
|
|
59
|
+
if (u) {
|
|
60
|
+
const { selectAll: s, toggledNodes: S } = u, p = S && S.length > 0;
|
|
61
|
+
s && !p ? (n = !0, i = !1) : s && p || !s && p ? (n = !1, i = !0) : (n = !1, i = !1);
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
const u = t.getSelectedRows().length, s = t.getDisplayedRowCount();
|
|
65
|
+
u === 0 ? (n = !1, i = !1) : u === s && s > 0 ? (n = !0, i = !1) : (n = !1, i = !0);
|
|
66
|
+
}
|
|
67
|
+
f(n), w(i);
|
|
57
68
|
};
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
69
|
+
x();
|
|
70
|
+
const h = () => {
|
|
71
|
+
x();
|
|
61
72
|
};
|
|
62
|
-
return t.addEventListener("selectionChanged",
|
|
63
|
-
t.removeEventListener("selectionChanged",
|
|
73
|
+
return t.addEventListener("selectionChanged", h), t.addEventListener("modelUpdated", h), () => {
|
|
74
|
+
t.removeEventListener("selectionChanged", h), t.removeEventListener("modelUpdated", h);
|
|
64
75
|
};
|
|
65
|
-
}, [t]), /* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
),
|
|
79
|
-
/* @__PURE__ */ e("div", { className: `ag-checkbox-input-custom ${C ? "ag-checked" : ""} ${c ? "ag-indeterminate" : ""}` })
|
|
80
|
-
] });
|
|
81
|
-
}, re = (t) => {
|
|
76
|
+
}, [t]), /* @__PURE__ */ e(
|
|
77
|
+
K,
|
|
78
|
+
{
|
|
79
|
+
checked: H ? "indeterminate" : g,
|
|
80
|
+
onCheckedChange: (l) => {
|
|
81
|
+
l === !0 ? t.selectAll() : t.deselectAll();
|
|
82
|
+
},
|
|
83
|
+
"aria-label": "Toggle Selection",
|
|
84
|
+
className: "mr-0"
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}, le = (t) => {
|
|
82
88
|
const {
|
|
83
|
-
displayName:
|
|
84
|
-
enableSorting:
|
|
85
|
-
enableMenu:
|
|
86
|
-
progressSort:
|
|
87
|
-
column:
|
|
89
|
+
displayName: g,
|
|
90
|
+
enableSorting: f,
|
|
91
|
+
enableMenu: H,
|
|
92
|
+
progressSort: w,
|
|
93
|
+
column: d,
|
|
88
94
|
api: l,
|
|
89
|
-
handleInlineSearch:
|
|
90
|
-
handleClearSearchInline:
|
|
91
|
-
onColumnSearchClick:
|
|
92
|
-
onAdvanceSearchClick:
|
|
93
|
-
toggleAdvanceSearch:
|
|
94
|
-
isSearchable:
|
|
95
|
-
advanceSearchEnabled:
|
|
95
|
+
handleInlineSearch: x,
|
|
96
|
+
handleClearSearchInline: h,
|
|
97
|
+
onColumnSearchClick: n,
|
|
98
|
+
onAdvanceSearchClick: i,
|
|
99
|
+
toggleAdvanceSearch: u,
|
|
100
|
+
isSearchable: s = !1,
|
|
101
|
+
advanceSearchEnabled: S = !1,
|
|
96
102
|
// Select params
|
|
97
|
-
selectOptions:
|
|
103
|
+
selectOptions: p,
|
|
98
104
|
isMultiSelect: A,
|
|
99
105
|
onSelectScrollToBottom: D,
|
|
100
106
|
onSelectSearchChange: F,
|
|
101
|
-
onSelectOpen:
|
|
102
|
-
isLoadingSelect:
|
|
103
|
-
} = t,
|
|
104
|
-
|
|
105
|
-
const b = l.getGridOption("context")?.activeSearchColumnId ===
|
|
107
|
+
onSelectOpen: T,
|
|
108
|
+
isLoadingSelect: V
|
|
109
|
+
} = t, c = G(), o = d.getColDef(), C = d.getColId(), k = d.isFilterActive(), _ = d.getSort(), N = d.getSortIndex(), Z = !!_, E = N != null && (N > 0 || l.getColumnState().filter((r) => r.sort).length > 1), P = Z && E, y = o?.filter || "agTextColumnFilter", v = y === "agNumberColumnFilter" || (Array.isArray(o?.type) ? o.type.some((r) => r === "number" || r === "numericColumn") : o?.type === "number" || o?.type === "numericColumn");
|
|
110
|
+
y === "agDateColumnFilter" || (Array.isArray(o?.type) ? o.type.includes("dateColumn") : o?.type);
|
|
111
|
+
const b = l.getGridOption("context")?.activeSearchColumnId === C, I = ![
|
|
106
112
|
"agTextColumnFilter",
|
|
107
113
|
"agNumberColumnFilter",
|
|
108
114
|
"agDateColumnFilter",
|
|
@@ -112,110 +118,110 @@ const q = () => /* @__PURE__ */ i(z, { children: [
|
|
|
112
118
|
// Defaults to text/set
|
|
113
119
|
void 0
|
|
114
120
|
// Defaults to text
|
|
115
|
-
].includes(o?.filter),
|
|
116
|
-
|
|
117
|
-
},
|
|
118
|
-
if (
|
|
119
|
-
l.showColumnFilter ? l.showColumnFilter(
|
|
121
|
+
].includes(o?.filter), L = (r) => {
|
|
122
|
+
r.stopPropagation(), f && w && w(r.shiftKey);
|
|
123
|
+
}, B = (r) => {
|
|
124
|
+
if (r.stopPropagation(), n && n(t), I) {
|
|
125
|
+
l.showColumnFilter ? l.showColumnFilter(C) : l.showColumnMenu(C);
|
|
120
126
|
return;
|
|
121
127
|
}
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
|
|
128
|
+
c && (b ? c.closeSearch() : c.openSearch(C));
|
|
129
|
+
}, R = (r) => /* @__PURE__ */ e("span", { onClick: (O) => O.stopPropagation(), children: /* @__PURE__ */ e(
|
|
130
|
+
U,
|
|
125
131
|
{
|
|
126
132
|
...t,
|
|
127
|
-
className:
|
|
133
|
+
className: r
|
|
128
134
|
}
|
|
129
135
|
) });
|
|
130
|
-
return b &&
|
|
131
|
-
|
|
136
|
+
return b && c && !I ? /* @__PURE__ */ e(
|
|
137
|
+
q,
|
|
132
138
|
{
|
|
133
|
-
column:
|
|
139
|
+
column: d,
|
|
134
140
|
api: l,
|
|
135
|
-
onClose: () =>
|
|
136
|
-
handleInlineSearch:
|
|
137
|
-
handleClearSearchInline:
|
|
138
|
-
onAdvanceSearchClick:
|
|
139
|
-
toggleAdvanceSearch:
|
|
140
|
-
advanceSearchEnabled:
|
|
141
|
-
selectOptions:
|
|
141
|
+
onClose: () => c.closeSearch(),
|
|
142
|
+
handleInlineSearch: x,
|
|
143
|
+
handleClearSearchInline: h ? () => h(t) : void 0,
|
|
144
|
+
onAdvanceSearchClick: i,
|
|
145
|
+
toggleAdvanceSearch: u,
|
|
146
|
+
advanceSearchEnabled: S,
|
|
147
|
+
selectOptions: p,
|
|
142
148
|
isMultiSelect: A,
|
|
143
149
|
onSelectScrollToBottom: D,
|
|
144
150
|
onSelectSearchChange: F,
|
|
145
|
-
onSelectOpen:
|
|
146
|
-
isLoadingSelect:
|
|
151
|
+
onSelectOpen: T,
|
|
152
|
+
isLoadingSelect: V
|
|
147
153
|
}
|
|
148
|
-
) : /* @__PURE__ */
|
|
154
|
+
) : /* @__PURE__ */ a("div", { className: m(
|
|
149
155
|
"ag-header-cell-label flex items-center w-full group min-w-0",
|
|
150
|
-
|
|
156
|
+
v ? "flex-row-reverse" : "flex-row"
|
|
151
157
|
), children: [
|
|
152
158
|
/* @__PURE__ */ e(
|
|
153
159
|
"div",
|
|
154
160
|
{
|
|
155
|
-
className:
|
|
161
|
+
className: m(
|
|
156
162
|
"ag-header-cell-text flex-1 relative group flex items-center min-w-0 overflow-hidden h-full",
|
|
157
|
-
|
|
158
|
-
|
|
163
|
+
v ? "flex-row-reverse" : "flex-row",
|
|
164
|
+
f ? "sortable cursor-pointer" : ""
|
|
159
165
|
),
|
|
160
|
-
onClick:
|
|
161
|
-
children: /* @__PURE__ */
|
|
166
|
+
onClick: f ? L : void 0,
|
|
167
|
+
children: /* @__PURE__ */ a("div", { className: m(
|
|
162
168
|
"flex items-center min-w-0",
|
|
163
|
-
|
|
169
|
+
v ? "flex-row-reverse" : "flex-row",
|
|
164
170
|
// If it's a checkbox-only header (no display name), center it and ensure it's not clipped
|
|
165
|
-
o?.headerCheckboxSelection && !
|
|
171
|
+
o?.headerCheckboxSelection && !g ? "justify-center pl-0 pr-0" : "gap-1"
|
|
166
172
|
), children: [
|
|
167
|
-
o?.headerCheckboxSelection && /* @__PURE__ */ e(
|
|
168
|
-
/* @__PURE__ */ e("span", { className: "block truncate", children:
|
|
169
|
-
|
|
173
|
+
o?.headerCheckboxSelection && /* @__PURE__ */ e(Q, { api: l }),
|
|
174
|
+
/* @__PURE__ */ e("span", { className: "block truncate", children: g !== "Selection" && g }),
|
|
175
|
+
R(m(
|
|
170
176
|
"text-[#60697D] hover:text-[#3649C6] transition-colors",
|
|
171
|
-
|
|
177
|
+
v ? "mr-1" : "ml-1"
|
|
172
178
|
))
|
|
173
179
|
] })
|
|
174
180
|
}
|
|
175
181
|
),
|
|
176
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ a(
|
|
177
183
|
"div",
|
|
178
184
|
{
|
|
179
|
-
className:
|
|
185
|
+
className: m(
|
|
180
186
|
"flex items-center shrink-0 group gap-1",
|
|
181
|
-
|
|
187
|
+
v ? "flex-row-reverse" : "flex-row"
|
|
182
188
|
),
|
|
183
189
|
children: [
|
|
184
|
-
|
|
190
|
+
f && /* @__PURE__ */ a(
|
|
185
191
|
"div",
|
|
186
192
|
{
|
|
187
193
|
className: "ag-sort-indicator-container cursor-pointer flex items-center",
|
|
188
|
-
onClick:
|
|
194
|
+
onClick: L,
|
|
189
195
|
children: [
|
|
190
|
-
P && /* @__PURE__ */ e("span", { className: "ag-sort-order text-[10px] font-bold text-[#60697D] mr-0.5", children:
|
|
191
|
-
/* @__PURE__ */ e("span", { className: "ag-sort-indicator-icon", children: /* @__PURE__ */ e(
|
|
196
|
+
P && /* @__PURE__ */ e("span", { className: "ag-sort-order text-[10px] font-bold text-[#60697D] mr-0.5", children: N + 1 }),
|
|
197
|
+
/* @__PURE__ */ e("span", { className: "ag-sort-indicator-icon", children: /* @__PURE__ */ e(J, {}) })
|
|
192
198
|
]
|
|
193
199
|
}
|
|
194
200
|
),
|
|
195
|
-
|
|
201
|
+
s && /* @__PURE__ */ a(
|
|
196
202
|
"span",
|
|
197
203
|
{
|
|
198
|
-
className:
|
|
204
|
+
className: m(
|
|
199
205
|
"relative cursor-pointer flex items-center shrink-0 duration-200 text-[#60697D] hover:text-[#3649C6] transition-colors",
|
|
200
|
-
|
|
206
|
+
k ? "opacity-100 w-auto" : "opacity-0 w-0 overflow-hidden group-hover:opacity-100 group-hover:w-auto"
|
|
201
207
|
),
|
|
202
|
-
onClick:
|
|
203
|
-
title:
|
|
208
|
+
onClick: B,
|
|
209
|
+
title: k ? "Active filter" : "Search",
|
|
204
210
|
children: [
|
|
205
211
|
/* @__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" }) }),
|
|
206
|
-
|
|
212
|
+
k && /* @__PURE__ */ e("span", { className: "absolute -top-0.5 -right-0.5 w-2.5 h-2.5 rounded-full border-2 bg-[#4259ee] z-10" })
|
|
207
213
|
]
|
|
208
214
|
}
|
|
209
215
|
),
|
|
210
|
-
|
|
216
|
+
H && !o?.suppressHeaderMenuButton && /* @__PURE__ */ e("div", { className: "custom-ag-header-icons relative", children: /* @__PURE__ */ e(
|
|
211
217
|
"button",
|
|
212
218
|
{
|
|
213
|
-
className:
|
|
219
|
+
className: m(
|
|
214
220
|
"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-[#60697D] hover:text-[#3649C6]",
|
|
215
|
-
|
|
221
|
+
c?.activeMenuColumnId === C ? "opacity-100 w-auto text-[#3649C6]" : "w-0 opacity-0 group-hover:w-auto group-hover:opacity-100"
|
|
216
222
|
),
|
|
217
|
-
onClick: (
|
|
218
|
-
|
|
223
|
+
onClick: (r) => {
|
|
224
|
+
r.stopPropagation(), c && c.openMenu(C, r.currentTarget);
|
|
219
225
|
},
|
|
220
226
|
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" }) })
|
|
221
227
|
}
|
|
@@ -226,5 +232,5 @@ const q = () => /* @__PURE__ */ i(z, { children: [
|
|
|
226
232
|
] });
|
|
227
233
|
};
|
|
228
234
|
export {
|
|
229
|
-
|
|
235
|
+
le as CustomHeader
|
|
230
236
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Theme } from 'ag-grid-
|
|
1
|
+
import { Theme } from 'ag-grid-enterprise';
|
|
2
2
|
export declare const customAgGridTheme: Theme;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impact-nova",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -246,7 +246,13 @@
|
|
|
246
246
|
},
|
|
247
247
|
"./tailwind.config": {
|
|
248
248
|
"types": "./tailwind.config.d.ts",
|
|
249
|
-
"import": "./tailwind.config.js"
|
|
249
|
+
"import": "./tailwind.config.js",
|
|
250
|
+
"default": "./tailwind.config.js"
|
|
251
|
+
},
|
|
252
|
+
"./tailwind.config.js": {
|
|
253
|
+
"types": "./tailwind.config.d.ts",
|
|
254
|
+
"import": "./tailwind.config.js",
|
|
255
|
+
"default": "./tailwind.config.js"
|
|
250
256
|
},
|
|
251
257
|
"./dist/*": "./dist/*"
|
|
252
258
|
},
|
|
@@ -512,4 +518,4 @@
|
|
|
512
518
|
"react": "^19.2.0",
|
|
513
519
|
"react-dom": "^19.2.0"
|
|
514
520
|
}
|
|
515
|
-
}
|
|
521
|
+
}
|