impact-nova 1.2.4 → 1.5.0

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 (123) 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.js +1 -1
  16. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.d.ts +4 -6
  17. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +23 -37
  18. package/dist/components/ui/ag-grid-react/cell-renderers/types.d.ts +33 -17
  19. package/dist/components/ui/ag-grid-react/editable-utils.d.ts +27 -0
  20. package/dist/components/ui/ag-grid-react/editable-utils.js +62 -0
  21. package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +99 -98
  22. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +110 -143
  23. package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +72 -69
  24. package/dist/components/ui/ag-grid-react/headers/components/header-info.js +36 -35
  25. package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +14 -12
  26. package/dist/components/ui/ag-grid-react/headers/custom-header.js +111 -110
  27. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +204 -203
  28. package/dist/components/ui/alert.d.ts +1 -1
  29. package/dist/components/ui/alert.js +76 -60
  30. package/dist/components/ui/breadcrumb.js +81 -74
  31. package/dist/components/ui/calendar.js +355 -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 -85
  84. package/dist/components/ui/select/select.js +225 -229
  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/tabs.d.ts +11 -1
  90. package/dist/components/ui/tabs.js +79 -54
  91. package/dist/components/ui/tag.js +48 -44
  92. package/dist/components/ui/toast.js +46 -41
  93. package/dist/i18n/ImpactNovaI18nContext.d.ts +21 -0
  94. package/dist/i18n/ImpactNovaI18nContext.js +76 -0
  95. package/dist/i18n/defaultMessages.d.ts +231 -0
  96. package/dist/i18n/defaultMessages.js +206 -0
  97. package/dist/i18n/getDateFnsLocale.d.ts +11 -0
  98. package/dist/i18n/getDateFnsLocale.js +21 -0
  99. package/dist/i18n/index.d.ts +5 -0
  100. package/dist/i18n/locales/de.d.ts +2 -0
  101. package/dist/i18n/locales/de.js +206 -0
  102. package/dist/i18n/locales/es.d.ts +2 -0
  103. package/dist/i18n/locales/es.js +206 -0
  104. package/dist/i18n/locales/hi.d.ts +2 -0
  105. package/dist/i18n/locales/hi.js +206 -0
  106. package/dist/i18n/locales/index.d.ts +4 -0
  107. package/dist/i18n/locales/kn.d.ts +2 -0
  108. package/dist/i18n/locales/kn.js +206 -0
  109. package/dist/icons/assets/boxAdd.svg.js +5 -0
  110. package/dist/icons/assets/boxed.svg.js +5 -0
  111. package/dist/icons/assets/trolley.svg.js +5 -0
  112. package/dist/icons/assets/unlocked.svg.js +5 -0
  113. package/dist/icons/assets/webp/delete-3d.webp.js +4 -0
  114. package/dist/icons/assets/webp/info-3d.webp.js +4 -0
  115. package/dist/icons/assets/webp/success-3d.webp.js +4 -0
  116. package/dist/icons/assets/webp/warning-3d.webp.js +4 -0
  117. package/dist/icons/index.d.ts +8 -0
  118. package/dist/icons/index.js +197 -181
  119. package/dist/impact-nova.css +1 -1
  120. package/dist/index.d.ts +4 -0
  121. package/dist/index.js +260 -199
  122. package/package.json +36 -4
  123. package/dist/components/ui/ag-grid-react/cell-renderers/types.js +0 -74
@@ -1,27 +1,34 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import A, { forwardRef as E, useRef as V, useImperativeHandle as D, useEffect as I, useCallback as i } from "react";
3
- const m = E((u, p) => {
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import E, { forwardRef as D, useRef as j, useImperativeHandle as I, useEffect as k, useCallback as s } from "react";
3
+ const h = D((i, g) => {
4
4
  const {
5
- value: o,
6
- placeholder: h,
7
- min: g,
8
- max: b,
9
- step: w,
10
- maxLength: a,
11
- onValueChange: c,
5
+ value: r,
6
+ placeholder: b,
7
+ min: v,
8
+ max: w,
9
+ step: y,
10
+ maxLength: o,
11
+ onValueChange: f,
12
12
  colDef: x,
13
13
  className: N
14
- } = u, f = x?.cellDataType === "number" ? "number" : "text", l = f === "number", t = V(null);
15
- D(p, () => ({
14
+ } = i, d = x?.cellDataType === "number" ? "number" : "text", u = d === "number", t = j(null), p = r && typeof r == "object" && "value" in r, m = p ? r.cellMetadata : void 0;
15
+ I(g, () => ({
16
16
  getValue() {
17
17
  const e = t.current?.value;
18
- if (l) {
18
+ let n;
19
+ if (u)
19
20
  if (!e || e === "" || e === "-")
20
- return null;
21
- const d = Number(e);
22
- return isNaN(d) ? null : d;
23
- }
24
- return e === "" ? null : e;
21
+ n = null;
22
+ else {
23
+ const a = Number(e);
24
+ n = isNaN(a) ? null : a;
25
+ }
26
+ else
27
+ n = e === "" ? null : e;
28
+ return p ? {
29
+ value: n,
30
+ ...m !== void 0 && { cellMetadata: m }
31
+ } : n;
25
32
  },
26
33
  isCancelBeforeStart() {
27
34
  return !1;
@@ -29,64 +36,65 @@ const m = E((u, p) => {
29
36
  isCancelAfterEnd() {
30
37
  return !1;
31
38
  }
32
- }), []), I(() => {
33
- if (t.current && !u.suppressAutoFocus) {
34
- if (t.current.value = o != null ? String(o) : "", l) {
35
- const n = t.current, e = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value");
36
- Object.defineProperty(n, "value", {
39
+ }), []), k(() => {
40
+ if (t.current) {
41
+ const l = r && typeof r == "object" && "value" in r ? r.value : r;
42
+ if (t.current.value = l != null ? String(l) : "", u) {
43
+ const e = t.current, n = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value");
44
+ Object.defineProperty(e, "value", {
37
45
  get() {
38
- const r = this.valueAsNumber;
39
- return isNaN(r) ? e.get.call(this) : r;
46
+ const a = this.valueAsNumber;
47
+ return isNaN(a) ? n.get.call(this) : a;
40
48
  },
41
- set(r) {
42
- e.set.call(this, r);
49
+ set(a) {
50
+ n.set.call(this, a);
43
51
  },
44
52
  configurable: !0
45
53
  });
46
54
  }
47
- t.current.focus(), t.current.select();
55
+ i.suppressAutoFocus || (t.current.focus(), t.current.select());
48
56
  }
49
57
  return () => {
50
58
  };
51
59
  }, []);
52
- const y = i((n) => {
60
+ const C = s((l) => {
53
61
  const e = t.current?.value;
54
- if (!(a && e && e.length > a)) {
55
- if (l && t.current) {
56
- const r = t.current.valueAsNumber;
57
- isNaN(r) || t.current.setAttribute("data-value", String(r));
62
+ if (!(o && e && e.length > o)) {
63
+ if (u && t.current) {
64
+ const n = t.current.valueAsNumber;
65
+ isNaN(n) || t.current.setAttribute("data-value", String(n));
58
66
  }
59
- c?.(e);
67
+ f?.(e);
60
68
  }
61
- }, [a, c, l]), v = i((n) => {
62
- n.key === "Enter" || n.key === "Escape" || n.key === "Tab" || ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n.key) && n.stopPropagation();
63
- }, []), C = i(() => {
64
- u.stopEditing?.();
65
- }, [u, l]);
66
- return /* @__PURE__ */ s("div", { className: `w-full h-full flex items-center ag-cell-inner-padding in-ag-editable-cell-highlight ${N}`, children: /* @__PURE__ */ s(
69
+ }, [o, f, u]), V = s((l) => {
70
+ l.key === "Enter" || l.key === "Escape" || l.key === "Tab" || ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(l.key) && l.stopPropagation();
71
+ }, []), A = s(() => {
72
+ i.stopEditing?.();
73
+ }, [i, u]);
74
+ return /* @__PURE__ */ c("div", { className: `w-full h-full flex items-center ag-cell-inner-padding in-ag-editable-cell-highlight ${N}`, children: /* @__PURE__ */ c(
67
75
  "div",
68
76
  {
69
- className: `flex w-full items-center rounded-[8px] bg-white px-1.5 h-7 ${l ? "justify-end text-right" : ""}`,
70
- children: /* @__PURE__ */ s(
77
+ className: `flex w-full items-center rounded-[8px] bg-white px-1.5 h-7 ${u ? "justify-end text-right" : ""}`,
78
+ children: /* @__PURE__ */ c(
71
79
  "input",
72
80
  {
73
81
  ref: t,
74
- type: f,
75
- onChange: y,
76
- onKeyDown: v,
77
- onBlur: C,
78
- placeholder: h,
79
- className: `flex h-full w-full bg-transparent p-0 text-sm font-medium text-[#1f2b4d] outline-none placeholder:font-medium placeholder:text-[#dfe2e7] ${l ? "text-right" : ""}`,
80
- min: g,
81
- max: b,
82
- step: w
82
+ type: d,
83
+ onChange: C,
84
+ onKeyDown: V,
85
+ onBlur: A,
86
+ placeholder: b,
87
+ className: `flex h-full w-full bg-transparent p-0 text-sm font-medium text-[#1f2b4d] outline-none placeholder:font-medium placeholder:text-[#dfe2e7] ${u ? "text-right" : ""}`,
88
+ min: v,
89
+ max: w,
90
+ step: y
83
91
  }
84
92
  )
85
93
  }
86
94
  ) });
87
95
  });
88
- m.displayName = "InputCellEditor";
89
- const j = A.memo(m, () => !0);
96
+ h.displayName = "InputCellEditor";
97
+ const O = E.memo(h, () => !0);
90
98
  export {
91
- j as InputCellEditor
99
+ O as InputCellEditor
92
100
  };
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { ICellEditorParams, ColDef, GridApi } 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>;
@@ -10,11 +10,7 @@ export interface CommonParams {
10
10
  export interface metaData {
11
11
  [key: string]: "string";
12
12
  }
13
- export interface SplitCellRendererValue {
14
- [key: string]: {
15
- value: unknown;
16
- };
17
- }
13
+ export type SplitCellRendererValue = SplitCellValue;
18
14
  export interface CellUpdatePayload {
19
15
  api: GridApi;
20
16
  colDef: ColDef;
@@ -45,5 +41,7 @@ export interface SplitCellEditorProps extends Omit<ICellEditorParams, 'context'>
45
41
  frameworkComponents?: Record<string, React.ComponentType<SubCellComponentProps>>;
46
42
  onCellUpdate?: (payload: CellUpdatePayload) => void;
47
43
  };
44
+ /** Column-level value formatter (lowest priority: cell > row > split > column) */
45
+ valueFormatter?: ValueFormatter;
48
46
  }
49
47
  export declare const SplitCellEditor: React.ForwardRefExoticComponent<SplitCellEditorProps & React.RefAttributes<unknown>>;
@@ -1,87 +1,73 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { forwardRef as U, useMemo as E, useState as I, useCallback as P } from "react";
3
- const R = U((V) => {
4
- const { splits: r, commonParams: f, data: s, node: o, api: p, column: m, context: i, value: a, colDef: d } = V, h = E(() => r?.map((e) => {
5
- const l = e?.field?.split(".")?.pop() ?? "", n = a?.[l]?.value;
6
- return { valueKey: l, field: e.field, newValue: n };
7
- }) ?? [], [r, a]), [u, b] = I(h), x = P((e) => {
8
- const l = u.find((t) => t.field === e);
9
- if (!l)
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { forwardRef as P, useMemo as R, useState as $, useCallback as j } from "react";
3
+ import { resolveValueFormatter as k, applyValueFormatter as A, resolveCellEditable as O } from "../cell-renderer-utils.js";
4
+ const G = P((x) => {
5
+ const { splits: i, commonParams: m, data: u, node: a, api: p, column: v, context: d, value: t, colDef: o, valueFormatter: F } = x, K = R(() => i?.map((l) => {
6
+ const e = l?.field?.split(".")?.pop() ?? "", n = t?.[e]?.value;
7
+ return { valueKey: e, field: l.field, newValue: n };
8
+ }) ?? [], [i, t]), [s, E] = $(K), U = j((l) => {
9
+ const e = s.find((c) => c.field === l);
10
+ if (!e)
10
11
  return;
11
12
  const n = {
12
13
  api: p,
13
- colDef: d,
14
- column: m,
15
- context: i,
16
- data: s,
17
- field: d.field,
18
- node: o,
19
- rowIndex: o?.rowIndex ?? null,
20
- rowPinned: o?.rowPinned ?? void 0,
14
+ colDef: o,
15
+ column: v,
16
+ context: d,
17
+ data: u,
18
+ field: o.field,
19
+ node: a,
20
+ rowIndex: a?.rowIndex ?? null,
21
+ rowPinned: a?.rowPinned ?? void 0,
21
22
  source: "edit",
22
23
  type: "cellValueChanged",
23
- currentCellUpdate: l,
24
- newValue: { [l.valueKey]: { value: l.newValue } },
25
- oldValue: { [l.valueKey]: { value: a?.[l.valueKey]?.value } },
26
- value: { [l.valueKey]: { value: l.newValue } }
27
- };
28
- o.setDataValue(d.field, { ...a, [l.valueKey]: { value: l.newValue } }), i?.onCellUpdate?.(n);
29
- }, [u, p, d, m, i, s, o, a]), N = (e) => {
30
- if (typeof e == "string") {
31
- const l = p?.getGridOption("components");
32
- return i?.frameworkComponents?.[e] || l?.[e];
33
- }
34
- return e;
35
- }, $ = (e, l) => {
36
- if (!l) return "--";
37
- let n = l;
38
- switch (e?.decimals != null && !isNaN(Number(l)) && (n = Number(l).toFixed(e.decimals)), e.type) {
39
- case "currencySymbol": {
40
- const t = e.symbol ?? "$";
41
- return e.position === "suffix" ? `${n} ${t}` : `${t} ${n}`;
42
- }
43
- case "percentage":
44
- return `${n} %`;
45
- case "number":
46
- return n;
47
- default:
48
- return n;
24
+ currentCellUpdate: e,
25
+ newValue: { [e.valueKey]: { value: e.newValue } },
26
+ oldValue: { [e.valueKey]: { value: t?.[e.valueKey]?.value } },
27
+ value: { [e.valueKey]: { value: e.newValue } }
28
+ }, r = t?.[e.valueKey] ?? {};
29
+ a.setDataValue(o.field, { ...t, [e.valueKey]: { ...r, value: e.newValue } }), d?.onCellUpdate?.(n);
30
+ }, [s, p, o, v, d, u, a, t]), S = (l) => {
31
+ if (typeof l == "string") {
32
+ const e = p?.getGridOption("components");
33
+ return d?.frameworkComponents?.[l] || e?.[l];
49
34
  }
35
+ return l;
50
36
  };
51
- return /* @__PURE__ */ c(
37
+ return /* @__PURE__ */ f(
52
38
  "div",
53
39
  {
54
- style: { display: "grid", gridTemplateRows: `repeat(${r?.length}, 1fr)`, height: "100%", width: "100%" },
55
- children: r?.map((e, l) => {
56
- const n = e?.field?.split(".")?.pop(), t = a?.[n]?.value, v = s?.valueFormatter ?? e?.valueFormatter ?? null, S = v ? $(v, t?.toString()) : t?.toString(), w = e.editable ? f.cellEditor : f.cellRenderer ? f.cellRenderer : void 0, g = w ? N(w) : void 0;
57
- return /* @__PURE__ */ c(
40
+ style: { display: "grid", gridTemplateRows: `repeat(${i?.length}, 1fr)`, height: "100%", width: "100%" },
41
+ children: i?.map((l, e) => {
42
+ const n = l?.field?.split(".")?.pop(), r = t?.[n], c = r?.value, w = u, C = k(r, w, l?.valueFormatter, F ?? null), I = C ? A(C, c) : c?.toString(), N = typeof o?.editable == "boolean" ? o.editable : void 0, V = O(N, l.editable, w, r), g = V ? m.cellEditor : m.cellRenderer ? m.cellRenderer : void 0, y = g ? S(g) : void 0;
43
+ return /* @__PURE__ */ f(
58
44
  "div",
59
45
  {
60
46
  className: "flex items-center max-h-full overflow-hidden",
61
- children: g ? /* @__PURE__ */ c(
62
- g,
47
+ children: y ? /* @__PURE__ */ f(
48
+ y,
63
49
  {
64
- context: i,
65
- data: s,
66
- value: t,
67
- onValueChange: (y) => {
68
- const C = u.find((K) => K.field === e.field);
69
- C ? C.newValue = y : b([...u, {
50
+ context: d,
51
+ data: u,
52
+ value: r,
53
+ onValueChange: (h) => {
54
+ const b = s.find((D) => D.field === l.field);
55
+ b ? b.newValue = h : E([...s, {
70
56
  valueKey: n,
71
- field: e.field,
72
- newValue: y
57
+ field: l.field,
58
+ newValue: h
73
59
  }]);
74
60
  },
75
- valueFormatted: S,
76
- colDef: e,
61
+ valueFormatted: I,
62
+ colDef: { ...l, editable: V },
77
63
  stopEditing: () => {
78
- x(e.field);
64
+ U(l.field);
79
65
  },
80
- node: o,
81
- suppressAutoFocus: l !== 0,
82
- className: l !== r.length - 1 ? "border-b border-gray-200" : ""
66
+ node: a,
67
+ suppressAutoFocus: e !== 0,
68
+ className: e !== i.length - 1 ? "border-b border-gray-200" : ""
83
69
  }
84
- ) : /* @__PURE__ */ c(
70
+ ) : /* @__PURE__ */ f(
85
71
  "div",
86
72
  {
87
73
  className: "w-full h-full flex items-center ag-cell-inner-padding overflow-hidden text-ellipsis whitespace-nowrap",
@@ -89,13 +75,13 @@ const R = U((V) => {
89
75
  }
90
76
  )
91
77
  },
92
- `${e.field}-${l}`
78
+ `${l.field}-${e}`
93
79
  );
94
80
  })
95
81
  }
96
82
  );
97
83
  });
98
- R.displayName = "SplitCellEditor";
84
+ G.displayName = "SplitCellEditor";
99
85
  export {
100
- R as SplitCellEditor
86
+ G as SplitCellEditor
101
87
  };
@@ -30,7 +30,9 @@ export type { SplitCellRendererProps } from './split-cell-renderer';
30
30
  export type { InputCellEditorProps } from './editors/input-cell-editor';
31
31
  export type { SelectCellEditorProps } from './editors/select-cell-editor';
32
32
  export type { SplitCellEditorProps } from './editors/split-cell-editor';
33
- export { type BadgeVariant, type BadgeColor, type SelectOption, type ActionButton, type RightSideIcon, type RightSideBadge, type RightSideContentItem, type RightSideContent, type SplitConfig, mapBadgeVariant, mapBadgeColor, getFieldValue, } from './types';
33
+ export { type BadgeVariant, type BadgeColor, type SelectOption, type ActionButton, type RightSideIcon, type RightSideBadge, type RightSideContentItem, type RightSideContent, type SplitConfig, type CellMetadata, type RowMetadata, type ValueFormatter, } from './types';
34
+ export { mapBadgeVariant, mapBadgeColor, getFieldValue, resolveValueFormatter, applyValueFormatter, resolveCellEditable, evaluateValidationRules, } from './cell-renderer-utils';
35
+ export { addRowDataEditableCheck } from '../editable-utils';
34
36
  export declare const AG_GRID_CELL_COMPONENTS: {
35
37
  empty: {
36
38
  (_props: import('ag-grid-community').ICellRendererParams): any;
@@ -2,31 +2,32 @@ import { EmptyCellRenderer as e } from "./empty-cell-renderer.js";
2
2
  import { BadgeCellRenderer as r } from "./badge-cell-renderer.js";
3
3
  import { StatusBadgeRenderer as t } from "./status-badge-renderer.js";
4
4
  import { ActionsCellRenderer as o } from "./actions-cell-renderer.js";
5
- import { LinkCellRenderer as i } from "./link-with-batch-cell-renderer.js";
6
- import { SplitCellRenderer as l } from "./split-cell-renderer.js";
7
- import { InputDisplayRenderer as p } from "./input-display-renderer.js";
8
- import { SelectDisplayRenderer as a } from "./select-display-renderer.js";
5
+ import { LinkCellRenderer as l } from "./link-with-batch-cell-renderer.js";
6
+ import { SplitCellRenderer as i } from "./split-cell-renderer.js";
7
+ import { InputDisplayRenderer as a } from "./input-display-renderer.js";
8
+ import { SelectDisplayRenderer as p } from "./select-display-renderer.js";
9
9
  import { CheckboxDisplayRenderer as m } from "./checkbox-display-renderer.js";
10
10
  import { SwitchDisplayRenderer as d } from "./switch-display-renderer.js";
11
11
  import { TextAreaDisplayRenderer as n } from "./textarea-display-renderer.js";
12
12
  import { DateDisplayRenderer as s } from "./date-display-renderer.js";
13
13
  import { InputCellEditor as c } from "./editors/input-cell-editor.js";
14
14
  import { SelectCellEditor as f } from "./editors/select-cell-editor.js";
15
- import { TextAreaCellEditor as D } from "./editors/textarea-cell-editor.js";
16
- import { DateCellEditor as C } from "./editors/date-cell-editor.js";
15
+ import { TextAreaCellEditor as C } from "./editors/textarea-cell-editor.js";
16
+ import { DateCellEditor as D } from "./editors/date-cell-editor.js";
17
17
  import { SplitCellEditor as E } from "./editors/split-cell-editor.js";
18
- import { getFieldValue as U, mapBadgeColor as j, mapBadgeVariant as q } from "./types.js";
19
- const b = "ag-cell-no-padding", P = "ag-cell-renderer-full-control", w = "ag-cell-inner-padding", F = {
18
+ import { applyValueFormatter as M, evaluateValidationRules as U, getFieldValue as j, mapBadgeColor as q, mapBadgeVariant as z, resolveCellEditable as H, resolveValueFormatter as J } from "./cell-renderer-utils.js";
19
+ import { addRowDataEditableCheck as Q } from "../editable-utils.js";
20
+ const V = "ag-cell-no-padding", F = "ag-cell-renderer-full-control", T = "ag-cell-inner-padding", v = {
20
21
  // Display-only renderers
21
22
  empty: e,
22
23
  badge: r,
23
24
  statusBadge: t,
24
25
  actions: o,
25
- link: i,
26
- split: l,
26
+ link: l,
27
+ split: i,
27
28
  // Editable display renderers (lightweight styled divs)
28
- inputDisplay: p,
29
- selectDisplay: a,
29
+ inputDisplay: a,
30
+ selectDisplay: p,
30
31
  checkboxDisplay: m,
31
32
  switchDisplay: d,
32
33
  textareaDisplay: n,
@@ -34,32 +35,37 @@ const b = "ag-cell-no-padding", P = "ag-cell-renderer-full-control", w = "ag-cel
34
35
  // Cell editors (real interactive components, mounted on edit)
35
36
  inputEditor: c,
36
37
  selectEditor: f,
37
- textareaEditor: D,
38
- dateEditor: C,
38
+ textareaEditor: C,
39
+ dateEditor: D,
39
40
  splitEditor: E
40
41
  };
41
42
  export {
42
- P as AG_CELL_FULL_CONTROL,
43
- w as AG_CELL_INNER_PADDING,
44
- b as AG_CELL_NO_PADDING,
45
- F as AG_GRID_CELL_COMPONENTS,
43
+ F as AG_CELL_FULL_CONTROL,
44
+ T as AG_CELL_INNER_PADDING,
45
+ V as AG_CELL_NO_PADDING,
46
+ v as AG_GRID_CELL_COMPONENTS,
46
47
  o as ActionsCellRenderer,
47
48
  r as BadgeCellRenderer,
48
49
  m as CheckboxDisplayRenderer,
49
- C as DateCellEditor,
50
+ D as DateCellEditor,
50
51
  s as DateDisplayRenderer,
51
52
  e as EmptyCellRenderer,
52
- p as InputDisplayRenderer,
53
- i as LinkCellRenderer,
53
+ a as InputDisplayRenderer,
54
+ l as LinkCellRenderer,
54
55
  f as SelectCellEditor,
55
- a as SelectDisplayRenderer,
56
+ p as SelectDisplayRenderer,
56
57
  E as SplitCellEditor,
57
- l as SplitCellRenderer,
58
+ i as SplitCellRenderer,
58
59
  t as StatusBadgeRenderer,
59
60
  d as SwitchDisplayRenderer,
60
- D as TextAreaCellEditor,
61
+ C as TextAreaCellEditor,
61
62
  n as TextAreaDisplayRenderer,
62
- U as getFieldValue,
63
- j as mapBadgeColor,
64
- q as mapBadgeVariant
63
+ Q as addRowDataEditableCheck,
64
+ M as applyValueFormatter,
65
+ U as evaluateValidationRules,
66
+ j as getFieldValue,
67
+ q as mapBadgeColor,
68
+ z as mapBadgeVariant,
69
+ H as resolveCellEditable,
70
+ J as resolveValueFormatter
65
71
  };
@@ -1,10 +1,13 @@
1
1
  import { ICellRendererParams } from 'ag-grid-enterprise';
2
+ import { ValueFormatter } from './types';
2
3
  export interface InputDisplayRendererProps extends ICellRendererParams {
3
4
  /** Placeholder text shown when value is empty */
4
5
  placeholder?: string;
5
6
  /** Whether the field is disabled */
6
7
  disabled?: boolean;
7
8
  className?: string;
9
+ /** Column-level value formatter (lowest priority: cell > row > column) */
10
+ valueFormatter?: ValueFormatter;
8
11
  }
9
12
  /**
10
13
  * InputDisplayRenderer - Lightweight styled div that looks like an input field.
@@ -1,19 +1,35 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- const p = (r) => {
3
- const { valueFormatted: d, value: c, placeholder: u, disabled: t, colDef: l, className: o } = r, i = !t && l?.editable === !0, a = l?.cellDataType === "number", n = d ?? c, s = !n;
4
- return /* @__PURE__ */ e(
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { applyValueFormatter as F } from "./cell-renderer-utils.js";
3
+ const w = (h) => {
4
+ const { valueFormatted: l, value: e, placeholder: g, disabled: n, colDef: s, className: y, data: t, valueFormatter: v } = h, c = e && typeof e == "object" && "cellMetadata" in e ? e.cellMetadata?._isDisabled : void 0, u = t && typeof t == "object" && "rowMetadata" in t ? t.rowMetadata?._isDisabled : void 0;
5
+ let a = !1;
6
+ if (!n) {
7
+ const o = s?._originalEditable;
8
+ s?.editable === !1 ? a = !1 : c === !1 ? a = !0 : c === !0 ? a = !1 : u === !1 ? a = !0 : u === !0 ? a = !1 : a = o === !0 || s?.editable === !0;
9
+ }
10
+ const f = s?.cellDataType === "number", m = e && typeof e == "object" && "value" in e, r = m ? e.value : e;
11
+ let i;
12
+ if (l != null && l !== "Invalid Number" && l !== "")
13
+ i = l;
14
+ else if (m) {
15
+ const o = e.cellMetadata?.valueFormatter, x = t && typeof t == "object" && "rowMetadata" in t ? t.rowMetadata?.valueFormatter : void 0, b = o ?? x ?? v;
16
+ i = b ? F(b, r) : r;
17
+ } else
18
+ i = l ?? r;
19
+ const p = !i;
20
+ return /* @__PURE__ */ d(
5
21
  "div",
6
22
  {
7
- className: `w-full h-full flex items-center ag-cell-inner-padding ${o} ${t ? "opacity-60 cursor-not-allowed" : i ? "in-ag-editable-cell-highlight" : ""}`,
8
- children: /* @__PURE__ */ e(
23
+ className: `w-full h-full flex items-center ag-cell-inner-padding ${y} ${n ? "opacity-60 cursor-not-allowed" : a ? "in-ag-editable-cell-highlight" : ""}`,
24
+ children: /* @__PURE__ */ d(
9
25
  "div",
10
26
  {
11
- className: `flex w-full items-center rounded-[8px] px-1.5 h-7 ${a ? "justify-end text-right" : ""} ${i ? "bg-white" : "bg-inherit"}`,
12
- children: /* @__PURE__ */ e(
27
+ className: `flex w-full items-center rounded-[8px] px-1.5 h-7 ${f ? "justify-end text-right" : ""} ${a ? "bg-white" : "bg-inherit"}`,
28
+ children: /* @__PURE__ */ d(
13
29
  "span",
14
30
  {
15
- className: `flex h-full w-full bg-transparent p-0 text-sm font-medium items-center truncate text-[#1f2b4d] ${s ? "text-[#dfe2e7]" : ""} ${a ? "justify-end text-right" : ""}`,
16
- children: s ? u ?? "--" : n
31
+ className: `flex h-full w-full bg-transparent p-0 text-sm font-medium items-center truncate text-[#1f2b4d] ${p ? "text-[#dfe2e7]" : ""} ${f ? "justify-end text-right" : ""}`,
32
+ children: p ? g ?? "--" : i
17
33
  }
18
34
  )
19
35
  }
@@ -21,7 +37,7 @@ const p = (r) => {
21
37
  }
22
38
  );
23
39
  };
24
- p.displayName = "InputDisplayRenderer";
40
+ w.displayName = "InputDisplayRenderer";
25
41
  export {
26
- p as InputDisplayRenderer
42
+ w as InputDisplayRenderer
27
43
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as c, jsxs as j } from "react/jsx-runtime";
2
2
  import { useMemo as S, useCallback as O } from "react";
3
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";
4
+ import { evaluateValidationRules as V, getFieldValue as m, mapBadgeVariant as I, mapBadgeColor as L } from "./cell-renderer-utils.js";
5
5
  import { getIconComponent as U } from "../../../../icons/index.js";
6
6
  import { Tooltip as H, TooltipTrigger as _, TooltipContent as z } from "../../tooltip.js";
7
7
  const M = (e, t, r, a) => {
@@ -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;