impact-nova 1.3.0 → 1.5.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.
Files changed (117) hide show
  1. package/README.md +49 -0
  2. package/dist/components/layout/dashboard-layout.d.ts +15 -1
  3. package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +65 -64
  4. package/dist/components/ui/accordion.js +38 -34
  5. package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +1 -1
  6. package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.d.ts +58 -0
  7. package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.js +104 -0
  8. package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +62 -54
  9. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +4 -6
  10. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +54 -68
  11. package/dist/components/ui/ag-grid-react/cell-renderers/index.d.ts +3 -1
  12. package/dist/components/ui/ag-grid-react/cell-renderers/index.js +33 -27
  13. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +3 -0
  14. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +28 -12
  15. package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.d.ts +2 -0
  16. package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +45 -44
  17. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.d.ts +4 -6
  18. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +23 -37
  19. package/dist/components/ui/ag-grid-react/cell-renderers/types.d.ts +33 -17
  20. package/dist/components/ui/ag-grid-react/editable-utils.d.ts +27 -0
  21. package/dist/components/ui/ag-grid-react/editable-utils.js +62 -0
  22. package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +99 -98
  23. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +110 -143
  24. package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +72 -69
  25. package/dist/components/ui/ag-grid-react/headers/components/header-info.js +36 -35
  26. package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +14 -12
  27. package/dist/components/ui/ag-grid-react/headers/custom-header.js +111 -110
  28. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +204 -203
  29. package/dist/components/ui/alert.js +62 -58
  30. package/dist/components/ui/breadcrumb.js +81 -74
  31. package/dist/components/ui/calendar.js +354 -354
  32. package/dist/components/ui/chart/chart.js +63 -62
  33. package/dist/components/ui/chips.js +42 -38
  34. package/dist/components/ui/command-palette/command-palette-context.d.ts +52 -0
  35. package/dist/components/ui/command-palette/command-palette-context.js +110 -0
  36. package/dist/components/ui/command-palette/command-palette.d.ts +67 -0
  37. package/dist/components/ui/command-palette/command-palette.js +402 -0
  38. package/dist/components/ui/command-palette/index.d.ts +23 -0
  39. package/dist/components/ui/command-palette/index.js +44 -0
  40. package/dist/components/ui/command-palette/kbd.d.ts +28 -0
  41. package/dist/components/ui/command-palette/kbd.js +52 -0
  42. package/dist/components/ui/command-palette/shortcut-registry.d.ts +68 -0
  43. package/dist/components/ui/command-palette/shortcut-registry.js +183 -0
  44. package/dist/components/ui/command-palette/shortcut-scope-provider.d.ts +55 -0
  45. package/dist/components/ui/command-palette/shortcut-scope-provider.js +55 -0
  46. package/dist/components/ui/command-palette/shortcut-settings.d.ts +27 -0
  47. package/dist/components/ui/command-palette/shortcut-settings.js +266 -0
  48. package/dist/components/ui/command-palette/use-browser-shortcuts.d.ts +32 -0
  49. package/dist/components/ui/command-palette/use-browser-shortcuts.js +48 -0
  50. package/dist/components/ui/command-palette/use-global-shortcut.d.ts +3 -0
  51. package/dist/components/ui/command-palette/use-global-shortcut.js +7 -0
  52. package/dist/components/ui/command-palette/use-shortcut.d.ts +47 -0
  53. package/dist/components/ui/command-palette/use-shortcut.js +49 -0
  54. package/dist/components/ui/command-palette/utils.d.ts +119 -0
  55. package/dist/components/ui/command-palette/utils.js +248 -0
  56. package/dist/components/ui/data-table/data-table-column-list.js +87 -86
  57. package/dist/components/ui/data-table/data-table-format-options.js +45 -44
  58. package/dist/components/ui/data-table/data-table-view-options.js +39 -38
  59. package/dist/components/ui/date-picker/date-picker.js +89 -87
  60. package/dist/components/ui/date-picker/date-range-picker.js +140 -138
  61. package/dist/components/ui/date-picker/month-picker.js +82 -81
  62. package/dist/components/ui/date-picker/month-range-picker.js +108 -105
  63. package/dist/components/ui/date-picker/multi-date-picker.js +68 -66
  64. package/dist/components/ui/date-picker/multi-month-picker.js +59 -58
  65. package/dist/components/ui/date-picker/multi-week-picker.js +80 -78
  66. package/dist/components/ui/date-picker/week-picker.js +117 -115
  67. package/dist/components/ui/date-picker/week-range-picker.js +166 -164
  68. package/dist/components/ui/dialog.js +78 -73
  69. package/dist/components/ui/drawer.js +71 -66
  70. package/dist/components/ui/file-upload.js +131 -127
  71. package/dist/components/ui/filter-panel/filter-panel.js +98 -94
  72. package/dist/components/ui/filter-strip/filter-strip.js +95 -91
  73. package/dist/components/ui/filter-strip/filter-summary.js +91 -90
  74. package/dist/components/ui/header.js +57 -53
  75. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +78 -76
  76. package/dist/components/ui/loader.js +17 -16
  77. package/dist/components/ui/nested-list/components/NestedListHeader.d.ts +1 -0
  78. package/dist/components/ui/nested-list/components/NestedListHeader.js +51 -48
  79. package/dist/components/ui/nested-list/components/SortableItem.js +60 -59
  80. package/dist/components/ui/nested-list/nested-list.js +184 -182
  81. package/dist/components/ui/notification-panel/notification-panel.js +60 -53
  82. package/dist/components/ui/popover.js +45 -40
  83. package/dist/components/ui/prompt.js +90 -86
  84. package/dist/components/ui/select/select.js +206 -209
  85. package/dist/components/ui/sheet.d.ts +1 -0
  86. package/dist/components/ui/sheet.js +50 -48
  87. package/dist/components/ui/sidebar.js +273 -267
  88. package/dist/components/ui/stepper.js +75 -63
  89. package/dist/components/ui/tag.js +48 -44
  90. package/dist/components/ui/toast.js +46 -41
  91. package/dist/i18n/ImpactNovaI18nContext.d.ts +21 -0
  92. package/dist/i18n/ImpactNovaI18nContext.js +76 -0
  93. package/dist/i18n/defaultMessages.d.ts +231 -0
  94. package/dist/i18n/defaultMessages.js +206 -0
  95. package/dist/i18n/getDateFnsLocale.d.ts +11 -0
  96. package/dist/i18n/getDateFnsLocale.js +21 -0
  97. package/dist/i18n/index.d.ts +5 -0
  98. package/dist/i18n/locales/de.d.ts +2 -0
  99. package/dist/i18n/locales/de.js +206 -0
  100. package/dist/i18n/locales/es.d.ts +2 -0
  101. package/dist/i18n/locales/es.js +206 -0
  102. package/dist/i18n/locales/hi.d.ts +2 -0
  103. package/dist/i18n/locales/hi.js +206 -0
  104. package/dist/i18n/locales/index.d.ts +4 -0
  105. package/dist/i18n/locales/kn.d.ts +2 -0
  106. package/dist/i18n/locales/kn.js +206 -0
  107. package/dist/icons/assets/boxAdd.svg.js +5 -0
  108. package/dist/icons/assets/boxed.svg.js +5 -0
  109. package/dist/icons/assets/trolley.svg.js +5 -0
  110. package/dist/icons/assets/unlocked.svg.js +5 -0
  111. package/dist/icons/index.d.ts +4 -0
  112. package/dist/icons/index.js +179 -171
  113. package/dist/impact-nova.css +1 -1
  114. package/dist/index.d.ts +4 -0
  115. package/dist/index.js +232 -172
  116. package/package.json +36 -4
  117. package/dist/components/ui/ag-grid-react/cell-renderers/types.js +0 -74
@@ -1,17 +1,17 @@
1
- import { jsx as c, jsxs as j } from "react/jsx-runtime";
2
- import { useMemo as S, useCallback as O } from "react";
3
- import { Badge as T } from "../../badge.js";
4
- import { evaluateValidationRules as V, getFieldValue as m, mapBadgeVariant as I, mapBadgeColor as L } from "./types.js";
5
- import { getIconComponent as U } from "../../../../icons/index.js";
6
- import { Tooltip as H, TooltipTrigger as _, TooltipContent as z } from "../../tooltip.js";
7
- const M = (e, t, r, a) => {
1
+ import { jsx as c, jsxs as w } from "react/jsx-runtime";
2
+ import { useMemo as S, useCallback as T } from "react";
3
+ import { Badge as V } from "../../badge.js";
4
+ import { evaluateValidationRules as I, getFieldValue as m, mapBadgeVariant as L, mapBadgeColor as U } from "./cell-renderer-utils.js";
5
+ import { getIconComponent as H } from "../../../../icons/index.js";
6
+ import { Tooltip as _, TooltipTrigger as z, TooltipContent as M } from "../../tooltip.js";
7
+ const Q = (e, t, r, a) => {
8
8
  if (!t) return e;
9
9
  let l = e;
10
10
  return l = l.replace(/\$\{value\}/g, String(a ?? "")), l = l.replace(/\$\{field\}/g, String(r ?? "")), Object.keys(t).forEach((i) => {
11
11
  const o = new RegExp(`\\$\\{${i}\\}`, "g");
12
12
  l = l.replace(o, String(t[i] ?? ""));
13
13
  }), l;
14
- }, Q = ({
14
+ }, W = ({
15
15
  iconConfig: e,
16
16
  rowData: t,
17
17
  rowId: r,
@@ -19,8 +19,8 @@ const M = (e, t, r, a) => {
19
19
  }) => {
20
20
  let l = null;
21
21
  const i = m(e.iconField, e.icon, t);
22
- if (typeof i == "string" ? l = U(i, { size: 16 }) : l = i, !l) return null;
23
- const o = m(e.backgroundColorField, e.backgroundColor, t), s = m(e.colorField, e.color, t) ?? "#60697D", h = m(e.tooltipField, e.tooltip, t), f = /* @__PURE__ */ c(
22
+ if (typeof i == "string" ? l = H(i, { size: 16 }) : l = i, !l) return null;
23
+ const o = m(e.backgroundColorField, e.backgroundColor, t), s = m(e.colorField, e.color, t) ?? "#60697D", f = m(e.tooltipField, e.tooltip, t), h = /* @__PURE__ */ c(
24
24
  "div",
25
25
  {
26
26
  className: `flex items-center justify-center ${e.onClick ? "cursor-pointer" : ""} ${e.showOnHover ? "opacity-0 group-hover:opacity-100 transition-opacity" : ""}`,
@@ -37,11 +37,11 @@ const M = (e, t, r, a) => {
37
37
  children: l
38
38
  }
39
39
  );
40
- return h ? /* @__PURE__ */ j(H, { children: [
41
- /* @__PURE__ */ c(_, { asChild: !0, children: f }),
42
- /* @__PURE__ */ c(z, { variant: "tertiary", side: e.tooltipSide || "top", children: h })
43
- ] }) : f;
44
- }, W = ({
40
+ return f ? /* @__PURE__ */ w(_, { children: [
41
+ /* @__PURE__ */ c(z, { asChild: !0, children: h }),
42
+ /* @__PURE__ */ c(M, { variant: "tertiary", side: e.tooltipSide || "top", children: f })
43
+ ] }) : h;
44
+ }, q = ({
45
45
  badgeConfig: e,
46
46
  rowData: t,
47
47
  rowId: r,
@@ -51,16 +51,16 @@ const M = (e, t, r, a) => {
51
51
  if (!l) return null;
52
52
  const i = m(e.colorField, e.color, t), o = m(e.variantField, e.variant, t);
53
53
  return /* @__PURE__ */ c(
54
- T,
54
+ V,
55
55
  {
56
56
  className: "font-medium",
57
- color: L(i),
58
- variant: I(o),
57
+ color: U(i),
58
+ variant: L(o),
59
59
  onClick: e.onClick ? () => e.onClick?.({ rowId: r, field: a, rowData: t ?? {} }) : void 0,
60
60
  children: l
61
61
  }
62
62
  );
63
- }, q = (e) => {
63
+ }, A = (e) => {
64
64
  const {
65
65
  value: t,
66
66
  data: r,
@@ -69,39 +69,40 @@ const M = (e, t, r, a) => {
69
69
  onClick: i,
70
70
  redirectUrl: o,
71
71
  updateQueryParams: s,
72
- navigate: h,
73
- setSearchParams: f,
72
+ navigate: f,
73
+ setSearchParams: h,
74
74
  rightSideContent: v,
75
75
  valueFormatter: k,
76
76
  disableOnPinnedRows: b = !0,
77
- validationRules: $
78
- } = e, y = a.id ?? String(r?.id ?? ""), d = l?.field ?? "", R = r && typeof r == "object" && "_isPinned" in r && r._isPinned === !0, E = S(() => b && R || V($, r) ? !1 : !!(s || o || i), [b, R, s, o, i, $, r]), w = O(
77
+ disableLinkStyle: $,
78
+ validationRules: R
79
+ } = e, y = a.id ?? String(r?.id ?? ""), d = l?.field ?? "", E = r && typeof r == "object" && "_isPinned" in r && r._isPinned === !0, F = S(() => $ || b && E || I(R, r) ? !1 : !!(s || o || i), [$, b, E, s, o, i, R, r]), C = T(
79
80
  (u) => {
80
- if (u.stopPropagation(), s && f)
81
- f((n) => {
81
+ if (u.stopPropagation(), s && h)
82
+ h((n) => {
82
83
  const g = new URLSearchParams(n);
83
- return Object.entries(s).forEach(([x, N]) => {
84
- let p = String(N);
85
- p = p.replace(/\$\{value\}/g, String(t ?? "")), p = p.replace(/\$\{field\}/g, d), r && Object.keys(r).forEach((P) => {
86
- const B = new RegExp(`\\$\\{${P}\\}`, "g");
87
- p = p.replace(B, String(r[P] ?? ""));
84
+ return Object.entries(s).forEach(([x, B]) => {
85
+ let p = String(B);
86
+ p = p.replace(/\$\{value\}/g, String(t ?? "")), p = p.replace(/\$\{field\}/g, d), r && Object.keys(r).forEach((j) => {
87
+ const O = new RegExp(`\\$\\{${j}\\}`, "g");
88
+ p = p.replace(O, String(r[j] ?? ""));
88
89
  }), g.set(x, p);
89
90
  }), g;
90
91
  });
91
- else if (o && h) {
92
- const n = M(o, r, d, t);
93
- h(n);
92
+ else if (o && f) {
93
+ const n = Q(o, r, d, t);
94
+ f(n);
94
95
  } else i && i({ rowId: y, field: d, rowData: r ?? {}, value: t });
95
96
  },
96
- [s, f, o, h, i, r, d, t, y]
97
- ), C = S(() => k ? k(t, r ?? {}) : String(t ?? ""), [t, k, r]), F = S(() => {
97
+ [s, h, o, f, i, r, d, t, y]
98
+ ), N = S(() => k ? k(t, r ?? {}) : String(t ?? ""), [t, k, r]), P = S(() => {
98
99
  if (!v?.items || v.items.length === 0) return null;
99
100
  const u = [];
100
101
  return v.items.forEach((n, g) => {
101
102
  if (n.type === "icon" && n.icon)
102
103
  u.push(
103
104
  /* @__PURE__ */ c(
104
- Q,
105
+ W,
105
106
  {
106
107
  iconConfig: n.icon,
107
108
  rowData: r,
@@ -114,7 +115,7 @@ const M = (e, t, r, a) => {
114
115
  else if (n.type === "badge" && n.badge)
115
116
  u.push(
116
117
  /* @__PURE__ */ c(
117
- W,
118
+ q,
118
119
  {
119
120
  badgeConfig: n.badge,
120
121
  rowData: r,
@@ -130,19 +131,19 @@ const M = (e, t, r, a) => {
130
131
  }
131
132
  }), u.length > 0 ? u : null;
132
133
  }, [v, r, y, d]);
133
- return /* @__PURE__ */ j("div", { className: "w-full h-full flex items-center justify-between gap-2 group ag-cell-inner-padding", children: [
134
+ return /* @__PURE__ */ w("div", { className: "w-full h-full flex items-center justify-between gap-2 group ag-cell-inner-padding", children: [
134
135
  /* @__PURE__ */ c(
135
136
  "div",
136
137
  {
137
- className: `flex-1 truncate ${E ? "text-blue-600 cursor-pointer hover:underline min-w-0 font-medium" : ""}`,
138
- onClick: E ? w : void 0,
139
- children: C
138
+ className: `flex-1 truncate min-w-0 ${F ? "text-blue-600 cursor-pointer hover:underline font-medium" : ""}`,
139
+ onClick: F ? C : void 0,
140
+ children: N
140
141
  }
141
142
  ),
142
- F && /* @__PURE__ */ c("div", { className: "flex items-center gap-1 flex-shrink-0", children: F })
143
+ P && /* @__PURE__ */ c("div", { className: "flex items-center gap-1 flex-shrink-0", children: P })
143
144
  ] });
144
145
  };
145
- q.displayName = "LinkCellRenderer";
146
+ A.displayName = "LinkCellRenderer";
146
147
  export {
147
- q as LinkCellRenderer
148
+ A as LinkCellRenderer
148
149
  };
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { ICellRendererParams, ColDef, GridApi, Column } from 'ag-grid-enterprise';
3
- import { SplitConfig, SubCellComponentProps } from './types';
3
+ import { SplitConfig, SubCellComponentProps, ValueFormatter, SplitCellValue } from './types';
4
4
  export interface CommonParams {
5
5
  cellRenderer?: string | React.ComponentType<SubCellComponentProps>;
6
6
  cellEditor?: string | React.ComponentType<SubCellComponentProps>;
@@ -21,12 +21,10 @@ export interface SplitCellRendererProps extends ICellRendererParams {
21
21
  context: {
22
22
  frameworkComponents?: Record<string, React.ComponentType<SubCellComponentProps>>;
23
23
  };
24
+ /** Column-level value formatter (lowest priority: cell > row > split > column) */
25
+ valueFormatter?: ValueFormatter;
24
26
  }
25
- export interface SplitCellRendererValue {
26
- [key: string]: {
27
- value: unknown;
28
- };
29
- }
27
+ export type SplitCellRendererValue = SplitCellValue;
30
28
  export declare const SplitCellRenderer: {
31
29
  (props: SplitCellRendererProps): import("react/jsx-runtime").JSX.Element;
32
30
  displayName: string;
@@ -1,50 +1,36 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import "react";
3
- const w = (m) => {
4
- const { splits: n, commonParams: i, data: s, node: p, api: c, column: u, context: a, value: f } = m;
5
- if (!n || !Array.isArray(n)) return null;
6
- const g = (r, e) => {
7
- if (!e) return "--";
8
- let t = e;
9
- switch (r?.decimals != null && !isNaN(Number(e)) && (t = Number(e).toFixed(r.decimals)), r.type) {
10
- case "currencySymbol": {
11
- const l = r.symbol ?? "$";
12
- return r.position === "suffix" ? `${t} ${l}` : `${l} ${t}`;
13
- }
14
- case "percentage":
15
- return `${t} %`;
16
- case "number":
17
- return t;
18
- default:
19
- return t;
20
- }
21
- }, h = (r) => {
22
- const e = r;
3
+ import { resolveCellEditable as V, resolveValueFormatter as x, applyValueFormatter as N } from "./cell-renderer-utils.js";
4
+ const E = (v) => {
5
+ const { splits: l, commonParams: n, data: i, node: g, api: c, column: b, context: d, value: h, colDef: s, valueFormatter: y } = v;
6
+ if (!l || !Array.isArray(l)) return null;
7
+ const w = (t) => {
8
+ const e = t;
23
9
  if (typeof e == "string") {
24
- const t = c?.getGridOption("components");
25
- return a?.frameworkComponents?.[e] || t?.[e];
10
+ const a = c?.getGridOption("components");
11
+ return d?.frameworkComponents?.[e] || a?.[e];
26
12
  }
27
13
  return e;
28
14
  };
29
- return /* @__PURE__ */ o("div", { style: { display: "grid", gridTemplateRows: `repeat(${n?.length}, 1fr)`, height: "100%", width: "100%" }, children: n?.map((r, e) => {
30
- const t = f?.[r?.field?.split(".")?.pop()]?.value?.toString(), l = s?.valueFormatter ?? r?.valueFormatter ?? null, y = l ? g(l, t?.toString()) : t, d = i?.cellRenderer && typeof i?.cellRenderer == "string" ? h(i?.cellRenderer) : void 0;
15
+ return /* @__PURE__ */ o("div", { style: { display: "grid", gridTemplateRows: `repeat(${l?.length}, 1fr)`, height: "100%", width: "100%" }, children: l?.map((t, e) => {
16
+ const a = t?.field?.split(".")?.pop(), r = h?.[a], m = r?.value?.toString(), p = i, C = typeof s?.editable == "boolean" ? s.editable : void 0, F = V(C, t.editable, p, r), u = x(r, p, t?.valueFormatter, y ?? null), R = u ? N(u, m) : m, f = n?.cellRenderer && typeof n?.cellRenderer == "string" ? w(n?.cellRenderer) : void 0;
31
17
  return /* @__PURE__ */ o(
32
18
  "div",
33
19
  {
34
20
  className: "flex items-center overflow-hidden",
35
21
  "data-split-index": e,
36
- children: d ? /* @__PURE__ */ o(
37
- d,
22
+ children: f ? /* @__PURE__ */ o(
23
+ f,
38
24
  {
39
- node: p,
25
+ node: g,
40
26
  api: c,
41
- column: u,
42
- context: a,
43
- data: s,
44
- value: t,
45
- colDef: r,
46
- valueFormatted: y,
47
- className: e !== n.length - 1 ? "border-b border-gray-200" : ""
27
+ column: b,
28
+ context: d,
29
+ data: i,
30
+ value: r,
31
+ colDef: { ...t, editable: F },
32
+ valueFormatted: R,
33
+ className: e !== l.length - 1 ? "border-b border-gray-200" : ""
48
34
  }
49
35
  ) : /* @__PURE__ */ o(
50
36
  "div",
@@ -54,11 +40,11 @@ const w = (m) => {
54
40
  }
55
41
  )
56
42
  },
57
- `${r.field}-${e}`
43
+ `${t.field}-${e}`
58
44
  );
59
45
  }) });
60
46
  };
61
- w.displayName = "SplitCellRenderer";
47
+ E.displayName = "SplitCellRenderer";
62
48
  export {
63
- w as SplitCellRenderer
49
+ E as SplitCellRenderer
64
50
  };
@@ -5,19 +5,6 @@ import { IRowNode, ColDef, GridApi, Column } from 'ag-grid-community';
5
5
  */
6
6
  export type BadgeVariant = 'solid' | 'outline' | 'subtle';
7
7
  export type BadgeColor = 'primary' | 'success' | 'warning' | 'destructive' | 'neutral';
8
- /**
9
- * Maps legacy variant names (from backend/config) to impact-nova Badge variants.
10
- */
11
- export declare const mapBadgeVariant: (v: string | undefined) => BadgeVariant;
12
- /**
13
- * Maps legacy color names (from backend/config) to impact-nova Badge colors.
14
- */
15
- export declare const mapBadgeColor: (c: string | undefined) => BadgeColor;
16
- /**
17
- * Resolves a value from either a static prop or a field in row data.
18
- * Used by renderers that support both static and dynamic (field-driven) configuration.
19
- */
20
- export declare const getFieldValue: <T>(fieldName: string | undefined, staticValue: T | undefined, rowData: Record<string, unknown> | null | undefined) => T | undefined;
21
8
  /**
22
9
  * Validation condition for dynamic behavior
23
10
  */
@@ -35,10 +22,6 @@ export interface ValidationRules {
35
22
  conditions: ValidationCondition[];
36
23
  };
37
24
  }
38
- /**
39
- * Evaluates validation rules against row data
40
- */
41
- export declare const evaluateValidationRules: (rules: ValidationRules | undefined, rowData: Record<string, unknown> | null | undefined) => boolean;
42
25
  export interface SelectOption {
43
26
  label: string;
44
27
  value: string;
@@ -121,5 +104,38 @@ export interface SplitConfig {
121
104
  field: string;
122
105
  headerName?: string;
123
106
  editable?: boolean;
107
+ cellDataType?: string;
108
+ valueFormatter?: ValueFormatter;
109
+ }
110
+ /**
111
+ * Metadata attached to an individual cell value.
112
+ * e.g. `{ _isDisabled: true }`
113
+ */
114
+ export interface CellMetadata {
115
+ _isDisabled?: boolean;
124
116
  valueFormatter?: ValueFormatter;
125
117
  }
118
+ /**
119
+ * Metadata attached to a row.
120
+ * e.g. `{ _isDisabled: false, start_date: "2025-01-06", end_date: "2025-01-26", kpi: "markdown_value" }`
121
+ */
122
+ export interface RowMetadata {
123
+ _isDisabled?: boolean;
124
+ valueFormatter?: ValueFormatter;
125
+ [key: string]: unknown;
126
+ }
127
+ /**
128
+ * Shape of an individual version value within a split cell.
129
+ * e.g. `{ value: 1500, cellMetadata: { _isDisabled: true } }`
130
+ */
131
+ export interface SplitCellValueEntry {
132
+ value: unknown;
133
+ cellMetadata?: CellMetadata;
134
+ }
135
+ /**
136
+ * Shape of the entire split cell value object.
137
+ * Keys are version identifiers (e.g. "wp", "iaf").
138
+ */
139
+ export interface SplitCellValue {
140
+ [versionKey: string]: SplitCellValueEntry;
141
+ }
@@ -0,0 +1,27 @@
1
+ import { ColDef, ColGroupDef } from 'ag-grid-community';
2
+ /**
3
+ * Recursively overrides `editable` on leaf columns to be a function
4
+ * that enforces the **4-level editable priority**: column < split < row < cell.
5
+ *
6
+ * This function acts as the AG Grid "gatekeeper" — it determines whether
7
+ * the cell editor should open at all. The `SplitCellEditor` then handles
8
+ * per-sub-cell editability internally using `resolveCellEditable`.
9
+ *
10
+ * ### 4-Level priority (highest wins):
11
+ * 1. **Column** (`colDef.editable`) — baseline for the whole column.
12
+ * 2. **Split** (`split.editable`) — per sub-cell in split columns.
13
+ * 3. **Row** (`rowData.rowMetadata._isDisabled`) — disables all cells in the row.
14
+ * 4. **Cell** (`cellValue.cellMetadata._isDisabled`) — per-cell override (highest priority).
15
+ *
16
+ * ### Usage
17
+ * ```ts
18
+ * import { addRowDataEditableCheck } from 'impact-nova';
19
+ *
20
+ * const processedColDefs = addRowDataEditableCheck(rawColDefs);
21
+ * // Pass processedColDefs to <AgGridWrapper columnDefs={processedColDefs} />
22
+ * ```
23
+ *
24
+ * @param colDefs - Array of AG Grid column definitions (may contain groups).
25
+ * @returns A new array with `editable` overridden as runtime functions.
26
+ */
27
+ export declare function addRowDataEditableCheck(colDefs: (ColDef | ColGroupDef)[]): (ColDef | ColGroupDef)[];
@@ -0,0 +1,62 @@
1
+ import { resolveCellEditable as d } from "./cell-renderers/cell-renderer-utils.js";
2
+ const y = (o, l) => {
3
+ if (l in o) return o[l];
4
+ if (l.includes(".")) {
5
+ const e = l.split(".");
6
+ let t = o;
7
+ for (const n of e)
8
+ if (t != null && typeof t == "object")
9
+ t = t[n];
10
+ else
11
+ return;
12
+ return t;
13
+ }
14
+ }, h = (o) => {
15
+ const l = o.colDef.field;
16
+ if (!l) return !1;
17
+ let e = o.data, t = l;
18
+ if (!(l in e) && l.includes(".")) {
19
+ const r = l.split(".");
20
+ t = r[r.length - 1];
21
+ for (let i = 0; i < r.length - 1; i++) {
22
+ const s = e[r[i]];
23
+ if (s != null && typeof s == "object")
24
+ e = s;
25
+ else
26
+ return !1;
27
+ }
28
+ }
29
+ const n = e[t], u = o.newValue;
30
+ return n && typeof n == "object" && "cellMetadata" in n ? e[t] = u && typeof u == "object" && "value" in u ? u : { ...n, value: u } : e[t] = u, !0;
31
+ };
32
+ function j(o) {
33
+ return o.map((l) => {
34
+ const e = { ...l };
35
+ if (e.children?.length)
36
+ return e.children = j(e.children), e;
37
+ const t = e.field;
38
+ if (!t) return e;
39
+ const n = e.cellEditorParams?.splits, u = n?.some((i) => i.editable === !0) ?? !1, r = typeof e.editable == "boolean" ? e.editable : void 0;
40
+ return e._originalEditable = r, n || (e.valueSetter = h), e.editable = (i) => {
41
+ if (i.node?.group === !0 || i.data?.group === !0)
42
+ return !1;
43
+ const s = i.data;
44
+ if (!s) return u || !!r;
45
+ const c = y(s, t);
46
+ if (n) {
47
+ const p = c != null && typeof c == "object" ? c : null;
48
+ return n.some((a) => {
49
+ const f = a.field?.split(".")?.pop();
50
+ if (!f) return !1;
51
+ const v = p?.[f];
52
+ return d(r, a.editable, s, v);
53
+ });
54
+ }
55
+ const b = c != null && typeof c == "object" && "value" in c ? c : void 0;
56
+ return d(r, void 0, s, b);
57
+ }, e;
58
+ });
59
+ }
60
+ export {
61
+ j as addRowDataEditableCheck
62
+ };