impact-nova 1.7.30 → 1.7.32
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.
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.d.ts +2 -0
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +69 -67
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +2 -0
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +107 -71
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +277 -213
- package/dist/components/ui/ag-grid-react/headers/utils/date-utils.d.ts +11 -1
- package/dist/components/ui/ag-grid-react/headers/utils/date-utils.js +34 -20
- package/dist/components/ui/ag-grid-react/index.js +16 -15
- package/dist/components/ui/date-picker/date-range-picker.js +182 -165
- package/dist/components/ui/date-picker/month-range-picker.js +221 -166
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +98 -93
- package/dist/components/ui/nested-list/components/SortableItem.d.ts +1 -0
- package/dist/components/ui/nested-list/components/SortableItem.js +37 -36
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +2 -1
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +173 -160
- package/dist/components/ui/nested-list/nested-list.js +200 -196
- package/dist/components/ui/types/ag-grid.types.d.ts +2 -0
- package/dist/components/ui/types/horizontal-scroller.types.d.ts +4 -0
- package/dist/components/ui/types/nested-list.types.d.ts +1 -0
- package/dist/impact-nova.css +1 -1
- package/package.json +1 -1
|
@@ -1,156 +1,160 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { ChevronRight as
|
|
4
|
-
import { useVirtualizer as
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { ChevronRight as j } from "lucide-react";
|
|
4
|
+
import { useVirtualizer as I } from "@tanstack/react-virtual";
|
|
5
5
|
import { cn as h } from "../../../lib/utils.js";
|
|
6
|
-
import { Button as
|
|
7
|
-
import { useImpactNovaI18n as
|
|
8
|
-
const
|
|
6
|
+
import { Button as O } from "../button.js";
|
|
7
|
+
import { useImpactNovaI18n as T } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
8
|
+
const $ = o.forwardRef(
|
|
9
9
|
({
|
|
10
10
|
className: N,
|
|
11
|
-
items:
|
|
12
|
-
renderItem:
|
|
13
|
-
scrollStep:
|
|
14
|
-
hideScrollbar:
|
|
15
|
-
controlsPosition:
|
|
16
|
-
renderPrevious:
|
|
17
|
-
renderNext:
|
|
18
|
-
maxWidth:
|
|
11
|
+
items: d,
|
|
12
|
+
renderItem: C,
|
|
13
|
+
scrollStep: p = 200,
|
|
14
|
+
hideScrollbar: u = !0,
|
|
15
|
+
controlsPosition: v = "right",
|
|
16
|
+
renderPrevious: x,
|
|
17
|
+
renderNext: g,
|
|
18
|
+
maxWidth: R = "100%",
|
|
19
19
|
estimateSize: m = 200,
|
|
20
|
-
overscan:
|
|
21
|
-
...
|
|
22
|
-
},
|
|
23
|
-
const { t:
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
count:
|
|
27
|
-
getScrollElement: () =>
|
|
20
|
+
overscan: L = 5,
|
|
21
|
+
...B
|
|
22
|
+
}, E) => {
|
|
23
|
+
const { t: b } = T(), r = o.useRef(null), [n, H] = o.useState(!1), [s, V] = o.useState(!1);
|
|
24
|
+
o.useImperativeHandle(E, () => r.current);
|
|
25
|
+
const c = I({
|
|
26
|
+
count: d.length,
|
|
27
|
+
getScrollElement: () => r.current,
|
|
28
28
|
estimateSize: typeof m == "function" ? m : () => m,
|
|
29
29
|
horizontal: !0,
|
|
30
|
-
overscan:
|
|
31
|
-
}),
|
|
32
|
-
const e =
|
|
33
|
-
e && (
|
|
30
|
+
overscan: L
|
|
31
|
+
}), W = c.getTotalSize(), f = o.useCallback(() => {
|
|
32
|
+
const e = r.current;
|
|
33
|
+
e && (H(e.scrollLeft > 0), V(Math.ceil(e.scrollLeft + e.clientWidth) < e.scrollWidth));
|
|
34
34
|
}, []);
|
|
35
|
-
|
|
36
|
-
const e =
|
|
35
|
+
o.useEffect(() => {
|
|
36
|
+
const e = r.current;
|
|
37
37
|
if (!e) return;
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
e.addEventListener("scroll",
|
|
41
|
-
const
|
|
42
|
-
|
|
38
|
+
f();
|
|
39
|
+
const l = () => f();
|
|
40
|
+
e.addEventListener("scroll", l);
|
|
41
|
+
const i = new ResizeObserver(() => {
|
|
42
|
+
f();
|
|
43
43
|
});
|
|
44
|
-
return
|
|
45
|
-
e.removeEventListener("scroll",
|
|
44
|
+
return i.observe(e), () => {
|
|
45
|
+
e.removeEventListener("scroll", l), i.disconnect();
|
|
46
46
|
};
|
|
47
|
-
}, [
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
},
|
|
47
|
+
}, [f, d, W]);
|
|
48
|
+
const w = () => {
|
|
49
|
+
r.current?.scrollBy({ left: -p, behavior: "smooth" });
|
|
50
|
+
}, z = () => {
|
|
51
|
+
r.current?.scrollBy({ left: p, behavior: "smooth" });
|
|
52
|
+
}, y = ({
|
|
53
53
|
direction: e,
|
|
54
|
-
onClick:
|
|
55
|
-
disabled:
|
|
54
|
+
onClick: l,
|
|
55
|
+
disabled: i
|
|
56
56
|
}) => {
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
|
|
57
|
+
if (i) return null;
|
|
58
|
+
const k = b(e === "left" ? "horizontalScroller.scrollLeft" : "horizontalScroller.scrollRight");
|
|
59
|
+
return /* @__PURE__ */ a(
|
|
60
|
+
O,
|
|
61
61
|
{
|
|
62
62
|
variant: "ghost",
|
|
63
63
|
size: "icon",
|
|
64
64
|
className: h(
|
|
65
65
|
"h-8 w-8 rounded-md bg-canvas-muted text-content-tertiary hover:bg-brand-tint hover:text-brand"
|
|
66
66
|
),
|
|
67
|
-
onClick:
|
|
68
|
-
disabled:
|
|
69
|
-
"aria-label":
|
|
67
|
+
onClick: l,
|
|
68
|
+
disabled: i,
|
|
69
|
+
"aria-label": k,
|
|
70
70
|
"data-component": e === "left" ? "horizontal-scroller-prev" : "horizontal-scroller-next",
|
|
71
71
|
children: [
|
|
72
72
|
/* @__PURE__ */ t(
|
|
73
|
-
|
|
73
|
+
j,
|
|
74
74
|
{
|
|
75
75
|
className: h("h-4 w-4", e === "left" && "rotate-180")
|
|
76
76
|
}
|
|
77
77
|
),
|
|
78
|
-
/* @__PURE__ */ t("span", { className: "sr-only", children:
|
|
78
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: k })
|
|
79
79
|
]
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
},
|
|
83
|
-
const e =
|
|
84
|
-
|
|
82
|
+
}, S = (() => {
|
|
83
|
+
const e = x ? x({ onClick: w, disabled: !n }) : /* @__PURE__ */ t(
|
|
84
|
+
y,
|
|
85
85
|
{
|
|
86
86
|
direction: "left",
|
|
87
|
-
onClick:
|
|
87
|
+
onClick: w,
|
|
88
88
|
disabled: !n
|
|
89
89
|
}
|
|
90
|
-
),
|
|
91
|
-
|
|
90
|
+
), l = g ? g({ onClick: z, disabled: !s }) : /* @__PURE__ */ t(
|
|
91
|
+
y,
|
|
92
92
|
{
|
|
93
93
|
direction: "right",
|
|
94
|
-
onClick:
|
|
95
|
-
disabled: !
|
|
94
|
+
onClick: z,
|
|
95
|
+
disabled: !s
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
|
-
return
|
|
99
|
-
/* @__PURE__ */ t("div", { className: "
|
|
100
|
-
/* @__PURE__ */ t("div", { className: "
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
98
|
+
return v === "split" ? {
|
|
99
|
+
left: n ? /* @__PURE__ */ t("div", { className: "flex-shrink-0", children: e }) : null,
|
|
100
|
+
right: s ? /* @__PURE__ */ t("div", { className: "flex-shrink-0", children: l }) : null
|
|
101
|
+
} : v === "left" ? {
|
|
102
|
+
left: n || s ? /* @__PURE__ */ a("div", { className: "flex-shrink-0 flex items-center gap-1", children: [
|
|
103
|
+
e,
|
|
104
|
+
l
|
|
105
|
+
] }) : null,
|
|
106
|
+
right: null
|
|
107
|
+
} : {
|
|
108
|
+
left: null,
|
|
109
|
+
right: n || s ? /* @__PURE__ */ a("div", { className: "flex-shrink-0 flex items-center gap-1", children: [
|
|
110
|
+
e,
|
|
111
|
+
l
|
|
112
|
+
] }) : null
|
|
113
|
+
};
|
|
114
|
+
})();
|
|
115
|
+
return /* @__PURE__ */ a(
|
|
110
116
|
"div",
|
|
111
117
|
{
|
|
112
118
|
className: h(
|
|
113
|
-
"
|
|
114
|
-
j(),
|
|
115
|
-
I(),
|
|
119
|
+
"flex items-center gap-2 min-w-0 w-full bg-transparent",
|
|
116
120
|
N
|
|
117
121
|
),
|
|
118
|
-
style: { maxWidth:
|
|
122
|
+
style: { maxWidth: R },
|
|
119
123
|
"data-component": "horizontal-scroller",
|
|
120
|
-
...
|
|
124
|
+
...B,
|
|
121
125
|
children: [
|
|
122
|
-
|
|
126
|
+
S.left,
|
|
123
127
|
/* @__PURE__ */ t(
|
|
124
128
|
"div",
|
|
125
129
|
{
|
|
126
|
-
ref:
|
|
130
|
+
ref: r,
|
|
127
131
|
className: h(
|
|
128
|
-
"flex w-
|
|
129
|
-
|
|
132
|
+
"flex flex-1 min-w-0 overflow-x-auto overflow-y-hidden whitespace-nowrap",
|
|
133
|
+
u && "scrollbar-hide",
|
|
130
134
|
"scroll-smooth"
|
|
131
135
|
),
|
|
132
136
|
style: {
|
|
133
|
-
scrollbarWidth:
|
|
134
|
-
msOverflowStyle:
|
|
137
|
+
scrollbarWidth: u ? "none" : "auto",
|
|
138
|
+
msOverflowStyle: u ? "none" : "auto"
|
|
135
139
|
},
|
|
136
140
|
"data-component": "horizontal-scroller-viewport",
|
|
137
|
-
children: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ a(
|
|
138
142
|
"div",
|
|
139
143
|
{
|
|
140
144
|
style: {
|
|
141
|
-
width: `${
|
|
145
|
+
width: `${c.getTotalSize()}px`,
|
|
142
146
|
display: "flex",
|
|
143
147
|
position: "relative"
|
|
144
148
|
},
|
|
145
149
|
children: [
|
|
146
|
-
/* @__PURE__ */ t("div", { style: { width: `${
|
|
147
|
-
|
|
150
|
+
/* @__PURE__ */ t("div", { style: { width: `${c.getVirtualItems()[0]?.start ?? 0}px`, flexShrink: 0 } }),
|
|
151
|
+
c.getVirtualItems().map((e) => /* @__PURE__ */ t(
|
|
148
152
|
"div",
|
|
149
153
|
{
|
|
150
|
-
ref:
|
|
154
|
+
ref: c.measureElement,
|
|
151
155
|
"data-index": e.index,
|
|
152
156
|
className: "flex-shrink-0",
|
|
153
|
-
children:
|
|
157
|
+
children: C(d[e.index], e.index)
|
|
154
158
|
},
|
|
155
159
|
e.key
|
|
156
160
|
))
|
|
@@ -158,13 +162,14 @@ const F = a.forwardRef(
|
|
|
158
162
|
}
|
|
159
163
|
)
|
|
160
164
|
}
|
|
161
|
-
)
|
|
165
|
+
),
|
|
166
|
+
S.right
|
|
162
167
|
]
|
|
163
168
|
}
|
|
164
169
|
);
|
|
165
170
|
}
|
|
166
171
|
);
|
|
167
|
-
|
|
172
|
+
$.displayName = "HorizontalScroller";
|
|
168
173
|
export {
|
|
169
|
-
|
|
174
|
+
$ as default
|
|
170
175
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { useSortable as
|
|
4
|
-
import { useDroppable as
|
|
5
|
-
import { Checkbox as
|
|
6
|
-
import { ChevronRight as
|
|
2
|
+
import I, { useMemo as L } from "react";
|
|
3
|
+
import { useSortable as R } from "@dnd-kit/sortable";
|
|
4
|
+
import { useDroppable as S } from "@dnd-kit/core";
|
|
5
|
+
import { Checkbox as w } from "../../checkbox.js";
|
|
6
|
+
import { ChevronRight as z, Drag as D } from "../../../../icons/index.js";
|
|
7
7
|
import { cn as d } from "../../../../lib/utils.js";
|
|
8
|
-
import { useImpactNovaI18n as
|
|
9
|
-
const
|
|
8
|
+
import { useImpactNovaI18n as f } from "../../../../i18n/ImpactNovaI18nContext.js";
|
|
9
|
+
const H = (e, o) => {
|
|
10
10
|
const t = "flex items-center gap-1 py-[3px] px-2 rounded transition-colors duration-150";
|
|
11
11
|
return e ? d(t, "opacity-40 bg-canvas-muted") : o ? d(t, "bg-feedback-error-surface border border-destructive animate-pulse") : d(t, "hover:bg-canvas-muted");
|
|
12
|
-
},
|
|
13
|
-
const { t } =
|
|
12
|
+
}, P = ({ item: e, isAnyDragging: o }) => {
|
|
13
|
+
const { t } = f(), n = !e.children || e.children.length === 0, {
|
|
14
14
|
setNodeRef: c,
|
|
15
15
|
isOver: s
|
|
16
|
-
} =
|
|
16
|
+
} = S({
|
|
17
17
|
id: `droppable-${e.id}`,
|
|
18
18
|
data: { sectionId: e.id },
|
|
19
19
|
disabled: !n
|
|
@@ -44,41 +44,42 @@ const z = (e, o) => {
|
|
|
44
44
|
}
|
|
45
45
|
)
|
|
46
46
|
] });
|
|
47
|
-
},
|
|
47
|
+
}, _ = ({
|
|
48
48
|
item: e,
|
|
49
49
|
level: o,
|
|
50
50
|
isCollapsed: t,
|
|
51
51
|
onToggle: n,
|
|
52
52
|
onToggleCollapse: c,
|
|
53
53
|
isAnyDragging: s = !1,
|
|
54
|
-
isOver:
|
|
55
|
-
isValidDrop:
|
|
56
|
-
enableDragDrop:
|
|
54
|
+
isOver: $ = !1,
|
|
55
|
+
isValidDrop: j = !1,
|
|
56
|
+
enableDragDrop: x = !0,
|
|
57
57
|
enableCollapse: b = !0,
|
|
58
|
-
shouldBlink:
|
|
58
|
+
shouldBlink: v = !1,
|
|
59
|
+
isDragDisabled: h = !1
|
|
59
60
|
}) => {
|
|
60
|
-
const { t:
|
|
61
|
-
attributes:
|
|
62
|
-
listeners:
|
|
63
|
-
setNodeRef:
|
|
64
|
-
isDragging:
|
|
61
|
+
const { t: u } = f(), m = e.category === "structure", i = e.children && e.children.length > 0, g = L(() => !e.children || e.children.length === 0 || e.children.every((l) => l.checked) ? !1 : e.children.some((l) => l.checked), [e.children]), {
|
|
62
|
+
attributes: k,
|
|
63
|
+
listeners: N,
|
|
64
|
+
setNodeRef: y,
|
|
65
|
+
isDragging: C,
|
|
65
66
|
// transform and transition intentionally not applied — we use a custom
|
|
66
67
|
// FloatingClone and manual insertion line instead of dnd-kit's built-in animations.
|
|
67
|
-
transform:
|
|
68
|
-
transition:
|
|
69
|
-
} =
|
|
68
|
+
transform: E,
|
|
69
|
+
transition: O
|
|
70
|
+
} = R({
|
|
70
71
|
id: e.id,
|
|
71
72
|
data: {
|
|
72
73
|
level: o,
|
|
73
74
|
hasChildren: i,
|
|
74
75
|
isExpanded: !t
|
|
75
76
|
},
|
|
76
|
-
disabled:
|
|
77
|
+
disabled: m || e.disabled || h
|
|
77
78
|
});
|
|
78
|
-
return
|
|
79
|
+
return m ? /* @__PURE__ */ r(P, { item: e, isAnyDragging: s }) : /* @__PURE__ */ r(
|
|
79
80
|
"div",
|
|
80
81
|
{
|
|
81
|
-
ref:
|
|
82
|
+
ref: y,
|
|
82
83
|
className: "relative",
|
|
83
84
|
"data-item-id": e.id,
|
|
84
85
|
"data-level": o,
|
|
@@ -88,7 +89,7 @@ const z = (e, o) => {
|
|
|
88
89
|
children: /* @__PURE__ */ p(
|
|
89
90
|
"div",
|
|
90
91
|
{
|
|
91
|
-
className:
|
|
92
|
+
className: H(C, v),
|
|
92
93
|
style: {
|
|
93
94
|
paddingLeft: `${8 + o * 20}px`
|
|
94
95
|
},
|
|
@@ -102,9 +103,9 @@ const z = (e, o) => {
|
|
|
102
103
|
},
|
|
103
104
|
onMouseDown: (a) => a.stopPropagation(),
|
|
104
105
|
className: "p-1 hover:bg-muted rounded-full transition-colors flex items-center text-content-icon hover:text-brand",
|
|
105
|
-
"aria-label":
|
|
106
|
+
"aria-label": u(t ? "nestedList.expand" : "nestedList.collapse"),
|
|
106
107
|
children: /* @__PURE__ */ r(
|
|
107
|
-
|
|
108
|
+
z,
|
|
108
109
|
{
|
|
109
110
|
size: "16px",
|
|
110
111
|
className: d("transition-transform", !t && "rotate-90")
|
|
@@ -114,19 +115,19 @@ const z = (e, o) => {
|
|
|
114
115
|
),
|
|
115
116
|
(!b || !i) && /* @__PURE__ */ r("div", { className: "w-6" }),
|
|
116
117
|
/* @__PURE__ */ r(
|
|
117
|
-
|
|
118
|
+
w,
|
|
118
119
|
{
|
|
119
120
|
id: `checkbox-${e.id}`,
|
|
120
|
-
checked:
|
|
121
|
+
checked: g ? "indeterminate" : e.checked,
|
|
121
122
|
onCheckedChange: () => n(e.id),
|
|
122
123
|
disabled: e.disabled
|
|
123
124
|
}
|
|
124
125
|
),
|
|
125
|
-
|
|
126
|
+
x && !h && /* @__PURE__ */ r(
|
|
126
127
|
"div",
|
|
127
128
|
{
|
|
128
|
-
...g,
|
|
129
129
|
...k,
|
|
130
|
+
...N,
|
|
130
131
|
className: "cursor-grab active:cursor-grabbing p-0 hover:bg-muted rounded flex items-center",
|
|
131
132
|
style: {
|
|
132
133
|
pointerEvents: "auto",
|
|
@@ -137,7 +138,7 @@ const z = (e, o) => {
|
|
|
137
138
|
onPointerDown: (a) => {
|
|
138
139
|
a.stopPropagation();
|
|
139
140
|
},
|
|
140
|
-
children: /* @__PURE__ */ r(
|
|
141
|
+
children: /* @__PURE__ */ r(D, { size: "14px", className: "text-content-icon" })
|
|
141
142
|
}
|
|
142
143
|
),
|
|
143
144
|
/* @__PURE__ */ r(
|
|
@@ -153,7 +154,7 @@ const z = (e, o) => {
|
|
|
153
154
|
)
|
|
154
155
|
}
|
|
155
156
|
);
|
|
156
|
-
},
|
|
157
|
+
}, Q = I.memo(_);
|
|
157
158
|
export {
|
|
158
|
-
|
|
159
|
+
Q as SortableItem
|
|
159
160
|
};
|
|
@@ -16,8 +16,9 @@ interface UseNestedListDragDropProps {
|
|
|
16
16
|
items: NestedListItem[];
|
|
17
17
|
onDragEnd?: (activeId: string, overId: string | null) => void;
|
|
18
18
|
collapsedItems?: Record<string, boolean>;
|
|
19
|
+
canDrag?: (item: NestedListItem, level: number) => boolean;
|
|
19
20
|
}
|
|
20
|
-
export declare const useNestedListDragDrop: ({ items, onDragEnd, collapsedItems, }: UseNestedListDragDropProps) => {
|
|
21
|
+
export declare const useNestedListDragDrop: ({ items, onDragEnd, collapsedItems, canDrag, }: UseNestedListDragDropProps) => {
|
|
21
22
|
sensors: import('@dnd-kit/core').SensorDescriptor<import('@dnd-kit/core').SensorOptions>[];
|
|
22
23
|
handleDragEnd: (event: DragEndEvent, setItems: (updater: (prevItems: NestedListItem[]) => NestedListItem[]) => void) => void;
|
|
23
24
|
isValidDrop: (activeItemId: string | null, overItemId: string | null) => boolean;
|