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.
@@ -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: import('react').ForwardRefExoticComponent<SplitCellEditorProps & import('react').RefAttributes<unknown>>;
17
+ export declare const SplitCellEditor: React.ForwardRefExoticComponent<SplitCellEditorProps & React.RefAttributes<unknown>>;
@@ -1,85 +1,100 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as b, useRef as R, useImperativeHandle as v } from "react";
3
- import { AG_GRID_VALUE_FORMATTERS as x } from "../../value-formatters.js";
4
- const N = b((m, g) => {
5
- const { splits: a, data: f, node: h, api: u, column: d, context: p, stopEditing: y } = m, i = R({});
6
- Object.keys(i.current).length === 0 && a && f && a.forEach((e) => {
7
- const o = e.field.split(".");
8
- let r = f;
9
- for (const t of o) r = r?.[t];
10
- i.current[e.field] = r && typeof r == "object" && "value" in r ? r.value : r;
11
- }), v(g, () => ({
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 e = JSON.parse(JSON.stringify(f));
14
- return Object.entries(i.current).forEach(([o, r]) => {
15
- const t = o.split(".");
16
- let l = e;
17
- for (let n = 0; n < t.length - 1; n++)
18
- l[t[n]] || (l[t[n]] = {}), l = l[t[n]];
19
- l[t[t.length - 1]] = r;
20
- }), e;
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 C = d?.getColDef().type === "number", E = (e, o, r) => {
27
- const t = e.valueFormatter;
28
- if (!t) return o;
29
- if (typeof t == "function")
30
- return t({ value: o, data: r });
31
- const l = typeof t == "string" ? t : t.type, n = x[l];
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 c = {
47
+ const d = {
34
48
  value: o,
35
- data: r,
36
- node: h,
37
- api: u,
38
- context: p,
39
- column: d,
49
+ data: t,
50
+ node: E,
51
+ api: g,
52
+ context: h,
53
+ column: m,
40
54
  colDef: {
41
- ...d?.getColDef(),
42
- ...typeof t == "object" ? t : {},
43
- ...e
55
+ ...m?.getColDef(),
56
+ ...typeof e == "object" ? e : {},
57
+ ...r
44
58
  }
45
59
  };
46
- return n(c);
60
+ return n(d);
47
61
  }
48
62
  return o;
49
63
  };
50
- return /* @__PURE__ */ s("div", { style: { display: "grid", gridTemplateRows: `repeat(${a.length}, 1fr)`, height: "100%", width: "100%" }, children: a.map((e, o) => {
51
- let r = e.cellEditor || e.cellRenderer;
52
- if (typeof r == "string") {
53
- const c = u?.getGridOption("components");
54
- r = p?.frameworkComponents?.[r] || c?.[r];
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 t = e.type === "number" || e.type !== "text" && C, l = i.current[e.field], n = r;
57
- return /* @__PURE__ */ s(
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 ${t ? "justify-end" : ""}`,
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: e.editable && n ? /* @__PURE__ */ s(
63
- n,
77
+ children: t.editable && d ? /* @__PURE__ */ f(
78
+ d,
64
79
  {
65
- ...m,
66
- ...e.cellEditorParams,
67
- ...e.cellRendererParams,
68
- value: l,
69
- onValueChange: (c) => {
70
- i.current[e.field] = c;
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: { ...e, field: e.field },
74
- stopEditing: y
88
+ colDef: { ...t, field: r.field },
89
+ stopEditing: R
75
90
  }
76
- ) : /* @__PURE__ */ s("div", { className: `w-full px-2 text-gray-500 ${t ? "text-right" : ""}`, children: E(e, l, f) })
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
- N.displayName = "SplitCellEditor";
97
+ w.displayName = "SplitCellEditor";
83
98
  export {
84
- N as SplitCellEditor
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 i } from "react/jsx-runtime";
1
+ import { jsx as c } from "react/jsx-runtime";
2
2
  import "react";
3
- const y = (d) => {
4
- const { splits: n, data: a, node: c, column: o, context: u } = d;
5
- if (!n || !Array.isArray(n)) return null;
6
- const m = a?._isPinned === !0, g = (e, r) => r.split(".").reduce((t, l) => t?.[l], e), p = (e, r, t) => {
7
- const l = o?.getColDef().valueFormatter;
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 f = {
21
+ const o = {
10
22
  value: r,
11
23
  data: t,
12
- node: c,
24
+ node: m,
13
25
  context: u,
14
- column: o,
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
- ...o?.getColDef(),
30
+ ...i?.getColDef(),
19
31
  ...e,
20
32
  field: e.field
21
33
  },
22
34
  // Include required ValueFormatterParams properties from props
23
- api: d.api
35
+ api: s.api
24
36
  };
25
- return l(f);
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__ */ i("div", { style: { display: "grid", gridTemplateRows: `repeat(${n.length}, 1fr)`, height: "100%", width: "100%" }, children: n?.map((e, r) => {
30
- let t = g(a, e.field);
31
- t && typeof t == "object" && "value" in t && !Array.isArray(t) && (t = t.value);
32
- const l = p(e, t, a), f = l != null ? String(l) : "", s = e.cellRenderer;
33
- return /* @__PURE__ */ i(
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: m || r === n.length - 1 ? "none" : "1px solid #d9dde7" },
39
- children: s ? /* @__PURE__ */ i(
40
- s,
58
+ style: { borderBottom: g || r === n.length - 1 ? "none" : "1px solid #d9dde7" },
59
+ children: f ? /* @__PURE__ */ c(
60
+ f,
41
61
  {
42
- ...d,
43
- ...e.cellRendererParams,
44
- value: t,
45
- colDef: { ...e, field: e.field },
46
- valueFormatted: typeof l == "string" ? l : void 0,
47
- onValueChange: (h) => {
48
- o && c && c.setDataValue(o.getColId(), { ...a, [e.field]: h });
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__ */ i(
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: f,
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
- y.displayName = "SplitCellRenderer";
84
+ w.displayName = "SplitCellRenderer";
65
85
  export {
66
- y as SplitCellRenderer
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: 51,
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: 51,
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: 51,
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 n, jsxs as p, Fragment as h } from "react/jsx-runtime";
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 m } from "./lazy-tooltip.js";
5
+ import { LazyTooltip as d } from "./lazy-tooltip.js";
6
6
  import { InfoModal as g } from "./info-modal.js";
7
- const d = ({ onClick: t, className: e }) => {
8
- const o = (r) => {
9
- r.stopPropagation(), t && t(r);
7
+ const m = ({ onClick: n, className: r }) => {
8
+ const o = (i) => {
9
+ i.stopPropagation(), n && n(i);
10
10
  };
11
- return /* @__PURE__ */ n(
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
- e
16
+ r
17
17
  ),
18
18
  onClick: o,
19
19
  role: "button",
20
- children: /* @__PURE__ */ n(I, { size: 16 })
20
+ children: /* @__PURE__ */ t(I, { size: 16 })
21
21
  }
22
22
  );
23
23
  }, C = ({
24
- content: t,
25
- className: e,
24
+ content: n,
25
+ className: r,
26
26
  onInfoClick: o
27
- }) => /* @__PURE__ */ n(m, { content: t, children: /* @__PURE__ */ n(d, { onClick: o, className: e }) }), k = ({
28
- infoData: t,
29
- className: e,
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 [r, a] = u(!1), l = (i) => {
33
- i.stopPropagation(), a(!0);
32
+ const [i, a] = u(!1), l = (e) => {
33
+ e.stopPropagation(), a(!0);
34
34
  };
35
35
  return /* @__PURE__ */ p(h, { children: [
36
- /* @__PURE__ */ n(m, { content: "Click for details", children: /* @__PURE__ */ n(
37
- d,
36
+ /* @__PURE__ */ t(d, { content: "Click for details", children: /* @__PURE__ */ t(
37
+ m,
38
38
  {
39
- onClick: (i) => {
40
- l(i), o && o(i);
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
- e
44
+ r
45
45
  )
46
46
  }
47
47
  ) }),
48
- r && t && /* @__PURE__ */ n(
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: r,
53
+ open: i,
52
54
  onClose: () => a(!1),
53
- data: t
55
+ data: n
54
56
  }
55
- )
57
+ ) })
56
58
  ] });
57
- }, j = (t) => {
59
+ }, j = (n) => {
58
60
  const {
59
- showInfoIcon: e,
61
+ showInfoIcon: r,
60
62
  displayName: o,
61
- displayMode: r = "tooltip",
63
+ displayMode: i = "tooltip",
62
64
  infoTooltip: a,
63
65
  infoData: l,
64
- className: i,
66
+ className: e,
65
67
  onInfoClick: s
66
- } = t;
67
- if (!e || !o || o.trim() === "") return null;
68
+ } = n;
69
+ if (!r || !o || o.trim() === "") return null;
68
70
  const c = () => {
69
- s && s(t);
71
+ s && s(n);
70
72
  };
71
- return r === "modal" ? /* @__PURE__ */ n(
73
+ return i === "modal" ? /* @__PURE__ */ t(
72
74
  k,
73
75
  {
74
76
  infoData: l,
75
77
  displayName: o,
76
- className: i,
78
+ className: e,
77
79
  onInfoClick: c
78
80
  }
79
- ) : /* @__PURE__ */ n(
81
+ ) : /* @__PURE__ */ t(
80
82
  C,
81
83
  {
82
84
  content: a || `Info about ${o}`,
83
- className: i,
85
+ className: e,
84
86
  onInfoClick: c
85
87
  }
86
88
  );
87
89
  };
88
90
  export {
89
91
  j as HeaderInfo,
90
- d as InfoIconTrigger,
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 i, Fragment as z } from "react/jsx-runtime";
2
- import { useRef as O, useState as y, useEffect as G } from "react";
3
- import { cn as h } from "../../../../lib/utils.js";
4
- import { useGridHeader as U } from "./context/grid-header-context.js";
5
- import { HeaderInfo as $ } from "./components/header-info.js";
6
- import { HeaderSearchInput as K } from "./header-search-input.js";
7
- const q = () => /* @__PURE__ */ i(z, { children: [
8
- /* @__PURE__ */ e("span", { className: "sort-asc-icon inline-flex transition-colors text-[#60697D] hover:text-[#3649C6]", children: /* @__PURE__ */ i(
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__ */ i(
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
- ] }), J = ({ api: t, displayName: f }) => {
51
- const r = O(null), [C, u] = y(!1), [c, l] = y(!1);
52
- return G(() => {
51
+ ] }), Q = ({ api: t }) => {
52
+ const [g, f] = M(!1), [H, w] = M(!1);
53
+ return z(() => {
53
54
  if (!t) return;
54
- const d = () => {
55
- const p = t.getSelectedRows().length, w = t.getDisplayedRowCount();
56
- p === 0 ? (u(!1), l(!1), r.current && (r.current.indeterminate = !1)) : p === w && w > 0 ? (u(!0), l(!1), r.current && (r.current.indeterminate = !1)) : (u(!1), l(!0), r.current && (r.current.indeterminate = !0));
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
- d();
59
- const s = (p) => {
60
- d();
69
+ x();
70
+ const h = () => {
71
+ x();
61
72
  };
62
- return t.addEventListener("selectionChanged", s), t.addEventListener("modelUpdated", s), () => {
63
- t.removeEventListener("selectionChanged", s), t.removeEventListener("modelUpdated", s);
73
+ return t.addEventListener("selectionChanged", h), t.addEventListener("modelUpdated", h), () => {
74
+ t.removeEventListener("selectionChanged", h), t.removeEventListener("modelUpdated", h);
64
75
  };
65
- }, [t]), /* @__PURE__ */ i("div", { className: "ag-wrapper ag-input-wrapper ag-checkbox-input-wrapper", role: "presentation", children: [
66
- /* @__PURE__ */ e(
67
- "input",
68
- {
69
- ref: r,
70
- className: "ag-input-field-input ag-checkbox-input-input",
71
- type: "checkbox",
72
- checked: C,
73
- onChange: (d) => {
74
- d.target.checked ? t.selectAll() : t.deselectAll();
75
- },
76
- "aria-label": "Toggle Selection"
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: f,
84
- enableSorting: r,
85
- enableMenu: C,
86
- progressSort: u,
87
- column: c,
89
+ displayName: g,
90
+ enableSorting: f,
91
+ enableMenu: H,
92
+ progressSort: w,
93
+ column: d,
88
94
  api: l,
89
- handleInlineSearch: S,
90
- handleClearSearchInline: d,
91
- onColumnSearchClick: s,
92
- onAdvanceSearchClick: p,
93
- toggleAdvanceSearch: w,
94
- isSearchable: I = !1,
95
- advanceSearchEnabled: L = !1,
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: M,
103
+ selectOptions: p,
98
104
  isMultiSelect: A,
99
105
  onSelectScrollToBottom: D,
100
106
  onSelectSearchChange: F,
101
- onSelectOpen: V,
102
- isLoadingSelect: T
103
- } = t, a = U(), o = c.getColDef(), m = c.getColId(), x = c.isFilterActive(), _ = c.getSort(), v = c.getSortIndex(), Z = !!_, E = v != null && (v > 0 || l.getColumnState().filter((n) => n.sort).length > 1), P = Z && E, N = o?.filter || "agTextColumnFilter", g = N === "agNumberColumnFilter" || (Array.isArray(o?.type) ? o.type.some((n) => n === "number" || n === "numericColumn") : o?.type === "number" || o?.type === "numericColumn");
104
- N === "agDateColumnFilter" || (Array.isArray(o?.type) ? o.type.includes("dateColumn") : o?.type);
105
- const b = l.getGridOption("context")?.activeSearchColumnId === m, k = ![
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), H = (n) => {
116
- n.stopPropagation(), r && u && u(n.shiftKey);
117
- }, R = (n) => {
118
- if (n.stopPropagation(), s && s(t), k) {
119
- l.showColumnFilter ? l.showColumnFilter(m) : l.showColumnMenu(m);
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
- a && (b ? a.closeSearch() : a.openSearch(m));
123
- }, B = (n) => /* @__PURE__ */ e("span", { onClick: (j) => j.stopPropagation(), children: /* @__PURE__ */ e(
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: n
133
+ className: r
128
134
  }
129
135
  ) });
130
- return b && a && !k ? /* @__PURE__ */ e(
131
- K,
136
+ return b && c && !I ? /* @__PURE__ */ e(
137
+ q,
132
138
  {
133
- column: c,
139
+ column: d,
134
140
  api: l,
135
- onClose: () => a.closeSearch(),
136
- handleInlineSearch: S,
137
- handleClearSearchInline: d ? () => d(t) : void 0,
138
- onAdvanceSearchClick: p,
139
- toggleAdvanceSearch: w,
140
- advanceSearchEnabled: L,
141
- selectOptions: M,
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: V,
146
- isLoadingSelect: T
151
+ onSelectOpen: T,
152
+ isLoadingSelect: V
147
153
  }
148
- ) : /* @__PURE__ */ i("div", { className: h(
154
+ ) : /* @__PURE__ */ a("div", { className: m(
149
155
  "ag-header-cell-label flex items-center w-full group min-w-0",
150
- g ? "flex-row-reverse" : "flex-row"
156
+ v ? "flex-row-reverse" : "flex-row"
151
157
  ), children: [
152
158
  /* @__PURE__ */ e(
153
159
  "div",
154
160
  {
155
- className: h(
161
+ className: m(
156
162
  "ag-header-cell-text flex-1 relative group flex items-center min-w-0 overflow-hidden h-full",
157
- g ? "flex-row-reverse" : "flex-row",
158
- r ? "sortable cursor-pointer" : ""
163
+ v ? "flex-row-reverse" : "flex-row",
164
+ f ? "sortable cursor-pointer" : ""
159
165
  ),
160
- onClick: r ? H : void 0,
161
- children: /* @__PURE__ */ i("div", { className: h(
166
+ onClick: f ? L : void 0,
167
+ children: /* @__PURE__ */ a("div", { className: m(
162
168
  "flex items-center min-w-0",
163
- g ? "flex-row-reverse" : "flex-row",
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 && !f ? "justify-center pl-0 pr-0" : "gap-1"
171
+ o?.headerCheckboxSelection && !g ? "justify-center pl-0 pr-0" : "gap-1"
166
172
  ), children: [
167
- o?.headerCheckboxSelection && /* @__PURE__ */ e(J, { api: l, displayName: f }),
168
- /* @__PURE__ */ e("span", { className: "block truncate", children: f !== "Selection" && f }),
169
- B(h(
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
- g ? "mr-1" : "ml-1"
177
+ v ? "mr-1" : "ml-1"
172
178
  ))
173
179
  ] })
174
180
  }
175
181
  ),
176
- /* @__PURE__ */ i(
182
+ /* @__PURE__ */ a(
177
183
  "div",
178
184
  {
179
- className: h(
185
+ className: m(
180
186
  "flex items-center shrink-0 group gap-1",
181
- g ? "flex-row-reverse" : "flex-row"
187
+ v ? "flex-row-reverse" : "flex-row"
182
188
  ),
183
189
  children: [
184
- r && /* @__PURE__ */ i(
190
+ f && /* @__PURE__ */ a(
185
191
  "div",
186
192
  {
187
193
  className: "ag-sort-indicator-container cursor-pointer flex items-center",
188
- onClick: H,
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: v + 1 }),
191
- /* @__PURE__ */ e("span", { className: "ag-sort-indicator-icon", children: /* @__PURE__ */ e(q, {}) })
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
- I && /* @__PURE__ */ i(
201
+ s && /* @__PURE__ */ a(
196
202
  "span",
197
203
  {
198
- className: h(
204
+ className: m(
199
205
  "relative cursor-pointer flex items-center shrink-0 duration-200 text-[#60697D] hover:text-[#3649C6] transition-colors",
200
- x ? "opacity-100 w-auto" : "opacity-0 w-0 overflow-hidden group-hover:opacity-100 group-hover:w-auto"
206
+ k ? "opacity-100 w-auto" : "opacity-0 w-0 overflow-hidden group-hover:opacity-100 group-hover:w-auto"
201
207
  ),
202
- onClick: R,
203
- title: x ? "Active filter" : "Search",
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
- x && /* @__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" })
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
- C && !o?.suppressHeaderMenuButton && /* @__PURE__ */ e("div", { className: "custom-ag-header-icons relative", children: /* @__PURE__ */ e(
216
+ H && !o?.suppressHeaderMenuButton && /* @__PURE__ */ e("div", { className: "custom-ag-header-icons relative", children: /* @__PURE__ */ e(
211
217
  "button",
212
218
  {
213
- className: h(
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
- a?.activeMenuColumnId === m ? "opacity-100 w-auto text-[#3649C6]" : "w-0 opacity-0 group-hover:w-auto group-hover:opacity-100"
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: (n) => {
218
- n.stopPropagation(), a && a.openMenu(m, n.currentTarget);
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
- re as CustomHeader
235
+ le as CustomHeader
230
236
  };
@@ -1,2 +1,2 @@
1
- import { Theme } from 'ag-grid-community';
1
+ import { Theme } from 'ag-grid-enterprise';
2
2
  export declare const customAgGridTheme: Theme;
@@ -1,4 +1,4 @@
1
- import { themeQuartz as e, iconSetMaterial as r } from "ag-grid-community";
1
+ import { themeQuartz as e, iconSetMaterial as r } from "ag-grid-enterprise";
2
2
  /* empty css */
3
3
  const a = e.withPart(r).withParams({
4
4
  accentColor: "#4259EE",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impact-nova",
3
- "version": "0.1.0",
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
+ }