impact-nova 3.0.0-alpha.18 → 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 +6 -0
- 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 +307 -291
- 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 +6 -2
- package/dist/components/data/ag-grid-react/process-backend-columndefs.js +57 -51
- 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/primitives/tabs/tabs.js +64 -51
- package/dist/i18n/defaultMessages.d.ts +2 -0
- package/dist/i18n/defaultMessages.js +2 -0
- package/dist/i18n/locales/de.js +2 -0
- package/dist/i18n/locales/es.js +2 -0
- package/dist/i18n/locales/hi.js +2 -0
- package/dist/i18n/locales/kn.js +2 -0
- package/dist/impact-nova.css +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
*/
|
|
@@ -26,9 +30,9 @@ export interface BackendColDef extends Omit<ColDef, 'cellStyle'> {
|
|
|
26
30
|
*
|
|
27
31
|
* This is exported so it can be used for individual column processing or in other components.
|
|
28
32
|
*/
|
|
29
|
-
export declare const processColDef: (colDef: BackendColDef) => ColDef | ColGroupDef;
|
|
33
|
+
export declare const processColDef: (colDef: BackendColDef, options?: ProcessBackendColumnDefsOptions) => ColDef | ColGroupDef;
|
|
30
34
|
/**
|
|
31
35
|
* Processes a list of column definitions.
|
|
32
36
|
* Filters out invalid columns and applies transformation to each.
|
|
33
37
|
*/
|
|
34
|
-
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;
|
|
@@ -1,78 +1,84 @@
|
|
|
1
|
-
import { AG_GRID_VALUE_FORMATTERS as
|
|
2
|
-
import { isBackendValueFormatterObject as
|
|
3
|
-
|
|
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 = {
|
|
4
5
|
percentage: 2,
|
|
5
6
|
currencySymbol: 2,
|
|
6
7
|
currency: 2,
|
|
7
8
|
number: 0
|
|
8
|
-
},
|
|
9
|
-
if (
|
|
10
|
-
switch (
|
|
9
|
+
}, p = (r, i, n) => {
|
|
10
|
+
if (r == null) return !1;
|
|
11
|
+
switch (i) {
|
|
11
12
|
case ">":
|
|
12
|
-
return Number(
|
|
13
|
+
return Number(r) > Number(n);
|
|
13
14
|
case "<":
|
|
14
|
-
return Number(
|
|
15
|
+
return Number(r) < Number(n);
|
|
15
16
|
case ">=":
|
|
16
|
-
return Number(
|
|
17
|
+
return Number(r) >= Number(n);
|
|
17
18
|
case "<=":
|
|
18
|
-
return Number(
|
|
19
|
+
return Number(r) <= Number(n);
|
|
19
20
|
case "==":
|
|
20
|
-
return
|
|
21
|
+
return r == n;
|
|
21
22
|
case "!=":
|
|
22
|
-
return
|
|
23
|
+
return r != n;
|
|
23
24
|
case "contains":
|
|
24
|
-
return String(
|
|
25
|
+
return String(r).includes(String(n));
|
|
25
26
|
case "startsWith":
|
|
26
|
-
return String(
|
|
27
|
+
return String(r).startsWith(String(n));
|
|
27
28
|
case "endsWith":
|
|
28
|
-
return String(
|
|
29
|
+
return String(r).endsWith(String(n));
|
|
29
30
|
default:
|
|
30
31
|
return !1;
|
|
31
32
|
}
|
|
32
|
-
},
|
|
33
|
-
const
|
|
34
|
-
for (const
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
color:
|
|
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
|
|
38
39
|
};
|
|
39
|
-
return
|
|
40
|
+
return e.fontWeight && (c.fontWeight = e.fontWeight), e.backgroundColor && (c.backgroundColor = e.backgroundColor), c;
|
|
40
41
|
}
|
|
41
|
-
},
|
|
42
|
-
|
|
42
|
+
}, f = (r, i = {}) => {
|
|
43
|
+
const n = i.numericColumnHeaderAlignment ?? "right";
|
|
44
|
+
if ("children" in r && r.children)
|
|
43
45
|
return {
|
|
44
|
-
...
|
|
45
|
-
children:
|
|
46
|
+
...r,
|
|
47
|
+
children: r.children.map((t) => f(t, i))
|
|
46
48
|
};
|
|
47
|
-
const e = { ...
|
|
48
|
-
if (
|
|
49
|
-
const
|
|
50
|
-
|
|
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}"`);
|
|
51
53
|
}
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
typeof
|
|
55
|
-
const
|
|
56
|
-
if (!(!
|
|
57
|
-
return { ...
|
|
58
|
-
} :
|
|
59
|
-
...
|
|
60
|
-
...
|
|
61
|
-
}) : e.cellStyle =
|
|
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;
|
|
62
64
|
}
|
|
63
|
-
if (
|
|
64
|
-
const { type:
|
|
65
|
-
if (
|
|
66
|
-
const
|
|
67
|
-
e.filterValueGetter = (
|
|
68
|
-
const
|
|
69
|
-
return
|
|
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;
|
|
70
72
|
};
|
|
71
73
|
}
|
|
72
74
|
}
|
|
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));
|
|
75
81
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
N as processBackendColumnDefs,
|
|
83
|
+
f as processColDef
|
|
78
84
|
};
|