impact-nova 2.5.13 → 2.5.14
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/data-table/build-column-tree-from-grid.d.ts +0 -1
- package/dist/components/data/data-table/build-column-tree-from-grid.js +50 -55
- package/dist/components/data/data-table/data-table-column-apply.d.ts +0 -2
- package/dist/components/data/data-table/data-table-column-apply.js +73 -84
- package/dist/components/data/data-table/data-table-column-list.js +64 -94
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +6 -12
- package/dist/components/data/data-table/data-table-column-tree-cache.js +131 -250
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +0 -5
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +11 -28
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +0 -10
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +196 -250
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
- package/dist/components/data/nested-list/components/NestedListContent.d.ts +2 -10
- package/dist/components/data/nested-list/components/NestedListContent.js +138 -253
- package/dist/components/data/nested-list/components/SortableItem.d.ts +1 -2
- package/dist/components/data/nested-list/components/SortableItem.js +60 -62
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +20 -10
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +233 -44
- package/dist/components/data/nested-list/nested-list-constants.d.ts +1 -4
- package/dist/components/data/nested-list/nested-list-constants.js +4 -10
- package/dist/components/data/nested-list/nested-list.js +336 -322
- package/dist/components/data/nested-list/nested-list.types.d.ts +0 -17
- package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
- package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
- package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
- package/dist/components/data-display/calendar/calendar-config.js +1 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +4 -2
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +234 -164
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +77 -76
- package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +9 -0
- package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +45 -0
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
- package/dist/components/data-display/calendar/calendar-footer.js +21 -21
- package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +5 -0
- package/dist/components/data-display/calendar/calendar-injected-week-row.js +92 -0
- package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +16 -0
- package/dist/components/data-display/calendar/calendar-leading-week.utils.js +51 -0
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +50 -49
- package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
- package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
- package/dist/components/data-display/calendar/calendar-orphan-week.d.ts +23 -0
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +3 -1
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +7 -5
- package/dist/components/data-display/calendar/calendar-period-cell.js +45 -46
- package/dist/components/data-display/calendar/calendar-quarter-panes.js +33 -31
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +10 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +53 -39
- package/dist/components/data-display/calendar/calendar-selection.d.ts +25 -0
- package/dist/components/data-display/calendar/calendar-selection.js +52 -23
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +2 -1
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +59 -45
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +15 -4
- package/dist/components/data-display/calendar/calendar-week-utils.js +59 -50
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +3 -0
- package/dist/components/data-display/calendar/calendar-year-panes.js +53 -49
- package/dist/components/data-display/calendar/calendar.js +146 -143
- package/dist/components/data-display/calendar/calendar.types.d.ts +5 -0
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +2 -1
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +79 -74
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
- package/dist/components/data-display/calendar/use-calendar-state.js +394 -314
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/forms/date-picker/date-picker.js +60 -58
- package/dist/components/forms/date-picker/date-picker.types.d.ts +5 -0
- package/dist/components/forms/date-picker/date-range-picker.js +66 -64
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +3 -2
- package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +17 -0
- package/dist/components/forms/date-picker/month-picker.js +61 -59
- package/dist/components/forms/date-picker/month-range-picker.js +63 -61
- package/dist/components/forms/date-picker/multi-date-picker.js +51 -49
- package/dist/components/forms/date-picker/multi-month-picker.js +49 -47
- package/dist/components/forms/date-picker/multi-quarter-picker.js +51 -47
- package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
- package/dist/components/forms/date-picker/multi-year-picker.js +53 -49
- package/dist/components/forms/date-picker/quarter-picker.js +51 -47
- package/dist/components/forms/date-picker/quarter-range-picker.js +50 -46
- package/dist/components/forms/date-picker/week-picker.js +130 -126
- package/dist/components/forms/date-picker/week-range-picker.js +159 -155
- package/dist/components/forms/date-picker/year-picker.js +52 -48
- package/dist/components/forms/date-picker/year-range-picker.js +52 -48
- package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
- package/dist/components/forms/select/components/Submenu.js +3 -2
- package/dist/form-react/Fields/DateInputField.js +51 -50
- package/dist/form-react/Fields/DateRangeField.js +14 -13
- package/dist/form-react/Fields/MonthRangeField.js +29 -28
- package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
- package/dist/form-react/Fields/MultiWeekPickerField.js +35 -27
- package/dist/form-react/Fields/MultiYearPickerField.d.ts +8 -0
- package/dist/form-react/Fields/MultiYearPickerField.js +57 -0
- package/dist/form-react/Fields/WeekRangePicker.js +33 -32
- package/dist/form-react/Fields/YearPickerField.d.ts +8 -0
- package/dist/form-react/Fields/YearPickerField.js +57 -0
- package/dist/form-react/Fields/YearRangePickerField.d.ts +8 -0
- package/dist/form-react/Fields/YearRangePickerField.js +57 -0
- package/dist/form-react/registry/defaultFieldRegistrations.d.ts +1 -1
- package/dist/form-react/registry/defaultFieldRegistrations.js +16 -13
- package/dist/form-react/types/fields.types.d.ts +69 -1
- package/dist/form-react/types/fieldsOutput.types.d.ts +8 -2
- package/dist/form-react/utils/fieldDefaults.utils.js +1 -1
- package/dist/impact-nova-components.css +13 -6
- package/dist/impact-nova.css +1 -1
- package/dist/lib/fiscal-calendar/index.d.ts +2 -2
- package/dist/lib/fiscal-calendar/index.js +26 -28
- package/dist/lib/fiscal-calendar/types.d.ts +0 -7
- package/dist/lib/fiscal-calendar/week-selection.d.ts +3 -4
- package/dist/lib/fiscal-calendar/week-selection.js +52 -79
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
- package/dist/components/data/data-table/column-picker-authority.d.ts +0 -34
- package/dist/components/data/data-table/column-picker-authority.js +0 -116
- package/dist/components/data/data-table/column-picker-drop-validation.d.ts +0 -7
- package/dist/components/data/data-table/column-picker-drop-validation.js +0 -37
- package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +0 -10
- package/dist/components/data/data-table/data-table-column-list-tree-apply.js +0 -79
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +0 -26
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +0 -195
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +0 -1
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +0 -7
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +0 -12
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +0 -12
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +0 -24
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +0 -128
- package/dist/components/data/nested-list/nested-list-display-utils.d.ts +0 -11
- package/dist/components/data/nested-list/nested-list-display-utils.js +0 -74
- package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +0 -31
- package/dist/components/data/nested-list/nested-list-drop-engine.js +0 -209
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +0 -26
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +0 -67
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +0 -4
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +0 -43
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +0 -3
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +0 -34
- package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +0 -9
- package/dist/components/data/nested-list/nested-list-row-estimates.js +0 -14
- package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +0 -36
- package/dist/components/data/nested-list/nested-list-scroll-anchor.js +0 -47
- package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +0 -59
- package/dist/components/data/nested-list/nested-list-virtual-drop.js +0 -341
- package/dist/lib/hash/fnv1a128.d.ts +0 -16
- package/dist/lib/hash/fnv1a128.js +0 -21
|
@@ -1,328 +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
|
-
import { useVirtualizedRows as
|
|
9
|
-
import { NESTED_LIST_VIRTUAL_OVERSCAN as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/* @__PURE__ */ i(
|
|
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(
|
|
17
16
|
"div",
|
|
18
17
|
{
|
|
19
18
|
className: "fixed z-50 pointer-events-none",
|
|
20
|
-
style: { top: `${
|
|
21
|
-
children: /* @__PURE__ */
|
|
19
|
+
style: { top: `${N + 16}px`, left: `${u + 12}px` },
|
|
20
|
+
children: /* @__PURE__ */ b(
|
|
22
21
|
"div",
|
|
23
22
|
{
|
|
24
23
|
className: "inline-flex items-center gap-1.5 bg-canvas-elevated border border-stroke-subtle rounded px-2.5 py-1 shadow-md",
|
|
25
24
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__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 })
|
|
28
27
|
]
|
|
29
28
|
}
|
|
30
29
|
)
|
|
31
30
|
}
|
|
32
31
|
),
|
|
33
32
|
document.body
|
|
34
|
-
)
|
|
35
|
-
isListCollapsed:
|
|
36
|
-
enableDragDrop:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
onDragCancel: B,
|
|
46
|
-
activeId: c,
|
|
47
|
-
onToggleCollapse: U,
|
|
48
|
-
toggleCollapseHandlerRef: q,
|
|
49
|
-
collapsedItems: ce = {},
|
|
50
|
-
onVirtualDrop: K
|
|
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
|
|
51
44
|
}) => {
|
|
52
|
-
const
|
|
53
|
-
if (!e || !
|
|
54
|
-
let
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
(
|
|
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"
|
|
60
53
|
);
|
|
61
|
-
if (
|
|
62
|
-
|
|
54
|
+
if (c)
|
|
55
|
+
t = c.item.id, n = "before";
|
|
63
56
|
else {
|
|
64
|
-
const
|
|
65
|
-
(
|
|
57
|
+
const i = o.slice(0, a).filter(
|
|
58
|
+
(f) => f.item.id !== "root-frozen" && f.item.id !== "root-scrollable"
|
|
66
59
|
);
|
|
67
|
-
|
|
60
|
+
i.length > 0 && (t = i[i.length - 1].item.id, n = "after");
|
|
68
61
|
}
|
|
69
62
|
}
|
|
70
63
|
} else {
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
const
|
|
76
|
-
|
|
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";
|
|
77
70
|
}
|
|
78
71
|
}
|
|
79
72
|
}
|
|
80
|
-
return { overId:
|
|
81
|
-
}, [
|
|
82
|
-
|
|
83
|
-
if (!
|
|
84
|
-
const e = (
|
|
85
|
-
|
|
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));
|
|
86
79
|
};
|
|
87
80
|
return window.addEventListener("pointermove", e), () => window.removeEventListener("pointermove", e);
|
|
88
|
-
}, [
|
|
89
|
-
if (!
|
|
81
|
+
}, [l, z, x]), P(() => {
|
|
82
|
+
if (!l) return;
|
|
90
83
|
const e = document.createElement("style");
|
|
91
84
|
return e.setAttribute("data-drag-cursor", "true"), e.textContent = "body, body * { cursor: grabbing !important; }", document.head.appendChild(e), () => {
|
|
92
85
|
e.remove();
|
|
93
86
|
};
|
|
94
|
-
}, [
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
[
|
|
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
|
|
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
|
|
114
94
|
});
|
|
115
|
-
|
|
116
|
-
if (
|
|
95
|
+
Z(() => {
|
|
96
|
+
if (!E)
|
|
117
97
|
return;
|
|
118
|
-
const e =
|
|
98
|
+
const e = v.current;
|
|
119
99
|
if (!e)
|
|
120
100
|
return;
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
101
|
+
y.measure();
|
|
102
|
+
const r = new ResizeObserver(() => {
|
|
103
|
+
y.measure();
|
|
124
104
|
});
|
|
125
|
-
return
|
|
126
|
-
|
|
105
|
+
return r.observe(e), () => {
|
|
106
|
+
r.disconnect();
|
|
127
107
|
};
|
|
128
|
-
}, [
|
|
129
|
-
const
|
|
130
|
-
(e)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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);
|
|
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);
|
|
192
115
|
else {
|
|
193
|
-
const
|
|
194
|
-
|
|
116
|
+
const n = t.id;
|
|
117
|
+
g(n), h(x(n, S));
|
|
195
118
|
}
|
|
196
|
-
|
|
197
|
-
}, [
|
|
198
|
-
|
|
199
|
-
}, [
|
|
200
|
-
|
|
201
|
-
}, [
|
|
202
|
-
if (
|
|
203
|
-
const
|
|
204
|
-
const { item:
|
|
205
|
-
return /* @__PURE__ */
|
|
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(
|
|
206
129
|
"div",
|
|
207
130
|
{
|
|
208
131
|
className: "relative",
|
|
209
|
-
style: {
|
|
210
|
-
|
|
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
|
-
})
|
|
132
|
+
style: f ? { boxShadow: f } : void 0,
|
|
133
|
+
children: k(n, m, a)
|
|
219
134
|
},
|
|
220
|
-
|
|
135
|
+
n.id
|
|
221
136
|
);
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
(n) => n.item.id === D.overId
|
|
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
|
|
229
143
|
);
|
|
230
|
-
t !== -1 && (
|
|
144
|
+
t !== -1 && (r = _.position === "before" ? t : t + 1);
|
|
231
145
|
}
|
|
232
|
-
if (
|
|
233
|
-
const t =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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(
|
|
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(
|
|
254
152
|
"div",
|
|
255
153
|
{
|
|
256
|
-
"data-index":
|
|
257
|
-
ref:
|
|
154
|
+
"data-index": n.index,
|
|
155
|
+
ref: M,
|
|
258
156
|
className: "absolute left-0 top-0 w-full",
|
|
259
|
-
style: { transform: `translateY(${
|
|
260
|
-
children:
|
|
157
|
+
style: { transform: `translateY(${n.start}px)` },
|
|
158
|
+
children: D(m, n.index, r)
|
|
261
159
|
},
|
|
262
|
-
|
|
160
|
+
m.item.id
|
|
263
161
|
) : null;
|
|
264
162
|
}),
|
|
265
|
-
|
|
163
|
+
u ? /* @__PURE__ */ s(
|
|
266
164
|
"div",
|
|
267
165
|
{
|
|
268
166
|
"aria-hidden": !0,
|
|
269
167
|
className: "absolute left-0 w-full h-8 shrink-0",
|
|
270
|
-
style: { top:
|
|
168
|
+
style: { top: O },
|
|
271
169
|
"data-slot": "drag-drop-tail"
|
|
272
170
|
}
|
|
273
171
|
) : null
|
|
274
172
|
] });
|
|
275
173
|
}
|
|
276
|
-
return /* @__PURE__ */
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
p ? /* @__PURE__ */ i("div", { "aria-hidden": !0, className: "h-8 shrink-0", "data-slot": "drag-drop-tail" }) : null
|
|
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
|
|
282
179
|
] });
|
|
283
180
|
};
|
|
284
|
-
return /* @__PURE__ */
|
|
285
|
-
/* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ b("div", { className: "flex flex-col min-h-0 h-full", children: [
|
|
182
|
+
/* @__PURE__ */ s(
|
|
286
183
|
"div",
|
|
287
184
|
{
|
|
288
|
-
ref:
|
|
289
|
-
"data-slot": "nested-list-scroll",
|
|
185
|
+
ref: v,
|
|
290
186
|
className: "flex-1 p-1 overflow-y-auto overflow-x-hidden relative",
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
be,
|
|
187
|
+
children: u ? /* @__PURE__ */ s(
|
|
188
|
+
Q,
|
|
294
189
|
{
|
|
295
|
-
sensors:
|
|
296
|
-
collisionDetection:
|
|
297
|
-
onDragStart:
|
|
298
|
-
onDragOver:
|
|
299
|
-
onDragEnd:
|
|
300
|
-
onDragCancel:
|
|
301
|
-
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() })
|
|
302
197
|
}
|
|
303
|
-
) :
|
|
304
|
-
}
|
|
305
|
-
),
|
|
306
|
-
c && Q && !f && /* @__PURE__ */ i(
|
|
307
|
-
ie,
|
|
308
|
-
{
|
|
309
|
-
item: Q.item,
|
|
310
|
-
pointerX: de,
|
|
311
|
-
pointerY: T,
|
|
312
|
-
isVisible: !0
|
|
198
|
+
) : H()
|
|
313
199
|
}
|
|
314
200
|
),
|
|
315
|
-
|
|
316
|
-
|
|
201
|
+
l && A && /* @__PURE__ */ s(
|
|
202
|
+
ue,
|
|
317
203
|
{
|
|
318
|
-
item:
|
|
319
|
-
pointerX:
|
|
320
|
-
pointerY:
|
|
321
|
-
isVisible: v.isPointerInsideScrollContainer
|
|
204
|
+
item: A.item,
|
|
205
|
+
pointerX: X,
|
|
206
|
+
pointerY: S
|
|
322
207
|
}
|
|
323
208
|
)
|
|
324
209
|
] });
|
|
325
210
|
};
|
|
326
211
|
export {
|
|
327
|
-
|
|
212
|
+
be as NestedListContent
|
|
328
213
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { NestedListItem
|
|
2
|
+
import { NestedListItem } from '../nested-list.types';
|
|
3
3
|
interface SortableItemProps {
|
|
4
4
|
item: NestedListItem;
|
|
5
5
|
level: number;
|
|
@@ -11,7 +11,6 @@ interface SortableItemProps {
|
|
|
11
11
|
isOver?: boolean;
|
|
12
12
|
isValidDrop?: boolean;
|
|
13
13
|
enableDragDrop?: boolean;
|
|
14
|
-
dragMode?: NestedListDragMode;
|
|
15
14
|
enableCollapse?: boolean;
|
|
16
15
|
shouldBlink?: boolean;
|
|
17
16
|
isDragDisabled?: boolean;
|