impact-nova 1.6.2 → 1.6.3
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/ui/accordion-nested-list/accordion-nested-list.js +7 -7
- package/dist/components/ui/accordion.d.ts +0 -1
- package/dist/components/ui/accordion.js +30 -33
- package/dist/components/ui/ag-grid-react/index.js +38 -35
- package/dist/components/ui/ag-grid-react/process-backend-columndefs.js +10 -10
- package/dist/components/ui/ag-grid-react/value-formatters.js +18 -18
- package/dist/components/ui/calendar.js +255 -247
- package/dist/components/ui/data-table/data-table.d.ts +0 -4
- package/dist/components/ui/data-table/data-table.js +94 -60
- package/dist/components/ui/date-picker/date-picker.js +90 -81
- package/dist/components/ui/date-picker/date-range-picker.js +144 -130
- package/dist/components/ui/date-picker/week-range-picker.js +157 -143
- package/dist/components/ui/filter-strip/filter-summary.js +161 -234
- package/dist/components/ui/filter-strip/filter-tag-list.js +97 -124
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +29 -29
- package/dist/components/ui/select/select.js +521 -493
- package/dist/components/ui/sheet.js +71 -94
- package/dist/impact-nova.css +1 -1
- package/package.json +1 -1
|
@@ -10,8 +10,8 @@ import { useImpactNovaI18n as Z } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
|
10
10
|
const ce = ({
|
|
11
11
|
sections: r,
|
|
12
12
|
onChange: u,
|
|
13
|
-
onSubmit:
|
|
14
|
-
onCancel:
|
|
13
|
+
onSubmit: m,
|
|
14
|
+
onCancel: h,
|
|
15
15
|
enableApplyDiscard: v = !0,
|
|
16
16
|
submitButtonLabel: A,
|
|
17
17
|
cancelButtonLabel: g,
|
|
@@ -39,10 +39,10 @@ const ce = ({
|
|
|
39
39
|
},
|
|
40
40
|
[u, f]
|
|
41
41
|
), _ = d(() => {
|
|
42
|
-
p(),
|
|
43
|
-
}, [l,
|
|
44
|
-
b(),
|
|
45
|
-
}, [b,
|
|
42
|
+
p(), m?.(l);
|
|
43
|
+
}, [l, m, p]), q = d(() => {
|
|
44
|
+
b(), h?.();
|
|
45
|
+
}, [b, h]), z = G(() => a ? c ? c(l) : !0 : !1, [a, c, l]);
|
|
46
46
|
return /* @__PURE__ */ i(
|
|
47
47
|
"div",
|
|
48
48
|
{
|
|
@@ -50,7 +50,7 @@ const ce = ({
|
|
|
50
50
|
"data-component": "accordion-nested-list",
|
|
51
51
|
"data-has-changes": a ? "" : void 0,
|
|
52
52
|
children: [
|
|
53
|
-
/* @__PURE__ */ t("div", { className: "flex-1 min-h-0 overflow-
|
|
53
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ t(
|
|
54
54
|
H,
|
|
55
55
|
{
|
|
56
56
|
type: n ? "multiple" : "single",
|
|
@@ -7,7 +7,6 @@ declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPr
|
|
|
7
7
|
rightActions?: React.ReactNode;
|
|
8
8
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
9
9
|
declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
-
/** Classes on the Radix content node (e.g. `overflow-visible` for portaled overlays). */
|
|
11
10
|
surfaceClassName?: string;
|
|
12
11
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
13
12
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -1,68 +1,65 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import * as c from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as o from "@radix-ui/react-accordion";
|
|
4
4
|
import { ChevronRight as f } from "lucide-react";
|
|
5
5
|
import { cn as n } from "../../lib/utils.js";
|
|
6
6
|
import { Tooltip as p, TooltipTrigger as g, TooltipContent as h } from "./tooltip.js";
|
|
7
7
|
import { useImpactNovaI18n as v } from "../../i18n/ImpactNovaI18nContext.js";
|
|
8
|
-
const C =
|
|
9
|
-
|
|
8
|
+
const C = o.Root, u = c.forwardRef(({ className: i, ...t }, a) => /* @__PURE__ */ e(
|
|
9
|
+
o.Item,
|
|
10
10
|
{
|
|
11
|
-
ref:
|
|
11
|
+
ref: a,
|
|
12
12
|
"data-item": t.value,
|
|
13
13
|
"data-disabled": t.disabled ? "" : void 0,
|
|
14
14
|
className: n(
|
|
15
|
-
"border-b rounded-lg bg-
|
|
16
|
-
|
|
15
|
+
"ia-accordion-item border-b rounded-lg bg-white border-b-[#D9DDE7]",
|
|
16
|
+
i
|
|
17
17
|
),
|
|
18
18
|
...t
|
|
19
19
|
}
|
|
20
20
|
));
|
|
21
|
-
|
|
22
|
-
const
|
|
21
|
+
u.displayName = "AccordionItem";
|
|
22
|
+
const x = c.forwardRef(({ className: i, children: t, badge: a, rightActions: s, ...d }, l) => {
|
|
23
23
|
const { t: m } = v();
|
|
24
|
-
return /* @__PURE__ */ e(
|
|
25
|
-
|
|
24
|
+
return /* @__PURE__ */ e(o.Header, { className: "flex", children: /* @__PURE__ */ r(
|
|
25
|
+
o.Trigger,
|
|
26
26
|
{
|
|
27
27
|
ref: l,
|
|
28
28
|
className: n(
|
|
29
|
-
"flex flex-1 items-center gap-3 px-4 py-2 text-sm font-semibold transition-all text-left [&[data-state=open]>div>svg]:-rotate-90",
|
|
30
|
-
|
|
29
|
+
"flex flex-1 items-center gap-3 px-4 py-2 text-sm font-semibold transition-all text-left [&[data-state=open]>div>svg]:-rotate-90 outline-none focus-visible:outline-none focus-visible:shadow-none",
|
|
30
|
+
i
|
|
31
31
|
),
|
|
32
|
-
...
|
|
32
|
+
...d,
|
|
33
33
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ r(p, { children: [
|
|
35
35
|
/* @__PURE__ */ e(g, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-8 w-8 shrink-0 rounded-lg bg-secondary text-secondary-foreground transition-transform duration-200", children: /* @__PURE__ */ e(f, { className: "h-4 w-4 transition-transform duration-200" }) }) }),
|
|
36
36
|
/* @__PURE__ */ e(h, { side: "top", variant: "tertiary", children: m("aria.toggle") })
|
|
37
37
|
] }),
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ r("div", { className: "flex flex-1 items-center justify-between", children: [
|
|
39
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
|
|
40
40
|
t,
|
|
41
|
-
|
|
41
|
+
a
|
|
42
42
|
] }),
|
|
43
|
-
|
|
43
|
+
s
|
|
44
44
|
] })
|
|
45
45
|
]
|
|
46
46
|
}
|
|
47
47
|
) });
|
|
48
48
|
});
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
49
|
+
x.displayName = o.Trigger.displayName;
|
|
50
|
+
const N = c.forwardRef(({ className: i, children: t, surfaceClassName: a, ...s }, d) => /* @__PURE__ */ e(
|
|
51
|
+
o.Content,
|
|
52
52
|
{
|
|
53
|
-
ref:
|
|
54
|
-
className: n(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
),
|
|
58
|
-
...d,
|
|
59
|
-
children: /* @__PURE__ */ e("div", { className: n("px-4 pb-4 pt-1", a), children: o })
|
|
53
|
+
ref: d,
|
|
54
|
+
className: n("overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down data-[state=open]:overflow-visible", a),
|
|
55
|
+
...s,
|
|
56
|
+
children: /* @__PURE__ */ e("div", { className: n("px-4 pb-4 pt-2", i), children: t })
|
|
60
57
|
}
|
|
61
58
|
));
|
|
62
|
-
|
|
59
|
+
N.displayName = o.Content.displayName;
|
|
63
60
|
export {
|
|
64
61
|
C as Accordion,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
N as AccordionContent,
|
|
63
|
+
u as AccordionItem,
|
|
64
|
+
x as AccordionTrigger
|
|
68
65
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { lazy as E, useRef as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { AllEnterpriseModule as
|
|
5
|
-
import { AgGridReact as
|
|
6
|
-
import { customAgGridTheme as
|
|
7
|
-
import { CustomHeader as
|
|
1
|
+
import { jsxs as k, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { lazy as E, useRef as L, useState as d, useCallback as h, useMemo as F, Suspense as V } from "react";
|
|
3
|
+
import { ModuleRegistry as W, AllCommunityModule as _, ValidationModule as $ } from "ag-grid-community";
|
|
4
|
+
import { AllEnterpriseModule as U } from "ag-grid-enterprise";
|
|
5
|
+
import { AgGridReact as w } from "ag-grid-react";
|
|
6
|
+
import { customAgGridTheme as z } from "./theme.js";
|
|
7
|
+
import { CustomHeader as J } from "./headers/custom-header.js";
|
|
8
8
|
import { CustomHeaderGroup as q } from "./headers/custom-header-group.js";
|
|
9
|
-
import { GridHeaderContext as
|
|
9
|
+
import { GridHeaderContext as B } from "./headers/context/grid-header-context.js";
|
|
10
10
|
import { convertToAgGridFilterModel as K, getMultiFilterIndices as Q, convertFromAgGridFilterModel as X } from "./headers/utils/filter-utils.js";
|
|
11
11
|
import { ColumnSettingsMenu as Y } from "./headers/column-menu/column-settings-menu.js";
|
|
12
12
|
import { AG_GRID_VALUE_FORMATTERS as Z } from "./value-formatters.js";
|
|
13
13
|
/* empty css */
|
|
14
14
|
const ee = E(() => import("./headers/advanced-filter/advanced-filter-dialog.js"));
|
|
15
|
-
|
|
15
|
+
W.registerModules([_, U, $]);
|
|
16
16
|
function ge({
|
|
17
17
|
children: i,
|
|
18
18
|
defaultColDef: n,
|
|
@@ -22,7 +22,7 @@ function ge({
|
|
|
22
22
|
onGridReady: s,
|
|
23
23
|
...o
|
|
24
24
|
}) {
|
|
25
|
-
const t =
|
|
25
|
+
const t = L(null), [u, M] = d(null), [v, A] = d(!1), [G, C] = d(null), [D, S] = d(!1), [y, b] = d(null), [I, x] = d(null), O = h((e) => {
|
|
26
26
|
if (!t.current) return;
|
|
27
27
|
const r = K(e);
|
|
28
28
|
t.current.setFilterModel(r), t.current.onFilterChanged();
|
|
@@ -47,39 +47,40 @@ function ge({
|
|
|
47
47
|
O(e);
|
|
48
48
|
},
|
|
49
49
|
openMenu: (e, r) => {
|
|
50
|
-
|
|
50
|
+
b(e), x(r), S(!0);
|
|
51
51
|
},
|
|
52
52
|
closeMenu: () => {
|
|
53
|
-
|
|
53
|
+
S(!1), b(null), x(null);
|
|
54
54
|
},
|
|
55
|
-
activeMenuColumnId:
|
|
56
|
-
}), [O,
|
|
55
|
+
activeMenuColumnId: y
|
|
56
|
+
}), [O, y]), R = h((e) => {
|
|
57
57
|
t.current = e.api, M(e.api), e.api.setGridOption("context", { activeSearchColumnId: null }), s && s(e);
|
|
58
|
-
}, [s]),
|
|
59
|
-
headerComponent:
|
|
58
|
+
}, [s]), N = F(() => ({
|
|
59
|
+
headerComponent: J,
|
|
60
60
|
...n,
|
|
61
61
|
headerComponentParams: {
|
|
62
62
|
...n?.headerComponentParams
|
|
63
63
|
}
|
|
64
|
-
}), [n]),
|
|
64
|
+
}), [n]), j = F(() => ({
|
|
65
65
|
headerGroupComponent: q,
|
|
66
66
|
...l,
|
|
67
67
|
headerGroupComponentParams: {
|
|
68
68
|
...l?.headerGroupComponentParams
|
|
69
69
|
}
|
|
70
|
-
}), [l]),
|
|
71
|
-
...o.components,
|
|
70
|
+
}), [l]), T = F(() => ({
|
|
72
71
|
...Z,
|
|
73
|
-
// Always available
|
|
72
|
+
// Always available - value formatters
|
|
73
|
+
...o.components,
|
|
74
|
+
// User components override
|
|
74
75
|
...c
|
|
75
76
|
// Optional custom formatters override defaults
|
|
76
|
-
}), [c, o.components]),
|
|
77
|
+
}), [c, o.components]), H = h((e) => {
|
|
77
78
|
if (e.value !== null && e.value !== void 0 && typeof e.value == "object") {
|
|
78
|
-
const r = Object.entries(e.value).map(([g, a]) => a && typeof a == "object" && "value" in a ?
|
|
79
|
-
return r.length > 0 ? r.join(" ") :
|
|
79
|
+
const r = Object.entries(e.value).map(([g, a]) => a && typeof a == "object" && "value" in a ? a.value : typeof a != "object" && typeof a < "u" ? a : null).filter((g) => g != null);
|
|
80
|
+
return r.length > 0 ? r.join(" ") : "";
|
|
80
81
|
}
|
|
81
82
|
return e.value;
|
|
82
|
-
}, []),
|
|
83
|
+
}, []), P = h((e) => {
|
|
83
84
|
if (typeof e.value == "string") {
|
|
84
85
|
const r = e.value.trim();
|
|
85
86
|
if (r.startsWith("{") || r.startsWith("["))
|
|
@@ -91,19 +92,21 @@ function ge({
|
|
|
91
92
|
}
|
|
92
93
|
return e.value;
|
|
93
94
|
}, []);
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
+
return /* @__PURE__ */ k(B.Provider, { value: f, children: [
|
|
95
96
|
/* @__PURE__ */ m(
|
|
96
|
-
|
|
97
|
+
w,
|
|
97
98
|
{
|
|
98
|
-
theme:
|
|
99
|
-
defaultColDef:
|
|
99
|
+
theme: z,
|
|
100
|
+
defaultColDef: N,
|
|
100
101
|
columnDefs: p,
|
|
101
102
|
cellSelection: !0,
|
|
102
|
-
defaultColGroupDef:
|
|
103
|
-
onGridReady:
|
|
104
|
-
components:
|
|
105
|
-
processCellForClipboard:
|
|
106
|
-
processCellFromClipboard:
|
|
103
|
+
defaultColGroupDef: j,
|
|
104
|
+
onGridReady: R,
|
|
105
|
+
components: T,
|
|
106
|
+
processCellForClipboard: H,
|
|
107
|
+
processCellFromClipboard: P,
|
|
108
|
+
ensureDomOrder: !0,
|
|
109
|
+
suppressGroupRowsSticky: !0,
|
|
107
110
|
columnTypes: {
|
|
108
111
|
numericColumn: {
|
|
109
112
|
cellClass: "ag-right-aligned-cell",
|
|
@@ -144,7 +147,7 @@ function ge({
|
|
|
144
147
|
re,
|
|
145
148
|
{
|
|
146
149
|
isOpen: D,
|
|
147
|
-
columnId:
|
|
150
|
+
columnId: y,
|
|
148
151
|
gridApi: u,
|
|
149
152
|
anchor: I,
|
|
150
153
|
onClose: f.closeMenu
|
|
@@ -163,7 +166,7 @@ function te({
|
|
|
163
166
|
const s = l.getColumn(n);
|
|
164
167
|
if (!s) return null;
|
|
165
168
|
const o = s.getColDef(), t = o.headerComponentParams, u = Q(o), M = u.text !== -1 || u.number !== -1 || u.date !== -1, v = u.set !== -1, G = o.filter === "agMultiColumnFilter" && (M || v) ? "multi" : o.filter === "agNumberColumnFilter" ? "number" : o.filter === "agDateColumnFilter" ? "date" : o.filter === "agSetColumnFilter" || t?.selectOptions ? "select" : "text", C = X(l.getFilterModel());
|
|
166
|
-
return /* @__PURE__ */ m(
|
|
169
|
+
return /* @__PURE__ */ m(V, { fallback: null, children: /* @__PURE__ */ m(
|
|
167
170
|
ee,
|
|
168
171
|
{
|
|
169
172
|
isOpen: i,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AG_GRID_VALUE_FORMATTERS as
|
|
2
|
-
const
|
|
1
|
+
import { AG_GRID_VALUE_FORMATTERS as a } from "./value-formatters.js";
|
|
2
|
+
const d = ["percentage", "currency", "currencySymbol", "number"], g = {
|
|
3
3
|
percentage: 2,
|
|
4
4
|
currencySymbol: 2,
|
|
5
5
|
currency: 2,
|
|
@@ -45,7 +45,7 @@ const m = ["percentage", "currency", "currencySymbol", "number"], g = {
|
|
|
45
45
|
};
|
|
46
46
|
const e = { ...t };
|
|
47
47
|
if (typeof e.valueFormatter == "object" && e.valueFormatter?.type) {
|
|
48
|
-
const r = e.valueFormatter, n =
|
|
48
|
+
const r = e.valueFormatter, n = a[r.type];
|
|
49
49
|
n ? e.valueFormatter = n : console.warn(`[processColDef] Unknown valueFormatter type: "${r.type}"`);
|
|
50
50
|
}
|
|
51
51
|
if (t.colorRules && t.colorRules.length > 0) {
|
|
@@ -60,17 +60,17 @@ const m = ["percentage", "currency", "currencySymbol", "number"], g = {
|
|
|
60
60
|
}
|
|
61
61
|
if (typeof t.valueFormatter == "object" && t.valueFormatter !== null) {
|
|
62
62
|
const r = t.valueFormatter, { type: n, decimals: o } = r;
|
|
63
|
-
if (n &&
|
|
64
|
-
const
|
|
65
|
-
e.filterValueGetter = (
|
|
66
|
-
const s =
|
|
63
|
+
if (n && d.includes(n) && !e.filterValueGetter) {
|
|
64
|
+
const l = o ?? g[n] ?? 0, i = Math.pow(10, l), u = t.field;
|
|
65
|
+
e.filterValueGetter = (m) => {
|
|
66
|
+
const s = m.data?.[u];
|
|
67
67
|
return s == null || isNaN(Number(s)) ? s : Math.round(Number(s) * i) / i;
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
return (e.type === "number" || e.type === "numericColumn" || e.type === "currency" || e.type === "percentage") && (e.headerClass = e.headerClass ? `${e.headerClass} ag-right-aligned-header` : "ag-right-aligned-header", e.cellClass = e.cellClass ? `${e.cellClass} ag-right-aligned-cell` : "ag-right-aligned-cell"), e;
|
|
72
|
-
},
|
|
71
|
+
return (e.type === "number" || e.type === "numericColumn" || e.type === "currency" || e.type === "percentage") && (e.headerClass = e.headerClass ? `${e.headerClass} ag-right-aligned-header` : "ag-right-aligned-header", e.cellClass = e.cellClass ? `${e.cellClass} ag-right-aligned-cell` : "ag-right-aligned-cell"), !e.valueFormatter && (e.type === "numericColumn" || e.type === "number") && (e.valueFormatter = a.number), e;
|
|
72
|
+
}, h = (t) => !t || t.length === 0 ? t : t.filter((e) => e != null).map((e) => c(e));
|
|
73
73
|
export {
|
|
74
|
-
|
|
74
|
+
h as processBackendColumnDefs,
|
|
75
75
|
c as processColDef
|
|
76
76
|
};
|
|
@@ -4,37 +4,37 @@ const a = (e) => e?.nullDisplay ?? "-", F = (e, n) => {
|
|
|
4
4
|
}, y = (e, n) => !n || n === "full_no" ? null : F(e, n), N = (e) => {
|
|
5
5
|
const n = e.colDef, t = typeof n.valueFormatter == "object" ? n.valueFormatter : n;
|
|
6
6
|
if (e.value == null) return t.nullDisplay ?? "-";
|
|
7
|
-
const o = t.currency || "USD",
|
|
8
|
-
if (isNaN(
|
|
9
|
-
const s = y(Math.abs(
|
|
7
|
+
const o = t.currency || "USD", c = t.locale || "en-US", r = e.context?.formatType || t.formatType, l = Number(e.value);
|
|
8
|
+
if (isNaN(l)) return String(e.value);
|
|
9
|
+
const s = y(Math.abs(l), r);
|
|
10
10
|
if (s) {
|
|
11
|
-
const u =
|
|
11
|
+
const u = l < 0 ? "-" : "", i = new Intl.NumberFormat(c, {
|
|
12
12
|
style: "currency",
|
|
13
13
|
currency: o
|
|
14
14
|
}).formatToParts(0).find((D) => D.type === "currency")?.value || o;
|
|
15
15
|
return `${u}${i}${s}`;
|
|
16
16
|
}
|
|
17
|
-
return new Intl.NumberFormat(
|
|
17
|
+
return new Intl.NumberFormat(c, {
|
|
18
18
|
style: "currency",
|
|
19
19
|
currency: o
|
|
20
|
-
}).format(
|
|
20
|
+
}).format(l);
|
|
21
21
|
}, d = (e) => {
|
|
22
22
|
const n = e.colDef, t = typeof n.valueFormatter == "object" ? n.valueFormatter : n;
|
|
23
23
|
if (e.value == null) return t.nullDisplay ?? "-";
|
|
24
|
-
const o = t.symbol || "$",
|
|
24
|
+
const o = t.symbol || "$", c = t.position || "prefix", r = t.decimals ?? 2, l = t.locale || "en-US", s = e.context?.formatType || t.formatType, u = Number(e.value);
|
|
25
25
|
if (isNaN(u)) return String(e.value);
|
|
26
26
|
const m = y(Math.abs(u), s);
|
|
27
27
|
let i;
|
|
28
|
-
return m ? i = `${u < 0 ? "-" : ""}${m}` : i = new Intl.NumberFormat(
|
|
28
|
+
return m ? i = `${u < 0 ? "-" : ""}${m}` : i = new Intl.NumberFormat(l, {
|
|
29
29
|
minimumFractionDigits: r,
|
|
30
30
|
maximumFractionDigits: r
|
|
31
|
-
}).format(u),
|
|
31
|
+
}).format(u), c === "prefix" ? `${o}${i}` : `${i}${o}`;
|
|
32
32
|
}, b = (e) => {
|
|
33
33
|
if (e.value == null) return a(e.colDef);
|
|
34
|
-
const n = e.colDef, t = n.decimals ?? 0, o = n.locale || "en-US",
|
|
34
|
+
const n = e.colDef, t = n.decimals ?? 0, o = n.locale || "en-US", c = e.context?.formatType || n.formatType, r = Number(e.value);
|
|
35
35
|
if (isNaN(r)) return String(e.value);
|
|
36
|
-
const
|
|
37
|
-
return
|
|
36
|
+
const l = y(Math.abs(r), c);
|
|
37
|
+
return l ? `${r < 0 ? "-" : ""}${l}` : new Intl.NumberFormat(o, {
|
|
38
38
|
minimumFractionDigits: t,
|
|
39
39
|
maximumFractionDigits: t
|
|
40
40
|
}).format(r);
|
|
@@ -50,7 +50,7 @@ const a = (e) => e?.nullDisplay ?? "-", F = (e, n) => {
|
|
|
50
50
|
if (e.value == null) return a(e.colDef);
|
|
51
51
|
const n = Number(e.value);
|
|
52
52
|
if (isNaN(n)) return String(e.value);
|
|
53
|
-
const t = e.colDef, o = t.decimals ?? 2,
|
|
53
|
+
const t = e.colDef, o = t.decimals ?? 2, c = t.divideBy ?? 100, r = n / c;
|
|
54
54
|
return new Intl.NumberFormat("en-US", {
|
|
55
55
|
style: "percent",
|
|
56
56
|
minimumFractionDigits: o,
|
|
@@ -58,14 +58,14 @@ const a = (e) => e?.nullDisplay ?? "-", F = (e, n) => {
|
|
|
58
58
|
}).format(r);
|
|
59
59
|
}, g = (e) => {
|
|
60
60
|
if (!e.value) return a(e.colDef);
|
|
61
|
-
const n = e.colDef, t = n.dateStyle || "medium", o = n.locale || "en-US",
|
|
62
|
-
return isNaN(
|
|
61
|
+
const n = e.colDef, t = n.dateStyle || "medium", o = n.locale || "en-US", c = new Date(e.value);
|
|
62
|
+
return isNaN(c.getTime()) ? String(e.value) : new Intl.DateTimeFormat(o, {
|
|
63
63
|
dateStyle: t
|
|
64
|
-
}).format(
|
|
64
|
+
}).format(c);
|
|
65
65
|
}, S = (e) => {
|
|
66
66
|
if (!e.value) return a(e.colDef);
|
|
67
|
-
const n = e.colDef, t = n.dateStyle || "medium", o = n.timeStyle || "short",
|
|
68
|
-
return isNaN(r.getTime()) ? String(e.value) : new Intl.DateTimeFormat(
|
|
67
|
+
const n = e.colDef, t = n.dateStyle || "medium", o = n.timeStyle || "short", c = n.locale || "en-US", r = new Date(e.value);
|
|
68
|
+
return isNaN(r.getTime()) ? String(e.value) : new Intl.DateTimeFormat(c, {
|
|
69
69
|
dateStyle: t,
|
|
70
70
|
timeStyle: o
|
|
71
71
|
}).format(r);
|