impact-nova 1.7.12 → 1.7.14

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 re, 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;
@@ -33,13 +33,13 @@ const D = "", W = (a) => {
33
33
  function Ve({
34
34
  children: a,
35
35
  defaultColDef: r,
36
- defaultColGroupDef: s,
37
- columnDefs: x,
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,18 +71,18 @@ 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
81
  const t = (n) => {
82
82
  if (n.key !== "Enter" && n.key !== " ") return;
83
- const c = n.target;
84
- if (!c.classList.contains("ag-cell") && !c.classList.contains("ag-header-cell")) return;
85
- const u = c.querySelector(
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
88
  u && (n.preventDefault(), n.stopPropagation(), u.click(), u.focus());
@@ -91,6 +91,13 @@ function Ve({
91
91
  }, []);
92
92
  const z = b(() => ({
93
93
  headerComponent: pe,
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
+ },
94
101
  ...r,
95
102
  suppressHeaderKeyboardEvent: (e) => {
96
103
  const { event: t } = e, n = t.target;
@@ -111,11 +118,11 @@ function Ve({
111
118
  }
112
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,
@@ -125,7 +132,7 @@ function Ve({
125
132
  }), [h, i.components]), B = y((e) => {
126
133
  if (e.value !== null && e.value !== void 0 && typeof e.value == "object") {
127
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);
128
- return t.length === 0 ? "" : t.length === 1 ? t[0] : t.join(D);
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,26 +148,26 @@ 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 n = [], 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) {
157
+ for (let u = 0; u < s.length; u++) {
158
+ const m = s[u];
159
+ if (m.length === 0 && u === s.length - 1) {
153
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
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
- n.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
173
  W(n.join(`
@@ -169,17 +176,17 @@ function Ve({
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((ne) => ne.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
  }
@@ -195,12 +202,12 @@ function Ve({
195
202
  ...i.defaultExcelExportParams ?? {}
196
203
  }), [A, i.defaultExcelExportParams]);
197
204
  return /* @__PURE__ */ re(ge.Provider, { value: E, children: [
198
- /* @__PURE__ */ g("div", { ref: f, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ g(
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,
@@ -212,7 +219,6 @@ function Ve({
212
219
  suppressHeaderFocus: !1,
213
220
  suppressFocusAfterRefresh: !0,
214
221
  suppressGroupRowsSticky: !0,
215
- enableCellTextSelection: !0,
216
222
  columnTypes: {
217
223
  numericColumn: {
218
224
  cellClass: "ag-right-aligned-cell",
@@ -241,22 +247,22 @@ function Ve({
241
247
  }
242
248
  ) }),
243
249
  a,
244
- /* @__PURE__ */ g(
250
+ /* @__PURE__ */ f(
245
251
  Ee,
246
252
  {
247
- isOpen: j,
253
+ isOpen: D,
248
254
  columnId: R,
249
- gridApi: F,
255
+ gridApi: x,
250
256
  onClose: E.closeAdvancedFilter,
251
257
  onApply: E.applyAdvancedFilter
252
258
  }
253
259
  ),
254
- /* @__PURE__ */ g(
260
+ /* @__PURE__ */ f(
255
261
  Ae,
256
262
  {
257
263
  isOpen: U,
258
264
  columnId: O,
259
- gridApi: F,
265
+ gridApi: x,
260
266
  anchor: $,
261
267
  onClose: E.closeMenu
262
268
  }
@@ -266,19 +272,19 @@ function Ve({
266
272
  function Ee({
267
273
  isOpen: a,
268
274
  columnId: r,
269
- gridApi: s,
270
- onClose: x,
275
+ gridApi: c,
276
+ onClose: F,
271
277
  onApply: h
272
278
  }) {
273
- if (!a || !r || !s) return null;
274
- const C = s.getColumn(r);
279
+ if (!a || !r || !c) return null;
280
+ const C = c.getColumn(r);
275
281
  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(
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(
278
284
  Me,
279
285
  {
280
286
  isOpen: a,
281
- onClose: x,
287
+ onClose: F,
282
288
  onApply: h,
283
289
  columnId: r,
284
290
  columnLabel: i.headerName || r,
@@ -286,24 +292,24 @@ function Ee({
286
292
  selectOptions: o?.selectOptions,
287
293
  isMultiSelect: o?.isMultiSelect,
288
294
  initialModel: R,
289
- api: s
295
+ api: c
290
296
  }
291
297
  ) });
292
298
  }
293
299
  function Ae({
294
300
  isOpen: a,
295
301
  columnId: r,
296
- gridApi: s,
297
- anchor: x,
302
+ gridApi: c,
303
+ anchor: F,
298
304
  onClose: h
299
305
  }) {
300
- return !a || !r || !s ? null : /* @__PURE__ */ g(
306
+ return !a || !r || !c ? null : /* @__PURE__ */ f(
301
307
  ye,
302
308
  {
303
309
  isOpen: a,
304
310
  columnId: r,
305
- gridApi: s,
306
- anchor: x,
311
+ gridApi: c,
312
+ anchor: F,
307
313
  onClose: h
308
314
  }
309
315
  );