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.
Files changed (59) hide show
  1. package/dist/components/data/ag-grid-react/headers/custom-header.js +133 -110
  2. package/dist/components/data/ag-grid-react/headers/header-search-input.js +23 -23
  3. package/dist/components/data/ag-grid-react/index.js +202 -206
  4. package/dist/components/data/data-table/build-column-tree-from-grid.js +65 -67
  5. package/dist/components/data/data-table/data-table-column-list-sync.js +5 -10
  6. package/dist/components/data/data-table/data-table-column-list.js +64 -61
  7. package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +29 -0
  8. package/dist/components/data/data-table/data-table-column-tree-cache.js +117 -0
  9. package/dist/components/data/data-table/data-table-constants.d.ts +2 -0
  10. package/dist/components/data/data-table/data-table-constants.js +3 -2
  11. package/dist/components/data/data-table/data-table-sheet.js +46 -49
  12. package/dist/components/data/data-table/data-table.js +137 -119
  13. package/dist/components/data/data-table/index.js +24 -23
  14. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +3 -0
  15. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +24 -0
  16. package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +2 -1
  17. package/dist/components/data/data-table/use-data-table-column-list-sync.js +249 -150
  18. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.d.ts +2 -1
  19. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +30 -27
  20. package/dist/components/data/expandable-list-item/expandable-list-item-parts.d.ts +1 -1
  21. package/dist/components/data/expandable-list-item/expandable-list-item-parts.js +179 -118
  22. package/dist/components/data/expandable-list-item/expandable-list-item-preset.js +30 -29
  23. package/dist/components/data/expandable-list-item/expandable-list-item.types.d.ts +8 -1
  24. package/dist/components/data/expandable-list-item/index.d.ts +1 -1
  25. package/dist/components/data/nested-list/components/NestedListContent.js +158 -96
  26. package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -0
  27. package/dist/components/data/nested-list/nested-list-constants.js +6 -0
  28. package/dist/components/data/nested-list/nested-list-tree-utils.d.ts +3 -0
  29. package/dist/components/data/nested-list/nested-list-tree-utils.js +24 -0
  30. package/dist/components/data/nested-list/nested-list.js +214 -215
  31. package/dist/components/data-display/card/card.js +6 -5
  32. package/dist/components/feedback/dialog/dialog.js +7 -5
  33. package/dist/components/feedback/sheet/sheet.js +28 -27
  34. package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
  35. package/dist/components/flows/filter-panel/filter-panel.js +36 -35
  36. package/dist/components/flows/filter-strip/filter-tag-list.js +44 -44
  37. package/dist/components/forms/combobox/combobox.js +110 -100
  38. package/dist/components/forms/date-picker/date-input-behavior.d.ts +9 -0
  39. package/dist/components/forms/date-picker/date-input-behavior.js +32 -19
  40. package/dist/components/forms/date-picker/date-picker.js +96 -90
  41. package/dist/components/forms/date-picker/date-range-picker.js +160 -152
  42. package/dist/components/forms/date-picker/month-picker.js +71 -65
  43. package/dist/components/forms/date-picker/month-range-picker.js +153 -145
  44. package/dist/components/forms/date-picker/multi-date-picker.js +127 -99
  45. package/dist/components/forms/date-picker/multi-month-picker.js +109 -97
  46. package/dist/components/forms/date-picker/multi-week-picker.js +98 -86
  47. package/dist/components/forms/date-picker/week-picker.js +82 -76
  48. package/dist/components/forms/date-picker/week-range-picker.js +127 -119
  49. package/dist/impact-nova-base.scss +10 -5
  50. package/dist/impact-nova-components.css +9 -5
  51. package/dist/impact-nova.css +1 -1
  52. package/dist/index.js +189 -188
  53. package/dist/lib/overlay/overlay-portal-context.d.ts +11 -2
  54. package/dist/lib/overlay/overlay-portal-context.js +39 -28
  55. package/dist/lib/primitives/create-compound.d.ts +5 -0
  56. package/dist/lib/primitives/create-compound.js +17 -16
  57. package/dist/llms/rules/installation.js +1 -1
  58. package/dist/llms/rules/requirements.js +1 -1
  59. package/package.json +1 -1
@@ -1,151 +1,213 @@
1
- import { jsxs as O, jsx as a } from "react/jsx-runtime";
2
- import L, { useRef as j, useState as h, useCallback as f, useEffect as _ } from "react";
3
- import { createPortal as H } from "react-dom";
4
- import { DndContext as M } from "@dnd-kit/core";
5
- import { SortableContext as q } from "@dnd-kit/sortable";
6
- import { customCollisionDetection as G } from "../hooks/useNestedListDragDrop.js";
7
- import { Drag as J } from "impact-nova-icons";
8
- const K = "0 -2px 0 0 var(--color-primary)", Q = "0 2px 0 0 var(--color-primary)", U = () => null, V = ({ item: x, pointerX: v, pointerY: g }) => H(
9
- /* @__PURE__ */ a(
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: `${g + 16}px`, left: `${v + 12}px` },
14
- children: /* @__PURE__ */ O(
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__ */ a(J, { size: "12px", className: "text-content-icon shrink-0" }),
20
- /* @__PURE__ */ a("span", { className: "text-[13px] text-content capitalize select-none whitespace-nowrap", children: x.label })
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
- ), le = ({
28
- isListCollapsed: x,
29
- enableDragDrop: v,
30
- sensors: g,
31
- items: n,
32
- renderItem: Y,
33
- onDragStart: y,
34
- onDragOver: I,
35
- onDragEnd: N,
36
- onDragCancel: C,
37
- activeId: o
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 E = j(null), [S, m] = h(null), [k, A] = h(0), [b, B] = h(0), p = f((e, r) => {
40
- if (!e || !o) return null;
41
- let t = e, l = "after";
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 s = n.findIndex((c) => c.item.id === t);
44
- if (s !== -1) {
45
- const c = n.slice(s + 1).find(
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, l = "before";
55
+ t = c.item.id, n = "before";
50
56
  else {
51
- const i = n.slice(0, s).filter(
52
- (d) => d.item.id !== "root-frozen" && d.item.id !== "root-scrollable"
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, l = "after");
60
+ i.length > 0 && (t = i[i.length - 1].item.id, n = "after");
55
61
  }
56
62
  }
57
63
  } else {
58
- const s = E.current;
59
- if (s) {
60
- const c = s.querySelector(`[data-item-id="${t}"]`);
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(), d = i.top + i.height / 2;
63
- l = r < d ? "before" : "after";
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: l };
68
- }, [o, n]), [w, u] = h(null);
69
- _(() => {
70
- if (!o) return;
73
+ return { overId: t, position: n };
74
+ }, [l, o]), [_, h] = I(null);
75
+ P(() => {
76
+ if (!l) return;
71
77
  const e = (r) => {
72
- A(r.clientX), B(r.clientY), u(p(S, r.clientY));
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
- }, [o, S, p]), _(() => {
76
- if (!o) return;
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
- }, [o]);
82
- const F = L.useMemo(() => n.map((e) => e.item.id), [n]), D = L.useMemo(() => o && n.find((e) => e.item.id === o) || null, [o, n]), P = f((e) => {
83
- y(e);
84
- }, [y]), T = f((e) => {
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
- m(null), u(null);
114
+ g(null), h(null);
88
115
  else {
89
- const l = t.id;
90
- m(l), u(p(l, b));
116
+ const n = t.id;
117
+ g(n), h(x(n, S));
91
118
  }
92
- I(e);
93
- }, [I, p, b]), X = f((e) => {
94
- m(null), u(null), N(e);
95
- }, [N]), $ = f(() => {
96
- m(null), u(null), C();
97
- }, [C]);
98
- if (x) return null;
99
- const R = () => {
100
- const e = o !== null;
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 && w) {
103
- const t = n.findIndex((l) => l.item.id === w.overId);
104
- t !== -1 && (r = w.position === "before" ? t : t + 1);
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__ */ O("div", { className: "flex flex-col min-h-0 h-full", children: [
120
- /* @__PURE__ */ a(
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: E,
185
+ ref: v,
124
186
  className: "flex-1 p-1 overflow-y-auto overflow-x-hidden relative",
125
- children: v ? /* @__PURE__ */ a(
126
- M,
187
+ children: u ? /* @__PURE__ */ s(
188
+ Q,
127
189
  {
128
- sensors: g,
129
- collisionDetection: G,
130
- onDragStart: P,
131
- onDragOver: T,
132
- onDragEnd: X,
133
- onDragCancel: $,
134
- children: /* @__PURE__ */ a(q, { items: F, strategy: U, children: R() })
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
- ) : R()
198
+ ) : H()
137
199
  }
138
200
  ),
139
- o && D && /* @__PURE__ */ a(
140
- V,
201
+ l && A && /* @__PURE__ */ s(
202
+ ue,
141
203
  {
142
- item: D.item,
143
- pointerX: k,
144
- pointerY: b
204
+ item: A.item,
205
+ pointerX: X,
206
+ pointerY: S
145
207
  }
146
208
  )
147
209
  ] });
148
210
  };
149
211
  export {
150
- le as NestedListContent
212
+ be as NestedListContent
151
213
  };
@@ -0,0 +1,4 @@
1
+ /** Flat row count at or above which NestedListContent virtualizes rows. */
2
+ export declare const NESTED_LIST_VIRTUALIZATION_THRESHOLD = 80;
3
+ export declare const NESTED_LIST_VIRTUAL_ROW_ESTIMATE_PX = 32;
4
+ export declare const NESTED_LIST_VIRTUAL_OVERSCAN = 12;
@@ -0,0 +1,6 @@
1
+ const T = 80, _ = 32, E = 12;
2
+ export {
3
+ T as NESTED_LIST_VIRTUALIZATION_THRESHOLD,
4
+ E as NESTED_LIST_VIRTUAL_OVERSCAN,
5
+ _ as NESTED_LIST_VIRTUAL_ROW_ESTIMATE_PX
6
+ };
@@ -0,0 +1,3 @@
1
+ import { NestedListItem } from './nested-list.types';
2
+ export declare function countNestedListLeaves(items: NestedListItem[]): number;
3
+ export declare function buildCollapsedStateForAllGroups(items: NestedListItem[]): Record<string, boolean>;
@@ -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
+ };