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,1481 @@
|
|
|
1
|
+
import { SharedBaseProps } from '../../shared/types/BaseProps';
|
|
2
|
+
import { FilterOperator as SharedFilterOperator, FilterRule as SharedFilterRule, FilterGroup as SharedFilterGroup } from '../../shared/types/commonTypes';
|
|
3
|
+
import { IService } from '../../shared/services/ServiceRegistry';
|
|
4
|
+
import { RowData, ColumnDef as TanStackColumnDef, RowSelectionState, GroupingState, Row, SortingState, ColumnFiltersState, PaginationState, TableState, Table, Column, Updater } from '@tanstack/react-table';
|
|
5
|
+
export type FilterOperator = SharedFilterOperator;
|
|
6
|
+
export type FilterRule = SharedFilterRule;
|
|
7
|
+
export type FilterGroup = SharedFilterGroup;
|
|
8
|
+
/**
|
|
9
|
+
* Configuration for row/cell selection behavior.
|
|
10
|
+
* @group Models
|
|
11
|
+
*/
|
|
12
|
+
export interface SelectionSettings {
|
|
13
|
+
/** Selection mode. @group Properties */
|
|
14
|
+
mode?: 'Row' | 'Cell' | 'Both';
|
|
15
|
+
/** Selection type. @group Properties */
|
|
16
|
+
type?: 'Single' | 'Multiple';
|
|
17
|
+
/** Whether to allow selection only via checkbox. @group Properties */
|
|
18
|
+
checkboxOnly?: boolean;
|
|
19
|
+
/** Whether to persist selection across data updates. @group Properties */
|
|
20
|
+
persistSelection?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for filtering behavior.
|
|
24
|
+
* @group Models
|
|
25
|
+
*/
|
|
26
|
+
export interface FilterSettings {
|
|
27
|
+
/** Filter UI type. @group Properties */
|
|
28
|
+
type?: 'Menu' | 'CheckBox' | 'Excel';
|
|
29
|
+
/** Whether to ignore accents during filtering. @group Properties */
|
|
30
|
+
ignoreAccent?: boolean;
|
|
31
|
+
/** Filter application mode. @group Properties */
|
|
32
|
+
mode?: 'Immediate' | 'OnEnter';
|
|
33
|
+
/** Whether to show the filter bar status. @group Properties */
|
|
34
|
+
showFilterBarStatus?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Configuration for global search behavior.
|
|
38
|
+
* @group Models
|
|
39
|
+
*/
|
|
40
|
+
export interface SearchSettings {
|
|
41
|
+
/** Specific fields to search in. @group Properties */
|
|
42
|
+
fields?: string[];
|
|
43
|
+
/** Search operator. @group Properties */
|
|
44
|
+
operator?: 'contains' | 'startsWith' | 'endsWith' | 'equal';
|
|
45
|
+
/** Search key/term. @group Properties */
|
|
46
|
+
key?: string;
|
|
47
|
+
/** Whether to ignore case during search. @group Properties */
|
|
48
|
+
ignoreCase?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Configuration for sorting behavior.
|
|
52
|
+
* @group Models
|
|
53
|
+
*/
|
|
54
|
+
export interface SortSettings {
|
|
55
|
+
/** Sort mode (single or multiple columns). @group Properties */
|
|
56
|
+
mode?: 'Single' | 'Multiple';
|
|
57
|
+
/** Whether to allow unsorting columns. @group Properties */
|
|
58
|
+
allowUnsort?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Configuration for editing behavior.
|
|
62
|
+
* @group Models
|
|
63
|
+
*/
|
|
64
|
+
export interface EditSettings {
|
|
65
|
+
/** Whether to allow adding new rows. @group Properties */
|
|
66
|
+
allowAdding?: boolean;
|
|
67
|
+
/** Whether to allow editing existing rows. @group Properties */
|
|
68
|
+
allowEditing?: boolean;
|
|
69
|
+
/** Whether to allow deleting rows. @group Properties */
|
|
70
|
+
allowDeleting?: boolean;
|
|
71
|
+
/** Edit mode. @group Properties */
|
|
72
|
+
mode?: 'Normal' | 'Dialog' | 'Batch';
|
|
73
|
+
/** Position for newly added rows. @group Properties */
|
|
74
|
+
newRowPosition?: 'Top' | 'Bottom';
|
|
75
|
+
/** Whether to allow editing on double-click. @group Properties */
|
|
76
|
+
allowEditOnDblClick?: boolean;
|
|
77
|
+
/** Primary key field(s) for identification. @group Properties */
|
|
78
|
+
primaryKey?: string | string[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Configuration for text wrapping.
|
|
82
|
+
* @group Models
|
|
83
|
+
*/
|
|
84
|
+
export interface TextWrapSettings {
|
|
85
|
+
/** Wrap mode for header, content or both. @group Properties */
|
|
86
|
+
wrapMode?: 'Both' | 'Header' | 'Content';
|
|
87
|
+
}
|
|
88
|
+
export type ToolbarItemType = 'Search' | 'Print' | 'Export' | 'Add' | 'Edit' | 'Delete' | 'Update' | 'Cancel' | 'ColumnChooser' | string;
|
|
89
|
+
/**
|
|
90
|
+
* Represents an item in the table toolbar.
|
|
91
|
+
* @group Models
|
|
92
|
+
*/
|
|
93
|
+
export interface ToolbarItem {
|
|
94
|
+
/** Display text for the item. @group Properties */
|
|
95
|
+
text?: string;
|
|
96
|
+
/** Tooltip text for the item. @group Properties */
|
|
97
|
+
tooltipText?: string;
|
|
98
|
+
/** Prefix icon for the item. @group Properties */
|
|
99
|
+
prefixIcon?: string | React.ReactNode;
|
|
100
|
+
/** Unique identifier for the item. @group Properties */
|
|
101
|
+
id?: string;
|
|
102
|
+
/** Alignment in the toolbar. @group Properties */
|
|
103
|
+
align?: 'Left' | 'Right' | 'Center';
|
|
104
|
+
/** Predefined or custom type. @group Properties */
|
|
105
|
+
type?: ToolbarItemType;
|
|
106
|
+
/** Custom template for rendering the item. @group Properties */
|
|
107
|
+
template?: React.ReactNode;
|
|
108
|
+
/** Callback when the item is clicked. @group Events */
|
|
109
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Custom CSS class names for internal table elements.
|
|
113
|
+
* @group Models
|
|
114
|
+
*/
|
|
115
|
+
export interface EzTableClassNames {
|
|
116
|
+
/** Root container class. @group Properties */
|
|
117
|
+
root?: string;
|
|
118
|
+
/** Header class. @group Properties */
|
|
119
|
+
header?: string;
|
|
120
|
+
/** Body class. @group Properties */
|
|
121
|
+
body?: string;
|
|
122
|
+
/** Row class or function. @group Properties */
|
|
123
|
+
row?: string | ((row: Row<any>) => string);
|
|
124
|
+
/** Cell class or function. @group Properties */
|
|
125
|
+
cell?: string | ((cell: any) => string);
|
|
126
|
+
/** Footer class. @group Properties */
|
|
127
|
+
footer?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Custom icons for table elements.
|
|
131
|
+
* @group Models
|
|
132
|
+
*/
|
|
133
|
+
export interface EzTableIcons {
|
|
134
|
+
/** Sorting ascending icon. @group Properties */
|
|
135
|
+
sortAsc?: React.ReactNode;
|
|
136
|
+
/** Sorting descending icon. @group Properties */
|
|
137
|
+
sortDesc?: React.ReactNode;
|
|
138
|
+
/** Filter icon. @group Properties */
|
|
139
|
+
filter?: React.ReactNode;
|
|
140
|
+
/** Context menu trigger icon. @group Properties */
|
|
141
|
+
contextMenu?: React.ReactNode;
|
|
142
|
+
/** Expanded row/group icon. @group Properties */
|
|
143
|
+
expanded?: React.ReactNode;
|
|
144
|
+
/** Collapsed row/group icon. @group Properties */
|
|
145
|
+
collapsed?: React.ReactNode;
|
|
146
|
+
/** First page icon. @group Properties */
|
|
147
|
+
firstPage?: React.ReactNode;
|
|
148
|
+
/** Last page icon. @group Properties */
|
|
149
|
+
lastPage?: React.ReactNode;
|
|
150
|
+
/** Next page icon. @group Properties */
|
|
151
|
+
nextPage?: React.ReactNode;
|
|
152
|
+
/** Previous page icon. @group Properties */
|
|
153
|
+
previousPage?: React.ReactNode;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Localization strings for the table component.
|
|
157
|
+
* @group Models
|
|
158
|
+
*/
|
|
159
|
+
export interface EzTableLocalization {
|
|
160
|
+
/** "No records to display" label. @group Properties */
|
|
161
|
+
noRowsLabel?: string;
|
|
162
|
+
/** "Loading..." label. @group Properties */
|
|
163
|
+
loadingLabel?: string;
|
|
164
|
+
/** Column menu label. @group Properties */
|
|
165
|
+
columnMenuLabel?: string;
|
|
166
|
+
/** "Contains" filter operator label. @group Properties */
|
|
167
|
+
filterOperatorContains?: string;
|
|
168
|
+
/** Next page label. @group Properties */
|
|
169
|
+
nextPage?: string;
|
|
170
|
+
/** Previous page label. @group Properties */
|
|
171
|
+
previousPage?: string;
|
|
172
|
+
/** First page label. @group Properties */
|
|
173
|
+
firstPage?: string;
|
|
174
|
+
/** Last page label. @group Properties */
|
|
175
|
+
lastPage?: string;
|
|
176
|
+
/** Search input placeholder. @group Properties */
|
|
177
|
+
searchPlaceholder?: string;
|
|
178
|
+
/** Rows per page label. @group Properties */
|
|
179
|
+
rowsPerPageLabel?: string;
|
|
180
|
+
/** Rows label. @group Properties */
|
|
181
|
+
rowsLabel?: string;
|
|
182
|
+
/** Total label. @group Properties */
|
|
183
|
+
totalLabel?: string;
|
|
184
|
+
/** Records label. @group Properties */
|
|
185
|
+
recordsLabel?: string;
|
|
186
|
+
/** Page label. @group Properties */
|
|
187
|
+
pageLabel?: string;
|
|
188
|
+
/** "of" label. @group Properties */
|
|
189
|
+
ofLabel?: string;
|
|
190
|
+
/** "Go to" label. @group Properties */
|
|
191
|
+
goToLabel?: string;
|
|
192
|
+
/** Pager status message. @group Properties */
|
|
193
|
+
pagerMessage?: string;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Custom component slots for override.
|
|
197
|
+
* @group Models
|
|
198
|
+
*/
|
|
199
|
+
export interface EzTableSlots {
|
|
200
|
+
/** Custom toolbar component. @group Properties */
|
|
201
|
+
toolbar?: React.ComponentType<any>;
|
|
202
|
+
/** Custom footer component. @group Properties */
|
|
203
|
+
footer?: React.ComponentType<any>;
|
|
204
|
+
/** Custom overlay for empty state. @group Properties */
|
|
205
|
+
noRowsOverlay?: React.ComponentType<any>;
|
|
206
|
+
/** Custom loading overlay. @group Properties */
|
|
207
|
+
loadingOverlay?: React.ComponentType<any>;
|
|
208
|
+
/** Custom header component. @group Properties */
|
|
209
|
+
header?: React.ComponentType<any>;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Parameters for data request operations.
|
|
213
|
+
* @group Models
|
|
214
|
+
*/
|
|
215
|
+
export interface TableParams {
|
|
216
|
+
/** Page number (0-indexed). @group Properties */
|
|
217
|
+
page?: number;
|
|
218
|
+
/** Number of rows per page. @group Properties */
|
|
219
|
+
pageSize?: number;
|
|
220
|
+
/** Current sorting state. @group Properties */
|
|
221
|
+
sorting?: SortingState;
|
|
222
|
+
/** Current column filters. @group Properties */
|
|
223
|
+
filters?: ColumnFiltersState;
|
|
224
|
+
/** Search term. @group Properties */
|
|
225
|
+
globalFilter?: string;
|
|
226
|
+
[key: string]: any;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Service interface for table data management.
|
|
230
|
+
* @group Services
|
|
231
|
+
*/
|
|
232
|
+
export interface ITableService<T extends RowData = any> extends IService {
|
|
233
|
+
/** Retrieves a page of data. @group Services */
|
|
234
|
+
getData(params: TableParams): Promise<{
|
|
235
|
+
data: T[];
|
|
236
|
+
totalCount: number;
|
|
237
|
+
}>;
|
|
238
|
+
/** Adds a new row. @group Services */
|
|
239
|
+
createRow(row: Partial<T>): Promise<T>;
|
|
240
|
+
/** Updates an existing row. @group Services */
|
|
241
|
+
updateRow(id: string | number, updates: Partial<T>): Promise<T>;
|
|
242
|
+
/** Deletes a row. @group Services */
|
|
243
|
+
deleteRow(id: string | number): Promise<void>;
|
|
244
|
+
/** Initializes the service with local data. @group Services */
|
|
245
|
+
initializeWithData?(data: T[]): void;
|
|
246
|
+
}
|
|
247
|
+
export type EzGlobalFilterState = string | {
|
|
248
|
+
quickSearch?: string;
|
|
249
|
+
advanced?: FilterGroup;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Props passed to custom cell renderers.
|
|
253
|
+
* @group Models
|
|
254
|
+
*/
|
|
255
|
+
export interface EzTableCellProps<TData = any, TValue = any> {
|
|
256
|
+
/** Returns the current cell value. @group Properties */
|
|
257
|
+
getValue: () => TValue;
|
|
258
|
+
/** The TanStack Row instance. @group Properties */
|
|
259
|
+
row: Row<TData>;
|
|
260
|
+
/** The TanStack Column instance. @group Properties */
|
|
261
|
+
column: Column<TData, TValue>;
|
|
262
|
+
/** The TanStack Table instance. @group Properties */
|
|
263
|
+
table: Table<TData>;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Props passed to custom editor components.
|
|
267
|
+
* @group Models
|
|
268
|
+
*/
|
|
269
|
+
export interface EzTableEditorProps<TData = any, TValue = any> extends EzTableCellProps<TData, TValue> {
|
|
270
|
+
/** Current value in the editor. @group Properties */
|
|
271
|
+
value: TValue;
|
|
272
|
+
/** Callback to update the value. @group Events */
|
|
273
|
+
onChange: (value: TValue) => void;
|
|
274
|
+
/** Callback when the editor loses focus. @group Events */
|
|
275
|
+
onBlur: () => void;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Extended metadata for EzTable columns, supporting rich features
|
|
279
|
+
* like editor types, chart options, and formatting.
|
|
280
|
+
* @group Models
|
|
281
|
+
*/
|
|
282
|
+
export type EzColumnMeta = {
|
|
283
|
+
/** Custom cell component. @group Components */
|
|
284
|
+
Cell?: React.ComponentType<EzTableCellProps<any, any>>;
|
|
285
|
+
/** Custom editor component. @group Components */
|
|
286
|
+
Editor?: React.ComponentType<EzTableEditorProps<any, any>>;
|
|
287
|
+
/** Custom filter component. @group Components */
|
|
288
|
+
Filter?: React.ComponentType<any>;
|
|
289
|
+
/** Filter UI variant. @group Properties */
|
|
290
|
+
filterVariant?: 'text' | 'range' | 'select';
|
|
291
|
+
/** Column content alignment. @group Properties */
|
|
292
|
+
align?: 'left' | 'center' | 'right';
|
|
293
|
+
/** Column header icon. @group Properties */
|
|
294
|
+
icon?: React.ReactNode;
|
|
295
|
+
/** Whether to wrap text in cells. @group Properties */
|
|
296
|
+
wrapText?: boolean;
|
|
297
|
+
/** Text clipping mode. @group Properties */
|
|
298
|
+
clipMode?: 'clip' | 'ellipsis' | 'ellipsis-tooltip';
|
|
299
|
+
/** Whether to automatically fit column width to content. @group Properties */
|
|
300
|
+
autoFit?: boolean;
|
|
301
|
+
/** Predefined column type for automatic formatting/editing. @group Properties */
|
|
302
|
+
columnType?: 'text' | 'longtext' | 'number' | 'boolean' | 'date' | 'datetime' | 'select' | 'multiselect' | 'chart' | 'sparkline' | 'progress';
|
|
303
|
+
/** Options for boolean columns. @group Properties */
|
|
304
|
+
booleanOptions?: {
|
|
305
|
+
trueLabel?: string;
|
|
306
|
+
falseLabel?: string;
|
|
307
|
+
nullLabel?: string;
|
|
308
|
+
showIcon?: boolean;
|
|
309
|
+
showLabel?: boolean;
|
|
310
|
+
variant?: 'checkbox' | 'switch';
|
|
311
|
+
};
|
|
312
|
+
/** Options for chart/progress columns. @group Properties */
|
|
313
|
+
chartOptions?: {
|
|
314
|
+
color?: 'default' | 'success' | 'warning' | 'danger' | 'info';
|
|
315
|
+
size?: 'sm' | 'md' | 'lg';
|
|
316
|
+
showLabel?: boolean;
|
|
317
|
+
height?: number;
|
|
318
|
+
width?: number;
|
|
319
|
+
showDots?: boolean;
|
|
320
|
+
};
|
|
321
|
+
/** Options for long text columns. @group Properties */
|
|
322
|
+
longTextOptions?: {
|
|
323
|
+
previewLength?: number;
|
|
324
|
+
};
|
|
325
|
+
/** Options for numeric columns. @group Properties */
|
|
326
|
+
numberOptions?: {
|
|
327
|
+
format?: 'integer' | 'float' | 'currency' | 'percentage';
|
|
328
|
+
decimals?: number;
|
|
329
|
+
currency?: string;
|
|
330
|
+
locale?: string;
|
|
331
|
+
};
|
|
332
|
+
/** Options for date columns. @group Properties */
|
|
333
|
+
dateOptions?: {
|
|
334
|
+
format?: 'short' | 'medium' | 'long' | 'full';
|
|
335
|
+
locale?: string;
|
|
336
|
+
};
|
|
337
|
+
/** Options for date-time columns. @group Properties */
|
|
338
|
+
dateTimeOptions?: {
|
|
339
|
+
format?: 'short' | 'medium' | 'long' | 'full' | 'relative';
|
|
340
|
+
showIcon?: boolean;
|
|
341
|
+
locale?: string;
|
|
342
|
+
};
|
|
343
|
+
/** Options for select/dropdown columns. @group Properties */
|
|
344
|
+
selectOptions?: {
|
|
345
|
+
options?: {
|
|
346
|
+
value: any;
|
|
347
|
+
label: string;
|
|
348
|
+
color?: string;
|
|
349
|
+
icon?: React.ReactNode;
|
|
350
|
+
}[];
|
|
351
|
+
multiSelect?: boolean;
|
|
352
|
+
variant?: 'dropdown' | 'radio' | 'combobox';
|
|
353
|
+
};
|
|
354
|
+
/** Grid lines configuration for this column. @group Properties */
|
|
355
|
+
gridLines?: 'Both' | 'Horizontal' | 'Vertical' | 'None';
|
|
356
|
+
};
|
|
357
|
+
declare module '@tanstack/react-table' {
|
|
358
|
+
interface TableMeta<TData extends RowData> {
|
|
359
|
+
updateData?: (rowIndex: number, columnId: string, value: unknown) => void;
|
|
360
|
+
editingRows?: Record<string, boolean>;
|
|
361
|
+
toggleRowEditing?: (rowIndex: number, editing?: boolean) => void;
|
|
362
|
+
focusedCell?: {
|
|
363
|
+
r: number;
|
|
364
|
+
c: number;
|
|
365
|
+
} | null;
|
|
366
|
+
setFocusedCell?: (cell: {
|
|
367
|
+
r: number;
|
|
368
|
+
c: number;
|
|
369
|
+
} | null) => void;
|
|
370
|
+
navigateFocus?: (dr: number, dc: number) => void;
|
|
371
|
+
enableEditing?: boolean;
|
|
372
|
+
isRowEditable?: (row: TData) => boolean;
|
|
373
|
+
isCellEditable?: (row: TData, columnId: string) => boolean;
|
|
374
|
+
enableSearchHighlighting?: boolean;
|
|
375
|
+
selectionSettings?: SelectionSettings;
|
|
376
|
+
editSettings?: EditSettings;
|
|
377
|
+
filterSettings?: FilterSettings;
|
|
378
|
+
searchSettings?: SearchSettings;
|
|
379
|
+
sortSettings?: SortSettings;
|
|
380
|
+
textWrapSettings?: TextWrapSettings;
|
|
381
|
+
classNames?: EzTableClassNames;
|
|
382
|
+
icons?: EzTableIcons;
|
|
383
|
+
slots?: EzTableSlots;
|
|
384
|
+
slotProps?: Record<string, any>;
|
|
385
|
+
localization?: EzTableLocalization;
|
|
386
|
+
gridLines?: 'Both' | 'Horizontal' | 'Vertical' | 'None';
|
|
387
|
+
}
|
|
388
|
+
interface ColumnMeta<TData extends RowData, TValue> extends EzColumnMeta {
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
export type ColumnDef<TData, TValue = unknown> = TanStackColumnDef<TData, TValue>;
|
|
392
|
+
/**
|
|
393
|
+
* Props for the EzTable component.
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* ```tsx
|
|
397
|
+
* import { EzTable, useEzTable } from 'ezux';
|
|
398
|
+
*
|
|
399
|
+
* const table = useEzTable({
|
|
400
|
+
* data: [{ id: 1, name: 'John' }],
|
|
401
|
+
* columns: [{ accessorKey: 'name', header: 'Name' }]
|
|
402
|
+
* });
|
|
403
|
+
*
|
|
404
|
+
* return <EzTable table={table} />;
|
|
405
|
+
* ```
|
|
406
|
+
*/
|
|
407
|
+
export interface EzTableProps<TData extends object> extends SharedBaseProps {
|
|
408
|
+
/**
|
|
409
|
+
* The data to display in the table.
|
|
410
|
+
* Can be an array of objects or an empty array.
|
|
411
|
+
* @group Properties
|
|
412
|
+
*/
|
|
413
|
+
data: TData[];
|
|
414
|
+
/**
|
|
415
|
+
* Configuration for the table columns.
|
|
416
|
+
* Defines headers, accessors, cell rendering, and other per-column options.
|
|
417
|
+
* @group Properties
|
|
418
|
+
*/
|
|
419
|
+
columns: ColumnDef<TData>[];
|
|
420
|
+
/**
|
|
421
|
+
* Controlled state object for the table.
|
|
422
|
+
* Use this to control pagination, sorting, filtering, etc. from outside.
|
|
423
|
+
* @group Properties
|
|
424
|
+
*/
|
|
425
|
+
state?: Partial<TableState>;
|
|
426
|
+
/**
|
|
427
|
+
* Initial state object for the table.
|
|
428
|
+
* Use this to set the initial pagination, sorting, filtering, etc.
|
|
429
|
+
* @group Properties
|
|
430
|
+
*/
|
|
431
|
+
initialState?: Partial<TableState>;
|
|
432
|
+
/**
|
|
433
|
+
* Callback fired when the table state changes.
|
|
434
|
+
* @group Events
|
|
435
|
+
*/
|
|
436
|
+
onStateChange?: (updater: Updater<TableState>) => void;
|
|
437
|
+
/**
|
|
438
|
+
* Custom slots to override default internal components.
|
|
439
|
+
* @group Properties
|
|
440
|
+
*/
|
|
441
|
+
slots?: EzTableSlots;
|
|
442
|
+
/**
|
|
443
|
+
* Props to pass to the custom slots.
|
|
444
|
+
* @group Properties
|
|
445
|
+
*/
|
|
446
|
+
slotProps?: Record<string, any>;
|
|
447
|
+
/**
|
|
448
|
+
* Custom class names for internal table elements.
|
|
449
|
+
* Use strict mode class names or functions for dynamic styling.
|
|
450
|
+
* @group Properties
|
|
451
|
+
*/
|
|
452
|
+
classNames?: EzTableClassNames;
|
|
453
|
+
/**
|
|
454
|
+
* Custom icons for table elements (sort, filter, pagination, etc.).
|
|
455
|
+
* @group Properties
|
|
456
|
+
*/
|
|
457
|
+
icons?: EzTableIcons;
|
|
458
|
+
/**
|
|
459
|
+
* Function to derive a unique ID for a row.
|
|
460
|
+
* Defaults to looking for `id` property.
|
|
461
|
+
* @group Properties
|
|
462
|
+
*/
|
|
463
|
+
getRowId?: (row: TData) => string;
|
|
464
|
+
/**
|
|
465
|
+
* Callback to process a row update before it is committed.
|
|
466
|
+
* Useful for validation or transformation.
|
|
467
|
+
* @group Events
|
|
468
|
+
*/
|
|
469
|
+
onProcessRowUpdate?: (newRow: TData, oldRow: TData) => Promise<TData>;
|
|
470
|
+
/**
|
|
471
|
+
* Alias for onDataRequest. Triggered when data needs to be fetched (e.g. pagination/sorting in server-side mode).
|
|
472
|
+
* @group Events
|
|
473
|
+
*/
|
|
474
|
+
onFetchData?: (params: any) => void;
|
|
475
|
+
/**
|
|
476
|
+
* Localization strings for the table (e.g. pagination labels, no rows message).
|
|
477
|
+
* @group Properties
|
|
478
|
+
*/
|
|
479
|
+
localization?: EzTableLocalization;
|
|
480
|
+
/**
|
|
481
|
+
* Estimated row height for virtualization.
|
|
482
|
+
* Increase this if your rows are taller than 48px to improve scroll performance.
|
|
483
|
+
* Default: 48
|
|
484
|
+
* @group Properties
|
|
485
|
+
*/
|
|
486
|
+
estimatedRowHeight?: number;
|
|
487
|
+
/**
|
|
488
|
+
* Progressive rendering for large datasets.
|
|
489
|
+
* Renders rows in chunks to keep the UI responsive.
|
|
490
|
+
* @group Properties
|
|
491
|
+
*/
|
|
492
|
+
progressiveRendering?: boolean;
|
|
493
|
+
/**
|
|
494
|
+
* Distance in items to prefetch during scrolling.
|
|
495
|
+
* @group Properties
|
|
496
|
+
*/
|
|
497
|
+
prefetchDistance?: number;
|
|
498
|
+
/**
|
|
499
|
+
* Number of items to render outside the visible area.
|
|
500
|
+
* Higher values reduce blank space during fast scrolling but increase memory usage.
|
|
501
|
+
* @group Properties
|
|
502
|
+
*/
|
|
503
|
+
overscanCount?: number;
|
|
504
|
+
/**
|
|
505
|
+
* Enable debug logging for virtualization.
|
|
506
|
+
* @group Properties
|
|
507
|
+
*/
|
|
508
|
+
debugVirtualization?: boolean;
|
|
509
|
+
/**
|
|
510
|
+
* Enable adaptive sizing for dynamic item heights.
|
|
511
|
+
* @group Properties
|
|
512
|
+
*/
|
|
513
|
+
adaptiveSizing?: boolean;
|
|
514
|
+
/**
|
|
515
|
+
* Scroll padding start (pixels) to offset sticky elements or top padding.
|
|
516
|
+
* @group Properties
|
|
517
|
+
*/
|
|
518
|
+
scrollPaddingStart?: number;
|
|
519
|
+
/**
|
|
520
|
+
* Scroll padding end (pixels) to offset sticky elements.
|
|
521
|
+
* @group Properties
|
|
522
|
+
*/
|
|
523
|
+
scrollPaddingEnd?: number;
|
|
524
|
+
/**
|
|
525
|
+
* Scroll margin (pixels) to apply to scroll container.
|
|
526
|
+
* @group Properties
|
|
527
|
+
*/
|
|
528
|
+
scrollMargin?: number;
|
|
529
|
+
/**
|
|
530
|
+
* Enable horizontal column virtualization.
|
|
531
|
+
* Recommended for tables with many columns (e.g. 50+).
|
|
532
|
+
* @group Properties
|
|
533
|
+
*/
|
|
534
|
+
enableColumnVirtualization?: boolean;
|
|
535
|
+
/**
|
|
536
|
+
* Number of columns after which virtualization kicks in.
|
|
537
|
+
* @group Properties
|
|
538
|
+
*/
|
|
539
|
+
columnVirtualizationThreshold?: number;
|
|
540
|
+
/**
|
|
541
|
+
* Enable Infinite Scrolling.
|
|
542
|
+
* If true, `onEndReached` will be called when the user scrolls to the bottom.
|
|
543
|
+
* @group Properties
|
|
544
|
+
*/
|
|
545
|
+
enableInfiniteScroll?: boolean;
|
|
546
|
+
/**
|
|
547
|
+
* Callback when the table is scrolled to the bottom.
|
|
548
|
+
* Used for Infinite Scroll to load more data.
|
|
549
|
+
* @group Events
|
|
550
|
+
*/
|
|
551
|
+
onEndReached?: () => void;
|
|
552
|
+
/**
|
|
553
|
+
* Alias for data.
|
|
554
|
+
* @deprecated Use `data` instead.
|
|
555
|
+
* @group Properties
|
|
556
|
+
*/
|
|
557
|
+
dataSource?: TData[];
|
|
558
|
+
/**
|
|
559
|
+
* Configuration for pagination.
|
|
560
|
+
* Defines page size, available page sizes, and initial page.
|
|
561
|
+
* @group Properties
|
|
562
|
+
*/
|
|
563
|
+
pageSettings?: {
|
|
564
|
+
pageSize?: number;
|
|
565
|
+
pageCount?: number;
|
|
566
|
+
currentPage?: number;
|
|
567
|
+
pageSizes?: number[];
|
|
568
|
+
};
|
|
569
|
+
/**
|
|
570
|
+
* Configuration for column aggregates (e.g. Sum, Average).
|
|
571
|
+
* Displayed in the table footer.
|
|
572
|
+
* @group Properties
|
|
573
|
+
*/
|
|
574
|
+
aggregates?: {
|
|
575
|
+
field: string;
|
|
576
|
+
type: 'Sum' | 'Average' | 'Min' | 'Max' | 'Count' | 'Custom';
|
|
577
|
+
footerTemplate?: string;
|
|
578
|
+
}[];
|
|
579
|
+
/**
|
|
580
|
+
* Text clipping mode for all columns.
|
|
581
|
+
* - `clip`: Text is clipped.
|
|
582
|
+
* - `ellipsis`: Text is truncated with an ellipsis.
|
|
583
|
+
* - `ellipsis-tooltip`: Text is truncated and a tooltip is shown on hover.
|
|
584
|
+
* @group Properties
|
|
585
|
+
*/
|
|
586
|
+
clipMode?: 'clip' | 'ellipsis' | 'ellipsis-tooltip';
|
|
587
|
+
/**
|
|
588
|
+
* Total expected rows if knowing beforehand.
|
|
589
|
+
* Crucial for server-side pagination to calculate total pages.
|
|
590
|
+
* @group Properties
|
|
591
|
+
*/
|
|
592
|
+
rowCount?: number;
|
|
593
|
+
/**
|
|
594
|
+
* Enable pagination.
|
|
595
|
+
* @group Properties
|
|
596
|
+
*/
|
|
597
|
+
pagination?: boolean;
|
|
598
|
+
/**
|
|
599
|
+
* Number of rows per page.
|
|
600
|
+
* @group Properties
|
|
601
|
+
*/
|
|
602
|
+
pageSize?: number;
|
|
603
|
+
/**
|
|
604
|
+
* Grid line configuration.
|
|
605
|
+
* @group Properties
|
|
606
|
+
*/
|
|
607
|
+
gridLines?: 'Both' | 'Horizontal' | 'Vertical' | 'None';
|
|
608
|
+
/**
|
|
609
|
+
* Enable keyboard navigation features.
|
|
610
|
+
* @group Properties
|
|
611
|
+
*/
|
|
612
|
+
allowKeyboard?: boolean;
|
|
613
|
+
/**
|
|
614
|
+
* Enable alternating row background colors (zebra striping).
|
|
615
|
+
* @group Properties
|
|
616
|
+
*/
|
|
617
|
+
enableAltRow?: boolean;
|
|
618
|
+
/**
|
|
619
|
+
* Enable row hover effect.
|
|
620
|
+
* @group Properties
|
|
621
|
+
*/
|
|
622
|
+
enableHover?: boolean;
|
|
623
|
+
/**
|
|
624
|
+
* Enable HTML sanitizer for cell content.
|
|
625
|
+
* @group Properties
|
|
626
|
+
*/
|
|
627
|
+
enableHtmlSanitizer?: boolean;
|
|
628
|
+
/**
|
|
629
|
+
* Width of the table.
|
|
630
|
+
* Accepts pixel number or CSS string (e.g. '100%').
|
|
631
|
+
* @group Properties
|
|
632
|
+
*/
|
|
633
|
+
width?: string | number;
|
|
634
|
+
/**
|
|
635
|
+
* Height of the table.
|
|
636
|
+
* Accepts pixel number or CSS string (e.g. '500px').
|
|
637
|
+
* @group Properties
|
|
638
|
+
*/
|
|
639
|
+
height?: string | number;
|
|
640
|
+
/**
|
|
641
|
+
* Fixed row height for all rows.
|
|
642
|
+
* Required for efficient virtualization.
|
|
643
|
+
* @group Properties
|
|
644
|
+
*/
|
|
645
|
+
rowHeight?: number;
|
|
646
|
+
/**
|
|
647
|
+
* Configuration for row/cell selection behavior.
|
|
648
|
+
* @group Properties
|
|
649
|
+
*/
|
|
650
|
+
selectionSettings?: SelectionSettings;
|
|
651
|
+
/**
|
|
652
|
+
* Configuration for filtering behavior (UI type, mode, etc).
|
|
653
|
+
* @group Properties
|
|
654
|
+
*/
|
|
655
|
+
filterSettings?: FilterSettings;
|
|
656
|
+
/**
|
|
657
|
+
* Configuration for global search behavior.
|
|
658
|
+
* @group Properties
|
|
659
|
+
*/
|
|
660
|
+
searchSettings?: SearchSettings;
|
|
661
|
+
/**
|
|
662
|
+
* Configuration for sorting behavior.
|
|
663
|
+
* @group Properties
|
|
664
|
+
*/
|
|
665
|
+
sortSettings?: SortSettings;
|
|
666
|
+
/**
|
|
667
|
+
* Configuration for editing behavior (mode, new row position).
|
|
668
|
+
* @group Properties
|
|
669
|
+
*/
|
|
670
|
+
editSettings?: EditSettings;
|
|
671
|
+
/**
|
|
672
|
+
* Configuration for text wrapping in cells and headers.
|
|
673
|
+
* @group Properties
|
|
674
|
+
*/
|
|
675
|
+
textWrapSettings?: TextWrapSettings;
|
|
676
|
+
/**
|
|
677
|
+
* Toolbar items configuration.
|
|
678
|
+
* Accepts an array of item names (strings) or detailed item objects.
|
|
679
|
+
* @group Properties
|
|
680
|
+
*/
|
|
681
|
+
toolbar?: (ToolbarItemType | ToolbarItem)[];
|
|
682
|
+
/**
|
|
683
|
+
* Generic query parameters for server-side operations.
|
|
684
|
+
* Passed to `onDataRequest`.
|
|
685
|
+
* @group Properties
|
|
686
|
+
*/
|
|
687
|
+
query?: any;
|
|
688
|
+
/**
|
|
689
|
+
* Custom template for rendering rows.
|
|
690
|
+
* @group Subcomponents
|
|
691
|
+
*/
|
|
692
|
+
rowTemplate?: (props: {
|
|
693
|
+
row: Row<TData>;
|
|
694
|
+
}) => React.ReactNode;
|
|
695
|
+
/**
|
|
696
|
+
* Custom template for when there are no records.
|
|
697
|
+
* @group Subcomponents
|
|
698
|
+
*/
|
|
699
|
+
emptyRecordTemplate?: () => React.ReactNode;
|
|
700
|
+
/**
|
|
701
|
+
* Custom template for the loading state.
|
|
702
|
+
* @group Subcomponents
|
|
703
|
+
*/
|
|
704
|
+
loadingTemplate?: () => React.ReactNode;
|
|
705
|
+
/**
|
|
706
|
+
* Callback when grid renders starts.
|
|
707
|
+
* @group Events
|
|
708
|
+
*/
|
|
709
|
+
onGridRenderStart?: () => void;
|
|
710
|
+
/**
|
|
711
|
+
* Callback when grid renders completes.
|
|
712
|
+
* @group Events
|
|
713
|
+
*/
|
|
714
|
+
onGridRenderComplete?: () => void;
|
|
715
|
+
/**
|
|
716
|
+
* Callback when data is loaded into the table.
|
|
717
|
+
* @group Events
|
|
718
|
+
*/
|
|
719
|
+
onDataLoad?: (data: TData[]) => void;
|
|
720
|
+
/**
|
|
721
|
+
* Callback to request data from the server.
|
|
722
|
+
* Triggered by paging, sorting, filtering, etc.
|
|
723
|
+
* @group Events
|
|
724
|
+
*/
|
|
725
|
+
onDataRequest?: (query: any) => void;
|
|
726
|
+
/**
|
|
727
|
+
* Callback when a data change (add/edit/delete) is requested.
|
|
728
|
+
* @group Events
|
|
729
|
+
*/
|
|
730
|
+
onDataChangeRequest?: (args: {
|
|
731
|
+
action: 'add' | 'edit' | 'delete';
|
|
732
|
+
data: TData;
|
|
733
|
+
}) => void;
|
|
734
|
+
/**
|
|
735
|
+
* Callback when an internal error occurs.
|
|
736
|
+
* @group Events
|
|
737
|
+
*/
|
|
738
|
+
onError?: (error: any) => void;
|
|
739
|
+
/**
|
|
740
|
+
* Callback when the table is refreshed.
|
|
741
|
+
* @group Events
|
|
742
|
+
*/
|
|
743
|
+
onRefresh?: () => void;
|
|
744
|
+
/**
|
|
745
|
+
* Callback when a cell is focused.
|
|
746
|
+
* @group Events
|
|
747
|
+
*/
|
|
748
|
+
onCellFocus?: (args: {
|
|
749
|
+
cell: any;
|
|
750
|
+
row: Row<TData>;
|
|
751
|
+
}) => void;
|
|
752
|
+
/**
|
|
753
|
+
* Callback when a toolbar item is clicked.
|
|
754
|
+
* @group Events
|
|
755
|
+
*/
|
|
756
|
+
onToolbarItemClick?: (args: {
|
|
757
|
+
item: ToolbarItem;
|
|
758
|
+
originalEvent: React.MouseEvent;
|
|
759
|
+
}) => void;
|
|
760
|
+
/**
|
|
761
|
+
* Callback when a row is deselected.
|
|
762
|
+
* @group Events
|
|
763
|
+
*/
|
|
764
|
+
onRowDeselect?: (args: {
|
|
765
|
+
row?: Row<TData>;
|
|
766
|
+
data: TData;
|
|
767
|
+
rowIndex: number;
|
|
768
|
+
}) => void;
|
|
769
|
+
/**
|
|
770
|
+
* Callback when a row is clicked.
|
|
771
|
+
* @group Events
|
|
772
|
+
*/
|
|
773
|
+
onRowClick?: (args: {
|
|
774
|
+
row: Row<TData>;
|
|
775
|
+
data: TData;
|
|
776
|
+
rowIndex: number;
|
|
777
|
+
originalEvent: React.MouseEvent;
|
|
778
|
+
}) => void;
|
|
779
|
+
/**
|
|
780
|
+
* Callback when a row is selected.
|
|
781
|
+
* @group Events
|
|
782
|
+
*/
|
|
783
|
+
onRowSelect?: (args: {
|
|
784
|
+
row?: Row<TData>;
|
|
785
|
+
data: TData;
|
|
786
|
+
rowIndex: number;
|
|
787
|
+
originalEvent?: React.SyntheticEvent;
|
|
788
|
+
}) => void;
|
|
789
|
+
/**
|
|
790
|
+
* Callback when a row is double-clicked.
|
|
791
|
+
* @group Events
|
|
792
|
+
*/
|
|
793
|
+
onRowDoubleClick?: (args: {
|
|
794
|
+
row: Row<TData>;
|
|
795
|
+
data: TData;
|
|
796
|
+
rowIndex: number;
|
|
797
|
+
originalEvent: React.MouseEvent;
|
|
798
|
+
}) => void;
|
|
799
|
+
/**
|
|
800
|
+
* Callback before a new row is added. Return false to cancel.
|
|
801
|
+
* @group Events
|
|
802
|
+
*/
|
|
803
|
+
onRowAddStart?: (args: {
|
|
804
|
+
data: Partial<TData>;
|
|
805
|
+
}) => void;
|
|
806
|
+
/**
|
|
807
|
+
* Callback before a row is edited. Return false to cancel.
|
|
808
|
+
* @group Events
|
|
809
|
+
*/
|
|
810
|
+
onRowEditStart?: (args: {
|
|
811
|
+
row: Row<TData>;
|
|
812
|
+
data: TData;
|
|
813
|
+
}) => void;
|
|
814
|
+
/**
|
|
815
|
+
* Callback when a data change operation starts.
|
|
816
|
+
* @group Events
|
|
817
|
+
*/
|
|
818
|
+
onDataChangeStart?: (args: {
|
|
819
|
+
action: 'add' | 'edit' | 'delete';
|
|
820
|
+
data: TData | TData[];
|
|
821
|
+
}) => void;
|
|
822
|
+
/**
|
|
823
|
+
* Callback when a data change operation completes.
|
|
824
|
+
* @group Events
|
|
825
|
+
*/
|
|
826
|
+
onDataChangeComplete?: (args: {
|
|
827
|
+
action: 'add' | 'edit' | 'delete';
|
|
828
|
+
data: TData | TData[];
|
|
829
|
+
}) => void;
|
|
830
|
+
/**
|
|
831
|
+
* Callback when a data change operation is cancelled.
|
|
832
|
+
* @group Events
|
|
833
|
+
*/
|
|
834
|
+
onDataChangeCancel?: (args: {
|
|
835
|
+
action: 'add' | 'edit' | 'delete';
|
|
836
|
+
row?: Row<TData>;
|
|
837
|
+
}) => void;
|
|
838
|
+
/**
|
|
839
|
+
* Callback when batch changes are saved.
|
|
840
|
+
* @group Events
|
|
841
|
+
*/
|
|
842
|
+
onBatchSave?: (changes: {
|
|
843
|
+
addedRecords: TData[];
|
|
844
|
+
changedRecords: TData[];
|
|
845
|
+
deletedRecords: TData[];
|
|
846
|
+
}) => void;
|
|
847
|
+
/**
|
|
848
|
+
* Callback when batch changes are discarded.
|
|
849
|
+
* @group Events
|
|
850
|
+
*/
|
|
851
|
+
onBatchDiscard?: () => void;
|
|
852
|
+
/**
|
|
853
|
+
* Callback when filters change.
|
|
854
|
+
* @group Events
|
|
855
|
+
*/
|
|
856
|
+
onFilter?: (args: {
|
|
857
|
+
columns: FilterRule[];
|
|
858
|
+
}) => void;
|
|
859
|
+
/**
|
|
860
|
+
* Callback when sorting changes.
|
|
861
|
+
* @group Events
|
|
862
|
+
*/
|
|
863
|
+
onSort?: (args: {
|
|
864
|
+
columns: {
|
|
865
|
+
field: string;
|
|
866
|
+
direction: 'asc' | 'desc';
|
|
867
|
+
}[];
|
|
868
|
+
}) => void;
|
|
869
|
+
/**
|
|
870
|
+
* Callback when page changes.
|
|
871
|
+
* @group Events
|
|
872
|
+
*/
|
|
873
|
+
onPageChange?: (args: {
|
|
874
|
+
currentPage: number;
|
|
875
|
+
pageSize: number;
|
|
876
|
+
}) => void;
|
|
877
|
+
/**
|
|
878
|
+
* Callback when global search is performed.
|
|
879
|
+
* @group Events
|
|
880
|
+
*/
|
|
881
|
+
onSearch?: (term: string) => void;
|
|
882
|
+
/**
|
|
883
|
+
* Callback when the edit form is rendered.
|
|
884
|
+
* @group Events
|
|
885
|
+
*/
|
|
886
|
+
onFormRender?: (args: {
|
|
887
|
+
form: any;
|
|
888
|
+
mode: 'Add' | 'Edit';
|
|
889
|
+
}) => void;
|
|
890
|
+
/**
|
|
891
|
+
* Function to validate a field during editing.
|
|
892
|
+
* Return true if valid, or an error message string if invalid.
|
|
893
|
+
* @group Properties
|
|
894
|
+
*/
|
|
895
|
+
validateField?: (args: {
|
|
896
|
+
fieldName: string;
|
|
897
|
+
value: any;
|
|
898
|
+
data: TData;
|
|
899
|
+
}) => boolean | string;
|
|
900
|
+
rowClass?: string | ((row: Row<TData>) => string);
|
|
901
|
+
manualPagination?: boolean;
|
|
902
|
+
/**
|
|
903
|
+
* Total number of pages (0-indexed).
|
|
904
|
+
* @group Properties
|
|
905
|
+
*/
|
|
906
|
+
pageCount?: number;
|
|
907
|
+
/** @group Events */
|
|
908
|
+
onPaginationChange?: (pagination: PaginationState) => void;
|
|
909
|
+
/** @group Properties */
|
|
910
|
+
enableRowSelection?: boolean;
|
|
911
|
+
/** @group Events */
|
|
912
|
+
onRowSelectionChange?: (selection: RowSelectionState) => void;
|
|
913
|
+
/**
|
|
914
|
+
* Enable column filtering.
|
|
915
|
+
* @group Properties
|
|
916
|
+
*/
|
|
917
|
+
enableColumnFiltering?: boolean;
|
|
918
|
+
/** @group Properties */
|
|
919
|
+
/**
|
|
920
|
+
* Whether filtering is handled manually (server-side).
|
|
921
|
+
* @group Properties
|
|
922
|
+
*/
|
|
923
|
+
manualFiltering?: boolean;
|
|
924
|
+
/** @group Events */
|
|
925
|
+
onColumnFiltersChange?: (filters: ColumnFiltersState) => void;
|
|
926
|
+
/** @group Events */
|
|
927
|
+
onGlobalFilterChange?: (filter: EzGlobalFilterState) => void;
|
|
928
|
+
/**
|
|
929
|
+
* Enable row grouping.
|
|
930
|
+
* @group Properties
|
|
931
|
+
*/
|
|
932
|
+
enableGrouping?: boolean;
|
|
933
|
+
/** @group Properties */
|
|
934
|
+
/**
|
|
935
|
+
* Initial grouping state.
|
|
936
|
+
* @group Properties
|
|
937
|
+
*/
|
|
938
|
+
defaultGrouping?: GroupingState;
|
|
939
|
+
/** @group Events */
|
|
940
|
+
onGroupingChange?: (grouping: GroupingState) => void;
|
|
941
|
+
/** @group Properties */
|
|
942
|
+
/**
|
|
943
|
+
* Whether sorting is handled manually (server-side).
|
|
944
|
+
* @group Properties
|
|
945
|
+
*/
|
|
946
|
+
manualSorting?: boolean;
|
|
947
|
+
/** @group Events */
|
|
948
|
+
onSortingChange?: (sorting: SortingState) => void;
|
|
949
|
+
/**
|
|
950
|
+
* Enable inline or batch editing.
|
|
951
|
+
* @group Properties
|
|
952
|
+
*/
|
|
953
|
+
enableEditing?: boolean;
|
|
954
|
+
/** @group Events */
|
|
955
|
+
onDataChange?: (dataOrChanges: TData[] | {
|
|
956
|
+
added: number;
|
|
957
|
+
edited: number;
|
|
958
|
+
deleted: number;
|
|
959
|
+
}) => void;
|
|
960
|
+
/** @group Properties */
|
|
961
|
+
/**
|
|
962
|
+
* Function to check if a cell is editable.
|
|
963
|
+
* @group Properties
|
|
964
|
+
*/
|
|
965
|
+
isCellEditable?: (row: TData, columnId: string) => boolean;
|
|
966
|
+
/**
|
|
967
|
+
* Function to check if a row is editable.
|
|
968
|
+
* @group Properties
|
|
969
|
+
*/
|
|
970
|
+
isRowEditable?: (row: TData) => boolean;
|
|
971
|
+
/** @group Properties */
|
|
972
|
+
/**
|
|
973
|
+
* Enable tree data (hierarchical rows).
|
|
974
|
+
* @group Properties
|
|
975
|
+
*/
|
|
976
|
+
enableTreeData?: boolean;
|
|
977
|
+
/** @group Properties */
|
|
978
|
+
/**
|
|
979
|
+
* Function to get sub-rows for tree data.
|
|
980
|
+
* @group Properties
|
|
981
|
+
*/
|
|
982
|
+
getSubRows?: (originalRow: TData) => TData[] | undefined;
|
|
983
|
+
/** @group Properties */
|
|
984
|
+
/**
|
|
985
|
+
* Enable pivoting mode.
|
|
986
|
+
* @group Properties
|
|
987
|
+
*/
|
|
988
|
+
enablePivoting?: boolean;
|
|
989
|
+
/**
|
|
990
|
+
* Enable data export (Excel, CSV, PDF).
|
|
991
|
+
* @group Properties
|
|
992
|
+
*/
|
|
993
|
+
enableExport?: boolean;
|
|
994
|
+
/** @group Events */
|
|
995
|
+
/**
|
|
996
|
+
* Callback when Excel export is triggered.
|
|
997
|
+
* @group Events
|
|
998
|
+
*/
|
|
999
|
+
onExportExcel?: (table: Table<TData>) => void;
|
|
1000
|
+
/** @group Events */
|
|
1001
|
+
/**
|
|
1002
|
+
* Callback when CSV export is triggered.
|
|
1003
|
+
* @group Events
|
|
1004
|
+
*/
|
|
1005
|
+
onExportCSV?: (table: Table<TData>) => void;
|
|
1006
|
+
/** @group Events */
|
|
1007
|
+
/**
|
|
1008
|
+
* Callback when PDF export is triggered.
|
|
1009
|
+
* @group Events
|
|
1010
|
+
*/
|
|
1011
|
+
onExportPDF?: (table: Table<TData>) => void;
|
|
1012
|
+
/**
|
|
1013
|
+
* Enable context menu on right-click.
|
|
1014
|
+
* @group Properties
|
|
1015
|
+
*/
|
|
1016
|
+
enableContextMenu?: boolean;
|
|
1017
|
+
/** @group Events */
|
|
1018
|
+
/**
|
|
1019
|
+
* Callback when a context menu item is clicked.
|
|
1020
|
+
* @group Events
|
|
1021
|
+
*/
|
|
1022
|
+
onContextMenuItemClick?: (action: string, row: TData) => void;
|
|
1023
|
+
/** @group Properties */
|
|
1024
|
+
/**
|
|
1025
|
+
* Enable range selection (Excel-like selection).
|
|
1026
|
+
* @group Properties
|
|
1027
|
+
*/
|
|
1028
|
+
enableRangeSelection?: boolean;
|
|
1029
|
+
/**
|
|
1030
|
+
* Enable row pinning (sticky rows).
|
|
1031
|
+
* @group Properties
|
|
1032
|
+
*/
|
|
1033
|
+
enableRowPinning?: boolean;
|
|
1034
|
+
/** @group Methods */
|
|
1035
|
+
setPagerMessage?: (message: string) => void;
|
|
1036
|
+
/**
|
|
1037
|
+
* Enable advanced filtering (Excel-like).
|
|
1038
|
+
* @group Properties
|
|
1039
|
+
*/
|
|
1040
|
+
enableAdvancedFiltering?: boolean;
|
|
1041
|
+
/** @group Properties */
|
|
1042
|
+
/**
|
|
1043
|
+
* Function to render a detail panel for expanding rows.
|
|
1044
|
+
* @group Properties
|
|
1045
|
+
*/
|
|
1046
|
+
renderDetailPanel?: (props: {
|
|
1047
|
+
row: Row<TData>;
|
|
1048
|
+
}) => React.ReactNode;
|
|
1049
|
+
/** @group Properties */
|
|
1050
|
+
/**
|
|
1051
|
+
* Enable sticky header.
|
|
1052
|
+
* @group Properties
|
|
1053
|
+
*/
|
|
1054
|
+
enableStickyHeader?: boolean;
|
|
1055
|
+
/** @group Properties */
|
|
1056
|
+
/**
|
|
1057
|
+
* Enable sticky pagination at the bottom.
|
|
1058
|
+
* @group Properties
|
|
1059
|
+
*/
|
|
1060
|
+
enableStickyPagination?: boolean;
|
|
1061
|
+
/**
|
|
1062
|
+
* Enable change tracking for batch editing.
|
|
1063
|
+
* @group Properties
|
|
1064
|
+
*/
|
|
1065
|
+
enableChangeTracking?: boolean;
|
|
1066
|
+
/**
|
|
1067
|
+
* Enable column pinning (sticky columns).
|
|
1068
|
+
* @group Properties
|
|
1069
|
+
*/
|
|
1070
|
+
enableColumnPinning?: boolean;
|
|
1071
|
+
/** @group Properties */
|
|
1072
|
+
/**
|
|
1073
|
+
* Enable state persistence (save settings to local storage).
|
|
1074
|
+
* @group Properties
|
|
1075
|
+
*/
|
|
1076
|
+
enablePersistence?: boolean;
|
|
1077
|
+
/** @group Properties */
|
|
1078
|
+
/**
|
|
1079
|
+
* Key to use for state persistence.
|
|
1080
|
+
* @group Properties
|
|
1081
|
+
*/
|
|
1082
|
+
persistenceKey?: string;
|
|
1083
|
+
/**
|
|
1084
|
+
* Enable group footers (aggregates).
|
|
1085
|
+
* @group Properties
|
|
1086
|
+
*/
|
|
1087
|
+
enableGroupFooters?: boolean;
|
|
1088
|
+
/**
|
|
1089
|
+
* Enable drag-and-drop row reordering.
|
|
1090
|
+
* @group Properties
|
|
1091
|
+
*/
|
|
1092
|
+
enableRowReordering?: boolean;
|
|
1093
|
+
/** @group Events */
|
|
1094
|
+
onRowReorder?: (newOrder: string[]) => void;
|
|
1095
|
+
/** @group Properties */
|
|
1096
|
+
/**
|
|
1097
|
+
* Enable highlighting of search terms in cells.
|
|
1098
|
+
* @group Properties
|
|
1099
|
+
*/
|
|
1100
|
+
enableSearchHighlighting?: boolean;
|
|
1101
|
+
/** @group Properties */
|
|
1102
|
+
/**
|
|
1103
|
+
* Display density of the table.
|
|
1104
|
+
* @group Properties
|
|
1105
|
+
*/
|
|
1106
|
+
density?: 'compact' | 'standard' | 'comfortable';
|
|
1107
|
+
/** @group Properties */
|
|
1108
|
+
/**
|
|
1109
|
+
* Whether the table is in a loading state.
|
|
1110
|
+
* @group Properties
|
|
1111
|
+
*/
|
|
1112
|
+
isLoading?: boolean;
|
|
1113
|
+
/** @group Properties */
|
|
1114
|
+
/**
|
|
1115
|
+
* Scroll behavior for the table (auto or smooth).
|
|
1116
|
+
* @group Properties
|
|
1117
|
+
*/
|
|
1118
|
+
scrollBehavior?: 'auto' | 'smooth';
|
|
1119
|
+
/** @group Properties */
|
|
1120
|
+
/**
|
|
1121
|
+
* Custom overlay to render when there are no rows.
|
|
1122
|
+
* @group Properties
|
|
1123
|
+
*/
|
|
1124
|
+
renderNoRowsOverlay?: () => React.ReactNode;
|
|
1125
|
+
/** @group Events */
|
|
1126
|
+
/**
|
|
1127
|
+
* Callback when a cell is clicked.
|
|
1128
|
+
* @group Events
|
|
1129
|
+
*/
|
|
1130
|
+
onCellClick?: (params: {
|
|
1131
|
+
row: TData;
|
|
1132
|
+
columnId: string;
|
|
1133
|
+
cellValue: any;
|
|
1134
|
+
event: React.MouseEvent;
|
|
1135
|
+
}) => void;
|
|
1136
|
+
/** @group Events */
|
|
1137
|
+
/**
|
|
1138
|
+
* Callback when a cell is double-clicked.
|
|
1139
|
+
* @group Events
|
|
1140
|
+
*/
|
|
1141
|
+
onCellDoubleClick?: (params: {
|
|
1142
|
+
row: TData;
|
|
1143
|
+
columnId: string;
|
|
1144
|
+
cellValue: any;
|
|
1145
|
+
event: React.MouseEvent;
|
|
1146
|
+
}) => void;
|
|
1147
|
+
/** @group Properties */
|
|
1148
|
+
/**
|
|
1149
|
+
* Configuration for clipboard operations (copy/paste).
|
|
1150
|
+
* @group Properties
|
|
1151
|
+
*/
|
|
1152
|
+
clipboardSettings?: {
|
|
1153
|
+
enable?: boolean;
|
|
1154
|
+
mode?: 'Copy' | 'Paste' | 'Both';
|
|
1155
|
+
copyHeaders?: boolean;
|
|
1156
|
+
};
|
|
1157
|
+
/** @group Properties */
|
|
1158
|
+
/**
|
|
1159
|
+
* Configuration for grouping UI.
|
|
1160
|
+
* @group Properties
|
|
1161
|
+
*/
|
|
1162
|
+
groupSettings?: {
|
|
1163
|
+
showDropArea?: boolean;
|
|
1164
|
+
showGroupedColumn?: boolean;
|
|
1165
|
+
captionTemplate?: string;
|
|
1166
|
+
};
|
|
1167
|
+
/** @group Properties */
|
|
1168
|
+
/**
|
|
1169
|
+
* Print mode (Current Page or All Pages).
|
|
1170
|
+
* @group Properties
|
|
1171
|
+
*/
|
|
1172
|
+
printMode?: 'CurrentPage' | 'AllPages';
|
|
1173
|
+
/** @group Events */
|
|
1174
|
+
/**
|
|
1175
|
+
* Callback when data is pasted from clipboard.
|
|
1176
|
+
* @group Events
|
|
1177
|
+
*/
|
|
1178
|
+
onPaste?: (args: {
|
|
1179
|
+
data: any[][];
|
|
1180
|
+
rowIndex: number;
|
|
1181
|
+
colIndex: number;
|
|
1182
|
+
}) => void;
|
|
1183
|
+
/** @group Events */
|
|
1184
|
+
/**
|
|
1185
|
+
* Callback when a cell is saved (async).
|
|
1186
|
+
* @group Events
|
|
1187
|
+
*/
|
|
1188
|
+
onCellSave?: (args: {
|
|
1189
|
+
value: any;
|
|
1190
|
+
oldValue: any;
|
|
1191
|
+
cancel: boolean;
|
|
1192
|
+
}) => Promise<void>;
|
|
1193
|
+
/** @group Events */
|
|
1194
|
+
/**
|
|
1195
|
+
* Callback when context menu is opened.
|
|
1196
|
+
* @group Events
|
|
1197
|
+
*/
|
|
1198
|
+
onContextMenuOpen?: (args: {
|
|
1199
|
+
row: Row<TData>;
|
|
1200
|
+
column: Column<TData, any>;
|
|
1201
|
+
items: any[];
|
|
1202
|
+
}) => void;
|
|
1203
|
+
/** @group Events */
|
|
1204
|
+
/**
|
|
1205
|
+
* Callback when export completes.
|
|
1206
|
+
* @group Events
|
|
1207
|
+
*/
|
|
1208
|
+
onExportComplete?: (args: {
|
|
1209
|
+
blob: Blob;
|
|
1210
|
+
}) => void;
|
|
1211
|
+
/**
|
|
1212
|
+
* Data service instance for remote operations.
|
|
1213
|
+
* @group Properties
|
|
1214
|
+
*/
|
|
1215
|
+
service?: ITableService<TData>;
|
|
1216
|
+
/**
|
|
1217
|
+
* Name of the registered service.
|
|
1218
|
+
* @group Properties
|
|
1219
|
+
*/
|
|
1220
|
+
serviceName?: string;
|
|
1221
|
+
}
|
|
1222
|
+
export interface EzTableRef<TData = any> {
|
|
1223
|
+
/**
|
|
1224
|
+
* Refreshes the table data.
|
|
1225
|
+
* @group Methods
|
|
1226
|
+
*/
|
|
1227
|
+
refresh: () => void;
|
|
1228
|
+
/**
|
|
1229
|
+
* Returns the current data displayed in the table.
|
|
1230
|
+
* @group Methods
|
|
1231
|
+
*/
|
|
1232
|
+
getData: () => TData[];
|
|
1233
|
+
/**
|
|
1234
|
+
* Sets a value for a specific cell.
|
|
1235
|
+
* @group Methods
|
|
1236
|
+
*/
|
|
1237
|
+
setCellValue: (key: string, field: string, value: any) => void;
|
|
1238
|
+
/**
|
|
1239
|
+
* Updates the data for a specific row.
|
|
1240
|
+
* @group Methods
|
|
1241
|
+
*/
|
|
1242
|
+
setRowData: (key: string, data: Partial<TData>) => void;
|
|
1243
|
+
/**
|
|
1244
|
+
* Saves any pending data changes (batch mode).
|
|
1245
|
+
* @group Methods
|
|
1246
|
+
*/
|
|
1247
|
+
saveDataChanges: () => void | Promise<void>;
|
|
1248
|
+
/**
|
|
1249
|
+
* Cancels any pending data changes.
|
|
1250
|
+
* @group Methods
|
|
1251
|
+
*/
|
|
1252
|
+
cancelDataChanges: () => void | Promise<void>;
|
|
1253
|
+
/**
|
|
1254
|
+
* Validates the current edit form.
|
|
1255
|
+
* @group Methods
|
|
1256
|
+
*/
|
|
1257
|
+
validateEditForm: () => boolean;
|
|
1258
|
+
/**
|
|
1259
|
+
* Returns the field names used as primary keys.
|
|
1260
|
+
* @group Methods
|
|
1261
|
+
*/
|
|
1262
|
+
getPrimaryKeyFieldNames: () => string[];
|
|
1263
|
+
/**
|
|
1264
|
+
* Selects a row by its index or ID.
|
|
1265
|
+
* @group Methods
|
|
1266
|
+
*/
|
|
1267
|
+
selectRow: (index: number | string) => void;
|
|
1268
|
+
/**
|
|
1269
|
+
* Selects multiple rows by their indices or IDs.
|
|
1270
|
+
* @group Methods
|
|
1271
|
+
*/
|
|
1272
|
+
selectRows: (indices: (number | string)[]) => void;
|
|
1273
|
+
/**
|
|
1274
|
+
* Clears the current selection.
|
|
1275
|
+
* @group Methods
|
|
1276
|
+
*/
|
|
1277
|
+
clearSelection: () => void;
|
|
1278
|
+
/**
|
|
1279
|
+
* Selects all rows in the table.
|
|
1280
|
+
* @group Methods
|
|
1281
|
+
*/
|
|
1282
|
+
selectAll: () => void;
|
|
1283
|
+
/**
|
|
1284
|
+
* Returns the currently selected records.
|
|
1285
|
+
* @group Methods
|
|
1286
|
+
*/
|
|
1287
|
+
getSelectedRecords: () => TData[];
|
|
1288
|
+
/**
|
|
1289
|
+
* Returns the indexes of currently selected rows.
|
|
1290
|
+
* @group Methods
|
|
1291
|
+
*/
|
|
1292
|
+
getSelectedRowIndexes: () => number[];
|
|
1293
|
+
/**
|
|
1294
|
+
* Navigates to a specific page.
|
|
1295
|
+
* @group Methods
|
|
1296
|
+
*/
|
|
1297
|
+
goToPage: (page: number) => void;
|
|
1298
|
+
/**
|
|
1299
|
+
* Performs a global search.
|
|
1300
|
+
* @group Methods
|
|
1301
|
+
*/
|
|
1302
|
+
search: (key: string) => void;
|
|
1303
|
+
/**
|
|
1304
|
+
* Filters the table by a specific column.
|
|
1305
|
+
* @group Methods
|
|
1306
|
+
*/
|
|
1307
|
+
filterByColumn: (fieldName: string, operator: string, value: any) => void;
|
|
1308
|
+
/**
|
|
1309
|
+
* Clears the filter for a specific column or all columns.
|
|
1310
|
+
* @group Methods
|
|
1311
|
+
*/
|
|
1312
|
+
clearFilter: (fieldName?: string) => void;
|
|
1313
|
+
/**
|
|
1314
|
+
* Sorts the table by a specific column.
|
|
1315
|
+
* @group Methods
|
|
1316
|
+
*/
|
|
1317
|
+
sortByColumn: (fieldName: string, direction: 'asc' | 'desc') => void;
|
|
1318
|
+
/**
|
|
1319
|
+
* Clears the current sort.
|
|
1320
|
+
* @group Methods
|
|
1321
|
+
*/
|
|
1322
|
+
clearSort: () => void;
|
|
1323
|
+
/**
|
|
1324
|
+
* Shows the loading spinner.
|
|
1325
|
+
* @group Methods
|
|
1326
|
+
*/
|
|
1327
|
+
showSpinner: () => void;
|
|
1328
|
+
/**
|
|
1329
|
+
* Hides the loading spinner.
|
|
1330
|
+
* @group Methods
|
|
1331
|
+
*/
|
|
1332
|
+
hideSpinner: () => void;
|
|
1333
|
+
/**
|
|
1334
|
+
* Returns the list of visible columns.
|
|
1335
|
+
* @group Methods
|
|
1336
|
+
*/
|
|
1337
|
+
getVisibleColumns: () => any[];
|
|
1338
|
+
/**
|
|
1339
|
+
* Returns the list of hidden columns.
|
|
1340
|
+
* @group Methods
|
|
1341
|
+
*/
|
|
1342
|
+
getHiddenColumns: () => any[];
|
|
1343
|
+
/**
|
|
1344
|
+
* Returns a column definition by its field name.
|
|
1345
|
+
* @group Methods
|
|
1346
|
+
*/
|
|
1347
|
+
getColumnByField: (field: string) => any;
|
|
1348
|
+
/**
|
|
1349
|
+
* Adds a new record to the table.
|
|
1350
|
+
* @group Methods
|
|
1351
|
+
*/
|
|
1352
|
+
addRecord: (data?: Partial<TData>) => void | Promise<void>;
|
|
1353
|
+
/**
|
|
1354
|
+
* Deletes a record from the table.
|
|
1355
|
+
* @group Methods
|
|
1356
|
+
*/
|
|
1357
|
+
deleteRecord: (key?: string | number) => void | Promise<void>;
|
|
1358
|
+
/**
|
|
1359
|
+
* Puts a record into edit mode.
|
|
1360
|
+
* @group Methods
|
|
1361
|
+
*/
|
|
1362
|
+
editRecord: (key: string | number) => void | Promise<void>;
|
|
1363
|
+
/**
|
|
1364
|
+
* Updates an existing record.
|
|
1365
|
+
* @group Methods
|
|
1366
|
+
*/
|
|
1367
|
+
updateRecord: (key: string | number, data: Partial<TData>) => void | Promise<void>;
|
|
1368
|
+
/**
|
|
1369
|
+
* Deletes multiple records.
|
|
1370
|
+
* @group Methods
|
|
1371
|
+
*/
|
|
1372
|
+
deleteRecords: (indices: number[]) => void | Promise<void>;
|
|
1373
|
+
/**
|
|
1374
|
+
* Returns all column definitions.
|
|
1375
|
+
* @group Methods
|
|
1376
|
+
*/
|
|
1377
|
+
getColumns: () => ColumnDef<TData>[];
|
|
1378
|
+
/**
|
|
1379
|
+
* Returns the underlying data module (internal use).
|
|
1380
|
+
* @group Methods
|
|
1381
|
+
*/
|
|
1382
|
+
getDataModule: () => any;
|
|
1383
|
+
/**
|
|
1384
|
+
* Returns row information for a specific key.
|
|
1385
|
+
* @group Methods
|
|
1386
|
+
*/
|
|
1387
|
+
getRowInfo: (key: string | number) => Row<TData> | undefined;
|
|
1388
|
+
/**
|
|
1389
|
+
* Checks if the table is in remote data mode.
|
|
1390
|
+
* @group Methods
|
|
1391
|
+
*/
|
|
1392
|
+
isRemote: () => boolean;
|
|
1393
|
+
/**
|
|
1394
|
+
* Removes a sort column.
|
|
1395
|
+
* @group Methods
|
|
1396
|
+
*/
|
|
1397
|
+
removeSortColumn: (field: string) => void;
|
|
1398
|
+
/**
|
|
1399
|
+
* Selects a range of rows.
|
|
1400
|
+
* @group Methods
|
|
1401
|
+
*/
|
|
1402
|
+
selectRowByRange: (startIndex: number | string, endIndex: number | string) => void;
|
|
1403
|
+
/**
|
|
1404
|
+
* Sets a message in the pager.
|
|
1405
|
+
* @group Methods
|
|
1406
|
+
*/
|
|
1407
|
+
setPagerMessage: (message: string) => void;
|
|
1408
|
+
/**
|
|
1409
|
+
* Clears row selection (Alias for clearSelection).
|
|
1410
|
+
* @group Methods
|
|
1411
|
+
*/
|
|
1412
|
+
clearRowSelection: () => void;
|
|
1413
|
+
/**
|
|
1414
|
+
* Validates a specific field.
|
|
1415
|
+
* @group Methods
|
|
1416
|
+
*/
|
|
1417
|
+
validateField: (field: string) => boolean;
|
|
1418
|
+
/**
|
|
1419
|
+
* Returns batch changes (added, changed, deleted).
|
|
1420
|
+
* @group Methods
|
|
1421
|
+
*/
|
|
1422
|
+
getBatchChanges: () => {
|
|
1423
|
+
addedRecords: TData[];
|
|
1424
|
+
changedRecords: TData[];
|
|
1425
|
+
deletedRecords: TData[];
|
|
1426
|
+
};
|
|
1427
|
+
/**
|
|
1428
|
+
* Returns changes (Alias for getBatchChanges).
|
|
1429
|
+
* @group Methods
|
|
1430
|
+
*/
|
|
1431
|
+
getChanges: () => {
|
|
1432
|
+
addedRecords: TData[];
|
|
1433
|
+
changedRecords: TData[];
|
|
1434
|
+
deletedRecords: TData[];
|
|
1435
|
+
};
|
|
1436
|
+
/**
|
|
1437
|
+
* Copies table data to clipboard.
|
|
1438
|
+
* @group Methods
|
|
1439
|
+
*/
|
|
1440
|
+
copyToClipboard: (withHeaders?: boolean) => void;
|
|
1441
|
+
/**
|
|
1442
|
+
* Automatically fits columns to content.
|
|
1443
|
+
* @group Methods
|
|
1444
|
+
*/
|
|
1445
|
+
autoFitColumns: () => void;
|
|
1446
|
+
/**
|
|
1447
|
+
* Expands all groups.
|
|
1448
|
+
* @group Methods
|
|
1449
|
+
*/
|
|
1450
|
+
expandAllGroups: () => void;
|
|
1451
|
+
/**
|
|
1452
|
+
* Collapses all groups.
|
|
1453
|
+
* @group Methods
|
|
1454
|
+
*/
|
|
1455
|
+
collapseAllGroups: () => void;
|
|
1456
|
+
/**
|
|
1457
|
+
* Scrolls to a specific row index.
|
|
1458
|
+
* @group Methods
|
|
1459
|
+
*/
|
|
1460
|
+
scrollToIndex: (index: number) => void;
|
|
1461
|
+
/**
|
|
1462
|
+
* Forces a re-render of the table.
|
|
1463
|
+
* @group Methods
|
|
1464
|
+
*/
|
|
1465
|
+
forceUpdate: () => void;
|
|
1466
|
+
/**
|
|
1467
|
+
* Exports data as CSV.
|
|
1468
|
+
* @group Methods
|
|
1469
|
+
*/
|
|
1470
|
+
exportDataAsCsv: (options?: any) => void;
|
|
1471
|
+
/**
|
|
1472
|
+
* Sets the filter model programmatically.
|
|
1473
|
+
* @group Methods
|
|
1474
|
+
*/
|
|
1475
|
+
setFilterModel: (model: ColumnFiltersState) => void;
|
|
1476
|
+
/**
|
|
1477
|
+
* Sets column visibility programmatically.
|
|
1478
|
+
* @group Methods
|
|
1479
|
+
*/
|
|
1480
|
+
setColumnVisibility: (model: Record<string, boolean>) => void;
|
|
1481
|
+
}
|