ezux 1.0.0
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/LICENSE +21 -0
- package/README.md +56 -0
- package/dist/EzEventModal-DtpvYwGr.js +684 -0
- package/dist/EzGroupingPanel-CFwKUrF_.js +59 -0
- package/dist/EzTableEditDialog-BIk_mNpI.js +60 -0
- package/dist/components/EzKanban/EzKanban.types.d.ts +789 -0
- package/dist/components/EzKanban/components/CardEditorModal.d.ts +23 -0
- package/dist/components/EzKanban/components/EzKanbanErrorFallback.d.ts +1 -0
- package/dist/components/EzKanban/components/FilterPopover.d.ts +10 -0
- package/dist/components/EzKanban/components/KanbanBoard.d.ts +62 -0
- package/dist/components/EzKanban/components/KanbanCard.d.ts +38 -0
- package/dist/components/EzKanban/components/KanbanColumn.d.ts +55 -0
- package/dist/components/EzKanban/components/KanbanSwimlane.d.ts +46 -0
- package/dist/components/EzKanban/components/KanbanToolbar.d.ts +41 -0
- package/dist/components/EzKanban/exports.d.ts +4 -0
- package/dist/components/EzKanban/hooks/useKanbanCards.d.ts +36 -0
- package/dist/components/EzKanban/hooks/useKanbanColumns.d.ts +27 -0
- package/dist/components/EzKanban/hooks/useKanbanDragDrop.d.ts +31 -0
- package/dist/components/EzKanban/hooks/useKanbanFilters.d.ts +23 -0
- package/dist/components/EzKanban/hooks/useKanbanState.d.ts +79 -0
- package/dist/components/EzKanban/hooks/useKanbanSwimlanes.d.ts +27 -0
- package/dist/components/EzKanban/hooks/useKanbanVirtualization.d.ts +16 -0
- package/dist/components/EzKanban/index.d.ts +45 -0
- package/dist/components/EzKanban/services/KanbanService.d.ts +30 -0
- package/dist/components/EzKanban/state/kanban.store.d.ts +33 -0
- package/dist/components/EzKanban/useEzKanban.d.ts +162 -0
- package/dist/components/EzKanban/views/KanbanTimelineView.d.ts +15 -0
- package/dist/components/EzLayout/Authentication/AuthSlider.d.ts +13 -0
- package/dist/components/EzLayout/Authentication/InputPassword.d.ts +7 -0
- package/dist/components/EzLayout/Authentication/SignInForm.d.ts +21 -0
- package/dist/components/EzLayout/Authentication/SignUpForm.d.ts +20 -0
- package/dist/components/EzLayout/EzHeader.d.ts +33 -0
- package/dist/components/EzLayout/EzLanguageSwitcher.d.ts +4 -0
- package/dist/components/EzLayout/EzLayout.types.d.ts +223 -0
- package/dist/components/EzLayout/EzSidebar.d.ts +14 -0
- package/dist/components/EzLayout/EzThemeColorChanger.d.ts +9 -0
- package/dist/components/EzLayout/EzThemeSwitcher.d.ts +8 -0
- package/dist/components/EzLayout/EzUserProfile.d.ts +23 -0
- package/dist/components/EzLayout/components/MainContent.d.ts +13 -0
- package/dist/components/EzLayout/hooks/useLayoutImperative.d.ts +17 -0
- package/dist/components/EzLayout/hooks/useLayoutState.d.ts +25 -0
- package/dist/components/EzLayout/index.d.ts +19 -0
- package/dist/components/EzLayout/useEzLayout.d.ts +26 -0
- package/dist/components/EzScheduler/EzScheduler.types.d.ts +1658 -0
- package/dist/components/EzScheduler/EzSchedulerToolbar.d.ts +117 -0
- package/dist/components/EzScheduler/components/EzEventModal.d.ts +17 -0
- package/dist/components/EzScheduler/components/EzOverlapAlert.d.ts +12 -0
- package/dist/components/EzScheduler/components/EzQuickInfoPopup.d.ts +22 -0
- package/dist/components/EzScheduler/components/EzResourceSidebar.d.ts +33 -0
- package/dist/components/EzScheduler/components/EzSchedulerContent.d.ts +123 -0
- package/dist/components/EzScheduler/components/EzSchedulerQuickAdd.d.ts +17 -0
- package/dist/components/EzScheduler/components/RecurrenceEditor.d.ts +7 -0
- package/dist/components/EzScheduler/components/SchedulerLoadingSpinner.d.ts +2 -0
- package/dist/components/EzScheduler/components/dnd/DraggableEvent.d.ts +21 -0
- package/dist/components/EzScheduler/components/dnd/DroppableSlot.d.ts +19 -0
- package/dist/components/EzScheduler/hooks/useRecurrence.d.ts +2 -0
- package/dist/components/EzScheduler/hooks/useSchedulerEventHandlers.d.ts +11 -0
- package/dist/components/EzScheduler/hooks/useSchedulerEvents.d.ts +26 -0
- package/dist/components/EzScheduler/hooks/useSchedulerImperative.d.ts +15 -0
- package/dist/components/EzScheduler/hooks/useSchedulerNavigation.d.ts +9 -0
- package/dist/components/EzScheduler/hooks/useSchedulerResources.d.ts +10 -0
- package/dist/components/EzScheduler/hooks/useSchedulerState.d.ts +14 -0
- package/dist/components/EzScheduler/hooks/useSchedulerVirtualization.d.ts +9 -0
- package/dist/components/EzScheduler/index.d.ts +41 -0
- package/dist/components/EzScheduler/models/EventSettings.d.ts +11 -0
- package/dist/components/EzScheduler/models/View.d.ts +49 -0
- package/dist/components/EzScheduler/models/index.d.ts +2 -0
- package/dist/components/EzScheduler/services/AttendeeService.d.ts +15 -0
- package/dist/components/EzScheduler/services/AuditService.d.ts +15 -0
- package/dist/components/EzScheduler/services/CollisionDetectionService.d.ts +19 -0
- package/dist/components/EzScheduler/services/DragAndDropService.d.ts +16 -0
- package/dist/components/EzScheduler/services/HistoryService.d.ts +31 -0
- package/dist/components/EzScheduler/services/ICalendarImportService.d.ts +16 -0
- package/dist/components/EzScheduler/services/PrintService.d.ts +7 -0
- package/dist/components/EzScheduler/services/RecurrenceEngine.d.ts +7 -0
- package/dist/components/EzScheduler/services/ReminderService.d.ts +17 -0
- package/dist/components/EzScheduler/services/SchedulerService.d.ts +69 -0
- package/dist/components/EzScheduler/services/SearchService.d.ts +11 -0
- package/dist/components/EzScheduler/services/SecurityService.d.ts +25 -0
- package/dist/components/EzScheduler/services/TimezoneService.d.ts +20 -0
- package/dist/components/EzScheduler/services/VirtualScrollingService.d.ts +34 -0
- package/dist/components/EzScheduler/state/scheduler.store.d.ts +27 -0
- package/dist/components/EzScheduler/templates/CellTemplate.d.ts +42 -0
- package/dist/components/EzScheduler/templates/EditorTemplate.d.ts +32 -0
- package/dist/components/EzScheduler/templates/HeaderTemplate.d.ts +36 -0
- package/dist/components/EzScheduler/tests/phase1_rendering.spec.d.ts +1 -0
- package/dist/components/EzScheduler/tests/phase2_events.spec.d.ts +1 -0
- package/dist/components/EzScheduler/tests/phase3_templates.spec.d.ts +1 -0
- package/dist/components/EzScheduler/tests/phase4_export.spec.d.ts +1 -0
- package/dist/components/EzScheduler/tests/phase5_advanced.spec.d.ts +1 -0
- package/dist/components/EzScheduler/tests/phase6_security.spec.d.ts +1 -0
- package/dist/components/EzScheduler/tests/phase7_regression.spec.d.ts +1 -0
- package/dist/components/EzScheduler/useEzScheduler.d.ts +152 -0
- package/dist/components/EzScheduler/utils/createDragConstraint.d.ts +7 -0
- package/dist/components/EzScheduler/utils/getWeekNumber.d.ts +8 -0
- package/dist/components/EzScheduler/utils/sanitizeHtml.d.ts +17 -0
- package/dist/components/EzScheduler/views/AgendaView.d.ts +33 -0
- package/dist/components/EzScheduler/views/DayWeekView.d.ts +182 -0
- package/dist/components/EzScheduler/views/MonthView.d.ts +65 -0
- package/dist/components/EzScheduler/views/TimelineView.d.ts +121 -0
- package/dist/components/EzSignature/EzSignature.d.ts +42 -0
- package/dist/components/EzSignature/EzSignature.test.d.ts +1 -0
- package/dist/components/EzSignature/EzSignature.types.d.ts +132 -0
- package/dist/components/EzSignature/index.d.ts +2 -0
- package/dist/components/EzTable/EzColumnMenu.d.ts +7 -0
- package/dist/components/EzTable/EzDateFilterTree.d.ts +7 -0
- package/dist/components/EzTable/EzExcelFilter.d.ts +6 -0
- package/dist/components/EzTable/EzFilterBuilder.d.ts +12 -0
- package/dist/components/EzTable/EzGroupingPanel.d.ts +9 -0
- package/dist/components/EzTable/EzHeaderContextMenu.d.ts +8 -0
- package/dist/components/EzTable/EzPagination.d.ts +19 -0
- package/dist/components/EzTable/EzTable.types.d.ts +1481 -0
- package/dist/components/EzTable/EzTableEditDialog.d.ts +15 -0
- package/dist/components/EzTable/EzTableFooter.d.ts +10 -0
- package/dist/components/EzTable/EzTableOverlays.d.ts +11 -0
- package/dist/components/EzTable/EzTableStatusBar.d.ts +6 -0
- package/dist/components/EzTable/EzTableToolbar.d.ts +58 -0
- package/dist/components/EzTable/SmartCell.d.ts +7 -0
- package/dist/components/EzTable/__tests__/EzTableDX.test.d.ts +0 -0
- package/dist/components/EzTable/__tests__/EzTableEnterprise.test.d.ts +1 -0
- package/dist/components/EzTable/__tests__/useEzTable.test.d.ts +1 -0
- package/dist/components/EzTable/components/AdvancedColumnFilter.d.ts +16 -0
- package/dist/components/EzTable/components/BooleanFilterSection.d.ts +7 -0
- package/dist/components/EzTable/components/DraggableHeader.d.ts +10 -0
- package/dist/components/EzTable/components/EzTableBodySection.d.ts +70 -0
- package/dist/components/EzTable/components/EzTableCell.d.ts +46 -0
- package/dist/components/EzTable/components/EzTableHeaderSection.d.ts +22 -0
- package/dist/components/EzTable/components/EzTablePaginationSection.d.ts +31 -0
- package/dist/components/EzTable/components/EzTableRow.d.ts +56 -0
- package/dist/components/EzTable/components/FilterActionButtons.d.ts +16 -0
- package/dist/components/EzTable/components/FilterRuleSelect.d.ts +26 -0
- package/dist/components/EzTable/components/SelectAllCheckbox.d.ts +21 -0
- package/dist/components/EzTable/components/SelectFilterSection.d.ts +18 -0
- package/dist/components/EzTable/components/VirtualizedFilterList.d.ts +21 -0
- package/dist/components/EzTable/constants/filterOptions.d.ts +47 -0
- package/dist/components/EzTable/context/EzTableContext.d.ts +10 -0
- package/dist/components/EzTable/context/TableConfigContext.d.ts +13 -0
- package/dist/components/EzTable/context/TableStore.d.ts +17 -0
- package/dist/components/EzTable/filterUtils.d.ts +5 -0
- package/dist/components/EzTable/hooks/useAutoFit.d.ts +4 -0
- package/dist/components/EzTable/hooks/useCellEventHandlers.d.ts +16 -0
- package/dist/components/EzTable/hooks/useColumnSizeVars.d.ts +6 -0
- package/dist/components/EzTable/hooks/useContainerResize.d.ts +11 -0
- package/dist/components/EzTable/hooks/useDialogStateInitialization.d.ts +8 -0
- package/dist/components/EzTable/hooks/useFilterSelection.d.ts +12 -0
- package/dist/components/EzTable/hooks/useTableFiltering.d.ts +23 -0
- package/dist/components/EzTable/hooks/useTableHistory.d.ts +87 -0
- package/dist/components/EzTable/hooks/useTableImperative.d.ts +42 -0
- package/dist/components/EzTable/hooks/useTableSelection.d.ts +32 -0
- package/dist/components/EzTable/hooks/useTableState.d.ts +31 -0
- package/dist/components/EzTable/hooks/useTableVirtualization.d.ts +33 -0
- package/dist/components/EzTable/index.d.ts +50 -0
- package/dist/components/EzTable/renderers/index.d.ts +6 -0
- package/dist/components/EzTable/services/TableService.d.ts +26 -0
- package/dist/components/EzTable/useEzTable.d.ts +17 -0
- package/dist/components/EzTable/utils/TextMeasurer.d.ts +1 -0
- package/dist/components/EzTable/utils/TruncatedTooltip.d.ts +7 -0
- package/dist/components/EzTable/utils/columnTypeDetector.d.ts +5 -0
- package/dist/components/EzTable/utils/filterTypeGuards.d.ts +3 -0
- package/dist/components/EzTable/utils/index.d.ts +1 -0
- package/dist/components/EzTreeView/EzTreeView.types.d.ts +395 -0
- package/dist/components/EzTreeView/EzTreeViewItem.d.ts +77 -0
- package/dist/components/EzTreeView/EzVirtualTree.d.ts +72 -0
- package/dist/components/EzTreeView/components/EzTreeViewLoadingSpinner.d.ts +2 -0
- package/dist/components/EzTreeView/hooks/useTreeDragDrop.d.ts +31 -0
- package/dist/components/EzTreeView/hooks/useTreeExpansion.d.ts +21 -0
- package/dist/components/EzTreeView/hooks/useTreeImperative.d.ts +28 -0
- package/dist/components/EzTreeView/hooks/useTreeSelection.d.ts +31 -0
- package/dist/components/EzTreeView/hooks/useTreeState.d.ts +21 -0
- package/dist/components/EzTreeView/hooks/useTreeVirtualization.d.ts +18 -0
- package/dist/components/EzTreeView/index.d.ts +40 -0
- package/dist/components/EzTreeView/services/TreeService.d.ts +11 -0
- package/dist/components/EzTreeView/useEzTreeView.d.ts +62 -0
- package/dist/components/EzTreeView/utils/treeUtils.d.ts +17 -0
- package/dist/components/shared/components/EzErrorBoundary.d.ts +18 -0
- package/dist/components/shared/components/EzLayoutErrorFallback.d.ts +2 -0
- package/dist/components/shared/components/EzLoadingSpinner.d.ts +8 -0
- package/dist/components/shared/components/EzSchedulerErrorFallback.d.ts +2 -0
- package/dist/components/shared/components/EzTableErrorFallback.d.ts +2 -0
- package/dist/components/shared/components/EzTreeViewErrorFallback.d.ts +2 -0
- package/dist/components/ui/avatar.d.ts +5 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/breadcrumb.d.ts +19 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/calendar.d.ts +15 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/checkbox.d.ts +7 -0
- package/dist/components/ui/command.d.ts +78 -0
- package/dist/components/ui/context-menu.d.ts +27 -0
- package/dist/components/ui/date-time-picker.d.ts +13 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/index.d.ts +26 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/modal.d.ts +9 -0
- package/dist/components/ui/password-input.d.ts +5 -0
- package/dist/components/ui/popover.d.ts +4 -0
- package/dist/components/ui/progress.d.ts +7 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +24 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +14 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/ezux.es.js +149 -0
- package/dist/ezux.umd.js +68 -0
- package/dist/index-DBwoXp4n.js +30656 -0
- package/dist/index.d.ts +70 -0
- package/dist/lib/perfect-freehand.d.ts +221 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/shared/components/AnimatedText.d.ts +44 -0
- package/dist/shared/components/BaseCell.d.ts +14 -0
- package/dist/shared/components/BooleanRenderer.d.ts +34 -0
- package/dist/shared/components/ChartRenderer.d.ts +19 -0
- package/dist/shared/components/DeleteConfirmationModal.d.ts +11 -0
- package/dist/shared/components/EzContextMenu.d.ts +12 -0
- package/dist/shared/components/EzNotificationDropdown.d.ts +1 -0
- package/dist/shared/components/HighlightText.d.ts +4 -0
- package/dist/shared/components/Modal.d.ts +13 -0
- package/dist/shared/components/NotificationPanel.d.ts +2 -0
- package/dist/shared/components/PrimitiveRenderer.d.ts +39 -0
- package/dist/shared/components/SearchableSelect.d.ts +13 -0
- package/dist/shared/components/SelectRenderer.d.ts +33 -0
- package/dist/shared/components/StatusBadge.d.ts +12 -0
- package/dist/shared/components/TooltipWrapper.d.ts +12 -0
- package/dist/shared/components/index.d.ts +9 -0
- package/dist/shared/hooks/index.d.ts +56 -0
- package/dist/shared/hooks/useBaseComponent.d.ts +60 -0
- package/dist/shared/hooks/useComponentImperativeAPI.d.ts +11 -0
- package/dist/shared/hooks/useComponentState.d.ts +39 -0
- package/dist/shared/hooks/useCurrentTime.d.ts +6 -0
- package/dist/shared/hooks/useDataChangeEvents.d.ts +53 -0
- package/dist/shared/hooks/useDebounce.d.ts +10 -0
- package/dist/shared/hooks/useDeleteConfirmation.d.ts +9 -0
- package/dist/shared/hooks/useDialogState.d.ts +21 -0
- package/dist/shared/hooks/useDndHandlers.d.ts +17 -0
- package/dist/shared/hooks/useEditing.d.ts +107 -0
- package/dist/shared/hooks/useEventHandlers.d.ts +61 -0
- package/dist/shared/hooks/useEzTheme.d.ts +22 -0
- package/dist/shared/hooks/useFieldValidation.d.ts +24 -0
- package/dist/shared/hooks/useHistory.d.ts +13 -0
- package/dist/shared/hooks/useI18n.d.ts +9 -0
- package/dist/shared/hooks/useImperativeAPI.d.ts +8 -0
- package/dist/shared/hooks/useInitCoreServices.d.ts +5 -0
- package/dist/shared/hooks/useKeyboardNavigation.d.ts +36 -0
- package/dist/shared/hooks/useKeyboardShortcuts.d.ts +14 -0
- package/dist/shared/hooks/useLifecycleEvents.d.ts +22 -0
- package/dist/shared/hooks/useLoadingState.d.ts +17 -0
- package/dist/shared/hooks/useMediaQuery.d.ts +6 -0
- package/dist/shared/hooks/useNotificationService.d.ts +8 -0
- package/dist/shared/hooks/usePerformanceMonitor.d.ts +15 -0
- package/dist/shared/hooks/useRowSelectionEvents.d.ts +44 -0
- package/dist/shared/hooks/useSelection.d.ts +73 -0
- package/dist/shared/hooks/useService.d.ts +12 -0
- package/dist/shared/hooks/useServiceState.d.ts +12 -0
- package/dist/shared/hooks/useStateChangeEvents.d.ts +61 -0
- package/dist/shared/hooks/useTheme.d.ts +13 -0
- package/dist/shared/hooks/useVirtualization.d.ts +85 -0
- package/dist/shared/services/BaseService.d.ts +56 -0
- package/dist/shared/services/ContextMenuService.d.ts +58 -0
- package/dist/shared/services/ExportService.d.ts +35 -0
- package/dist/shared/services/FocusManagerService.d.ts +33 -0
- package/dist/shared/services/HierarchyService.d.ts +43 -0
- package/dist/shared/services/I18nService.d.ts +65 -0
- package/dist/shared/services/LayoutService.d.ts +80 -0
- package/dist/shared/services/NotificationService.d.ts +44 -0
- package/dist/shared/services/PersistenceService.d.ts +69 -0
- package/dist/shared/services/ServiceRegistry.d.ts +51 -0
- package/dist/shared/services/ThemeService.d.ts +49 -0
- package/dist/shared/services/VirtualizationService.d.ts +51 -0
- package/dist/shared/state/store.d.ts +10 -0
- package/dist/shared/themes.d.ts +25 -0
- package/dist/shared/types/BaseProps.d.ts +18 -0
- package/dist/shared/types/common.d.ts +292 -0
- package/dist/shared/types/commonTypes.d.ts +101 -0
- package/dist/shared/types/index.d.ts +2 -0
- package/dist/shared/utils/canvasUtils.d.ts +16 -0
- package/dist/shared/utils/commonUtils.d.ts +28 -0
- package/dist/shared/utils/csvUtils.d.ts +7 -0
- package/dist/shared/utils/dateUtils.d.ts +5 -0
- package/dist/shared/utils/dndUtils.d.ts +16 -0
- package/dist/shared/utils/ezStyleUtils.d.ts +64 -0
- package/dist/shared/utils/formatUtils.d.ts +20 -0
- package/dist/shared/utils/imperativeApiUtils.d.ts +36 -0
- package/dist/shared/utils/index.d.ts +11 -0
- package/dist/shared/utils/renderUtils.d.ts +6 -0
- package/dist/shared/utils/serviceUtils.d.ts +10 -0
- package/dist/shared/utils/styleUtils.d.ts +66 -0
- package/dist/shared/utils/validationUtils.d.ts +16 -0
- package/package.json +101 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { SharedBaseProps } from '../../shared/types/BaseProps';
|
|
2
|
+
import { TreeNode as SharedTreeNode } from '../../shared/types/commonTypes';
|
|
3
|
+
import { IService } from '../../shared/services/ServiceRegistry';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a node in the tree structure.
|
|
6
|
+
* @group Models
|
|
7
|
+
*/
|
|
8
|
+
export interface TreeNode extends SharedTreeNode {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Component Injection (IoC) slots for customizing tree elements.
|
|
12
|
+
* @group Subcomponents
|
|
13
|
+
*/
|
|
14
|
+
export interface EzTreeViewComponents {
|
|
15
|
+
/**
|
|
16
|
+
* Custom renderer for the tree node.
|
|
17
|
+
* @param props.node The node data.
|
|
18
|
+
* @param props.level Current nesting level (0-based).
|
|
19
|
+
* @param props.isExpanded If the node is currently expanded.
|
|
20
|
+
* @param props.isSelected If the node is currently selected.
|
|
21
|
+
* @param props.isChecked If the node is checked (checkbox mode).
|
|
22
|
+
* @param props.isIndeterminate If the node is partially checked.
|
|
23
|
+
* @param props.onToggleExpand Callback to toggle expansion.
|
|
24
|
+
* @param props.onToggleSelect Callback to toggle selection.
|
|
25
|
+
* @param props.onToggleCheck Callback to toggle check state.
|
|
26
|
+
* @group Subcomponents
|
|
27
|
+
*/
|
|
28
|
+
node?: React.ComponentType<{
|
|
29
|
+
node: TreeNode;
|
|
30
|
+
level: number;
|
|
31
|
+
isExpanded: boolean;
|
|
32
|
+
isSelected: boolean;
|
|
33
|
+
isChecked?: boolean;
|
|
34
|
+
isIndeterminate?: boolean;
|
|
35
|
+
onToggleExpand: () => void;
|
|
36
|
+
onToggleSelect: () => void;
|
|
37
|
+
onToggleCheck?: () => void;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Custom expand/collapse icon.
|
|
41
|
+
* @group Subcomponents
|
|
42
|
+
*/
|
|
43
|
+
expandIcon?: React.ReactNode | React.ComponentType<{
|
|
44
|
+
isExpanded: boolean;
|
|
45
|
+
isLoading?: boolean;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Custom checkbox component.
|
|
49
|
+
* @group Subcomponents
|
|
50
|
+
*/
|
|
51
|
+
checkbox?: React.ComponentType<{
|
|
52
|
+
checked: boolean;
|
|
53
|
+
indeterminate: boolean;
|
|
54
|
+
onChange: () => void;
|
|
55
|
+
}>;
|
|
56
|
+
}
|
|
57
|
+
export type EzTreeViewRef = EzTreeViewApi;
|
|
58
|
+
/**
|
|
59
|
+
* Imperative API for EzTreeView.
|
|
60
|
+
* @group Methods
|
|
61
|
+
*/
|
|
62
|
+
export interface EzTreeViewApi {
|
|
63
|
+
/** Expand all nodes in the tree. @group Methods */
|
|
64
|
+
expandAll: () => void;
|
|
65
|
+
/** Collapse all nodes in the tree. @group Methods */
|
|
66
|
+
collapseAll: () => void;
|
|
67
|
+
/** Check all nodes (only in checkbox mode). @group Methods */
|
|
68
|
+
checkAll: () => void;
|
|
69
|
+
/** Uncheck all nodes. @group Methods */
|
|
70
|
+
uncheckAll: () => void;
|
|
71
|
+
/** Select a specific node by ID. @group Methods */
|
|
72
|
+
selectNode: (id: string) => void;
|
|
73
|
+
/** Expand or collapse a specific node. @group Methods */
|
|
74
|
+
expandNode: (id: string, expand?: boolean) => void;
|
|
75
|
+
/** Check or uncheck a specific node. @group Methods */
|
|
76
|
+
checkNode: (id: string, check?: boolean) => void;
|
|
77
|
+
/** Returns a flat list of visible nodes with their nesting level. @group Methods */
|
|
78
|
+
getFlattenedNodes: () => {
|
|
79
|
+
node: TreeNode;
|
|
80
|
+
level: number;
|
|
81
|
+
}[];
|
|
82
|
+
/** Adds new nodes to the tree at a specific target. @group Methods */
|
|
83
|
+
addNodes: (nodes: TreeNode[], target?: string, index?: number) => void;
|
|
84
|
+
/** Deletes nodes by their IDs. @group Methods */
|
|
85
|
+
removeNodes: (ids: string[]) => void;
|
|
86
|
+
/** Updates properties of an existing node. @group Methods */
|
|
87
|
+
updateNode: (id: string, updates: Partial<TreeNode>) => void;
|
|
88
|
+
/** Moves nodes to a new parent location. @group Methods */
|
|
89
|
+
moveNodes: (ids: string[], target: string, index?: number) => void;
|
|
90
|
+
/** Fetches a node object by ID. @group Methods */
|
|
91
|
+
getNode: (id: string) => TreeNode | undefined;
|
|
92
|
+
/** Returns the full tree data structure. @group Methods */
|
|
93
|
+
getTreeData: () => TreeNode[];
|
|
94
|
+
/** Scrolls and expands parents to make a node visible. @group Methods */
|
|
95
|
+
ensureVisible: (id: string) => void;
|
|
96
|
+
/** Switches a node into its editing state. @group Methods */
|
|
97
|
+
beginEdit: (id: string) => void;
|
|
98
|
+
/** Disables specified nodes. @group Methods */
|
|
99
|
+
disableNodes: (ids: string[], disable?: boolean) => void;
|
|
100
|
+
/** Enables specified nodes. @group Methods */
|
|
101
|
+
enableNodes: (ids: string[], enable?: boolean) => void;
|
|
102
|
+
/** Returns IDs of all checked nodes. @group Methods */
|
|
103
|
+
getAllCheckedNodes: () => string[];
|
|
104
|
+
/** Returns IDs of all disabled nodes. @group Methods */
|
|
105
|
+
getDisabledNodes: () => string[];
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Service interface for tree data operations.
|
|
109
|
+
* @group Services
|
|
110
|
+
*/
|
|
111
|
+
export interface ITreeService extends IService {
|
|
112
|
+
/** Loads child nodes for a given parent (or root). @group Methods */
|
|
113
|
+
loadNodes(parentId?: string): Promise<TreeNode[]>;
|
|
114
|
+
/** Backend call to move a node. @group Methods */
|
|
115
|
+
moveNode(id: string, targetParentId: string, index?: number): Promise<void>;
|
|
116
|
+
/** Backend call to rename a node. @group Methods */
|
|
117
|
+
renameNode(id: string, newName: string): Promise<void>;
|
|
118
|
+
/** Backend call to delete a node. @group Methods */
|
|
119
|
+
deleteNode(id: string): Promise<void>;
|
|
120
|
+
/** Backend call to add a new node. @group Methods */
|
|
121
|
+
addNode(parentId: string, node: Partial<TreeNode>): Promise<TreeNode>;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Props for the EzTreeView component, extending shared base props.
|
|
125
|
+
* @group Properties
|
|
126
|
+
*/
|
|
127
|
+
export interface EzTreeViewProps extends SharedBaseProps {
|
|
128
|
+
/** The hierarchical tree data. @group Data */
|
|
129
|
+
data: TreeNode[];
|
|
130
|
+
/**
|
|
131
|
+
* Custom subcomponents (Slots) to override default rendering.
|
|
132
|
+
* Allows fully custom rendering of nodes, icons, and checkboxes.
|
|
133
|
+
* @group Subcomponents
|
|
134
|
+
*/
|
|
135
|
+
components?: EzTreeViewComponents;
|
|
136
|
+
/**
|
|
137
|
+
* Selection mode for the tree.
|
|
138
|
+
* @group Properties
|
|
139
|
+
*/
|
|
140
|
+
selectionMode?: 'single' | 'multiple';
|
|
141
|
+
/**
|
|
142
|
+
* Whether to show checkboxes for tri-state selection.
|
|
143
|
+
* @group Properties
|
|
144
|
+
*/
|
|
145
|
+
showCheckboxes?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Whether to enable inline label editing.
|
|
148
|
+
* @group Properties
|
|
149
|
+
*/
|
|
150
|
+
allowEditing?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Search term for real-time filtering and highlighting.
|
|
153
|
+
* @group Properties
|
|
154
|
+
*/
|
|
155
|
+
searchTerm?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Whether to allow drag-and-drop node reordering.
|
|
158
|
+
* @group Properties
|
|
159
|
+
*/
|
|
160
|
+
allowDragAndDrop?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Whether to allow selecting multiple nodes (if selectionMode is multiple).
|
|
163
|
+
* @group Properties
|
|
164
|
+
*/
|
|
165
|
+
allowMultiSelection?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Whether to allow node labels to wrap to multiple lines.
|
|
168
|
+
* @group Properties
|
|
169
|
+
*/
|
|
170
|
+
allowTextWrap?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Animation configuration for expansion/collapse.
|
|
173
|
+
* @group Properties
|
|
174
|
+
*/
|
|
175
|
+
animation?: boolean | {
|
|
176
|
+
expand?: boolean;
|
|
177
|
+
collapse?: boolean;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Whether to automatically check child nodes when parent is checked.
|
|
181
|
+
* @group Properties
|
|
182
|
+
*/
|
|
183
|
+
autoCheck?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Whether to allow checking nodes that are disabled.
|
|
186
|
+
* @group Properties
|
|
187
|
+
*/
|
|
188
|
+
checkDisabledChildren?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Whether to toggle check state when a node is clicked.
|
|
191
|
+
* @group Properties
|
|
192
|
+
*/
|
|
193
|
+
checkOnClick?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* List of IDs for nodes that should be checked (controlled mode).
|
|
196
|
+
* @group Properties
|
|
197
|
+
*/
|
|
198
|
+
checkedNodes?: string[];
|
|
199
|
+
/**
|
|
200
|
+
* List of IDs for nodes that should be expanded (controlled mode).
|
|
201
|
+
* @group Properties
|
|
202
|
+
*/
|
|
203
|
+
expandedNodes?: string[];
|
|
204
|
+
/**
|
|
205
|
+
* List of IDs for nodes that should be selected (controlled mode).
|
|
206
|
+
* @group Properties
|
|
207
|
+
*/
|
|
208
|
+
selectedNodes?: string[];
|
|
209
|
+
/**
|
|
210
|
+
* Field mapping for custom data structures.
|
|
211
|
+
* @group Properties
|
|
212
|
+
*/
|
|
213
|
+
fields?: {
|
|
214
|
+
id?: string;
|
|
215
|
+
text?: string;
|
|
216
|
+
children?: string;
|
|
217
|
+
hasChildren?: string;
|
|
218
|
+
expanded?: string;
|
|
219
|
+
selected?: string;
|
|
220
|
+
isChecked?: string;
|
|
221
|
+
icon?: string;
|
|
222
|
+
tooltip?: string;
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* Whether the full row should be navigable via keyboard.
|
|
226
|
+
* @group Properties
|
|
227
|
+
*/
|
|
228
|
+
fullRowNavigable?: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Whether the full row should be triggers selection on click.
|
|
231
|
+
* @group Properties
|
|
232
|
+
*/
|
|
233
|
+
fullRowSelect?: boolean;
|
|
234
|
+
/**
|
|
235
|
+
* Sorting order for tree nodes.
|
|
236
|
+
* @group Properties
|
|
237
|
+
*/
|
|
238
|
+
sortOrder?: 'None' | 'Ascending' | 'Descending';
|
|
239
|
+
/**
|
|
240
|
+
* Callback triggered when selection changes.
|
|
241
|
+
* @group Events
|
|
242
|
+
*/
|
|
243
|
+
onSelectionChange?: (selectedIds: string[]) => void;
|
|
244
|
+
/**
|
|
245
|
+
* Callback triggered when check states change.
|
|
246
|
+
* @group Events
|
|
247
|
+
*/
|
|
248
|
+
onCheckedChange?: (checkedIds: string[]) => void;
|
|
249
|
+
/**
|
|
250
|
+
* Callback triggered when a node is expanded or collapsed.
|
|
251
|
+
* @group Events
|
|
252
|
+
*/
|
|
253
|
+
onNodeExpand?: (nodeId: string, isExpanded: boolean) => void;
|
|
254
|
+
/**
|
|
255
|
+
* Callback for lazy loading children.
|
|
256
|
+
* @group Events
|
|
257
|
+
*/
|
|
258
|
+
onLoadChildren?: (nodeId: string) => Promise<TreeNode[]>;
|
|
259
|
+
/**
|
|
260
|
+
* Callback triggered when a node is dropped during D&D.
|
|
261
|
+
* @group Events
|
|
262
|
+
*/
|
|
263
|
+
onNodeDrop?: (dragged: TreeNode, target: TreeNode, pos: 'inside' | 'before' | 'after') => void;
|
|
264
|
+
/**
|
|
265
|
+
* Callback triggered when a node is renamed via inline editing.
|
|
266
|
+
* @group Events
|
|
267
|
+
*/
|
|
268
|
+
onNodeRename?: (nodeId: string, newLabel: string) => void;
|
|
269
|
+
/**
|
|
270
|
+
* Callback triggered when an operation fails.
|
|
271
|
+
* @group Events
|
|
272
|
+
*/
|
|
273
|
+
onActionFailure?: (error: Error) => void;
|
|
274
|
+
/**
|
|
275
|
+
* Callback triggered when the component is created.
|
|
276
|
+
* @group Events
|
|
277
|
+
*/
|
|
278
|
+
onCreated?: () => void;
|
|
279
|
+
/**
|
|
280
|
+
* Callback triggered after data is bound to the tree.
|
|
281
|
+
* @group Events
|
|
282
|
+
*/
|
|
283
|
+
onDataBound?: () => void;
|
|
284
|
+
/**
|
|
285
|
+
* Callback triggered when the data source is changed.
|
|
286
|
+
* @group Events
|
|
287
|
+
*/
|
|
288
|
+
onDataSourceChanged?: () => void;
|
|
289
|
+
/**
|
|
290
|
+
* Callback triggered when the component is destroyed.
|
|
291
|
+
* @group Events
|
|
292
|
+
*/
|
|
293
|
+
onDestroyed?: () => void;
|
|
294
|
+
/**
|
|
295
|
+
* Callback before rendering each node, allowing for custom logic.
|
|
296
|
+
* @group Events
|
|
297
|
+
*/
|
|
298
|
+
onDrawNode?: (node: TreeNode) => void;
|
|
299
|
+
/**
|
|
300
|
+
* Callback on key press within the tree.
|
|
301
|
+
* @group Events
|
|
302
|
+
*/
|
|
303
|
+
onKeyPress?: (event: React.KeyboardEvent) => void;
|
|
304
|
+
/**
|
|
305
|
+
* Callback triggered when a node is checked.
|
|
306
|
+
* @group Events
|
|
307
|
+
*/
|
|
308
|
+
onNodeChecked?: (nodeId: string, isChecked: boolean) => void;
|
|
309
|
+
/**
|
|
310
|
+
* Callback triggered before checking a node (cancellable).
|
|
311
|
+
* @group Events
|
|
312
|
+
*/
|
|
313
|
+
onNodeChecking?: (nodeId: string, isChecked: boolean) => boolean | void;
|
|
314
|
+
/**
|
|
315
|
+
* Callback triggered when a node is clicked.
|
|
316
|
+
* @group Events
|
|
317
|
+
*/
|
|
318
|
+
onNodeClicked?: (nodeId: string) => void;
|
|
319
|
+
/**
|
|
320
|
+
* Callback triggered when a node is collapsed.
|
|
321
|
+
* @group Events
|
|
322
|
+
*/
|
|
323
|
+
onNodeCollapsed?: (nodeId: string) => void;
|
|
324
|
+
/**
|
|
325
|
+
* Callback triggered before collapsing a node (cancellable).
|
|
326
|
+
* @group Events
|
|
327
|
+
*/
|
|
328
|
+
onNodeCollapsing?: (nodeId: string) => boolean | void;
|
|
329
|
+
/**
|
|
330
|
+
* Callback triggered when node dragging starts (cancellable).
|
|
331
|
+
* @group Events
|
|
332
|
+
*/
|
|
333
|
+
onNodeDragStart?: (event: any) => boolean | void;
|
|
334
|
+
/**
|
|
335
|
+
* Callback triggered when node dragging stops.
|
|
336
|
+
* @group Events
|
|
337
|
+
*/
|
|
338
|
+
onNodeDragStop?: (event: any) => void;
|
|
339
|
+
/**
|
|
340
|
+
* Callback triggered during node dragging.
|
|
341
|
+
* @group Events
|
|
342
|
+
*/
|
|
343
|
+
onNodeDragging?: (event: any) => void;
|
|
344
|
+
/**
|
|
345
|
+
* Callback triggered when a node is selected.
|
|
346
|
+
* @group Events
|
|
347
|
+
*/
|
|
348
|
+
onNodeSelected?: (nodeId: string) => void;
|
|
349
|
+
/**
|
|
350
|
+
* Callback triggered before selecting a node (cancellable).
|
|
351
|
+
* @group Events
|
|
352
|
+
*/
|
|
353
|
+
onNodeSelecting?: (nodeId: string) => boolean | void;
|
|
354
|
+
/**
|
|
355
|
+
* Callback triggered when a node label has been expanded.
|
|
356
|
+
* @group Events
|
|
357
|
+
*/
|
|
358
|
+
onNodeExpanded?: (nodeId: string) => void;
|
|
359
|
+
/**
|
|
360
|
+
* Callback triggered before expanding a node (cancellable).
|
|
361
|
+
* @group Events
|
|
362
|
+
*/
|
|
363
|
+
onNodeExpanding?: (nodeId: string) => boolean | void;
|
|
364
|
+
/**
|
|
365
|
+
* Callback triggered before entering node editing mode (cancellable).
|
|
366
|
+
* @group Events
|
|
367
|
+
*/
|
|
368
|
+
onNodeEditing?: (nodeId: string) => boolean | void;
|
|
369
|
+
/**
|
|
370
|
+
* Reference to access the imperative API of the tree.
|
|
371
|
+
* @group Properties
|
|
372
|
+
*/
|
|
373
|
+
apiRef?: React.RefObject<EzTreeViewApi | null>;
|
|
374
|
+
/**
|
|
375
|
+
* Advanced internal configuration options.
|
|
376
|
+
* @group Properties
|
|
377
|
+
*/
|
|
378
|
+
config?: {
|
|
379
|
+
dragDropEnabled?: boolean;
|
|
380
|
+
multiSelectEnabled?: boolean;
|
|
381
|
+
virtualizationThreshold?: number;
|
|
382
|
+
collisionPolicy?: string;
|
|
383
|
+
rtl?: boolean;
|
|
384
|
+
};
|
|
385
|
+
/**
|
|
386
|
+
* Custom data service instance for the tree.
|
|
387
|
+
* @group Services
|
|
388
|
+
*/
|
|
389
|
+
service?: ITreeService;
|
|
390
|
+
/**
|
|
391
|
+
* Name of the global service to use for data operations.
|
|
392
|
+
* @group Services
|
|
393
|
+
*/
|
|
394
|
+
serviceName?: string;
|
|
395
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TreeNode, EzTreeViewComponents } from './EzTreeView.types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the EzTreeViewItem component.
|
|
5
|
+
* @group Properties
|
|
6
|
+
*/
|
|
7
|
+
interface EzTreeViewItemProps {
|
|
8
|
+
/** The node data to render. @group Data */
|
|
9
|
+
node: TreeNode;
|
|
10
|
+
/** The nesting level of the node (0-based). @group Data */
|
|
11
|
+
level: number;
|
|
12
|
+
/** Whether the node is currently expanded. @group State */
|
|
13
|
+
isExpanded: boolean;
|
|
14
|
+
/** Whether the node is currently selected. @group State */
|
|
15
|
+
isSelected: boolean;
|
|
16
|
+
/** Whether the node is checked. @group State */
|
|
17
|
+
isChecked: boolean;
|
|
18
|
+
/** Whether the node has an indeterminate check state. @group State */
|
|
19
|
+
isIndeterminate: boolean;
|
|
20
|
+
/** Whether the node is currently loading children. @group State */
|
|
21
|
+
isLoading: boolean;
|
|
22
|
+
/** Whether the node has children (visible or potentially lazy-loaded). @group Data */
|
|
23
|
+
hasChildren: boolean;
|
|
24
|
+
/** Callback to toggle expansion state. @group Events */
|
|
25
|
+
onToggleExpand: (id: string) => void;
|
|
26
|
+
/** Callback to toggle selection state. @group Events */
|
|
27
|
+
onToggleSelect: (id: string) => void;
|
|
28
|
+
/** Callback to toggle check state. @group Events */
|
|
29
|
+
onToggleCheck: (id: string) => void;
|
|
30
|
+
/** Callback triggered when the node is renamed. @group Events */
|
|
31
|
+
onRename: (id: string, newLabel: string) => void;
|
|
32
|
+
/** Whether to show checkboxes. @group Appearance */
|
|
33
|
+
showCheckboxes?: boolean;
|
|
34
|
+
/** Whether inline editing is allowed. @group Appearance */
|
|
35
|
+
allowEditing?: boolean;
|
|
36
|
+
/** Current search term for highlighting. @group Data */
|
|
37
|
+
searchTerm?: string;
|
|
38
|
+
/** Virtualized style object. @group Appearance */
|
|
39
|
+
style: React.CSSProperties;
|
|
40
|
+
/** Keyboard event handler. @group Events */
|
|
41
|
+
onKeyDown: (e: React.KeyboardEvent, id: string) => void;
|
|
42
|
+
/** Tab index for keyboard navigation. @group Properties */
|
|
43
|
+
tabIndex: number;
|
|
44
|
+
/** Whether to automatically focus this item when mounted. @group Properties */
|
|
45
|
+
autoFocus?: boolean;
|
|
46
|
+
/** Custom subcomponent slots. @group Subcomponents */
|
|
47
|
+
components?: EzTreeViewComponents;
|
|
48
|
+
/** Whether text wrapping is allowed. @group Appearance */
|
|
49
|
+
allowTextWrap?: boolean;
|
|
50
|
+
/** Animation configuration. @group Appearance */
|
|
51
|
+
animation?: boolean | {
|
|
52
|
+
expand?: boolean;
|
|
53
|
+
collapse?: boolean;
|
|
54
|
+
};
|
|
55
|
+
/** Whether to check on click. @group Properties */
|
|
56
|
+
checkOnClick?: boolean;
|
|
57
|
+
/** Whether full row selection is enabled. @group Appearance */
|
|
58
|
+
fullRowSelect?: boolean;
|
|
59
|
+
/** Whether full row navigation is enabled. @group Appearance */
|
|
60
|
+
fullRowNavigable?: boolean;
|
|
61
|
+
/** Callback triggered when the node is clicked. @group Events */
|
|
62
|
+
onNodeClicked?: (nodeId: string) => void;
|
|
63
|
+
/** Callback triggered before drawing the node. @group Events */
|
|
64
|
+
onDrawNode?: (node: TreeNode) => void;
|
|
65
|
+
/** Whether the node is currently in editing mode. @group State */
|
|
66
|
+
isEditing?: boolean;
|
|
67
|
+
/** Callback triggered when editing mode changes. @group Events */
|
|
68
|
+
onEditingChange?: (editing: boolean) => void;
|
|
69
|
+
/** Text direction. @group Appearance */
|
|
70
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Renders a single row in the tree with support for expansion, checkbox, icons, and inline editing.
|
|
74
|
+
* @group Components
|
|
75
|
+
*/
|
|
76
|
+
export declare const EzTreeViewItem: React.MemoExoticComponent<({ node, level, isExpanded, isSelected, isChecked, isIndeterminate, isLoading, hasChildren, onToggleExpand, onToggleSelect, onToggleCheck, onRename, showCheckboxes, allowEditing, searchTerm, style, onKeyDown, tabIndex, autoFocus, components, allowTextWrap, animation, checkOnClick, fullRowSelect: _fullRowSelect, fullRowNavigable: _fullRowNavigable, onNodeClicked, onDrawNode, isEditing: externalIsEditing, onEditingChange, dir }: EzTreeViewItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TreeNode, EzTreeViewComponents } from './EzTreeView.types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the EzVirtualTree component.
|
|
5
|
+
* @group Properties
|
|
6
|
+
*/
|
|
7
|
+
interface EzVirtualTreeProps {
|
|
8
|
+
/** Flattened list of visible nodes and their nesting levels. @group Data */
|
|
9
|
+
items: {
|
|
10
|
+
node: TreeNode;
|
|
11
|
+
level: number;
|
|
12
|
+
}[];
|
|
13
|
+
/** Set of IDs for currently expanded nodes. @group State */
|
|
14
|
+
expandedNodes: Set<string>;
|
|
15
|
+
/** Set of IDs for currently selected nodes. @group State */
|
|
16
|
+
selectedNodes: Set<string>;
|
|
17
|
+
/** Set of IDs for currently checked nodes. @group State */
|
|
18
|
+
checkedNodes: Set<string>;
|
|
19
|
+
/** Set of IDs for nodes in an indeterminate state. @group State */
|
|
20
|
+
indeterminateNodes: Set<string>;
|
|
21
|
+
/** Set of IDs for nodes currently loading data. @group State */
|
|
22
|
+
loadingNodes: Set<string>;
|
|
23
|
+
/** Callback to toggle expansion state of a node. @group Events */
|
|
24
|
+
onToggleExpand: (nodeId: string) => void;
|
|
25
|
+
/** Callback to toggle selection state of a node. @group Events */
|
|
26
|
+
onToggleSelect: (nodeId: string) => void;
|
|
27
|
+
/** Callback to toggle check state of a node. @group Events */
|
|
28
|
+
onToggleCheck: (nodeId: string) => void;
|
|
29
|
+
/** Callback triggered when a node label is renamed. @group Events */
|
|
30
|
+
onNodeRename: (nodeId: string, newLabel: string) => void;
|
|
31
|
+
/** Custom class name for the tree container. @group Appearance */
|
|
32
|
+
className?: string;
|
|
33
|
+
/** Text direction. @group Appearance */
|
|
34
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
35
|
+
/** Whether to show checkboxes. @group Appearance */
|
|
36
|
+
showCheckboxes?: boolean;
|
|
37
|
+
/** Whether inline editing is allowed. @group Appearance */
|
|
38
|
+
allowEditing?: boolean;
|
|
39
|
+
/** Current search query for highlighting. @group Data */
|
|
40
|
+
searchTerm?: string;
|
|
41
|
+
/** Custom subcomponent slots. @group Subcomponents */
|
|
42
|
+
components?: EzTreeViewComponents;
|
|
43
|
+
/** Whether text wrapping is allowed. @group Appearance */
|
|
44
|
+
allowTextWrap?: boolean;
|
|
45
|
+
/** Animation configuration. @group Appearance */
|
|
46
|
+
animation?: boolean | {
|
|
47
|
+
expand?: boolean;
|
|
48
|
+
collapse?: boolean;
|
|
49
|
+
};
|
|
50
|
+
/** Whether to check on click. @group Properties */
|
|
51
|
+
checkOnClick?: boolean;
|
|
52
|
+
/** Whether full row selection is enabled. @group Appearance */
|
|
53
|
+
fullRowSelect?: boolean;
|
|
54
|
+
/** Whether full row navigation is enabled. @group Appearance */
|
|
55
|
+
fullRowNavigable?: boolean;
|
|
56
|
+
/** Keyboard event handler for the tree. @group Events */
|
|
57
|
+
onKeyPress?: (event: React.KeyboardEvent) => void;
|
|
58
|
+
/** Callback triggered when a node is clicked. @group Events */
|
|
59
|
+
onNodeClicked?: (nodeId: string) => void;
|
|
60
|
+
/** Callback triggered before drawing a node. @group Events */
|
|
61
|
+
onDrawNode?: (node: TreeNode) => void;
|
|
62
|
+
/** ID of the node currently being edited. @group State */
|
|
63
|
+
editingNodeId: string | null;
|
|
64
|
+
/** Handler to set the editing node. @group Methods */
|
|
65
|
+
setEditingNodeId: (id: string | null) => void;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Internal virtualized tree renderer that handles keyboard navigation and efficient row rendering.
|
|
69
|
+
* @group Components
|
|
70
|
+
*/
|
|
71
|
+
export declare const EzVirtualTree: React.MemoExoticComponent<({ items, expandedNodes, selectedNodes, checkedNodes, indeterminateNodes, loadingNodes, onToggleExpand, onToggleSelect, onToggleCheck, onNodeRename, className, dir, showCheckboxes, allowEditing, searchTerm, components, allowTextWrap, animation, checkOnClick, fullRowSelect, fullRowNavigable, onKeyPress, onNodeClicked, onDrawNode, editingNodeId, setEditingNodeId, }: EzVirtualTreeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DragEndEvent, DragStartEvent } from '@dnd-kit/core';
|
|
2
|
+
import { TreeNode } from '../EzTreeView.types';
|
|
3
|
+
interface UseTreeDragDropProps {
|
|
4
|
+
onDragEnd: (node: TreeNode, targetNode: TreeNode, position: 'before' | 'after' | 'inside') => void;
|
|
5
|
+
onDragStart?: (node: TreeNode) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Hook for managing tree-specific drag-and-drop logic using @dnd-kit.
|
|
9
|
+
*
|
|
10
|
+
* Handles drag start, over (calculating drop position), and end events.
|
|
11
|
+
*
|
|
12
|
+
* @param props Configuration and callbacks for drag-and-drop operations.
|
|
13
|
+
* @group Hooks
|
|
14
|
+
*/
|
|
15
|
+
export declare const useTreeDragDrop: ({ onDragEnd, onDragStart }: UseTreeDragDropProps) => {
|
|
16
|
+
/** Sensors for dnd-kit interaction. @group Properties */
|
|
17
|
+
sensors: import('@dnd-kit/core').SensorDescriptor<import('@dnd-kit/core').SensorOptions>[];
|
|
18
|
+
/** The node currently being dragged. @group State */
|
|
19
|
+
activeNode: TreeNode | null;
|
|
20
|
+
/** The node currently being dragged over. @group State */
|
|
21
|
+
dragOverNode: TreeNode | null;
|
|
22
|
+
/** The relative drop position (before/after/inside). @group State */
|
|
23
|
+
dragPosition: "before" | "after" | "inside";
|
|
24
|
+
/** Internal handler for drag start. @group Events */
|
|
25
|
+
handleDragStart: (event: DragStartEvent) => void;
|
|
26
|
+
/** Internal handler for drag over. @group Events */
|
|
27
|
+
handleDragOver: (event: any) => void;
|
|
28
|
+
/** Internal handler for drag end. @group Events */
|
|
29
|
+
handleDragEnd: (event: DragEndEvent) => void;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EzTreeViewProps, TreeNode, ITreeService } from '../EzTreeView.types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for managing tree expansion state and lazy loading of child nodes.
|
|
4
|
+
*
|
|
5
|
+
* Handles optimistic updates and triggers "expanding/expanded" events.
|
|
6
|
+
*
|
|
7
|
+
* @param props Props for the EzTreeView component.
|
|
8
|
+
* @param treeData The current tree data.
|
|
9
|
+
* @param updateNode Callback to update a node's data.
|
|
10
|
+
* @param setLoadingNodes Callback to manage loading state.
|
|
11
|
+
* @param service Optional data service for lazy loading.
|
|
12
|
+
* @group Hooks
|
|
13
|
+
*/
|
|
14
|
+
export declare const useTreeExpansion: (props: EzTreeViewProps, treeData: TreeNode[], updateNode: (id: string, updates: Partial<TreeNode>) => void, setLoadingNodes: React.Dispatch<React.SetStateAction<Set<string>>>, service?: ITreeService | null) => {
|
|
15
|
+
/** Set of IDs for currently expanded nodes. @group State */
|
|
16
|
+
expandedNodes: Set<string>;
|
|
17
|
+
/** Manually set the set of expanded node IDs. @group Methods */
|
|
18
|
+
setInternalExpandedNodes: import('react').Dispatch<import('react').SetStateAction<Set<string>>>;
|
|
19
|
+
/** Toggle the expansion state of a specific node. @group Methods */
|
|
20
|
+
toggleExpand: (nodeId: string) => Promise<void>;
|
|
21
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EzTreeViewProps, TreeNode, EzTreeViewApi } from '../EzTreeView.types';
|
|
2
|
+
import { HierarchyService } from '../../../shared/services/HierarchyService';
|
|
3
|
+
/**
|
|
4
|
+
* Hook for building and exposing the imperative API for EzTreeView.
|
|
5
|
+
*
|
|
6
|
+
* Agregates all tree operations into a single API object and registers it with the component's ref.
|
|
7
|
+
*
|
|
8
|
+
* @param props Props for the EzTreeView component.
|
|
9
|
+
* @param treeData The current tree data.
|
|
10
|
+
* @param setTreeData Callback to update the tree data.
|
|
11
|
+
* @param expandedNodes The current expansion state.
|
|
12
|
+
* @param setExpandedNodes Callback to update expansion state.
|
|
13
|
+
* @param checkedNodes The current checked state.
|
|
14
|
+
* @param setCheckedNodes Callback to update checked state.
|
|
15
|
+
* @param setSelectedNodes Callback to update selection state.
|
|
16
|
+
* @param setIndeterminateNodes Callback to update indeterminate state.
|
|
17
|
+
* @param updateCheckState Core check state logic.
|
|
18
|
+
* @param flattenedNodes The current visible list of nodes.
|
|
19
|
+
* @param hierarchyService Service for tree structure operations.
|
|
20
|
+
* @param setEditingNodeId Callback to enter node editing mode.
|
|
21
|
+
* @param ref The ref to attach the API to.
|
|
22
|
+
* @param baseApi Optional base API methods.
|
|
23
|
+
* @group Hooks
|
|
24
|
+
*/
|
|
25
|
+
export declare const useTreeImperative: (props: EzTreeViewProps, treeData: TreeNode[], setTreeData: React.Dispatch<React.SetStateAction<TreeNode[]>>, expandedNodes: Set<string>, setExpandedNodes: React.Dispatch<React.SetStateAction<Set<string>>>, checkedNodes: Set<string>, setCheckedNodes: React.Dispatch<React.SetStateAction<Set<string>>>, setSelectedNodes: React.Dispatch<React.SetStateAction<Set<string>>>, setIndeterminateNodes: React.Dispatch<React.SetStateAction<Set<string>>>, updateCheckState: (id: string, check: boolean) => void, flattenedNodes: {
|
|
26
|
+
node: TreeNode;
|
|
27
|
+
level: number;
|
|
28
|
+
}[], hierarchyService: HierarchyService, setEditingNodeId: (id: string | null) => void, ref: React.Ref<EzTreeViewApi>, baseApi?: any) => void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EzTreeViewProps } from '../EzTreeView.types';
|
|
2
|
+
import { HierarchyService } from '../../../shared/services/HierarchyService';
|
|
3
|
+
/**
|
|
4
|
+
* Hook for managing tree selection (single/multiple) and tri-state check states.
|
|
5
|
+
*
|
|
6
|
+
* Handles propagation of check states to ancestors and descendants when autoCheck is enabled.
|
|
7
|
+
*
|
|
8
|
+
* @param props Props for the EzTreeView component.
|
|
9
|
+
* @param hierarchyService Service providing structural information about the tree.
|
|
10
|
+
* @group Hooks
|
|
11
|
+
*/
|
|
12
|
+
export declare const useTreeSelection: (props: EzTreeViewProps, hierarchyService: HierarchyService) => {
|
|
13
|
+
/** Set of IDs for currently selected nodes. @group State */
|
|
14
|
+
selectedNodes: Set<string>;
|
|
15
|
+
/** Manually set the set of selected node IDs. @group Methods */
|
|
16
|
+
setInternalSelectedNodes: import('react').Dispatch<import('react').SetStateAction<Set<string>>>;
|
|
17
|
+
/** Toggle selection state of a node. @group Methods */
|
|
18
|
+
toggleSelect: (nodeId: string) => void;
|
|
19
|
+
/** Set of IDs for currently checked nodes. @group State */
|
|
20
|
+
checkedNodes: Set<string>;
|
|
21
|
+
/** Manually set the set of checked node IDs. @group Methods */
|
|
22
|
+
setInternalCheckedNodes: import('react').Dispatch<import('react').SetStateAction<Set<string>>>;
|
|
23
|
+
/** Set of IDs for nodes with indeterminate check state. @group State */
|
|
24
|
+
indeterminateNodes: Set<string>;
|
|
25
|
+
/** Manually set the set of indeterminate node IDs. @group Methods */
|
|
26
|
+
setIndeterminateNodes: import('react').Dispatch<import('react').SetStateAction<Set<string>>>;
|
|
27
|
+
/** Toggle check state of a node. @group Methods */
|
|
28
|
+
toggleCheck: (nodeId: string) => void;
|
|
29
|
+
/** Core logic to update check state and propagate changes. @group Methods */
|
|
30
|
+
updateCheckState: (nodeId: string, isChecked: boolean) => void;
|
|
31
|
+
};
|