impact-nova 2.5.17 → 2.5.19

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 (77) hide show
  1. package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +1 -0
  2. package/dist/components/data/data-table/build-column-tree-from-grid.js +55 -50
  3. package/dist/components/data/data-table/column-picker-authority.d.ts +34 -0
  4. package/dist/components/data/data-table/column-picker-authority.js +116 -0
  5. package/dist/components/data/data-table/column-picker-drop-validation.d.ts +7 -0
  6. package/dist/components/data/data-table/column-picker-drop-validation.js +37 -0
  7. package/dist/components/data/data-table/data-table-column-apply.d.ts +2 -0
  8. package/dist/components/data/data-table/data-table-column-apply.js +84 -73
  9. package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +10 -0
  10. package/dist/components/data/data-table/data-table-column-list-tree-apply.js +79 -0
  11. package/dist/components/data/data-table/data-table-column-list.js +94 -64
  12. package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +12 -6
  13. package/dist/components/data/data-table/data-table-column-tree-cache.js +250 -131
  14. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +26 -0
  15. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +195 -0
  16. package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +1 -0
  17. package/dist/components/data/data-table/data-table-picker-column-eligibility.js +7 -0
  18. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +5 -0
  19. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +28 -11
  20. package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +12 -0
  21. package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +12 -0
  22. package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +10 -0
  23. package/dist/components/data/data-table/use-data-table-column-list-sync.js +250 -196
  24. package/dist/components/data/nested-list/components/NestedListContent.d.ts +10 -2
  25. package/dist/components/data/nested-list/components/NestedListContent.js +253 -138
  26. package/dist/components/data/nested-list/components/SortableItem.d.ts +2 -1
  27. package/dist/components/data/nested-list/components/SortableItem.js +62 -60
  28. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +10 -20
  29. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +44 -233
  30. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +24 -0
  31. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +128 -0
  32. package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -1
  33. package/dist/components/data/nested-list/nested-list-constants.js +10 -4
  34. package/dist/components/data/nested-list/nested-list-display-utils.d.ts +11 -0
  35. package/dist/components/data/nested-list/nested-list-display-utils.js +74 -0
  36. package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +31 -0
  37. package/dist/components/data/nested-list/nested-list-drop-engine.js +209 -0
  38. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +26 -0
  39. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +67 -0
  40. package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +4 -0
  41. package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +43 -0
  42. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +3 -0
  43. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +34 -0
  44. package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +9 -0
  45. package/dist/components/data/nested-list/nested-list-row-estimates.js +14 -0
  46. package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +36 -0
  47. package/dist/components/data/nested-list/nested-list-scroll-anchor.js +47 -0
  48. package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +59 -0
  49. package/dist/components/data/nested-list/nested-list-virtual-drop.js +341 -0
  50. package/dist/components/data/nested-list/nested-list.js +322 -336
  51. package/dist/components/data/nested-list/nested-list.types.d.ts +17 -0
  52. package/dist/components/data-display/calendar/calendar-quarter-utils.js +12 -12
  53. package/dist/components/data-display/calendar/calendar-year-utils.js +9 -9
  54. package/dist/components/forms/date-picker/multi-quarter-picker.js +87 -87
  55. package/dist/components/forms/date-picker/multi-year-picker.js +81 -81
  56. package/dist/components/forms/date-picker/quarter-range-picker.js +84 -84
  57. package/dist/components/forms/date-picker/year-range-picker.js +79 -79
  58. package/dist/form-react/Fields/ChipsField.js +49 -48
  59. package/dist/form-react/Fields/DateRangeField.js +25 -25
  60. package/dist/form-react/Fields/MonthRangeField.js +57 -57
  61. package/dist/form-react/Fields/MultiMonthPickerField.js +28 -26
  62. package/dist/form-react/Fields/MultiWeekPickerField.js +43 -41
  63. package/dist/form-react/Fields/MultiYearPickerField.js +45 -45
  64. package/dist/form-react/Fields/SelectField.js +24 -26
  65. package/dist/form-react/Fields/WeekRangePicker.js +16 -16
  66. package/dist/form-react/Fields/YearPickerField.js +27 -27
  67. package/dist/form-react/Fields/YearRangePickerField.js +29 -29
  68. package/dist/form-react/types/fields.types.d.ts +30 -0
  69. package/dist/form-react/utils/date.utils.d.ts +51 -2
  70. package/dist/form-react/utils/date.utils.js +195 -63
  71. package/dist/impact-nova.css +1 -1
  72. package/dist/lib/hash/fnv1a128.d.ts +16 -0
  73. package/dist/lib/hash/fnv1a128.js +21 -0
  74. package/dist/llms/rules/ag-grid.js +1 -1
  75. package/dist/llms/rules/installation.js +1 -1
  76. package/dist/llms/rules/requirements.js +1 -1
  77. package/package.json +1 -1
@@ -1,213 +1,328 @@
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(
1
+ import { jsxs as C, jsx as i } from "react/jsx-runtime";
2
+ import G, { useRef as ne, useState as L, useCallback as I, useEffect as re, useLayoutEffect as H } from "react";
3
+ import { createPortal as Ne } from "react-dom";
4
+ import { DndContext as be } from "@dnd-kit/core";
5
+ import { SortableContext as ye } from "@dnd-kit/sortable";
6
+ import { customCollisionDetection as Ee } from "../hooks/useNestedListDragDrop.js";
7
+ import { Drag as Ae } from "impact-nova-icons";
8
+ import { useVirtualizedRows as Le } from "../../../../lib/virtualized/useVirtualizedRows.js";
9
+ import { NESTED_LIST_VIRTUAL_OVERSCAN as Ce, NESTED_LIST_VIRTUALIZATION_THRESHOLD as ze } from "../nested-list-constants.js";
10
+ import { estimateNestedListRowHeight as X } from "../nested-list-row-estimates.js";
11
+ import { useVirtualNestedListDrag as Re } from "../hooks/useVirtualNestedListDrag.js";
12
+ import { insertGapIndexFromDropTarget as Oe, isInsertGapVisibleOnMountedRows as _e, getInsertGapOffsetY as Te } from "../nested-list-virtual-drop.js";
13
+ import { createLazyFlatRowList as De } from "../nested-list-lazy-flat-rows.js";
14
+ import { findNestedListRowIndexByItemId as Pe, resolveNestedListRowOffset as Ye, captureNestedListScrollAnchor as Fe, restoreNestedListScrollAnchor as Ge } from "../nested-list-scroll-anchor.js";
15
+ const oe = "0 -2px 0 0 var(--color-primary)", He = "0 2px 0 0 var(--color-primary)", Xe = () => null, se = 32, ie = ({ item: z, pointerX: p, pointerY: R, isVisible: O }) => O ? Ne(
16
+ /* @__PURE__ */ i(
16
17
  "div",
17
18
  {
18
19
  className: "fixed z-50 pointer-events-none",
19
- style: { top: `${N + 16}px`, left: `${u + 12}px` },
20
- children: /* @__PURE__ */ b(
20
+ style: { top: `${R + 16}px`, left: `${p + 12}px` },
21
+ children: /* @__PURE__ */ C(
21
22
  "div",
22
23
  {
23
24
  className: "inline-flex items-center gap-1.5 bg-canvas-elevated border border-stroke-subtle rounded px-2.5 py-1 shadow-md",
24
25
  children: [
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 })
26
+ /* @__PURE__ */ i(Ae, { size: "12px", className: "text-content-icon shrink-0" }),
27
+ /* @__PURE__ */ i("span", { className: "text-[13px] text-content capitalize select-none whitespace-nowrap", children: z.label })
27
28
  ]
28
29
  }
29
30
  )
30
31
  }
31
32
  ),
32
33
  document.body
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
34
+ ) : null, nt = ({
35
+ isListCollapsed: z,
36
+ enableDragDrop: p,
37
+ dragMode: R = "sortable",
38
+ sensors: O,
39
+ items: s,
40
+ flatVirtualRowModel: l = null,
41
+ renderItem: le,
42
+ onDragStart: k,
43
+ onDragOver: $,
44
+ onDragEnd: j,
45
+ onDragCancel: B,
46
+ activeId: c,
47
+ onToggleCollapse: U,
48
+ toggleCollapseHandlerRef: q,
49
+ collapsedItems: ce = {},
50
+ onVirtualDrop: K
44
51
  }) => {
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";
48
- if (t === "root-frozen" || t === "root-scrollable") {
49
- const a = o.findIndex((c) => c.item.id === t);
50
- if (a !== -1) {
51
- const c = o.slice(a + 1).find(
52
- (i) => i.item.id !== "root-frozen" && i.item.id !== "root-scrollable"
52
+ const x = ne(null), _ = ne(null), [W, y] = L(null), [de, ae] = L(0), [T, ue] = L(0), E = I((e, t) => {
53
+ if (!e || !c) return null;
54
+ let n = e, r = "after";
55
+ if (n === "root-frozen" || n === "root-scrollable") {
56
+ const o = s.findIndex((d) => d.item.id === n);
57
+ if (o !== -1) {
58
+ const d = s.slice(o + 1).find(
59
+ (m) => m.item.id !== "root-frozen" && m.item.id !== "root-scrollable"
53
60
  );
54
- if (c)
55
- t = c.item.id, n = "before";
61
+ if (d)
62
+ n = d.item.id, r = "before";
56
63
  else {
57
- const i = o.slice(0, a).filter(
58
- (f) => f.item.id !== "root-frozen" && f.item.id !== "root-scrollable"
64
+ const m = s.slice(0, o).filter(
65
+ (S) => S.item.id !== "root-frozen" && S.item.id !== "root-scrollable"
59
66
  );
60
- i.length > 0 && (t = i[i.length - 1].item.id, n = "after");
67
+ m.length > 0 && (n = m[m.length - 1].item.id, r = "after");
61
68
  }
62
69
  }
63
70
  } else {
64
- const a = v.current;
65
- if (a) {
66
- const c = a.querySelector(`[data-item-id="${t}"]`);
67
- if (c) {
68
- const i = c.getBoundingClientRect(), f = i.top + i.height / 2;
69
- n = r < f ? "before" : "after";
71
+ const o = x.current;
72
+ if (o) {
73
+ const d = o.querySelector(`[data-item-id="${n}"]`);
74
+ if (d) {
75
+ const m = d.getBoundingClientRect(), S = m.top + m.height / 2;
76
+ r = t < S ? "before" : "after";
70
77
  }
71
78
  }
72
79
  }
73
- return { overId: t, position: n };
74
- }, [l, o]), [_, h] = I(null);
75
- P(() => {
76
- if (!l) return;
77
- const e = (r) => {
78
- F(r.clientX), $(r.clientY), h(x(z, r.clientY));
80
+ return { overId: n, position: r };
81
+ }, [c, s]), [D, N] = L(null);
82
+ re(() => {
83
+ if (!c) return;
84
+ const e = (t) => {
85
+ ae(t.clientX), ue(t.clientY), N(E(W, t.clientY));
79
86
  };
80
87
  return window.addEventListener("pointermove", e), () => window.removeEventListener("pointermove", e);
81
- }, [l, z, x]), P(() => {
82
- if (!l) return;
88
+ }, [c, W, E]), re(() => {
89
+ if (!c) return;
83
90
  const e = document.createElement("style");
84
91
  return e.setAttribute("data-drag-cursor", "true"), e.textContent = "body, body * { cursor: grabbing !important; }", document.head.appendChild(e), () => {
85
92
  e.remove();
86
93
  };
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
+ }, [c]);
95
+ const me = G.useMemo(
96
+ () => l ? [] : s.map((e) => e.item.id),
97
+ [l, s]
98
+ ), f = p && R === "virtual-index", A = G.useMemo(
99
+ () => l ? De(l) : s,
100
+ [l, s]
101
+ ), a = l?.rowCount ?? s.length, w = (f || !p) && a >= ze, P = f || w ? a : 0, g = I(
102
+ (e) => l ? l.getRowAt(e) : s[e],
103
+ [l, s]
104
+ ), b = I(
105
+ (e) => X(g(e)?.item),
106
+ [g]
107
+ ), { virtualizer: u, virtualItems: Y, totalSize: Z, measureElement: fe } = Le({
108
+ scrollElementRef: x,
109
+ rowCount: P,
110
+ estimateSize: b,
111
+ overscan: Ce,
112
+ getItemKey: (e) => g(e)?.item.id ?? e,
113
+ scrollPaddingEnd: p ? se : void 0
94
114
  });
95
- Z(() => {
96
- if (!E)
115
+ H(() => {
116
+ if (P === 0)
97
117
  return;
98
- const e = v.current;
118
+ const e = x.current;
99
119
  if (!e)
100
120
  return;
101
- y.measure();
102
- const r = new ResizeObserver(() => {
103
- y.measure();
121
+ u.measure();
122
+ const t = new ResizeObserver(() => {
123
+ u.measure();
104
124
  });
105
- return r.observe(e), () => {
106
- r.disconnect();
125
+ return t.observe(e), () => {
126
+ t.disconnect();
107
127
  };
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) => {
112
- const { active: r, over: t } = e;
113
- if (!t || r.id === t.id)
114
- g(null), h(null);
128
+ }, [P, u]);
129
+ const J = I(
130
+ (e) => {
131
+ if (w && x.current) {
132
+ const t = Pe({
133
+ rowCount: a,
134
+ getRowAtIndex: g,
135
+ anchorItemId: e
136
+ }), n = Ye({
137
+ virtualizer: u,
138
+ rowIndex: t,
139
+ estimateRowSize: b
140
+ }), r = Fe({
141
+ scrollElement: x.current,
142
+ anchorItemId: e,
143
+ anchorRowIndex: t,
144
+ rowOffset: n
145
+ });
146
+ r && (_.current = r), u.shouldAdjustScrollPositionOnItemSizeChange = () => !1;
147
+ }
148
+ U(e);
149
+ },
150
+ [b, g, U, a, w, u]
151
+ );
152
+ H(() => {
153
+ q.current = J;
154
+ }, [J, q]), H(() => {
155
+ const e = _.current, t = x.current;
156
+ !e || !t || !w || (Ge({
157
+ scrollElement: t,
158
+ capture: e,
159
+ virtualizer: u,
160
+ estimateRowSize: b
161
+ }), _.current = null, u.shouldAdjustScrollPositionOnItemSizeChange = void 0);
162
+ }, [b, a, w, u]);
163
+ const he = w && Y.length > 0, pe = I((e, t, n) => {
164
+ K?.(e, t, n);
165
+ }, [K]), {
166
+ dragSession: v,
167
+ handlePointerDown: ge
168
+ } = Re({
169
+ items: A,
170
+ scrollElementRef: x,
171
+ virtualizer: u,
172
+ estimateRowSize: (e) => X(g(e)?.item),
173
+ onDrop: pe,
174
+ collapsedItems: ce
175
+ }), Q = G.useMemo(() => {
176
+ if (!c) return null;
177
+ if (l) {
178
+ for (let e = 0; e < l.rowCount; e += 1) {
179
+ const t = l.getRowAt(e);
180
+ if (t.item.id === c)
181
+ return t;
182
+ }
183
+ return null;
184
+ }
185
+ return s.find((e) => e.item.id === c) || null;
186
+ }, [c, l, s]), ve = I((e) => {
187
+ k(e);
188
+ }, [k]), Ie = I((e) => {
189
+ const { active: t, over: n } = e;
190
+ if (!n || t.id === n.id)
191
+ y(null), N(null);
115
192
  else {
116
- const n = t.id;
117
- g(n), h(x(n, S));
193
+ const r = n.id;
194
+ y(r), N(E(r, T));
118
195
  }
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(
196
+ $(e);
197
+ }, [$, E, T]), xe = I((e) => {
198
+ y(null), N(null), j(e);
199
+ }, [j]), we = I(() => {
200
+ y(null), N(null), B();
201
+ }, [B]);
202
+ if (z) return null;
203
+ const V = !f || !v?.dropTarget ? null : Oe(A, v.dropTarget), F = (e, t, n, r) => {
204
+ const { item: h, level: o, indentLevel: d } = e, m = n === t, S = n === r && t === r - 1, ee = m ? oe : S ? He : void 0, Se = f && v?.draggedId === h.id;
205
+ return /* @__PURE__ */ i(
129
206
  "div",
130
207
  {
131
208
  className: "relative",
132
- style: f ? { boxShadow: f } : void 0,
133
- children: k(n, m, a)
209
+ style: {
210
+ ...ee ? { boxShadow: ee } : void 0,
211
+ ...Se ? { opacity: 0.4 } : void 0
212
+ },
213
+ onPointerDownCapture: f && !h.isDragDisabled && h.category !== "structure" ? (te) => {
214
+ te.target.closest('[data-drag-handle="true"]') && ge(te, h.id);
215
+ } : void 0,
216
+ children: le(h, o, d, {
217
+ isAnyDragging: c !== null || v !== null
218
+ })
134
219
  },
135
- n.id
220
+ h.id
136
221
  );
137
- }, H = () => {
138
- const e = l !== null;
139
- let r = null;
140
- if (e && _) {
141
- const t = o.findIndex(
142
- (n) => n.item.id === _.overId
222
+ }, M = () => {
223
+ let e = null;
224
+ if (f && V !== null)
225
+ e = V;
226
+ else if (c !== null && D) {
227
+ const t = A.findIndex(
228
+ (n) => n.item.id === D.overId
143
229
  );
144
- t !== -1 && (r = _.position === "before" ? t : t + 1);
230
+ t !== -1 && (e = D.position === "before" ? t : t + 1);
145
231
  }
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(
232
+ if (he) {
233
+ const t = Z + (p ? se : 0), n = Y.map((o) => o.index), r = e !== null && f && !_e(e, n, a), h = r && e !== null ? Te(
234
+ e,
235
+ u,
236
+ (o) => X(g(o)?.item),
237
+ a
238
+ ) : null;
239
+ return /* @__PURE__ */ C("div", { className: "w-full relative", style: { height: t }, children: [
240
+ r && h !== null ? /* @__PURE__ */ i(
241
+ "div",
242
+ {
243
+ "aria-hidden": !0,
244
+ className: "absolute left-0 w-full h-0 pointer-events-none z-10",
245
+ style: {
246
+ top: `${h}px`,
247
+ boxShadow: oe
248
+ }
249
+ }
250
+ ) : null,
251
+ Y.map((o) => {
252
+ const d = g(o.index);
253
+ return d ? /* @__PURE__ */ i(
152
254
  "div",
153
255
  {
154
- "data-index": n.index,
155
- ref: M,
256
+ "data-index": o.index,
257
+ ref: fe,
156
258
  className: "absolute left-0 top-0 w-full",
157
- style: { transform: `translateY(${n.start}px)` },
158
- children: D(m, n.index, r)
259
+ style: { transform: `translateY(${o.start}px)` },
260
+ children: F(d, o.index, e, a)
159
261
  },
160
- m.item.id
262
+ d.item.id
161
263
  ) : null;
162
264
  }),
163
- u ? /* @__PURE__ */ s(
265
+ p ? /* @__PURE__ */ i(
164
266
  "div",
165
267
  {
166
268
  "aria-hidden": !0,
167
269
  className: "absolute left-0 w-full h-8 shrink-0",
168
- style: { top: O },
270
+ style: { top: Z },
169
271
  "data-slot": "drag-drop-tail"
170
272
  }
171
273
  ) : null
172
274
  ] });
173
275
  }
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
276
+ return /* @__PURE__ */ C("div", { className: "w-full", children: [
277
+ a > 0 && s.length === 0 ? Array.from({ length: a }, (t, n) => {
278
+ const r = g(n);
279
+ return r ? /* @__PURE__ */ i("div", { "data-index": n, children: F(r, n, e, a) }, r.item.id) : null;
280
+ }) : s.map((t, n) => /* @__PURE__ */ i("div", { "data-index": n, children: F(t, n, e, A.length) }, t.item.id)),
281
+ p ? /* @__PURE__ */ i("div", { "aria-hidden": !0, className: "h-8 shrink-0", "data-slot": "drag-drop-tail" }) : null
179
282
  ] });
180
283
  };
181
- return /* @__PURE__ */ b("div", { className: "flex flex-col min-h-0 h-full", children: [
182
- /* @__PURE__ */ s(
284
+ return /* @__PURE__ */ C("div", { className: "flex flex-col min-h-0 h-full", children: [
285
+ /* @__PURE__ */ i(
183
286
  "div",
184
287
  {
185
- ref: v,
288
+ ref: x,
289
+ "data-slot": "nested-list-scroll",
186
290
  className: "flex-1 p-1 overflow-y-auto overflow-x-hidden relative",
187
- children: u ? /* @__PURE__ */ s(
188
- Q,
291
+ style: { overflowAnchor: "none" },
292
+ children: p && !f ? /* @__PURE__ */ i(
293
+ be,
189
294
  {
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() })
295
+ sensors: O,
296
+ collisionDetection: Ee,
297
+ onDragStart: ve,
298
+ onDragOver: Ie,
299
+ onDragEnd: xe,
300
+ onDragCancel: we,
301
+ children: /* @__PURE__ */ i(ye, { items: me, strategy: Xe, children: M() })
197
302
  }
198
- ) : H()
303
+ ) : M()
304
+ }
305
+ ),
306
+ c && Q && !f && /* @__PURE__ */ i(
307
+ ie,
308
+ {
309
+ item: Q.item,
310
+ pointerX: de,
311
+ pointerY: T,
312
+ isVisible: !0
199
313
  }
200
314
  ),
201
- l && A && /* @__PURE__ */ s(
202
- ue,
315
+ v && f && /* @__PURE__ */ i(
316
+ ie,
203
317
  {
204
- item: A.item,
205
- pointerX: X,
206
- pointerY: S
318
+ item: v.draggedItem,
319
+ pointerX: v.pointerX,
320
+ pointerY: v.pointerY,
321
+ isVisible: v.isPointerInsideScrollContainer
207
322
  }
208
323
  )
209
324
  ] });
210
325
  };
211
326
  export {
212
- be as NestedListContent
327
+ nt as NestedListContent
213
328
  };
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { NestedListItem } from '../nested-list.types';
2
+ import { NestedListItem, NestedListDragMode } from '../nested-list.types';
3
3
  interface SortableItemProps {
4
4
  item: NestedListItem;
5
5
  level: number;
@@ -11,6 +11,7 @@ interface SortableItemProps {
11
11
  isOver?: boolean;
12
12
  isValidDrop?: boolean;
13
13
  enableDragDrop?: boolean;
14
+ dragMode?: NestedListDragMode;
14
15
  enableCollapse?: boolean;
15
16
  shouldBlink?: boolean;
16
17
  isDragDisabled?: boolean;