impact-nova 3.0.0-alpha.17 → 3.0.0-alpha.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +15 -0
- package/dist/components/data/ag-grid-react/cell-renderers/badge-cell-renderer.d.ts +2 -0
- package/dist/components/data/ag-grid-react/cell-renderers/badge-cell-renderer.js +15 -14
- package/dist/components/data/ag-grid-react/cell-renderers/badge-icon-registry.d.ts +10 -0
- package/dist/components/data/ag-grid-react/cell-renderers/badge-icon-registry.js +17 -0
- package/dist/components/data/ag-grid-react/cell-renderers/index.d.ts +45 -7
- package/dist/components/data/ag-grid-react/cell-renderers/index.js +70 -58
- package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.d.ts +5 -11
- package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.js +127 -51
- package/dist/components/data/ag-grid-react/headers/custom-header.js +56 -56
- package/dist/components/data/ag-grid-react/index.d.ts +2 -1
- package/dist/components/data/ag-grid-react/index.js +315 -296
- package/dist/components/data/ag-grid-react/list-drag-grid-options.d.ts +14 -1
- package/dist/components/data/ag-grid-react/list-drag-grid-options.js +95 -31
- package/dist/components/data/ag-grid-react/list-drag-preview-card.d.ts +4 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-card.js +14 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-snapshot.d.ts +20 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-snapshot.js +42 -0
- package/dist/components/data/ag-grid-react/list-find-highlight.d.ts +6 -0
- package/dist/components/data/ag-grid-react/list-find-highlight.js +7 -0
- package/dist/components/data/ag-grid-react/numeric-column-header-alignment.d.ts +9 -0
- package/dist/components/data/ag-grid-react/numeric-column-header-alignment.js +67 -0
- package/dist/components/data/ag-grid-react/process-backend-columndefs.d.ts +10 -2
- package/dist/components/data/ag-grid-react/process-backend-columndefs.js +84 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-list-drag.d.ts +10 -2
- package/dist/components/data/ag-grid-react/use-ag-grid-list-drag.js +130 -107
- package/dist/components/data/ag-grid-react/use-list-drag-preview.d.ts +4 -1
- package/dist/components/data/ag-grid-react/use-list-drag-preview.js +131 -32
- package/dist/components/data/ag-grid-react/use-list-find.d.ts +36 -0
- package/dist/components/data/ag-grid-react/use-list-row-drop-zones.d.ts +2 -0
- package/dist/components/data/ag-grid-react/use-list-row-drop-zones.js +60 -41
- package/dist/components/data/data-table/data-table-list-header.js +1 -1
- package/dist/components/data/data-table/data-table-overlay.d.ts +6 -0
- package/dist/components/data/data-table/data-table-overlay.js +18 -0
- package/dist/components/data/data-table/data-table.types.d.ts +1 -0
- package/dist/components/data/data-table/index.d.ts +3 -0
- package/dist/components/data/data-table/index.js +67 -63
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
- package/dist/components/data/scenario-comparison/flatten-scenario-comparison-rows.d.ts +2 -0
- package/dist/components/data/scenario-comparison/flatten-scenario-comparison-rows.js +16 -0
- package/dist/components/data/scenario-comparison/index.d.ts +3 -0
- package/dist/components/data/scenario-comparison/index.js +6 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-column.d.ts +12 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-column.js +172 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-label.d.ts +6 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-label.js +64 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.d.ts +5 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.js +127 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.types.d.ts +56 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.variants.d.ts +7 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.variants.js +29 -0
- package/dist/components/data-display/badge/index.d.ts +2 -0
- package/dist/components/data-display/badge/index.js +4 -2
- package/dist/components/data-display/badge/trophy-icon.d.ts +6 -0
- package/dist/components/data-display/badge/trophy-icon.js +28 -0
- package/dist/components/feedback/find-bar/collect-find-matches.d.ts +35 -0
- package/dist/components/feedback/find-bar/collect-find-matches.js +68 -0
- package/dist/components/feedback/find-bar/find-bar-shortcuts.d.ts +5 -0
- package/dist/components/feedback/find-bar/find-bar-shortcuts.js +27 -0
- package/dist/components/feedback/find-bar/find-bar.d.ts +7 -0
- package/dist/components/feedback/find-bar/find-bar.js +266 -0
- package/dist/components/feedback/find-bar/find-bar.types.d.ts +32 -0
- package/dist/components/feedback/find-bar/index.d.ts +4 -0
- package/dist/components/feedback/find-bar/index.js +11 -0
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/flows/iris-chat/iris-chat-composer.js +213 -184
- package/dist/components/flows/iris-chat/iris-chat-icons.d.ts +1 -0
- package/dist/components/flows/iris-chat/iris-chat-icons.js +23 -10
- package/dist/components/flows/iris-chat/iris-chat.variants.js +4 -4
- package/dist/components/flows/iris-chat/sync-iris-chat-composer-textarea.d.ts +6 -0
- package/dist/components/flows/iris-chat/sync-iris-chat-composer-textarea.js +23 -0
- package/dist/components/forms/choice-card/choice-card-compare-scroll.d.ts +4 -0
- package/dist/components/forms/choice-card/choice-card-compare-scroll.js +6 -0
- package/dist/components/forms/choice-card/choice-card.d.ts +13 -2
- package/dist/components/forms/choice-card/choice-card.js +432 -342
- package/dist/components/forms/choice-card/choice-card.types.d.ts +9 -2
- package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
- package/dist/components/forms/select/components/Submenu.js +3 -2
- package/dist/components/primitives/tabs/folder-tab-path.d.ts +6 -0
- package/dist/components/primitives/tabs/folder-tab-path.js +16 -0
- package/dist/components/primitives/tabs/tabs.js +178 -112
- package/dist/components/primitives/tabs/tabs.types.d.ts +1 -1
- package/dist/i18n/defaultMessages.d.ts +19 -0
- package/dist/i18n/defaultMessages.js +54 -38
- package/dist/i18n/impact-nova-i18n-defaults.d.ts +5 -0
- package/dist/i18n/impact-nova-i18n-defaults.js +4 -9
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/de.js +17 -1
- package/dist/i18n/locales/es.js +17 -1
- package/dist/i18n/locales/hi.js +17 -1
- package/dist/i18n/locales/kn.js +17 -1
- package/dist/impact-nova-components.css +189 -14
- package/dist/impact-nova-tokens.scss +2 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +621 -607
- package/dist/lib/virtualized/index.d.ts +2 -0
- package/dist/lib/virtualized/index.js +35 -31
- package/dist/lib/virtualized/list-index.d.ts +5 -0
- package/dist/lib/virtualized/list-index.js +13 -0
- package/dist/lib/virtualized/read-infinite-query-list.d.ts +14 -0
- package/dist/lib/virtualized/read-infinite-query-list.js +12 -0
- package/dist/lib/virtualized/types.d.ts +4 -2
- package/dist/lib/virtualized/useRowState.js +60 -56
- package/dist/lib/virtualized/useVirtualizedList.d.ts +5 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRowNode, RowDragEndEvent, RowDragMoveEvent } from 'ag-grid-community';
|
|
1
|
+
import { GridApi, IRowNode, RowDragEndEvent, RowDragMoveEvent } from 'ag-grid-community';
|
|
2
2
|
import { AgGridReactProps } from 'ag-grid-react';
|
|
3
3
|
import { ListDropPosition, isListDropAllowed } from './list-row-move';
|
|
4
4
|
import { AgGridVisualVariant, AgGridWrapperProps } from './ag-grid.types';
|
|
@@ -14,7 +14,20 @@ export declare function isAgGridListDragEnabled(options: {
|
|
|
14
14
|
getRowId?: unknown;
|
|
15
15
|
}): boolean;
|
|
16
16
|
export declare function readDragRowId<TData>(node: IRowNode<TData> | undefined): string | undefined;
|
|
17
|
+
/** Resolve the row under the drag handle / `.ag-row`, then fall back to the focused cell. */
|
|
18
|
+
export declare function readListKeyboardRow<TData>(options: {
|
|
19
|
+
api: GridApi<TData> | undefined;
|
|
20
|
+
target: EventTarget | null;
|
|
21
|
+
}): IRowNode<TData> | undefined;
|
|
22
|
+
export declare function formatListReorderLiveMessage(position: number, template: string): string;
|
|
17
23
|
export declare function dropPositionFromEvent<TData>(event: RowDragMoveEvent<TData> | RowDragEndEvent<TData>): ListDropPosition;
|
|
24
|
+
/** Same-list line only while the pointer is over this grid. Cross-list drop paints the other grid. */
|
|
25
|
+
export declare function isListDragPointerOverHost(event: {
|
|
26
|
+
event?: {
|
|
27
|
+
clientX?: number;
|
|
28
|
+
clientY?: number;
|
|
29
|
+
} | null;
|
|
30
|
+
}, host: HTMLElement | null | undefined): boolean;
|
|
18
31
|
export declare function itemIdFromGetRowId<TData>(getRowId: AgGridReactProps<TData>['getRowId'], data: TData): string | undefined;
|
|
19
32
|
export declare function createDefaultRowDragText<TData>(columnDefs: AgGridReactProps<TData>['columnDefs']): NonNullable<AgGridReactProps<TData>['rowDragText']>;
|
|
20
33
|
export declare function createListRowStyle<TData>(listRowGradient: AgGridWrapperProps<TData>['listRowGradient'], userGetRowStyle: AgGridReactProps<TData>['getRowStyle']): AgGridReactProps<TData>['getRowStyle'];
|
|
@@ -1,46 +1,110 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function s(t) {
|
|
2
|
+
return t === "list";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return
|
|
4
|
+
function a(t) {
|
|
5
|
+
return t.variant === "list" && t.onRowReorder != null && t.getRowId != null;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
if (!(
|
|
9
|
-
return String(
|
|
7
|
+
function g(t) {
|
|
8
|
+
if (!(t?.id == null || t.id === ""))
|
|
9
|
+
return String(t.id);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
|
|
11
|
+
function w(t) {
|
|
12
|
+
const { api: n, target: r } = t;
|
|
13
|
+
if (n && r instanceof Element) {
|
|
14
|
+
const i = r.closest(".ag-row");
|
|
15
|
+
if (i) {
|
|
16
|
+
const e = i.getAttribute("row-id");
|
|
17
|
+
if (e) {
|
|
18
|
+
const d = n.getRowNode(e);
|
|
19
|
+
if (d) return d;
|
|
20
|
+
}
|
|
21
|
+
const l = i.getAttribute("row-index");
|
|
22
|
+
if (l) {
|
|
23
|
+
const d = Number(l);
|
|
24
|
+
if (!Number.isNaN(d)) {
|
|
25
|
+
const f = n.getDisplayedRowAtIndex(d);
|
|
26
|
+
if (f) return f;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const o = n?.getFocusedCell();
|
|
32
|
+
if (!(!o || o.rowIndex == null))
|
|
33
|
+
return n?.getDisplayedRowAtIndex(o.rowIndex) ?? void 0;
|
|
34
|
+
}
|
|
35
|
+
function b(t, n) {
|
|
36
|
+
return n.replace(/\{\{position\}\}/g, String(t));
|
|
37
|
+
}
|
|
38
|
+
function p(t) {
|
|
39
|
+
return t.rowsDrop?.position === "above" ? "above" : "below";
|
|
40
|
+
}
|
|
41
|
+
function I(t, n) {
|
|
42
|
+
if (!n) return !0;
|
|
43
|
+
const r = t.event;
|
|
44
|
+
if (r == null || typeof r.clientX != "number" || typeof r.clientY != "number")
|
|
45
|
+
return !0;
|
|
46
|
+
const o = n.getBoundingClientRect();
|
|
47
|
+
return o.width <= 0 || o.height <= 0 ? !0 : r.clientX >= o.left && r.clientX <= o.right && r.clientY >= o.top && r.clientY <= o.bottom;
|
|
13
48
|
}
|
|
14
|
-
function
|
|
15
|
-
if (
|
|
49
|
+
function m(t, n) {
|
|
50
|
+
if (t)
|
|
16
51
|
return String(
|
|
17
|
-
|
|
52
|
+
t({ data: n, level: 0 })
|
|
18
53
|
);
|
|
19
54
|
}
|
|
20
|
-
function
|
|
21
|
-
const t = [],
|
|
22
|
-
for (const
|
|
23
|
-
if (
|
|
24
|
-
"children" in
|
|
55
|
+
function x(t) {
|
|
56
|
+
const n = u(t), r = [], o = (i) => {
|
|
57
|
+
for (const e of i) {
|
|
58
|
+
if (r.length >= 2) return;
|
|
59
|
+
"children" in e && e.children ? o(e.children) : "field" in e && typeof e.field == "string" && r.push(e.field);
|
|
25
60
|
}
|
|
26
61
|
};
|
|
27
|
-
return
|
|
28
|
-
const
|
|
29
|
-
|
|
62
|
+
return t && o(t), (i) => {
|
|
63
|
+
const e = i.rowNode?.data ?? {};
|
|
64
|
+
if (n) {
|
|
65
|
+
const l = e[n];
|
|
66
|
+
if (l != null && l !== "") return String(l);
|
|
67
|
+
}
|
|
68
|
+
return r.map((l) => e[l]).filter((l) => l != null && l !== "").join(" · ");
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function c(t, n) {
|
|
72
|
+
return /rank/i.test(t) || n != null && /rank/i.test(n);
|
|
73
|
+
}
|
|
74
|
+
function u(t) {
|
|
75
|
+
const n = [], r = (i) => {
|
|
76
|
+
for (const e of i)
|
|
77
|
+
"children" in e && e.children ? r(e.children) : "field" in e && typeof e.field == "string" && e.colId !== "__drag-handle" && n.push({
|
|
78
|
+
field: e.field,
|
|
79
|
+
colId: typeof e.colId == "string" ? e.colId : void 0,
|
|
80
|
+
context: e.context
|
|
81
|
+
});
|
|
30
82
|
};
|
|
83
|
+
t && r(t);
|
|
84
|
+
for (const i of n)
|
|
85
|
+
if (/label|name|title$/i.test(i.field)) return i.field;
|
|
86
|
+
for (const i of n) {
|
|
87
|
+
const e = i.context;
|
|
88
|
+
if (e != null && typeof e == "object" && "findable" in e && e.findable === !0 && !c(i.field, i.colId))
|
|
89
|
+
return i.field;
|
|
90
|
+
}
|
|
91
|
+
return n.filter((i) => !c(i.field, i.colId))[0]?.field ?? n[0]?.field;
|
|
31
92
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
34
|
-
const
|
|
35
|
-
return
|
|
93
|
+
function y(t, n) {
|
|
94
|
+
return t == null ? n : (r) => {
|
|
95
|
+
const o = typeof t == "function" ? t({ data: r.data, rowIndex: r.node.rowIndex }) : t, i = n?.(r);
|
|
96
|
+
return o ? { ...i, "--in-ag-list-row-gradient": o } : i;
|
|
36
97
|
};
|
|
37
98
|
}
|
|
38
99
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
100
|
+
x as createDefaultRowDragText,
|
|
101
|
+
y as createListRowStyle,
|
|
102
|
+
p as dropPositionFromEvent,
|
|
103
|
+
b as formatListReorderLiveMessage,
|
|
104
|
+
a as isAgGridListDragEnabled,
|
|
105
|
+
s as isAgGridListVariant,
|
|
106
|
+
I as isListDragPointerOverHost,
|
|
107
|
+
m as itemIdFromGetRowId,
|
|
108
|
+
g as readDragRowId,
|
|
109
|
+
w as readListKeyboardRow
|
|
46
110
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
function r(e) {
|
|
3
|
+
return /* @__PURE__ */ t(
|
|
4
|
+
"span",
|
|
5
|
+
{
|
|
6
|
+
"data-component": "ag-grid-drag-preview-label",
|
|
7
|
+
className: "block min-w-0 truncate text-sm leading-5 text-content",
|
|
8
|
+
children: e.label
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
r as ListDragPreviewCard
|
|
14
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ListDragRowFrame = {
|
|
2
|
+
left: number;
|
|
3
|
+
top: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
cardHeight: number;
|
|
7
|
+
rowGradient: string;
|
|
8
|
+
listBorderRadius: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function readListDragRowFrame(container: HTMLElement | null): ListDragRowFrame | null;
|
|
11
|
+
/** List row cells without the drag handle — same content as the visible row card. */
|
|
12
|
+
export declare function readListDragPreviewMarkup(container: HTMLElement | null): string;
|
|
13
|
+
export declare function readListDragPreviewPosition(options: {
|
|
14
|
+
pointerX: number;
|
|
15
|
+
pointerY: number;
|
|
16
|
+
frame: ListDragRowFrame | null;
|
|
17
|
+
}): {
|
|
18
|
+
left: number;
|
|
19
|
+
top: number;
|
|
20
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function o(t) {
|
|
2
|
+
const e = t?.closest('[data-component="ag-grid-react"][data-variant="list"]');
|
|
3
|
+
if (!(e instanceof HTMLElement)) return "";
|
|
4
|
+
const r = getComputedStyle(e).getPropertyValue("--in-ag-list-radius").trim();
|
|
5
|
+
return r && !r.startsWith("var(") ? r : getComputedStyle(e).getPropertyValue("--radius").trim();
|
|
6
|
+
}
|
|
7
|
+
function c(t) {
|
|
8
|
+
const e = t.querySelector(".ag-center-cols-container") ?? t.querySelector(".ag-grid-scrolling-cells");
|
|
9
|
+
return e instanceof HTMLElement ? e : t;
|
|
10
|
+
}
|
|
11
|
+
function l(t) {
|
|
12
|
+
const e = t?.querySelector(".ag-row.ag-row-dragging");
|
|
13
|
+
if (!(e instanceof HTMLElement)) return null;
|
|
14
|
+
const r = e.getBoundingClientRect(), n = c(e).getBoundingClientRect(), a = e.style.getPropertyValue("--in-ag-list-row-gradient").trim();
|
|
15
|
+
return {
|
|
16
|
+
left: n.left,
|
|
17
|
+
top: r.top,
|
|
18
|
+
width: n.width / 2,
|
|
19
|
+
height: r.height,
|
|
20
|
+
cardHeight: Math.max(r.height - 12, 0),
|
|
21
|
+
rowGradient: a,
|
|
22
|
+
listBorderRadius: o(t)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function s(t) {
|
|
26
|
+
const e = t?.querySelector(".ag-row.ag-row-dragging");
|
|
27
|
+
if (!(e instanceof HTMLElement)) return "";
|
|
28
|
+
const r = e.querySelectorAll('.ag-cell:not([col-id="__drag-handle"])');
|
|
29
|
+
return r.length === 0 ? "" : `<div class="in-ag-list-drag-preview-row">${Array.from(r).map((n) => `<div class="in-ag-list-drag-preview-cell">${n.innerHTML}</div>`).join("")}</div>`;
|
|
30
|
+
}
|
|
31
|
+
function g(t) {
|
|
32
|
+
const r = t.frame?.cardHeight ?? 40;
|
|
33
|
+
return {
|
|
34
|
+
left: t.pointerX + 16,
|
|
35
|
+
top: t.pointerY - r / 2
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
s as readListDragPreviewMarkup,
|
|
40
|
+
g as readListDragPreviewPosition,
|
|
41
|
+
l as readListDragRowFrame
|
|
42
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
function t(i) {
|
|
3
|
+
return /* @__PURE__ */ e("div", { className: i.active ? "bg-canvas-sunken" : void 0, "data-find-current": i.active ? "true" : "false", children: i.children });
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
t as ListFindHighlight
|
|
7
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColDef, ColGroupDef } from 'ag-grid-community';
|
|
2
|
+
/** Default matches ItemSmart / legacy tables: numeric headers right-aligned with cells. */
|
|
3
|
+
export type NumericColumnHeaderAlignment = 'left' | 'right';
|
|
4
|
+
export declare function columnDefUsesNumericType(type: ColDef['type'] | undefined): boolean;
|
|
5
|
+
export declare function columnDefPresentsNumericData(columnDef: ColDef): boolean;
|
|
6
|
+
export declare function stripNumericHeaderRightAlignmentClass(headerClass: ColDef['headerClass']): ColDef['headerClass'];
|
|
7
|
+
export declare function applyNumericColumnPresentationClasses(columnDef: ColDef, numericColumnHeaderAlignment?: NumericColumnHeaderAlignment): ColDef;
|
|
8
|
+
export declare function normalizeColumnDefsNumericHeaderAlignment<TData>(columnDefs: (ColDef<TData> | ColGroupDef<TData>)[] | undefined, numericColumnHeaderAlignment: NumericColumnHeaderAlignment): (ColDef<TData> | ColGroupDef<TData>)[] | undefined;
|
|
9
|
+
export declare function readNumericColumnTypeConfig(numericColumnHeaderAlignment: NumericColumnHeaderAlignment): Pick<ColDef, 'cellClass' | 'headerClass' | 'filter'>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const a = /* @__PURE__ */ new Set(["number", "numericColumn", "currency", "percentage"]), n = "ag-right-aligned-header", i = "ag-right-aligned-cell";
|
|
2
|
+
function c(r) {
|
|
3
|
+
return r == null ? !1 : Array.isArray(r) ? r.some((e) => a.has(String(e))) : a.has(String(r));
|
|
4
|
+
}
|
|
5
|
+
function h(r) {
|
|
6
|
+
return c(r.type) || r.cellDataType === "number";
|
|
7
|
+
}
|
|
8
|
+
function s(r) {
|
|
9
|
+
if (r == null)
|
|
10
|
+
return r;
|
|
11
|
+
if (typeof r == "string") {
|
|
12
|
+
const e = r.split(/\s+/).filter((t) => t.length > 0 && t !== n).join(" ");
|
|
13
|
+
return e.length > 0 ? e : void 0;
|
|
14
|
+
}
|
|
15
|
+
if (Array.isArray(r)) {
|
|
16
|
+
const e = r.filter((t) => t !== n);
|
|
17
|
+
return e.length > 0 ? e : void 0;
|
|
18
|
+
}
|
|
19
|
+
return r;
|
|
20
|
+
}
|
|
21
|
+
function g(r) {
|
|
22
|
+
return typeof r == "string" && r.length > 0 ? r.includes(i) ? r : `${r} ${i}` : i;
|
|
23
|
+
}
|
|
24
|
+
function o(r) {
|
|
25
|
+
return typeof r == "string" && r.length > 0 ? r.includes(n) ? r : `${r} ${n}` : n;
|
|
26
|
+
}
|
|
27
|
+
function f(r, e = "right") {
|
|
28
|
+
if (!h(r))
|
|
29
|
+
return r;
|
|
30
|
+
const t = {
|
|
31
|
+
...r,
|
|
32
|
+
cellClass: g(r.cellClass)
|
|
33
|
+
};
|
|
34
|
+
return e === "right" ? t.headerClass = o(r.headerClass) : t.headerClass = s(r.headerClass), t;
|
|
35
|
+
}
|
|
36
|
+
function C(r, e) {
|
|
37
|
+
return !r || r.length === 0 || e === "right" ? r : r.map((t) => {
|
|
38
|
+
if ("children" in t && Array.isArray(t.children))
|
|
39
|
+
return {
|
|
40
|
+
...t,
|
|
41
|
+
children: C(
|
|
42
|
+
t.children,
|
|
43
|
+
e
|
|
44
|
+
)
|
|
45
|
+
};
|
|
46
|
+
const l = t, u = {
|
|
47
|
+
...l,
|
|
48
|
+
headerClass: s(l.headerClass)
|
|
49
|
+
};
|
|
50
|
+
return f(u, e);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function d(r) {
|
|
54
|
+
const e = {
|
|
55
|
+
cellClass: i,
|
|
56
|
+
filter: "agNumberColumnFilter"
|
|
57
|
+
};
|
|
58
|
+
return r === "right" ? { ...e, headerClass: n } : e;
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
f as applyNumericColumnPresentationClasses,
|
|
62
|
+
h as columnDefPresentsNumericData,
|
|
63
|
+
c as columnDefUsesNumericType,
|
|
64
|
+
C as normalizeColumnDefsNumericHeaderAlignment,
|
|
65
|
+
d as readNumericColumnTypeConfig,
|
|
66
|
+
s as stripNumericHeaderRightAlignmentClass
|
|
67
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ColDef, ColGroupDef, CellStyle, CellClassParams } from 'ag-grid-community';
|
|
2
|
+
import { NumericColumnHeaderAlignment } from './numeric-column-header-alignment';
|
|
3
|
+
export type ProcessBackendColumnDefsOptions = {
|
|
4
|
+
numericColumnHeaderAlignment?: NumericColumnHeaderAlignment;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* Color rule from backend
|
|
4
8
|
*/
|
|
@@ -16,15 +20,19 @@ export interface BackendColDef extends Omit<ColDef, 'cellStyle'> {
|
|
|
16
20
|
colorRules?: ColorRule[];
|
|
17
21
|
cellStyle?: CellStyle | ((params: CellClassParams) => CellStyle | undefined);
|
|
18
22
|
children?: BackendColDef[];
|
|
23
|
+
decimals?: number;
|
|
24
|
+
divideBy?: number;
|
|
25
|
+
symbol?: string;
|
|
26
|
+
currency?: string;
|
|
19
27
|
}
|
|
20
28
|
/**
|
|
21
29
|
* Processes a single column definition to handle colorRules, valueFormatters, and alignment.
|
|
22
30
|
*
|
|
23
31
|
* This is exported so it can be used for individual column processing or in other components.
|
|
24
32
|
*/
|
|
25
|
-
export declare const processColDef: (colDef: BackendColDef) => ColDef | ColGroupDef;
|
|
33
|
+
export declare const processColDef: (colDef: BackendColDef, options?: ProcessBackendColumnDefsOptions) => ColDef | ColGroupDef;
|
|
26
34
|
/**
|
|
27
35
|
* Processes a list of column definitions.
|
|
28
36
|
* Filters out invalid columns and applies transformation to each.
|
|
29
37
|
*/
|
|
30
|
-
export declare const processBackendColumnDefs: (columnDefs?: (BackendColDef | ColDef | ColGroupDef)[]) => (ColDef | ColGroupDef)[] | undefined;
|
|
38
|
+
export declare const processBackendColumnDefs: (columnDefs?: (BackendColDef | ColDef | ColGroupDef)[], options?: ProcessBackendColumnDefsOptions) => (ColDef | ColGroupDef)[] | undefined;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { AG_GRID_VALUE_FORMATTERS as l } from "./value-formatters.js";
|
|
2
|
+
import { isBackendValueFormatterObject as d } from "./value-formatter.types.js";
|
|
3
|
+
import { applyNumericColumnPresentationClasses as b } from "./numeric-column-header-alignment.js";
|
|
4
|
+
const v = ["percentage", "currency", "currencySymbol", "number"], g = {
|
|
5
|
+
percentage: 2,
|
|
6
|
+
currencySymbol: 2,
|
|
7
|
+
currency: 2,
|
|
8
|
+
number: 0
|
|
9
|
+
}, p = (r, i, n) => {
|
|
10
|
+
if (r == null) return !1;
|
|
11
|
+
switch (i) {
|
|
12
|
+
case ">":
|
|
13
|
+
return Number(r) > Number(n);
|
|
14
|
+
case "<":
|
|
15
|
+
return Number(r) < Number(n);
|
|
16
|
+
case ">=":
|
|
17
|
+
return Number(r) >= Number(n);
|
|
18
|
+
case "<=":
|
|
19
|
+
return Number(r) <= Number(n);
|
|
20
|
+
case "==":
|
|
21
|
+
return r == n;
|
|
22
|
+
case "!=":
|
|
23
|
+
return r != n;
|
|
24
|
+
case "contains":
|
|
25
|
+
return String(r).includes(String(n));
|
|
26
|
+
case "startsWith":
|
|
27
|
+
return String(r).startsWith(String(n));
|
|
28
|
+
case "endsWith":
|
|
29
|
+
return String(r).endsWith(String(n));
|
|
30
|
+
default:
|
|
31
|
+
return !1;
|
|
32
|
+
}
|
|
33
|
+
}, C = (r) => (i) => {
|
|
34
|
+
const n = i.value;
|
|
35
|
+
for (const e of r)
|
|
36
|
+
if (p(n, e.condition, e.value)) {
|
|
37
|
+
const c = {
|
|
38
|
+
color: e.color
|
|
39
|
+
};
|
|
40
|
+
return e.fontWeight && (c.fontWeight = e.fontWeight), e.backgroundColor && (c.backgroundColor = e.backgroundColor), c;
|
|
41
|
+
}
|
|
42
|
+
}, f = (r, i = {}) => {
|
|
43
|
+
const n = i.numericColumnHeaderAlignment ?? "right";
|
|
44
|
+
if ("children" in r && r.children)
|
|
45
|
+
return {
|
|
46
|
+
...r,
|
|
47
|
+
children: r.children.map((t) => f(t, i))
|
|
48
|
+
};
|
|
49
|
+
const e = { ...r };
|
|
50
|
+
if (d(e.valueFormatter)) {
|
|
51
|
+
const t = e.valueFormatter, o = l[t.type];
|
|
52
|
+
o ? (t.decimals !== void 0 && (e.decimals = t.decimals), t.divideBy !== void 0 && (e.divideBy = t.divideBy), t.symbol !== void 0 && (e.symbol = t.symbol), t.currency !== void 0 && (e.currency = t.currency), e.valueFormatter = o) : console.warn(`[processColDef] Unknown valueFormatter type: "${t.type}"`);
|
|
53
|
+
}
|
|
54
|
+
if (r.colorRules && r.colorRules.length > 0) {
|
|
55
|
+
const t = C(r.colorRules), o = e.cellStyle;
|
|
56
|
+
typeof o == "function" ? e.cellStyle = (s) => {
|
|
57
|
+
const u = o(s), a = t(s);
|
|
58
|
+
if (!(!u && !a))
|
|
59
|
+
return { ...u, ...a };
|
|
60
|
+
} : o ? e.cellStyle = (s) => ({
|
|
61
|
+
...o,
|
|
62
|
+
...t(s) || {}
|
|
63
|
+
}) : e.cellStyle = t, delete e.colorRules;
|
|
64
|
+
}
|
|
65
|
+
if (d(r.valueFormatter)) {
|
|
66
|
+
const { type: t, decimals: o } = r.valueFormatter;
|
|
67
|
+
if (t && v.includes(t) && !e.filterValueGetter) {
|
|
68
|
+
const s = o ?? g[t] ?? 0, u = Math.pow(10, s), a = r.field;
|
|
69
|
+
e.filterValueGetter = (y) => {
|
|
70
|
+
const m = y.data?.[a];
|
|
71
|
+
return m == null || isNaN(Number(m)) ? m : Math.round(Number(m) * u) / u;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const c = b(
|
|
76
|
+
e,
|
|
77
|
+
n
|
|
78
|
+
);
|
|
79
|
+
return Object.assign(e, c), !e.valueFormatter && (e.type === "numericColumn" || e.type === "number") && (e.valueFormatter = l.number), e;
|
|
80
|
+
}, N = (r, i = {}) => !r || r.length === 0 ? r : r.filter((n) => n != null).map((n) => f(n, i));
|
|
81
|
+
export {
|
|
82
|
+
N as processBackendColumnDefs,
|
|
83
|
+
f as processColDef
|
|
84
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
import { ColDef, ColGroupDef, GridApi, RowDragEndEvent, RowDragMoveEvent } from 'ag-grid-community';
|
|
2
|
+
import { ColDef, ColGroupDef, GridApi, RowDragCancelEvent, RowDragEndEvent, RowDragLeaveEvent, RowDragMoveEvent } from 'ag-grid-community';
|
|
3
3
|
import { AgGridReactProps } from 'ag-grid-react';
|
|
4
4
|
import { ListRowDropCheck, ListRowReorderMeta } from './list-row-move';
|
|
5
5
|
import { AgGridListHeaderMode, AgGridVisualVariant, AgGridWrapperProps } from './ag-grid.types';
|
|
@@ -14,6 +14,11 @@ export declare function useAgGridDragList<TData>(options: {
|
|
|
14
14
|
getRowDragHandleLabel?: AgGridWrapperProps<TData>['getRowDragHandleLabel'];
|
|
15
15
|
canDropRow?: (params: ListRowDropCheck<TData>) => boolean;
|
|
16
16
|
onRowReorder?: (meta: ListRowReorderMeta<TData>) => void;
|
|
17
|
+
onRowMoveBeyondEdge?: (meta: {
|
|
18
|
+
rowId: string;
|
|
19
|
+
direction: 'up' | 'down';
|
|
20
|
+
row: TData;
|
|
21
|
+
}) => void;
|
|
17
22
|
getRowStyle?: AgGridReactProps<TData>['getRowStyle'];
|
|
18
23
|
getRowId?: AgGridReactProps<TData>['getRowId'];
|
|
19
24
|
rowData?: TData[] | null;
|
|
@@ -21,6 +26,7 @@ export declare function useAgGridDragList<TData>(options: {
|
|
|
21
26
|
rowDragText?: AgGridReactProps<TData>['rowDragText'];
|
|
22
27
|
onRowDragEnter?: AgGridReactProps<TData>['onRowDragEnter'];
|
|
23
28
|
onRowDragMove?: AgGridReactProps<TData>['onRowDragMove'];
|
|
29
|
+
onRowDragLeave?: AgGridReactProps<TData>['onRowDragLeave'];
|
|
24
30
|
onRowDragCancel?: AgGridReactProps<TData>['onRowDragCancel'];
|
|
25
31
|
onRowDragEnd?: AgGridReactProps<TData>['onRowDragEnd'];
|
|
26
32
|
gridContainerRef: RefObject<HTMLDivElement | null>;
|
|
@@ -38,7 +44,8 @@ export declare function useAgGridDragList<TData>(options: {
|
|
|
38
44
|
getRowStyle: import('ag-grid-community').GetRowStyle<TData, any> | undefined;
|
|
39
45
|
onRowDragEnter: (event: import('ag-grid-community').RowDragEnterEvent<TData, any>) => void;
|
|
40
46
|
onRowDragMove: (event: RowDragMoveEvent<TData>) => void;
|
|
41
|
-
|
|
47
|
+
onRowDragLeave: (event: RowDragLeaveEvent<TData>) => void;
|
|
48
|
+
onRowDragCancel: (event: RowDragCancelEvent<TData>) => void;
|
|
42
49
|
onRowDragEnd: (event: RowDragEndEvent<TData>) => void;
|
|
43
50
|
} | {
|
|
44
51
|
getRowStyle: import('ag-grid-community').GetRowStyle<TData, any> | undefined;
|
|
@@ -48,6 +55,7 @@ export declare function useAgGridDragList<TData>(options: {
|
|
|
48
55
|
animateRows?: undefined;
|
|
49
56
|
onRowDragEnter?: undefined;
|
|
50
57
|
onRowDragMove?: undefined;
|
|
58
|
+
onRowDragLeave?: undefined;
|
|
51
59
|
onRowDragCancel?: undefined;
|
|
52
60
|
onRowDragEnd?: undefined;
|
|
53
61
|
} | null;
|