impact-nova 1.7.19 → 1.7.21
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/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +47 -55
- package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +5 -5
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +12 -12
- package/dist/components/ui/ag-grid-react/value-formatters.js +77 -69
- package/dist/components/ui/create-item-flow/create-item-flow.js +2 -2
- package/dist/components/ui/data-table/data-table-context.d.ts +1 -1
- package/dist/components/ui/data-table/data-table-format-options.js +4 -4
- package/dist/components/ui/data-table/data-table.js +1 -1
- package/dist/components/ui/header.d.ts +6 -1
- package/dist/components/ui/header.js +59 -41
- package/dist/components/ui/report-card/index.d.ts +1 -1
- package/dist/components/ui/report-card/index.js +6 -4
- package/dist/components/ui/report-card/report-card.d.ts +8 -5
- package/dist/components/ui/report-card/report-card.js +96 -55
- package/dist/i18n/defaultMessages.d.ts +1 -1
- package/dist/i18n/defaultMessages.js +7 -7
- package/dist/i18n/locales/de.js +1 -1
- package/dist/i18n/locales/es.js +1 -1
- package/dist/i18n/locales/hi.js +1 -1
- package/dist/i18n/locales/kn.js +1 -1
- package/dist/icons/assets/Product.svg.js +5 -0
- package/dist/icons/assets/report_1.svg.js +5 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +178 -174
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +329 -326
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as f, jsx as r, Fragment as U } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as R } from "react";
|
|
3
3
|
import { Dialog as W, DialogContent as X, DialogHeader as Y, DialogTitle as Z, DialogClose as _, DialogBody as I, DialogFooter as ee } from "../../../dialog.js";
|
|
4
4
|
import { Button as C } from "../../../button.js";
|
|
5
5
|
import { ButtonGroup as te } from "../../../button-group.js";
|
|
@@ -19,19 +19,19 @@ const B = (S) => {
|
|
|
19
19
|
columnId: s,
|
|
20
20
|
columnLabel: P,
|
|
21
21
|
columnType: v,
|
|
22
|
-
selectOptions:
|
|
22
|
+
selectOptions: A,
|
|
23
23
|
isMultiSelect: $,
|
|
24
24
|
initialModel: k,
|
|
25
25
|
api: h
|
|
26
26
|
// Add api to props
|
|
27
27
|
}) => {
|
|
28
|
-
const { t: d } = ne(),
|
|
29
|
-
const e = {}, n =
|
|
28
|
+
const { t: d } = ne(), E = () => (k?.rules || []).filter((e) => !("logic" in e)), [y, G] = R("column"), [x, O] = R(() => {
|
|
29
|
+
const e = {}, n = E(), t = B(n);
|
|
30
30
|
return Object.keys(t).forEach((a) => {
|
|
31
31
|
e[a] = k?.logic || "OR";
|
|
32
32
|
}), e[s] || (e[s] = "OR"), e;
|
|
33
|
-
}), [g,
|
|
34
|
-
const e =
|
|
33
|
+
}), [g, w] = R(() => {
|
|
34
|
+
const e = E();
|
|
35
35
|
if (h) {
|
|
36
36
|
const t = h.getFilterModel();
|
|
37
37
|
t && Object.keys(t).forEach((i) => {
|
|
@@ -63,7 +63,7 @@ const B = (S) => {
|
|
|
63
63
|
value: l.values
|
|
64
64
|
};
|
|
65
65
|
else if (l.filterType === "multi") {
|
|
66
|
-
const c = l.filterModels?.find((
|
|
66
|
+
const c = l.filterModels?.find((D) => D && D.filterType === "set");
|
|
67
67
|
c && (o = {
|
|
68
68
|
id: Math.random().toString(36).substr(2, 9),
|
|
69
69
|
columnId: i,
|
|
@@ -78,12 +78,12 @@ const B = (S) => {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
return e.some((t) => t.columnId === s) || e.push(N(s, v)), e;
|
|
81
|
-
}), [
|
|
81
|
+
}), [b] = R(() => ({
|
|
82
82
|
allRules: g,
|
|
83
83
|
// Use the computed rules (potentially synced)
|
|
84
|
-
columnLogic: { ...
|
|
85
|
-
})), J = JSON.stringify({ allRules: g, columnLogic:
|
|
86
|
-
|
|
84
|
+
columnLogic: { ...x }
|
|
85
|
+
})), J = JSON.stringify({ allRules: g, columnLogic: x }) !== JSON.stringify(b), T = (e) => g.filter((n) => n.columnId === e), F = (e, n) => {
|
|
86
|
+
w((t) => {
|
|
87
87
|
const a = /* @__PURE__ */ new Set(), i = [];
|
|
88
88
|
t.forEach((o) => {
|
|
89
89
|
a.has(o.columnId) || (a.add(o.columnId), i.push(o.columnId));
|
|
@@ -93,22 +93,22 @@ const B = (S) => {
|
|
|
93
93
|
o === e ? l.push(...n) : l.push(...t.filter((c) => c.columnId === o));
|
|
94
94
|
}), l;
|
|
95
95
|
});
|
|
96
|
-
},
|
|
96
|
+
}, L = (e) => x[e] || "OR", M = (e, n) => {
|
|
97
97
|
O((t) => ({ ...t, [e]: n }));
|
|
98
98
|
}, H = () => {
|
|
99
|
-
y === "column" ? (
|
|
99
|
+
y === "column" ? (F(s, [N(s, v)]), M(s, "OR")) : (w([N(s, v)]), O({ [s]: "OR" }));
|
|
100
100
|
}, V = () => {
|
|
101
|
-
|
|
101
|
+
w(b.allRules.length > 0 ? b.allRules : [N(s, v)]), O(b.columnLogic);
|
|
102
102
|
}, K = () => {
|
|
103
103
|
const e = g.filter((n) => n.operator === "empty" || n.operator === "notEmpty" ? !!n.columnId : n.columnId && n.value !== "" && n.value !== null);
|
|
104
104
|
if (e.length === 0)
|
|
105
105
|
m(null);
|
|
106
106
|
else {
|
|
107
107
|
const n = e[0].columnId;
|
|
108
|
-
m({ logic:
|
|
108
|
+
m({ logic: L(n), rules: e });
|
|
109
109
|
}
|
|
110
110
|
u();
|
|
111
|
-
}, Q = B(g),
|
|
111
|
+
}, Q = B(g), j = Object.keys(Q), q = (e, n) => {
|
|
112
112
|
if (!h) return n;
|
|
113
113
|
const t = h.getColumn(e);
|
|
114
114
|
if (!t) return n;
|
|
@@ -125,16 +125,18 @@ const B = (S) => {
|
|
|
125
125
|
(console.log("[AdvancedFilterDialog] Current State:", {
|
|
126
126
|
mode: y,
|
|
127
127
|
allRules: g,
|
|
128
|
-
columnLogic:
|
|
129
|
-
activeColumns:
|
|
128
|
+
columnLogic: x,
|
|
129
|
+
activeColumns: j
|
|
130
130
|
}), null),
|
|
131
|
-
/* @__PURE__ */ f(X, { className: "w-[
|
|
132
|
-
/* @__PURE__ */ f(Y, { className: "flex flex-row items-center
|
|
131
|
+
/* @__PURE__ */ f(X, { className: "w-[800px] max-w-[95vw] max-h-[90vh] flex flex-col p-0", hideClose: !0, children: [
|
|
132
|
+
/* @__PURE__ */ f(Y, { className: "flex flex-row items-center justify-between px-4 py-3", children: [
|
|
133
133
|
/* @__PURE__ */ r(Z, { children: d("advancedFilter.title") }),
|
|
134
|
-
/* @__PURE__ */ r("
|
|
134
|
+
/* @__PURE__ */ r(_, { asChild: !0, children: /* @__PURE__ */ r(C, { variant: "ghost", size: "icon", className: "h-8 w-8 p-0 text-content-tertiary hover:text-brand-variant-hover", onClick: u, "aria-label": d("aria.close"), children: /* @__PURE__ */ r(le, { size: 14 }) }) })
|
|
135
|
+
] }),
|
|
136
|
+
/* @__PURE__ */ f("div", { className: "flex items-center justify-between px-4 py-4 pb-2", children: [
|
|
137
|
+
/* @__PURE__ */ f(
|
|
135
138
|
te,
|
|
136
139
|
{
|
|
137
|
-
className: "",
|
|
138
140
|
value: y,
|
|
139
141
|
onValueChange: (e) => G(e),
|
|
140
142
|
children: [
|
|
@@ -142,10 +144,10 @@ const B = (S) => {
|
|
|
142
144
|
/* @__PURE__ */ r(C, { value: "global", size: "md", children: d("advancedFilter.allFilters") })
|
|
143
145
|
]
|
|
144
146
|
}
|
|
145
|
-
)
|
|
146
|
-
/* @__PURE__ */ r(
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ r(C, { variant: "ghost", onClick: H, className: "!text-brand", children: d("advancedFilter.clearAll") })
|
|
147
149
|
] }),
|
|
148
|
-
/* @__PURE__ */ r(I, { className: "px-0 py-4
|
|
150
|
+
/* @__PURE__ */ r(I, { className: "px-0 py-4 flex-1 overflow-y-auto min-h-0", children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-6 w-full px-4", children: y === "column" ? (
|
|
149
151
|
// Column Mode: Single column section
|
|
150
152
|
/* @__PURE__ */ r(
|
|
151
153
|
z,
|
|
@@ -153,17 +155,17 @@ const B = (S) => {
|
|
|
153
155
|
columnId: s,
|
|
154
156
|
columnLabel: q(s, P),
|
|
155
157
|
columnType: v,
|
|
156
|
-
selectOptions:
|
|
157
|
-
isMultiSelect:
|
|
158
|
-
rules:
|
|
159
|
-
logic:
|
|
160
|
-
onLogicChange: (e) =>
|
|
161
|
-
onRulesChange: (e) =>
|
|
158
|
+
selectOptions: A,
|
|
159
|
+
isMultiSelect: A ? !!$ : !0,
|
|
160
|
+
rules: T(s),
|
|
161
|
+
logic: L(s),
|
|
162
|
+
onLogicChange: (e) => M(s, e),
|
|
163
|
+
onRulesChange: (e) => F(s, e)
|
|
162
164
|
}
|
|
163
165
|
)
|
|
164
166
|
) : (
|
|
165
167
|
// Global Mode: All columns with filters
|
|
166
|
-
/* @__PURE__ */ r(U, { children:
|
|
168
|
+
/* @__PURE__ */ r(U, { children: j.length === 0 ? /* @__PURE__ */ r("div", { className: "text-center py-8 text-content-placeholder", children: d("advancedFilter.noFiltersApplied") }) : j.map((e, n) => {
|
|
167
169
|
let t = null;
|
|
168
170
|
if (h) {
|
|
169
171
|
const p = h.getColumn(e);
|
|
@@ -171,7 +173,7 @@ const B = (S) => {
|
|
|
171
173
|
}
|
|
172
174
|
const a = t?.headerComponentParams, i = t?.headerName || e, l = q(e, i), o = t?.filter === "agNumberColumnFilter" ? "number" : t?.filter === "agDateColumnFilter" ? "date" : t?.filter === "agMultiColumnFilter" ? "multi" : t?.filter === "agSetColumnFilter" || a?.selectOptions ? "select" : "text";
|
|
173
175
|
console.log(`[AdvancedFilterDialog] Column: ${e}, Type: ${o}, Filter: ${t?.filter}`);
|
|
174
|
-
const c = a?.selectOptions,
|
|
176
|
+
const c = a?.selectOptions, D = a?.isMultiSelect;
|
|
175
177
|
return /* @__PURE__ */ f("div", { children: [
|
|
176
178
|
n > 0 && /* @__PURE__ */ r("hr", { className: "border-stroke-hairline mb-6" }),
|
|
177
179
|
/* @__PURE__ */ r(
|
|
@@ -181,40 +183,30 @@ const B = (S) => {
|
|
|
181
183
|
columnLabel: l,
|
|
182
184
|
columnType: o,
|
|
183
185
|
selectOptions: c,
|
|
184
|
-
isMultiSelect:
|
|
185
|
-
rules:
|
|
186
|
-
logic:
|
|
187
|
-
onLogicChange: (p) =>
|
|
188
|
-
onRulesChange: (p) =>
|
|
186
|
+
isMultiSelect: D,
|
|
187
|
+
rules: T(e),
|
|
188
|
+
logic: L(e),
|
|
189
|
+
onLogicChange: (p) => M(e, p),
|
|
190
|
+
onRulesChange: (p) => F(e, p),
|
|
189
191
|
canDeleteLastRule: !0,
|
|
190
|
-
onDeleteColumnFilter: () =>
|
|
192
|
+
onDeleteColumnFilter: () => F(e, [])
|
|
191
193
|
}
|
|
192
194
|
)
|
|
193
195
|
] }, e);
|
|
194
196
|
}) })
|
|
195
197
|
) }) }),
|
|
196
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ r(ee, { className: "flex justify-end border-t border-[#D9DDE7]", children: /* @__PURE__ */ f("div", { className: "flex gap-3", children: [
|
|
197
199
|
/* @__PURE__ */ r(
|
|
198
200
|
C,
|
|
199
201
|
{
|
|
200
|
-
onClick:
|
|
202
|
+
onClick: V,
|
|
201
203
|
variant: "secondary",
|
|
202
|
-
|
|
204
|
+
disabled: !J,
|
|
205
|
+
children: d("advancedFilter.discard")
|
|
203
206
|
}
|
|
204
207
|
),
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
|
|
207
|
-
C,
|
|
208
|
-
{
|
|
209
|
-
onClick: V,
|
|
210
|
-
variant: "outline",
|
|
211
|
-
disabled: !J,
|
|
212
|
-
children: d("advancedFilter.discard")
|
|
213
|
-
}
|
|
214
|
-
),
|
|
215
|
-
/* @__PURE__ */ r(C, { onClick: K, variant: "default", children: d("advancedFilter.apply") })
|
|
216
|
-
] })
|
|
217
|
-
] })
|
|
208
|
+
/* @__PURE__ */ r(C, { onClick: K, variant: "default", children: d("advancedFilter.apply") })
|
|
209
|
+
] }) })
|
|
218
210
|
] })
|
|
219
211
|
] });
|
|
220
212
|
};
|
|
@@ -5,13 +5,13 @@ import { HeaderInfo as f } from "./components/header-info.js";
|
|
|
5
5
|
import { TruncatedText as u } from "./components/truncated-text.js";
|
|
6
6
|
const y = (t) => {
|
|
7
7
|
const {
|
|
8
|
-
displayName:
|
|
8
|
+
displayName: i,
|
|
9
9
|
showInfoIcon: c = !1,
|
|
10
10
|
columnGroup: e,
|
|
11
11
|
setExpanded: n
|
|
12
|
-
} = t, o = e ? e.isExpanded() : !1, r = e ? e.isExpandable() : !1, d = (
|
|
13
|
-
|
|
14
|
-
}, s =
|
|
12
|
+
} = t, o = e ? e.isExpanded() : !1, r = e ? e.isExpandable() : !1, d = (l) => {
|
|
13
|
+
l && l.stopPropagation(), n && e && n(!o);
|
|
14
|
+
}, s = i || "";
|
|
15
15
|
return !s && c === !1 ? null : /* @__PURE__ */ p(
|
|
16
16
|
"div",
|
|
17
17
|
{
|
|
@@ -23,7 +23,7 @@ const y = (t) => {
|
|
|
23
23
|
u,
|
|
24
24
|
{
|
|
25
25
|
text: s,
|
|
26
|
-
className: "ag-header-group-text font-
|
|
26
|
+
className: "ag-header-group-text font-bold text-content"
|
|
27
27
|
}
|
|
28
28
|
),
|
|
29
29
|
/* @__PURE__ */ a(f, { ...t, className: "ml-1" }),
|
|
@@ -116,9 +116,9 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
|
|
|
116
116
|
enableSpaceSplitting: B,
|
|
117
117
|
enableBooleanParsing: E,
|
|
118
118
|
enableDateParsing: R
|
|
119
|
-
} = r, d = Q(), { t: N } = V(), n = s.getColDef(),
|
|
119
|
+
} = r, d = Q(), { t: N } = V(), n = s.getColDef(), p = s.getColId(), k = s.isFilterActive(), j = s.getSort(), y = s.getSortIndex(), O = !!j, z = y != null && (y > 0 || a.getColumnState().filter((o) => o.sort).length > 1), G = O && z, I = n?.filter || "agTextColumnFilter", v = I === "agNumberColumnFilter" || (Array.isArray(n?.type) ? n.type.some((o) => o === "number" || o === "numericColumn") : n?.type === "number" || n?.type === "numericColumn");
|
|
120
120
|
I === "agDateColumnFilter" || (Array.isArray(n?.type) ? n.type.includes("dateColumn") : n?.type);
|
|
121
|
-
const L = a.getGridOption("context")?.activeSearchColumnId ===
|
|
121
|
+
const L = a.getGridOption("context")?.activeSearchColumnId === p, M = ![
|
|
122
122
|
"agTextColumnFilter",
|
|
123
123
|
"agNumberColumnFilter",
|
|
124
124
|
"agDateColumnFilter",
|
|
@@ -132,10 +132,10 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
|
|
|
132
132
|
o.stopPropagation(), C && S && S(o.shiftKey);
|
|
133
133
|
}, U = (o) => {
|
|
134
134
|
if (o.stopPropagation(), u && u(r), M) {
|
|
135
|
-
a.showColumnFilter ? a.showColumnFilter(
|
|
135
|
+
a.showColumnFilter ? a.showColumnFilter(p) : a.showColumnMenu(p);
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
|
-
d && (L ? d.closeSearch() : d.openSearch(
|
|
138
|
+
d && (L ? d.closeSearch() : d.openSearch(p));
|
|
139
139
|
}, K = (o) => /* @__PURE__ */ e("span", { onClick: (q) => q.stopPropagation(), children: /* @__PURE__ */ e(
|
|
140
140
|
W,
|
|
141
141
|
{
|
|
@@ -169,7 +169,7 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
|
|
|
169
169
|
{
|
|
170
170
|
className: g(
|
|
171
171
|
"ag-header-cell-label flex items-center w-full group min-w-0 h-full",
|
|
172
|
-
|
|
172
|
+
v ? "flex-row-reverse" : "flex-row",
|
|
173
173
|
// Center the content area if it's a selection column
|
|
174
174
|
n?.headerCheckboxSelection && (!t || t.trim() === "") ? "justify-center" : ""
|
|
175
175
|
),
|
|
@@ -181,17 +181,17 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
|
|
|
181
181
|
className: g(
|
|
182
182
|
"ag-header-cell-text relative group flex min-w-0",
|
|
183
183
|
// Use items-start for non-numeric to allow 2-line text expansion
|
|
184
|
-
|
|
184
|
+
v ? "items-center" : "items-start",
|
|
185
185
|
// Remove flex-1 if we are centering via parent's justify-center
|
|
186
186
|
!(n?.headerCheckboxSelection && (!t || t.trim() === "")) && "flex-1",
|
|
187
|
-
|
|
187
|
+
v ? "flex-row-reverse" : "flex-row",
|
|
188
188
|
C ? "sortable cursor-pointer" : ""
|
|
189
189
|
),
|
|
190
190
|
onClick: C ? F : void 0,
|
|
191
191
|
children: /* @__PURE__ */ h("div", { className: g(
|
|
192
192
|
"flex min-w-0",
|
|
193
193
|
// Use items-start for non-numeric to allow 2-line text expansion
|
|
194
|
-
|
|
194
|
+
v ? "flex-row-reverse items-center" : "flex-row items-start",
|
|
195
195
|
// If it's a checkbox-only header, ensure it shrinks to content for centering
|
|
196
196
|
n?.headerCheckboxSelection && (!t || t.trim() === "") ? "justify-center items-center" : "gap-1 flex-1"
|
|
197
197
|
), children: [
|
|
@@ -199,7 +199,7 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
|
|
|
199
199
|
t && t.trim() !== "" && t !== N("gridHeader.selection") && /* @__PURE__ */ e(Y, { text: t }),
|
|
200
200
|
t && t.trim() !== "" && K(g(
|
|
201
201
|
"text-content-tertiary hover:text-brand-variant-hover transition-colors",
|
|
202
|
-
|
|
202
|
+
v ? "mr-1" : "ml-1"
|
|
203
203
|
))
|
|
204
204
|
] })
|
|
205
205
|
}
|
|
@@ -209,7 +209,7 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
|
|
|
209
209
|
{
|
|
210
210
|
className: g(
|
|
211
211
|
"flex items-center shrink-0 group gap-1",
|
|
212
|
-
|
|
212
|
+
v ? "flex-row-reverse" : "flex-row"
|
|
213
213
|
),
|
|
214
214
|
children: [
|
|
215
215
|
C && /* @__PURE__ */ h(
|
|
@@ -243,10 +243,10 @@ const ee = () => /* @__PURE__ */ h(T, { children: [
|
|
|
243
243
|
{
|
|
244
244
|
className: g(
|
|
245
245
|
"custom-ag-menu-icon-button cursor-pointer flex items-center shrink-0 overflow-hidden transition-colors duration-200 outline-none focus:outline-none focus:ring-0 text-content-tertiary hover:text-brand-variant-hover",
|
|
246
|
-
d?.activeMenuColumnId ===
|
|
246
|
+
d?.activeMenuColumnId === p ? "opacity-100 w-auto" : "w-0 opacity-0 group-hover:w-auto group-hover:opacity-100"
|
|
247
247
|
),
|
|
248
248
|
onClick: (o) => {
|
|
249
|
-
o.stopPropagation(), d && d.openMenu(
|
|
249
|
+
o.stopPropagation(), d && d.openMenu(p, o.currentTarget);
|
|
250
250
|
},
|
|
251
251
|
children: /* @__PURE__ */ e("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ e("path", { d: "M14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18ZM14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12ZM14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6Z", fill: "currentColor" }) })
|
|
252
252
|
}
|
|
@@ -1,94 +1,102 @@
|
|
|
1
|
-
const a = (
|
|
2
|
-
let
|
|
3
|
-
return n === "bil" ? (
|
|
4
|
-
}, y = (
|
|
5
|
-
const n =
|
|
6
|
-
if (
|
|
7
|
-
const o =
|
|
8
|
-
if (isNaN(
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
const
|
|
1
|
+
const a = (t) => t?.nullDisplay ?? "-", D = (t, n) => {
|
|
2
|
+
let e, o;
|
|
3
|
+
return n === "bil" ? (e = t / 1e9, o = "B") : n === "mil" ? (e = t / 1e6, o = "M") : (e = t / 1e3, o = "K"), isNaN(e) || !isFinite(e) ? `0.0${o}` : e.toFixed(1) + o;
|
|
4
|
+
}, y = (t, n) => !n || n === "full_no" || n === "full_precision" ? null : D(t, n), g = (t) => {
|
|
5
|
+
const n = t.colDef, e = typeof n.valueFormatter == "object" ? n.valueFormatter : n;
|
|
6
|
+
if (t.value == null) return e.nullDisplay ?? "-";
|
|
7
|
+
const o = e.currency || "USD", i = e.locale || "en-US", r = t.context?.formatType || e.formatType, c = Number(t.value);
|
|
8
|
+
if (isNaN(c)) return String(t.value);
|
|
9
|
+
const m = y(Math.abs(c), r);
|
|
10
|
+
if (m) {
|
|
11
|
+
const l = c < 0 ? "-" : "", u = new Intl.NumberFormat(i, {
|
|
12
12
|
style: "currency",
|
|
13
13
|
currency: o
|
|
14
|
-
}).formatToParts(0).find((
|
|
15
|
-
return `${
|
|
14
|
+
}).formatToParts(0).find((s) => s.type === "currency")?.value || o;
|
|
15
|
+
return `${l}${u}${m}`;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
if (r === "full_precision") {
|
|
18
|
+
const l = c < 0 ? "-" : "", u = new Intl.NumberFormat(i, { style: "currency", currency: o }).formatToParts(0).find((s) => s.type === "currency")?.value || o;
|
|
19
|
+
return `${l}${u}${new Intl.NumberFormat(i, { minimumFractionDigits: 2, maximumFractionDigits: 20 }).format(Math.abs(c))}`;
|
|
20
|
+
}
|
|
21
|
+
return new Intl.NumberFormat(i, {
|
|
18
22
|
style: "currency",
|
|
19
23
|
currency: o
|
|
20
|
-
}).format(
|
|
21
|
-
},
|
|
22
|
-
const n =
|
|
23
|
-
if (
|
|
24
|
-
const o =
|
|
25
|
-
if (isNaN(
|
|
26
|
-
const
|
|
27
|
-
let
|
|
28
|
-
return
|
|
24
|
+
}).format(c);
|
|
25
|
+
}, b = (t) => {
|
|
26
|
+
const n = t.colDef, e = typeof n.valueFormatter == "object" ? n.valueFormatter : n;
|
|
27
|
+
if (t.value == null) return e.nullDisplay ?? "-";
|
|
28
|
+
const o = e.symbol || "$", i = e.position || "prefix", r = e.decimals ?? 2, c = e.locale || "en-US", m = t.context?.formatType || e.formatType, l = Number(t.value);
|
|
29
|
+
if (isNaN(l)) return String(t.value);
|
|
30
|
+
const f = y(Math.abs(l), m);
|
|
31
|
+
let u;
|
|
32
|
+
return f ? u = `${l < 0 ? "-" : ""}${f}` : m === "full_precision" ? u = `${l < 0 ? "-" : ""}${new Intl.NumberFormat(c, { minimumFractionDigits: r, maximumFractionDigits: 20 }).format(Math.abs(l))}` : u = new Intl.NumberFormat(c, {
|
|
29
33
|
minimumFractionDigits: r,
|
|
30
34
|
maximumFractionDigits: r
|
|
31
|
-
}).format(
|
|
32
|
-
},
|
|
33
|
-
if (
|
|
34
|
-
const n =
|
|
35
|
-
if (isNaN(r)) return String(
|
|
36
|
-
const
|
|
37
|
-
return
|
|
38
|
-
minimumFractionDigits:
|
|
39
|
-
maximumFractionDigits:
|
|
35
|
+
}).format(l), i === "prefix" ? `${o}${u}` : `${u}${o}`;
|
|
36
|
+
}, N = (t) => {
|
|
37
|
+
if (t.value == null) return a(t.colDef);
|
|
38
|
+
const n = t.colDef, e = n.decimals ?? 0, o = n.locale || "en-US", i = t.context?.formatType || n.formatType, r = Number(t.value);
|
|
39
|
+
if (isNaN(r)) return String(t.value);
|
|
40
|
+
const c = y(Math.abs(r), i);
|
|
41
|
+
return c ? `${r < 0 ? "-" : ""}${c}` : i === "full_precision" ? `${r < 0 ? "-" : ""}${new Intl.NumberFormat(o, { minimumFractionDigits: e, maximumFractionDigits: 20 }).format(Math.abs(r))}` : new Intl.NumberFormat(o, {
|
|
42
|
+
minimumFractionDigits: e,
|
|
43
|
+
maximumFractionDigits: e
|
|
40
44
|
}).format(r);
|
|
41
|
-
},
|
|
42
|
-
if (
|
|
43
|
-
const n = Number(
|
|
44
|
-
if (isNaN(n)) return String(
|
|
45
|
-
const
|
|
46
|
-
return
|
|
45
|
+
}, F = (t) => {
|
|
46
|
+
if (t.value == null) return a(t.colDef);
|
|
47
|
+
const n = Number(t.value);
|
|
48
|
+
if (isNaN(n)) return String(t.value);
|
|
49
|
+
const e = Math.abs(n), o = n < 0 ? "-" : "";
|
|
50
|
+
return e >= 1e9 ? `${o}${(e / 1e9).toFixed(1)}B` : e >= 1e6 ? `${o}${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${o}${(e / 1e3).toFixed(1)}K` : new Intl.NumberFormat("en-US", {
|
|
47
51
|
maximumFractionDigits: 2
|
|
48
52
|
}).format(n);
|
|
49
|
-
},
|
|
50
|
-
if (
|
|
51
|
-
const n = Number(
|
|
52
|
-
if (isNaN(n)) return String(
|
|
53
|
-
const
|
|
54
|
-
return new Intl.NumberFormat("en-US", {
|
|
53
|
+
}, d = (t) => {
|
|
54
|
+
if (t.value == null) return a(t.colDef);
|
|
55
|
+
const n = Number(t.value);
|
|
56
|
+
if (isNaN(n)) return String(t.value);
|
|
57
|
+
const e = t.colDef, o = e.decimals ?? 2, i = e.divideBy ?? 100, r = t.context?.formatType || e.formatType, c = n / i;
|
|
58
|
+
return r === "full_precision" ? new Intl.NumberFormat("en-US", {
|
|
59
|
+
style: "percent",
|
|
60
|
+
minimumFractionDigits: 2,
|
|
61
|
+
maximumFractionDigits: 20
|
|
62
|
+
}).format(c) : new Intl.NumberFormat("en-US", {
|
|
55
63
|
style: "percent",
|
|
56
64
|
minimumFractionDigits: o,
|
|
57
65
|
maximumFractionDigits: o
|
|
58
|
-
}).format(r);
|
|
59
|
-
}, g = (e) => {
|
|
60
|
-
if (!e.value) return a(e.colDef);
|
|
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
|
-
dateStyle: t
|
|
64
66
|
}).format(c);
|
|
65
|
-
},
|
|
66
|
-
if (!
|
|
67
|
-
const n =
|
|
68
|
-
return isNaN(
|
|
69
|
-
dateStyle:
|
|
67
|
+
}, v = (t) => {
|
|
68
|
+
if (!t.value) return a(t.colDef);
|
|
69
|
+
const n = t.colDef, e = n.dateStyle || "medium", o = n.locale || "en-US", i = new Date(t.value);
|
|
70
|
+
return isNaN(i.getTime()) ? String(t.value) : new Intl.DateTimeFormat(o, {
|
|
71
|
+
dateStyle: e
|
|
72
|
+
}).format(i);
|
|
73
|
+
}, $ = (t) => {
|
|
74
|
+
if (!t.value) return a(t.colDef);
|
|
75
|
+
const n = t.colDef, e = n.dateStyle || "medium", o = n.timeStyle || "short", i = n.locale || "en-US", r = new Date(t.value);
|
|
76
|
+
return isNaN(r.getTime()) ? String(t.value) : new Intl.DateTimeFormat(i, {
|
|
77
|
+
dateStyle: e,
|
|
70
78
|
timeStyle: o
|
|
71
79
|
}).format(r);
|
|
72
|
-
},
|
|
73
|
-
if (
|
|
74
|
-
const n =
|
|
75
|
-
return
|
|
80
|
+
}, S = (t) => {
|
|
81
|
+
if (t.value == null) return a(t.colDef);
|
|
82
|
+
const n = t.colDef, e = n.trueValue || "Yes", o = n.falseValue || "No";
|
|
83
|
+
return t.value ? e : o;
|
|
76
84
|
}, x = {
|
|
77
85
|
// Currency formatters
|
|
78
|
-
currency:
|
|
79
|
-
currencySymbol:
|
|
86
|
+
currency: g,
|
|
87
|
+
currencySymbol: b,
|
|
80
88
|
// Number formatters
|
|
81
|
-
number:
|
|
82
|
-
compact:
|
|
83
|
-
compactNumber:
|
|
84
|
-
largeNumber:
|
|
89
|
+
number: N,
|
|
90
|
+
compact: F,
|
|
91
|
+
compactNumber: F,
|
|
92
|
+
largeNumber: F,
|
|
85
93
|
// Percentage formatter
|
|
86
|
-
percentage:
|
|
94
|
+
percentage: d,
|
|
87
95
|
// Date formatters
|
|
88
|
-
date:
|
|
89
|
-
dateTime:
|
|
96
|
+
date: v,
|
|
97
|
+
dateTime: $,
|
|
90
98
|
// Boolean formatter
|
|
91
|
-
boolean:
|
|
99
|
+
boolean: S
|
|
92
100
|
};
|
|
93
101
|
export {
|
|
94
102
|
x as AG_GRID_VALUE_FORMATTERS
|
|
@@ -220,7 +220,7 @@ const K = n.forwardRef(
|
|
|
220
220
|
"div",
|
|
221
221
|
{
|
|
222
222
|
ref: c,
|
|
223
|
-
className: r("flex items-center justify-between mt-auto shrink-0 pb-[27px]", t),
|
|
223
|
+
className: r("flex items-center justify-between mt-auto shrink-0 pt-6 pb-[27px]", t),
|
|
224
224
|
"data-slot": "actions",
|
|
225
225
|
...m,
|
|
226
226
|
children: e
|
|
@@ -229,7 +229,7 @@ const K = n.forwardRef(
|
|
|
229
229
|
"div",
|
|
230
230
|
{
|
|
231
231
|
ref: c,
|
|
232
|
-
className: r("flex items-center justify-between mt-auto shrink-0 pb-[27px]", t),
|
|
232
|
+
className: r("flex items-center justify-between mt-auto shrink-0 pt-6 pb-[27px]", t),
|
|
233
233
|
"data-slot": "actions",
|
|
234
234
|
...m,
|
|
235
235
|
children: [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GridApi } from 'ag-grid-community';
|
|
2
2
|
export type DataTableFontSize = 'small' | 'medium' | 'large';
|
|
3
|
-
export type DataTableNumericFormat = 'full' | 'k' | 'm' | 'b' | '
|
|
3
|
+
export type DataTableNumericFormat = 'full' | 'k' | 'm' | 'b' | 'full_precision';
|
|
4
4
|
export type DataTableRowHeight = 'default' | 'compact' | 'comfort';
|
|
5
5
|
export interface DataTableContextValue {
|
|
6
6
|
gridApi: GridApi | null;
|
|
@@ -3,9 +3,9 @@ import "react";
|
|
|
3
3
|
import { useDataTable as d } from "./data-table-context.js";
|
|
4
4
|
import { RadioGroup as i, RadioGroupItem as l } from "../radio-group.js";
|
|
5
5
|
import { Label as n } from "../label.js";
|
|
6
|
-
import { useImpactNovaI18n as
|
|
6
|
+
import { useImpactNovaI18n as u } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
7
7
|
const b = () => {
|
|
8
|
-
const { t: a } =
|
|
8
|
+
const { t: a } = u(), {
|
|
9
9
|
fontSize: c,
|
|
10
10
|
setFontSize: o,
|
|
11
11
|
numericFormat: m,
|
|
@@ -65,8 +65,8 @@ const b = () => {
|
|
|
65
65
|
/* @__PURE__ */ e(n, { htmlFor: "num-b", className: "font-normal text-[13px] text-content-tertiary cursor-pointer", children: a("dataTable.numericB") })
|
|
66
66
|
] }),
|
|
67
67
|
/* @__PURE__ */ t("div", { className: "flex items-center space-x-2", children: [
|
|
68
|
-
/* @__PURE__ */ e(l, { value: "
|
|
69
|
-
/* @__PURE__ */ e(n, { htmlFor: "num-precision", className: "font-normal text-[13px] text-content-tertiary cursor-pointer", children: a("dataTable.
|
|
68
|
+
/* @__PURE__ */ e(l, { value: "full_precision", id: "num-full-precision" }),
|
|
69
|
+
/* @__PURE__ */ e(n, { htmlFor: "num-full-precision", className: "font-normal text-[13px] text-content-tertiary cursor-pointer", children: a("dataTable.numericFullPrecision") })
|
|
70
70
|
] })
|
|
71
71
|
]
|
|
72
72
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BadgeProps } from './badge';
|
|
1
2
|
import { KeyBinding } from './command-palette/utils';
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
declare const Header: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
@@ -6,6 +7,10 @@ declare const HeaderRight: React.ForwardRefExoticComponent<React.HTMLAttributes<
|
|
|
6
7
|
declare const HeaderLogo: React.ForwardRefExoticComponent<React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLAnchorElement>>;
|
|
7
8
|
declare const HeaderSeparator: React.ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-separator').SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
9
|
declare const HeaderTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
10
|
+
declare const HeaderBadge: {
|
|
11
|
+
({ className, children, style, ...props }: Omit<BadgeProps, "size" | "shape">): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
9
14
|
type HeaderBotButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
10
15
|
declare const HeaderBotButton: React.ForwardRefExoticComponent<HeaderBotButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
16
|
interface NotificationIconButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
@@ -16,4 +21,4 @@ interface NotificationIconButtonProps extends Omit<React.ButtonHTMLAttributes<HT
|
|
|
16
21
|
tooltipKeybinding?: KeyBinding;
|
|
17
22
|
}
|
|
18
23
|
declare const NotificationIconButton: React.ForwardRefExoticComponent<NotificationIconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
-
export { Header, HeaderLeft, HeaderRight, HeaderLogo, HeaderSeparator, HeaderTitle, HeaderBotButton, NotificationIconButton, };
|
|
24
|
+
export { Header, HeaderLeft, HeaderRight, HeaderLogo, HeaderSeparator, HeaderTitle, HeaderBadge, HeaderBotButton, NotificationIconButton, };
|