impact-nova 1.7.10 → 1.7.12
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/index.js +211 -136
- package/dist/components/ui/calendar.js +242 -234
- package/dist/components/ui/command-palette/shortcut-overlay.js +97 -75
- package/dist/components/ui/data-table/data-table-saved-views.js +116 -113
- package/dist/components/ui/date-picker/month-range-picker.js +50 -50
- package/dist/impact-nova.css +1 -1
- package/package.json +1 -1
|
@@ -1,117 +1,134 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { lazy as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { AllEnterpriseModule as
|
|
5
|
-
import { AgGridReact as
|
|
6
|
-
import { customAgGridTheme as
|
|
7
|
-
import { CustomHeader as
|
|
8
|
-
import { CustomHeaderGroup as
|
|
9
|
-
import { GridHeaderContext as
|
|
10
|
-
import { convertToAgGridFilterModel as
|
|
11
|
-
import { ColumnSettingsMenu as
|
|
12
|
-
import { AG_GRID_VALUE_FORMATTERS as
|
|
1
|
+
import { jsxs as re, jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { lazy as oe, useRef as _, useState as v, useCallback as y, useMemo as b, useEffect as le, Suspense as ie } from "react";
|
|
3
|
+
import { ModuleRegistry as ae, AllCommunityModule as ue, ValidationModule as se } from "ag-grid-community";
|
|
4
|
+
import { AllEnterpriseModule as ce } from "ag-grid-enterprise";
|
|
5
|
+
import { AgGridReact as de } from "ag-grid-react";
|
|
6
|
+
import { customAgGridTheme as me } from "./theme.js";
|
|
7
|
+
import { CustomHeader as pe } from "./headers/custom-header.js";
|
|
8
|
+
import { CustomHeaderGroup as fe } from "./headers/custom-header-group.js";
|
|
9
|
+
import { GridHeaderContext as ge } from "./headers/context/grid-header-context.js";
|
|
10
|
+
import { convertToAgGridFilterModel as he, getMultiFilterIndices as Ce, convertFromAgGridFilterModel as ve } from "./headers/utils/filter-utils.js";
|
|
11
|
+
import { ColumnSettingsMenu as ye } from "./headers/column-menu/column-settings-menu.js";
|
|
12
|
+
import { AG_GRID_VALUE_FORMATTERS as be } from "./value-formatters.js";
|
|
13
|
+
import { resolveValueFormatter as xe, applyValueFormatter as Fe } from "./cell-renderers/cell-renderer-utils.js";
|
|
13
14
|
/* empty css */
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
const Me = oe(() => import("./headers/advanced-filter/advanced-filter-dialog.js"));
|
|
16
|
+
ae.registerModules([ue, ce, se]);
|
|
17
|
+
const D = "", W = (a) => {
|
|
18
|
+
if (typeof navigator < "u" && navigator.clipboard?.writeText) {
|
|
19
|
+
navigator.clipboard.writeText(a).catch(() => K(a));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
K(a);
|
|
23
|
+
}, K = (a) => {
|
|
24
|
+
if (typeof document > "u") return;
|
|
25
|
+
const r = document.createElement("textarea");
|
|
26
|
+
r.value = a, r.setAttribute("readonly", ""), r.style.position = "fixed", r.style.top = "0", r.style.left = "0", r.style.opacity = "0", r.style.pointerEvents = "none", document.body.appendChild(r);
|
|
27
|
+
try {
|
|
28
|
+
r.select(), document.execCommand("copy");
|
|
29
|
+
} finally {
|
|
30
|
+
document.body.removeChild(r);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
function Ve({
|
|
34
|
+
children: a,
|
|
35
|
+
defaultColDef: r,
|
|
36
|
+
defaultColGroupDef: s,
|
|
37
|
+
columnDefs: x,
|
|
38
|
+
valueFormatters: h,
|
|
39
|
+
onGridReady: C,
|
|
40
|
+
...i
|
|
24
41
|
}) {
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
27
|
-
const t =
|
|
28
|
-
|
|
29
|
-
}, []),
|
|
42
|
+
const o = _(null), f = _(null), [F, k] = v(null), [j, M] = v(!1), [R, w] = v(null), [U, I] = v(!1), [O, P] = v(null), [$, N] = v(null), L = y((e) => {
|
|
43
|
+
if (!o.current) return;
|
|
44
|
+
const t = he(e);
|
|
45
|
+
o.current.setFilterModel(t), o.current.onFilterChanged();
|
|
46
|
+
}, []), E = b(() => ({
|
|
30
47
|
openSearch: (e) => {
|
|
31
|
-
if (!
|
|
32
|
-
const t =
|
|
33
|
-
|
|
48
|
+
if (!o.current) return;
|
|
49
|
+
const t = o.current.getGridOption("context") || {};
|
|
50
|
+
o.current.setGridOption("context", { ...t, activeSearchColumnId: e }), o.current.refreshHeader();
|
|
34
51
|
},
|
|
35
52
|
closeSearch: () => {
|
|
36
|
-
if (!
|
|
37
|
-
const e =
|
|
38
|
-
|
|
53
|
+
if (!o.current) return;
|
|
54
|
+
const e = o.current.getGridOption("context") || {};
|
|
55
|
+
o.current.setGridOption("context", { ...e, activeSearchColumnId: null }), o.current.refreshHeader();
|
|
39
56
|
},
|
|
40
57
|
openAdvancedFilter: (e) => {
|
|
41
|
-
|
|
58
|
+
w(e || null), M(!0);
|
|
42
59
|
},
|
|
43
60
|
closeAdvancedFilter: () => {
|
|
44
|
-
|
|
61
|
+
M(!1), w(null);
|
|
45
62
|
},
|
|
46
63
|
applyAdvancedFilter: (e) => {
|
|
47
|
-
|
|
64
|
+
L(e);
|
|
48
65
|
},
|
|
49
66
|
openMenu: (e, t) => {
|
|
50
|
-
|
|
67
|
+
P(e), N(t), I(!0);
|
|
51
68
|
},
|
|
52
69
|
closeMenu: () => {
|
|
53
|
-
|
|
70
|
+
I(!1), P(null), N(null);
|
|
54
71
|
},
|
|
55
|
-
activeMenuColumnId:
|
|
56
|
-
}), [
|
|
57
|
-
|
|
72
|
+
activeMenuColumnId: O
|
|
73
|
+
}), [L, O]), q = y((e) => {
|
|
74
|
+
o.current = e.api, k(e.api);
|
|
58
75
|
const t = e.api.getGridOption("context") || {};
|
|
59
|
-
e.api.setGridOption("context", { ...t, activeSearchColumnId: null }),
|
|
60
|
-
}, [
|
|
61
|
-
|
|
62
|
-
const e =
|
|
76
|
+
e.api.setGridOption("context", { ...t, activeSearchColumnId: null }), C && C(e);
|
|
77
|
+
}, [C]);
|
|
78
|
+
le(() => {
|
|
79
|
+
const e = f.current;
|
|
63
80
|
if (!e) return;
|
|
64
81
|
const t = (n) => {
|
|
65
82
|
if (n.key !== "Enter" && n.key !== " ") return;
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
68
|
-
const
|
|
83
|
+
const c = n.target;
|
|
84
|
+
if (!c.classList.contains("ag-cell") && !c.classList.contains("ag-header-cell")) return;
|
|
85
|
+
const u = c.querySelector(
|
|
69
86
|
'button, [role="checkbox"], [role="switch"], [role="combobox"], [role="button"], [role="link"], a, input, select, textarea, .cursor-pointer'
|
|
70
87
|
);
|
|
71
|
-
|
|
88
|
+
u && (n.preventDefault(), n.stopPropagation(), u.click(), u.focus());
|
|
72
89
|
};
|
|
73
90
|
return e.addEventListener("keydown", t, !0), () => e.removeEventListener("keydown", t, !0);
|
|
74
91
|
}, []);
|
|
75
|
-
const
|
|
76
|
-
headerComponent:
|
|
77
|
-
...
|
|
92
|
+
const z = b(() => ({
|
|
93
|
+
headerComponent: pe,
|
|
94
|
+
...r,
|
|
78
95
|
suppressHeaderKeyboardEvent: (e) => {
|
|
79
96
|
const { event: t } = e, n = t.target;
|
|
80
97
|
if (n.tagName === "INPUT" || n.tagName === "TEXTAREA")
|
|
81
98
|
return !(t.key === "Enter" || t.key === "Escape" || t.key === "Tab");
|
|
82
99
|
if (t.key === "Enter" || t.key === " ") {
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
return t.preventDefault(),
|
|
100
|
+
const u = n.closest(".ag-header-cell");
|
|
101
|
+
if (u) {
|
|
102
|
+
const m = u.querySelector('[role="checkbox"], button, [role="switch"], input');
|
|
103
|
+
if (m)
|
|
104
|
+
return t.preventDefault(), m.click(), !0;
|
|
88
105
|
}
|
|
89
106
|
}
|
|
90
|
-
return
|
|
107
|
+
return r?.suppressHeaderKeyboardEvent?.(e) ?? !1;
|
|
91
108
|
},
|
|
92
109
|
headerComponentParams: {
|
|
93
|
-
...
|
|
110
|
+
...r?.headerComponentParams
|
|
94
111
|
}
|
|
95
|
-
}), [
|
|
96
|
-
headerGroupComponent:
|
|
97
|
-
...
|
|
112
|
+
}), [r]), J = b(() => ({
|
|
113
|
+
headerGroupComponent: fe,
|
|
114
|
+
...s,
|
|
98
115
|
headerGroupComponentParams: {
|
|
99
|
-
...
|
|
116
|
+
...s?.headerGroupComponentParams
|
|
100
117
|
}
|
|
101
|
-
}), [
|
|
102
|
-
...
|
|
118
|
+
}), [s]), X = b(() => ({
|
|
119
|
+
...be,
|
|
103
120
|
// Always available - value formatters
|
|
104
|
-
...
|
|
121
|
+
...i.components,
|
|
105
122
|
// User components override
|
|
106
|
-
...
|
|
123
|
+
...h
|
|
107
124
|
// Optional custom formatters override defaults
|
|
108
|
-
}), [
|
|
125
|
+
}), [h, i.components]), B = y((e) => {
|
|
109
126
|
if (e.value !== null && e.value !== void 0 && typeof e.value == "object") {
|
|
110
|
-
const t = Object.entries(e.value).map(([
|
|
111
|
-
return t.length
|
|
127
|
+
const t = Object.entries(e.value).map(([, n]) => n && typeof n == "object" && "value" in n ? n.value : typeof n != "object" && typeof n < "u" ? n : null).filter((n) => n != null);
|
|
128
|
+
return t.length === 0 ? "" : t.length === 1 ? t[0] : t.join(D);
|
|
112
129
|
}
|
|
113
130
|
return e.value;
|
|
114
|
-
}, []),
|
|
131
|
+
}, []), Q = y((e) => {
|
|
115
132
|
if (typeof e.value == "string") {
|
|
116
133
|
const t = e.value.trim();
|
|
117
134
|
if (t.startsWith("{") || t.startsWith("["))
|
|
@@ -122,24 +139,80 @@ function ye({
|
|
|
122
139
|
}
|
|
123
140
|
}
|
|
124
141
|
return e.value;
|
|
125
|
-
}, [])
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
142
|
+
}, []), Y = y((e) => {
|
|
143
|
+
const t = e?.data ?? "";
|
|
144
|
+
if (!t.includes(D)) {
|
|
145
|
+
W(t);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const n = [], c = t.split(`
|
|
149
|
+
`);
|
|
150
|
+
for (let u = 0; u < c.length; u++) {
|
|
151
|
+
const m = c[u];
|
|
152
|
+
if (m.length === 0 && u === c.length - 1) {
|
|
153
|
+
n.push("");
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
const d = m.split(" ").map((l) => l.split(D)), S = Math.max(1, ...d.map((l) => l.length));
|
|
157
|
+
if (S === 1) {
|
|
158
|
+
n.push(m);
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
for (let l = 0; l < S; l++) {
|
|
162
|
+
const G = d.map((p) => p.length === 1 ? p[0] : p[l] ?? "");
|
|
163
|
+
n.push(G.join(" "));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
W(n.join(`
|
|
167
|
+
`));
|
|
168
|
+
}, []), A = y((e) => {
|
|
169
|
+
const t = e.value;
|
|
170
|
+
if (t == null) return "";
|
|
171
|
+
if (typeof t != "object") return String(t);
|
|
172
|
+
const c = e.column?.getColDef?.()?.cellRendererParams ?? null, u = c?.splits, m = c?.valueFormatter ?? null, H = e.node?.data ?? null, d = [];
|
|
173
|
+
for (const [S, l] of Object.entries(t)) {
|
|
174
|
+
if (l && typeof l == "object" && "value" in l) {
|
|
175
|
+
const G = l, p = G.value;
|
|
176
|
+
if (p == null) continue;
|
|
177
|
+
const te = u?.find((ne) => ne.field?.split(".").pop() === S), V = xe(
|
|
178
|
+
G,
|
|
179
|
+
H,
|
|
180
|
+
te?.valueFormatter ?? null,
|
|
181
|
+
m
|
|
182
|
+
), T = V ? Fe(V, p) : String(p);
|
|
183
|
+
T != null && d.push(String(T));
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
typeof l != "object" && typeof l < "u" && l !== null && d.push(String(l));
|
|
187
|
+
}
|
|
188
|
+
return d.length === 0 ? "" : d.length === 1 ? d[0] : d.join(`
|
|
189
|
+
`);
|
|
190
|
+
}, []), Z = b(() => ({
|
|
191
|
+
processCellCallback: A,
|
|
192
|
+
...i.defaultCsvExportParams ?? {}
|
|
193
|
+
}), [A, i.defaultCsvExportParams]), ee = b(() => ({
|
|
194
|
+
processCellCallback: A,
|
|
195
|
+
...i.defaultExcelExportParams ?? {}
|
|
196
|
+
}), [A, i.defaultExcelExportParams]);
|
|
197
|
+
return /* @__PURE__ */ re(ge.Provider, { value: E, children: [
|
|
198
|
+
/* @__PURE__ */ g("div", { ref: f, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ g(
|
|
199
|
+
de,
|
|
129
200
|
{
|
|
130
|
-
theme:
|
|
131
|
-
defaultColDef:
|
|
132
|
-
columnDefs:
|
|
201
|
+
theme: me,
|
|
202
|
+
defaultColDef: z,
|
|
203
|
+
columnDefs: x,
|
|
133
204
|
cellSelection: !0,
|
|
134
|
-
defaultColGroupDef:
|
|
135
|
-
onGridReady:
|
|
136
|
-
components:
|
|
137
|
-
processCellForClipboard:
|
|
138
|
-
processCellFromClipboard:
|
|
205
|
+
defaultColGroupDef: J,
|
|
206
|
+
onGridReady: q,
|
|
207
|
+
components: X,
|
|
208
|
+
processCellForClipboard: B,
|
|
209
|
+
processCellFromClipboard: Q,
|
|
210
|
+
sendToClipboard: Y,
|
|
139
211
|
ensureDomOrder: !0,
|
|
140
212
|
suppressHeaderFocus: !1,
|
|
141
213
|
suppressFocusAfterRefresh: !0,
|
|
142
214
|
suppressGroupRowsSticky: !0,
|
|
215
|
+
enableCellTextSelection: !0,
|
|
143
216
|
columnTypes: {
|
|
144
217
|
numericColumn: {
|
|
145
218
|
cellClass: "ag-right-aligned-cell",
|
|
@@ -162,78 +235,80 @@ function ye({
|
|
|
162
235
|
filter: "agDateColumnFilter"
|
|
163
236
|
}
|
|
164
237
|
},
|
|
165
|
-
...
|
|
238
|
+
...i,
|
|
239
|
+
defaultCsvExportParams: Z,
|
|
240
|
+
defaultExcelExportParams: ee
|
|
166
241
|
}
|
|
167
242
|
) }),
|
|
168
|
-
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
|
|
243
|
+
a,
|
|
244
|
+
/* @__PURE__ */ g(
|
|
245
|
+
Ee,
|
|
171
246
|
{
|
|
172
|
-
isOpen:
|
|
173
|
-
columnId:
|
|
174
|
-
gridApi:
|
|
175
|
-
onClose:
|
|
176
|
-
onApply:
|
|
247
|
+
isOpen: j,
|
|
248
|
+
columnId: R,
|
|
249
|
+
gridApi: F,
|
|
250
|
+
onClose: E.closeAdvancedFilter,
|
|
251
|
+
onApply: E.applyAdvancedFilter
|
|
177
252
|
}
|
|
178
253
|
),
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
|
|
254
|
+
/* @__PURE__ */ g(
|
|
255
|
+
Ae,
|
|
181
256
|
{
|
|
182
|
-
isOpen:
|
|
183
|
-
columnId:
|
|
184
|
-
gridApi:
|
|
185
|
-
anchor:
|
|
186
|
-
onClose:
|
|
257
|
+
isOpen: U,
|
|
258
|
+
columnId: O,
|
|
259
|
+
gridApi: F,
|
|
260
|
+
anchor: $,
|
|
261
|
+
onClose: E.closeMenu
|
|
187
262
|
}
|
|
188
263
|
)
|
|
189
264
|
] });
|
|
190
265
|
}
|
|
191
|
-
function
|
|
192
|
-
isOpen:
|
|
193
|
-
columnId:
|
|
194
|
-
gridApi:
|
|
195
|
-
onClose:
|
|
196
|
-
onApply:
|
|
266
|
+
function Ee({
|
|
267
|
+
isOpen: a,
|
|
268
|
+
columnId: r,
|
|
269
|
+
gridApi: s,
|
|
270
|
+
onClose: x,
|
|
271
|
+
onApply: h
|
|
197
272
|
}) {
|
|
198
|
-
if (!
|
|
199
|
-
const
|
|
200
|
-
if (!
|
|
201
|
-
const
|
|
202
|
-
return /* @__PURE__ */
|
|
203
|
-
|
|
273
|
+
if (!a || !r || !s) return null;
|
|
274
|
+
const C = s.getColumn(r);
|
|
275
|
+
if (!C) return null;
|
|
276
|
+
const i = C.getColDef(), o = i.headerComponentParams, f = Ce(i), F = f.text !== -1 || f.number !== -1 || f.date !== -1, k = f.set !== -1, M = i.filter === "agMultiColumnFilter" && (F || k) ? "multi" : i.filter === "agNumberColumnFilter" ? "number" : i.filter === "agDateColumnFilter" ? "date" : i.filter === "agSetColumnFilter" || o?.selectOptions ? "select" : "text", R = ve(s.getFilterModel());
|
|
277
|
+
return /* @__PURE__ */ g(ie, { fallback: null, children: /* @__PURE__ */ g(
|
|
278
|
+
Me,
|
|
204
279
|
{
|
|
205
|
-
isOpen:
|
|
206
|
-
onClose:
|
|
207
|
-
onApply:
|
|
208
|
-
columnId:
|
|
209
|
-
columnLabel:
|
|
210
|
-
columnType:
|
|
211
|
-
selectOptions:
|
|
212
|
-
isMultiSelect:
|
|
213
|
-
initialModel:
|
|
214
|
-
api:
|
|
280
|
+
isOpen: a,
|
|
281
|
+
onClose: x,
|
|
282
|
+
onApply: h,
|
|
283
|
+
columnId: r,
|
|
284
|
+
columnLabel: i.headerName || r,
|
|
285
|
+
columnType: M,
|
|
286
|
+
selectOptions: o?.selectOptions,
|
|
287
|
+
isMultiSelect: o?.isMultiSelect,
|
|
288
|
+
initialModel: R,
|
|
289
|
+
api: s
|
|
215
290
|
}
|
|
216
291
|
) });
|
|
217
292
|
}
|
|
218
|
-
function
|
|
219
|
-
isOpen:
|
|
220
|
-
columnId:
|
|
221
|
-
gridApi:
|
|
222
|
-
anchor:
|
|
223
|
-
onClose:
|
|
293
|
+
function Ae({
|
|
294
|
+
isOpen: a,
|
|
295
|
+
columnId: r,
|
|
296
|
+
gridApi: s,
|
|
297
|
+
anchor: x,
|
|
298
|
+
onClose: h
|
|
224
299
|
}) {
|
|
225
|
-
return !
|
|
226
|
-
|
|
300
|
+
return !a || !r || !s ? null : /* @__PURE__ */ g(
|
|
301
|
+
ye,
|
|
227
302
|
{
|
|
228
|
-
isOpen:
|
|
229
|
-
columnId:
|
|
230
|
-
gridApi:
|
|
231
|
-
anchor:
|
|
232
|
-
onClose:
|
|
303
|
+
isOpen: a,
|
|
304
|
+
columnId: r,
|
|
305
|
+
gridApi: s,
|
|
306
|
+
anchor: x,
|
|
307
|
+
onClose: h
|
|
233
308
|
}
|
|
234
309
|
);
|
|
235
310
|
}
|
|
236
311
|
export {
|
|
237
|
-
|
|
238
|
-
|
|
312
|
+
Ve as AgGridWrapper,
|
|
313
|
+
Ve as default
|
|
239
314
|
};
|