impact-nova 1.7.38 → 1.7.40

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.
Files changed (42) hide show
  1. package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +58 -48
  2. package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.d.ts +0 -2
  3. package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +212 -218
  4. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +2 -2
  5. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +97 -127
  6. package/dist/components/ui/ag-grid-react/headers/components/date-filter-picker.d.ts +39 -0
  7. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +433 -299
  8. package/dist/components/ui/ag-grid-react/headers/utils/date-utils.d.ts +33 -1
  9. package/dist/components/ui/ag-grid-react/headers/utils/date-utils.js +60 -26
  10. package/dist/components/ui/ag-grid-react/headers/utils/filter-utils.d.ts +11 -10
  11. package/dist/components/ui/ag-grid-react/headers/utils/filter-utils.js +284 -260
  12. package/dist/components/ui/ag-grid-react/index.js +24 -25
  13. package/dist/components/ui/create-item-flow/create-item-flow.js +1 -1
  14. package/dist/components/ui/data-table/column-indicator.d.ts +17 -0
  15. package/dist/components/ui/data-table/column-indicator.js +30 -0
  16. package/dist/components/ui/data-table/data-table-column-list.js +210 -154
  17. package/dist/components/ui/data-table/data-table.js +60 -59
  18. package/dist/components/ui/data-table/index.d.ts +3 -0
  19. package/dist/components/ui/data-table/index.js +34 -28
  20. package/dist/components/ui/data-table/indicator-legend.d.ts +8 -0
  21. package/dist/components/ui/data-table/indicator-legend.js +20 -0
  22. package/dist/components/ui/data-table/pin-switch.d.ts +30 -0
  23. package/dist/components/ui/data-table/pin-switch.js +75 -0
  24. package/dist/components/ui/date-picker/date-picker.js +65 -63
  25. package/dist/components/ui/date-picker/date-range-picker.js +77 -75
  26. package/dist/components/ui/nested-list/components/NestedListContent.js +7 -7
  27. package/dist/components/ui/nested-list/components/SortableItem.d.ts +10 -0
  28. package/dist/components/ui/nested-list/components/SortableItem.js +91 -83
  29. package/dist/components/ui/nested-list/nested-list.js +184 -178
  30. package/dist/components/ui/types/ag-grid.types.d.ts +16 -2
  31. package/dist/components/ui/types/date-picker.types.d.ts +4 -0
  32. package/dist/components/ui/types/nested-list.types.d.ts +12 -0
  33. package/dist/i18n/defaultMessages.d.ts +10 -0
  34. package/dist/i18n/defaultMessages.js +16 -8
  35. package/dist/i18n/locales/de.js +8 -0
  36. package/dist/i18n/locales/es.js +8 -0
  37. package/dist/i18n/locales/hi.js +8 -0
  38. package/dist/i18n/locales/kn.js +8 -0
  39. package/dist/impact-nova.css +1 -1
  40. package/dist/index.js +180 -174
  41. package/package.json +1 -1
  42. package/tailwind.config.js +16 -0
@@ -1,106 +1,114 @@
1
- import { jsx as U } from "react/jsx-runtime";
2
- import { useState as j, useRef as R, useCallback as L, useEffect as B } from "react";
3
- import { useDataTable as ee } from "./data-table-context.js";
4
- import { NestedList as te } from "../nested-list/nested-list.js";
5
- import { SelectionMode as ne } from "../types/nested-list.types.js";
6
- import { mergePartialOrderedColumnState as le } from "./data-table-column-state.js";
7
- import { useImpactNovaI18n as oe } from "../../../i18n/ImpactNovaI18nContext.js";
8
- function re(v) {
9
- const T = [];
10
- let h = v.getOriginalParent();
11
- for (; h; ) {
12
- const M = h.getColGroupDef();
13
- M?.headerName && M?.children && T.push(h), h = h.getOriginalParent();
1
+ import { jsxs as ce, jsx as y } from "react/jsx-runtime";
2
+ import { useState as W, useRef as R, useCallback as g, useEffect as J } from "react";
3
+ import { useDataTable as se } from "./data-table-context.js";
4
+ import { NestedList as ae } from "../nested-list/nested-list.js";
5
+ import { SelectionMode as de } from "../types/nested-list.types.js";
6
+ import { mergePartialOrderedColumnState as ue } from "./data-table-column-state.js";
7
+ import { PinSwitch as fe } from "./pin-switch.js";
8
+ import { ColumnIndicator as Q } from "./column-indicator.js";
9
+ import { IndicatorLegend as pe } from "./indicator-legend.js";
10
+ import { useImpactNovaI18n as he } from "../../../i18n/ImpactNovaI18nContext.js";
11
+ function me(E) {
12
+ const P = [];
13
+ let C = E.getOriginalParent();
14
+ for (; C; ) {
15
+ const w = C.getColGroupDef();
16
+ w?.headerName && w?.children && P.push(C), C = C.getOriginalParent();
14
17
  }
15
- return T.reverse(), T;
18
+ return P.reverse(), P;
16
19
  }
17
- const ce = 300, q = 100, he = ({
18
- enableApplyDiscard: v = !1,
19
- showSearch: T = !0,
20
- showSelectAll: h = !0,
21
- showCollapse: M = !0
20
+ const ge = 300, K = 100, Ee = ({
21
+ enableApplyDiscard: E = !1,
22
+ showSearch: P = !0,
23
+ showSelectAll: C = !0,
24
+ showCollapse: w = !0
22
25
  }) => {
23
- const { gridApi: e } = ee(), { t: D } = oe(), [Y, F] = j([]), [H, J] = j(!1), k = R(!1), z = R(null), x = R(0), W = R({}), [K, Q] = j(!1), E = L(() => {
24
- if (!e || k.current) return;
25
- const r = e.getColumnState(), u = e.getColumns() || [], c = new Map(u.map((l) => [l.getColId(), l])), i = [], s = [], t = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
26
- f.set(i, "f"), f.set(s, "s");
27
- let P = 0;
28
- const G = (l) => {
29
- let n = f.get(l);
30
- return n === void 0 && (n = `n${P++}`, f.set(l, n)), n;
31
- }, N = (l, n) => {
32
- const o = l.getGroupId(), C = G(n), I = `${o}::${C}`, b = t.get(I);
33
- if (b && b.list === n && n[n.length - 1] === b.node)
34
- return b.node;
35
- const y = S.get(I) || 0;
36
- S.set(I, y + 1);
37
- const p = l.getColGroupDef(), w = {
38
- id: y === 0 ? `${o}__${C}` : `${o}__${C}__${y}`,
39
- label: p?.headerName || o,
26
+ const { gridApi: n } = se(), { t: L } = he(), [X, F] = W([]), [Z, ee] = W(!1), N = R(!1), $ = R(null), M = R(0), V = R({}), [B, te] = W(!1), x = g(() => {
27
+ if (!n || N.current) return;
28
+ const r = n.getColumnState(), i = n.getColumns() || [], t = new Map(i.map((o) => [o.getColId(), o])), s = [], l = [], e = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
29
+ f.set(s, "f"), f.set(l, "s");
30
+ let p = 0;
31
+ const T = (o) => {
32
+ let c = f.get(o);
33
+ return c === void 0 && (c = `n${p++}`, f.set(o, c)), c;
34
+ }, h = (o, c) => {
35
+ const a = o.getGroupId(), S = T(c), D = `${a}::${S}`, k = e.get(D);
36
+ if (k && k.list === c && c[c.length - 1] === k.node)
37
+ return k.node;
38
+ const _ = v.get(D) || 0;
39
+ v.set(D, _ + 1);
40
+ const O = o.getColGroupDef(), A = {
41
+ id: _ === 0 ? `${a}__${S}` : `${a}__${S}__${_}`,
42
+ label: O?.headerName || a,
40
43
  checked: !0,
41
44
  children: [],
42
45
  category: "group"
43
46
  };
44
- return n.push(w), t.set(I, { list: n, node: w }), w;
47
+ return c.push(A), e.set(D, { list: c, node: A }), A;
45
48
  };
46
- let a = 0, $ = 0, m = 0, d = 0;
47
- r.forEach((l) => {
48
- const n = c.get(l.colId);
49
- if (!n) return;
50
- let o = e.getDisplayNameForColumn(n, "header");
51
- if (o === "") return;
52
- if (o == null) {
53
- const p = n.getColDef();
54
- if (p.headerName === "") return;
55
- o = p.headerName || p.field || l.colId;
49
+ let d = 0, j = 0, m = 0, u = 0;
50
+ r.forEach((o) => {
51
+ const c = t.get(o.colId);
52
+ if (!c) return;
53
+ let a = n.getDisplayNameForColumn(c, "header");
54
+ if (a === "") return;
55
+ if (a == null) {
56
+ const b = c.getColDef();
57
+ if (b.headerName === "") return;
58
+ a = b.headerName || b.field || o.colId;
56
59
  }
57
- if (!o || o.trim() === "")
60
+ if (!a || a.trim() === "")
58
61
  return;
59
- const C = !l.hide, I = {
60
- id: l.colId,
61
- label: o,
62
- checked: C
62
+ const S = !o.hide, D = !!o.sort, k = c.isFilterActive(), _ = o.pinned === "left" ? "left" : o.pinned === "right" ? "right" : null, O = {
63
+ id: o.colId,
64
+ label: a,
65
+ checked: S,
66
+ data: {
67
+ hasSortApplied: D,
68
+ hasFilterApplied: k,
69
+ pinned: _
70
+ }
63
71
  };
64
- l.pinned ? (a++, C && $++) : (m++, C && d++);
65
- const b = l.pinned ? i : s, y = re(n);
66
- if (y.length > 0) {
67
- let p = b, O = null;
68
- for (const w of y)
69
- O = N(w, p), p = O.children;
70
- O.children.push(I);
72
+ o.pinned ? (d++, S && j++) : (m++, S && u++);
73
+ const U = o.pinned ? s : l, A = me(c);
74
+ if (A.length > 0) {
75
+ let b = U, q = null;
76
+ for (const ie of A)
77
+ q = h(ie, b), b = q.children;
78
+ q.children.push(O);
71
79
  } else
72
- b.push(I);
80
+ U.push(O);
73
81
  });
74
- const g = (l) => {
75
- let n = l.length > 0;
76
- for (const o of l)
77
- o.children && (o.checked = g(o.children)), o.checked || (n = !1);
78
- return n;
82
+ const I = (o) => {
83
+ let c = o.length > 0;
84
+ for (const a of o)
85
+ a.children && (a.checked = I(a.children)), a.checked || (c = !1);
86
+ return c;
79
87
  };
80
- g(i), g(s);
81
- const _ = [
88
+ I(s), I(l);
89
+ const G = [
82
90
  {
83
91
  id: "root-frozen",
84
- label: D("dataTable.frozenColumns"),
85
- checked: a > 0 && $ === a,
86
- children: i,
92
+ label: L("dataTable.frozenColumns"),
93
+ checked: d > 0 && j === d,
94
+ children: s,
87
95
  category: "structure",
88
96
  isDragDisabled: !0
89
97
  },
90
98
  {
91
99
  id: "root-scrollable",
92
- label: D("dataTable.scrollableColumns"),
93
- checked: m > 0 && d === m,
94
- children: s,
100
+ label: L("dataTable.scrollableColumns"),
101
+ checked: m > 0 && u === m,
102
+ children: l,
95
103
  category: "structure",
96
104
  isDragDisabled: !0
97
105
  }
98
106
  ];
99
- F(_), J(!0);
100
- }, [e, D]);
101
- B(() => {
102
- if (!e) return;
103
- const r = setTimeout(() => E(), 0), u = [
107
+ F(G), ee(!0);
108
+ }, [n, L]);
109
+ J(() => {
110
+ if (!n) return;
111
+ const r = setTimeout(() => x(), 0), i = [
104
112
  "columnVisible",
105
113
  "columnPinned",
106
114
  "columnMoved",
@@ -112,115 +120,163 @@ const ce = 300, q = 100, he = ({
112
120
  "columnEverythingChanged",
113
121
  "dragStopped",
114
122
  "columnValueChanged",
115
- "displayedColumnsChanged"
123
+ "displayedColumnsChanged",
124
+ "sortChanged",
125
+ "filterChanged"
116
126
  ];
117
- let c = null;
118
- const i = () => {
119
- c && clearTimeout(c), c = setTimeout(() => {
120
- if (c = null, k.current) return;
121
- const s = z.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
122
- s && (x.current = s.scrollTop), E(), Q((t) => !t);
127
+ let t = null;
128
+ const s = () => {
129
+ t && clearTimeout(t), t = setTimeout(() => {
130
+ if (t = null, N.current) return;
131
+ const l = $.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
132
+ l && (M.current = l.scrollTop), x(), te((e) => !e);
123
133
  }, 150);
124
134
  };
125
- return e.isDestroyed() || u.forEach((s) => e.addEventListener(s, i)), () => {
126
- clearTimeout(r), c && clearTimeout(c), e.isDestroyed() || u.forEach((s) => e.removeEventListener(s, i));
135
+ return n.isDestroyed() || i.forEach((l) => n.addEventListener(l, s)), () => {
136
+ clearTimeout(r), t && clearTimeout(t), n.isDestroyed() || i.forEach((l) => n.removeEventListener(l, s));
127
137
  };
128
- }, [e, E]), B(() => {
129
- if (x.current === 0) return;
138
+ }, [n, x]), J(() => {
139
+ if (M.current === 0) return;
130
140
  const r = requestAnimationFrame(() => {
131
- const u = z.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
132
- u && (u.scrollTop = x.current, x.current = 0);
141
+ const i = $.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
142
+ i && (i.scrollTop = M.current, M.current = 0);
133
143
  });
134
144
  return () => cancelAnimationFrame(r);
135
- }, [K]);
136
- const V = L((r) => {
137
- const u = [], c = (i, s) => {
138
- i.forEach((t) => {
139
- if (t.id === "root-frozen") {
140
- t.children && c(t.children, "left");
145
+ }, [B]);
146
+ const Y = g((r) => {
147
+ const i = [], t = (s, l) => {
148
+ s.forEach((e) => {
149
+ if (e.id === "root-frozen") {
150
+ e.children && t(e.children, "left");
141
151
  return;
142
152
  }
143
- if (t.id === "root-scrollable") {
144
- t.children && c(t.children, null);
153
+ if (e.id === "root-scrollable") {
154
+ e.children && t(e.children, null);
145
155
  return;
146
156
  }
147
- t.category === "group" || t.children && t.children.length > 0 ? t.children && c(t.children, s) : e?.getColumn(t.id) && u.push({
148
- colId: t.id,
149
- pinned: s,
150
- hide: !t.checked
151
- });
157
+ if (e.category === "group" || e.children && e.children.length > 0)
158
+ e.children && t(e.children, l);
159
+ else if (n?.getColumn(e.id)) {
160
+ let p;
161
+ if (l === null)
162
+ p = null;
163
+ else {
164
+ const h = e.data?.pinned;
165
+ p = h === "left" || h === "right" ? h : l;
166
+ }
167
+ i.push({
168
+ colId: e.id,
169
+ pinned: p,
170
+ hide: !e.checked
171
+ });
172
+ }
152
173
  });
153
174
  };
154
- return c(r, null), u;
155
- }, [e]), A = L((r) => {
156
- if (!e) return;
157
- k.current = !0;
158
- const u = V(r);
159
- if (u.length === 0) {
175
+ return t(r, null), i;
176
+ }, [n]), z = g((r) => {
177
+ if (!n) return;
178
+ N.current = !0;
179
+ const i = Y(r);
180
+ if (i.length === 0) {
160
181
  setTimeout(() => {
161
- k.current = !1;
162
- }, q);
182
+ N.current = !1;
183
+ }, K);
163
184
  return;
164
185
  }
165
- const c = e.getColumnState(), i = le(c, u), s = new Set(c.filter((a) => a.pinned).map((a) => a.colId)), t = i.filter((a) => a.pinned && !s.has(a.colId)), S = new Set(t.map((a) => a.colId));
166
- e.applyColumnState({ state: i, applyOrder: !0 });
186
+ const t = n.getColumnState(), s = ue(t, i), l = new Set(t.filter((d) => d.pinned).map((d) => d.colId)), e = s.filter((d) => d.pinned && !l.has(d.colId)), v = new Set(e.map((d) => d.colId));
187
+ n.applyColumnState({ state: s, applyOrder: !0 });
167
188
  const f = () => {
168
- k.current = !1, E();
189
+ N.current = !1, x();
169
190
  };
170
- if (S.size === 0) {
171
- setTimeout(f, q);
191
+ if (v.size === 0) {
192
+ setTimeout(f, K);
172
193
  return;
173
194
  }
174
- let P = !1, G = null;
175
- const N = () => {
176
- if (P || e.isDestroyed()) return;
177
- const a = e.getColumnState();
178
- if (t.filter((m) => {
179
- const d = a.find((g) => g.colId === m.colId);
180
- return d && !d.pinned;
195
+ let p = !1, T = null;
196
+ const h = () => {
197
+ if (p || n.isDestroyed()) return;
198
+ const d = n.getColumnState();
199
+ if (e.filter((m) => {
200
+ const u = d.find((I) => I.colId === m.colId);
201
+ return u && !u.pinned;
181
202
  }).length > 0) {
182
- P = !0, G && clearTimeout(G), e.removeEventListener("columnPinned", N);
183
- const m = i.filter((d) => d.pinned && !S.has(d.colId));
203
+ p = !0, T && clearTimeout(T), n.removeEventListener("columnPinned", h);
204
+ const m = s.filter((u) => u.pinned && !v.has(u.colId));
184
205
  if (m.length > 0) {
185
- const d = m[0], g = i.map(
186
- (_) => _.colId === d.colId ? { ..._, pinned: null } : _
206
+ const u = m[0], I = s.map(
207
+ (G) => G.colId === u.colId ? { ...G, pinned: null } : G
187
208
  );
188
- e.applyColumnState({ state: g, applyOrder: !0 });
209
+ n.applyColumnState({ state: I, applyOrder: !0 });
189
210
  }
190
- setTimeout(f, q);
211
+ setTimeout(f, K);
191
212
  }
192
213
  };
193
- e.addEventListener("columnPinned", N), G = setTimeout(() => {
194
- e.removeEventListener("columnPinned", N), P || f();
195
- }, ce);
196
- }, [e, V, E]), X = L((r) => {
197
- A(r);
198
- }, [A]), Z = L((r) => {
199
- v || A(r), F(r);
200
- }, [v, A]);
201
- return H ? /* @__PURE__ */ U("div", { ref: z, className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ U(
202
- te,
214
+ n.addEventListener("columnPinned", h), T = setTimeout(() => {
215
+ n.removeEventListener("columnPinned", h), p || f();
216
+ }, ge);
217
+ }, [n, Y, x]), ne = g((r) => {
218
+ z(r);
219
+ }, [z]), re = g((r) => {
220
+ E || z(r), F(r);
221
+ }, [E, z]), H = g((r, i) => {
222
+ F((t) => {
223
+ const s = (l) => l.map((e) => e.id === r ? {
224
+ ...e,
225
+ data: {
226
+ ...e.data,
227
+ pinned: i
228
+ }
229
+ } : e.children ? {
230
+ ...e,
231
+ children: s(e.children)
232
+ } : e);
233
+ return s(t);
234
+ }), n && n.applyColumnState({
235
+ state: [{ colId: r, pinned: i }]
236
+ });
237
+ }, [n]), le = g((r, i) => {
238
+ if (!i.isLeaf) return null;
239
+ const t = r.data;
240
+ return !t?.hasSortApplied && !t?.hasFilterApplied ? null : /* @__PURE__ */ ce("span", { className: "inline-flex items-center gap-1 ml-1.5 shrink-0", children: [
241
+ t?.hasSortApplied && /* @__PURE__ */ y(Q, { type: "sort" }),
242
+ t?.hasFilterApplied && /* @__PURE__ */ y(Q, { type: "filter" })
243
+ ] });
244
+ }, []), oe = g((r, i) => {
245
+ const t = r.data;
246
+ return r.category === "structure" ? r.id !== "root-frozen" ? null : /* @__PURE__ */ y(pe, {}) : !i.isLeaf || !(t?.pinned === "left" || t?.pinned === "right") ? null : /* @__PURE__ */ y(
247
+ fe,
248
+ {
249
+ value: t?.pinned ?? null,
250
+ onChange: (l) => H(r.id, l),
251
+ className: "shrink-0"
252
+ }
253
+ );
254
+ }, [H]);
255
+ return Z ? /* @__PURE__ */ y("div", { ref: $, className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ y(
256
+ ae,
203
257
  {
204
- items: Y,
205
- onChange: Z,
206
- onSubmit: X,
207
- enableApplyDiscard: v,
208
- enableSearch: T,
209
- enableSelectAll: h,
258
+ items: X,
259
+ onChange: re,
260
+ onSubmit: ne,
261
+ renderLabelExtras: le,
262
+ renderActions: oe,
263
+ enableApplyDiscard: E,
264
+ enableSearch: P,
265
+ enableSelectAll: C,
210
266
  enableDragDrop: !0,
211
267
  enableCollapse: !0,
212
- enableGlobalCollapse: M,
213
- selectionMode: ne.CASCADE_DOWN,
214
- searchPlaceholder: D("dataTable.searchColumnsPlaceholder"),
268
+ enableGlobalCollapse: w,
269
+ selectionMode: de.CASCADE_DOWN,
270
+ searchPlaceholder: L("dataTable.searchColumnsPlaceholder"),
215
271
  className: "h-full",
216
- initialCollapsedItems: W.current,
272
+ initialCollapsedItems: V.current,
217
273
  onCollapseChange: (r) => {
218
- W.current = r;
274
+ V.current = r;
219
275
  }
220
276
  },
221
- K ? "sync-a" : "sync-b"
222
- ) }) : /* @__PURE__ */ U("div", { className: "p-4 text-[13px] text-content-placeholder", children: D("dataTable.loadingColumns") });
277
+ B ? "sync-a" : "sync-b"
278
+ ) }) : /* @__PURE__ */ y("div", { className: "p-4 text-[13px] text-content-placeholder", children: L("dataTable.loadingColumns") });
223
279
  };
224
280
  export {
225
- he as DataTableColumnList
281
+ Ee as DataTableColumnList
226
282
  };
@@ -1,21 +1,21 @@
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 y, memo as E } from "react";
3
- import { AgGridWrapper as F } from "../ag-grid-react/index.js";
4
- import { cn as _ } from "../../../lib/utils.js";
5
- import { DataTableContext as N, DataTableSheetPortalContext as M, useDataTable as z, useDataTableSheetPortal as I } from "./data-table-context.js";
6
- import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as j } from "./data-table-constants.js";
1
+ import { jsx as i, jsxs as E } from "react/jsx-runtime";
2
+ import { useState as l, useRef as F, useCallback as _, useMemo as S, useEffect as A, memo as N } from "react";
3
+ import { AgGridWrapper as M } from "../ag-grid-react/index.js";
4
+ import { cn as y } from "../../../lib/utils.js";
5
+ import { DataTableContext as z, DataTableSheetPortalContext as I, useDataTable as j, useDataTableSheetPortal as P } from "./data-table-context.js";
6
+ import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as R } from "./data-table-constants.js";
7
7
  import { AG_GRID_VALUE_FORMATTERS as k } from "../ag-grid-react/value-formatters.js";
8
- const w = {
8
+ const C = {
9
9
  default: 46,
10
10
  compact: 30,
11
11
  comfort: 52
12
- }, P = (o) => {
12
+ }, G = (o) => {
13
13
  if (o)
14
14
  return o.map((e) => {
15
15
  if ("children" in e && e.children)
16
16
  return {
17
17
  ...e,
18
- children: P(e.children)
18
+ children: G(e.children)
19
19
  };
20
20
  const t = e;
21
21
  return !t.valueFormatter && (t.type === "numericColumn" || t.type === "number") ? {
@@ -27,65 +27,65 @@ const w = {
27
27
  children: o,
28
28
  className: e
29
29
  }) => {
30
- const [t, r] = l(null), [n, p] = l(null), [s, h] = l("medium"), [c, d] = l("full"), [u, f] = l("default"), [g, S] = l(!1), m = O(0), x = H((v) => {
31
- m.current = Math.max(0, m.current + v), S(m.current > 0);
32
- }, []), T = H((v) => {
33
- r(v);
34
- }, []), a = {
30
+ const [t, r] = l(null), [n, p] = l(null), [c, d] = l("medium"), [h, u] = l("full"), [s, f] = l("default"), [g, b] = l(!1), m = F(0), x = _((H) => {
31
+ m.current = Math.max(0, m.current + H), b(m.current > 0);
32
+ }, []), T = _((H) => {
33
+ r(H);
34
+ }, []), v = {
35
35
  small: "12px",
36
36
  medium: "14px",
37
37
  large: "16px"
38
- }[s], R = `${w[u]}px`, C = b(() => ({
38
+ }[c], a = `${C[s]}px`, O = S(() => ({
39
39
  gridApi: t,
40
40
  registerApi: T,
41
41
  registerScopedSheetDepth: x,
42
- fontSize: s,
43
- setFontSize: h,
44
- numericFormat: c,
45
- setNumericFormat: d,
46
- rowHeight: u,
42
+ fontSize: c,
43
+ setFontSize: d,
44
+ numericFormat: h,
45
+ setNumericFormat: u,
46
+ rowHeight: s,
47
47
  setRowHeight: f
48
48
  }), [
49
49
  t,
50
50
  T,
51
51
  x,
52
- s,
53
- h,
54
52
  c,
55
53
  d,
54
+ h,
56
55
  u,
56
+ s,
57
57
  f
58
- ]), G = b(() => ({
58
+ ]), D = S(() => ({
59
59
  sheetTarget: n,
60
60
  setSheetTarget: p,
61
61
  scopedSheetOpen: g
62
62
  }), [n, p, g]);
63
- return /* @__PURE__ */ i(N.Provider, { value: C, children: /* @__PURE__ */ i(M.Provider, { value: G, children: /* @__PURE__ */ i(
63
+ return /* @__PURE__ */ i(z.Provider, { value: O, children: /* @__PURE__ */ i(I.Provider, { value: D, children: /* @__PURE__ */ i(
64
64
  "div",
65
65
  {
66
66
  "data-component": "data-table",
67
- className: _("flex flex-col w-full min-h-0 rounded-[inherit]", e),
67
+ className: y("flex flex-col w-full min-h-0 rounded-[inherit]", e),
68
68
  style: {
69
- "--ag-font-size": a,
70
- "--ag-row-height": R
69
+ "--ag-font-size": v,
70
+ "--ag-row-height": a
71
71
  },
72
72
  children: o
73
73
  }
74
74
  ) }) });
75
- }, A = {
75
+ }, w = {
76
76
  full: "full_no",
77
77
  k: "thou",
78
78
  m: "mil",
79
79
  b: "bil",
80
80
  full_precision: "full_precision"
81
- }, L = E(function() {
82
- const { setSheetTarget: e, scopedSheetOpen: t } = I();
81
+ }, L = N(function() {
82
+ const { setSheetTarget: e, scopedSheetOpen: t } = P();
83
83
  return /* @__PURE__ */ i(
84
84
  "div",
85
85
  {
86
86
  ref: e,
87
87
  className: "absolute inset-0 pointer-events-none z-[39] flex overflow-x-hidden overflow-y-visible",
88
- style: t ? { minHeight: j } : void 0
88
+ style: t ? { minHeight: R } : void 0
89
89
  }
90
90
  );
91
91
  });
@@ -95,49 +95,50 @@ function J(o) {
95
95
  rowHeight: t,
96
96
  gridApi: r,
97
97
  numericFormat: n
98
- } = z(), {
99
- className: p,
100
- onGridReady: s,
98
+ } = j(), { scopedSheetOpen: p } = P(), {
99
+ className: c,
100
+ onGridReady: d,
101
101
  rowHeight: h,
102
- context: c,
103
- columnDefs: d,
104
- maintainColumnOrder: u = !0,
105
- ...f
106
- } = o, g = w[t], S = h ?? g, m = b(() => P(d), [d]), x = b(() => ({
107
- ...c,
108
- formatType: A[n]
109
- }), [c, n]);
110
- y(() => {
102
+ context: u,
103
+ columnDefs: s,
104
+ maintainColumnOrder: f = !0,
105
+ ...g
106
+ } = o, b = C[t], m = h ?? b, x = S(() => G(s), [s]), T = S(() => ({
107
+ ...u,
108
+ formatType: w[n]
109
+ }), [u, n]);
110
+ A(() => {
111
111
  r?.resetRowHeights();
112
- }, [t, r]), y(() => {
112
+ }, [t, r]), A(() => {
113
113
  if (r) {
114
114
  const a = r.getGridOption("context") || {};
115
115
  r.setGridOption("context", {
116
116
  ...a,
117
- formatType: A[n]
117
+ formatType: w[n]
118
118
  }), r.refreshCells({ force: !0 });
119
119
  }
120
120
  }, [n, r]);
121
- const T = H((a) => {
122
- e(a.api), s?.(a);
123
- }, [e, s]);
124
- return /* @__PURE__ */ D(
121
+ const v = _((a) => {
122
+ e(a.api), d?.(a);
123
+ }, [e, d]);
124
+ return /* @__PURE__ */ E(
125
125
  "div",
126
126
  {
127
- className: _(
127
+ className: y(
128
128
  "relative flex-1 min-h-0 w-full bg-canvas-elevated rounded-b-[inherit] grid-rounded-bottom",
129
- p
129
+ c
130
130
  ),
131
+ style: p ? { minHeight: R } : void 0,
131
132
  children: [
132
133
  /* @__PURE__ */ i(
133
- F,
134
+ M,
134
135
  {
135
- ...f,
136
- columnDefs: m,
137
- rowHeight: S,
138
- onGridReady: T,
139
- context: x,
140
- maintainColumnOrder: u
136
+ ...g,
137
+ columnDefs: x,
138
+ rowHeight: m,
139
+ onGridReady: v,
140
+ context: T,
141
+ maintainColumnOrder: f
141
142
  }
142
143
  ),
143
144
  /* @__PURE__ */ i(L, {})
@@ -148,7 +149,7 @@ function J(o) {
148
149
  const K = ({
149
150
  children: o,
150
151
  className: e
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 });
152
+ }) => /* @__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 });
152
153
  export {
153
154
  q as DataTable,
154
155
  J as DataTableContent,
@@ -6,4 +6,7 @@ export * from './data-table-format-options';
6
6
  export * from './data-table-sheet';
7
7
  export * from './data-table-view-menu';
8
8
  export * from './data-table-saved-views';
9
+ export * from './pin-switch';
10
+ export * from './column-indicator';
11
+ export * from './indicator-legend';
9
12
  export type { SavedTableViewItem, TableViewTypeOption, DataTableSavedViewsProps, DataTableSavedViewsActionContext, DataTableSavedViewsCancelContext, } from '../types/data-table-saved-views.types';