impact-nova 1.7.13 → 1.7.15

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