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,378 +1,392 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { SortableItem as
|
|
4
|
-
import { SelectionMode as
|
|
5
|
-
import { useNestedListDragDrop as
|
|
6
|
-
import { useNestedListSelectAll as
|
|
7
|
-
import { useNestedListState as
|
|
8
|
-
import { useNestedListHandlers as
|
|
9
|
-
import { NestedListHeader as
|
|
10
|
-
import { NestedListCategoryFilters as
|
|
11
|
-
import { NestedListContent as
|
|
12
|
-
import { NestedListApplyDiscardButtons as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
import { jsx as S, jsxs as ie } from "react/jsx-runtime";
|
|
2
|
+
import X, { useMemo as T, useCallback as A } from "react";
|
|
3
|
+
import { SortableItem as Ke } from "./components/SortableItem.js";
|
|
4
|
+
import { SelectionMode as _ } from "./nested-list.types.js";
|
|
5
|
+
import { useNestedListDragDrop as Qe } from "./hooks/useNestedListDragDrop.js";
|
|
6
|
+
import { useNestedListSelectAll as Xe } from "./hooks/useNestedListSelectAll.js";
|
|
7
|
+
import { useNestedListState as Ye } from "./hooks/useNestedListState.js";
|
|
8
|
+
import { useNestedListHandlers as Ze } from "./hooks/useNestedListHandlers.js";
|
|
9
|
+
import { NestedListHeader as $e } from "./components/NestedListHeader.js";
|
|
10
|
+
import { NestedListCategoryFilters as Me } from "./components/NestedListCategoryFilters.js";
|
|
11
|
+
import { NestedListContent as Ge } from "./components/NestedListContent.js";
|
|
12
|
+
import { NestedListApplyDiscardButtons as et } from "./components/NestedListApplyDiscardButtons.js";
|
|
13
|
+
import { shouldUseNestedListRevisionTracking as tt, computeNestedListHasChanges as st } from "./nested-list-change-detection.js";
|
|
14
|
+
import { cn as rt } from "../../../lib/utils.js";
|
|
15
|
+
import { useImpactNovaI18n as nt } from "../../../i18n/use-impact-nova-i18n.js";
|
|
16
|
+
const ae = (i, t) => {
|
|
17
|
+
if (!t || typeof t != "string") return i;
|
|
18
|
+
const o = t.toLowerCase(), c = [];
|
|
19
|
+
return i.forEach((n) => {
|
|
20
|
+
const d = n.label.toLowerCase().includes(o), l = n.children ? ae(n.children, t) : void 0;
|
|
21
|
+
(d || l && l.length > 0) && c.push({
|
|
22
|
+
...n,
|
|
23
|
+
children: l || n.children
|
|
24
|
+
});
|
|
25
|
+
}), c;
|
|
26
|
+
}, he = (i) => i.map((t) => {
|
|
27
|
+
if (t.children && t.children.length > 0) {
|
|
28
|
+
const o = he(t.children), c = o.every((n) => n.checked);
|
|
29
|
+
return {
|
|
30
|
+
...t,
|
|
31
|
+
checked: c,
|
|
32
|
+
children: o
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return t;
|
|
36
|
+
}), lt = (i, t) => {
|
|
37
|
+
const o = /* @__PURE__ */ new Set(), c = (n) => {
|
|
38
|
+
n.forEach((d) => {
|
|
39
|
+
const l = t ? t(d) : d.category;
|
|
40
|
+
l && o.add(l), d.children && c(d.children);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
return c(i), Array.from(o).sort();
|
|
44
|
+
}, ue = (i, t, o) => {
|
|
45
|
+
if (t.size === 0) return i;
|
|
46
|
+
const c = [];
|
|
47
|
+
return i.forEach((n) => {
|
|
48
|
+
const d = o ? o(n) : n.category, l = d && t.has(d), m = n.children ? ue(n.children, t, o) : void 0;
|
|
49
|
+
(l || m && m.length > 0) && c.push({
|
|
50
|
+
...n,
|
|
51
|
+
children: m
|
|
52
|
+
});
|
|
53
|
+
}), c;
|
|
54
|
+
}, fe = (i, t, o, c = 0, n = 0) => {
|
|
55
|
+
const d = [];
|
|
56
|
+
return i.forEach((l) => {
|
|
57
|
+
if (d.push({
|
|
58
|
+
item: l,
|
|
59
|
+
level: c,
|
|
60
|
+
indentLevel: l.category === "structure" ? 0 : n
|
|
61
|
+
}), !t[l.id] && l.children && l.children.length > 0 && l.id !== o) {
|
|
62
|
+
const y = l.category === "structure" ? 0 : n + 1;
|
|
63
|
+
d.push(
|
|
64
|
+
...fe(
|
|
65
|
+
l.children,
|
|
66
|
+
t,
|
|
67
|
+
o,
|
|
68
|
+
c + 1,
|
|
69
|
+
y
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}), d;
|
|
74
|
+
}, St = ({
|
|
75
|
+
items: i,
|
|
76
|
+
onChange: t,
|
|
77
|
+
onSubmit: o,
|
|
78
|
+
onCancel: c,
|
|
79
|
+
onItemToggle: n,
|
|
80
|
+
onDragEnd: d,
|
|
81
|
+
renderLabelExtras: l,
|
|
82
|
+
renderActions: m,
|
|
83
|
+
enableSearch: y = !0,
|
|
84
|
+
enableDragDrop: H = !0,
|
|
85
|
+
enableSelectAll: pe = !0,
|
|
86
|
+
enableGroupBy: g = !1,
|
|
87
|
+
getCategory: C,
|
|
88
|
+
searchPlaceholder: me,
|
|
89
|
+
className: Ie = "",
|
|
38
90
|
groupLabel: ve,
|
|
39
|
-
enableApplyDiscard:
|
|
40
|
-
enableCollapse:
|
|
91
|
+
enableApplyDiscard: p = !1,
|
|
92
|
+
enableCollapse: Y = !0,
|
|
41
93
|
enableGlobalCollapse: Ce = !0,
|
|
42
|
-
submitButtonLabel:
|
|
43
|
-
cancelButtonLabel:
|
|
44
|
-
selectionMode:
|
|
45
|
-
initialCollapsedItems:
|
|
46
|
-
onCollapseChange:
|
|
47
|
-
canDrag:
|
|
48
|
-
isValidDropTarget: U,
|
|
49
|
-
dragMode: V,
|
|
50
|
-
onVirtualReorder: F,
|
|
51
|
-
onVirtualDrop: _,
|
|
52
|
-
flatVirtualRowResolver: j,
|
|
53
|
-
onFlatVirtualSelectAll: M
|
|
94
|
+
submitButtonLabel: Ne,
|
|
95
|
+
cancelButtonLabel: Le,
|
|
96
|
+
selectionMode: N = _.CASCADE_DOWN,
|
|
97
|
+
initialCollapsedItems: Se,
|
|
98
|
+
onCollapseChange: Z,
|
|
99
|
+
canDrag: w
|
|
54
100
|
}) => {
|
|
55
|
-
const { t:
|
|
56
|
-
items:
|
|
57
|
-
setItems:
|
|
58
|
-
itemsRef:
|
|
59
|
-
savedItems:
|
|
60
|
-
setSavedItems:
|
|
61
|
-
markUserChange:
|
|
62
|
-
searchText:
|
|
63
|
-
setSearchText:
|
|
64
|
-
collapsedItems:
|
|
65
|
-
setCollapsedItems:
|
|
66
|
-
isListCollapsed:
|
|
67
|
-
setIsListCollapsed:
|
|
68
|
-
activeId:
|
|
101
|
+
const { t: P } = nt(), ge = me ?? P("nestedList.searchPlaceholder"), ke = Ne ?? P("nestedList.apply"), Ee = Le ?? P("nestedList.reset"), {
|
|
102
|
+
items: h,
|
|
103
|
+
setItems: L,
|
|
104
|
+
itemsRef: O,
|
|
105
|
+
savedItems: x,
|
|
106
|
+
setSavedItems: $,
|
|
107
|
+
markUserChange: R,
|
|
108
|
+
searchText: b,
|
|
109
|
+
setSearchText: De,
|
|
110
|
+
collapsedItems: I,
|
|
111
|
+
setCollapsedItems: Te,
|
|
112
|
+
isListCollapsed: z,
|
|
113
|
+
setIsListCollapsed: Ae,
|
|
114
|
+
activeId: v,
|
|
69
115
|
setActiveId: W,
|
|
70
|
-
setOverId:
|
|
71
|
-
selectedCategories:
|
|
72
|
-
setSelectedCategories:
|
|
73
|
-
itemsToBlink:
|
|
74
|
-
setItemsToBlink:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
);
|
|
116
|
-
r
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
overId: r,
|
|
121
|
-
insertAfter: f,
|
|
122
|
-
collapsedItems: o,
|
|
123
|
-
canDrag: L,
|
|
124
|
-
isValidDropTarget: U
|
|
125
|
-
});
|
|
126
|
-
D !== s && (a(D), u(D), y?.(e, t));
|
|
127
|
-
}, [s, N, o, L, U, n, u, y, a]), _e = c((e, t, i) => {
|
|
128
|
-
if (_) {
|
|
129
|
-
e !== t && _(e, t, i);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
const r = St({
|
|
133
|
-
activeId: e,
|
|
134
|
-
overId: t,
|
|
135
|
-
insertAfter: i,
|
|
136
|
-
flatVirtualRowModel: l,
|
|
137
|
-
displayItems: N,
|
|
138
|
-
onVirtualReorder: F
|
|
139
|
-
});
|
|
140
|
-
if (r) {
|
|
141
|
-
F?.(r.fromIndex, r.toIndex);
|
|
142
|
-
return;
|
|
116
|
+
setOverId: j,
|
|
117
|
+
selectedCategories: B,
|
|
118
|
+
setSelectedCategories: we,
|
|
119
|
+
itemsToBlink: M,
|
|
120
|
+
setItemsToBlink: F,
|
|
121
|
+
// Normalized state helpers (for optimized operations)
|
|
122
|
+
isNormalized: Pe,
|
|
123
|
+
normalizedState: xe,
|
|
124
|
+
batchUpdateItems: Re
|
|
125
|
+
} = Ye({
|
|
126
|
+
initialItems: i,
|
|
127
|
+
enableApplyDiscard: p,
|
|
128
|
+
// Enable normalized state for large datasets (can be made configurable via props)
|
|
129
|
+
enableNormalizedState: tt(i.length),
|
|
130
|
+
initialCollapsedItems: Se
|
|
131
|
+
});
|
|
132
|
+
X.useEffect(() => {
|
|
133
|
+
Z?.(I);
|
|
134
|
+
}, [I, Z]);
|
|
135
|
+
const [V, G] = X.useState(0), [U, be] = X.useState(0), {
|
|
136
|
+
sensors: ze,
|
|
137
|
+
handleDragEnd: Be,
|
|
138
|
+
isValidDrop: ee
|
|
139
|
+
} = Qe({
|
|
140
|
+
items: h,
|
|
141
|
+
onDragEnd: d,
|
|
142
|
+
collapsedItems: I,
|
|
143
|
+
canDrag: w
|
|
144
|
+
}), Ve = T(
|
|
145
|
+
() => g ? lt(h, C) : [],
|
|
146
|
+
[h, g, C]
|
|
147
|
+
), k = T(() => {
|
|
148
|
+
let e = h;
|
|
149
|
+
return g && B.size > 0 && (e = ue(e, B, C)), b && (e = ae(e, b)), e;
|
|
150
|
+
}, [h, b, g, B, C]), q = T(
|
|
151
|
+
() => fe(k, I, v),
|
|
152
|
+
[k, I, v]
|
|
153
|
+
), { allChecked: E, someChecked: Ue } = T(() => {
|
|
154
|
+
let e = !0, s = !1;
|
|
155
|
+
for (const { item: r } of q)
|
|
156
|
+
if (!(!(!r.children || r.children.length === 0) || r.category === "structure") && (r.checked ? s = !0 : e = !1, s && !e))
|
|
157
|
+
break;
|
|
158
|
+
return { allChecked: e && s, someChecked: s };
|
|
159
|
+
}, [q]), _e = Ue && !E, J = (e, s) => {
|
|
160
|
+
for (const r of e) {
|
|
161
|
+
if (r.id === s) return r;
|
|
162
|
+
if (r.children) {
|
|
163
|
+
const u = J(r.children, s);
|
|
164
|
+
if (u) return u;
|
|
165
|
+
}
|
|
143
166
|
}
|
|
144
|
-
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
167
|
+
return null;
|
|
168
|
+
}, ye = A(
|
|
169
|
+
(e, s) => {
|
|
170
|
+
if (N === _.INDEPENDENT)
|
|
171
|
+
return e;
|
|
172
|
+
const r = (f, a) => f.id === a ? !0 : f.children ? f.children.some(
|
|
173
|
+
(D) => r(D, a)
|
|
174
|
+
) : !1, u = (f) => f.map((a) => {
|
|
175
|
+
if (a.id === s)
|
|
176
|
+
return a;
|
|
177
|
+
if (a.children && r(a, s)) {
|
|
178
|
+
const D = u(a.children);
|
|
179
|
+
let K;
|
|
180
|
+
return N === _.CASCADE_UP_DOWN ? K = D.some((Q) => Q.checked) : K = D.every((Q) => Q.checked), {
|
|
181
|
+
...a,
|
|
182
|
+
checked: K,
|
|
183
|
+
children: D
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
return a;
|
|
187
|
+
});
|
|
188
|
+
return u(e);
|
|
189
|
+
},
|
|
190
|
+
[N]
|
|
191
|
+
), te = (e) => {
|
|
192
|
+
const s = [];
|
|
193
|
+
return e.forEach((r) => {
|
|
194
|
+
r.children && r.children.length > 0 && (s.push(r.id), s.push(...te(r.children)));
|
|
195
|
+
}), s;
|
|
196
|
+
}, {
|
|
197
|
+
handleToggle: se,
|
|
158
198
|
handleToggleCollapse: re,
|
|
159
|
-
handleCollapseAll:
|
|
160
|
-
handleToggleCategory:
|
|
161
|
-
} =
|
|
162
|
-
setItems:
|
|
163
|
-
itemsRef:
|
|
164
|
-
findItemById:
|
|
165
|
-
updateParentsUpward:
|
|
199
|
+
handleCollapseAll: He,
|
|
200
|
+
handleToggleCategory: Oe
|
|
201
|
+
} = Ze({
|
|
202
|
+
setItems: L,
|
|
203
|
+
itemsRef: O,
|
|
204
|
+
findItemById: J,
|
|
205
|
+
updateParentsUpward: ye,
|
|
166
206
|
onChange: (e) => {
|
|
167
|
-
|
|
207
|
+
G((s) => s + 1), t(e);
|
|
168
208
|
},
|
|
169
|
-
onItemToggle:
|
|
170
|
-
getCategory:
|
|
171
|
-
setCollapsedItems:
|
|
172
|
-
setIsListCollapsed:
|
|
173
|
-
setSelectedCategories:
|
|
174
|
-
markUserChange:
|
|
175
|
-
selectionMode:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
n();
|
|
193
|
-
const e = T.current, t = ae(m), i = ce(
|
|
194
|
-
m,
|
|
209
|
+
onItemToggle: n,
|
|
210
|
+
getCategory: C,
|
|
211
|
+
setCollapsedItems: Te,
|
|
212
|
+
setIsListCollapsed: Ae,
|
|
213
|
+
setSelectedCategories: we,
|
|
214
|
+
markUserChange: R,
|
|
215
|
+
selectionMode: N,
|
|
216
|
+
// Pass normalized state helpers for optimized operations
|
|
217
|
+
isNormalized: Pe,
|
|
218
|
+
normalizedState: xe,
|
|
219
|
+
batchUpdateItems: Re
|
|
220
|
+
}), {
|
|
221
|
+
collectVisibleItemIds: ne,
|
|
222
|
+
findItemsNotSelected: le,
|
|
223
|
+
collectVisibleItemsForCallback: oe,
|
|
224
|
+
updateVisibleItems: ce
|
|
225
|
+
} = Xe({
|
|
226
|
+
findItemById: J,
|
|
227
|
+
getCategory: C
|
|
228
|
+
}), We = A(() => {
|
|
229
|
+
R();
|
|
230
|
+
const e = O.current, s = ne(k), r = le(
|
|
231
|
+
k,
|
|
195
232
|
e,
|
|
196
|
-
|
|
233
|
+
s
|
|
197
234
|
);
|
|
198
|
-
|
|
199
|
-
const
|
|
235
|
+
r.size > 0 && (F(new Set(r)), setTimeout(() => F(/* @__PURE__ */ new Set()), 600));
|
|
236
|
+
const u = ce(
|
|
200
237
|
e,
|
|
201
|
-
|
|
202
|
-
!
|
|
203
|
-
), f =
|
|
204
|
-
if (
|
|
205
|
-
const
|
|
238
|
+
s,
|
|
239
|
+
!E
|
|
240
|
+
), f = N === _.INDEPENDENT ? u : he(u);
|
|
241
|
+
if (L(f), t(f), n) {
|
|
242
|
+
const a = oe(
|
|
206
243
|
e,
|
|
207
|
-
|
|
208
|
-
!
|
|
244
|
+
s,
|
|
245
|
+
!E
|
|
209
246
|
);
|
|
210
|
-
|
|
247
|
+
n(a);
|
|
211
248
|
}
|
|
212
249
|
}, [
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
u,
|
|
216
|
-
M,
|
|
217
|
-
h,
|
|
218
|
-
m,
|
|
219
|
-
ae,
|
|
220
|
-
ce,
|
|
221
|
-
de,
|
|
222
|
-
me,
|
|
250
|
+
E,
|
|
251
|
+
t,
|
|
223
252
|
n,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
oe(e);
|
|
240
|
-
},
|
|
241
|
-
[l, n, h, T, oe]
|
|
242
|
-
), Xe = c(
|
|
243
|
-
(e, t, i, r) => {
|
|
244
|
-
const f = d ? ie(d, e.id) : !1, R = te.has(e.id), D = L ? !L(e, t) : e.isDragDisabled ?? !1;
|
|
245
|
-
return /* @__PURE__ */ v(
|
|
246
|
-
Oe,
|
|
253
|
+
k,
|
|
254
|
+
ne,
|
|
255
|
+
le,
|
|
256
|
+
oe,
|
|
257
|
+
ce,
|
|
258
|
+
R,
|
|
259
|
+
O,
|
|
260
|
+
L,
|
|
261
|
+
F,
|
|
262
|
+
N
|
|
263
|
+
]), je = A(
|
|
264
|
+
(e, s, r) => {
|
|
265
|
+
const u = v ? ee(v, e.id) : !1, f = M.has(e.id), a = w ? !w(e, s) : e.isDragDisabled ?? !1;
|
|
266
|
+
return /* @__PURE__ */ S(
|
|
267
|
+
Ke,
|
|
247
268
|
{
|
|
248
269
|
item: e,
|
|
249
|
-
level:
|
|
250
|
-
indentLevel:
|
|
251
|
-
isCollapsed:
|
|
252
|
-
onToggle:
|
|
253
|
-
onToggleCollapse:
|
|
254
|
-
isAnyDragging:
|
|
255
|
-
isValidDrop:
|
|
256
|
-
enableDragDrop:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
renderActions: $
|
|
270
|
+
level: s,
|
|
271
|
+
indentLevel: r,
|
|
272
|
+
isCollapsed: I[e.id] || !1,
|
|
273
|
+
onToggle: se,
|
|
274
|
+
onToggleCollapse: re,
|
|
275
|
+
isAnyDragging: v !== null,
|
|
276
|
+
isValidDrop: u,
|
|
277
|
+
enableDragDrop: H,
|
|
278
|
+
enableCollapse: Y,
|
|
279
|
+
shouldBlink: f,
|
|
280
|
+
isDragDisabled: a,
|
|
281
|
+
renderLabelExtras: l,
|
|
282
|
+
renderActions: m
|
|
263
283
|
},
|
|
264
284
|
e.id
|
|
265
285
|
);
|
|
266
286
|
},
|
|
267
287
|
[
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
288
|
+
I,
|
|
289
|
+
se,
|
|
290
|
+
re,
|
|
291
|
+
v,
|
|
292
|
+
ee,
|
|
293
|
+
H,
|
|
294
|
+
M,
|
|
295
|
+
Y,
|
|
296
|
+
w,
|
|
297
|
+
l,
|
|
298
|
+
m
|
|
279
299
|
]
|
|
280
|
-
),
|
|
281
|
-
() =>
|
|
282
|
-
enableApplyDiscard:
|
|
283
|
-
items:
|
|
284
|
-
savedItems:
|
|
285
|
-
revision:
|
|
286
|
-
savedRevision:
|
|
300
|
+
), Fe = te(h).length > 0, de = T(
|
|
301
|
+
() => st({
|
|
302
|
+
enableApplyDiscard: p,
|
|
303
|
+
items: h,
|
|
304
|
+
savedItems: x,
|
|
305
|
+
revision: V,
|
|
306
|
+
savedRevision: U
|
|
287
307
|
}),
|
|
288
|
-
[
|
|
289
|
-
),
|
|
290
|
-
|
|
291
|
-
}, [
|
|
292
|
-
|
|
293
|
-
}, [
|
|
294
|
-
return /* @__PURE__ */
|
|
308
|
+
[p, h, x, V, U]
|
|
309
|
+
), qe = A(() => {
|
|
310
|
+
p && ($(h), be(V), o?.(h));
|
|
311
|
+
}, [p, h, o, $, V]), Je = A(() => {
|
|
312
|
+
p && (L(x), G(U), c?.());
|
|
313
|
+
}, [p, x, c, L, U]);
|
|
314
|
+
return /* @__PURE__ */ ie(
|
|
295
315
|
"div",
|
|
296
316
|
{
|
|
297
|
-
className:
|
|
317
|
+
className: rt("flex flex-col min-h-0", Ie),
|
|
298
318
|
"data-component": "nested-list",
|
|
299
|
-
"data-has-changes":
|
|
300
|
-
"data-list-collapsed":
|
|
319
|
+
"data-has-changes": de ? "" : void 0,
|
|
320
|
+
"data-list-collapsed": z ? "" : void 0,
|
|
301
321
|
children: [
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
|
|
322
|
+
/* @__PURE__ */ ie("div", { className: "flex-shrink-0", children: [
|
|
323
|
+
/* @__PURE__ */ S(
|
|
324
|
+
$e,
|
|
305
325
|
{
|
|
306
|
-
hasItemsWithChildren:
|
|
307
|
-
isListCollapsed:
|
|
308
|
-
onCollapseAll:
|
|
309
|
-
enableSearch:
|
|
310
|
-
enableSelectAll:
|
|
326
|
+
hasItemsWithChildren: Fe,
|
|
327
|
+
isListCollapsed: z,
|
|
328
|
+
onCollapseAll: He,
|
|
329
|
+
enableSearch: y,
|
|
330
|
+
enableSelectAll: pe,
|
|
311
331
|
groupLabel: ve,
|
|
312
|
-
allChecked:
|
|
313
|
-
isIndeterminate:
|
|
314
|
-
onSelectAll:
|
|
315
|
-
searchText:
|
|
332
|
+
allChecked: E,
|
|
333
|
+
isIndeterminate: _e,
|
|
334
|
+
onSelectAll: We,
|
|
335
|
+
searchText: b,
|
|
316
336
|
onSearchChange: (e) => {
|
|
317
|
-
|
|
337
|
+
De(e.target.value);
|
|
318
338
|
},
|
|
319
|
-
searchPlaceholder:
|
|
320
|
-
selectAllLabel:
|
|
339
|
+
searchPlaceholder: ge,
|
|
340
|
+
selectAllLabel: P("nestedList.selectAll"),
|
|
321
341
|
enableCollapse: Ce
|
|
322
342
|
}
|
|
323
343
|
),
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
|
|
344
|
+
/* @__PURE__ */ S(
|
|
345
|
+
Me,
|
|
326
346
|
{
|
|
327
|
-
isListCollapsed:
|
|
328
|
-
enableGroupBy:
|
|
329
|
-
categories:
|
|
330
|
-
selectedCategories:
|
|
331
|
-
onToggleCategory:
|
|
347
|
+
isListCollapsed: z,
|
|
348
|
+
enableGroupBy: g,
|
|
349
|
+
categories: Ve,
|
|
350
|
+
selectedCategories: B,
|
|
351
|
+
onToggleCategory: Oe
|
|
332
352
|
}
|
|
333
353
|
)
|
|
334
354
|
] }),
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
|
|
355
|
+
/* @__PURE__ */ S("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ S(
|
|
356
|
+
Ge,
|
|
337
357
|
{
|
|
338
|
-
isListCollapsed:
|
|
339
|
-
enableDragDrop:
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
renderItem: Xe,
|
|
345
|
-
activeId: d,
|
|
346
|
-
onToggleCollapse: re,
|
|
347
|
-
toggleCollapseHandlerRef: ne,
|
|
348
|
-
collapsedItems: o,
|
|
349
|
-
onVirtualDrop: _e,
|
|
358
|
+
isListCollapsed: z,
|
|
359
|
+
enableDragDrop: H,
|
|
360
|
+
sensors: ze,
|
|
361
|
+
items: q,
|
|
362
|
+
renderItem: je,
|
|
363
|
+
activeId: v,
|
|
350
364
|
onDragStart: (e) => {
|
|
351
365
|
W(e.active.id);
|
|
352
366
|
},
|
|
353
367
|
onDragOver: (e) => {
|
|
354
|
-
|
|
368
|
+
j(e.over?.id);
|
|
355
369
|
},
|
|
356
370
|
onDragEnd: (e) => {
|
|
357
|
-
W(null),
|
|
358
|
-
const
|
|
359
|
-
|
|
371
|
+
W(null), j(null), R(), Be(e, (s) => {
|
|
372
|
+
const r = s(h);
|
|
373
|
+
L(r), t(r);
|
|
360
374
|
});
|
|
361
375
|
},
|
|
362
376
|
onDragCancel: () => {
|
|
363
|
-
W(null),
|
|
377
|
+
W(null), j(null);
|
|
364
378
|
}
|
|
365
379
|
}
|
|
366
380
|
) }),
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
|
|
381
|
+
/* @__PURE__ */ S(
|
|
382
|
+
et,
|
|
369
383
|
{
|
|
370
|
-
enableApplyDiscard:
|
|
371
|
-
hasChanges:
|
|
372
|
-
onDiscard:
|
|
373
|
-
onApply:
|
|
374
|
-
cancelButtonLabel:
|
|
375
|
-
submitButtonLabel:
|
|
384
|
+
enableApplyDiscard: p,
|
|
385
|
+
hasChanges: de,
|
|
386
|
+
onDiscard: Je,
|
|
387
|
+
onApply: qe,
|
|
388
|
+
cancelButtonLabel: Ee,
|
|
389
|
+
submitButtonLabel: ke
|
|
376
390
|
}
|
|
377
391
|
)
|
|
378
392
|
]
|
|
@@ -380,5 +394,5 @@ const Xt = ({
|
|
|
380
394
|
);
|
|
381
395
|
};
|
|
382
396
|
export {
|
|
383
|
-
|
|
397
|
+
St as NestedList
|
|
384
398
|
};
|