impact-nova 1.7.16 → 1.7.18

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,113 +1,144 @@
1
- import { jsx as s, jsxs as Y } from "react/jsx-runtime";
2
- import { lazy as Z, useRef as P, useState as h, useCallback as C, useMemo as v, useEffect as ee, Suspense as te } from "react";
3
- import { ModuleRegistry as ne, AllCommunityModule as re, ValidationModule as oe } from "ag-grid-community";
4
- import { AllEnterpriseModule as le } from "ag-grid-enterprise";
5
- import { AgGridReact as ie } from "ag-grid-react";
6
- import { customAgGridTheme as ue } from "./theme.js";
7
- import { CustomHeader as ae } from "./headers/custom-header.js";
8
- import { CustomHeaderGroup as ce } from "./headers/custom-header-group.js";
9
- import { GridHeaderContext as se } from "./headers/context/grid-header-context.js";
10
- import { convertToAgGridFilterModel as de, getMultiFilterIndices as me, convertFromAgGridFilterModel as pe } from "./headers/utils/filter-utils.js";
11
- import { ColumnSettingsMenu as fe } from "./headers/column-menu/column-settings-menu.js";
12
- import { AG_GRID_VALUE_FORMATTERS as ge } from "./value-formatters.js";
1
+ import { jsx as m, jsxs as ne } from "react/jsx-runtime";
2
+ import { lazy as re, useRef as H, useState as C, useCallback as v, useMemo as y, useEffect as oe, Suspense as le } from "react";
3
+ import { ModuleRegistry as ie, AllCommunityModule as se, ValidationModule as ue } from "ag-grid-community";
4
+ import { AllEnterpriseModule as ce } from "ag-grid-enterprise";
5
+ import { AgGridReact as ae } from "ag-grid-react";
6
+ import { customAgGridTheme as de } 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 me } from "./headers/context/grid-header-context.js";
10
+ import { convertToAgGridFilterModel as ge, getMultiFilterIndices as he, convertFromAgGridFilterModel as Ce } from "./headers/utils/filter-utils.js";
11
+ import { ColumnSettingsMenu as ve } from "./headers/column-menu/column-settings-menu.js";
12
+ import { AG_GRID_VALUE_FORMATTERS as ye } from "./value-formatters.js";
13
13
  /* empty css */
14
- const he = Z(() => import("./headers/advanced-filter/advanced-filter-dialog.js"));
15
- ne.registerModules([re, le, oe]);
16
- const k = "", L = (a) => {
14
+ const be = re(() => import("./headers/advanced-filter/advanced-filter-dialog.js"));
15
+ ie.registerModules([se, ce, ue]);
16
+ const x = "", w = "", _ = (s) => {
17
+ if (!s) return;
18
+ const r = s.cellRendererParams?.splits;
19
+ if (Array.isArray(r) && r.length > 0) return r;
20
+ const l = s.cellEditorParams?.splits;
21
+ if (Array.isArray(l) && l.length > 0) return l;
22
+ }, K = (s, r) => {
23
+ const l = [];
24
+ for (const g of r) {
25
+ const f = g?.field?.split(".").pop();
26
+ if (!f) {
27
+ l.push("");
28
+ continue;
29
+ }
30
+ const a = s[f];
31
+ if (a == null) {
32
+ l.push("");
33
+ continue;
34
+ }
35
+ if (typeof a == "object" && "value" in a) {
36
+ const u = a.value;
37
+ l.push(u == null ? "" : String(u));
38
+ continue;
39
+ }
40
+ if (typeof a != "object") {
41
+ l.push(String(a));
42
+ continue;
43
+ }
44
+ l.push("");
45
+ }
46
+ return l;
47
+ }, W = (s) => {
17
48
  if (typeof navigator < "u" && navigator.clipboard?.writeText) {
18
- navigator.clipboard.writeText(a).catch(() => H(a));
49
+ navigator.clipboard.writeText(s).catch(() => V(s));
19
50
  return;
20
51
  }
21
- H(a);
22
- }, H = (a) => {
52
+ V(s);
53
+ }, V = (s) => {
23
54
  if (typeof document > "u") return;
24
55
  const r = document.createElement("textarea");
25
- 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);
56
+ r.value = s, 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);
26
57
  try {
27
58
  r.select(), document.execCommand("copy");
28
59
  } finally {
29
60
  document.body.removeChild(r);
30
61
  }
31
62
  };
32
- function je({
33
- children: a,
63
+ function De({
64
+ children: s,
34
65
  defaultColDef: r,
35
- defaultColGroupDef: c,
36
- columnDefs: y,
37
- valueFormatters: p,
38
- onGridReady: f,
39
- ...i
66
+ defaultColGroupDef: l,
67
+ columnDefs: g,
68
+ valueFormatters: f,
69
+ onGridReady: a,
70
+ ...u
40
71
  }) {
41
- const l = P(null), d = P(null), [b, E] = h(null), [R, x] = h(!1), [A, O] = h(null), [V, T] = h(!1), [S, w] = h(null), [_, j] = h(null), I = C((e) => {
42
- if (!l.current) return;
43
- const t = de(e);
44
- l.current.setFilterModel(t), l.current.onFilterChanged();
45
- }, []), F = v(() => ({
72
+ const c = H(null), h = H(null), [F, k] = C(null), [O, E] = C(!1), [G, T] = C(null), [U, I] = C(!1), [j, P] = C(null), [$, D] = C(null), L = v((e) => {
73
+ if (!c.current) return;
74
+ const t = ge(e);
75
+ c.current.setFilterModel(t), c.current.onFilterChanged();
76
+ }, []), S = y(() => ({
46
77
  openSearch: (e) => {
47
- if (!l.current) return;
48
- const t = l.current.getGridOption("context") || {};
49
- l.current.setGridOption("context", { ...t, activeSearchColumnId: e }), l.current.refreshHeader();
78
+ if (!c.current) return;
79
+ const t = c.current.getGridOption("context") || {};
80
+ c.current.setGridOption("context", { ...t, activeSearchColumnId: e }), c.current.refreshHeader();
50
81
  },
51
82
  closeSearch: () => {
52
- if (!l.current) return;
53
- const e = l.current.getGridOption("context") || {};
54
- l.current.setGridOption("context", { ...e, activeSearchColumnId: null }), l.current.refreshHeader();
83
+ if (!c.current) return;
84
+ const e = c.current.getGridOption("context") || {};
85
+ c.current.setGridOption("context", { ...e, activeSearchColumnId: null }), c.current.refreshHeader();
55
86
  },
56
87
  openAdvancedFilter: (e) => {
57
- O(e || null), x(!0);
88
+ T(e || null), E(!0);
58
89
  },
59
90
  closeAdvancedFilter: () => {
60
- x(!1), O(null);
91
+ E(!1), T(null);
61
92
  },
62
93
  applyAdvancedFilter: (e) => {
63
- I(e);
94
+ L(e);
64
95
  },
65
96
  openMenu: (e, t) => {
66
- w(e), j(t), T(!0);
97
+ P(e), D(t), I(!0);
67
98
  },
68
99
  closeMenu: () => {
69
- T(!1), w(null), j(null);
100
+ I(!1), P(null), D(null);
70
101
  },
71
- activeMenuColumnId: S
72
- }), [I, S]), W = C((e) => {
73
- l.current = e.api, E(e.api);
102
+ activeMenuColumnId: j
103
+ }), [L, j]), q = v((e) => {
104
+ c.current = e.api, k(e.api);
74
105
  const t = e.api.getGridOption("context") || {};
75
- e.api.setGridOption("context", { ...t, activeSearchColumnId: null }), f && f(e);
76
- }, [f]);
77
- ee(() => {
78
- const e = d.current;
106
+ e.api.setGridOption("context", { ...t, activeSearchColumnId: null }), a && a(e);
107
+ }, [a]);
108
+ oe(() => {
109
+ const e = h.current;
79
110
  if (!e) return;
80
- const t = (n) => {
81
- if (n.key !== "Enter" && n.key !== " ") return;
82
- const o = n.target;
83
- if (!o.classList.contains("ag-cell") && !o.classList.contains("ag-header-cell")) return;
84
- const u = o.querySelector(
111
+ const t = (o) => {
112
+ if (o.key !== "Enter" && o.key !== " ") return;
113
+ const i = o.target;
114
+ if (!i.classList.contains("ag-cell") && !i.classList.contains("ag-header-cell")) return;
115
+ const n = i.querySelector(
85
116
  'button, [role="checkbox"], [role="switch"], [role="combobox"], [role="button"], [role="link"], a, input, select, textarea, .cursor-pointer'
86
117
  );
87
- u && (n.preventDefault(), n.stopPropagation(), u.click(), u.focus());
118
+ n && (o.preventDefault(), o.stopPropagation(), n.click(), n.focus());
88
119
  };
89
120
  return e.addEventListener("keydown", t, !0), () => e.removeEventListener("keydown", t, !0);
90
121
  }, []);
91
- const K = v(() => ({
92
- headerComponent: ae,
122
+ const z = y(() => ({
123
+ headerComponent: pe,
93
124
  // Default cell renderer wraps text in a span so display:flex centering
94
125
  // and text-overflow:ellipsis both work (ellipsis doesn't work on
95
126
  // anonymous flex text nodes, but works on flex child elements).
96
127
  cellRenderer: (e) => {
97
128
  const t = e.valueFormatted ?? (e.value != null ? String(e.value) : "");
98
- return /* @__PURE__ */ s("span", { className: "truncate block w-full", children: t });
129
+ return /* @__PURE__ */ m("span", { className: "truncate block w-full", children: t });
99
130
  },
100
131
  ...r,
101
132
  suppressHeaderKeyboardEvent: (e) => {
102
- const { event: t } = e, n = t.target;
103
- if (n.tagName === "INPUT" || n.tagName === "TEXTAREA")
133
+ const { event: t } = e, o = t.target;
134
+ if (o.tagName === "INPUT" || o.tagName === "TEXTAREA")
104
135
  return !(t.key === "Enter" || t.key === "Escape" || t.key === "Tab");
105
136
  if (t.key === "Enter" || t.key === " ") {
106
- const u = n.closest(".ag-header-cell");
107
- if (u) {
108
- const g = u.querySelector('[role="checkbox"], button, [role="switch"], input');
109
- if (g)
110
- return t.preventDefault(), g.click(), !0;
137
+ const n = o.closest(".ag-header-cell");
138
+ if (n) {
139
+ const d = n.querySelector('[role="checkbox"], button, [role="switch"], input');
140
+ if (d)
141
+ return t.preventDefault(), d.click(), !0;
111
142
  }
112
143
  }
113
144
  return r?.suppressHeaderKeyboardEvent?.(e) ?? !1;
@@ -115,26 +146,34 @@ function je({
115
146
  headerComponentParams: {
116
147
  ...r?.headerComponentParams
117
148
  }
118
- }), [r]), U = v(() => ({
119
- headerGroupComponent: ce,
120
- ...c,
149
+ }), [r]), J = y(() => ({
150
+ headerGroupComponent: fe,
151
+ ...l,
121
152
  headerGroupComponentParams: {
122
- ...c?.headerGroupComponentParams
153
+ ...l?.headerGroupComponentParams
123
154
  }
124
- }), [c]), $ = v(() => ({
125
- ...ge,
155
+ }), [l]), X = y(() => ({
156
+ ...ye,
126
157
  // Always available - value formatters
127
- ...i.components,
158
+ ...u.components,
128
159
  // User components override
129
- ...p
160
+ ...f
130
161
  // Optional custom formatters override defaults
131
- }), [p, i.components]), q = C((e) => {
132
- if (e.value !== null && e.value !== void 0 && typeof e.value == "object") {
133
- 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);
134
- return t.length === 0 ? "" : t.length === 1 ? t[0] : t.join(k);
162
+ }), [f, u.components]), B = v((e) => {
163
+ const t = e.value;
164
+ if (t == null || typeof t != "object") return t;
165
+ const o = _(e.column?.getColDef());
166
+ if (o && o.length > 0) {
167
+ const n = K(t, o);
168
+ if (o.length === 1) {
169
+ const d = o[0]?.field?.split(".").pop(), b = d ? t[d] : void 0;
170
+ return b && typeof b == "object" && "value" in b ? b.value ?? "" : n[0];
171
+ }
172
+ return w + n.join(x);
135
173
  }
136
- return e.value;
137
- }, []), z = C((e) => {
174
+ const i = Object.entries(t).map(([, n]) => n && typeof n == "object" && "value" in n ? n.value : typeof n != "object" && typeof n < "u" ? n : null).filter((n) => n != null);
175
+ return i.length === 0 ? "" : i.length === 1 ? i[0] : i.join(x);
176
+ }, []), Q = v((e) => {
138
177
  if (typeof e.value == "string") {
139
178
  const t = e.value.trim();
140
179
  if (t.startsWith("{") || t.startsWith("["))
@@ -145,69 +184,75 @@ function je({
145
184
  }
146
185
  }
147
186
  return e.value;
148
- }, []), J = C((e) => {
187
+ }, []), Y = v((e) => {
149
188
  const t = e?.data ?? "";
150
- if (!t.includes(k)) {
151
- L(t);
189
+ if (!t.includes(x) && !t.includes(w)) {
190
+ W(t);
152
191
  return;
153
192
  }
154
- const n = [], o = t.split(`
193
+ const o = [], i = t.split(`
155
194
  `);
156
- for (let u = 0; u < o.length; u++) {
157
- const g = o[u];
158
- if (g.length === 0 && u === o.length - 1) {
159
- n.push("");
195
+ for (let n = 0; n < i.length; n++) {
196
+ const d = i[n];
197
+ if (d.length === 0 && n === i.length - 1) {
198
+ o.push("");
160
199
  continue;
161
200
  }
162
- const D = g.split(" ").map((m) => m.split(k)), N = Math.max(1, ...D.map((m) => m.length));
201
+ const A = d.split(" ").map((p) => p.startsWith(w) ? { isSplit: !0, slots: p.slice(1).split(x) } : { isSplit: !1, slots: p.split(x) }), N = Math.max(1, ...A.map((p) => p.slots.length));
163
202
  if (N === 1) {
164
- n.push(g);
203
+ o.push(A.map((p) => p.slots[0] ?? "").join(" "));
165
204
  continue;
166
205
  }
167
- for (let m = 0; m < N; m++) {
168
- const Q = D.map((G) => G.length === 1 ? G[0] : G[m] ?? "");
169
- n.push(Q.join(" "));
206
+ for (let p = 0; p < N; p++) {
207
+ const te = A.map((R) => !R.isSplit && R.slots.length === 1 ? R.slots[0] : R.slots[p] ?? "");
208
+ o.push(te.join(" "));
170
209
  }
171
210
  }
172
- L(n.join(`
211
+ W(o.join(`
173
212
  `));
174
- }, []), M = C((e) => {
213
+ }, []), M = v((e) => {
175
214
  const t = e.value;
176
215
  if (t == null) return "";
177
216
  if (typeof t != "object") return String(t);
178
- const n = [];
179
- for (const o of Object.values(t)) {
180
- if (o && typeof o == "object" && "value" in o) {
181
- const u = o.value;
182
- if (u == null) continue;
183
- n.push(String(u));
217
+ const o = _(e.column?.getColDef());
218
+ if (o && o.length > 0) {
219
+ const n = K(t, o);
220
+ return o.length === 1 ? n[0] : n.join(`
221
+ `);
222
+ }
223
+ const i = [];
224
+ for (const n of Object.values(t)) {
225
+ if (n && typeof n == "object" && "value" in n) {
226
+ const d = n.value;
227
+ if (d == null) continue;
228
+ i.push(String(d));
184
229
  continue;
185
230
  }
186
- o != null && typeof o != "object" && n.push(String(o));
231
+ n != null && typeof n != "object" && i.push(String(n));
187
232
  }
188
- return n.length === 0 ? "" : n.length === 1 ? n[0] : n.join(`
233
+ return i.length === 0 ? "" : i.length === 1 ? i[0] : i.join(`
189
234
  `);
190
- }, []), X = v(() => ({
235
+ }, []), Z = y(() => ({
191
236
  processCellCallback: M,
192
- ...i.defaultCsvExportParams ?? {}
193
- }), [M, i.defaultCsvExportParams]), B = v(() => ({
237
+ ...u.defaultCsvExportParams ?? {}
238
+ }), [M, u.defaultCsvExportParams]), ee = y(() => ({
194
239
  processCellCallback: M,
195
- ...i.defaultExcelExportParams ?? {}
196
- }), [M, i.defaultExcelExportParams]);
197
- return /* @__PURE__ */ Y(se.Provider, { value: F, children: [
198
- /* @__PURE__ */ s("div", { ref: d, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ s(
199
- ie,
240
+ ...u.defaultExcelExportParams ?? {}
241
+ }), [M, u.defaultExcelExportParams]);
242
+ return /* @__PURE__ */ ne(me.Provider, { value: S, children: [
243
+ /* @__PURE__ */ m("div", { ref: h, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ m(
244
+ ae,
200
245
  {
201
- theme: ue,
202
- defaultColDef: K,
203
- columnDefs: y,
246
+ theme: de,
247
+ defaultColDef: z,
248
+ columnDefs: g,
204
249
  cellSelection: !0,
205
- defaultColGroupDef: U,
206
- onGridReady: W,
207
- components: $,
208
- processCellForClipboard: q,
209
- processCellFromClipboard: z,
210
- sendToClipboard: J,
250
+ defaultColGroupDef: J,
251
+ onGridReady: q,
252
+ components: X,
253
+ processCellForClipboard: B,
254
+ processCellFromClipboard: Q,
255
+ sendToClipboard: Y,
211
256
  ensureDomOrder: !0,
212
257
  suppressHeaderFocus: !1,
213
258
  suppressFocusAfterRefresh: !0,
@@ -234,80 +279,80 @@ function je({
234
279
  filter: "agDateColumnFilter"
235
280
  }
236
281
  },
237
- ...i,
238
- defaultCsvExportParams: X,
239
- defaultExcelExportParams: B
282
+ ...u,
283
+ defaultCsvExportParams: Z,
284
+ defaultExcelExportParams: ee
240
285
  }
241
286
  ) }),
242
- a,
243
- /* @__PURE__ */ s(
244
- Ce,
287
+ s,
288
+ /* @__PURE__ */ m(
289
+ xe,
245
290
  {
246
- isOpen: R,
247
- columnId: A,
248
- gridApi: b,
249
- onClose: F.closeAdvancedFilter,
250
- onApply: F.applyAdvancedFilter
291
+ isOpen: O,
292
+ columnId: G,
293
+ gridApi: F,
294
+ onClose: S.closeAdvancedFilter,
295
+ onApply: S.applyAdvancedFilter
251
296
  }
252
297
  ),
253
- /* @__PURE__ */ s(
254
- ve,
298
+ /* @__PURE__ */ m(
299
+ Fe,
255
300
  {
256
- isOpen: V,
257
- columnId: S,
258
- gridApi: b,
259
- anchor: _,
260
- onClose: F.closeMenu
301
+ isOpen: U,
302
+ columnId: j,
303
+ gridApi: F,
304
+ anchor: $,
305
+ onClose: S.closeMenu
261
306
  }
262
307
  )
263
308
  ] });
264
309
  }
265
- function Ce({
266
- isOpen: a,
310
+ function xe({
311
+ isOpen: s,
267
312
  columnId: r,
268
- gridApi: c,
269
- onClose: y,
270
- onApply: p
313
+ gridApi: l,
314
+ onClose: g,
315
+ onApply: f
271
316
  }) {
272
- if (!a || !r || !c) return null;
273
- const f = c.getColumn(r);
274
- if (!f) return null;
275
- const i = f.getColDef(), l = i.headerComponentParams, d = me(i), b = d.text !== -1 || d.number !== -1 || d.date !== -1, E = d.set !== -1, x = i.filter === "agMultiColumnFilter" && (b || E) ? "multi" : i.filter === "agNumberColumnFilter" ? "number" : i.filter === "agDateColumnFilter" ? "date" : i.filter === "agSetColumnFilter" || l?.selectOptions ? "select" : "text", A = pe(c.getFilterModel());
276
- return /* @__PURE__ */ s(te, { fallback: null, children: /* @__PURE__ */ s(
277
- he,
317
+ if (!s || !r || !l) return null;
318
+ const a = l.getColumn(r);
319
+ if (!a) return null;
320
+ const u = a.getColDef(), c = u.headerComponentParams, h = he(u), F = h.text !== -1 || h.number !== -1 || h.date !== -1, k = h.set !== -1, E = u.filter === "agMultiColumnFilter" && (F || k) ? "multi" : u.filter === "agNumberColumnFilter" ? "number" : u.filter === "agDateColumnFilter" ? "date" : u.filter === "agSetColumnFilter" || c?.selectOptions ? "select" : "text", G = Ce(l.getFilterModel());
321
+ return /* @__PURE__ */ m(le, { fallback: null, children: /* @__PURE__ */ m(
322
+ be,
278
323
  {
279
- isOpen: a,
280
- onClose: y,
281
- onApply: p,
324
+ isOpen: s,
325
+ onClose: g,
326
+ onApply: f,
282
327
  columnId: r,
283
- columnLabel: i.headerName || r,
284
- columnType: x,
285
- selectOptions: l?.selectOptions,
286
- isMultiSelect: l?.isMultiSelect,
287
- initialModel: A,
288
- api: c
328
+ columnLabel: u.headerName || r,
329
+ columnType: E,
330
+ selectOptions: c?.selectOptions,
331
+ isMultiSelect: c?.isMultiSelect,
332
+ initialModel: G,
333
+ api: l
289
334
  }
290
335
  ) });
291
336
  }
292
- function ve({
293
- isOpen: a,
337
+ function Fe({
338
+ isOpen: s,
294
339
  columnId: r,
295
- gridApi: c,
296
- anchor: y,
297
- onClose: p
340
+ gridApi: l,
341
+ anchor: g,
342
+ onClose: f
298
343
  }) {
299
- return !a || !r || !c ? null : /* @__PURE__ */ s(
300
- fe,
344
+ return !s || !r || !l ? null : /* @__PURE__ */ m(
345
+ ve,
301
346
  {
302
- isOpen: a,
347
+ isOpen: s,
303
348
  columnId: r,
304
- gridApi: c,
305
- anchor: y,
306
- onClose: p
349
+ gridApi: l,
350
+ anchor: g,
351
+ onClose: f
307
352
  }
308
353
  );
309
354
  }
310
355
  export {
311
- je as AgGridWrapper,
312
- je as default
356
+ De as AgGridWrapper,
357
+ De as default
313
358
  };
@@ -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' | 'precision';
4
4
  export type DataTableRowHeight = 'default' | 'compact' | 'comfort';
5
5
  export interface DataTableContextValue {
6
6
  gridApi: GridApi | null;
@@ -1,13 +1,13 @@
1
1
  import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { useDataTable as d } from "./data-table-context.js";
4
- import { RadioGroup as o, RadioGroupItem as l } from "../radio-group.js";
4
+ import { RadioGroup as i, RadioGroupItem as l } from "../radio-group.js";
5
5
  import { Label as n } from "../label.js";
6
6
  import { useImpactNovaI18n as x } from "../../../i18n/ImpactNovaI18nContext.js";
7
7
  const b = () => {
8
8
  const { t: a } = x(), {
9
9
  fontSize: c,
10
- setFontSize: i,
10
+ setFontSize: o,
11
11
  numericFormat: m,
12
12
  setNumericFormat: s
13
13
  } = d();
@@ -15,11 +15,11 @@ const b = () => {
15
15
  /* @__PURE__ */ t("div", { className: "space-y-1", children: [
16
16
  /* @__PURE__ */ e("h3", { className: "text-[12px] font-semibold text-content-icon", children: a("dataTable.fontSize") }),
17
17
  /* @__PURE__ */ t(
18
- o,
18
+ i,
19
19
  {
20
20
  value: c,
21
21
  orientation: "vertical",
22
- onValueChange: (r) => i(r),
22
+ onValueChange: (r) => o(r),
23
23
  className: "flex flex-col",
24
24
  children: [
25
25
  /* @__PURE__ */ t("div", { className: "flex items-center space-x-2", children: [
@@ -41,7 +41,7 @@ const b = () => {
41
41
  /* @__PURE__ */ t("div", { className: "space-y-1", children: [
42
42
  /* @__PURE__ */ e("h3", { className: "text-[12px] font-semibold text-content-icon", children: a("dataTable.numericValues") }),
43
43
  /* @__PURE__ */ t(
44
- o,
44
+ i,
45
45
  {
46
46
  value: m,
47
47
  orientation: "vertical",
@@ -63,6 +63,10 @@ const b = () => {
63
63
  /* @__PURE__ */ t("div", { className: "flex items-center space-x-2", children: [
64
64
  /* @__PURE__ */ e(l, { value: "b", id: "num-b" }),
65
65
  /* @__PURE__ */ e(n, { htmlFor: "num-b", className: "font-normal text-[13px] text-content-tertiary cursor-pointer", children: a("dataTable.numericB") })
66
+ ] }),
67
+ /* @__PURE__ */ t("div", { className: "flex items-center space-x-2", children: [
68
+ /* @__PURE__ */ e(l, { value: "precision", id: "num-precision" }),
69
+ /* @__PURE__ */ e(n, { htmlFor: "num-precision", className: "font-normal text-[13px] text-content-tertiary cursor-pointer", children: a("dataTable.numericPrecision") })
66
70
  ] })
67
71
  ]
68
72
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as i, jsxs as D } from "react/jsx-runtime";
2
- import { useState as l, useRef as O, useCallback as H, useMemo as b, useEffect as A, memo as E } from "react";
2
+ import { useState as l, useRef as O, useCallback as H, useMemo as b, useEffect as y, memo as E } from "react";
3
3
  import { AgGridWrapper as F } from "../ag-grid-react/index.js";
4
- import { cn as y } from "../../../lib/utils.js";
4
+ import { cn as _ } from "../../../lib/utils.js";
5
5
  import { DataTableContext as N, DataTableSheetPortalContext as M, useDataTable as z, useDataTableSheetPortal as I } from "./data-table-context.js";
6
6
  import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as j } from "./data-table-constants.js";
7
7
  import { AG_GRID_VALUE_FORMATTERS as k } from "../ag-grid-react/value-formatters.js";
@@ -64,7 +64,7 @@ const w = {
64
64
  "div",
65
65
  {
66
66
  "data-component": "data-table",
67
- className: y("flex flex-col w-full min-h-0 rounded-[inherit]", e),
67
+ className: _("flex flex-col w-full min-h-0 rounded-[inherit]", e),
68
68
  style: {
69
69
  "--ag-font-size": a,
70
70
  "--ag-row-height": R
@@ -72,11 +72,12 @@ const w = {
72
72
  children: o
73
73
  }
74
74
  ) }) });
75
- }, _ = {
75
+ }, A = {
76
76
  full: "full_no",
77
77
  k: "thou",
78
78
  m: "mil",
79
- b: "bil"
79
+ b: "bil",
80
+ precision: "full_no"
80
81
  }, L = E(function() {
81
82
  const { setSheetTarget: e, scopedSheetOpen: t } = I();
82
83
  return /* @__PURE__ */ i(
@@ -104,16 +105,16 @@ function J(o) {
104
105
  ...f
105
106
  } = o, g = w[t], S = h ?? g, m = b(() => P(d), [d]), x = b(() => ({
106
107
  ...c,
107
- formatType: _[n]
108
+ formatType: A[n]
108
109
  }), [c, n]);
109
- A(() => {
110
+ y(() => {
110
111
  r?.resetRowHeights();
111
- }, [t, r]), A(() => {
112
+ }, [t, r]), y(() => {
112
113
  if (r) {
113
114
  const a = r.getGridOption("context") || {};
114
115
  r.setGridOption("context", {
115
116
  ...a,
116
- formatType: _[n]
117
+ formatType: A[n]
117
118
  }), r.refreshCells({ force: !0 });
118
119
  }
119
120
  }, [n, r]);
@@ -123,7 +124,7 @@ function J(o) {
123
124
  return /* @__PURE__ */ D(
124
125
  "div",
125
126
  {
126
- className: y(
127
+ className: _(
127
128
  "relative flex-1 min-h-0 w-full bg-canvas-elevated rounded-b-[inherit] grid-rounded-bottom",
128
129
  p
129
130
  ),
@@ -147,7 +148,7 @@ function J(o) {
147
148
  const K = ({
148
149
  children: o,
149
150
  className: e
150
- }) => /* @__PURE__ */ i("div", { "data-component": "data-table-toolbar", className: y("flex items-center justify-between px-4 py-3 shrink-0 bg-canvas-elevated rounded-t-[inherit]", e), children: o });
151
+ }) => /* @__PURE__ */ i("div", { "data-component": "data-table-toolbar", className: _("flex items-center justify-between px-4 py-3 shrink-0 bg-canvas-elevated rounded-t-[inherit]", e), children: o });
151
152
  export {
152
153
  q as DataTable,
153
154
  J as DataTableContent,