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
|
|
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
|
-
|
|
788
|
+
lt as Calendar,
|
|
790
789
|
Qe as CalendarDayButton
|
|
791
790
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
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:
|
|
11
|
-
showSelectAll:
|
|
12
|
-
showCollapse:
|
|
10
|
+
showSearch: F = !0,
|
|
11
|
+
showSelectAll: q = !0,
|
|
12
|
+
showCollapse: j = !0
|
|
13
13
|
}) => {
|
|
14
|
-
const { gridApi:
|
|
15
|
-
if (!
|
|
16
|
-
const o =
|
|
17
|
-
|
|
18
|
-
const c =
|
|
19
|
-
const n =
|
|
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 =
|
|
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(
|
|
31
|
+
return a.push(x), k.set(u, { list: a, node: x }), x;
|
|
32
32
|
};
|
|
33
|
-
let E = 0,
|
|
34
|
-
o.forEach((
|
|
35
|
-
const a = i.get(
|
|
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 =
|
|
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 ||
|
|
42
|
+
n = h.headerName || h.field || t.colId;
|
|
43
43
|
}
|
|
44
44
|
if (!n || n.trim() === "")
|
|
45
45
|
return;
|
|
46
|
-
const u = !
|
|
47
|
-
id:
|
|
46
|
+
const u = !t.hide, d = {
|
|
47
|
+
id: t.colId,
|
|
48
48
|
label: n,
|
|
49
49
|
checked: u
|
|
50
50
|
};
|
|
51
|
-
|
|
52
|
-
const m =
|
|
53
|
-
S?.getColGroupDef()?.children ?
|
|
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 = (
|
|
56
|
-
let a =
|
|
57
|
-
for (const n of
|
|
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(
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
|
100
|
-
f.current = !1, g(),
|
|
102
|
+
const r = !f.current;
|
|
103
|
+
f.current = !1, g(), r && O((e) => !e);
|
|
101
104
|
}, 150);
|
|
102
105
|
};
|
|
103
|
-
return
|
|
104
|
-
clearTimeout(o), c && clearTimeout(c),
|
|
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
|
-
}, [
|
|
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
|
-
}, [
|
|
114
|
-
const
|
|
115
|
-
const s = [], c = (i,
|
|
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,
|
|
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:
|
|
130
|
+
pinned: r,
|
|
128
131
|
hide: !e.checked
|
|
129
132
|
});
|
|
130
133
|
});
|
|
131
134
|
};
|
|
132
135
|
return c(o, null), s;
|
|
133
|
-
}, [
|
|
134
|
-
if (!
|
|
136
|
+
}, [l]), y = C((o) => {
|
|
137
|
+
if (!l) return;
|
|
135
138
|
f.current = !0;
|
|
136
|
-
const s =
|
|
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 =
|
|
144
|
-
|
|
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
|
|
150
|
-
|
|
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
|
-
}, [
|
|
155
|
+
}, [l, P, g]), L = C((o) => {
|
|
153
156
|
y(o);
|
|
154
|
-
}, [y]),
|
|
155
|
-
T || y(o),
|
|
157
|
+
}, [y]), U = C((o) => {
|
|
158
|
+
T || y(o), w(o);
|
|
156
159
|
}, [T, y]);
|
|
157
|
-
return
|
|
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:
|
|
161
|
-
onChange:
|
|
162
|
-
onSubmit:
|
|
163
|
+
items: K,
|
|
164
|
+
onChange: U,
|
|
165
|
+
onSubmit: L,
|
|
163
166
|
enableApplyDiscard: T,
|
|
164
|
-
enableSearch:
|
|
165
|
-
enableSelectAll:
|
|
167
|
+
enableSearch: F,
|
|
168
|
+
enableSelectAll: q,
|
|
166
169
|
enableDragDrop: !0,
|
|
167
170
|
enableCollapse: !0,
|
|
168
|
-
enableGlobalCollapse:
|
|
171
|
+
enableGlobalCollapse: j,
|
|
169
172
|
selectionMode: Y.CASCADE_DOWN,
|
|
170
173
|
searchPlaceholder: p("dataTable.searchColumnsPlaceholder"),
|
|
171
174
|
className: "h-full"
|
|
172
175
|
},
|
|
173
|
-
|
|
174
|
-
) }) : /* @__PURE__ */
|
|
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.
|
|
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",
|