impact-nova 1.7.27 → 1.7.28

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.
@@ -4,13 +4,12 @@ import { ChevronLeftIcon as ye, ChevronRightIcon as Ne } from "lucide-react";
4
4
  import { getDefaultClassNames as Be, DayPicker as Fe } from "react-day-picker";
5
5
  import { cn as u } from "../../lib/utils.js";
6
6
  import { Button as I } from "./button.js";
7
- import "./button-variants.js";
8
7
  import ue from "./select/select.js";
9
8
  import { FISCAL_PATTERNS as Ke, resolveWeekSelection as We } from "../../lib/fiscal-calendar.js";
10
9
  import { getIntlLocale as qe, getDateFnsLocale as Ge } from "../../i18n/getDateFnsLocale.js";
11
10
  import { useImpactNovaI18n as Je } from "../../i18n/ImpactNovaI18nContext.js";
12
11
  const de = d.createContext(0);
13
- function ot({
12
+ function lt({
14
13
  className: le,
15
14
  classNames: J,
16
15
  showOutsideDays: y = !1,
@@ -786,6 +785,6 @@ function Qe({
786
785
  );
787
786
  }
788
787
  export {
789
- ot as Calendar,
788
+ lt as Calendar,
790
789
  Qe as CalendarDayButton
791
790
  };
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impact-nova",
3
- "version": "1.7.27",
3
+ "version": "1.7.28",
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",