impact-nova 2.2.3 → 2.2.5
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/data/ag-grid-react/headers/custom-header.js +133 -110
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +23 -23
- package/dist/components/data/ag-grid-react/index.js +202 -206
- package/dist/components/data/data-table/build-column-tree-from-grid.js +65 -67
- package/dist/components/data/data-table/data-table-column-list-sync.js +5 -10
- package/dist/components/data/data-table/data-table-column-list.js +64 -61
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +29 -0
- package/dist/components/data/data-table/data-table-column-tree-cache.js +117 -0
- package/dist/components/data/data-table/data-table-constants.d.ts +2 -0
- package/dist/components/data/data-table/data-table-constants.js +3 -2
- package/dist/components/data/data-table/data-table-sheet.js +46 -49
- package/dist/components/data/data-table/data-table.js +137 -119
- package/dist/components/data/data-table/index.js +24 -23
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +3 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +24 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +2 -1
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +249 -150
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.d.ts +2 -1
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +30 -27
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.d.ts +1 -1
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.js +179 -118
- package/dist/components/data/expandable-list-item/expandable-list-item-preset.js +30 -29
- package/dist/components/data/expandable-list-item/expandable-list-item.types.d.ts +8 -1
- package/dist/components/data/expandable-list-item/index.d.ts +1 -1
- package/dist/components/data/nested-list/components/NestedListContent.js +158 -96
- package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -0
- package/dist/components/data/nested-list/nested-list-constants.js +6 -0
- package/dist/components/data/nested-list/nested-list-tree-utils.d.ts +3 -0
- package/dist/components/data/nested-list/nested-list-tree-utils.js +24 -0
- package/dist/components/data/nested-list/nested-list.js +214 -215
- package/dist/components/data-display/card/card.js +6 -5
- package/dist/components/feedback/dialog/dialog.js +7 -5
- package/dist/components/feedback/sheet/sheet.js +28 -27
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/flows/filter-panel/filter-panel.js +36 -35
- package/dist/components/flows/filter-strip/filter-tag-list.js +44 -44
- package/dist/components/forms/combobox/combobox.js +110 -100
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +9 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +32 -19
- package/dist/components/forms/date-picker/date-picker.js +96 -90
- package/dist/components/forms/date-picker/date-range-picker.js +160 -152
- package/dist/components/forms/date-picker/month-picker.js +71 -65
- package/dist/components/forms/date-picker/month-range-picker.js +153 -145
- package/dist/components/forms/date-picker/multi-date-picker.js +127 -99
- package/dist/components/forms/date-picker/multi-month-picker.js +109 -97
- package/dist/components/forms/date-picker/multi-week-picker.js +98 -86
- package/dist/components/forms/date-picker/week-picker.js +82 -76
- package/dist/components/forms/date-picker/week-range-picker.js +127 -119
- package/dist/impact-nova-base.scss +10 -5
- package/dist/impact-nova-components.css +9 -5
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +189 -188
- package/dist/lib/overlay/overlay-portal-context.d.ts +11 -2
- package/dist/lib/overlay/overlay-portal-context.js +39 -28
- package/dist/lib/primitives/create-compound.d.ts +5 -0
- package/dist/lib/primitives/create-compound.js +17 -16
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,151 +1,213 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { DndContext as
|
|
5
|
-
import { SortableContext as
|
|
6
|
-
import { customCollisionDetection as
|
|
7
|
-
import { Drag as
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as b, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import V, { useRef as W, useState as I, useCallback as p, useEffect as P, useLayoutEffect as Z } from "react";
|
|
3
|
+
import { createPortal as J } from "react-dom";
|
|
4
|
+
import { DndContext as Q } from "@dnd-kit/core";
|
|
5
|
+
import { SortableContext as ee } from "@dnd-kit/sortable";
|
|
6
|
+
import { customCollisionDetection as te } from "../hooks/useNestedListDragDrop.js";
|
|
7
|
+
import { Drag as ne } from "impact-nova-icons";
|
|
8
|
+
import { useVirtualizedRows as re } from "../../../../lib/virtualized/useVirtualizedRows.js";
|
|
9
|
+
import { NESTED_LIST_VIRTUALIZATION_THRESHOLD as oe, NESTED_LIST_VIRTUAL_OVERSCAN as le, NESTED_LIST_VIRTUAL_ROW_ESTIMATE_PX as Y } from "../nested-list-constants.js";
|
|
10
|
+
const ie = "0 -2px 0 0 var(--color-primary)", se = "0 2px 0 0 var(--color-primary)", ce = () => null, ae = 32;
|
|
11
|
+
function de(d) {
|
|
12
|
+
return d ? d.item.id === "root-scrollable" ? 36 : d.item.category === "structure" ? 28 : Y : Y;
|
|
13
|
+
}
|
|
14
|
+
const ue = ({ item: d, pointerX: u, pointerY: N }) => J(
|
|
15
|
+
/* @__PURE__ */ s(
|
|
10
16
|
"div",
|
|
11
17
|
{
|
|
12
18
|
className: "fixed z-50 pointer-events-none",
|
|
13
|
-
style: { top: `${
|
|
14
|
-
children: /* @__PURE__ */
|
|
19
|
+
style: { top: `${N + 16}px`, left: `${u + 12}px` },
|
|
20
|
+
children: /* @__PURE__ */ b(
|
|
15
21
|
"div",
|
|
16
22
|
{
|
|
17
23
|
className: "inline-flex items-center gap-1.5 bg-canvas-elevated border border-stroke-subtle rounded px-2.5 py-1 shadow-md",
|
|
18
24
|
children: [
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ s(ne, { size: "12px", className: "text-content-icon shrink-0" }),
|
|
26
|
+
/* @__PURE__ */ s("span", { className: "text-[13px] text-content capitalize select-none whitespace-nowrap", children: d.label })
|
|
21
27
|
]
|
|
22
28
|
}
|
|
23
29
|
)
|
|
24
30
|
}
|
|
25
31
|
),
|
|
26
32
|
document.body
|
|
27
|
-
),
|
|
28
|
-
isListCollapsed:
|
|
29
|
-
enableDragDrop:
|
|
30
|
-
sensors:
|
|
31
|
-
items:
|
|
32
|
-
renderItem:
|
|
33
|
-
onDragStart:
|
|
34
|
-
onDragOver:
|
|
35
|
-
onDragEnd:
|
|
36
|
-
onDragCancel:
|
|
37
|
-
activeId:
|
|
33
|
+
), be = ({
|
|
34
|
+
isListCollapsed: d,
|
|
35
|
+
enableDragDrop: u,
|
|
36
|
+
sensors: N,
|
|
37
|
+
items: o,
|
|
38
|
+
renderItem: k,
|
|
39
|
+
onDragStart: R,
|
|
40
|
+
onDragOver: w,
|
|
41
|
+
onDragEnd: T,
|
|
42
|
+
onDragCancel: L,
|
|
43
|
+
activeId: l
|
|
38
44
|
}) => {
|
|
39
|
-
const
|
|
40
|
-
if (!e || !
|
|
41
|
-
let t = e,
|
|
45
|
+
const v = W(null), [z, g] = I(null), [X, F] = I(0), [S, $] = I(0), x = p((e, r) => {
|
|
46
|
+
if (!e || !l) return null;
|
|
47
|
+
let t = e, n = "after";
|
|
42
48
|
if (t === "root-frozen" || t === "root-scrollable") {
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const c =
|
|
49
|
+
const a = o.findIndex((c) => c.item.id === t);
|
|
50
|
+
if (a !== -1) {
|
|
51
|
+
const c = o.slice(a + 1).find(
|
|
46
52
|
(i) => i.item.id !== "root-frozen" && i.item.id !== "root-scrollable"
|
|
47
53
|
);
|
|
48
54
|
if (c)
|
|
49
|
-
t = c.item.id,
|
|
55
|
+
t = c.item.id, n = "before";
|
|
50
56
|
else {
|
|
51
|
-
const i =
|
|
52
|
-
(
|
|
57
|
+
const i = o.slice(0, a).filter(
|
|
58
|
+
(f) => f.item.id !== "root-frozen" && f.item.id !== "root-scrollable"
|
|
53
59
|
);
|
|
54
|
-
i.length > 0 && (t = i[i.length - 1].item.id,
|
|
60
|
+
i.length > 0 && (t = i[i.length - 1].item.id, n = "after");
|
|
55
61
|
}
|
|
56
62
|
}
|
|
57
63
|
} else {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
const c =
|
|
64
|
+
const a = v.current;
|
|
65
|
+
if (a) {
|
|
66
|
+
const c = a.querySelector(`[data-item-id="${t}"]`);
|
|
61
67
|
if (c) {
|
|
62
|
-
const i = c.getBoundingClientRect(),
|
|
63
|
-
|
|
68
|
+
const i = c.getBoundingClientRect(), f = i.top + i.height / 2;
|
|
69
|
+
n = r < f ? "before" : "after";
|
|
64
70
|
}
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
|
-
return { overId: t, position:
|
|
68
|
-
}, [
|
|
69
|
-
|
|
70
|
-
if (!
|
|
73
|
+
return { overId: t, position: n };
|
|
74
|
+
}, [l, o]), [_, h] = I(null);
|
|
75
|
+
P(() => {
|
|
76
|
+
if (!l) return;
|
|
71
77
|
const e = (r) => {
|
|
72
|
-
|
|
78
|
+
F(r.clientX), $(r.clientY), h(x(z, r.clientY));
|
|
73
79
|
};
|
|
74
80
|
return window.addEventListener("pointermove", e), () => window.removeEventListener("pointermove", e);
|
|
75
|
-
}, [
|
|
76
|
-
if (!
|
|
81
|
+
}, [l, z, x]), P(() => {
|
|
82
|
+
if (!l) return;
|
|
77
83
|
const e = document.createElement("style");
|
|
78
84
|
return e.setAttribute("data-drag-cursor", "true"), e.textContent = "body, body * { cursor: grabbing !important; }", document.head.appendChild(e), () => {
|
|
79
85
|
e.remove();
|
|
80
86
|
};
|
|
81
|
-
}, [
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
}, [l]);
|
|
88
|
+
const B = V.useMemo(() => o.map((e) => e.item.id), [o]), E = !u && o.length >= oe, { virtualizer: y, virtualItems: C, totalSize: O, measureElement: M } = re({
|
|
89
|
+
scrollElementRef: v,
|
|
90
|
+
rowCount: E ? o.length : 0,
|
|
91
|
+
estimateSize: (e) => de(o[e]),
|
|
92
|
+
overscan: le,
|
|
93
|
+
getItemKey: (e) => o[e]?.item.id ?? e
|
|
94
|
+
});
|
|
95
|
+
Z(() => {
|
|
96
|
+
if (!E)
|
|
97
|
+
return;
|
|
98
|
+
const e = v.current;
|
|
99
|
+
if (!e)
|
|
100
|
+
return;
|
|
101
|
+
y.measure();
|
|
102
|
+
const r = new ResizeObserver(() => {
|
|
103
|
+
y.measure();
|
|
104
|
+
});
|
|
105
|
+
return r.observe(e), () => {
|
|
106
|
+
r.disconnect();
|
|
107
|
+
};
|
|
108
|
+
}, [E, o.length, y]);
|
|
109
|
+
const U = E && C.length > 0, A = V.useMemo(() => l && o.find((e) => e.item.id === l) || null, [l, o]), j = p((e) => {
|
|
110
|
+
R(e);
|
|
111
|
+
}, [R]), G = p((e) => {
|
|
85
112
|
const { active: r, over: t } = e;
|
|
86
113
|
if (!t || r.id === t.id)
|
|
87
|
-
|
|
114
|
+
g(null), h(null);
|
|
88
115
|
else {
|
|
89
|
-
const
|
|
90
|
-
|
|
116
|
+
const n = t.id;
|
|
117
|
+
g(n), h(x(n, S));
|
|
91
118
|
}
|
|
92
|
-
|
|
93
|
-
}, [
|
|
94
|
-
|
|
95
|
-
}, [
|
|
96
|
-
|
|
97
|
-
}, [
|
|
98
|
-
if (
|
|
99
|
-
const
|
|
100
|
-
const e = o
|
|
119
|
+
w(e);
|
|
120
|
+
}, [w, x, S]), q = p((e) => {
|
|
121
|
+
g(null), h(null), T(e);
|
|
122
|
+
}, [T]), K = p(() => {
|
|
123
|
+
g(null), h(null), L();
|
|
124
|
+
}, [L]);
|
|
125
|
+
if (d) return null;
|
|
126
|
+
const D = (e, r, t) => {
|
|
127
|
+
const { item: n, level: m, indentLevel: a } = e, c = t === r, i = t === r + 1 && r === o.length - 1, f = c ? ie : i ? se : void 0;
|
|
128
|
+
return /* @__PURE__ */ s(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
className: "relative",
|
|
132
|
+
style: f ? { boxShadow: f } : void 0,
|
|
133
|
+
children: k(n, m, a)
|
|
134
|
+
},
|
|
135
|
+
n.id
|
|
136
|
+
);
|
|
137
|
+
}, H = () => {
|
|
138
|
+
const e = l !== null;
|
|
101
139
|
let r = null;
|
|
102
|
-
if (e &&
|
|
103
|
-
const t =
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
return /* @__PURE__ */ a("div", { className: "w-full pb-12", children: n.map(({ item: t, level: l, indentLevel: z }, s) => {
|
|
107
|
-
const c = r === s, i = r === s + 1 && s === n.length - 1, d = c ? K : i ? Q : void 0;
|
|
108
|
-
return /* @__PURE__ */ a(
|
|
109
|
-
"div",
|
|
110
|
-
{
|
|
111
|
-
className: "relative",
|
|
112
|
-
style: d ? { boxShadow: d } : void 0,
|
|
113
|
-
children: Y(t, l, z)
|
|
114
|
-
},
|
|
115
|
-
t.id
|
|
140
|
+
if (e && _) {
|
|
141
|
+
const t = o.findIndex(
|
|
142
|
+
(n) => n.item.id === _.overId
|
|
116
143
|
);
|
|
117
|
-
|
|
144
|
+
t !== -1 && (r = _.position === "before" ? t : t + 1);
|
|
145
|
+
}
|
|
146
|
+
if (U) {
|
|
147
|
+
const t = O + (u ? ae : 0);
|
|
148
|
+
return /* @__PURE__ */ b("div", { className: "w-full relative", style: { height: t }, children: [
|
|
149
|
+
C.map((n) => {
|
|
150
|
+
const m = o[n.index];
|
|
151
|
+
return m ? /* @__PURE__ */ s(
|
|
152
|
+
"div",
|
|
153
|
+
{
|
|
154
|
+
"data-index": n.index,
|
|
155
|
+
ref: M,
|
|
156
|
+
className: "absolute left-0 top-0 w-full",
|
|
157
|
+
style: { transform: `translateY(${n.start}px)` },
|
|
158
|
+
children: D(m, n.index, r)
|
|
159
|
+
},
|
|
160
|
+
m.item.id
|
|
161
|
+
) : null;
|
|
162
|
+
}),
|
|
163
|
+
u ? /* @__PURE__ */ s(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
"aria-hidden": !0,
|
|
167
|
+
className: "absolute left-0 w-full h-8 shrink-0",
|
|
168
|
+
style: { top: O },
|
|
169
|
+
"data-slot": "drag-drop-tail"
|
|
170
|
+
}
|
|
171
|
+
) : null
|
|
172
|
+
] });
|
|
173
|
+
}
|
|
174
|
+
return /* @__PURE__ */ b("div", { className: "w-full", children: [
|
|
175
|
+
o.map(
|
|
176
|
+
(t, n) => D(t, n, r)
|
|
177
|
+
),
|
|
178
|
+
u ? /* @__PURE__ */ s("div", { "aria-hidden": !0, className: "h-8 shrink-0", "data-slot": "drag-drop-tail" }) : null
|
|
179
|
+
] });
|
|
118
180
|
};
|
|
119
|
-
return /* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ b("div", { className: "flex flex-col min-h-0 h-full", children: [
|
|
182
|
+
/* @__PURE__ */ s(
|
|
121
183
|
"div",
|
|
122
184
|
{
|
|
123
|
-
ref:
|
|
185
|
+
ref: v,
|
|
124
186
|
className: "flex-1 p-1 overflow-y-auto overflow-x-hidden relative",
|
|
125
|
-
children:
|
|
126
|
-
|
|
187
|
+
children: u ? /* @__PURE__ */ s(
|
|
188
|
+
Q,
|
|
127
189
|
{
|
|
128
|
-
sensors:
|
|
129
|
-
collisionDetection:
|
|
130
|
-
onDragStart:
|
|
131
|
-
onDragOver:
|
|
132
|
-
onDragEnd:
|
|
133
|
-
onDragCancel:
|
|
134
|
-
children: /* @__PURE__ */
|
|
190
|
+
sensors: N,
|
|
191
|
+
collisionDetection: te,
|
|
192
|
+
onDragStart: j,
|
|
193
|
+
onDragOver: G,
|
|
194
|
+
onDragEnd: q,
|
|
195
|
+
onDragCancel: K,
|
|
196
|
+
children: /* @__PURE__ */ s(ee, { items: B, strategy: ce, children: H() })
|
|
135
197
|
}
|
|
136
|
-
) :
|
|
198
|
+
) : H()
|
|
137
199
|
}
|
|
138
200
|
),
|
|
139
|
-
|
|
140
|
-
|
|
201
|
+
l && A && /* @__PURE__ */ s(
|
|
202
|
+
ue,
|
|
141
203
|
{
|
|
142
|
-
item:
|
|
143
|
-
pointerX:
|
|
144
|
-
pointerY:
|
|
204
|
+
item: A.item,
|
|
205
|
+
pointerX: X,
|
|
206
|
+
pointerY: S
|
|
145
207
|
}
|
|
146
208
|
)
|
|
147
209
|
] });
|
|
148
210
|
};
|
|
149
211
|
export {
|
|
150
|
-
|
|
212
|
+
be as NestedListContent
|
|
151
213
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function r(l) {
|
|
2
|
+
let t = 0;
|
|
3
|
+
const n = (o) => {
|
|
4
|
+
for (const e of o)
|
|
5
|
+
e.children && e.children.length > 0 ? n(e.children) : t += 1;
|
|
6
|
+
};
|
|
7
|
+
return n(l), t;
|
|
8
|
+
}
|
|
9
|
+
function c(l) {
|
|
10
|
+
const t = {}, n = (o) => {
|
|
11
|
+
for (const e of o) {
|
|
12
|
+
if (e.category === "structure") {
|
|
13
|
+
e.children && e.children.length > 0 && n(e.children);
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
e.children && e.children.length > 0 && (t[e.id] = !0, n(e.children));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
return n(l), t;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
c as buildCollapsedStateForAllGroups,
|
|
23
|
+
r as countNestedListLeaves
|
|
24
|
+
};
|