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.
- package/README.md +49 -0
- package/dist/components/layout/dashboard-layout.d.ts +15 -1
- package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +65 -64
- package/dist/components/ui/accordion.js +38 -34
- package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.d.ts +58 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.js +104 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +62 -54
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +4 -6
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +54 -68
- package/dist/components/ui/ag-grid-react/cell-renderers/index.d.ts +3 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/index.js +33 -27
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +3 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +28 -12
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.d.ts +2 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +45 -44
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.d.ts +4 -6
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +23 -37
- package/dist/components/ui/ag-grid-react/cell-renderers/types.d.ts +33 -17
- package/dist/components/ui/ag-grid-react/editable-utils.d.ts +27 -0
- package/dist/components/ui/ag-grid-react/editable-utils.js +62 -0
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +99 -98
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +110 -143
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +72 -69
- package/dist/components/ui/ag-grid-react/headers/components/header-info.js +36 -35
- package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +14 -12
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +111 -110
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +204 -203
- package/dist/components/ui/alert.js +62 -58
- package/dist/components/ui/breadcrumb.js +81 -74
- package/dist/components/ui/calendar.js +354 -354
- package/dist/components/ui/chart/chart.js +63 -62
- package/dist/components/ui/chips.js +42 -38
- package/dist/components/ui/command-palette/command-palette-context.d.ts +52 -0
- package/dist/components/ui/command-palette/command-palette-context.js +110 -0
- package/dist/components/ui/command-palette/command-palette.d.ts +67 -0
- package/dist/components/ui/command-palette/command-palette.js +402 -0
- package/dist/components/ui/command-palette/index.d.ts +23 -0
- package/dist/components/ui/command-palette/index.js +44 -0
- package/dist/components/ui/command-palette/kbd.d.ts +28 -0
- package/dist/components/ui/command-palette/kbd.js +52 -0
- package/dist/components/ui/command-palette/shortcut-registry.d.ts +68 -0
- package/dist/components/ui/command-palette/shortcut-registry.js +183 -0
- package/dist/components/ui/command-palette/shortcut-scope-provider.d.ts +55 -0
- package/dist/components/ui/command-palette/shortcut-scope-provider.js +55 -0
- package/dist/components/ui/command-palette/shortcut-settings.d.ts +27 -0
- package/dist/components/ui/command-palette/shortcut-settings.js +266 -0
- package/dist/components/ui/command-palette/use-browser-shortcuts.d.ts +32 -0
- package/dist/components/ui/command-palette/use-browser-shortcuts.js +48 -0
- package/dist/components/ui/command-palette/use-global-shortcut.d.ts +3 -0
- package/dist/components/ui/command-palette/use-global-shortcut.js +7 -0
- package/dist/components/ui/command-palette/use-shortcut.d.ts +47 -0
- package/dist/components/ui/command-palette/use-shortcut.js +49 -0
- package/dist/components/ui/command-palette/utils.d.ts +119 -0
- package/dist/components/ui/command-palette/utils.js +248 -0
- package/dist/components/ui/data-table/data-table-column-list.js +87 -86
- package/dist/components/ui/data-table/data-table-format-options.js +45 -44
- package/dist/components/ui/data-table/data-table-view-options.js +39 -38
- package/dist/components/ui/date-picker/date-picker.js +89 -87
- package/dist/components/ui/date-picker/date-range-picker.js +140 -138
- package/dist/components/ui/date-picker/month-picker.js +82 -81
- package/dist/components/ui/date-picker/month-range-picker.js +108 -105
- package/dist/components/ui/date-picker/multi-date-picker.js +68 -66
- package/dist/components/ui/date-picker/multi-month-picker.js +59 -58
- package/dist/components/ui/date-picker/multi-week-picker.js +80 -78
- package/dist/components/ui/date-picker/week-picker.js +117 -115
- package/dist/components/ui/date-picker/week-range-picker.js +166 -164
- package/dist/components/ui/dialog.js +78 -73
- package/dist/components/ui/drawer.js +71 -66
- package/dist/components/ui/file-upload.js +131 -127
- package/dist/components/ui/filter-panel/filter-panel.js +98 -94
- package/dist/components/ui/filter-strip/filter-strip.js +95 -91
- package/dist/components/ui/filter-strip/filter-summary.js +91 -90
- package/dist/components/ui/header.js +57 -53
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +78 -76
- package/dist/components/ui/loader.js +17 -16
- package/dist/components/ui/nested-list/components/NestedListHeader.d.ts +1 -0
- package/dist/components/ui/nested-list/components/NestedListHeader.js +51 -48
- package/dist/components/ui/nested-list/components/SortableItem.js +60 -59
- package/dist/components/ui/nested-list/nested-list.js +184 -182
- package/dist/components/ui/notification-panel/notification-panel.js +60 -53
- package/dist/components/ui/popover.js +45 -40
- package/dist/components/ui/prompt.js +90 -86
- package/dist/components/ui/select/select.js +206 -209
- package/dist/components/ui/sheet.d.ts +1 -0
- package/dist/components/ui/sheet.js +50 -48
- package/dist/components/ui/sidebar.js +273 -267
- package/dist/components/ui/stepper.js +75 -63
- package/dist/components/ui/tag.js +48 -44
- package/dist/components/ui/toast.js +46 -41
- package/dist/i18n/ImpactNovaI18nContext.d.ts +21 -0
- package/dist/i18n/ImpactNovaI18nContext.js +76 -0
- package/dist/i18n/defaultMessages.d.ts +231 -0
- package/dist/i18n/defaultMessages.js +206 -0
- package/dist/i18n/getDateFnsLocale.d.ts +11 -0
- package/dist/i18n/getDateFnsLocale.js +21 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/locales/de.d.ts +2 -0
- package/dist/i18n/locales/de.js +206 -0
- package/dist/i18n/locales/es.d.ts +2 -0
- package/dist/i18n/locales/es.js +206 -0
- package/dist/i18n/locales/hi.d.ts +2 -0
- package/dist/i18n/locales/hi.js +206 -0
- package/dist/i18n/locales/index.d.ts +4 -0
- package/dist/i18n/locales/kn.d.ts +2 -0
- package/dist/i18n/locales/kn.js +206 -0
- package/dist/icons/assets/boxAdd.svg.js +5 -0
- package/dist/icons/assets/boxed.svg.js +5 -0
- package/dist/icons/assets/trolley.svg.js +5 -0
- package/dist/icons/assets/unlocked.svg.js +5 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +179 -171
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +232 -172
- package/package.json +36 -4
- package/dist/components/ui/ag-grid-react/cell-renderers/types.js +0 -74
|
@@ -1,27 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
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:
|
|
6
|
-
placeholder:
|
|
7
|
-
min:
|
|
8
|
-
max:
|
|
9
|
-
step:
|
|
10
|
-
maxLength:
|
|
11
|
-
onValueChange:
|
|
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
|
-
} =
|
|
15
|
-
|
|
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
|
-
|
|
18
|
+
let n;
|
|
19
|
+
if (u)
|
|
19
20
|
if (!e || e === "" || e === "-")
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
}), []),
|
|
33
|
-
if (t.current
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Object.
|
|
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
|
|
39
|
-
return isNaN(
|
|
46
|
+
const a = this.valueAsNumber;
|
|
47
|
+
return isNaN(a) ? n.get.call(this) : a;
|
|
40
48
|
},
|
|
41
|
-
set(
|
|
42
|
-
|
|
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
|
|
60
|
+
const C = s((l) => {
|
|
53
61
|
const e = t.current?.value;
|
|
54
|
-
if (!(
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
isNaN(
|
|
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
|
-
|
|
67
|
+
f?.(e);
|
|
60
68
|
}
|
|
61
|
-
}, [
|
|
62
|
-
|
|
63
|
-
}, []),
|
|
64
|
-
|
|
65
|
-
}, [
|
|
66
|
-
return /* @__PURE__ */
|
|
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 ${
|
|
70
|
-
children: /* @__PURE__ */
|
|
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:
|
|
75
|
-
onChange:
|
|
76
|
-
onKeyDown:
|
|
77
|
-
onBlur:
|
|
78
|
-
placeholder:
|
|
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] ${
|
|
80
|
-
min:
|
|
81
|
-
max:
|
|
82
|
-
step:
|
|
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
|
-
|
|
89
|
-
const
|
|
96
|
+
h.displayName = "InputCellEditor";
|
|
97
|
+
const O = E.memo(h, () => !0);
|
|
90
98
|
export {
|
|
91
|
-
|
|
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
|
|
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
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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:
|
|
14
|
-
column:
|
|
15
|
-
context:
|
|
16
|
-
data:
|
|
17
|
-
field:
|
|
18
|
-
node:
|
|
19
|
-
rowIndex:
|
|
20
|
-
rowPinned:
|
|
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:
|
|
24
|
-
newValue: { [
|
|
25
|
-
oldValue: { [
|
|
26
|
-
value: { [
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
}, [
|
|
30
|
-
if (typeof
|
|
31
|
-
const
|
|
32
|
-
return
|
|
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__ */
|
|
37
|
+
return /* @__PURE__ */ f(
|
|
52
38
|
"div",
|
|
53
39
|
{
|
|
54
|
-
style: { display: "grid", gridTemplateRows: `repeat(${
|
|
55
|
-
children:
|
|
56
|
-
const n =
|
|
57
|
-
return /* @__PURE__ */
|
|
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:
|
|
62
|
-
|
|
47
|
+
children: y ? /* @__PURE__ */ f(
|
|
48
|
+
y,
|
|
63
49
|
{
|
|
64
|
-
context:
|
|
65
|
-
data:
|
|
66
|
-
value:
|
|
67
|
-
onValueChange: (
|
|
68
|
-
const
|
|
69
|
-
|
|
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:
|
|
72
|
-
newValue:
|
|
57
|
+
field: l.field,
|
|
58
|
+
newValue: h
|
|
73
59
|
}]);
|
|
74
60
|
},
|
|
75
|
-
valueFormatted:
|
|
76
|
-
colDef:
|
|
61
|
+
valueFormatted: I,
|
|
62
|
+
colDef: { ...l, editable: V },
|
|
77
63
|
stopEditing: () => {
|
|
78
|
-
|
|
64
|
+
U(l.field);
|
|
79
65
|
},
|
|
80
|
-
node:
|
|
81
|
-
suppressAutoFocus:
|
|
82
|
-
className:
|
|
66
|
+
node: a,
|
|
67
|
+
suppressAutoFocus: e !== 0,
|
|
68
|
+
className: e !== i.length - 1 ? "border-b border-gray-200" : ""
|
|
83
69
|
}
|
|
84
|
-
) : /* @__PURE__ */
|
|
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
|
-
`${
|
|
78
|
+
`${l.field}-${e}`
|
|
93
79
|
);
|
|
94
80
|
})
|
|
95
81
|
}
|
|
96
82
|
);
|
|
97
83
|
});
|
|
98
|
-
|
|
84
|
+
G.displayName = "SplitCellEditor";
|
|
99
85
|
export {
|
|
100
|
-
|
|
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,
|
|
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
|
|
6
|
-
import { SplitCellRenderer as
|
|
7
|
-
import { InputDisplayRenderer as
|
|
8
|
-
import { SelectDisplayRenderer as
|
|
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
|
|
16
|
-
import { DateCellEditor as
|
|
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 {
|
|
19
|
-
|
|
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:
|
|
26
|
-
split:
|
|
26
|
+
link: l,
|
|
27
|
+
split: i,
|
|
27
28
|
// Editable display renderers (lightweight styled divs)
|
|
28
|
-
inputDisplay:
|
|
29
|
-
selectDisplay:
|
|
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:
|
|
38
|
-
dateEditor:
|
|
38
|
+
textareaEditor: C,
|
|
39
|
+
dateEditor: D,
|
|
39
40
|
splitEditor: E
|
|
40
41
|
};
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
50
|
+
D as DateCellEditor,
|
|
50
51
|
s as DateDisplayRenderer,
|
|
51
52
|
e as EmptyCellRenderer,
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
a as InputDisplayRenderer,
|
|
54
|
+
l as LinkCellRenderer,
|
|
54
55
|
f as SelectCellEditor,
|
|
55
|
-
|
|
56
|
+
p as SelectDisplayRenderer,
|
|
56
57
|
E as SplitCellEditor,
|
|
57
|
-
|
|
58
|
+
i as SplitCellRenderer,
|
|
58
59
|
t as StatusBadgeRenderer,
|
|
59
60
|
d as SwitchDisplayRenderer,
|
|
60
|
-
|
|
61
|
+
C as TextAreaCellEditor,
|
|
61
62
|
n as TextAreaDisplayRenderer,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 ${
|
|
8
|
-
children: /* @__PURE__ */
|
|
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 ${
|
|
12
|
-
children: /* @__PURE__ */
|
|
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] ${
|
|
16
|
-
children:
|
|
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
|
-
|
|
40
|
+
w.displayName = "InputDisplayRenderer";
|
|
25
41
|
export {
|
|
26
|
-
|
|
42
|
+
w as InputDisplayRenderer
|
|
27
43
|
};
|
|
@@ -24,6 +24,8 @@ export interface LinkCellRendererProps extends ICellRendererParams {
|
|
|
24
24
|
tooltipField?: string;
|
|
25
25
|
/** Whether to disable link behavior on pinned rows (default: true) */
|
|
26
26
|
disableOnPinnedRows?: boolean;
|
|
27
|
+
/** When true, text is plain (no blue/link styling) and click does nothing */
|
|
28
|
+
disableLinkStyle?: boolean;
|
|
27
29
|
/** Validation rules for disabling the link */
|
|
28
30
|
validationRules?: ValidationRules;
|
|
29
31
|
}
|