impact-nova 1.7.27 → 1.7.29

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,5 +1,5 @@
1
- import { jsx as N } from "react/jsx-runtime";
2
- import { useState as w, useRef as I, useCallback as C, useEffect as F } from "react";
1
+ import { jsx as R } from "react/jsx-runtime";
2
+ import { useState as N, useRef as I, useCallback as C, useEffect as A } from "react";
3
3
  import { useDataTable as Q } from "./data-table-context.js";
4
4
  import { NestedList as X } from "../nested-list/nested-list.js";
5
5
  import { SelectionMode as Y } from "../types/nested-list.types.js";
@@ -7,77 +7,80 @@ import { mergePartialOrderedColumnState as Z } from "./data-table-column-state.j
7
7
  import { useImpactNovaI18n as ee } from "../../../i18n/ImpactNovaI18nContext.js";
8
8
  const ue = ({
9
9
  enableApplyDiscard: T = !1,
10
- showSearch: q = !0,
11
- showSelectAll: j = !0,
12
- showCollapse: K = !0
10
+ showSearch: F = !0,
11
+ showSelectAll: q = !0,
12
+ showCollapse: j = !0
13
13
  }) => {
14
- const { gridApi: r } = Q(), { t: p } = ee(), [V, z] = w([]), [W, B] = w(!1), f = I(!1), v = I(null), b = I(0), [O, P] = w(!1), L = I(/* @__PURE__ */ new Map()), g = C(() => {
15
- if (!r || f.current) return;
16
- const o = r.getColumnState(), s = new Map(o.map((l) => [l.colId, l]));
17
- L.current = s;
18
- const c = r.getColumns() || [], i = new Map(c.map((l) => [l.getColId(), l])), t = [], e = [], k = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), J = (l, a) => {
19
- const n = l.getGroupId(), u = `${n}::${a === t ? "f" : "s"}`, d = k.get(u);
14
+ const { gridApi: l } = Q(), { t: p } = ee(), [K, w] = N([]), [V, W] = N(!1), f = I(!1), v = I(null), b = I(0), [z, O] = N(!1), B = I(/* @__PURE__ */ new Map()), g = C(() => {
15
+ if (!l || f.current) return;
16
+ const o = l.getColumnState(), s = new Map(o.map((t) => [t.colId, t]));
17
+ B.current = s;
18
+ const c = l.getColumns() || [], i = new Map(c.map((t) => [t.getColId(), t])), r = [], e = [], k = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), H = (t, a) => {
19
+ const n = t.getGroupId(), u = `${n}::${a === r ? "f" : "s"}`, d = k.get(u);
20
20
  if (d && d.list === a && a[a.length - 1] === d.node)
21
21
  return d.node;
22
22
  const m = D.get(u) || 0;
23
23
  D.set(u, m + 1);
24
- const S = l.getColGroupDef(), h = a === t ? "f" : "s", R = {
24
+ const S = t.getColGroupDef(), h = a === r ? "f" : "s", x = {
25
25
  id: m === 0 ? `${n}__${h}` : `${n}__${h}__${m}`,
26
26
  label: S?.headerName || n,
27
27
  checked: !0,
28
28
  children: [],
29
29
  category: "group"
30
30
  };
31
- return a.push(R), k.set(u, { list: a, node: R }), R;
31
+ return a.push(x), k.set(u, { list: a, node: x }), x;
32
32
  };
33
- let E = 0, $ = 0, G = 0, A = 0;
34
- o.forEach((l) => {
35
- const a = i.get(l.colId);
33
+ let E = 0, _ = 0, G = 0, $ = 0;
34
+ o.forEach((t) => {
35
+ const a = i.get(t.colId);
36
36
  if (!a) return;
37
- let n = r.getDisplayNameForColumn(a, "header");
37
+ let n = l.getDisplayNameForColumn(a, "header");
38
38
  if (n === "") return;
39
39
  if (n == null) {
40
40
  const h = a.getColDef();
41
41
  if (h.headerName === "") return;
42
- n = h.headerName || h.field || l.colId;
42
+ n = h.headerName || h.field || t.colId;
43
43
  }
44
44
  if (!n || n.trim() === "")
45
45
  return;
46
- const u = !l.hide, d = {
47
- id: l.colId,
46
+ const u = !t.hide, d = {
47
+ id: t.colId,
48
48
  label: n,
49
49
  checked: u
50
50
  };
51
- l.pinned ? (E++, u && $++) : (G++, u && A++);
52
- const m = l.pinned ? t : e, S = a.getOriginalParent();
53
- S?.getColGroupDef()?.children ? J(S, m).children.push(d) : m.push(d);
51
+ t.pinned ? (E++, u && _++) : (G++, u && $++);
52
+ const m = t.pinned ? r : e, S = a.getOriginalParent();
53
+ S?.getColGroupDef()?.children ? H(S, m).children.push(d) : m.push(d);
54
54
  });
55
- const M = (l) => {
56
- let a = l.length > 0;
57
- for (const n of l)
55
+ const M = (t) => {
56
+ let a = t.length > 0;
57
+ for (const n of t)
58
58
  n.children && (n.checked = M(n.children)), n.checked || (a = !1);
59
59
  return a;
60
60
  };
61
- M(t), M(e);
62
- const x = [];
63
- t.length > 0 && x.push({
64
- id: "root-frozen",
65
- label: p("dataTable.frozenColumns"),
66
- checked: E > 0 && $ === E,
67
- children: t,
68
- category: "structure",
69
- isDragDisabled: !0
70
- }), e.length > 0 && x.push({
71
- id: "root-scrollable",
72
- label: p("dataTable.scrollableColumns"),
73
- checked: G > 0 && A === G,
74
- children: e,
75
- category: "structure",
76
- isDragDisabled: !0
77
- }), z(x), B(!0);
78
- }, [r, p]);
79
- F(() => {
80
- if (!r) return;
61
+ M(r), M(e);
62
+ const J = [
63
+ {
64
+ id: "root-frozen",
65
+ label: p("dataTable.frozenColumns"),
66
+ checked: E > 0 && _ === E,
67
+ children: r,
68
+ category: "structure",
69
+ isDragDisabled: !0
70
+ },
71
+ {
72
+ id: "root-scrollable",
73
+ label: p("dataTable.scrollableColumns"),
74
+ checked: G > 0 && $ === G,
75
+ children: e,
76
+ category: "structure",
77
+ isDragDisabled: !0
78
+ }
79
+ ];
80
+ w(J), W(!0);
81
+ }, [l, p]);
82
+ A(() => {
83
+ if (!l) return;
81
84
  const o = setTimeout(() => g(), 0), s = [
82
85
  "columnVisible",
83
86
  "columnPinned",
@@ -96,23 +99,23 @@ const ue = ({
96
99
  const i = () => {
97
100
  c && clearTimeout(c), c = setTimeout(() => {
98
101
  c = null;
99
- const t = !f.current;
100
- f.current = !1, g(), t && P((e) => !e);
102
+ const r = !f.current;
103
+ f.current = !1, g(), r && O((e) => !e);
101
104
  }, 150);
102
105
  };
103
- return r.isDestroyed() || s.forEach((t) => r.addEventListener(t, i)), () => {
104
- clearTimeout(o), c && clearTimeout(c), r.isDestroyed() || s.forEach((t) => r.removeEventListener(t, i));
106
+ return l.isDestroyed() || s.forEach((r) => l.addEventListener(r, i)), () => {
107
+ clearTimeout(o), c && clearTimeout(c), l.isDestroyed() || s.forEach((r) => l.removeEventListener(r, i));
105
108
  };
106
- }, [r, g]), F(() => {
109
+ }, [l, g]), A(() => {
107
110
  if (b.current === 0) return;
108
111
  const o = requestAnimationFrame(() => {
109
112
  const s = v.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
110
113
  s && (s.scrollTop = b.current, b.current = 0);
111
114
  });
112
115
  return () => cancelAnimationFrame(o);
113
- }, [O]);
114
- const _ = C((o) => {
115
- const s = [], c = (i, t) => {
116
+ }, [z]);
117
+ const P = C((o) => {
118
+ const s = [], c = (i, r) => {
116
119
  i.forEach((e) => {
117
120
  if (e.id === "root-frozen") {
118
121
  e.children && c(e.children, "left");
@@ -122,56 +125,56 @@ const ue = ({
122
125
  e.children && c(e.children, null);
123
126
  return;
124
127
  }
125
- e.category === "group" || e.children && e.children.length > 0 ? e.children && c(e.children, t) : r?.getColumn(e.id) && s.push({
128
+ e.category === "group" || e.children && e.children.length > 0 ? e.children && c(e.children, r) : l?.getColumn(e.id) && s.push({
126
129
  colId: e.id,
127
- pinned: t,
130
+ pinned: r,
128
131
  hide: !e.checked
129
132
  });
130
133
  });
131
134
  };
132
135
  return c(o, null), s;
133
- }, [r]), y = C((o) => {
134
- if (!r) return;
136
+ }, [l]), y = C((o) => {
137
+ if (!l) return;
135
138
  f.current = !0;
136
- const s = _(o);
139
+ const s = P(o);
137
140
  if (s.length === 0) {
138
141
  setTimeout(() => {
139
142
  f.current = !1;
140
143
  }, 300);
141
144
  return;
142
145
  }
143
- const c = r.getColumnState(), i = Z(c, s);
144
- r.applyColumnState({
146
+ const c = l.getColumnState(), i = Z(c, s);
147
+ l.applyColumnState({
145
148
  state: i,
146
149
  applyOrder: !0
147
150
  }), setTimeout(() => {
148
151
  f.current = !1;
149
- const t = v.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
150
- t && (b.current = t.scrollTop), g(), P((e) => !e);
152
+ const r = v.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
153
+ r && (b.current = r.scrollTop), g(), O((e) => !e);
151
154
  }, 300);
152
- }, [r, _, g]), U = C((o) => {
155
+ }, [l, P, g]), L = C((o) => {
153
156
  y(o);
154
- }, [y]), H = C((o) => {
155
- T || y(o), z(o);
157
+ }, [y]), U = C((o) => {
158
+ T || y(o), w(o);
156
159
  }, [T, y]);
157
- return W ? /* @__PURE__ */ N("div", { ref: v, className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ N(
160
+ return V ? /* @__PURE__ */ R("div", { ref: v, className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ R(
158
161
  X,
159
162
  {
160
- items: V,
161
- onChange: H,
162
- onSubmit: U,
163
+ items: K,
164
+ onChange: U,
165
+ onSubmit: L,
163
166
  enableApplyDiscard: T,
164
- enableSearch: q,
165
- enableSelectAll: j,
167
+ enableSearch: F,
168
+ enableSelectAll: q,
166
169
  enableDragDrop: !0,
167
170
  enableCollapse: !0,
168
- enableGlobalCollapse: K,
171
+ enableGlobalCollapse: j,
169
172
  selectionMode: Y.CASCADE_DOWN,
170
173
  searchPlaceholder: p("dataTable.searchColumnsPlaceholder"),
171
174
  className: "h-full"
172
175
  },
173
- O ? "sync-a" : "sync-b"
174
- ) }) : /* @__PURE__ */ N("div", { className: "p-4 text-[13px] text-content-placeholder", children: p("dataTable.loadingColumns") });
176
+ z ? "sync-a" : "sync-b"
177
+ ) }) : /* @__PURE__ */ R("div", { className: "p-4 text-[13px] text-content-placeholder", children: p("dataTable.loadingColumns") });
175
178
  };
176
179
  export {
177
180
  ue as DataTableColumnList
@@ -239,11 +239,15 @@ export interface GridHeaderMessages {
239
239
  columnWidth: string;
240
240
  autosizeThisColumn: string;
241
241
  autosizeAllColumns: string;
242
+ autosizeAllVisibleColumns: string;
242
243
  searchOptions: string;
243
244
  advanceSearch: string;
244
245
  clickForDetails: string;
245
246
  information: string;
246
247
  noInformationAvailable: string;
248
+ columnOptions: string;
249
+ chooseColumns: string;
250
+ resetColumns: string;
247
251
  }
248
252
  export interface ImpactNovaMessages {
249
253
  calendar: CalendarMessages;
@@ -80,7 +80,7 @@ const e = {
80
80
  dropHere: "Drop here",
81
81
  releaseToDrop: "Release to drop",
82
82
  dragHere: "Drag here"
83
- }, r = {
83
+ }, n = {
84
84
  frozenColumns: "Frozen Columns",
85
85
  scrollableColumns: "Scrollable Columns",
86
86
  searchColumnsPlaceholder: "Search columns...",
@@ -135,7 +135,7 @@ const e = {
135
135
  toggle: "Toggle",
136
136
  more: "More",
137
137
  loading: "Loading"
138
- }, n = {
138
+ }, r = {
139
139
  cancel: "Cancel",
140
140
  confirm: "Confirm"
141
141
  }, c = {
@@ -210,20 +210,24 @@ const e = {
210
210
  columnWidth: "Column width",
211
211
  autosizeThisColumn: "Autosize This Column",
212
212
  autosizeAllColumns: "Autosize All Columns",
213
+ autosizeAllVisibleColumns: "Autosize All Visible Columns",
213
214
  searchOptions: "Search Options",
214
215
  advanceSearch: "Advance Search",
215
216
  clickForDetails: "Click for details",
216
217
  information: "Information",
217
- noInformationAvailable: "No information available for this column."
218
+ noInformationAvailable: "No information available for this column.",
219
+ columnOptions: "Column Options",
220
+ chooseColumns: "Choose Columns",
221
+ resetColumns: "Reset Columns"
218
222
  }, v = {
219
223
  calendar: e,
220
224
  datePicker: t,
221
225
  filter: a,
222
226
  select: o,
223
227
  nestedList: s,
224
- dataTable: r,
228
+ dataTable: n,
225
229
  aria: i,
226
- prompt: n,
230
+ prompt: r,
227
231
  filterStrip: c,
228
232
  filterPanel: d,
229
233
  advancedFilter: f,
@@ -210,6 +210,10 @@ const e = {
210
210
  columnWidth: "Spaltenbreite",
211
211
  autosizeThisColumn: "Diese Spalte anpassen",
212
212
  autosizeAllColumns: "Alle Spalten anpassen",
213
+ autosizeAllVisibleColumns: "Alle sichtbaren Spalten anpassen",
214
+ columnOptions: "Spaltenoptionen",
215
+ chooseColumns: "Spalten auswählen",
216
+ resetColumns: "Spalten zurücksetzen",
213
217
  searchOptions: "Suchoptionen",
214
218
  advanceSearch: "Erweiterte Suche",
215
219
  clickForDetails: "Klicken für Details",
@@ -210,6 +210,10 @@ const e = {
210
210
  columnWidth: "Ancho de columna",
211
211
  autosizeThisColumn: "Ajustar esta columna",
212
212
  autosizeAllColumns: "Ajustar todas las columnas",
213
+ autosizeAllVisibleColumns: "Ajustar todas las columnas visibles",
214
+ columnOptions: "Opciones de columna",
215
+ chooseColumns: "Elegir columnas",
216
+ resetColumns: "Restablecer columnas",
213
217
  searchOptions: "Opciones de búsqueda",
214
218
  advanceSearch: "Búsqueda avanzada",
215
219
  clickForDetails: "Clic para más detalles",
@@ -210,6 +210,10 @@ const e = {
210
210
  columnWidth: "कॉलम चौड़ाई",
211
211
  autosizeThisColumn: "इस कॉलम का आकार स्वचालित करें",
212
212
  autosizeAllColumns: "सभी कॉलम का आकार स्वचालित करें",
213
+ autosizeAllVisibleColumns: "सभी दृश्य कॉलम का आकार स्वचालित करें",
214
+ columnOptions: "कॉलम विकल्प",
215
+ chooseColumns: "कॉलम चुनें",
216
+ resetColumns: "कॉलम रीसेट करें",
213
217
  searchOptions: "खोज विकल्प",
214
218
  advanceSearch: "उन्नत खोज",
215
219
  clickForDetails: "विवरण के लिए क्लिक करें",
@@ -210,6 +210,10 @@ const e = {
210
210
  columnWidth: "ಕಾಲಮ್ ಅಗಲ",
211
211
  autosizeThisColumn: "ಈ ಕಾಲಮ್ ಸ್ವಯಂ-ಗಾತ್ರ",
212
212
  autosizeAllColumns: "ಎಲ್ಲಾ ಕಾಲಮ್‌ಗಳು ಸ್ವಯಂ-ಗಾತ್ರ",
213
+ autosizeAllVisibleColumns: "ಎಲ್ಲಾ ದೃಶ್ಯ ಕಾಲಮ್‌ಗಳನ್ನು ಸ್ವಯಂ-ಗಾತ್ರ ಮಾಡಿ",
214
+ columnOptions: "ಕಾಲಮ್ ಆಯ್ಕೆಗಳು",
215
+ chooseColumns: "ಕಾಲಮ್‌ಗಳನ್ನು ಆರಿಸಿ",
216
+ resetColumns: "ಕಾಲಮ್‌ಗಳನ್ನು ಮರುಹೊಂದಿಸಿ",
213
217
  searchOptions: "ಹುಡುಕಾಟ ಆಯ್ಕೆಗಳು",
214
218
  advanceSearch: "ಸುಧಾರಿತ ಹುಡುಕಾಟ",
215
219
  clickForDetails: "ವಿವರಗಳಿಗಾಗಿ ಕ್ಲಿಕ್ ಮಾಡಿ",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impact-nova",
3
- "version": "1.7.27",
3
+ "version": "1.7.29",
4
4
  "description": "Enterprise-grade React design system built with React 19, Vite, Tailwind CSS, and Radix UI. Built-in internationalization (i18n) and comprehensive UI component library for scalable, accessible, and performant applications.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",