@freighttech/ui 0.13.18
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 +31 -0
- package/dist/backend/AppShell.js +1289 -0
- package/dist/backend/AppShell.js.map +7 -0
- package/dist/backend/BackendChromeProvider.js +83 -0
- package/dist/backend/BackendChromeProvider.js.map +7 -0
- package/dist/backend/BackendPageSurface.js +19 -0
- package/dist/backend/BackendPageSurface.js.map +7 -0
- package/dist/backend/CollapsibleNavSection.js +149 -0
- package/dist/backend/CollapsibleNavSection.js.map +7 -0
- package/dist/backend/ContextHelp.js +33 -0
- package/dist/backend/ContextHelp.js.map +7 -0
- package/dist/backend/CrudForm.js +3163 -0
- package/dist/backend/CrudForm.js.map +7 -0
- package/dist/backend/DataTable.js +2091 -0
- package/dist/backend/DataTable.js.map +7 -0
- package/dist/backend/EmptyState.js +52 -0
- package/dist/backend/EmptyState.js.map +7 -0
- package/dist/backend/FilterBar.js +147 -0
- package/dist/backend/FilterBar.js.map +7 -0
- package/dist/backend/FilterOverlay.js +337 -0
- package/dist/backend/FilterOverlay.js.map +7 -0
- package/dist/backend/FlashMessages.js +158 -0
- package/dist/backend/FlashMessages.js.map +7 -0
- package/dist/backend/HtmlRichTextEditor.js +129 -0
- package/dist/backend/HtmlRichTextEditor.js.map +7 -0
- package/dist/backend/IntegrationsButton.js +25 -0
- package/dist/backend/IntegrationsButton.js.map +7 -0
- package/dist/backend/JsonBuilder.js +323 -0
- package/dist/backend/JsonBuilder.js.map +7 -0
- package/dist/backend/JsonDisplay.js +207 -0
- package/dist/backend/JsonDisplay.js.map +7 -0
- package/dist/backend/NextStepCallout.js +79 -0
- package/dist/backend/NextStepCallout.js.map +7 -0
- package/dist/backend/Page.js +27 -0
- package/dist/backend/Page.js.map +7 -0
- package/dist/backend/PerspectiveSidebar.js +456 -0
- package/dist/backend/PerspectiveSidebar.js.map +7 -0
- package/dist/backend/ProfileDropdown.js +341 -0
- package/dist/backend/ProfileDropdown.js.map +7 -0
- package/dist/backend/RowActions.js +155 -0
- package/dist/backend/RowActions.js.map +7 -0
- package/dist/backend/SectionHeader.js +74 -0
- package/dist/backend/SectionHeader.js.map +7 -0
- package/dist/backend/SettingsButton.js +25 -0
- package/dist/backend/SettingsButton.js.map +7 -0
- package/dist/backend/Sidebar.js +510 -0
- package/dist/backend/Sidebar.js.map +7 -0
- package/dist/backend/Sidebar.stories.js +166 -0
- package/dist/backend/Sidebar.stories.js.map +7 -0
- package/dist/backend/TruncatedCell.js +92 -0
- package/dist/backend/TruncatedCell.js.map +7 -0
- package/dist/backend/UserMenu.js +146 -0
- package/dist/backend/UserMenu.js.map +7 -0
- package/dist/backend/ValueIcons.js +34 -0
- package/dist/backend/ValueIcons.js.map +7 -0
- package/dist/backend/WebhookSetupGuide.js +79 -0
- package/dist/backend/WebhookSetupGuide.js.map +7 -0
- package/dist/backend/charts/BarChart.js +154 -0
- package/dist/backend/charts/BarChart.js.map +7 -0
- package/dist/backend/charts/ChartUtils.js +141 -0
- package/dist/backend/charts/ChartUtils.js.map +7 -0
- package/dist/backend/charts/ComboChart.js +261 -0
- package/dist/backend/charts/ComboChart.js.map +7 -0
- package/dist/backend/charts/ComboChart.stories.js +88 -0
- package/dist/backend/charts/ComboChart.stories.js.map +7 -0
- package/dist/backend/charts/KpiCard.js +96 -0
- package/dist/backend/charts/KpiCard.js.map +7 -0
- package/dist/backend/charts/LineChart.js +165 -0
- package/dist/backend/charts/LineChart.js.map +7 -0
- package/dist/backend/charts/PieChart.js +121 -0
- package/dist/backend/charts/PieChart.js.map +7 -0
- package/dist/backend/charts/ScatterChart.js +320 -0
- package/dist/backend/charts/ScatterChart.js.map +7 -0
- package/dist/backend/charts/TopNTable.js +91 -0
- package/dist/backend/charts/TopNTable.js.map +7 -0
- package/dist/backend/charts/WaterfallChart.js +136 -0
- package/dist/backend/charts/WaterfallChart.js.map +7 -0
- package/dist/backend/charts/index.js +30 -0
- package/dist/backend/charts/index.js.map +7 -0
- package/dist/backend/columns/ColumnChooserPanel.js +244 -0
- package/dist/backend/columns/ColumnChooserPanel.js.map +7 -0
- package/dist/backend/confirm-dialog/ConfirmDialog.js +214 -0
- package/dist/backend/confirm-dialog/ConfirmDialog.js.map +7 -0
- package/dist/backend/confirm-dialog/index.js +7 -0
- package/dist/backend/confirm-dialog/index.js.map +7 -0
- package/dist/backend/confirm-dialog/useConfirmDialog.js +113 -0
- package/dist/backend/confirm-dialog/useConfirmDialog.js.map +7 -0
- package/dist/backend/custom-fields/FieldDefinitionsEditor.js +1352 -0
- package/dist/backend/custom-fields/FieldDefinitionsEditor.js.map +7 -0
- package/dist/backend/custom-fields/FieldDefinitionsManager.js +332 -0
- package/dist/backend/custom-fields/FieldDefinitionsManager.js.map +7 -0
- package/dist/backend/dashboard/DashboardScreen.js +598 -0
- package/dist/backend/dashboard/DashboardScreen.js.map +7 -0
- package/dist/backend/dashboard/index.js +5 -0
- package/dist/backend/dashboard/index.js.map +7 -0
- package/dist/backend/dashboard/widgetRegistry.js +55 -0
- package/dist/backend/dashboard/widgetRegistry.js.map +7 -0
- package/dist/backend/date-range/DateRangeSelect.js +39 -0
- package/dist/backend/date-range/DateRangeSelect.js.map +7 -0
- package/dist/backend/date-range/InlineDateRangeSelect.js +42 -0
- package/dist/backend/date-range/InlineDateRangeSelect.js.map +7 -0
- package/dist/backend/date-range/InlineGranularitySelect.js +40 -0
- package/dist/backend/date-range/InlineGranularitySelect.js.map +7 -0
- package/dist/backend/date-range/dateRanges.js +176 -0
- package/dist/backend/date-range/dateRanges.js.map +7 -0
- package/dist/backend/date-range/index.js +25 -0
- package/dist/backend/date-range/index.js.map +7 -0
- package/dist/backend/detail/AccessDeniedMessage.js +28 -0
- package/dist/backend/detail/AccessDeniedMessage.js.map +7 -0
- package/dist/backend/detail/ActivitiesSection.js +947 -0
- package/dist/backend/detail/ActivitiesSection.js.map +7 -0
- package/dist/backend/detail/AddressEditor.js +417 -0
- package/dist/backend/detail/AddressEditor.js.map +7 -0
- package/dist/backend/detail/AddressTiles.js +441 -0
- package/dist/backend/detail/AddressTiles.js.map +7 -0
- package/dist/backend/detail/AddressesSection.js +274 -0
- package/dist/backend/detail/AddressesSection.js.map +7 -0
- package/dist/backend/detail/AttachmentDeleteDialog.js +41 -0
- package/dist/backend/detail/AttachmentDeleteDialog.js.map +7 -0
- package/dist/backend/detail/AttachmentMetadataDialog.js +519 -0
- package/dist/backend/detail/AttachmentMetadataDialog.js.map +7 -0
- package/dist/backend/detail/AttachmentVisualPreview.js +132 -0
- package/dist/backend/detail/AttachmentVisualPreview.js.map +7 -0
- package/dist/backend/detail/AttachmentsSection.js +281 -0
- package/dist/backend/detail/AttachmentsSection.js.map +7 -0
- package/dist/backend/detail/CustomDataSection.js +575 -0
- package/dist/backend/detail/CustomDataSection.js.map +7 -0
- package/dist/backend/detail/DetailFieldsSection.js +85 -0
- package/dist/backend/detail/DetailFieldsSection.js.map +7 -0
- package/dist/backend/detail/ErrorMessage.js +28 -0
- package/dist/backend/detail/ErrorMessage.js.map +7 -0
- package/dist/backend/detail/InlineEditors.js +697 -0
- package/dist/backend/detail/InlineEditors.js.map +7 -0
- package/dist/backend/detail/LoadingMessage.js +14 -0
- package/dist/backend/detail/LoadingMessage.js.map +7 -0
- package/dist/backend/detail/NotesSection.js +1022 -0
- package/dist/backend/detail/NotesSection.js.map +7 -0
- package/dist/backend/detail/TabEmptyState.js +25 -0
- package/dist/backend/detail/TabEmptyState.js.map +7 -0
- package/dist/backend/detail/TagsSection.js +375 -0
- package/dist/backend/detail/TagsSection.js.map +7 -0
- package/dist/backend/detail/addressFormat.js +77 -0
- package/dist/backend/detail/addressFormat.js.map +7 -0
- package/dist/backend/detail/index.js +36 -0
- package/dist/backend/detail/index.js.map +7 -0
- package/dist/backend/devtools/UmesDevToolsPanel.js +109 -0
- package/dist/backend/devtools/UmesDevToolsPanel.js.map +7 -0
- package/dist/backend/devtools/components/ConflictWarnings.js +32 -0
- package/dist/backend/devtools/components/ConflictWarnings.js.map +7 -0
- package/dist/backend/devtools/components/EnricherTiming.js +46 -0
- package/dist/backend/devtools/components/EnricherTiming.js.map +7 -0
- package/dist/backend/devtools/components/EventFlow.js +34 -0
- package/dist/backend/devtools/components/EventFlow.js.map +7 -0
- package/dist/backend/devtools/components/ExtensionPointList.js +58 -0
- package/dist/backend/devtools/components/ExtensionPointList.js.map +7 -0
- package/dist/backend/devtools/components/InterceptorActivity.js +36 -0
- package/dist/backend/devtools/components/InterceptorActivity.js.map +7 -0
- package/dist/backend/devtools/index.js +7 -0
- package/dist/backend/devtools/index.js.map +7 -0
- package/dist/backend/devtools/useUmesDevTools.js +125 -0
- package/dist/backend/devtools/useUmesDevTools.js.map +7 -0
- package/dist/backend/document-viewer/RegionOverlay.js +92 -0
- package/dist/backend/document-viewer/RegionOverlay.js.map +7 -0
- package/dist/backend/document-viewer/index.js +6 -0
- package/dist/backend/document-viewer/index.js.map +7 -0
- package/dist/backend/dynamic-grid/DynamicGrid.js +130 -0
- package/dist/backend/dynamic-grid/DynamicGrid.js.map +7 -0
- package/dist/backend/dynamic-grid/adapters.js +34 -0
- package/dist/backend/dynamic-grid/adapters.js.map +7 -0
- package/dist/backend/dynamic-grid/components/GridCell.js +149 -0
- package/dist/backend/dynamic-grid/components/GridCell.js.map +7 -0
- package/dist/backend/dynamic-grid/components/GridRow.js +32 -0
- package/dist/backend/dynamic-grid/components/GridRow.js.map +7 -0
- package/dist/backend/dynamic-grid/hooks/useGridKeyboardNav.js +115 -0
- package/dist/backend/dynamic-grid/hooks/useGridKeyboardNav.js.map +7 -0
- package/dist/backend/dynamic-grid/index.js +9 -0
- package/dist/backend/dynamic-grid/index.js.map +7 -0
- package/dist/backend/dynamic-grid/types.js +1 -0
- package/dist/backend/dynamic-grid/types.js.map +7 -0
- package/dist/backend/dynamic-table/DynamicTable.js +2607 -0
- package/dist/backend/dynamic-table/DynamicTable.js.map +7 -0
- package/dist/backend/dynamic-table/DynamicTable.stories.js +233 -0
- package/dist/backend/dynamic-table/DynamicTable.stories.js.map +7 -0
- package/dist/backend/dynamic-table/components/ActiveFilterChips.js +60 -0
- package/dist/backend/dynamic-table/components/ActiveFilterChips.js.map +7 -0
- package/dist/backend/dynamic-table/components/BulkActionsBar.js +58 -0
- package/dist/backend/dynamic-table/components/BulkActionsBar.js.map +7 -0
- package/dist/backend/dynamic-table/components/Cell.js +155 -0
- package/dist/backend/dynamic-table/components/Cell.js.map +7 -0
- package/dist/backend/dynamic-table/components/CellCommentDialog.js +726 -0
- package/dist/backend/dynamic-table/components/CellCommentDialog.js.map +7 -0
- package/dist/backend/dynamic-table/components/CellCommentHoverPopup.js +77 -0
- package/dist/backend/dynamic-table/components/CellCommentHoverPopup.js.map +7 -0
- package/dist/backend/dynamic-table/components/ColumnFilterPopover.js +485 -0
- package/dist/backend/dynamic-table/components/ColumnFilterPopover.js.map +7 -0
- package/dist/backend/dynamic-table/components/ColumnHeaderMenu.js +173 -0
- package/dist/backend/dynamic-table/components/ColumnHeaderMenu.js.map +7 -0
- package/dist/backend/dynamic-table/components/ColumnHeaders.js +528 -0
- package/dist/backend/dynamic-table/components/ColumnHeaders.js.map +7 -0
- package/dist/backend/dynamic-table/components/CompactLabelCell.js +64 -0
- package/dist/backend/dynamic-table/components/CompactLabelCell.js.map +7 -0
- package/dist/backend/dynamic-table/components/ConfigureViewFields.js +139 -0
- package/dist/backend/dynamic-table/components/ConfigureViewFields.js.map +7 -0
- package/dist/backend/dynamic-table/components/ConfigureViewFilters.js +305 -0
- package/dist/backend/dynamic-table/components/ConfigureViewFilters.js.map +7 -0
- package/dist/backend/dynamic-table/components/ConfigureViewFormatting.js +169 -0
- package/dist/backend/dynamic-table/components/ConfigureViewFormatting.js.map +7 -0
- package/dist/backend/dynamic-table/components/ConfigureViewFormulas.js +298 -0
- package/dist/backend/dynamic-table/components/ConfigureViewFormulas.js.map +7 -0
- package/dist/backend/dynamic-table/components/ConfigureViewGrouping.js +224 -0
- package/dist/backend/dynamic-table/components/ConfigureViewGrouping.js.map +7 -0
- package/dist/backend/dynamic-table/components/ConfigureViewLinkedColumns.js +167 -0
- package/dist/backend/dynamic-table/components/ConfigureViewLinkedColumns.js.map +7 -0
- package/dist/backend/dynamic-table/components/ConfigureViewPanel.js +592 -0
- package/dist/backend/dynamic-table/components/ConfigureViewPanel.js.map +7 -0
- package/dist/backend/dynamic-table/components/ConfigureViewRollups.js +269 -0
- package/dist/backend/dynamic-table/components/ConfigureViewRollups.js.map +7 -0
- package/dist/backend/dynamic-table/components/ConfigureViewSorting.js +107 -0
- package/dist/backend/dynamic-table/components/ConfigureViewSorting.js.map +7 -0
- package/dist/backend/dynamic-table/components/ContextMenu.js +91 -0
- package/dist/backend/dynamic-table/components/ContextMenu.js.map +7 -0
- package/dist/backend/dynamic-table/components/DateCell.js +80 -0
- package/dist/backend/dynamic-table/components/DateCell.js.map +7 -0
- package/dist/backend/dynamic-table/components/Debugger.js +311 -0
- package/dist/backend/dynamic-table/components/Debugger.js.map +7 -0
- package/dist/backend/dynamic-table/components/DensityControl.js +289 -0
- package/dist/backend/dynamic-table/components/DensityControl.js.map +7 -0
- package/dist/backend/dynamic-table/components/EmptyState.js +42 -0
- package/dist/backend/dynamic-table/components/EmptyState.js.map +7 -0
- package/dist/backend/dynamic-table/components/EntitySearchEditor.js +369 -0
- package/dist/backend/dynamic-table/components/EntitySearchEditor.js.map +7 -0
- package/dist/backend/dynamic-table/components/ExportMenu.js +63 -0
- package/dist/backend/dynamic-table/components/ExportMenu.js.map +7 -0
- package/dist/backend/dynamic-table/components/FilterDatePicker.js +165 -0
- package/dist/backend/dynamic-table/components/FilterDatePicker.js.map +7 -0
- package/dist/backend/dynamic-table/components/FilterValueInput.js +200 -0
- package/dist/backend/dynamic-table/components/FilterValueInput.js.map +7 -0
- package/dist/backend/dynamic-table/components/FooterTotalsRow.js +165 -0
- package/dist/backend/dynamic-table/components/FooterTotalsRow.js.map +7 -0
- package/dist/backend/dynamic-table/components/FullscreenOverlay.js +51 -0
- package/dist/backend/dynamic-table/components/FullscreenOverlay.js.map +7 -0
- package/dist/backend/dynamic-table/components/GroupHeaderRow.js +108 -0
- package/dist/backend/dynamic-table/components/GroupHeaderRow.js.map +7 -0
- package/dist/backend/dynamic-table/components/GroupSummaryRow.js +134 -0
- package/dist/backend/dynamic-table/components/GroupSummaryRow.js.map +7 -0
- package/dist/backend/dynamic-table/components/ImportPanel.js +341 -0
- package/dist/backend/dynamic-table/components/ImportPanel.js.map +7 -0
- package/dist/backend/dynamic-table/components/ImportPreviewGrid.js +114 -0
- package/dist/backend/dynamic-table/components/ImportPreviewGrid.js.map +7 -0
- package/dist/backend/dynamic-table/components/LoadErrorState.js +23 -0
- package/dist/backend/dynamic-table/components/LoadErrorState.js.map +7 -0
- package/dist/backend/dynamic-table/components/MentionPopup.js +149 -0
- package/dist/backend/dynamic-table/components/MentionPopup.js.map +7 -0
- package/dist/backend/dynamic-table/components/PerspectiveDeleteDialog.js +57 -0
- package/dist/backend/dynamic-table/components/PerspectiveDeleteDialog.js.map +7 -0
- package/dist/backend/dynamic-table/components/PerspectivePublishDialog.js +100 -0
- package/dist/backend/dynamic-table/components/PerspectivePublishDialog.js.map +7 -0
- package/dist/backend/dynamic-table/components/PerspectiveTabMenu.js +159 -0
- package/dist/backend/dynamic-table/components/PerspectiveTabMenu.js.map +7 -0
- package/dist/backend/dynamic-table/components/PerspectiveTabs.js +319 -0
- package/dist/backend/dynamic-table/components/PerspectiveTabs.js.map +7 -0
- package/dist/backend/dynamic-table/components/PerspectiveTemplateMenu.js +90 -0
- package/dist/backend/dynamic-table/components/PerspectiveTemplateMenu.js.map +7 -0
- package/dist/backend/dynamic-table/components/RowHeaderCell.js +58 -0
- package/dist/backend/dynamic-table/components/RowHeaderCell.js.map +7 -0
- package/dist/backend/dynamic-table/components/SearchBar.js +221 -0
- package/dist/backend/dynamic-table/components/SearchBar.js.map +7 -0
- package/dist/backend/dynamic-table/components/SelectMenu.js +186 -0
- package/dist/backend/dynamic-table/components/SelectMenu.js.map +7 -0
- package/dist/backend/dynamic-table/components/StaleDataBar.js +26 -0
- package/dist/backend/dynamic-table/components/StaleDataBar.js.map +7 -0
- package/dist/backend/dynamic-table/components/TableDeleteDialog.js +48 -0
- package/dist/backend/dynamic-table/components/TableDeleteDialog.js.map +7 -0
- package/dist/backend/dynamic-table/components/TablePagination.js +69 -0
- package/dist/backend/dynamic-table/components/TablePagination.js.map +7 -0
- package/dist/backend/dynamic-table/components/TableSkeleton.js +43 -0
- package/dist/backend/dynamic-table/components/TableSkeleton.js.map +7 -0
- package/dist/backend/dynamic-table/components/ToolbarOverflow.js +204 -0
- package/dist/backend/dynamic-table/components/ToolbarOverflow.js.map +7 -0
- package/dist/backend/dynamic-table/components/ViewModeSwitch.js +50 -0
- package/dist/backend/dynamic-table/components/ViewModeSwitch.js.map +7 -0
- package/dist/backend/dynamic-table/components/VirtualRow.js +214 -0
- package/dist/backend/dynamic-table/components/VirtualRow.js.map +7 -0
- package/dist/backend/dynamic-table/components/editors.js +1483 -0
- package/dist/backend/dynamic-table/components/editors.js.map +7 -0
- package/dist/backend/dynamic-table/components/renderers.js +131 -0
- package/dist/backend/dynamic-table/components/renderers.js.map +7 -0
- package/dist/backend/dynamic-table/events/events.js +73 -0
- package/dist/backend/dynamic-table/events/events.js.map +7 -0
- package/dist/backend/dynamic-table/formula/check.js +243 -0
- package/dist/backend/dynamic-table/formula/check.js.map +7 -0
- package/dist/backend/dynamic-table/formula/evaluate.js +302 -0
- package/dist/backend/dynamic-table/formula/evaluate.js.map +7 -0
- package/dist/backend/dynamic-table/formula/functions.js +602 -0
- package/dist/backend/dynamic-table/formula/functions.js.map +7 -0
- package/dist/backend/dynamic-table/formula/index.js +47 -0
- package/dist/backend/dynamic-table/formula/index.js.map +7 -0
- package/dist/backend/dynamic-table/formula/parse.js +293 -0
- package/dist/backend/dynamic-table/formula/parse.js.map +7 -0
- package/dist/backend/dynamic-table/formula/types.js +24 -0
- package/dist/backend/dynamic-table/formula/types.js.map +7 -0
- package/dist/backend/dynamic-table/handlers/cellWrites.js +143 -0
- package/dist/backend/dynamic-table/handlers/cellWrites.js.map +7 -0
- package/dist/backend/dynamic-table/handlers/index.js +504 -0
- package/dist/backend/dynamic-table/handlers/index.js.map +7 -0
- package/dist/backend/dynamic-table/handlers/perspectiveHandlers.js +377 -0
- package/dist/backend/dynamic-table/handlers/perspectiveHandlers.js.map +7 -0
- package/dist/backend/dynamic-table/hooks/index.js +524 -0
- package/dist/backend/dynamic-table/hooks/index.js.map +7 -0
- package/dist/backend/dynamic-table/hooks/useAbbreviations.js +19 -0
- package/dist/backend/dynamic-table/hooks/useAbbreviations.js.map +7 -0
- package/dist/backend/dynamic-table/hooks/useAnnotations.js +115 -0
- package/dist/backend/dynamic-table/hooks/useAnnotations.js.map +7 -0
- package/dist/backend/dynamic-table/hooks/useColumnVirtualizer.js +155 -0
- package/dist/backend/dynamic-table/hooks/useColumnVirtualizer.js.map +7 -0
- package/dist/backend/dynamic-table/hooks/useColumnWidthPersistence.js +135 -0
- package/dist/backend/dynamic-table/hooks/useColumnWidthPersistence.js.map +7 -0
- package/dist/backend/dynamic-table/hooks/useDensityPreference.js +203 -0
- package/dist/backend/dynamic-table/hooks/useDensityPreference.js.map +7 -0
- package/dist/backend/dynamic-table/hooks/useDynamicTablePage.js +1005 -0
- package/dist/backend/dynamic-table/hooks/useDynamicTablePage.js.map +7 -0
- package/dist/backend/dynamic-table/hooks/useEscapeLayer.js +32 -0
- package/dist/backend/dynamic-table/hooks/useEscapeLayer.js.map +7 -0
- package/dist/backend/dynamic-table/hooks/useGrouping.js +256 -0
- package/dist/backend/dynamic-table/hooks/useGrouping.js.map +7 -0
- package/dist/backend/dynamic-table/hooks/useSuggestionFetch.js +63 -0
- package/dist/backend/dynamic-table/hooks/useSuggestionFetch.js.map +7 -0
- package/dist/backend/dynamic-table/hooks/useTableDateFormat.js +11 -0
- package/dist/backend/dynamic-table/hooks/useTableDateFormat.js.map +7 -0
- package/dist/backend/dynamic-table/index.js +476 -0
- package/dist/backend/dynamic-table/index.js.map +7 -0
- package/dist/backend/dynamic-table/registry/ContentRegistryContext.js +126 -0
- package/dist/backend/dynamic-table/registry/ContentRegistryContext.js.map +7 -0
- package/dist/backend/dynamic-table/registry/TableRegistryContext.js +43 -0
- package/dist/backend/dynamic-table/registry/TableRegistryContext.js.map +7 -0
- package/dist/backend/dynamic-table/registry/filterAccessibleTables.js +13 -0
- package/dist/backend/dynamic-table/registry/filterAccessibleTables.js.map +7 -0
- package/dist/backend/dynamic-table/registry/index.js +44 -0
- package/dist/backend/dynamic-table/registry/index.js.map +7 -0
- package/dist/backend/dynamic-table/registry/lazyTable.js +55 -0
- package/dist/backend/dynamic-table/registry/lazyTable.js.map +7 -0
- package/dist/backend/dynamic-table/registry/types.js +1 -0
- package/dist/backend/dynamic-table/registry/types.js.map +7 -0
- package/dist/backend/dynamic-table/registry/widgetCatalog.js +96 -0
- package/dist/backend/dynamic-table/registry/widgetCatalog.js.map +7 -0
- package/dist/backend/dynamic-table/server/aggregate.js +261 -0
- package/dist/backend/dynamic-table/server/aggregate.js.map +7 -0
- package/dist/backend/dynamic-table/server/dateWindows.js +105 -0
- package/dist/backend/dynamic-table/server/dateWindows.js.map +7 -0
- package/dist/backend/dynamic-table/server/filterParser.js +97 -0
- package/dist/backend/dynamic-table/server/filterParser.js.map +7 -0
- package/dist/backend/dynamic-table/server/filterSuggestions.js +70 -0
- package/dist/backend/dynamic-table/server/filterSuggestions.js.map +7 -0
- package/dist/backend/dynamic-table/server/index.js +47 -0
- package/dist/backend/dynamic-table/server/index.js.map +7 -0
- package/dist/backend/dynamic-table/server/makeDynamicTableRoute.js +270 -0
- package/dist/backend/dynamic-table/server/makeDynamicTableRoute.js.map +7 -0
- package/dist/backend/dynamic-table/split-view/ContentPicker.js +171 -0
- package/dist/backend/dynamic-table/split-view/ContentPicker.js.map +7 -0
- package/dist/backend/dynamic-table/split-view/EmptySlot.js +47 -0
- package/dist/backend/dynamic-table/split-view/EmptySlot.js.map +7 -0
- package/dist/backend/dynamic-table/split-view/SplitViewHost.js +863 -0
- package/dist/backend/dynamic-table/split-view/SplitViewHost.js.map +7 -0
- package/dist/backend/dynamic-table/split-view/WidgetPane.js +280 -0
- package/dist/backend/dynamic-table/split-view/WidgetPane.js.map +7 -0
- package/dist/backend/dynamic-table/split-view/WorkspaceFilterBar.js +524 -0
- package/dist/backend/dynamic-table/split-view/WorkspaceFilterBar.js.map +7 -0
- package/dist/backend/dynamic-table/split-view/index.js +61 -0
- package/dist/backend/dynamic-table/split-view/index.js.map +7 -0
- package/dist/backend/dynamic-table/split-view/layoutPersistence.js +91 -0
- package/dist/backend/dynamic-table/split-view/layoutPersistence.js.map +7 -0
- package/dist/backend/dynamic-table/split-view/sharedCriteria.js +62 -0
- package/dist/backend/dynamic-table/split-view/sharedCriteria.js.map +7 -0
- package/dist/backend/dynamic-table/split-view/types.js +426 -0
- package/dist/backend/dynamic-table/split-view/types.js.map +7 -0
- package/dist/backend/dynamic-table/split-view/useSplitViewLayouts.js +79 -0
- package/dist/backend/dynamic-table/split-view/useSplitViewLayouts.js.map +7 -0
- package/dist/backend/dynamic-table/store/index.js +611 -0
- package/dist/backend/dynamic-table/store/index.js.map +7 -0
- package/dist/backend/dynamic-table/styles/ContextMenu.css.js +2 -0
- package/dist/backend/dynamic-table/styles/DynamicTable.css.js +2 -0
- package/dist/backend/dynamic-table/styles/DynamicTable.v2.css.js +2 -0
- package/dist/backend/dynamic-table/styles/SearchBar.css.js +2 -0
- package/dist/backend/dynamic-table/styles/dateCell.css.js +2 -0
- package/dist/backend/dynamic-table/styles/density.css.js +2 -0
- package/dist/backend/dynamic-table/types/density.js +29 -0
- package/dist/backend/dynamic-table/types/density.js.map +7 -0
- package/dist/backend/dynamic-table/types/filters.js +124 -0
- package/dist/backend/dynamic-table/types/filters.js.map +7 -0
- package/dist/backend/dynamic-table/types/grouping.js +34 -0
- package/dist/backend/dynamic-table/types/grouping.js.map +7 -0
- package/dist/backend/dynamic-table/types/import.js +7 -0
- package/dist/backend/dynamic-table/types/import.js.map +7 -0
- package/dist/backend/dynamic-table/types/index.js +46 -0
- package/dist/backend/dynamic-table/types/index.js.map +7 -0
- package/dist/backend/dynamic-table/types/perspective.js +79 -0
- package/dist/backend/dynamic-table/types/perspective.js.map +7 -0
- package/dist/backend/dynamic-table/types/rollup.js +13 -0
- package/dist/backend/dynamic-table/types/rollup.js.map +7 -0
- package/dist/backend/dynamic-table/utils/abbreviations.js +228 -0
- package/dist/backend/dynamic-table/utils/abbreviations.js.map +7 -0
- package/dist/backend/dynamic-table/utils/anchoredPosition.js +21 -0
- package/dist/backend/dynamic-table/utils/anchoredPosition.js.map +7 -0
- package/dist/backend/dynamic-table/utils/badgeAutoFit.js +35 -0
- package/dist/backend/dynamic-table/utils/badgeAutoFit.js.map +7 -0
- package/dist/backend/dynamic-table/utils/clipboard.js +172 -0
- package/dist/backend/dynamic-table/utils/clipboard.js.map +7 -0
- package/dist/backend/dynamic-table/utils/coerceCellValue.js +52 -0
- package/dist/backend/dynamic-table/utils/coerceCellValue.js.map +7 -0
- package/dist/backend/dynamic-table/utils/colorAdjacency.js +27 -0
- package/dist/backend/dynamic-table/utils/colorAdjacency.js.map +7 -0
- package/dist/backend/dynamic-table/utils/columnFill.js +36 -0
- package/dist/backend/dynamic-table/utils/columnFill.js.map +7 -0
- package/dist/backend/dynamic-table/utils/columnSpacerStyle.js +21 -0
- package/dist/backend/dynamic-table/utils/columnSpacerStyle.js.map +7 -0
- package/dist/backend/dynamic-table/utils/columnWindow.js +293 -0
- package/dist/backend/dynamic-table/utils/columnWindow.js.map +7 -0
- package/dist/backend/dynamic-table/utils/conditionalFormat.js +188 -0
- package/dist/backend/dynamic-table/utils/conditionalFormat.js.map +7 -0
- package/dist/backend/dynamic-table/utils/exportTable.js +82 -0
- package/dist/backend/dynamic-table/utils/exportTable.js.map +7 -0
- package/dist/backend/dynamic-table/utils/fillGeometry.js +92 -0
- package/dist/backend/dynamic-table/utils/fillGeometry.js.map +7 -0
- package/dist/backend/dynamic-table/utils/fillPatterns.js +241 -0
- package/dist/backend/dynamic-table/utils/fillPatterns.js.map +7 -0
- package/dist/backend/dynamic-table/utils/formatAggregate.js +82 -0
- package/dist/backend/dynamic-table/utils/formatAggregate.js.map +7 -0
- package/dist/backend/dynamic-table/utils/formatDateCompact.js +508 -0
- package/dist/backend/dynamic-table/utils/formatDateCompact.js.map +7 -0
- package/dist/backend/dynamic-table/utils/formatLabelCompact.js +312 -0
- package/dist/backend/dynamic-table/utils/formatLabelCompact.js.map +7 -0
- package/dist/backend/dynamic-table/utils/formulaColumns.js +158 -0
- package/dist/backend/dynamic-table/utils/formulaColumns.js.map +7 -0
- package/dist/backend/dynamic-table/utils/importMapping.js +118 -0
- package/dist/backend/dynamic-table/utils/importMapping.js.map +7 -0
- package/dist/backend/dynamic-table/utils/importParse.js +121 -0
- package/dist/backend/dynamic-table/utils/importParse.js.map +7 -0
- package/dist/backend/dynamic-table/utils/lookupColumns.js +28 -0
- package/dist/backend/dynamic-table/utils/lookupColumns.js.map +7 -0
- package/dist/backend/dynamic-table/utils/perspectiveTransforms.js +191 -0
- package/dist/backend/dynamic-table/utils/perspectiveTransforms.js.map +7 -0
- package/dist/backend/dynamic-table/utils/rollupColumns.js +81 -0
- package/dist/backend/dynamic-table/utils/rollupColumns.js.map +7 -0
- package/dist/backend/dynamic-table/validators/index.js +36 -0
- package/dist/backend/dynamic-table/validators/index.js.map +7 -0
- package/dist/backend/fields/registry.generated.js +8 -0
- package/dist/backend/fields/registry.generated.js.map +7 -0
- package/dist/backend/fields/registry.js +29 -0
- package/dist/backend/fields/registry.js.map +7 -0
- package/dist/backend/filters/AdvancedFilterBuilder.js +280 -0
- package/dist/backend/filters/AdvancedFilterBuilder.js.map +7 -0
- package/dist/backend/forms/ActionsDropdown.js +160 -0
- package/dist/backend/forms/ActionsDropdown.js.map +7 -0
- package/dist/backend/forms/FormActionButtons.js +59 -0
- package/dist/backend/forms/FormActionButtons.js.map +7 -0
- package/dist/backend/forms/FormFooter.js +18 -0
- package/dist/backend/forms/FormFooter.js.map +7 -0
- package/dist/backend/forms/FormHeader.js +125 -0
- package/dist/backend/forms/FormHeader.js.map +7 -0
- package/dist/backend/forms/index.js +11 -0
- package/dist/backend/forms/index.js.map +7 -0
- package/dist/backend/hooks/useAdvancedFilter.js +64 -0
- package/dist/backend/hooks/useAdvancedFilter.js.map +7 -0
- package/dist/backend/indexes/PartialIndexBanner.js +74 -0
- package/dist/backend/indexes/PartialIndexBanner.js.map +7 -0
- package/dist/backend/indexes/store.js +62 -0
- package/dist/backend/indexes/store.js.map +7 -0
- package/dist/backend/injection/ComponentOverrideProvider.js +55 -0
- package/dist/backend/injection/ComponentOverrideProvider.js.map +7 -0
- package/dist/backend/injection/InjectedField.js +166 -0
- package/dist/backend/injection/InjectedField.js.map +7 -0
- package/dist/backend/injection/InjectionSpot.js +323 -0
- package/dist/backend/injection/InjectionSpot.js.map +7 -0
- package/dist/backend/injection/InjectionWizard.js +256 -0
- package/dist/backend/injection/InjectionWizard.js.map +7 -0
- package/dist/backend/injection/PageInjectionBoundary.js +26 -0
- package/dist/backend/injection/PageInjectionBoundary.js.map +7 -0
- package/dist/backend/injection/SseEventIndicator.js +8 -0
- package/dist/backend/injection/SseEventIndicator.js.map +7 -0
- package/dist/backend/injection/StatusBadgeInjectionSpot.js +34 -0
- package/dist/backend/injection/StatusBadgeInjectionSpot.js.map +7 -0
- package/dist/backend/injection/StatusBadgeRenderer.js +58 -0
- package/dist/backend/injection/StatusBadgeRenderer.js.map +7 -0
- package/dist/backend/injection/WidgetSharedState.js +49 -0
- package/dist/backend/injection/WidgetSharedState.js.map +7 -0
- package/dist/backend/injection/WizardInjectionSpot.js +30 -0
- package/dist/backend/injection/WizardInjectionSpot.js.map +7 -0
- package/dist/backend/injection/eventBridge.js +129 -0
- package/dist/backend/injection/eventBridge.js.map +7 -0
- package/dist/backend/injection/helpers.js +26 -0
- package/dist/backend/injection/helpers.js.map +7 -0
- package/dist/backend/injection/mergeMenuItems.js +49 -0
- package/dist/backend/injection/mergeMenuItems.js.map +7 -0
- package/dist/backend/injection/mutationEvents.js +20 -0
- package/dist/backend/injection/mutationEvents.js.map +7 -0
- package/dist/backend/injection/resolveInjectedIcon.js +23 -0
- package/dist/backend/injection/resolveInjectedIcon.js.map +7 -0
- package/dist/backend/injection/spotIds.js +72 -0
- package/dist/backend/injection/spotIds.js.map +7 -0
- package/dist/backend/injection/useAppEvent.js +35 -0
- package/dist/backend/injection/useAppEvent.js.map +7 -0
- package/dist/backend/injection/useGuardedMutation.js +71 -0
- package/dist/backend/injection/useGuardedMutation.js.map +7 -0
- package/dist/backend/injection/useInjectedMenuItems.js +49 -0
- package/dist/backend/injection/useInjectedMenuItems.js.map +7 -0
- package/dist/backend/injection/useInjectionDataWidgets.js +36 -0
- package/dist/backend/injection/useInjectionDataWidgets.js.map +7 -0
- package/dist/backend/injection/useOperationProgress.js +64 -0
- package/dist/backend/injection/useOperationProgress.js.map +7 -0
- package/dist/backend/injection/useRegisteredComponent.js +89 -0
- package/dist/backend/injection/useRegisteredComponent.js.map +7 -0
- package/dist/backend/injection/useWidgetSharedState.js +26 -0
- package/dist/backend/injection/useWidgetSharedState.js.map +7 -0
- package/dist/backend/injection/visibility-utils.js +29 -0
- package/dist/backend/injection/visibility-utils.js.map +7 -0
- package/dist/backend/injection/widgetRegistry.js +55 -0
- package/dist/backend/injection/widgetRegistry.js.map +7 -0
- package/dist/backend/inputs/ComboboxInput.js +228 -0
- package/dist/backend/inputs/ComboboxInput.js.map +7 -0
- package/dist/backend/inputs/DatePicker.js +148 -0
- package/dist/backend/inputs/DatePicker.js.map +7 -0
- package/dist/backend/inputs/DateTimePicker.js +188 -0
- package/dist/backend/inputs/DateTimePicker.js.map +7 -0
- package/dist/backend/inputs/EventPatternInput.js +38 -0
- package/dist/backend/inputs/EventPatternInput.js.map +7 -0
- package/dist/backend/inputs/EventSelect.js +115 -0
- package/dist/backend/inputs/EventSelect.js.map +7 -0
- package/dist/backend/inputs/LookupSelect.js +197 -0
- package/dist/backend/inputs/LookupSelect.js.map +7 -0
- package/dist/backend/inputs/PhoneNumberField.js +133 -0
- package/dist/backend/inputs/PhoneNumberField.js.map +7 -0
- package/dist/backend/inputs/SwitchableMarkdownInput.js +73 -0
- package/dist/backend/inputs/SwitchableMarkdownInput.js.map +7 -0
- package/dist/backend/inputs/TagsInput.js +258 -0
- package/dist/backend/inputs/TagsInput.js.map +7 -0
- package/dist/backend/inputs/TimeInput.js +132 -0
- package/dist/backend/inputs/TimeInput.js.map +7 -0
- package/dist/backend/inputs/TimePicker.js +105 -0
- package/dist/backend/inputs/TimePicker.js.map +7 -0
- package/dist/backend/inputs/index.js +12 -0
- package/dist/backend/inputs/index.js.map +7 -0
- package/dist/backend/markdown/MarkdownContent.js +20 -0
- package/dist/backend/markdown/MarkdownContent.js.map +7 -0
- package/dist/backend/markdown/index.js +3 -0
- package/dist/backend/markdown/index.js.map +7 -0
- package/dist/backend/markdown/useMarkdownRemarkPlugins.js +33 -0
- package/dist/backend/markdown/useMarkdownRemarkPlugins.js.map +7 -0
- package/dist/backend/messages/MessageComposer.js +158 -0
- package/dist/backend/messages/MessageComposer.js.map +7 -0
- package/dist/backend/messages/MessageObjectDetail.js +81 -0
- package/dist/backend/messages/MessageObjectDetail.js.map +7 -0
- package/dist/backend/messages/MessageObjectPreview.js +48 -0
- package/dist/backend/messages/MessageObjectPreview.js.map +7 -0
- package/dist/backend/messages/MessageObjectRecordPicker.js +89 -0
- package/dist/backend/messages/MessageObjectRecordPicker.js.map +7 -0
- package/dist/backend/messages/MessagePrioritySelector.js +74 -0
- package/dist/backend/messages/MessagePrioritySelector.js.map +7 -0
- package/dist/backend/messages/MessagesIcon.js +22 -0
- package/dist/backend/messages/MessagesIcon.js.map +7 -0
- package/dist/backend/messages/SendObjectMessageDialog.js +65 -0
- package/dist/backend/messages/SendObjectMessageDialog.js.map +7 -0
- package/dist/backend/messages/index.js +17 -0
- package/dist/backend/messages/index.js.map +7 -0
- package/dist/backend/messages/message-compose-form-groups.js +333 -0
- package/dist/backend/messages/message-compose-form-groups.js.map +7 -0
- package/dist/backend/messages/message-composer.types.js +1 -0
- package/dist/backend/messages/message-composer.types.js.map +7 -0
- package/dist/backend/messages/message-priority.js +40 -0
- package/dist/backend/messages/message-priority.js.map +7 -0
- package/dist/backend/messages/useMessageCompose.js +488 -0
- package/dist/backend/messages/useMessageCompose.js.map +7 -0
- package/dist/backend/messages/useMessageComposeOperations.js +163 -0
- package/dist/backend/messages/useMessageComposeOperations.js.map +7 -0
- package/dist/backend/messages/useMessagesPoll.js +79 -0
- package/dist/backend/messages/useMessagesPoll.js.map +7 -0
- package/dist/backend/notifications/NotificationBell.js +83 -0
- package/dist/backend/notifications/NotificationBell.js.map +7 -0
- package/dist/backend/notifications/NotificationCountBadge.js +9 -0
- package/dist/backend/notifications/NotificationCountBadge.js.map +7 -0
- package/dist/backend/notifications/NotificationDispatcher.js +165 -0
- package/dist/backend/notifications/NotificationDispatcher.js.map +7 -0
- package/dist/backend/notifications/NotificationItem.js +187 -0
- package/dist/backend/notifications/NotificationItem.js.map +7 -0
- package/dist/backend/notifications/NotificationPanel.js +146 -0
- package/dist/backend/notifications/NotificationPanel.js.map +7 -0
- package/dist/backend/notifications/index.js +19 -0
- package/dist/backend/notifications/index.js.map +7 -0
- package/dist/backend/notifications/useNotificationActions.js +124 -0
- package/dist/backend/notifications/useNotificationActions.js.map +7 -0
- package/dist/backend/notifications/useNotificationEffect.js +13 -0
- package/dist/backend/notifications/useNotificationEffect.js.map +7 -0
- package/dist/backend/notifications/useNotifications.js +11 -0
- package/dist/backend/notifications/useNotifications.js.map +7 -0
- package/dist/backend/notifications/useNotificationsPoll.js +135 -0
- package/dist/backend/notifications/useNotificationsPoll.js.map +7 -0
- package/dist/backend/notifications/useNotificationsSse.js +173 -0
- package/dist/backend/notifications/useNotificationsSse.js.map +7 -0
- package/dist/backend/operations/LastOperationBanner.js +80 -0
- package/dist/backend/operations/LastOperationBanner.js.map +7 -0
- package/dist/backend/operations/store.js +183 -0
- package/dist/backend/operations/store.js.map +7 -0
- package/dist/backend/progress/ProgressTopBar.js +129 -0
- package/dist/backend/progress/ProgressTopBar.js.map +7 -0
- package/dist/backend/progress/useProgress.js +11 -0
- package/dist/backend/progress/useProgress.js.map +7 -0
- package/dist/backend/progress/useProgressPoll.js +69 -0
- package/dist/backend/progress/useProgressPoll.js.map +7 -0
- package/dist/backend/progress/useProgressSse.js +104 -0
- package/dist/backend/progress/useProgressSse.js.map +7 -0
- package/dist/backend/schedule/ScheduleAgenda.js +107 -0
- package/dist/backend/schedule/ScheduleAgenda.js.map +7 -0
- package/dist/backend/schedule/ScheduleGrid.js +107 -0
- package/dist/backend/schedule/ScheduleGrid.js.map +7 -0
- package/dist/backend/schedule/ScheduleToolbar.js +166 -0
- package/dist/backend/schedule/ScheduleToolbar.js.map +7 -0
- package/dist/backend/schedule/ScheduleView.js +168 -0
- package/dist/backend/schedule/ScheduleView.js.map +7 -0
- package/dist/backend/schedule/index.js +6 -0
- package/dist/backend/schedule/index.js.map +7 -0
- package/dist/backend/schedule/recurrence.js +83 -0
- package/dist/backend/schedule/recurrence.js.map +7 -0
- package/dist/backend/schedule/types.js +1 -0
- package/dist/backend/schedule/types.js.map +7 -0
- package/dist/backend/section-page/SectionNav.js +104 -0
- package/dist/backend/section-page/SectionNav.js.map +7 -0
- package/dist/backend/section-page/SectionPage.js +33 -0
- package/dist/backend/section-page/SectionPage.js.map +7 -0
- package/dist/backend/section-page/index.js +7 -0
- package/dist/backend/section-page/index.js.map +7 -0
- package/dist/backend/section-page/types.js +1 -0
- package/dist/backend/section-page/types.js.map +7 -0
- package/dist/backend/settings/SettingsNavigation.js +43 -0
- package/dist/backend/settings/SettingsNavigation.js.map +7 -0
- package/dist/backend/settings/SettingsPageWrapper.js +66 -0
- package/dist/backend/settings/SettingsPageWrapper.js.map +7 -0
- package/dist/backend/settings/index.js +6 -0
- package/dist/backend/settings/index.js.map +7 -0
- package/dist/backend/upgrades/UpgradeActionBanner.js +91 -0
- package/dist/backend/upgrades/UpgradeActionBanner.js.map +7 -0
- package/dist/backend/utils/api.js +178 -0
- package/dist/backend/utils/api.js.map +7 -0
- package/dist/backend/utils/apiCall.js +68 -0
- package/dist/backend/utils/apiCall.js.map +7 -0
- package/dist/backend/utils/crud.js +126 -0
- package/dist/backend/utils/crud.js.map +7 -0
- package/dist/backend/utils/customFieldColumns.js +100 -0
- package/dist/backend/utils/customFieldColumns.js.map +7 -0
- package/dist/backend/utils/customFieldDefs.js +143 -0
- package/dist/backend/utils/customFieldDefs.js.map +7 -0
- package/dist/backend/utils/customFieldFilters.js +151 -0
- package/dist/backend/utils/customFieldFilters.js.map +7 -0
- package/dist/backend/utils/customFieldForms.js +169 -0
- package/dist/backend/utils/customFieldForms.js.map +7 -0
- package/dist/backend/utils/customFieldRelationDisplay.js +239 -0
- package/dist/backend/utils/customFieldRelationDisplay.js.map +7 -0
- package/dist/backend/utils/customFieldValues.js +26 -0
- package/dist/backend/utils/customFieldValues.js.map +7 -0
- package/dist/backend/utils/flash.js +16 -0
- package/dist/backend/utils/flash.js.map +7 -0
- package/dist/backend/utils/nav.js +280 -0
- package/dist/backend/utils/nav.js.map +7 -0
- package/dist/backend/utils/richTextSanitizer.js +11 -0
- package/dist/backend/utils/richTextSanitizer.js.map +7 -0
- package/dist/backend/utils/scopedHeaderStack.js +44 -0
- package/dist/backend/utils/scopedHeaderStack.js.map +7 -0
- package/dist/backend/utils/serverErrors.js +237 -0
- package/dist/backend/utils/serverErrors.js.map +7 -0
- package/dist/backend/utils/useAutoDiscoveredFields.js +96 -0
- package/dist/backend/utils/useAutoDiscoveredFields.js.map +7 -0
- package/dist/backend/version-history/VersionHistoryAction.js +67 -0
- package/dist/backend/version-history/VersionHistoryAction.js.map +7 -0
- package/dist/backend/version-history/VersionHistoryDetail.js +57 -0
- package/dist/backend/version-history/VersionHistoryDetail.js.map +7 -0
- package/dist/backend/version-history/VersionHistoryPanel.js +270 -0
- package/dist/backend/version-history/VersionHistoryPanel.js.map +7 -0
- package/dist/backend/version-history/index.js +13 -0
- package/dist/backend/version-history/index.js.map +7 -0
- package/dist/backend/version-history/labels.js +52 -0
- package/dist/backend/version-history/labels.js.map +7 -0
- package/dist/backend/version-history/types.js +1 -0
- package/dist/backend/version-history/types.js.map +7 -0
- package/dist/backend/version-history/useAuditPermissions.js +72 -0
- package/dist/backend/version-history/useAuditPermissions.js.map +7 -0
- package/dist/backend/version-history/useVersionHistory.js +141 -0
- package/dist/backend/version-history/useVersionHistory.js.map +7 -0
- package/dist/backend/views/NewViewForm.js +56 -0
- package/dist/backend/views/NewViewForm.js.map +7 -0
- package/dist/backend/views/ShareForm.js +49 -0
- package/dist/backend/views/ShareForm.js.map +7 -0
- package/dist/backend/views/ViewChip.js +112 -0
- package/dist/backend/views/ViewChip.js.map +7 -0
- package/dist/backend/views/ViewChipMenu.js +89 -0
- package/dist/backend/views/ViewChipMenu.js.map +7 -0
- package/dist/backend/views/types.js +1 -0
- package/dist/backend/views/types.js.map +7 -0
- package/dist/frontend/AuthFooter.js +23 -0
- package/dist/frontend/AuthFooter.js.map +7 -0
- package/dist/frontend/LanguageSwitcher.js +57 -0
- package/dist/frontend/LanguageSwitcher.js.map +7 -0
- package/dist/frontend/Layout.js +14 -0
- package/dist/frontend/Layout.js.map +7 -0
- package/dist/hooks/useIsMobile.js +21 -0
- package/dist/hooks/useIsMobile.js.map +7 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +7 -0
- package/dist/portal/PortalContext.js +113 -0
- package/dist/portal/PortalContext.js.map +7 -0
- package/dist/portal/PortalLayoutProvider.js +5 -0
- package/dist/portal/PortalLayoutProvider.js.map +7 -0
- package/dist/portal/PortalLayoutShell.js +44 -0
- package/dist/portal/PortalLayoutShell.js.map +7 -0
- package/dist/portal/PortalShell.js +229 -0
- package/dist/portal/PortalShell.js.map +7 -0
- package/dist/portal/components/PortalCard.js +31 -0
- package/dist/portal/components/PortalCard.js.map +7 -0
- package/dist/portal/components/PortalEmptyState.js +16 -0
- package/dist/portal/components/PortalEmptyState.js.map +7 -0
- package/dist/portal/components/PortalFeatureCard.js +21 -0
- package/dist/portal/components/PortalFeatureCard.js.map +7 -0
- package/dist/portal/components/PortalNotificationBell.js +67 -0
- package/dist/portal/components/PortalNotificationBell.js.map +7 -0
- package/dist/portal/components/PortalNotificationPanel.js +158 -0
- package/dist/portal/components/PortalNotificationPanel.js.map +7 -0
- package/dist/portal/components/PortalPageHeader.js +16 -0
- package/dist/portal/components/PortalPageHeader.js.map +7 -0
- package/dist/portal/components/index.js +18 -0
- package/dist/portal/components/index.js.map +7 -0
- package/dist/portal/hooks/useCustomerAuth.js +69 -0
- package/dist/portal/hooks/useCustomerAuth.js.map +7 -0
- package/dist/portal/hooks/usePortalAppEvent.js +26 -0
- package/dist/portal/hooks/usePortalAppEvent.js.map +7 -0
- package/dist/portal/hooks/usePortalDashboardWidgets.js +37 -0
- package/dist/portal/hooks/usePortalDashboardWidgets.js.map +7 -0
- package/dist/portal/hooks/usePortalEventBridge.js +129 -0
- package/dist/portal/hooks/usePortalEventBridge.js.map +7 -0
- package/dist/portal/hooks/usePortalInjectedMenuItems.js +88 -0
- package/dist/portal/hooks/usePortalInjectedMenuItems.js.map +7 -0
- package/dist/portal/hooks/usePortalNotifications.js +85 -0
- package/dist/portal/hooks/usePortalNotifications.js.map +7 -0
- package/dist/portal/hooks/useTenantContext.js +53 -0
- package/dist/portal/hooks/useTenantContext.js.map +7 -0
- package/dist/primitives/DataLoader.js +68 -0
- package/dist/primitives/DataLoader.js.map +7 -0
- package/dist/primitives/ErrorNotice.js +14 -0
- package/dist/primitives/ErrorNotice.js.map +7 -0
- package/dist/primitives/Notice.js +55 -0
- package/dist/primitives/Notice.js.map +7 -0
- package/dist/primitives/alert.js +38 -0
- package/dist/primitives/alert.js.map +7 -0
- package/dist/primitives/badge.js +33 -0
- package/dist/primitives/badge.js.map +7 -0
- package/dist/primitives/button.js +45 -0
- package/dist/primitives/button.js.map +7 -0
- package/dist/primitives/calendar.js +62 -0
- package/dist/primitives/calendar.js.map +7 -0
- package/dist/primitives/card.js +91 -0
- package/dist/primitives/card.js.map +7 -0
- package/dist/primitives/checkbox.js +28 -0
- package/dist/primitives/checkbox.js.map +7 -0
- package/dist/primitives/dialog.js +101 -0
- package/dist/primitives/dialog.js.map +7 -0
- package/dist/primitives/form-field.js +78 -0
- package/dist/primitives/form-field.js.map +7 -0
- package/dist/primitives/icon-button.js +40 -0
- package/dist/primitives/icon-button.js.map +7 -0
- package/dist/primitives/input.js +22 -0
- package/dist/primitives/input.js.map +7 -0
- package/dist/primitives/label.js +21 -0
- package/dist/primitives/label.js.map +7 -0
- package/dist/primitives/popover.js +36 -0
- package/dist/primitives/popover.js.map +7 -0
- package/dist/primitives/primitives.stories.js +187 -0
- package/dist/primitives/primitives.stories.js.map +7 -0
- package/dist/primitives/progress.js +28 -0
- package/dist/primitives/progress.js.map +7 -0
- package/dist/primitives/separator.js +9 -0
- package/dist/primitives/separator.js.map +7 -0
- package/dist/primitives/sheet.js +103 -0
- package/dist/primitives/sheet.js.map +7 -0
- package/dist/primitives/spinner.js +24 -0
- package/dist/primitives/spinner.js.map +7 -0
- package/dist/primitives/status-badge.js +38 -0
- package/dist/primitives/status-badge.js.map +7 -0
- package/dist/primitives/switch.js +80 -0
- package/dist/primitives/switch.js.map +7 -0
- package/dist/primitives/table.js +29 -0
- package/dist/primitives/table.js.map +7 -0
- package/dist/primitives/tabs.js +90 -0
- package/dist/primitives/tabs.js.map +7 -0
- package/dist/primitives/textarea.js +21 -0
- package/dist/primitives/textarea.js.map +7 -0
- package/dist/primitives/tooltip.js +60 -0
- package/dist/primitives/tooltip.js.map +7 -0
- package/dist/primitives-v2/Alert.js +69 -0
- package/dist/primitives-v2/Alert.js.map +7 -0
- package/dist/primitives-v2/Alert.stories.js +42 -0
- package/dist/primitives-v2/Alert.stories.js.map +7 -0
- package/dist/primitives-v2/Avatar.js +93 -0
- package/dist/primitives-v2/Avatar.js.map +7 -0
- package/dist/primitives-v2/Avatar.stories.js +57 -0
- package/dist/primitives-v2/Avatar.stories.js.map +7 -0
- package/dist/primitives-v2/Badge.js +50 -0
- package/dist/primitives-v2/Badge.js.map +7 -0
- package/dist/primitives-v2/Badge.stories.js +66 -0
- package/dist/primitives-v2/Badge.stories.js.map +7 -0
- package/dist/primitives-v2/Breadcrumb.js +53 -0
- package/dist/primitives-v2/Breadcrumb.js.map +7 -0
- package/dist/primitives-v2/Breadcrumb.stories.js +70 -0
- package/dist/primitives-v2/Breadcrumb.stories.js.map +7 -0
- package/dist/primitives-v2/Button.js +85 -0
- package/dist/primitives-v2/Button.js.map +7 -0
- package/dist/primitives-v2/Button.stories.js +48 -0
- package/dist/primitives-v2/Button.stories.js.map +7 -0
- package/dist/primitives-v2/Checkbox.js +65 -0
- package/dist/primitives-v2/Checkbox.js.map +7 -0
- package/dist/primitives-v2/Checkbox.stories.js +31 -0
- package/dist/primitives-v2/Checkbox.stories.js.map +7 -0
- package/dist/primitives-v2/IconButton.js +13 -0
- package/dist/primitives-v2/IconButton.js.map +7 -0
- package/dist/primitives-v2/IconButton.stories.js +37 -0
- package/dist/primitives-v2/IconButton.stories.js.map +7 -0
- package/dist/primitives-v2/Input.js +74 -0
- package/dist/primitives-v2/Input.js.map +7 -0
- package/dist/primitives-v2/Input.stories.js +56 -0
- package/dist/primitives-v2/Input.stories.js.map +7 -0
- package/dist/primitives-v2/NavGroup.js +54 -0
- package/dist/primitives-v2/NavGroup.js.map +7 -0
- package/dist/primitives-v2/NavGroup.stories.js +39 -0
- package/dist/primitives-v2/NavGroup.stories.js.map +7 -0
- package/dist/primitives-v2/NavItem.js +61 -0
- package/dist/primitives-v2/NavItem.js.map +7 -0
- package/dist/primitives-v2/NavItem.stories.js +56 -0
- package/dist/primitives-v2/NavItem.stories.js.map +7 -0
- package/dist/primitives-v2/SearchInput.js +93 -0
- package/dist/primitives-v2/SearchInput.js.map +7 -0
- package/dist/primitives-v2/SearchInput.stories.js +41 -0
- package/dist/primitives-v2/SearchInput.stories.js.map +7 -0
- package/dist/primitives-v2/Sidebar.js +48 -0
- package/dist/primitives-v2/Sidebar.js.map +7 -0
- package/dist/primitives-v2/Sidebar.stories.js +76 -0
- package/dist/primitives-v2/Sidebar.stories.js.map +7 -0
- package/dist/primitives-v2/Tab.js +78 -0
- package/dist/primitives-v2/Tab.js.map +7 -0
- package/dist/primitives-v2/Tab.stories.js +51 -0
- package/dist/primitives-v2/Tab.stories.js.map +7 -0
- package/dist/primitives-v2/Tag.js +61 -0
- package/dist/primitives-v2/Tag.js.map +7 -0
- package/dist/primitives-v2/Tag.stories.js +121 -0
- package/dist/primitives-v2/Tag.stories.js.map +7 -0
- package/dist/primitives-v2/Toggle.js +72 -0
- package/dist/primitives-v2/Toggle.js.map +7 -0
- package/dist/primitives-v2/Toggle.stories.js +34 -0
- package/dist/primitives-v2/Toggle.stories.js.map +7 -0
- package/dist/primitives-v2/Topbar.js +24 -0
- package/dist/primitives-v2/Topbar.js.map +7 -0
- package/dist/primitives-v2/Topbar.stories.js +58 -0
- package/dist/primitives-v2/Topbar.stories.js.map +7 -0
- package/dist/primitives-v2/index.js +41 -0
- package/dist/primitives-v2/index.js.map +7 -0
- package/dist/primitives-v2/utils.js +7 -0
- package/dist/primitives-v2/utils.js.map +7 -0
- package/dist/theme/BrandThemeProvider.js +49 -0
- package/dist/theme/BrandThemeProvider.js.map +7 -0
- package/dist/theme/QueryProvider.js +44 -0
- package/dist/theme/QueryProvider.js.map +7 -0
- package/dist/theme/ThemeProvider.js +96 -0
- package/dist/theme/ThemeProvider.js.map +7 -0
- package/dist/theme/ThemeToggle.js +88 -0
- package/dist/theme/ThemeToggle.js.map +7 -0
- package/dist/theme/index.js +12 -0
- package/dist/theme/index.js.map +7 -0
- package/dist/theme/m3.css.js +2 -0
- package/dist/theme/tokens.v2.css.js +2 -0
- package/dist/theme/typography.css.js +2 -0
- package/dist/theme/typography.stories.js +123 -0
- package/dist/theme/typography.stories.js.map +7 -0
- package/dist/theme/typography.tokens.js +281 -0
- package/dist/theme/typography.tokens.js.map +7 -0
- package/dist/types/react-big-calendar.d.js +1 -0
- package/dist/types/react-big-calendar.d.js.map +7 -0
- package/package.json +411 -0
- package/src/backend/AppShell.tsx +1606 -0
- package/src/backend/BackendChromeProvider.tsx +99 -0
- package/src/backend/BackendPageSurface.tsx +57 -0
- package/src/backend/CollapsibleNavSection.tsx +201 -0
- package/src/backend/ContextHelp.tsx +40 -0
- package/src/backend/CrudForm.tsx +3796 -0
- package/src/backend/DataTable.tsx +2584 -0
- package/src/backend/EmptyState.tsx +65 -0
- package/src/backend/FilterBar.tsx +171 -0
- package/src/backend/FilterOverlay.tsx +388 -0
- package/src/backend/FlashMessages.tsx +189 -0
- package/src/backend/HtmlRichTextEditor.tsx +124 -0
- package/src/backend/IntegrationsButton.tsx +29 -0
- package/src/backend/JsonBuilder.tsx +359 -0
- package/src/backend/JsonDisplay.tsx +258 -0
- package/src/backend/NextStepCallout.tsx +134 -0
- package/src/backend/Page.tsx +30 -0
- package/src/backend/PerspectiveSidebar.tsx +506 -0
- package/src/backend/ProfileDropdown.tsx +369 -0
- package/src/backend/RowActions.tsx +158 -0
- package/src/backend/SectionHeader.tsx +119 -0
- package/src/backend/SettingsButton.tsx +28 -0
- package/src/backend/Sidebar.stories.tsx +183 -0
- package/src/backend/Sidebar.tsx +737 -0
- package/src/backend/TruncatedCell.tsx +133 -0
- package/src/backend/UserMenu.tsx +153 -0
- package/src/backend/ValueIcons.tsx +48 -0
- package/src/backend/WebhookSetupGuide.tsx +127 -0
- package/src/backend/__tests__/AppShell.test.tsx +392 -0
- package/src/backend/__tests__/CrudForm.custom-fields.test.tsx +180 -0
- package/src/backend/__tests__/CrudForm.datetime.test.tsx +95 -0
- package/src/backend/__tests__/CrudForm.defaults.test.tsx +195 -0
- package/src/backend/__tests__/CrudForm.navigation.test.tsx +156 -0
- package/src/backend/__tests__/CrudForm.render.test.tsx +146 -0
- package/src/backend/__tests__/CrudForm.transformData.test.tsx +231 -0
- package/src/backend/__tests__/CrudForm.unsavedNavigation.test.tsx +145 -0
- package/src/backend/__tests__/CrudForm.validation.test.tsx +178 -0
- package/src/backend/__tests__/CustomDataSection.test.tsx +465 -0
- package/src/backend/__tests__/DataTable.extensions.test.tsx +339 -0
- package/src/backend/__tests__/DataTable.namespaces.test.ts +32 -0
- package/src/backend/__tests__/DataTable.render.test.tsx +48 -0
- package/src/backend/__tests__/FieldDefinitionsEditor.test.tsx +64 -0
- package/src/backend/__tests__/FlashMessages.test.tsx +105 -0
- package/src/backend/__tests__/FormHeader.test.tsx +81 -0
- package/src/backend/__tests__/NotificationDispatcher.test.ts +172 -0
- package/src/backend/__tests__/VersionHistoryPanel.test.tsx +109 -0
- package/src/backend/__tests__/component-replacement.test.tsx +270 -0
- package/src/backend/__tests__/custom-field-filters.test.ts +72 -0
- package/src/backend/__tests__/custom-field-forms.test.ts +54 -0
- package/src/backend/__tests__/nav-utils.test.ts +175 -0
- package/src/backend/__tests__/serverErrors.test.ts +83 -0
- package/src/backend/__tests__/useAuditPermissions.test.tsx +51 -0
- package/src/backend/__tests__/useNotifications.strategy.test.ts +58 -0
- package/src/backend/__tests__/useProgress.strategy.test.ts +62 -0
- package/src/backend/charts/BarChart.tsx +208 -0
- package/src/backend/charts/ChartUtils.tsx +196 -0
- package/src/backend/charts/ComboChart.stories.tsx +103 -0
- package/src/backend/charts/ComboChart.tsx +350 -0
- package/src/backend/charts/KpiCard.tsx +155 -0
- package/src/backend/charts/LineChart.tsx +207 -0
- package/src/backend/charts/PieChart.tsx +157 -0
- package/src/backend/charts/ScatterChart.tsx +498 -0
- package/src/backend/charts/TopNTable.tsx +141 -0
- package/src/backend/charts/WaterfallChart.tsx +213 -0
- package/src/backend/charts/index.ts +21 -0
- package/src/backend/columns/ColumnChooserPanel.tsx +293 -0
- package/src/backend/confirm-dialog/ConfirmDialog.tsx +275 -0
- package/src/backend/confirm-dialog/index.ts +7 -0
- package/src/backend/confirm-dialog/useConfirmDialog.tsx +146 -0
- package/src/backend/custom-fields/FieldDefinitionsEditor.tsx +1413 -0
- package/src/backend/custom-fields/FieldDefinitionsManager.tsx +381 -0
- package/src/backend/dashboard/DashboardScreen.tsx +706 -0
- package/src/backend/dashboard/__tests__/DashboardScreen.test.tsx +114 -0
- package/src/backend/dashboard/index.ts +1 -0
- package/src/backend/dashboard/widgetRegistry.ts +68 -0
- package/src/backend/date-range/DateRangeSelect.tsx +50 -0
- package/src/backend/date-range/InlineDateRangeSelect.tsx +52 -0
- package/src/backend/date-range/InlineGranularitySelect.tsx +63 -0
- package/src/backend/date-range/__tests__/dateRanges.test.ts +224 -0
- package/src/backend/date-range/dateRanges.ts +218 -0
- package/src/backend/date-range/index.ts +15 -0
- package/src/backend/detail/AccessDeniedMessage.tsx +32 -0
- package/src/backend/detail/ActivitiesSection.tsx +1261 -0
- package/src/backend/detail/AddressEditor.tsx +479 -0
- package/src/backend/detail/AddressTiles.tsx +591 -0
- package/src/backend/detail/AddressesSection.tsx +362 -0
- package/src/backend/detail/AttachmentDeleteDialog.tsx +56 -0
- package/src/backend/detail/AttachmentMetadataDialog.tsx +674 -0
- package/src/backend/detail/AttachmentVisualPreview.tsx +155 -0
- package/src/backend/detail/AttachmentsSection.tsx +327 -0
- package/src/backend/detail/CustomDataSection.tsx +700 -0
- package/src/backend/detail/DetailFieldsSection.tsx +163 -0
- package/src/backend/detail/ErrorMessage.tsx +32 -0
- package/src/backend/detail/InlineEditors.tsx +894 -0
- package/src/backend/detail/LoadingMessage.tsx +14 -0
- package/src/backend/detail/NotesSection.tsx +1266 -0
- package/src/backend/detail/TabEmptyState.tsx +48 -0
- package/src/backend/detail/TagsSection.tsx +470 -0
- package/src/backend/detail/__tests__/InlineEditors.test.tsx +59 -0
- package/src/backend/detail/addressFormat.tsx +121 -0
- package/src/backend/detail/index.ts +46 -0
- package/src/backend/devtools/UmesDevToolsPanel.tsx +122 -0
- package/src/backend/devtools/components/ConflictWarnings.tsx +36 -0
- package/src/backend/devtools/components/EnricherTiming.tsx +50 -0
- package/src/backend/devtools/components/EventFlow.tsx +45 -0
- package/src/backend/devtools/components/ExtensionPointList.tsx +59 -0
- package/src/backend/devtools/components/InterceptorActivity.tsx +48 -0
- package/src/backend/devtools/index.ts +2 -0
- package/src/backend/devtools/useUmesDevTools.ts +188 -0
- package/src/backend/document-viewer/RegionOverlay.tsx +150 -0
- package/src/backend/document-viewer/index.ts +2 -0
- package/src/backend/dynamic-grid/DynamicGrid.tsx +161 -0
- package/src/backend/dynamic-grid/adapters.ts +57 -0
- package/src/backend/dynamic-grid/components/GridCell.tsx +194 -0
- package/src/backend/dynamic-grid/components/GridRow.tsx +40 -0
- package/src/backend/dynamic-grid/hooks/useGridKeyboardNav.ts +134 -0
- package/src/backend/dynamic-grid/index.ts +4 -0
- package/src/backend/dynamic-grid/types.ts +55 -0
- package/src/backend/dynamic-table/DynamicTable.stories.tsx +274 -0
- package/src/backend/dynamic-table/DynamicTable.tsx +4419 -0
- package/src/backend/dynamic-table/README.md +1199 -0
- package/src/backend/dynamic-table/URL_FILTERING.md +217 -0
- package/src/backend/dynamic-table/__e2e__/GridHarness.ts +1155 -0
- package/src/backend/dynamic-table/__e2e__/SplitViewHarness.ts +366 -0
- package/src/backend/dynamic-table/__tests__/BulkActionsBar.test.tsx +143 -0
- package/src/backend/dynamic-table/__tests__/ColumnQuickFilter.test.tsx +607 -0
- package/src/backend/dynamic-table/__tests__/ConfigureViewFilters.suggestions.test.tsx +177 -0
- package/src/backend/dynamic-table/__tests__/ConfigureViewFormatting.test.tsx +125 -0
- package/src/backend/dynamic-table/__tests__/ConfigureViewFormulas.test.tsx +228 -0
- package/src/backend/dynamic-table/__tests__/ConfigureViewGrouping.aggregations.test.tsx +131 -0
- package/src/backend/dynamic-table/__tests__/ConfigureViewPanel.baseView.test.tsx +162 -0
- package/src/backend/dynamic-table/__tests__/ConfigureViewPanel.focus.test.tsx +54 -0
- package/src/backend/dynamic-table/__tests__/ConfigureViewPanel.sections.test.tsx +142 -0
- package/src/backend/dynamic-table/__tests__/ConfigureViewRollups.test.tsx +228 -0
- package/src/backend/dynamic-table/__tests__/ContextMenu.test.tsx +89 -0
- package/src/backend/dynamic-table/__tests__/DynamicTable.density.test.tsx +299 -0
- package/src/backend/dynamic-table/__tests__/DynamicTable.exportTruncation.test.tsx +145 -0
- package/src/backend/dynamic-table/__tests__/DynamicTable.loadError.test.tsx +173 -0
- package/src/backend/dynamic-table/__tests__/DynamicTable.wiring.test.tsx +357 -0
- package/src/backend/dynamic-table/__tests__/EmptyState.test.tsx +70 -0
- package/src/backend/dynamic-table/__tests__/ExportMenu.test.tsx +82 -0
- package/src/backend/dynamic-table/__tests__/FooterTotalsRow.test.tsx +154 -0
- package/src/backend/dynamic-table/__tests__/GroupSummaryRow.render.test.tsx +131 -0
- package/src/backend/dynamic-table/__tests__/LoadErrorState.test.tsx +74 -0
- package/src/backend/dynamic-table/__tests__/MentionPopup.search.test.tsx +127 -0
- package/src/backend/dynamic-table/__tests__/PerspectiveTabs.test.tsx +170 -0
- package/src/backend/dynamic-table/__tests__/RowHeaderCell.selection.test.tsx +80 -0
- package/src/backend/dynamic-table/__tests__/abbreviationsSubscription.test.ts +171 -0
- package/src/backend/dynamic-table/__tests__/aggregate.spec.test.ts +224 -0
- package/src/backend/dynamic-table/__tests__/aggregateDimension.test.tsx +191 -0
- package/src/backend/dynamic-table/__tests__/anchoredPosition.test.ts +88 -0
- package/src/backend/dynamic-table/__tests__/badgeAutoFit.test.ts +121 -0
- package/src/backend/dynamic-table/__tests__/cellHandlers.save.test.ts +282 -0
- package/src/backend/dynamic-table/__tests__/cellWrites.test.ts +274 -0
- package/src/backend/dynamic-table/__tests__/clipboard.test.ts +230 -0
- package/src/backend/dynamic-table/__tests__/coerceCellValue.test.ts +117 -0
- package/src/backend/dynamic-table/__tests__/colorAdjacency.test.ts +151 -0
- package/src/backend/dynamic-table/__tests__/columnFill.test.ts +66 -0
- package/src/backend/dynamic-table/__tests__/columnHeaderHandlers.sort.test.ts +100 -0
- package/src/backend/dynamic-table/__tests__/columnHeaderReorder.test.tsx +209 -0
- package/src/backend/dynamic-table/__tests__/columnReorderPersistence.test.tsx +127 -0
- package/src/backend/dynamic-table/__tests__/columnVirtualization.render.test.tsx +420 -0
- package/src/backend/dynamic-table/__tests__/columnVisibilityPersistence.test.tsx +136 -0
- package/src/backend/dynamic-table/__tests__/columnWindow.test.ts +643 -0
- package/src/backend/dynamic-table/__tests__/commentAudience.test.tsx +137 -0
- package/src/backend/dynamic-table/__tests__/commentScope.test.tsx +214 -0
- package/src/backend/dynamic-table/__tests__/conditionalFormat.test.ts +175 -0
- package/src/backend/dynamic-table/__tests__/contentRegistry.test.ts +267 -0
- package/src/backend/dynamic-table/__tests__/dateWindows.test.ts +149 -0
- package/src/backend/dynamic-table/__tests__/density.test.ts +204 -0
- package/src/backend/dynamic-table/__tests__/exportTable.test.ts +146 -0
- package/src/backend/dynamic-table/__tests__/fillGeometry.test.ts +201 -0
- package/src/backend/dynamic-table/__tests__/fillPatterns.test.ts +272 -0
- package/src/backend/dynamic-table/__tests__/filterParser.presets.test.ts +64 -0
- package/src/backend/dynamic-table/__tests__/filterParser.relative.test.ts +109 -0
- package/src/backend/dynamic-table/__tests__/filterSuggestions.test.ts +152 -0
- package/src/backend/dynamic-table/__tests__/formatAggregate.test.ts +99 -0
- package/src/backend/dynamic-table/__tests__/formatDateCompact.test.ts +489 -0
- package/src/backend/dynamic-table/__tests__/formatLabelCompact.test.ts +717 -0
- package/src/backend/dynamic-table/__tests__/formula.check.test.ts +257 -0
- package/src/backend/dynamic-table/__tests__/formula.evaluate.test.ts +274 -0
- package/src/backend/dynamic-table/__tests__/formula.functions.test.ts +226 -0
- package/src/backend/dynamic-table/__tests__/formula.noEval.test.ts +92 -0
- package/src/backend/dynamic-table/__tests__/formula.parse.test.ts +233 -0
- package/src/backend/dynamic-table/__tests__/formulaColumns.test.tsx +213 -0
- package/src/backend/dynamic-table/__tests__/handlerIdentity.test.ts +77 -0
- package/src/backend/dynamic-table/__tests__/importMapping.test.ts +174 -0
- package/src/backend/dynamic-table/__tests__/importParse.test.ts +130 -0
- package/src/backend/dynamic-table/__tests__/importServerOnly.test.ts +37 -0
- package/src/backend/dynamic-table/__tests__/layoutPersistence.test.ts +372 -0
- package/src/backend/dynamic-table/__tests__/mouseHandlers.doubleClick.test.ts +155 -0
- package/src/backend/dynamic-table/__tests__/perspectivePersonalization.test.ts +188 -0
- package/src/backend/dynamic-table/__tests__/perspectiveResolver.test.ts +133 -0
- package/src/backend/dynamic-table/__tests__/perspectiveState.defaultGrouping.test.ts +306 -0
- package/src/backend/dynamic-table/__tests__/perspectiveState.defaults.test.ts +107 -0
- package/src/backend/dynamic-table/__tests__/perspectiveTemplates.test.tsx +269 -0
- package/src/backend/dynamic-table/__tests__/perspectiveTransforms.aggregations.test.ts +105 -0
- package/src/backend/dynamic-table/__tests__/perspectiveTransforms.conditionalFormats.test.ts +107 -0
- package/src/backend/dynamic-table/__tests__/perspectiveTransforms.dateFormat.test.ts +61 -0
- package/src/backend/dynamic-table/__tests__/perspectiveTransforms.formulas.test.ts +85 -0
- package/src/backend/dynamic-table/__tests__/perspectiveTransforms.frozenColumns.test.ts +124 -0
- package/src/backend/dynamic-table/__tests__/rollupColumns.test.ts +149 -0
- package/src/backend/dynamic-table/__tests__/sharedCriteria.test.ts +255 -0
- package/src/backend/dynamic-table/__tests__/splitViewTree.test.ts +324 -0
- package/src/backend/dynamic-table/__tests__/store.clipboardMarker.test.ts +143 -0
- package/src/backend/dynamic-table/__tests__/store.fillPreview.test.ts +168 -0
- package/src/backend/dynamic-table/__tests__/store.mutations.test.ts +345 -0
- package/src/backend/dynamic-table/__tests__/store.selection.test.ts +157 -0
- package/src/backend/dynamic-table/__tests__/store.undo.test.ts +225 -0
- package/src/backend/dynamic-table/__tests__/store.valueSource.test.tsx +204 -0
- package/src/backend/dynamic-table/__tests__/useAnnotations.legacyOptions.test.tsx +58 -0
- package/src/backend/dynamic-table/__tests__/useColumnVirtualizer.test.ts +290 -0
- package/src/backend/dynamic-table/__tests__/useDensityPreference.test.ts +435 -0
- package/src/backend/dynamic-table/__tests__/useDynamicTablePage.duplicate.test.tsx +99 -0
- package/src/backend/dynamic-table/__tests__/useDynamicTablePage.export.test.tsx +281 -0
- package/src/backend/dynamic-table/__tests__/useDynamicTablePage.personalization.test.tsx +313 -0
- package/src/backend/dynamic-table/__tests__/useDynamicTablePage.perspectiveRestore.test.tsx +126 -0
- package/src/backend/dynamic-table/__tests__/useGrouping.aggregations.test.ts +158 -0
- package/src/backend/dynamic-table/__tests__/useGrouping.groupKey.test.ts +58 -0
- package/src/backend/dynamic-table/__tests__/useKeyboardNavigation.test.ts +594 -0
- package/src/backend/dynamic-table/__tests__/useStickyOffsets.memo.test.tsx +75 -0
- package/src/backend/dynamic-table/__tests__/useStickyOffsets.test.ts +106 -0
- package/src/backend/dynamic-table/__tests__/widgetPane.test.tsx +338 -0
- package/src/backend/dynamic-table/components/ActiveFilterChips.tsx +109 -0
- package/src/backend/dynamic-table/components/BulkActionsBar.tsx +89 -0
- package/src/backend/dynamic-table/components/Cell.tsx +292 -0
- package/src/backend/dynamic-table/components/CellCommentDialog.tsx +887 -0
- package/src/backend/dynamic-table/components/CellCommentHoverPopup.tsx +94 -0
- package/src/backend/dynamic-table/components/ColumnFilterPopover.tsx +775 -0
- package/src/backend/dynamic-table/components/ColumnHeaderMenu.tsx +189 -0
- package/src/backend/dynamic-table/components/ColumnHeaders.tsx +867 -0
- package/src/backend/dynamic-table/components/CompactLabelCell.tsx +293 -0
- package/src/backend/dynamic-table/components/ConfigureViewFields.tsx +173 -0
- package/src/backend/dynamic-table/components/ConfigureViewFilters.tsx +346 -0
- package/src/backend/dynamic-table/components/ConfigureViewFormatting.tsx +205 -0
- package/src/backend/dynamic-table/components/ConfigureViewFormulas.tsx +423 -0
- package/src/backend/dynamic-table/components/ConfigureViewGrouping.tsx +264 -0
- package/src/backend/dynamic-table/components/ConfigureViewLinkedColumns.tsx +249 -0
- package/src/backend/dynamic-table/components/ConfigureViewPanel.tsx +857 -0
- package/src/backend/dynamic-table/components/ConfigureViewRollups.tsx +364 -0
- package/src/backend/dynamic-table/components/ConfigureViewSorting.tsx +121 -0
- package/src/backend/dynamic-table/components/ContextMenu.tsx +140 -0
- package/src/backend/dynamic-table/components/DateCell.tsx +205 -0
- package/src/backend/dynamic-table/components/Debugger.tsx +340 -0
- package/src/backend/dynamic-table/components/DensityControl.tsx +441 -0
- package/src/backend/dynamic-table/components/EmptyState.tsx +103 -0
- package/src/backend/dynamic-table/components/EntitySearchEditor.tsx +528 -0
- package/src/backend/dynamic-table/components/ExportMenu.tsx +90 -0
- package/src/backend/dynamic-table/components/FilterDatePicker.tsx +194 -0
- package/src/backend/dynamic-table/components/FilterValueInput.tsx +294 -0
- package/src/backend/dynamic-table/components/FooterTotalsRow.tsx +291 -0
- package/src/backend/dynamic-table/components/FullscreenOverlay.tsx +66 -0
- package/src/backend/dynamic-table/components/GroupHeaderRow.tsx +136 -0
- package/src/backend/dynamic-table/components/GroupSummaryRow.tsx +184 -0
- package/src/backend/dynamic-table/components/ImportPanel.tsx +445 -0
- package/src/backend/dynamic-table/components/ImportPreviewGrid.tsx +155 -0
- package/src/backend/dynamic-table/components/LoadErrorState.tsx +70 -0
- package/src/backend/dynamic-table/components/MentionPopup.tsx +224 -0
- package/src/backend/dynamic-table/components/PerspectiveDeleteDialog.tsx +96 -0
- package/src/backend/dynamic-table/components/PerspectivePublishDialog.tsx +152 -0
- package/src/backend/dynamic-table/components/PerspectiveTabMenu.tsx +215 -0
- package/src/backend/dynamic-table/components/PerspectiveTabs.tsx +426 -0
- package/src/backend/dynamic-table/components/PerspectiveTemplateMenu.tsx +135 -0
- package/src/backend/dynamic-table/components/RowHeaderCell.tsx +73 -0
- package/src/backend/dynamic-table/components/SearchBar.tsx +309 -0
- package/src/backend/dynamic-table/components/SelectMenu.tsx +237 -0
- package/src/backend/dynamic-table/components/StaleDataBar.tsx +74 -0
- package/src/backend/dynamic-table/components/TableDeleteDialog.tsx +74 -0
- package/src/backend/dynamic-table/components/TablePagination.tsx +96 -0
- package/src/backend/dynamic-table/components/TableSkeleton.tsx +123 -0
- package/src/backend/dynamic-table/components/ToolbarOverflow.tsx +284 -0
- package/src/backend/dynamic-table/components/ViewModeSwitch.tsx +92 -0
- package/src/backend/dynamic-table/components/VirtualRow.tsx +346 -0
- package/src/backend/dynamic-table/components/editors.tsx +1727 -0
- package/src/backend/dynamic-table/components/renderers.tsx +162 -0
- package/src/backend/dynamic-table/events/events.ts +107 -0
- package/src/backend/dynamic-table/formula/check.ts +359 -0
- package/src/backend/dynamic-table/formula/evaluate.ts +473 -0
- package/src/backend/dynamic-table/formula/functions.ts +737 -0
- package/src/backend/dynamic-table/formula/index.ts +57 -0
- package/src/backend/dynamic-table/formula/parse.ts +414 -0
- package/src/backend/dynamic-table/formula/types.ts +151 -0
- package/src/backend/dynamic-table/handlers/cellWrites.ts +362 -0
- package/src/backend/dynamic-table/handlers/index.ts +789 -0
- package/src/backend/dynamic-table/handlers/perspectiveHandlers.ts +684 -0
- package/src/backend/dynamic-table/hooks/index.ts +888 -0
- package/src/backend/dynamic-table/hooks/useAbbreviations.ts +67 -0
- package/src/backend/dynamic-table/hooks/useAnnotations.ts +215 -0
- package/src/backend/dynamic-table/hooks/useColumnVirtualizer.ts +303 -0
- package/src/backend/dynamic-table/hooks/useColumnWidthPersistence.ts +214 -0
- package/src/backend/dynamic-table/hooks/useDensityPreference.ts +451 -0
- package/src/backend/dynamic-table/hooks/useDynamicTablePage.tsx +1681 -0
- package/src/backend/dynamic-table/hooks/useEscapeLayer.ts +72 -0
- package/src/backend/dynamic-table/hooks/useGrouping.ts +428 -0
- package/src/backend/dynamic-table/hooks/useSuggestionFetch.ts +109 -0
- package/src/backend/dynamic-table/hooks/useTableDateFormat.tsx +19 -0
- package/src/backend/dynamic-table/index.ts +497 -0
- package/src/backend/dynamic-table/registry/ContentRegistryContext.tsx +244 -0
- package/src/backend/dynamic-table/registry/TableRegistryContext.tsx +84 -0
- package/src/backend/dynamic-table/registry/filterAccessibleTables.ts +36 -0
- package/src/backend/dynamic-table/registry/index.ts +38 -0
- package/src/backend/dynamic-table/registry/lazyTable.tsx +80 -0
- package/src/backend/dynamic-table/registry/types.ts +181 -0
- package/src/backend/dynamic-table/registry/widgetCatalog.ts +226 -0
- package/src/backend/dynamic-table/server/aggregate.ts +474 -0
- package/src/backend/dynamic-table/server/dateWindows.ts +201 -0
- package/src/backend/dynamic-table/server/filterParser.ts +132 -0
- package/src/backend/dynamic-table/server/filterSuggestions.ts +150 -0
- package/src/backend/dynamic-table/server/index.ts +47 -0
- package/src/backend/dynamic-table/server/makeDynamicTableRoute.ts +426 -0
- package/src/backend/dynamic-table/split-view/ContentPicker.tsx +251 -0
- package/src/backend/dynamic-table/split-view/EmptySlot.tsx +69 -0
- package/src/backend/dynamic-table/split-view/SplitViewHost.tsx +1336 -0
- package/src/backend/dynamic-table/split-view/WidgetPane.tsx +390 -0
- package/src/backend/dynamic-table/split-view/WorkspaceFilterBar.tsx +728 -0
- package/src/backend/dynamic-table/split-view/index.ts +48 -0
- package/src/backend/dynamic-table/split-view/layoutPersistence.ts +185 -0
- package/src/backend/dynamic-table/split-view/sharedCriteria.ts +196 -0
- package/src/backend/dynamic-table/split-view/types.ts +778 -0
- package/src/backend/dynamic-table/split-view/useSplitViewLayouts.ts +97 -0
- package/src/backend/dynamic-table/store/index.ts +1011 -0
- package/src/backend/dynamic-table/styles/ContextMenu.css +387 -0
- package/src/backend/dynamic-table/styles/DynamicTable.css +3659 -0
- package/src/backend/dynamic-table/styles/DynamicTable.v2.css +2651 -0
- package/src/backend/dynamic-table/styles/SearchBar.css +426 -0
- package/src/backend/dynamic-table/styles/dateCell.css +146 -0
- package/src/backend/dynamic-table/styles/density.css +690 -0
- package/src/backend/dynamic-table/types/density.ts +179 -0
- package/src/backend/dynamic-table/types/filters.ts +156 -0
- package/src/backend/dynamic-table/types/grouping.ts +189 -0
- package/src/backend/dynamic-table/types/import.ts +132 -0
- package/src/backend/dynamic-table/types/index.ts +1198 -0
- package/src/backend/dynamic-table/types/perspective.ts +436 -0
- package/src/backend/dynamic-table/types/rollup.ts +111 -0
- package/src/backend/dynamic-table/utils/abbreviations.ts +556 -0
- package/src/backend/dynamic-table/utils/anchoredPosition.ts +106 -0
- package/src/backend/dynamic-table/utils/badgeAutoFit.ts +108 -0
- package/src/backend/dynamic-table/utils/clipboard.ts +294 -0
- package/src/backend/dynamic-table/utils/coerceCellValue.ts +96 -0
- package/src/backend/dynamic-table/utils/colorAdjacency.ts +87 -0
- package/src/backend/dynamic-table/utils/columnFill.ts +93 -0
- package/src/backend/dynamic-table/utils/columnSpacerStyle.ts +53 -0
- package/src/backend/dynamic-table/utils/columnWindow.ts +668 -0
- package/src/backend/dynamic-table/utils/conditionalFormat.ts +300 -0
- package/src/backend/dynamic-table/utils/exportTable.ts +140 -0
- package/src/backend/dynamic-table/utils/fillGeometry.ts +187 -0
- package/src/backend/dynamic-table/utils/fillPatterns.ts +422 -0
- package/src/backend/dynamic-table/utils/formatAggregate.ts +145 -0
- package/src/backend/dynamic-table/utils/formatDateCompact.ts +879 -0
- package/src/backend/dynamic-table/utils/formatLabelCompact.ts +640 -0
- package/src/backend/dynamic-table/utils/formulaColumns.tsx +237 -0
- package/src/backend/dynamic-table/utils/importMapping.ts +202 -0
- package/src/backend/dynamic-table/utils/importParse.ts +220 -0
- package/src/backend/dynamic-table/utils/lookupColumns.tsx +47 -0
- package/src/backend/dynamic-table/utils/perspectiveTransforms.ts +368 -0
- package/src/backend/dynamic-table/utils/rollupColumns.ts +162 -0
- package/src/backend/dynamic-table/validators/index.ts +40 -0
- package/src/backend/fields/registry.generated.ts +8 -0
- package/src/backend/fields/registry.ts +38 -0
- package/src/backend/filters/AdvancedFilterBuilder.tsx +339 -0
- package/src/backend/forms/ActionsDropdown.tsx +198 -0
- package/src/backend/forms/FormActionButtons.tsx +98 -0
- package/src/backend/forms/FormFooter.tsx +27 -0
- package/src/backend/forms/FormHeader.tsx +204 -0
- package/src/backend/forms/index.ts +4 -0
- package/src/backend/hooks/useAdvancedFilter.ts +77 -0
- package/src/backend/indexes/PartialIndexBanner.tsx +86 -0
- package/src/backend/indexes/store.ts +88 -0
- package/src/backend/injection/ComponentOverrideProvider.tsx +66 -0
- package/src/backend/injection/InjectedField.tsx +196 -0
- package/src/backend/injection/InjectionSpot.tsx +457 -0
- package/src/backend/injection/InjectionWizard.tsx +335 -0
- package/src/backend/injection/PageInjectionBoundary.tsx +31 -0
- package/src/backend/injection/SseEventIndicator.tsx +11 -0
- package/src/backend/injection/StatusBadgeInjectionSpot.tsx +50 -0
- package/src/backend/injection/StatusBadgeRenderer.tsx +100 -0
- package/src/backend/injection/WidgetSharedState.ts +58 -0
- package/src/backend/injection/WizardInjectionSpot.tsx +46 -0
- package/src/backend/injection/eventBridge.ts +158 -0
- package/src/backend/injection/helpers.ts +35 -0
- package/src/backend/injection/mergeMenuItems.ts +80 -0
- package/src/backend/injection/mutationEvents.ts +22 -0
- package/src/backend/injection/resolveInjectedIcon.tsx +30 -0
- package/src/backend/injection/spotIds.ts +64 -0
- package/src/backend/injection/useAppEvent.ts +76 -0
- package/src/backend/injection/useGuardedMutation.ts +101 -0
- package/src/backend/injection/useInjectedMenuItems.ts +67 -0
- package/src/backend/injection/useInjectionDataWidgets.ts +41 -0
- package/src/backend/injection/useOperationProgress.ts +105 -0
- package/src/backend/injection/useRegisteredComponent.tsx +106 -0
- package/src/backend/injection/useWidgetSharedState.ts +28 -0
- package/src/backend/injection/visibility-utils.ts +31 -0
- package/src/backend/injection/widgetRegistry.ts +68 -0
- package/src/backend/inputs/ComboboxInput.tsx +272 -0
- package/src/backend/inputs/DatePicker.tsx +162 -0
- package/src/backend/inputs/DateTimePicker.tsx +199 -0
- package/src/backend/inputs/EventPatternInput.tsx +46 -0
- package/src/backend/inputs/EventSelect.tsx +183 -0
- package/src/backend/inputs/LookupSelect.tsx +253 -0
- package/src/backend/inputs/PhoneNumberField.tsx +166 -0
- package/src/backend/inputs/SwitchableMarkdownInput.tsx +106 -0
- package/src/backend/inputs/TagsInput.tsx +297 -0
- package/src/backend/inputs/TimeInput.tsx +146 -0
- package/src/backend/inputs/TimePicker.tsx +120 -0
- package/src/backend/inputs/__tests__/DatePicker.test.tsx +76 -0
- package/src/backend/inputs/__tests__/DateTimePicker.logic.test.ts +126 -0
- package/src/backend/inputs/__tests__/PhoneNumberField.test.tsx +73 -0
- package/src/backend/inputs/__tests__/TagsInput.test.tsx +78 -0
- package/src/backend/inputs/__tests__/TimeInput.test.tsx +134 -0
- package/src/backend/inputs/__tests__/TimePicker.test.tsx +50 -0
- package/src/backend/inputs/index.ts +11 -0
- package/src/backend/markdown/MarkdownContent.tsx +33 -0
- package/src/backend/markdown/index.ts +2 -0
- package/src/backend/markdown/useMarkdownRemarkPlugins.ts +39 -0
- package/src/backend/messages/MessageComposer.tsx +197 -0
- package/src/backend/messages/MessageObjectDetail.tsx +95 -0
- package/src/backend/messages/MessageObjectPreview.tsx +64 -0
- package/src/backend/messages/MessageObjectRecordPicker.tsx +149 -0
- package/src/backend/messages/MessagePrioritySelector.tsx +78 -0
- package/src/backend/messages/MessagesIcon.tsx +32 -0
- package/src/backend/messages/SendObjectMessageDialog.tsx +74 -0
- package/src/backend/messages/__tests__/MessageComposer.test.tsx +350 -0
- package/src/backend/messages/__tests__/SendObjectMessageDialog.test.tsx +77 -0
- package/src/backend/messages/index.ts +22 -0
- package/src/backend/messages/message-compose-form-groups.tsx +383 -0
- package/src/backend/messages/message-composer.types.ts +82 -0
- package/src/backend/messages/message-priority.ts +53 -0
- package/src/backend/messages/useMessageCompose.ts +666 -0
- package/src/backend/messages/useMessageComposeOperations.ts +259 -0
- package/src/backend/messages/useMessagesPoll.ts +118 -0
- package/src/backend/notifications/NotificationBell.tsx +91 -0
- package/src/backend/notifications/NotificationCountBadge.tsx +14 -0
- package/src/backend/notifications/NotificationDispatcher.ts +213 -0
- package/src/backend/notifications/NotificationItem.tsx +262 -0
- package/src/backend/notifications/NotificationPanel.tsx +225 -0
- package/src/backend/notifications/__tests__/NotificationCountBadge.test.tsx +34 -0
- package/src/backend/notifications/index.ts +20 -0
- package/src/backend/notifications/useNotificationActions.ts +161 -0
- package/src/backend/notifications/useNotificationEffect.ts +17 -0
- package/src/backend/notifications/useNotifications.ts +12 -0
- package/src/backend/notifications/useNotificationsPoll.ts +167 -0
- package/src/backend/notifications/useNotificationsSse.ts +220 -0
- package/src/backend/operations/LastOperationBanner.tsx +85 -0
- package/src/backend/operations/__tests__/LastOperationBanner.test.tsx +101 -0
- package/src/backend/operations/store.ts +230 -0
- package/src/backend/progress/ProgressTopBar.tsx +189 -0
- package/src/backend/progress/useProgress.ts +12 -0
- package/src/backend/progress/useProgressPoll.ts +100 -0
- package/src/backend/progress/useProgressSse.ts +118 -0
- package/src/backend/schedule/ScheduleAgenda.tsx +136 -0
- package/src/backend/schedule/ScheduleGrid.tsx +136 -0
- package/src/backend/schedule/ScheduleToolbar.tsx +178 -0
- package/src/backend/schedule/ScheduleView.tsx +201 -0
- package/src/backend/schedule/index.ts +5 -0
- package/src/backend/schedule/recurrence.ts +99 -0
- package/src/backend/schedule/types.ts +26 -0
- package/src/backend/section-page/SectionNav.tsx +140 -0
- package/src/backend/section-page/SectionPage.tsx +34 -0
- package/src/backend/section-page/index.ts +3 -0
- package/src/backend/section-page/types.ts +30 -0
- package/src/backend/settings/SettingsNavigation.tsx +74 -0
- package/src/backend/settings/SettingsPageWrapper.tsx +78 -0
- package/src/backend/settings/index.ts +3 -0
- package/src/backend/upgrades/UpgradeActionBanner.tsx +128 -0
- package/src/backend/utils/__tests__/api.scoped-headers.test.ts +58 -0
- package/src/backend/utils/__tests__/api.test.ts +148 -0
- package/src/backend/utils/__tests__/apiCall.scoped-request-headers.test.ts +58 -0
- package/src/backend/utils/__tests__/apiCall.test.ts +109 -0
- package/src/backend/utils/__tests__/crud.test.ts +87 -0
- package/src/backend/utils/__tests__/customFieldDefs.test.ts +25 -0
- package/src/backend/utils/__tests__/customFieldValues.test.ts +35 -0
- package/src/backend/utils/__tests__/richTextSanitizer.test.ts +57 -0
- package/src/backend/utils/api.ts +214 -0
- package/src/backend/utils/apiCall.ts +123 -0
- package/src/backend/utils/crud.ts +174 -0
- package/src/backend/utils/customFieldColumns.ts +118 -0
- package/src/backend/utils/customFieldDefs.ts +247 -0
- package/src/backend/utils/customFieldFilters.ts +174 -0
- package/src/backend/utils/customFieldForms.ts +203 -0
- package/src/backend/utils/customFieldRelationDisplay.ts +302 -0
- package/src/backend/utils/customFieldValues.ts +41 -0
- package/src/backend/utils/flash.ts +17 -0
- package/src/backend/utils/nav.ts +402 -0
- package/src/backend/utils/richTextSanitizer.ts +7 -0
- package/src/backend/utils/scopedHeaderStack.ts +49 -0
- package/src/backend/utils/serverErrors.ts +313 -0
- package/src/backend/utils/useAutoDiscoveredFields.ts +138 -0
- package/src/backend/version-history/VersionHistoryAction.tsx +76 -0
- package/src/backend/version-history/VersionHistoryDetail.tsx +87 -0
- package/src/backend/version-history/VersionHistoryPanel.tsx +331 -0
- package/src/backend/version-history/index.ts +9 -0
- package/src/backend/version-history/labels.ts +56 -0
- package/src/backend/version-history/types.ts +27 -0
- package/src/backend/version-history/useAuditPermissions.ts +94 -0
- package/src/backend/version-history/useVersionHistory.ts +173 -0
- package/src/backend/views/NewViewForm.tsx +54 -0
- package/src/backend/views/ShareForm.tsx +62 -0
- package/src/backend/views/ViewChip.tsx +123 -0
- package/src/backend/views/ViewChipMenu.tsx +94 -0
- package/src/backend/views/types.ts +4 -0
- package/src/frontend/AuthFooter.tsx +29 -0
- package/src/frontend/LanguageSwitcher.tsx +66 -0
- package/src/frontend/Layout.tsx +13 -0
- package/src/hooks/useIsMobile.ts +27 -0
- package/src/index.ts +40 -0
- package/src/portal/PortalContext.tsx +180 -0
- package/src/portal/PortalLayoutProvider.tsx +5 -0
- package/src/portal/PortalLayoutShell.tsx +64 -0
- package/src/portal/PortalShell.tsx +370 -0
- package/src/portal/components/PortalCard.tsx +77 -0
- package/src/portal/components/PortalEmptyState.tsx +32 -0
- package/src/portal/components/PortalFeatureCard.tsx +41 -0
- package/src/portal/components/PortalNotificationBell.tsx +81 -0
- package/src/portal/components/PortalNotificationPanel.tsx +230 -0
- package/src/portal/components/PortalPageHeader.tsx +33 -0
- package/src/portal/components/index.ts +6 -0
- package/src/portal/hooks/useCustomerAuth.ts +97 -0
- package/src/portal/hooks/usePortalAppEvent.ts +56 -0
- package/src/portal/hooks/usePortalDashboardWidgets.ts +50 -0
- package/src/portal/hooks/usePortalEventBridge.ts +162 -0
- package/src/portal/hooks/usePortalInjectedMenuItems.ts +130 -0
- package/src/portal/hooks/usePortalNotifications.ts +116 -0
- package/src/portal/hooks/useTenantContext.ts +83 -0
- package/src/primitives/DataLoader.tsx +93 -0
- package/src/primitives/ErrorNotice.tsx +17 -0
- package/src/primitives/Notice.tsx +83 -0
- package/src/primitives/alert.tsx +59 -0
- package/src/primitives/badge.tsx +43 -0
- package/src/primitives/button.tsx +60 -0
- package/src/primitives/calendar.tsx +69 -0
- package/src/primitives/card.tsx +92 -0
- package/src/primitives/checkbox.tsx +34 -0
- package/src/primitives/dialog.tsx +122 -0
- package/src/primitives/form-field.tsx +106 -0
- package/src/primitives/icon-button.tsx +48 -0
- package/src/primitives/input.tsx +26 -0
- package/src/primitives/label.tsx +18 -0
- package/src/primitives/popover.tsx +37 -0
- package/src/primitives/primitives.stories.tsx +223 -0
- package/src/primitives/progress.tsx +28 -0
- package/src/primitives/separator.tsx +7 -0
- package/src/primitives/sheet.tsx +137 -0
- package/src/primitives/spinner.tsx +27 -0
- package/src/primitives/status-badge.tsx +62 -0
- package/src/primitives/switch.tsx +92 -0
- package/src/primitives/table.tsx +27 -0
- package/src/primitives/tabs.tsx +131 -0
- package/src/primitives/textarea.tsx +20 -0
- package/src/primitives/tooltip.tsx +85 -0
- package/src/primitives-v2/AGENTS.md +66 -0
- package/src/primitives-v2/Alert.stories.tsx +56 -0
- package/src/primitives-v2/Alert.tsx +108 -0
- package/src/primitives-v2/Avatar.stories.tsx +60 -0
- package/src/primitives-v2/Avatar.tsx +139 -0
- package/src/primitives-v2/Badge.stories.tsx +80 -0
- package/src/primitives-v2/Badge.tsx +99 -0
- package/src/primitives-v2/Breadcrumb.stories.tsx +61 -0
- package/src/primitives-v2/Breadcrumb.tsx +96 -0
- package/src/primitives-v2/Button.stories.tsx +72 -0
- package/src/primitives-v2/Button.tsx +178 -0
- package/src/primitives-v2/Checkbox.stories.tsx +34 -0
- package/src/primitives-v2/Checkbox.tsx +103 -0
- package/src/primitives-v2/IconButton.stories.tsx +40 -0
- package/src/primitives-v2/IconButton.tsx +40 -0
- package/src/primitives-v2/Input.stories.tsx +60 -0
- package/src/primitives-v2/Input.tsx +113 -0
- package/src/primitives-v2/NavGroup.stories.tsx +50 -0
- package/src/primitives-v2/NavGroup.tsx +76 -0
- package/src/primitives-v2/NavItem.stories.tsx +68 -0
- package/src/primitives-v2/NavItem.tsx +105 -0
- package/src/primitives-v2/SearchInput.stories.tsx +44 -0
- package/src/primitives-v2/SearchInput.tsx +123 -0
- package/src/primitives-v2/Sidebar.stories.tsx +91 -0
- package/src/primitives-v2/Sidebar.tsx +92 -0
- package/src/primitives-v2/Tab.stories.tsx +62 -0
- package/src/primitives-v2/Tab.tsx +148 -0
- package/src/primitives-v2/Tag.stories.tsx +123 -0
- package/src/primitives-v2/Tag.tsx +115 -0
- package/src/primitives-v2/Toggle.stories.tsx +37 -0
- package/src/primitives-v2/Toggle.tsx +93 -0
- package/src/primitives-v2/Topbar.stories.tsx +65 -0
- package/src/primitives-v2/Topbar.tsx +37 -0
- package/src/primitives-v2/index.ts +31 -0
- package/src/primitives-v2/utils.ts +9 -0
- package/src/theme/BrandThemeProvider.tsx +122 -0
- package/src/theme/QueryProvider.tsx +46 -0
- package/src/theme/ThemeProvider.tsx +120 -0
- package/src/theme/ThemeToggle.tsx +88 -0
- package/src/theme/index.ts +4 -0
- package/src/theme/m3.css +622 -0
- package/src/theme/tokens.v2.css +559 -0
- package/src/theme/typography.css +163 -0
- package/src/theme/typography.stories.tsx +157 -0
- package/src/theme/typography.tokens.ts +326 -0
- package/src/types/react-big-calendar.d.ts +16 -0
|
@@ -0,0 +1,2607 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
useState,
|
|
5
|
+
useEffect,
|
|
6
|
+
useLayoutEffect,
|
|
7
|
+
useRef,
|
|
8
|
+
useMemo,
|
|
9
|
+
useCallback
|
|
10
|
+
} from "react";
|
|
11
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
12
|
+
import { createCellStore } from "./store/index.js";
|
|
13
|
+
import {
|
|
14
|
+
CellStoreContext,
|
|
15
|
+
useStickyOffsets,
|
|
16
|
+
ROW_HEADER_WIDTH,
|
|
17
|
+
useKeyboardNavigation,
|
|
18
|
+
useCopyHandler,
|
|
19
|
+
useRowActionShortcuts,
|
|
20
|
+
columnMountsEditor
|
|
21
|
+
} from "./hooks/index.js";
|
|
22
|
+
import {
|
|
23
|
+
createCellHandlers,
|
|
24
|
+
createRowHandlers,
|
|
25
|
+
createDragHandlers,
|
|
26
|
+
createMouseHandlers,
|
|
27
|
+
createColumnHeaderHandlers,
|
|
28
|
+
createRowHeaderHandlers,
|
|
29
|
+
createContextMenuHandlers,
|
|
30
|
+
createResizeHandlers
|
|
31
|
+
} from "./handlers/index.js";
|
|
32
|
+
import { createPerspectiveHandlers, resolvePerspectiveState } from "./handlers/perspectiveHandlers.js";
|
|
33
|
+
import { TableDateFormatContext } from "./hooks/useTableDateFormat.js";
|
|
34
|
+
import { useColumnWidthPersistence } from "./hooks/useColumnWidthPersistence.js";
|
|
35
|
+
import { useColumnVirtualizer } from "./hooks/useColumnVirtualizer.js";
|
|
36
|
+
import { getPinnedColumnIndices } from "./utils/columnWindow.js";
|
|
37
|
+
import { computeColumnFill } from "./utils/columnFill.js";
|
|
38
|
+
import { useDensityPreference } from "./hooks/useDensityPreference.js";
|
|
39
|
+
import { DENSITY_ATTRIBUTE, resolveDensityRowHeight } from "./types/density.js";
|
|
40
|
+
import { DensityControl } from "./components/DensityControl.js";
|
|
41
|
+
import { ToolbarOverflow } from "./components/ToolbarOverflow.js";
|
|
42
|
+
import { dispatch, useEventHandlers } from "./events/events.js";
|
|
43
|
+
import {
|
|
44
|
+
TableEvents
|
|
45
|
+
} from "./types/index.js";
|
|
46
|
+
import { ViewModeSwitch } from "./components/ViewModeSwitch.js";
|
|
47
|
+
import { buildLookupColumnDefs } from "./utils/lookupColumns.js";
|
|
48
|
+
import { buildRollupColumnDefs } from "./utils/rollupColumns.js";
|
|
49
|
+
import { applyCellWrites } from "./handlers/cellWrites.js";
|
|
50
|
+
import { coerceCellValue } from "./utils/coerceCellValue.js";
|
|
51
|
+
import { parseClipboardGrid, selectionToTsv } from "./utils/clipboard.js";
|
|
52
|
+
import { detectFillPattern, generateFill, invertFillMode } from "./utils/fillPatterns.js";
|
|
53
|
+
import { buildFillLines, cellsInRect, computeFillPreview } from "./utils/fillGeometry.js";
|
|
54
|
+
import { compileConditionalFormats } from "./utils/conditionalFormat.js";
|
|
55
|
+
import { buildFormulaColumnDefs, isFormulaColumnKey } from "./utils/formulaColumns.js";
|
|
56
|
+
import { fieldMetaFromColumns } from "./formula/check.js";
|
|
57
|
+
import { badgeFitWidth, recordBadgeFit, planBadgeWidths } from "./utils/badgeAutoFit.js";
|
|
58
|
+
import { useGrouping, computeAggregates } from "./hooks/useGrouping.js";
|
|
59
|
+
import PerspectiveTabs from "./components/PerspectiveTabs.js";
|
|
60
|
+
import ConfigureViewPanel from "./components/ConfigureViewPanel.js";
|
|
61
|
+
import SearchBar from "./components/SearchBar.js";
|
|
62
|
+
import ActiveFilterChips from "./components/ActiveFilterChips.js";
|
|
63
|
+
import EmptyState from "./components/EmptyState.js";
|
|
64
|
+
import LoadErrorState from "./components/LoadErrorState.js";
|
|
65
|
+
import StaleDataBar from "./components/StaleDataBar.js";
|
|
66
|
+
import ContextMenu from "./components/ContextMenu.js";
|
|
67
|
+
import VirtualRow from "./components/VirtualRow.js";
|
|
68
|
+
import GroupHeaderRow from "./components/GroupHeaderRow.js";
|
|
69
|
+
import GroupSummaryRow from "./components/GroupSummaryRow.js";
|
|
70
|
+
import FooterTotalsRow from "./components/FooterTotalsRow.js";
|
|
71
|
+
import ColumnHeaders from "./components/ColumnHeaders.js";
|
|
72
|
+
import BulkActionsBar from "./components/BulkActionsBar.js";
|
|
73
|
+
import ExportMenu from "./components/ExportMenu.js";
|
|
74
|
+
import {
|
|
75
|
+
extractExportRows,
|
|
76
|
+
extractExportRowsFromData,
|
|
77
|
+
toCsv,
|
|
78
|
+
toXlsxBlob,
|
|
79
|
+
slugifyFileName,
|
|
80
|
+
downloadBlob
|
|
81
|
+
} from "./utils/exportTable.js";
|
|
82
|
+
import Debugger from "./components/Debugger.js";
|
|
83
|
+
import FullscreenOverlay from "./components/FullscreenOverlay.js";
|
|
84
|
+
import { Maximize2, FunnelX } from "lucide-react";
|
|
85
|
+
import { generateSortRuleId, generatePerspectiveId, BASE_VIEW_PERSPECTIVE_NAME } from "./types/perspective.js";
|
|
86
|
+
import { useAnnotations, annotationKey } from "./hooks/useAnnotations.js";
|
|
87
|
+
import CellCommentDialog from "./components/CellCommentDialog.js";
|
|
88
|
+
import CellCommentHoverPopup from "./components/CellCommentHoverPopup.js";
|
|
89
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "../../primitives/dialog.js";
|
|
90
|
+
import { Button } from "../../primitives/button.js";
|
|
91
|
+
import { useT, useLocale } from "@open-mercato/shared/lib/i18n/context";
|
|
92
|
+
import { flash } from "../FlashMessages.js";
|
|
93
|
+
import TablePagination from "./components/TablePagination.js";
|
|
94
|
+
const EMPTY_GROUP_RULES = [];
|
|
95
|
+
const SELECTION_COPY_ID = "__cellsel_copy";
|
|
96
|
+
const SELECTION_ANNOTATE_ID = "__cellsel_annotate";
|
|
97
|
+
const NON_TEXT_INPUT_TYPES = ["checkbox", "radio", "button", "submit", "range", "color", "file"];
|
|
98
|
+
function isTextEntryTarget(el) {
|
|
99
|
+
if (!el) return false;
|
|
100
|
+
const tag = el.tagName;
|
|
101
|
+
if (tag === "TEXTAREA" || el.isContentEditable) return true;
|
|
102
|
+
return tag === "INPUT" && !NON_TEXT_INPUT_TYPES.includes(el.type);
|
|
103
|
+
}
|
|
104
|
+
if (typeof window !== "undefined") {
|
|
105
|
+
import("./styles/DynamicTable.css.js");
|
|
106
|
+
import("./styles/DynamicTable.v2.css.js");
|
|
107
|
+
}
|
|
108
|
+
const DynamicTable = ({
|
|
109
|
+
data = [],
|
|
110
|
+
columns = [],
|
|
111
|
+
colHeaders = true,
|
|
112
|
+
rowHeaders = false,
|
|
113
|
+
height = "auto",
|
|
114
|
+
width = "auto",
|
|
115
|
+
idColumnName = "id",
|
|
116
|
+
rowKeyColumn,
|
|
117
|
+
tableName = "Table Name",
|
|
118
|
+
loadError,
|
|
119
|
+
onRetryLoad,
|
|
120
|
+
tableId,
|
|
121
|
+
density,
|
|
122
|
+
striped = false,
|
|
123
|
+
onSelectionChange,
|
|
124
|
+
onBulkDelete,
|
|
125
|
+
onExportAll,
|
|
126
|
+
tableRef,
|
|
127
|
+
emptyMessage,
|
|
128
|
+
columnActions,
|
|
129
|
+
rowActions,
|
|
130
|
+
cellActions,
|
|
131
|
+
actionsRenderer,
|
|
132
|
+
pagination,
|
|
133
|
+
searchQuery,
|
|
134
|
+
// New perspective props
|
|
135
|
+
savedPerspectives: propSavedPerspectives,
|
|
136
|
+
activePerspectiveId: controlledActivePerspectiveId,
|
|
137
|
+
defaultPerspectiveId,
|
|
138
|
+
sharedTemplates,
|
|
139
|
+
canPublishTemplates = false,
|
|
140
|
+
publishableRoles,
|
|
141
|
+
defaultHiddenColumns = [],
|
|
142
|
+
defaultGrouping = EMPTY_GROUP_RULES,
|
|
143
|
+
// Deprecated props (backward compatibility)
|
|
144
|
+
savedFilters: deprecatedSavedFilters,
|
|
145
|
+
activeFilterId: deprecatedActiveFilterId,
|
|
146
|
+
hiddenColumns: deprecatedHiddenColumns = [],
|
|
147
|
+
debug = false,
|
|
148
|
+
uiConfig = {},
|
|
149
|
+
autoSelectOnFocus = false,
|
|
150
|
+
autoEditOnTab = true,
|
|
151
|
+
loadFilterSuggestions,
|
|
152
|
+
loadLookupSources,
|
|
153
|
+
loadRollupSources,
|
|
154
|
+
dateFormatOptions,
|
|
155
|
+
keyboardShortcuts,
|
|
156
|
+
onRowAction,
|
|
157
|
+
siblingTableRefs,
|
|
158
|
+
onRowClick,
|
|
159
|
+
highlightedRowId,
|
|
160
|
+
actionsColumnWidth: actionsColumnWidthProp = 80,
|
|
161
|
+
enableComments = false,
|
|
162
|
+
commentsEntityType,
|
|
163
|
+
commentsCellTarget,
|
|
164
|
+
commentsViewContext,
|
|
165
|
+
onAnnotationChange,
|
|
166
|
+
aggregateResult = null,
|
|
167
|
+
aggregateLoading = false,
|
|
168
|
+
aggregateError = false,
|
|
169
|
+
renderBody
|
|
170
|
+
}) => {
|
|
171
|
+
const savedPerspectives = useMemo(() => {
|
|
172
|
+
if (propSavedPerspectives) {
|
|
173
|
+
return propSavedPerspectives;
|
|
174
|
+
}
|
|
175
|
+
if (deprecatedSavedFilters && deprecatedSavedFilters.length > 0) {
|
|
176
|
+
return deprecatedSavedFilters.map((filter) => ({
|
|
177
|
+
id: filter.id,
|
|
178
|
+
name: filter.name,
|
|
179
|
+
color: filter.color,
|
|
180
|
+
columns: {
|
|
181
|
+
visible: columns.map((c) => c.data),
|
|
182
|
+
hidden: []
|
|
183
|
+
},
|
|
184
|
+
filters: filter.rows,
|
|
185
|
+
sorting: [],
|
|
186
|
+
grouping: [],
|
|
187
|
+
aggregations: [],
|
|
188
|
+
lookupColumns: []
|
|
189
|
+
}));
|
|
190
|
+
}
|
|
191
|
+
return [];
|
|
192
|
+
}, [propSavedPerspectives, deprecatedSavedFilters, columns]);
|
|
193
|
+
const controlledActiveId = controlledActivePerspectiveId !== void 0 ? controlledActivePerspectiveId : deprecatedActiveFilterId;
|
|
194
|
+
const initialHiddenColumns = useMemo(() => {
|
|
195
|
+
return [.../* @__PURE__ */ new Set([...defaultHiddenColumns, ...deprecatedHiddenColumns])];
|
|
196
|
+
}, [defaultHiddenColumns, deprecatedHiddenColumns]);
|
|
197
|
+
const {
|
|
198
|
+
hideToolbar = false,
|
|
199
|
+
hideTitle = false,
|
|
200
|
+
searchSuggestions,
|
|
201
|
+
searchDebounceMs,
|
|
202
|
+
searchPlaceholder,
|
|
203
|
+
formatGroupValue,
|
|
204
|
+
hideSearch = false,
|
|
205
|
+
hideAddRowButton = false,
|
|
206
|
+
hidePerspectiveTabs: hidePerspectiveTabsExplicit,
|
|
207
|
+
hidePagination = false,
|
|
208
|
+
hideActionsColumn = false,
|
|
209
|
+
topBarStart,
|
|
210
|
+
topBarEnd,
|
|
211
|
+
searchBarEnd,
|
|
212
|
+
searchBarStart,
|
|
213
|
+
beforeBody,
|
|
214
|
+
enableFullscreen = false,
|
|
215
|
+
onFullscreenChange,
|
|
216
|
+
enableFillHandle = false,
|
|
217
|
+
fillConfirmThreshold = 100,
|
|
218
|
+
readOnlyStyle = "muted",
|
|
219
|
+
rowHoverStyle = "default",
|
|
220
|
+
disableBuiltinColumnMenu = false,
|
|
221
|
+
borderless = false,
|
|
222
|
+
bulkActions,
|
|
223
|
+
hideExportButton = false,
|
|
224
|
+
exportFileName,
|
|
225
|
+
enableColumnVirtualization = false,
|
|
226
|
+
columnOverscan,
|
|
227
|
+
hideDensityControl = false,
|
|
228
|
+
expandToolbarActions = false,
|
|
229
|
+
toolbarOverflowExtras,
|
|
230
|
+
densityLevel: densityLevelOverride,
|
|
231
|
+
viewModes,
|
|
232
|
+
onViewModeChange
|
|
233
|
+
} = uiConfig;
|
|
234
|
+
const { density: densityLevel } = useDensityPreference(densityLevelOverride, tableId);
|
|
235
|
+
const densityAttribute = useMemo(
|
|
236
|
+
() => ({ [DENSITY_ATTRIBUTE]: densityLevel }),
|
|
237
|
+
[densityLevel]
|
|
238
|
+
);
|
|
239
|
+
const hasPerspectives = !!(propSavedPerspectives || deprecatedSavedFilters);
|
|
240
|
+
const hidePerspectiveTabs = hidePerspectiveTabsExplicit ?? !hasPerspectives;
|
|
241
|
+
const t = useT();
|
|
242
|
+
const locale = useLocale();
|
|
243
|
+
const storeRef = useRef(null);
|
|
244
|
+
const dragStateRef = useRef({
|
|
245
|
+
isDragging: false,
|
|
246
|
+
type: null,
|
|
247
|
+
start: null
|
|
248
|
+
});
|
|
249
|
+
const actionsColumnWidth = actionsColumnWidthProp;
|
|
250
|
+
const [lookupColumns, setLookupColumns] = useState(() => {
|
|
251
|
+
const activePerspective = controlledActiveId ? savedPerspectives.find((p) => p.id === controlledActiveId) : null;
|
|
252
|
+
return activePerspective?.lookupColumns ?? [];
|
|
253
|
+
});
|
|
254
|
+
const lookupColumnDefs = useMemo(() => buildLookupColumnDefs(lookupColumns), [lookupColumns]);
|
|
255
|
+
const [rollupColumns, setRollupColumns] = useState(() => {
|
|
256
|
+
const activePerspective = controlledActiveId ? savedPerspectives.find((p) => p.id === controlledActiveId) : null;
|
|
257
|
+
return activePerspective?.rollupColumns ?? [];
|
|
258
|
+
});
|
|
259
|
+
const rollupColumnDefs = useMemo(
|
|
260
|
+
() => buildRollupColumnDefs(rollupColumns, { locale }),
|
|
261
|
+
[rollupColumns, locale]
|
|
262
|
+
);
|
|
263
|
+
const [formulas, setFormulas] = useState(() => {
|
|
264
|
+
const activePerspective = controlledActiveId ? savedPerspectives.find((p) => p.id === controlledActiveId) : null;
|
|
265
|
+
return activePerspective?.formulas ?? [];
|
|
266
|
+
});
|
|
267
|
+
const nativeColumns = useMemo(() => {
|
|
268
|
+
let raw;
|
|
269
|
+
if (columns.length > 0) {
|
|
270
|
+
raw = columns;
|
|
271
|
+
} else if (data.length > 0 && typeof data[0] === "object" && !Array.isArray(data[0])) {
|
|
272
|
+
raw = Object.keys(data[0]).filter((k) => k !== "_isNew").map((k) => ({ data: k }));
|
|
273
|
+
} else {
|
|
274
|
+
raw = [];
|
|
275
|
+
}
|
|
276
|
+
if (lookupColumnDefs.length === 0 && rollupColumnDefs.length === 0) return raw;
|
|
277
|
+
return [...raw, ...lookupColumnDefs, ...rollupColumnDefs];
|
|
278
|
+
}, [columns, data, lookupColumnDefs, rollupColumnDefs]);
|
|
279
|
+
const formulaColumnDefs = useMemo(
|
|
280
|
+
() => buildFormulaColumnDefs(formulas, { fields: fieldMetaFromColumns(nativeColumns), translate: t }),
|
|
281
|
+
[formulas, nativeColumns, t]
|
|
282
|
+
);
|
|
283
|
+
const baseColumns = useMemo(
|
|
284
|
+
() => formulaColumnDefs.length > 0 ? [...nativeColumns, ...formulaColumnDefs] : nativeColumns,
|
|
285
|
+
[nativeColumns, formulaColumnDefs]
|
|
286
|
+
);
|
|
287
|
+
const initialState = useMemo(() => {
|
|
288
|
+
const activePerspective = controlledActiveId ? savedPerspectives.find((p) => p.id === controlledActiveId) : null;
|
|
289
|
+
return resolvePerspectiveState({
|
|
290
|
+
baseColumns,
|
|
291
|
+
perspective: activePerspective,
|
|
292
|
+
defaultHiddenColumns: initialHiddenColumns,
|
|
293
|
+
defaultGrouping
|
|
294
|
+
});
|
|
295
|
+
}, []);
|
|
296
|
+
const [visibleColumns, setVisibleColumns] = useState(initialState.visibleColumns);
|
|
297
|
+
const [hiddenColumns, setHiddenColumns] = useState(initialState.hiddenColumns);
|
|
298
|
+
const [filters, setFilters] = useState(initialState.filters);
|
|
299
|
+
const [sortRules, setSortRules] = useState(initialState.sortRules);
|
|
300
|
+
const [groupRules, setGroupRules] = useState(initialState.groupRules);
|
|
301
|
+
const [viewMode, setViewMode] = useState(initialState.viewMode ?? "table");
|
|
302
|
+
const [aggregations, setAggregations] = useState(initialState.aggregations);
|
|
303
|
+
const [conditionalFormats, setConditionalFormats] = useState(
|
|
304
|
+
initialState.conditionalFormats
|
|
305
|
+
);
|
|
306
|
+
const [dateFormat, setDateFormat] = useState(initialState.dateFormat);
|
|
307
|
+
const [frozenColumns, setFrozenColumns] = useState(
|
|
308
|
+
() => new Set(initialState.frozenColumns)
|
|
309
|
+
);
|
|
310
|
+
const [internalActivePerspectiveId, setInternalActivePerspectiveId] = useState(
|
|
311
|
+
controlledActiveId ?? null
|
|
312
|
+
);
|
|
313
|
+
const activePerspectiveId = controlledActiveId !== void 0 ? controlledActiveId : internalActivePerspectiveId;
|
|
314
|
+
const appliedPerspectiveRef = useRef(void 0);
|
|
315
|
+
useEffect(() => {
|
|
316
|
+
if (appliedPerspectiveRef.current === activePerspectiveId) return;
|
|
317
|
+
const perspective = activePerspectiveId ? savedPerspectives.find((p) => p.id === activePerspectiveId) : null;
|
|
318
|
+
if (activePerspectiveId && !perspective) return;
|
|
319
|
+
appliedPerspectiveRef.current = activePerspectiveId;
|
|
320
|
+
const next = resolvePerspectiveState({
|
|
321
|
+
baseColumns,
|
|
322
|
+
perspective,
|
|
323
|
+
defaultHiddenColumns: initialHiddenColumns,
|
|
324
|
+
defaultGrouping
|
|
325
|
+
});
|
|
326
|
+
setVisibleColumns(next.visibleColumns);
|
|
327
|
+
setHiddenColumns(next.hiddenColumns);
|
|
328
|
+
setFilters(next.filters);
|
|
329
|
+
setSortRules(next.sortRules);
|
|
330
|
+
setGroupRules(next.groupRules);
|
|
331
|
+
setViewMode(next.viewMode ?? "table");
|
|
332
|
+
setAggregations(next.aggregations);
|
|
333
|
+
setLookupColumns(next.lookupColumns);
|
|
334
|
+
setRollupColumns(next.rollupColumns);
|
|
335
|
+
setFormulas(next.formulas);
|
|
336
|
+
setConditionalFormats(next.conditionalFormats);
|
|
337
|
+
setFrozenColumns(new Set(next.frozenColumns));
|
|
338
|
+
setDateFormat(next.dateFormat);
|
|
339
|
+
if (controlledActiveId !== void 0) {
|
|
340
|
+
setInternalActivePerspectiveId(activePerspectiveId ?? null);
|
|
341
|
+
}
|
|
342
|
+
}, [activePerspectiveId, controlledActiveId, savedPerspectives, baseColumns, initialHiddenColumns, defaultGrouping]);
|
|
343
|
+
const displayTableName = useMemo(() => {
|
|
344
|
+
if (activePerspectiveId && !activePerspectiveId.startsWith("_")) {
|
|
345
|
+
const activePerspective = savedPerspectives.find((p) => p.id === activePerspectiveId);
|
|
346
|
+
if (activePerspective && !activePerspective.isBaseView) {
|
|
347
|
+
return activePerspective.name;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return tableName;
|
|
351
|
+
}, [activePerspectiveId, savedPerspectives, tableName]);
|
|
352
|
+
const [configPanelOpen, setConfigPanelOpen] = useState(false);
|
|
353
|
+
const [configPanelInitialSection, setConfigPanelInitialSection] = useState(null);
|
|
354
|
+
const [editingPerspectiveId, setEditingPerspectiveId] = useState(null);
|
|
355
|
+
const [configureBaseView, setConfigureBaseView] = useState(false);
|
|
356
|
+
const baseViewPerspective = useMemo(
|
|
357
|
+
() => savedPerspectives.find((p) => p.isBaseView) ?? null,
|
|
358
|
+
[savedPerspectives]
|
|
359
|
+
);
|
|
360
|
+
const [commentDialog, setCommentDialog] = useState(null);
|
|
361
|
+
const [commentHover, setCommentHover] = useState(null);
|
|
362
|
+
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
363
|
+
const cols = useMemo(() => {
|
|
364
|
+
const orderedCols = [];
|
|
365
|
+
for (const key of visibleColumns) {
|
|
366
|
+
const col = baseColumns.find((c) => c.data === key);
|
|
367
|
+
if (col) {
|
|
368
|
+
orderedCols.push(col);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return orderedCols;
|
|
372
|
+
}, [baseColumns, visibleColumns]);
|
|
373
|
+
const resolveCommentTarget = useCallback(
|
|
374
|
+
(rowData, col) => {
|
|
375
|
+
if (!rowData) return { entityType: "", rowId: "" };
|
|
376
|
+
if (commentsCellTarget) return commentsCellTarget(rowData, col);
|
|
377
|
+
const entityType = typeof commentsEntityType === "function" ? commentsEntityType(rowData) : commentsEntityType || "";
|
|
378
|
+
return { entityType, rowId: String(rowData[idColumnName] ?? "") };
|
|
379
|
+
},
|
|
380
|
+
[commentsCellTarget, commentsEntityType, idColumnName]
|
|
381
|
+
);
|
|
382
|
+
const annotationTargets = useMemo(() => {
|
|
383
|
+
if (!enableComments) return [];
|
|
384
|
+
const seen = /* @__PURE__ */ new Set();
|
|
385
|
+
const out = [];
|
|
386
|
+
for (const row of data) {
|
|
387
|
+
for (const col of cols) {
|
|
388
|
+
const target = resolveCommentTarget(row, col);
|
|
389
|
+
if (!target.entityType || !target.rowId) continue;
|
|
390
|
+
const key = `${target.entityType}:${target.rowId}`;
|
|
391
|
+
if (seen.has(key)) continue;
|
|
392
|
+
seen.add(key);
|
|
393
|
+
out.push(target);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return out;
|
|
397
|
+
}, [enableComments, data, cols, resolveCommentTarget]);
|
|
398
|
+
const { annotations, refresh: refreshAnnotations } = useAnnotations({
|
|
399
|
+
enabled: enableComments && annotationTargets.length > 0,
|
|
400
|
+
targets: annotationTargets
|
|
401
|
+
});
|
|
402
|
+
const cellAnnotationKeyAt = useCallback(
|
|
403
|
+
(rowData, column) => {
|
|
404
|
+
const target = resolveCommentTarget(rowData, column);
|
|
405
|
+
if (!target.entityType || !target.rowId) return null;
|
|
406
|
+
return annotationKey(target, column.data);
|
|
407
|
+
},
|
|
408
|
+
[resolveCommentTarget]
|
|
409
|
+
);
|
|
410
|
+
const compiledFormats = useMemo(
|
|
411
|
+
() => compileConditionalFormats(conditionalFormats),
|
|
412
|
+
[conditionalFormats]
|
|
413
|
+
);
|
|
414
|
+
if (!storeRef.current) {
|
|
415
|
+
storeRef.current = createCellStore(data, cols);
|
|
416
|
+
}
|
|
417
|
+
const store = storeRef.current;
|
|
418
|
+
const groupingResult = useGrouping(data, groupRules, cols, aggregations, {
|
|
419
|
+
totalRows: pagination?.total
|
|
420
|
+
});
|
|
421
|
+
const isGrouped = groupingResult.visualRows !== null;
|
|
422
|
+
const reportedViewMode = useRef(null);
|
|
423
|
+
useEffect(() => {
|
|
424
|
+
if (reportedViewMode.current === viewMode) return;
|
|
425
|
+
reportedViewMode.current = viewMode;
|
|
426
|
+
onViewModeChange?.(viewMode);
|
|
427
|
+
}, [viewMode, onViewModeChange]);
|
|
428
|
+
const usingCustomBody = viewMode !== "table" && !!renderBody;
|
|
429
|
+
const [rowCount, setRowCount] = useState(store.getRowCount());
|
|
430
|
+
const [storeRevision, setStoreRevision] = useState(0);
|
|
431
|
+
const sortState = useMemo(() => {
|
|
432
|
+
const primary = sortRules[0];
|
|
433
|
+
if (!primary) return { columnIndex: null, direction: null };
|
|
434
|
+
const columnIndex = cols.findIndex((c) => c.data === primary.field);
|
|
435
|
+
if (columnIndex < 0) return { columnIndex: null, direction: null };
|
|
436
|
+
return { columnIndex, direction: primary.direction };
|
|
437
|
+
}, [sortRules, cols]);
|
|
438
|
+
const [contextMenu, setContextMenu] = useState(null);
|
|
439
|
+
const { leftOffsets, rightOffsets } = useStickyOffsets(cols, store, rowHeaders);
|
|
440
|
+
const showActionsColumn = !hideActionsColumn && (!!rowActions || !!actionsRenderer || store.hasNewRows());
|
|
441
|
+
const [actionsScrollShadow, setActionsScrollShadow] = useState(false);
|
|
442
|
+
const [firstColScrollShadow, setFirstColScrollShadow] = useState(false);
|
|
443
|
+
const [frozenColShadow, setFrozenColShadow] = useState(false);
|
|
444
|
+
useEffect(() => {
|
|
445
|
+
const el = tableRef.current;
|
|
446
|
+
if (!el) return;
|
|
447
|
+
let frozenEdge = null;
|
|
448
|
+
let frozenTarget = 0;
|
|
449
|
+
const measureFrozenEdge = () => {
|
|
450
|
+
frozenEdge = el.querySelector('.hot-headers-sticky [data-frozen-edge="true"]');
|
|
451
|
+
frozenTarget = frozenEdge ? parseFloat(getComputedStyle(frozenEdge).left) || 0 : 0;
|
|
452
|
+
};
|
|
453
|
+
const update = () => {
|
|
454
|
+
const maxScroll = el.scrollWidth - el.clientWidth;
|
|
455
|
+
setActionsScrollShadow(maxScroll > 1 && Math.ceil(el.scrollLeft) < maxScroll - 1);
|
|
456
|
+
setFirstColScrollShadow(el.scrollLeft > 1);
|
|
457
|
+
if (frozenEdge && el.scrollLeft > 1) {
|
|
458
|
+
const rel = frozenEdge.getBoundingClientRect().left - el.getBoundingClientRect().left;
|
|
459
|
+
setFrozenColShadow(rel <= frozenTarget + 1);
|
|
460
|
+
} else {
|
|
461
|
+
setFrozenColShadow(false);
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
let frame = null;
|
|
465
|
+
const onScroll = () => {
|
|
466
|
+
if (frame !== null) return;
|
|
467
|
+
frame = requestAnimationFrame(() => {
|
|
468
|
+
frame = null;
|
|
469
|
+
update();
|
|
470
|
+
});
|
|
471
|
+
};
|
|
472
|
+
measureFrozenEdge();
|
|
473
|
+
update();
|
|
474
|
+
el.addEventListener("scroll", onScroll, { passive: true });
|
|
475
|
+
const ro = new ResizeObserver(() => {
|
|
476
|
+
measureFrozenEdge();
|
|
477
|
+
onScroll();
|
|
478
|
+
});
|
|
479
|
+
ro.observe(el);
|
|
480
|
+
return () => {
|
|
481
|
+
el.removeEventListener("scroll", onScroll);
|
|
482
|
+
if (frame !== null) cancelAnimationFrame(frame);
|
|
483
|
+
ro.disconnect();
|
|
484
|
+
};
|
|
485
|
+
}, [tableRef, cols.length, showActionsColumn, isFullscreen, frozenColumns]);
|
|
486
|
+
const totalWidth = useMemo(() => {
|
|
487
|
+
return cols.reduce((sum, _, idx) => sum + store.getColumnWidth(idx), 0) + (rowHeaders ? 50 : 0) + (showActionsColumn ? actionsColumnWidth : 0);
|
|
488
|
+
}, [cols, store, rowHeaders, actionsColumnWidth, showActionsColumn, storeRevision]);
|
|
489
|
+
const furnitureWidth = (rowHeaders ? 50 : 0) + (showActionsColumn ? actionsColumnWidth : 0);
|
|
490
|
+
const getColumnWidth = useCallback(
|
|
491
|
+
(colIndex) => store.getColumnWidth(colIndex),
|
|
492
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
493
|
+
[store, storeRevision]
|
|
494
|
+
);
|
|
495
|
+
const pageAggregates = useMemo(() => {
|
|
496
|
+
if (aggregations.length === 0) return void 0;
|
|
497
|
+
const columnsByField = new Map(cols.map((c) => [c.data, c]));
|
|
498
|
+
const indices = data.map((_, i) => i);
|
|
499
|
+
return computeAggregates(data, indices, aggregations, columnsByField);
|
|
500
|
+
}, [data, aggregations, cols]);
|
|
501
|
+
const pageAggregateValues = pageAggregates?.values;
|
|
502
|
+
const pageAggregateBreakdowns = pageAggregates?.breakdowns;
|
|
503
|
+
const virtualizerCount = isGrouped ? groupingResult.visualRows.length : rowCount;
|
|
504
|
+
const dataRowHeight = densityLevel !== "comfortable" ? resolveDensityRowHeight(densityLevel) : density === "md" ? 44 : density === "sm" ? 36 : 32;
|
|
505
|
+
const selectionColumnName = rowKeyColumn ?? idColumnName;
|
|
506
|
+
const selectable = rowHeaders;
|
|
507
|
+
const [selectedRowIds, setSelectedRowIds] = useState(/* @__PURE__ */ new Set());
|
|
508
|
+
const showRowActionsMenu = !!rowActions && !actionsRenderer;
|
|
509
|
+
const pageRowIds = useMemo(
|
|
510
|
+
() => data.map((r) => r == null ? void 0 : r[selectionColumnName]).filter((id) => id != null).map((id) => String(id)),
|
|
511
|
+
[data, selectionColumnName]
|
|
512
|
+
);
|
|
513
|
+
const allSelected = pageRowIds.length > 0 && pageRowIds.every((id) => selectedRowIds.has(id));
|
|
514
|
+
const someSelected = !allSelected && pageRowIds.some((id) => selectedRowIds.has(id));
|
|
515
|
+
const handleToggleRowSelect = useCallback((rowId) => {
|
|
516
|
+
setSelectedRowIds((prev) => {
|
|
517
|
+
const next = new Set(prev);
|
|
518
|
+
if (next.has(rowId)) next.delete(rowId);
|
|
519
|
+
else next.add(rowId);
|
|
520
|
+
onSelectionChange?.(Array.from(next));
|
|
521
|
+
return next;
|
|
522
|
+
});
|
|
523
|
+
}, [onSelectionChange]);
|
|
524
|
+
const handleToggleSelectAll = useCallback(() => {
|
|
525
|
+
setSelectedRowIds((prev) => {
|
|
526
|
+
const next = new Set(prev);
|
|
527
|
+
const everySelected = pageRowIds.length > 0 && pageRowIds.every((id) => next.has(id));
|
|
528
|
+
if (everySelected) pageRowIds.forEach((id) => next.delete(id));
|
|
529
|
+
else pageRowIds.forEach((id) => next.add(id));
|
|
530
|
+
onSelectionChange?.(Array.from(next));
|
|
531
|
+
return next;
|
|
532
|
+
});
|
|
533
|
+
}, [pageRowIds, onSelectionChange]);
|
|
534
|
+
const handleToggleGroupSelect = useCallback((groupRowIds) => {
|
|
535
|
+
setSelectedRowIds((prev) => {
|
|
536
|
+
const next = new Set(prev);
|
|
537
|
+
const everySelected = groupRowIds.length > 0 && groupRowIds.every((id) => next.has(id));
|
|
538
|
+
if (everySelected) groupRowIds.forEach((id) => next.delete(id));
|
|
539
|
+
else groupRowIds.forEach((id) => next.add(id));
|
|
540
|
+
onSelectionChange?.(Array.from(next));
|
|
541
|
+
return next;
|
|
542
|
+
});
|
|
543
|
+
}, [onSelectionChange]);
|
|
544
|
+
const [isBulkDeleting, setIsBulkDeleting] = useState(false);
|
|
545
|
+
const bulkBarCountRef = useRef(0);
|
|
546
|
+
const clearSelection = useCallback(() => {
|
|
547
|
+
setSelectedRowIds(/* @__PURE__ */ new Set());
|
|
548
|
+
onSelectionChange?.([]);
|
|
549
|
+
}, [onSelectionChange]);
|
|
550
|
+
const handleBulkDelete = useCallback(async () => {
|
|
551
|
+
if (!onBulkDelete) return;
|
|
552
|
+
const ids = Array.from(selectedRowIds);
|
|
553
|
+
if (ids.length === 0) return;
|
|
554
|
+
setIsBulkDeleting(true);
|
|
555
|
+
try {
|
|
556
|
+
await onBulkDelete(ids);
|
|
557
|
+
clearSelection();
|
|
558
|
+
} catch {
|
|
559
|
+
} finally {
|
|
560
|
+
setIsBulkDeleting(false);
|
|
561
|
+
}
|
|
562
|
+
}, [onBulkDelete, selectedRowIds, clearSelection]);
|
|
563
|
+
const rowVirtualizer = useVirtualizer({
|
|
564
|
+
count: virtualizerCount,
|
|
565
|
+
getScrollElement: () => tableRef?.current,
|
|
566
|
+
// Group headers share the data-row height so the grouped band lines up
|
|
567
|
+
// with the rest of the rows (same pill height + inter-row gap).
|
|
568
|
+
estimateSize: () => dataRowHeight,
|
|
569
|
+
overscan: 10
|
|
570
|
+
});
|
|
571
|
+
useLayoutEffect(() => {
|
|
572
|
+
rowVirtualizer.measure();
|
|
573
|
+
}, [dataRowHeight]);
|
|
574
|
+
useEffect(() => {
|
|
575
|
+
const timer = setTimeout(() => {
|
|
576
|
+
rowVirtualizer.measure();
|
|
577
|
+
}, 50);
|
|
578
|
+
return () => clearTimeout(timer);
|
|
579
|
+
}, [isFullscreen, dataRowHeight, rowVirtualizer]);
|
|
580
|
+
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
581
|
+
const { handleCellSave: handleCellSaveBase } = useMemo(
|
|
582
|
+
() => createCellHandlers(store, cols, tableRef, idColumnName),
|
|
583
|
+
[store, cols, tableRef, idColumnName]
|
|
584
|
+
);
|
|
585
|
+
const hasFormulaColumns = useMemo(() => cols.some((c) => isFormulaColumnKey(c.data)), [cols]);
|
|
586
|
+
const handleCellSave = useCallback(
|
|
587
|
+
(row, col, newValue, clearEditing = true) => {
|
|
588
|
+
handleCellSaveBase(row, col, newValue, clearEditing);
|
|
589
|
+
if (hasFormulaColumns) store.bumpRowRevisions(row, cols.length);
|
|
590
|
+
},
|
|
591
|
+
[handleCellSaveBase, hasFormulaColumns, store, cols.length]
|
|
592
|
+
);
|
|
593
|
+
const { handleAddRow, handleSaveNewRow, handleCancelNewRow } = useMemo(
|
|
594
|
+
() => createRowHandlers(store, cols, tableRef),
|
|
595
|
+
[store, cols, tableRef]
|
|
596
|
+
);
|
|
597
|
+
const dragHandlers = useMemo(
|
|
598
|
+
() => createDragHandlers(store, cols, dragStateRef),
|
|
599
|
+
[store, cols]
|
|
600
|
+
);
|
|
601
|
+
const { handleMouseDown, handleMouseMove, handleMouseUp, handleDoubleClick } = useMemo(
|
|
602
|
+
() => createMouseHandlers(store, cols, dragStateRef, dragHandlers),
|
|
603
|
+
[store, cols, dragHandlers]
|
|
604
|
+
);
|
|
605
|
+
const {
|
|
606
|
+
handleColumnVisibilityChange,
|
|
607
|
+
handleColumnOrderChange,
|
|
608
|
+
handleFiltersChange,
|
|
609
|
+
handleSortRulesChange,
|
|
610
|
+
handleGroupRulesChange,
|
|
611
|
+
handleAggregationsChange,
|
|
612
|
+
handleLookupColumnsChange,
|
|
613
|
+
handleRollupColumnsChange,
|
|
614
|
+
handleFormulasChange,
|
|
615
|
+
handleConditionalFormatsChange,
|
|
616
|
+
handleDateFormatChange,
|
|
617
|
+
handleSavePerspective,
|
|
618
|
+
handlePerspectiveSelect,
|
|
619
|
+
handlePerspectiveRename,
|
|
620
|
+
handlePerspectiveDelete,
|
|
621
|
+
handlePerspectiveDuplicate,
|
|
622
|
+
handlePerspectiveSetDefault,
|
|
623
|
+
handlePerspectivePublish,
|
|
624
|
+
handlePerspectiveTemplateCopy
|
|
625
|
+
} = useMemo(
|
|
626
|
+
() => createPerspectiveHandlers({
|
|
627
|
+
tableRef,
|
|
628
|
+
columns: baseColumns,
|
|
629
|
+
savedPerspectives,
|
|
630
|
+
activePerspectiveId,
|
|
631
|
+
setVisibleColumns,
|
|
632
|
+
setHiddenColumns,
|
|
633
|
+
setFilters,
|
|
634
|
+
setSortRules,
|
|
635
|
+
setGroupRules,
|
|
636
|
+
setAggregations,
|
|
637
|
+
setLookupColumns,
|
|
638
|
+
setRollupColumns,
|
|
639
|
+
setFormulas,
|
|
640
|
+
setConditionalFormats,
|
|
641
|
+
setFrozenColumns,
|
|
642
|
+
setDateFormat,
|
|
643
|
+
setInternalActivePerspectiveId,
|
|
644
|
+
defaultHiddenColumns: initialHiddenColumns,
|
|
645
|
+
defaultGrouping
|
|
646
|
+
}),
|
|
647
|
+
// The `set*` functions are React state setters (stable by contract) plus
|
|
648
|
+
// `setInternalActivePerspectiveId`; only the three data inputs can change.
|
|
649
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
650
|
+
[tableRef, baseColumns, savedPerspectives, activePerspectiveId, initialHiddenColumns, defaultGrouping]
|
|
651
|
+
);
|
|
652
|
+
const handleBaseViewReset = useCallback(() => {
|
|
653
|
+
if (!baseViewPerspective) return;
|
|
654
|
+
handleSavePerspective({
|
|
655
|
+
id: baseViewPerspective.id,
|
|
656
|
+
name: BASE_VIEW_PERSPECTIVE_NAME,
|
|
657
|
+
isBaseView: true,
|
|
658
|
+
columns: { visible: [], hidden: [] },
|
|
659
|
+
filters: [],
|
|
660
|
+
sorting: [],
|
|
661
|
+
grouping: [],
|
|
662
|
+
aggregations: [],
|
|
663
|
+
lookupColumns: [],
|
|
664
|
+
rollupColumns: [],
|
|
665
|
+
formulas: [],
|
|
666
|
+
conditionalFormats: [],
|
|
667
|
+
dateFormat: void 0
|
|
668
|
+
});
|
|
669
|
+
const next = resolvePerspectiveState({
|
|
670
|
+
baseColumns,
|
|
671
|
+
perspective: null,
|
|
672
|
+
defaultHiddenColumns: initialHiddenColumns,
|
|
673
|
+
defaultGrouping
|
|
674
|
+
});
|
|
675
|
+
setVisibleColumns(next.visibleColumns);
|
|
676
|
+
setHiddenColumns(next.hiddenColumns);
|
|
677
|
+
setFilters(next.filters);
|
|
678
|
+
setSortRules(next.sortRules);
|
|
679
|
+
setGroupRules(next.groupRules);
|
|
680
|
+
setAggregations(next.aggregations);
|
|
681
|
+
setLookupColumns(next.lookupColumns);
|
|
682
|
+
setRollupColumns(next.rollupColumns);
|
|
683
|
+
setFormulas(next.formulas);
|
|
684
|
+
setConditionalFormats(next.conditionalFormats);
|
|
685
|
+
setFrozenColumns(new Set(next.frozenColumns));
|
|
686
|
+
setDateFormat(next.dateFormat);
|
|
687
|
+
}, [baseViewPerspective, handleSavePerspective, baseColumns, initialHiddenColumns, defaultGrouping]);
|
|
688
|
+
const handleSortDirectionChange = useCallback(
|
|
689
|
+
(colIndex, direction) => {
|
|
690
|
+
const col = cols[colIndex];
|
|
691
|
+
if (!col) return;
|
|
692
|
+
handleSortRulesChange(
|
|
693
|
+
direction === null ? [] : [{ id: generateSortRuleId(), field: col.data, direction }]
|
|
694
|
+
);
|
|
695
|
+
},
|
|
696
|
+
[cols, handleSortRulesChange]
|
|
697
|
+
);
|
|
698
|
+
const { handleColumnSort, handleColumnHeaderDoubleClick, handleColumnHeaderMouseDown } = useMemo(
|
|
699
|
+
() => createColumnHeaderHandlers(
|
|
700
|
+
store,
|
|
701
|
+
cols,
|
|
702
|
+
tableRef,
|
|
703
|
+
sortState,
|
|
704
|
+
handleSortDirectionChange,
|
|
705
|
+
setContextMenu,
|
|
706
|
+
columnActions
|
|
707
|
+
),
|
|
708
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
709
|
+
[store, cols, tableRef, sortState, handleSortDirectionChange, columnActions]
|
|
710
|
+
);
|
|
711
|
+
const { handleRowHeaderDoubleClick } = useMemo(
|
|
712
|
+
() => createRowHeaderHandlers(store, tableRef, setContextMenu, rowActions),
|
|
713
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
714
|
+
[store, tableRef, rowActions]
|
|
715
|
+
);
|
|
716
|
+
const { handleContextMenuAction, handleContextMenuClose } = useMemo(
|
|
717
|
+
() => createContextMenuHandlers(store, cols, tableRef, contextMenu, setContextMenu, onRowAction),
|
|
718
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
719
|
+
[store, cols, tableRef, contextMenu, onRowAction]
|
|
720
|
+
);
|
|
721
|
+
const handleRowActionsMenu = useCallback((e, rowIndex) => {
|
|
722
|
+
if (!rowActions) return;
|
|
723
|
+
const rowData = store.getRowData(rowIndex);
|
|
724
|
+
const actions = rowActions(rowData, rowIndex);
|
|
725
|
+
if (!actions.length) return;
|
|
726
|
+
e.preventDefault();
|
|
727
|
+
e.stopPropagation();
|
|
728
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
729
|
+
setContextMenu({ isOpen: true, position: { x: rect.right, y: rect.bottom + 4 }, actions, type: "row", index: rowIndex });
|
|
730
|
+
}, [rowActions, store]);
|
|
731
|
+
const persistColumnWidthRef = useRef(() => {
|
|
732
|
+
});
|
|
733
|
+
const { handleResizeStart } = useMemo(
|
|
734
|
+
() => createResizeHandlers(store, (colIndex) => persistColumnWidthRef.current(colIndex)),
|
|
735
|
+
[store]
|
|
736
|
+
);
|
|
737
|
+
const userResizedColsRef = useRef(/* @__PURE__ */ new Set());
|
|
738
|
+
const badgeFitRef = useRef(/* @__PURE__ */ new Map());
|
|
739
|
+
const declaredTotalWidth = useMemo(
|
|
740
|
+
() => cols.reduce((sum, _, idx) => sum + store.getBaseColumnWidth(idx), 0) + furnitureWidth,
|
|
741
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
742
|
+
[cols, store, furnitureWidth, storeRevision]
|
|
743
|
+
);
|
|
744
|
+
const applyColumnFill = useCallback(() => {
|
|
745
|
+
const el = tableRef.current;
|
|
746
|
+
if (!el) return;
|
|
747
|
+
const rigid = /* @__PURE__ */ new Set();
|
|
748
|
+
cols.forEach((col, idx) => {
|
|
749
|
+
if (col.sticky || frozenColumns.has(col.data) || userResizedColsRef.current.has(idx)) {
|
|
750
|
+
rigid.add(idx);
|
|
751
|
+
}
|
|
752
|
+
});
|
|
753
|
+
store.setColumnStretch(
|
|
754
|
+
computeColumnFill({
|
|
755
|
+
widths: cols.map((_, idx) => store.getBaseColumnWidth(idx)),
|
|
756
|
+
rigid,
|
|
757
|
+
furnitureWidth,
|
|
758
|
+
containerWidth: el.clientWidth
|
|
759
|
+
})
|
|
760
|
+
);
|
|
761
|
+
}, [cols, store, frozenColumns, furnitureWidth, tableRef]);
|
|
762
|
+
useLayoutEffect(() => {
|
|
763
|
+
applyColumnFill();
|
|
764
|
+
const el = tableRef.current;
|
|
765
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
766
|
+
const ro = new ResizeObserver(() => applyColumnFill());
|
|
767
|
+
ro.observe(el);
|
|
768
|
+
return () => ro.disconnect();
|
|
769
|
+
}, [applyColumnFill, declaredTotalWidth, isFullscreen, tableRef]);
|
|
770
|
+
const handleModernSortAsc = useCallback(
|
|
771
|
+
(colIndex) => handleSortDirectionChange(colIndex, "asc"),
|
|
772
|
+
[handleSortDirectionChange]
|
|
773
|
+
);
|
|
774
|
+
const handleModernSortDesc = useCallback(
|
|
775
|
+
(colIndex) => handleSortDirectionChange(colIndex, "desc"),
|
|
776
|
+
[handleSortDirectionChange]
|
|
777
|
+
);
|
|
778
|
+
const handleModernFilterByField = useCallback((colIndex) => {
|
|
779
|
+
const col = cols[colIndex];
|
|
780
|
+
if (!col) return;
|
|
781
|
+
const newFilter = {
|
|
782
|
+
id: `filter-${Date.now()}`,
|
|
783
|
+
field: col.data,
|
|
784
|
+
operator: "contains",
|
|
785
|
+
values: []
|
|
786
|
+
};
|
|
787
|
+
handleFiltersChange([...filters, newFilter]);
|
|
788
|
+
setEditingPerspectiveId(null);
|
|
789
|
+
setConfigureBaseView(!activePerspectiveId || activePerspectiveId === baseViewPerspective?.id);
|
|
790
|
+
setConfigPanelInitialSection("filters");
|
|
791
|
+
setConfigPanelOpen(true);
|
|
792
|
+
}, [cols, filters, handleFiltersChange, activePerspectiveId, baseViewPerspective]);
|
|
793
|
+
const persistColumnLayout = useCallback((visible, hidden) => {
|
|
794
|
+
if (controlledActiveId === void 0) return;
|
|
795
|
+
const target = activePerspectiveId ? savedPerspectives.find((p) => p.id === activePerspectiveId) ?? null : baseViewPerspective;
|
|
796
|
+
if (target) {
|
|
797
|
+
handleSavePerspective({ ...target, columns: { visible, hidden } }, true);
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
if (activePerspectiveId) return;
|
|
801
|
+
handleSavePerspective(
|
|
802
|
+
{
|
|
803
|
+
id: generatePerspectiveId(),
|
|
804
|
+
name: BASE_VIEW_PERSPECTIVE_NAME,
|
|
805
|
+
isBaseView: true,
|
|
806
|
+
columns: { visible, hidden },
|
|
807
|
+
// FROM THE LIVE STATE — same rule as the view-mode switch below. A
|
|
808
|
+
// column drag records a column order and a "Hide field" records a
|
|
809
|
+
// column set; neither is a statement that the user wanted their
|
|
810
|
+
// filters, sorting and grouping thrown away, and writing empty literals
|
|
811
|
+
// here made it exactly that.
|
|
812
|
+
filters,
|
|
813
|
+
sorting: sortRules,
|
|
814
|
+
grouping: groupRules,
|
|
815
|
+
aggregations,
|
|
816
|
+
lookupColumns,
|
|
817
|
+
rollupColumns,
|
|
818
|
+
formulas,
|
|
819
|
+
conditionalFormats,
|
|
820
|
+
dateFormat,
|
|
821
|
+
viewMode
|
|
822
|
+
},
|
|
823
|
+
true
|
|
824
|
+
);
|
|
825
|
+
}, [
|
|
826
|
+
activePerspectiveId,
|
|
827
|
+
controlledActiveId,
|
|
828
|
+
savedPerspectives,
|
|
829
|
+
baseViewPerspective,
|
|
830
|
+
handleSavePerspective,
|
|
831
|
+
filters,
|
|
832
|
+
sortRules,
|
|
833
|
+
groupRules,
|
|
834
|
+
aggregations,
|
|
835
|
+
lookupColumns,
|
|
836
|
+
rollupColumns,
|
|
837
|
+
formulas,
|
|
838
|
+
conditionalFormats,
|
|
839
|
+
dateFormat,
|
|
840
|
+
viewMode
|
|
841
|
+
]);
|
|
842
|
+
const persistFrozenColumns = useCallback((next) => {
|
|
843
|
+
if (controlledActiveId === void 0) return;
|
|
844
|
+
const frozen = [...next];
|
|
845
|
+
const target = activePerspectiveId ? savedPerspectives.find((p) => p.id === activePerspectiveId) ?? null : baseViewPerspective;
|
|
846
|
+
if (target) {
|
|
847
|
+
handleSavePerspective({ ...target, frozenColumns: frozen }, true);
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
if (activePerspectiveId) return;
|
|
851
|
+
handleSavePerspective(
|
|
852
|
+
{
|
|
853
|
+
id: generatePerspectiveId(),
|
|
854
|
+
name: BASE_VIEW_PERSPECTIVE_NAME,
|
|
855
|
+
isBaseView: true,
|
|
856
|
+
columns: { visible: visibleColumns, hidden: hiddenColumns },
|
|
857
|
+
frozenColumns: frozen,
|
|
858
|
+
// Same rule as the column-layout mint: pinning a column is not a
|
|
859
|
+
// statement that the user wanted their filters and sorting discarded.
|
|
860
|
+
filters,
|
|
861
|
+
sorting: sortRules,
|
|
862
|
+
grouping: groupRules,
|
|
863
|
+
aggregations,
|
|
864
|
+
lookupColumns,
|
|
865
|
+
rollupColumns,
|
|
866
|
+
formulas,
|
|
867
|
+
conditionalFormats,
|
|
868
|
+
dateFormat,
|
|
869
|
+
viewMode
|
|
870
|
+
},
|
|
871
|
+
true
|
|
872
|
+
);
|
|
873
|
+
}, [
|
|
874
|
+
activePerspectiveId,
|
|
875
|
+
controlledActiveId,
|
|
876
|
+
savedPerspectives,
|
|
877
|
+
baseViewPerspective,
|
|
878
|
+
handleSavePerspective,
|
|
879
|
+
visibleColumns,
|
|
880
|
+
hiddenColumns,
|
|
881
|
+
filters,
|
|
882
|
+
sortRules,
|
|
883
|
+
groupRules,
|
|
884
|
+
aggregations,
|
|
885
|
+
lookupColumns,
|
|
886
|
+
rollupColumns,
|
|
887
|
+
formulas,
|
|
888
|
+
conditionalFormats,
|
|
889
|
+
dateFormat,
|
|
890
|
+
viewMode
|
|
891
|
+
]);
|
|
892
|
+
const handleModernFreezeToggle = useCallback((colIndex) => {
|
|
893
|
+
const col = cols[colIndex];
|
|
894
|
+
if (!col) return;
|
|
895
|
+
const next = new Set(frozenColumns);
|
|
896
|
+
if (next.has(col.data)) {
|
|
897
|
+
next.delete(col.data);
|
|
898
|
+
} else {
|
|
899
|
+
next.add(col.data);
|
|
900
|
+
}
|
|
901
|
+
setFrozenColumns(next);
|
|
902
|
+
persistFrozenColumns(next);
|
|
903
|
+
}, [cols, frozenColumns, persistFrozenColumns]);
|
|
904
|
+
const handleColumnReorder = useCallback((fromIndex, toIndex) => {
|
|
905
|
+
const fromCol = cols[fromIndex];
|
|
906
|
+
const toCol = cols[toIndex];
|
|
907
|
+
if (!fromCol || !toCol || fromIndex === toIndex) return;
|
|
908
|
+
const fromKey = fromCol.data;
|
|
909
|
+
const toKey = toCol.data;
|
|
910
|
+
const fi = visibleColumns.indexOf(fromKey);
|
|
911
|
+
const ti = visibleColumns.indexOf(toKey);
|
|
912
|
+
if (fi < 0 || ti < 0 || fi === ti) return;
|
|
913
|
+
const next = visibleColumns.slice();
|
|
914
|
+
next.splice(fi, 1);
|
|
915
|
+
next.splice(ti, 0, fromKey);
|
|
916
|
+
handleColumnVisibilityChange(next, hiddenColumns);
|
|
917
|
+
persistColumnLayout(next, hiddenColumns);
|
|
918
|
+
}, [cols, visibleColumns, hiddenColumns, handleColumnVisibilityChange, persistColumnLayout]);
|
|
919
|
+
const handleModernHideField = useCallback((colIndex) => {
|
|
920
|
+
const col = cols[colIndex];
|
|
921
|
+
if (!col) return;
|
|
922
|
+
if (!visibleColumns.includes(col.data)) return;
|
|
923
|
+
const newVisible = visibleColumns.filter((k) => k !== col.data);
|
|
924
|
+
const newHidden = hiddenColumns.includes(col.data) ? hiddenColumns : [...hiddenColumns, col.data];
|
|
925
|
+
handleColumnVisibilityChange(newVisible, newHidden);
|
|
926
|
+
persistColumnLayout(newVisible, newHidden);
|
|
927
|
+
}, [cols, visibleColumns, hiddenColumns, handleColumnVisibilityChange, persistColumnLayout]);
|
|
928
|
+
const handleViewModeChange = useCallback((mode) => {
|
|
929
|
+
setViewMode(mode);
|
|
930
|
+
onViewModeChange?.(mode);
|
|
931
|
+
if (controlledActiveId === void 0) return;
|
|
932
|
+
const target = activePerspectiveId ? savedPerspectives.find((p) => p.id === activePerspectiveId) ?? null : baseViewPerspective;
|
|
933
|
+
if (target) {
|
|
934
|
+
handleSavePerspective({ ...target, viewMode: mode }, true);
|
|
935
|
+
return;
|
|
936
|
+
}
|
|
937
|
+
if (activePerspectiveId) return;
|
|
938
|
+
handleSavePerspective(
|
|
939
|
+
{
|
|
940
|
+
id: generatePerspectiveId(),
|
|
941
|
+
name: BASE_VIEW_PERSPECTIVE_NAME,
|
|
942
|
+
isBaseView: true,
|
|
943
|
+
columns: { visible: visibleColumns, hidden: hiddenColumns },
|
|
944
|
+
filters,
|
|
945
|
+
sorting: sortRules,
|
|
946
|
+
grouping: groupRules,
|
|
947
|
+
aggregations,
|
|
948
|
+
lookupColumns,
|
|
949
|
+
rollupColumns,
|
|
950
|
+
formulas,
|
|
951
|
+
conditionalFormats,
|
|
952
|
+
dateFormat,
|
|
953
|
+
viewMode: mode
|
|
954
|
+
},
|
|
955
|
+
true
|
|
956
|
+
);
|
|
957
|
+
}, [
|
|
958
|
+
controlledActiveId,
|
|
959
|
+
activePerspectiveId,
|
|
960
|
+
savedPerspectives,
|
|
961
|
+
baseViewPerspective,
|
|
962
|
+
handleSavePerspective,
|
|
963
|
+
visibleColumns,
|
|
964
|
+
hiddenColumns,
|
|
965
|
+
filters,
|
|
966
|
+
sortRules,
|
|
967
|
+
groupRules,
|
|
968
|
+
aggregations,
|
|
969
|
+
lookupColumns,
|
|
970
|
+
rollupColumns,
|
|
971
|
+
formulas,
|
|
972
|
+
conditionalFormats,
|
|
973
|
+
dateFormat
|
|
974
|
+
]);
|
|
975
|
+
const handleColumnMove = useCallback((colIndex, direction) => {
|
|
976
|
+
const target = colIndex + direction;
|
|
977
|
+
if (target < 0 || target >= cols.length) return;
|
|
978
|
+
handleColumnReorder(colIndex, target);
|
|
979
|
+
}, [cols.length, handleColumnReorder]);
|
|
980
|
+
const handleModernColumnAction = useCallback((actionId, colIndex) => {
|
|
981
|
+
if (!tableRef?.current) return;
|
|
982
|
+
dispatch(tableRef.current, TableEvents.COLUMN_CONTEXT_MENU_ACTION, {
|
|
983
|
+
columnIndex: colIndex,
|
|
984
|
+
columnName: cols[colIndex]?.data,
|
|
985
|
+
actionId
|
|
986
|
+
});
|
|
987
|
+
}, [cols, tableRef]);
|
|
988
|
+
const effectiveLeftOffsets = useMemo(() => {
|
|
989
|
+
if (frozenColumns.size === 0) return leftOffsets;
|
|
990
|
+
const offsets = [...leftOffsets];
|
|
991
|
+
let cumulativeOffset = rowHeaders ? ROW_HEADER_WIDTH : 0;
|
|
992
|
+
for (let i = 0; i < cols.length; i++) {
|
|
993
|
+
if (cols[i].sticky === "left") {
|
|
994
|
+
cumulativeOffset = (offsets[i] ?? 0) + store.getColumnWidth(i);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
for (let i = 0; i < cols.length; i++) {
|
|
998
|
+
if (frozenColumns.has(cols[i].data) && cols[i].sticky !== "left") {
|
|
999
|
+
offsets[i] = cumulativeOffset;
|
|
1000
|
+
cumulativeOffset += store.getColumnWidth(i);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
return offsets;
|
|
1004
|
+
}, [frozenColumns, leftOffsets, cols, store, rowHeaders, storeRevision]);
|
|
1005
|
+
const lastFrozenColumnKey = useMemo(() => {
|
|
1006
|
+
let key = null;
|
|
1007
|
+
for (let i = 0; i < cols.length; i++) {
|
|
1008
|
+
if (effectiveLeftOffsets[i] !== void 0) key = cols[i].data;
|
|
1009
|
+
}
|
|
1010
|
+
return key;
|
|
1011
|
+
}, [effectiveLeftOffsets, cols]);
|
|
1012
|
+
const pinnedColumnIndices = useMemo(
|
|
1013
|
+
() => getPinnedColumnIndices(cols, frozenColumns),
|
|
1014
|
+
[cols, frozenColumns]
|
|
1015
|
+
);
|
|
1016
|
+
const [forcedColumnIndices, setForcedColumnIndices] = useState([]);
|
|
1017
|
+
const getColumnKeyByIndex = useCallback(
|
|
1018
|
+
(colIndex) => cols[colIndex]?.data ?? colIndex,
|
|
1019
|
+
[cols]
|
|
1020
|
+
);
|
|
1021
|
+
const columnVirtualizer = useColumnVirtualizer({
|
|
1022
|
+
enabled: enableColumnVirtualization,
|
|
1023
|
+
columnCount: cols.length,
|
|
1024
|
+
getColumnWidth,
|
|
1025
|
+
getScrollElement: () => tableRef.current,
|
|
1026
|
+
pinnedLeftIndices: pinnedColumnIndices.left,
|
|
1027
|
+
pinnedRightIndices: pinnedColumnIndices.right,
|
|
1028
|
+
forcedIndices: forcedColumnIndices,
|
|
1029
|
+
overscan: columnOverscan,
|
|
1030
|
+
// ROW_HEADER_WIDTH (32), NOT the 50 that `totalWidth` uses for the same
|
|
1031
|
+
// gutter — the two disagree today (a pre-existing bug). The 18px difference
|
|
1032
|
+
// moves only the scroll-range arithmetic, well inside one overscan column,
|
|
1033
|
+
// and never touches a spacer width. Do NOT "fix" it by swapping `totalWidth`
|
|
1034
|
+
// for the virtualizer's: that visibly narrows every table by 18px.
|
|
1035
|
+
leadingWidth: rowHeaders ? ROW_HEADER_WIDTH : 0,
|
|
1036
|
+
trailingWidth: showActionsColumn ? actionsColumnWidth : 0,
|
|
1037
|
+
widthRevision: storeRevision,
|
|
1038
|
+
getColumnKey: getColumnKeyByIndex,
|
|
1039
|
+
hasRowHeader: rowHeaders,
|
|
1040
|
+
hasActionsColumn: showActionsColumn
|
|
1041
|
+
});
|
|
1042
|
+
const columnVirtualizerRef = useRef(columnVirtualizer);
|
|
1043
|
+
columnVirtualizerRef.current = columnVirtualizer;
|
|
1044
|
+
useEffect(() => {
|
|
1045
|
+
if (!enableColumnVirtualization) return;
|
|
1046
|
+
let lastKey = "";
|
|
1047
|
+
const sync = () => {
|
|
1048
|
+
const sel = store.getSelection();
|
|
1049
|
+
const editing = store.getEditingCell();
|
|
1050
|
+
const next = [];
|
|
1051
|
+
if (sel.anchor) next.push(sel.anchor.col);
|
|
1052
|
+
if (sel.focus) next.push(sel.focus.col);
|
|
1053
|
+
if (editing) next.push(editing.col);
|
|
1054
|
+
const unique = Array.from(new Set(next)).sort((a, b) => a - b);
|
|
1055
|
+
const key = unique.join(",");
|
|
1056
|
+
if (key !== lastKey) {
|
|
1057
|
+
lastKey = key;
|
|
1058
|
+
setForcedColumnIndices(unique);
|
|
1059
|
+
}
|
|
1060
|
+
const target = editing?.col ?? sel.focus?.col ?? sel.anchor?.col;
|
|
1061
|
+
if (target != null) columnVirtualizerRef.current.scrollToColumn(target);
|
|
1062
|
+
};
|
|
1063
|
+
sync();
|
|
1064
|
+
const offSelection = store.subscribeToSelection(sync);
|
|
1065
|
+
const offEditing = store.subscribeToEditing(sync);
|
|
1066
|
+
return () => {
|
|
1067
|
+
offSelection();
|
|
1068
|
+
offEditing();
|
|
1069
|
+
};
|
|
1070
|
+
}, [store, enableColumnVirtualization]);
|
|
1071
|
+
useEffect(() => {
|
|
1072
|
+
let lastRow = -1;
|
|
1073
|
+
const sync = () => {
|
|
1074
|
+
const editing = store.getEditingCell();
|
|
1075
|
+
const sel = store.getSelection();
|
|
1076
|
+
const target = editing?.row ?? sel.focus?.row ?? sel.anchor?.row;
|
|
1077
|
+
if (target == null || target < 0 || target >= store.getRowCount()) return;
|
|
1078
|
+
if (target === lastRow) return;
|
|
1079
|
+
lastRow = target;
|
|
1080
|
+
const mounted = rowVirtualizer.getVirtualItems();
|
|
1081
|
+
if (mounted.length === 0) return;
|
|
1082
|
+
if (target >= mounted[0].index && target <= mounted[mounted.length - 1].index) return;
|
|
1083
|
+
rowVirtualizer.scrollToIndex(target, { align: "auto" });
|
|
1084
|
+
};
|
|
1085
|
+
const offSelection = store.subscribeToSelection(sync);
|
|
1086
|
+
const offEditing = store.subscribeToEditing(sync);
|
|
1087
|
+
return () => {
|
|
1088
|
+
offSelection();
|
|
1089
|
+
offEditing();
|
|
1090
|
+
};
|
|
1091
|
+
}, [store, rowVirtualizer]);
|
|
1092
|
+
const keyboardHandler = useKeyboardNavigation(store, cols.length, cols, autoEditOnTab, handleCellSave, siblingTableRefs);
|
|
1093
|
+
const shortcutHandler = useRowActionShortcuts(store, keyboardShortcuts, onRowAction);
|
|
1094
|
+
const handleTableClick = useCallback((e) => {
|
|
1095
|
+
if (!onRowClick) return;
|
|
1096
|
+
const target = e.target;
|
|
1097
|
+
if (target.closest("tr[data-group-header]")) return;
|
|
1098
|
+
if (target.closest("button, input, select, textarea, a, [data-no-row-click]")) return;
|
|
1099
|
+
const row = target.closest("tr[data-row]");
|
|
1100
|
+
if (!row) return;
|
|
1101
|
+
const rowIndex = parseInt(row.getAttribute("data-row") || "", 10);
|
|
1102
|
+
if (isNaN(rowIndex)) return;
|
|
1103
|
+
const rowData = store.getRowData(rowIndex);
|
|
1104
|
+
if (rowData) {
|
|
1105
|
+
onRowClick(rowIndex, rowData, e);
|
|
1106
|
+
}
|
|
1107
|
+
}, [store, onRowClick]);
|
|
1108
|
+
const collectBulkCells = useCallback(
|
|
1109
|
+
(bounds) => {
|
|
1110
|
+
const cells = [];
|
|
1111
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1112
|
+
for (let r = bounds.startRow; r <= bounds.endRow; r++) {
|
|
1113
|
+
const rData = store.getRowData(r);
|
|
1114
|
+
if (!rData) continue;
|
|
1115
|
+
for (let c = bounds.startCol; c <= bounds.endCol; c++) {
|
|
1116
|
+
const cConfig = cols[c];
|
|
1117
|
+
if (!cConfig) continue;
|
|
1118
|
+
const target = resolveCommentTarget(rData, cConfig);
|
|
1119
|
+
if (!target.entityType || !target.rowId) continue;
|
|
1120
|
+
const key = annotationKey(target, cConfig.data);
|
|
1121
|
+
if (seen.has(key)) continue;
|
|
1122
|
+
seen.add(key);
|
|
1123
|
+
cells.push({ entityType: target.entityType, rowId: target.rowId, columnKey: cConfig.data });
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
return cells;
|
|
1127
|
+
},
|
|
1128
|
+
[store, cols, resolveCommentTarget]
|
|
1129
|
+
);
|
|
1130
|
+
const resolveCommentCell = useCallback((el) => {
|
|
1131
|
+
const cell = el.closest("td[data-row][data-col]");
|
|
1132
|
+
if (!cell) return null;
|
|
1133
|
+
const rowIndex = parseInt(cell.getAttribute("data-row") || "", 10);
|
|
1134
|
+
const colIndex = parseInt(cell.getAttribute("data-col") || "", 10);
|
|
1135
|
+
if (Number.isNaN(rowIndex) || Number.isNaN(colIndex)) return null;
|
|
1136
|
+
const rowData = store.getRowData(rowIndex);
|
|
1137
|
+
const col = cols[colIndex];
|
|
1138
|
+
if (!rowData || !col) return null;
|
|
1139
|
+
const target = resolveCommentTarget(rowData, col);
|
|
1140
|
+
if (!target.rowId || !target.entityType) return null;
|
|
1141
|
+
return {
|
|
1142
|
+
rowIndex,
|
|
1143
|
+
colIndex,
|
|
1144
|
+
rowData,
|
|
1145
|
+
col,
|
|
1146
|
+
entityType: target.entityType,
|
|
1147
|
+
rowId: target.rowId,
|
|
1148
|
+
annotation: annotations.get(annotationKey(target, col.data)),
|
|
1149
|
+
cell
|
|
1150
|
+
};
|
|
1151
|
+
}, [store, cols, resolveCommentTarget, annotations]);
|
|
1152
|
+
const handleCellHoverOver = useCallback((e) => {
|
|
1153
|
+
if (!enableComments || !commentsEntityType) return;
|
|
1154
|
+
const td = e.target.closest?.("td.hot-cell[data-row][data-col]");
|
|
1155
|
+
if (!td || td.hasAttribute("data-actions-cell")) {
|
|
1156
|
+
store.setHoveredCell(null);
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
const row = Number(td.getAttribute("data-row"));
|
|
1160
|
+
const col = Number(td.getAttribute("data-col"));
|
|
1161
|
+
if (Number.isNaN(row) || Number.isNaN(col)) {
|
|
1162
|
+
store.setHoveredCell(null);
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1165
|
+
store.setHoveredCell({ row, col });
|
|
1166
|
+
}, [enableComments, commentsEntityType, store]);
|
|
1167
|
+
const handleCommentHoverOver = useCallback((e) => {
|
|
1168
|
+
if (!enableComments || !commentsEntityType) return;
|
|
1169
|
+
const indicator = e.target.closest?.(".cell-comment-indicator");
|
|
1170
|
+
if (!indicator) return;
|
|
1171
|
+
const info = resolveCommentCell(indicator);
|
|
1172
|
+
if (!info?.annotation || info.annotation.comments.length === 0) return;
|
|
1173
|
+
setCommentHover({
|
|
1174
|
+
comments: info.annotation.comments,
|
|
1175
|
+
columnTitle: info.col.title || info.col.data,
|
|
1176
|
+
anchorRect: indicator.getBoundingClientRect()
|
|
1177
|
+
});
|
|
1178
|
+
}, [enableComments, commentsEntityType, resolveCommentCell]);
|
|
1179
|
+
const handleCommentHoverOut = useCallback((e) => {
|
|
1180
|
+
const indicator = e.target.closest?.(".cell-comment-indicator");
|
|
1181
|
+
if (!indicator) return;
|
|
1182
|
+
const related = e.relatedTarget;
|
|
1183
|
+
if (related && indicator.contains(related)) return;
|
|
1184
|
+
setCommentHover(null);
|
|
1185
|
+
}, []);
|
|
1186
|
+
const handleCommentMouseDown = useCallback((e) => {
|
|
1187
|
+
if (!enableComments || !commentsEntityType) return false;
|
|
1188
|
+
const indicator = e.target.closest?.(".cell-comment-indicator");
|
|
1189
|
+
if (indicator) {
|
|
1190
|
+
const info = resolveCommentCell(indicator);
|
|
1191
|
+
if (info) {
|
|
1192
|
+
e.preventDefault();
|
|
1193
|
+
e.stopPropagation();
|
|
1194
|
+
setCommentHover(null);
|
|
1195
|
+
setCommentDialog({
|
|
1196
|
+
entityType: info.entityType,
|
|
1197
|
+
rowId: info.rowId,
|
|
1198
|
+
columnKey: info.col.data,
|
|
1199
|
+
columnTitle: info.col.title || info.col.data,
|
|
1200
|
+
rowLabel: info.rowData.name || info.rowData.title || void 0,
|
|
1201
|
+
annotationId: info.annotation?.id || null,
|
|
1202
|
+
currentColor: info.annotation?.color || null,
|
|
1203
|
+
anchorRect: info.cell.getBoundingClientRect()
|
|
1204
|
+
});
|
|
1205
|
+
return true;
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
if (!e.shiftKey) return false;
|
|
1209
|
+
const target = e.target;
|
|
1210
|
+
const cell = target.closest("td[data-row][data-col]");
|
|
1211
|
+
if (!cell) return false;
|
|
1212
|
+
const rowIndex = parseInt(cell.getAttribute("data-row") || "", 10);
|
|
1213
|
+
const colIndex = parseInt(cell.getAttribute("data-col") || "", 10);
|
|
1214
|
+
if (isNaN(rowIndex) || isNaN(colIndex)) return false;
|
|
1215
|
+
const rowData = store.getRowData(rowIndex);
|
|
1216
|
+
const colConfig = cols[colIndex];
|
|
1217
|
+
if (!rowData || !colConfig) return false;
|
|
1218
|
+
const cellTarget = resolveCommentTarget(rowData, colConfig);
|
|
1219
|
+
if (!cellTarget.entityType || !cellTarget.rowId) return false;
|
|
1220
|
+
const bounds = store.getSelectionBounds();
|
|
1221
|
+
const isMultiCell = bounds && (bounds.startRow !== bounds.endRow || bounds.startCol !== bounds.endCol);
|
|
1222
|
+
if (isMultiCell && bounds) {
|
|
1223
|
+
const bulkCells = collectBulkCells(bounds);
|
|
1224
|
+
if (bulkCells.length > 1) {
|
|
1225
|
+
e.preventDefault();
|
|
1226
|
+
e.stopPropagation();
|
|
1227
|
+
setCommentDialog({
|
|
1228
|
+
entityType: cellTarget.entityType,
|
|
1229
|
+
rowId: cellTarget.rowId,
|
|
1230
|
+
columnKey: colConfig.data,
|
|
1231
|
+
columnTitle: colConfig.title || colConfig.data,
|
|
1232
|
+
anchorRect: cell.getBoundingClientRect(),
|
|
1233
|
+
bulkCells
|
|
1234
|
+
});
|
|
1235
|
+
return true;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
e.preventDefault();
|
|
1239
|
+
e.stopPropagation();
|
|
1240
|
+
const annotation = annotations.get(annotationKey(cellTarget, colConfig.data));
|
|
1241
|
+
setCommentDialog({
|
|
1242
|
+
entityType: cellTarget.entityType,
|
|
1243
|
+
rowId: cellTarget.rowId,
|
|
1244
|
+
columnKey: colConfig.data,
|
|
1245
|
+
columnTitle: colConfig.title || colConfig.data,
|
|
1246
|
+
rowLabel: rowData.name || rowData.title || void 0,
|
|
1247
|
+
annotationId: annotation?.id || null,
|
|
1248
|
+
currentColor: annotation?.color || null,
|
|
1249
|
+
anchorRect: cell.getBoundingClientRect()
|
|
1250
|
+
});
|
|
1251
|
+
return true;
|
|
1252
|
+
}, [enableComments, commentsEntityType, store, cols, resolveCommentTarget, collectBulkCells, annotations]);
|
|
1253
|
+
const [rangePhase, setRangePhase] = useState("idle");
|
|
1254
|
+
const rangePhaseRef = useRef("idle");
|
|
1255
|
+
const rangeExitTimerRef = useRef(null);
|
|
1256
|
+
const applyRangePhase = useCallback((p) => {
|
|
1257
|
+
rangePhaseRef.current = p;
|
|
1258
|
+
setRangePhase(p);
|
|
1259
|
+
}, []);
|
|
1260
|
+
const clearSelectionAnimated = useCallback(() => {
|
|
1261
|
+
if (rangePhaseRef.current === "committed") {
|
|
1262
|
+
applyRangePhase("exiting");
|
|
1263
|
+
if (rangeExitTimerRef.current) window.clearTimeout(rangeExitTimerRef.current);
|
|
1264
|
+
rangeExitTimerRef.current = window.setTimeout(() => {
|
|
1265
|
+
store.setSelection({ type: null, anchor: null, focus: null });
|
|
1266
|
+
applyRangePhase("idle");
|
|
1267
|
+
rangeExitTimerRef.current = null;
|
|
1268
|
+
}, 170);
|
|
1269
|
+
} else {
|
|
1270
|
+
store.setSelection({ type: null, anchor: null, focus: null });
|
|
1271
|
+
applyRangePhase("idle");
|
|
1272
|
+
}
|
|
1273
|
+
}, [store, applyRangePhase]);
|
|
1274
|
+
const copySelectionToClipboard = useCallback(() => {
|
|
1275
|
+
const cells = store.getCellsInSelection();
|
|
1276
|
+
const bounds = store.getSelectionBounds();
|
|
1277
|
+
if (!cells.length || !bounds) return;
|
|
1278
|
+
const text = selectionToTsv(cells, bounds);
|
|
1279
|
+
store.setClipboardMarker({ mode: "copy", bounds });
|
|
1280
|
+
void navigator.clipboard?.writeText(text).then(() => flash(t("dynamicTable.cellMenu.copied", "Copied to clipboard"), "success")).catch(() => {
|
|
1281
|
+
store.setClipboardMarker(null);
|
|
1282
|
+
flash(t("dynamicTable.cellMenu.copyFailed", "Could not copy to clipboard"), "error");
|
|
1283
|
+
});
|
|
1284
|
+
}, [store, t]);
|
|
1285
|
+
const copyRowSelectionText = useCallback(() => {
|
|
1286
|
+
if (selectedRowIds.size === 0) return null;
|
|
1287
|
+
const rowCount2 = store.getRowCount();
|
|
1288
|
+
const lines = [];
|
|
1289
|
+
for (let r = 0; r < rowCount2; r++) {
|
|
1290
|
+
const rowData = store.getRowData(r);
|
|
1291
|
+
if (!rowData) continue;
|
|
1292
|
+
const id = String(rowData[selectionColumnName] ?? "");
|
|
1293
|
+
if (!id || !selectedRowIds.has(id)) continue;
|
|
1294
|
+
lines.push(cols.map((_, c) => String(store.getCellValue(r, c) ?? "")).join(" "));
|
|
1295
|
+
}
|
|
1296
|
+
return lines.length ? lines.join("\n") : null;
|
|
1297
|
+
}, [store, selectedRowIds, selectionColumnName, cols]);
|
|
1298
|
+
const handleCopied = useCallback((bounds) => {
|
|
1299
|
+
if (bounds) store.setClipboardMarker({ mode: "copy", bounds });
|
|
1300
|
+
flash(t("dynamicTable.cellMenu.copied", "Copied to clipboard"), "success");
|
|
1301
|
+
}, [store, t]);
|
|
1302
|
+
const handleCopy = useCopyHandler(store, tableRef, {
|
|
1303
|
+
getFallbackText: copyRowSelectionText,
|
|
1304
|
+
onCopy: handleCopied
|
|
1305
|
+
});
|
|
1306
|
+
const handleBulkCopy = useCallback(() => {
|
|
1307
|
+
const text = copyRowSelectionText();
|
|
1308
|
+
if (!text) return;
|
|
1309
|
+
void navigator.clipboard?.writeText(text).then(() => flash(t("dynamicTable.cellMenu.copied", "Copied to clipboard"), "success")).catch(() => flash(t("dynamicTable.cellMenu.copyFailed", "Could not copy to clipboard"), "error"));
|
|
1310
|
+
}, [copyRowSelectionText, t]);
|
|
1311
|
+
const serializeAndDownload = useCallback(async (table, format) => {
|
|
1312
|
+
if (table.rows.length === 0) {
|
|
1313
|
+
flash(t("dynamicTable.export.empty", "No rows to export"), "info");
|
|
1314
|
+
return;
|
|
1315
|
+
}
|
|
1316
|
+
const stem = exportFileName?.trim() || slugifyFileName(displayTableName);
|
|
1317
|
+
try {
|
|
1318
|
+
if (format === "csv") {
|
|
1319
|
+
const blob = new Blob([toCsv(table)], { type: "text/csv;charset=utf-8" });
|
|
1320
|
+
downloadBlob(blob, `${stem}.csv`);
|
|
1321
|
+
} else {
|
|
1322
|
+
const XLSX = await import("xlsx");
|
|
1323
|
+
downloadBlob(toXlsxBlob(table, XLSX), `${stem}.xlsx`);
|
|
1324
|
+
}
|
|
1325
|
+
flash(t("dynamicTable.export.success", "Export ready"), "success");
|
|
1326
|
+
} catch {
|
|
1327
|
+
flash(t("dynamicTable.export.failed", "Could not export"), "error");
|
|
1328
|
+
}
|
|
1329
|
+
}, [exportFileName, displayTableName, t]);
|
|
1330
|
+
const handleExportSelection = useCallback((format) => {
|
|
1331
|
+
void serializeAndDownload(
|
|
1332
|
+
extractExportRows(store, cols, selectedRowIds, selectionColumnName),
|
|
1333
|
+
format
|
|
1334
|
+
);
|
|
1335
|
+
}, [serializeAndDownload, store, cols, selectedRowIds, selectionColumnName]);
|
|
1336
|
+
const [isExportingAll, setIsExportingAll] = useState(false);
|
|
1337
|
+
const handleExportAll = useCallback(async (format) => {
|
|
1338
|
+
if (isExportingAll) return;
|
|
1339
|
+
setIsExportingAll(true);
|
|
1340
|
+
try {
|
|
1341
|
+
const outcome = onExportAll ? await onExportAll() : data;
|
|
1342
|
+
const counted = outcome != null && !Array.isArray(outcome) ? outcome : null;
|
|
1343
|
+
const rows = counted ? counted.rows : outcome;
|
|
1344
|
+
if (counted && !counted.complete) {
|
|
1345
|
+
flash(
|
|
1346
|
+
t(
|
|
1347
|
+
"dynamicTable.export.incomplete",
|
|
1348
|
+
"Export stopped early and was NOT saved \u2014 {reason}. Try again.",
|
|
1349
|
+
{ reason: counted.reason ?? "the full table could not be read" }
|
|
1350
|
+
),
|
|
1351
|
+
"error"
|
|
1352
|
+
);
|
|
1353
|
+
return;
|
|
1354
|
+
}
|
|
1355
|
+
await serializeAndDownload(extractExportRowsFromData(rows ?? [], baseColumns), format);
|
|
1356
|
+
} catch (err) {
|
|
1357
|
+
const detail = err instanceof Error && err.message ? err.message : null;
|
|
1358
|
+
flash(
|
|
1359
|
+
detail ? t("dynamicTable.export.failedDetail", "Could not export \u2014 {detail}", { detail }) : t("dynamicTable.export.failed", "Could not export"),
|
|
1360
|
+
"error"
|
|
1361
|
+
);
|
|
1362
|
+
} finally {
|
|
1363
|
+
setIsExportingAll(false);
|
|
1364
|
+
}
|
|
1365
|
+
}, [isExportingAll, onExportAll, data, serializeAndDownload, baseColumns, t]);
|
|
1366
|
+
const openAnnotateForSelection = useCallback(() => {
|
|
1367
|
+
if (!enableComments || !commentsEntityType) return;
|
|
1368
|
+
const bounds = store.getSelectionBounds();
|
|
1369
|
+
if (!bounds) return;
|
|
1370
|
+
const anchorCell = tableRef.current?.querySelector(
|
|
1371
|
+
`td[data-row="${bounds.endRow}"][data-col="${bounds.endCol}"]`
|
|
1372
|
+
);
|
|
1373
|
+
const anchorRect = anchorCell?.getBoundingClientRect() ?? (() => {
|
|
1374
|
+
const el = tableRef.current;
|
|
1375
|
+
if (!el) return void 0;
|
|
1376
|
+
const box = el.getBoundingClientRect();
|
|
1377
|
+
const geo = columnVirtualizer.geometry;
|
|
1378
|
+
const x = box.left + (geo.starts[bounds.endCol] ?? 0) - el.scrollLeft;
|
|
1379
|
+
const y = box.top + bounds.endRow * dataRowHeight - el.scrollTop;
|
|
1380
|
+
const width2 = store.getColumnWidth(bounds.endCol);
|
|
1381
|
+
return new DOMRect(x, y, width2, dataRowHeight);
|
|
1382
|
+
})();
|
|
1383
|
+
const firstRowData = store.getRowData(bounds.startRow);
|
|
1384
|
+
const firstCol = cols[bounds.startCol];
|
|
1385
|
+
if (!firstRowData || !firstCol) return;
|
|
1386
|
+
const firstTarget = resolveCommentTarget(firstRowData, firstCol);
|
|
1387
|
+
if (!firstTarget.entityType || !firstTarget.rowId) return;
|
|
1388
|
+
const isMultiCell = bounds.startRow !== bounds.endRow || bounds.startCol !== bounds.endCol;
|
|
1389
|
+
if (isMultiCell) {
|
|
1390
|
+
const bulkCells = collectBulkCells(bounds);
|
|
1391
|
+
if (bulkCells.length > 1) {
|
|
1392
|
+
setCommentDialog({
|
|
1393
|
+
entityType: firstTarget.entityType,
|
|
1394
|
+
rowId: firstTarget.rowId,
|
|
1395
|
+
columnKey: firstCol.data,
|
|
1396
|
+
columnTitle: firstCol.title || firstCol.data,
|
|
1397
|
+
anchorRect,
|
|
1398
|
+
bulkCells
|
|
1399
|
+
});
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
const annotation = annotations.get(annotationKey(firstTarget, firstCol.data));
|
|
1404
|
+
setCommentDialog({
|
|
1405
|
+
entityType: firstTarget.entityType,
|
|
1406
|
+
rowId: firstTarget.rowId,
|
|
1407
|
+
columnKey: firstCol.data,
|
|
1408
|
+
columnTitle: firstCol.title || firstCol.data,
|
|
1409
|
+
rowLabel: firstRowData.name || firstRowData.title || void 0,
|
|
1410
|
+
annotationId: annotation?.id || null,
|
|
1411
|
+
currentColor: annotation?.color || null,
|
|
1412
|
+
anchorRect
|
|
1413
|
+
});
|
|
1414
|
+
}, [enableComments, commentsEntityType, store, cols, resolveCommentTarget, collectBulkCells, annotations, columnVirtualizer, dataRowHeight]);
|
|
1415
|
+
const handleMouseUpWithMenu = useCallback(() => {
|
|
1416
|
+
handleMouseUp();
|
|
1417
|
+
const bounds = store.getSelectionBounds();
|
|
1418
|
+
const isRange = !!bounds && (bounds.startRow !== bounds.endRow || bounds.startCol !== bounds.endCol);
|
|
1419
|
+
if (isRange) applyRangePhase("committed");
|
|
1420
|
+
}, [handleMouseUp, store, applyRangePhase]);
|
|
1421
|
+
const fillStateRef = useRef(null);
|
|
1422
|
+
const [pendingWrite, setPendingWrite] = useState(null);
|
|
1423
|
+
const readFillSeed = useCallback(
|
|
1424
|
+
(cells, seedColIndex) => {
|
|
1425
|
+
const column = cols[seedColIndex];
|
|
1426
|
+
const values = cells.map(({ row, col }) => {
|
|
1427
|
+
const raw = store.getCellValue(row, col);
|
|
1428
|
+
return cols[col]?.type === "boolean" ? Boolean(raw) : raw;
|
|
1429
|
+
});
|
|
1430
|
+
return { values, column };
|
|
1431
|
+
},
|
|
1432
|
+
[cols, store]
|
|
1433
|
+
);
|
|
1434
|
+
const paintFillPreview = useCallback(() => {
|
|
1435
|
+
const fs = fillStateRef.current;
|
|
1436
|
+
if (!fs) return;
|
|
1437
|
+
const geometry = computeFillPreview(fs.source, fs.pointer, {
|
|
1438
|
+
modifier: false,
|
|
1439
|
+
defaultMode: "series"
|
|
1440
|
+
});
|
|
1441
|
+
const [firstLine] = buildFillLines(geometry);
|
|
1442
|
+
let defaultMode = "copy";
|
|
1443
|
+
if (firstLine && firstLine.seedCells.length > 0) {
|
|
1444
|
+
defaultMode = detectFillPattern(readFillSeed(firstLine.seedCells, firstLine.seedCol)).defaultMode;
|
|
1445
|
+
}
|
|
1446
|
+
const mode = fs.modifier ? invertFillMode(defaultMode) : defaultMode;
|
|
1447
|
+
store.setFillPreview({ ...geometry, mode });
|
|
1448
|
+
}, [store, readFillSeed]);
|
|
1449
|
+
const handleFillMouseDown = useCallback((e) => {
|
|
1450
|
+
if (!enableFillHandle) return false;
|
|
1451
|
+
if (!e.target.closest("[data-fill-handle]")) return false;
|
|
1452
|
+
const bounds = store.getSelectionBounds();
|
|
1453
|
+
if (!bounds) return false;
|
|
1454
|
+
const anyFillable = (() => {
|
|
1455
|
+
for (let c = bounds.startCol; c <= bounds.endCol; c++) {
|
|
1456
|
+
const col = cols[c];
|
|
1457
|
+
if (col && !col.readOnly && !col.disableFill) return true;
|
|
1458
|
+
}
|
|
1459
|
+
return false;
|
|
1460
|
+
})();
|
|
1461
|
+
if (!anyFillable) return false;
|
|
1462
|
+
fillStateRef.current = {
|
|
1463
|
+
source: bounds,
|
|
1464
|
+
pointer: { row: bounds.endRow, col: bounds.endCol },
|
|
1465
|
+
modifier: e.altKey || e.ctrlKey
|
|
1466
|
+
};
|
|
1467
|
+
paintFillPreview();
|
|
1468
|
+
e.preventDefault();
|
|
1469
|
+
return true;
|
|
1470
|
+
}, [enableFillHandle, store, cols, paintFillPreview]);
|
|
1471
|
+
const handleFillMouseMove = useCallback((e) => {
|
|
1472
|
+
const fs = fillStateRef.current;
|
|
1473
|
+
if (!fs) return;
|
|
1474
|
+
const cell = document.elementFromPoint(e.clientX, e.clientY)?.closest("td");
|
|
1475
|
+
if (!cell) return;
|
|
1476
|
+
if (cell.hasAttribute("data-row-header") || cell.hasAttribute("data-actions-cell")) return;
|
|
1477
|
+
const row = parseInt(cell.getAttribute("data-row") || "", 10);
|
|
1478
|
+
const col = parseInt(cell.getAttribute("data-col") || "", 10);
|
|
1479
|
+
if (Number.isNaN(row) || Number.isNaN(col)) return;
|
|
1480
|
+
if (col < 0 || col >= cols.length) return;
|
|
1481
|
+
fs.pointer = { row, col };
|
|
1482
|
+
fs.modifier = e.altKey || e.ctrlKey;
|
|
1483
|
+
paintFillPreview();
|
|
1484
|
+
}, [cols, paintFillPreview]);
|
|
1485
|
+
const [writeRevision, setWriteRevision] = useState(0);
|
|
1486
|
+
const writeCells = useCallback(
|
|
1487
|
+
(writes, origin, respectDisableFill) => {
|
|
1488
|
+
const report = applyCellWrites(
|
|
1489
|
+
{
|
|
1490
|
+
store,
|
|
1491
|
+
columns: cols,
|
|
1492
|
+
handleCellSave,
|
|
1493
|
+
coerce: coerceCellValue,
|
|
1494
|
+
element: tableRef.current,
|
|
1495
|
+
idColumnName
|
|
1496
|
+
},
|
|
1497
|
+
writes,
|
|
1498
|
+
{ origin, respectDisableFill }
|
|
1499
|
+
);
|
|
1500
|
+
if (report.written > 0) setWriteRevision((n) => n + 1);
|
|
1501
|
+
return report;
|
|
1502
|
+
},
|
|
1503
|
+
[store, cols, handleCellSave, idColumnName, tableRef]
|
|
1504
|
+
);
|
|
1505
|
+
const reportWrite = useCallback((report) => {
|
|
1506
|
+
if (report.rejected.length === 0) {
|
|
1507
|
+
if (report.written > 0) {
|
|
1508
|
+
const applied = report.origin === "cut" ? t("dynamicTable.cut.done", "Cut {count} cells", { count: report.written }) : report.origin === "clear" ? t("dynamicTable.clear.done", "Cleared {count} cells", { count: report.written }) : t("dynamicTable.write.applied", "Updated {count} cells", { count: report.written });
|
|
1509
|
+
flash(applied, "success");
|
|
1510
|
+
}
|
|
1511
|
+
return;
|
|
1512
|
+
}
|
|
1513
|
+
const parts = [];
|
|
1514
|
+
const r = report.rejectedByReason;
|
|
1515
|
+
if (r.readOnly) parts.push(t("dynamicTable.write.rejectedReadOnly", "{count} read-only", { count: r.readOnly }));
|
|
1516
|
+
if (r.notCoercible) parts.push(t("dynamicTable.write.rejectedNotCoercible", "{count} wrong type", { count: r.notCoercible }));
|
|
1517
|
+
if (r.notInSource) parts.push(t("dynamicTable.write.rejectedNotInSource", "{count} not an allowed value", { count: r.notInSource }));
|
|
1518
|
+
if (r.required) parts.push(t("dynamicTable.write.rejectedRequired", "{count} required", { count: r.required }));
|
|
1519
|
+
if (r.outOfRange) parts.push(t("dynamicTable.write.rejectedOutOfRange", "{count} outside the table", { count: r.outOfRange }));
|
|
1520
|
+
flash(
|
|
1521
|
+
t("dynamicTable.write.partial", "Updated {written} cells; skipped {skipped} ({reasons})", {
|
|
1522
|
+
written: report.written,
|
|
1523
|
+
skipped: report.rejected.length,
|
|
1524
|
+
reasons: parts.join(", ")
|
|
1525
|
+
}),
|
|
1526
|
+
report.written > 0 ? "info" : "error"
|
|
1527
|
+
);
|
|
1528
|
+
}, [t]);
|
|
1529
|
+
const submitWrites = useCallback((writes, origin) => {
|
|
1530
|
+
if (writes.length === 0) return;
|
|
1531
|
+
if (writes.length > fillConfirmThreshold) {
|
|
1532
|
+
setPendingWrite({ writes, origin });
|
|
1533
|
+
return;
|
|
1534
|
+
}
|
|
1535
|
+
reportWrite(writeCells(writes, origin));
|
|
1536
|
+
}, [fillConfirmThreshold, reportWrite, writeCells]);
|
|
1537
|
+
const commitFill = useCallback(() => {
|
|
1538
|
+
const fs = fillStateRef.current;
|
|
1539
|
+
if (!fs) return;
|
|
1540
|
+
fillStateRef.current = null;
|
|
1541
|
+
const preview = store.getFillPreview();
|
|
1542
|
+
if (!preview) {
|
|
1543
|
+
store.setFillPreview(null);
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1546
|
+
if (preview.clearing && preview.cleared) {
|
|
1547
|
+
const writes2 = cellsInRect(preview.cleared).map(({ row, col }) => ({
|
|
1548
|
+
row,
|
|
1549
|
+
col,
|
|
1550
|
+
value: null
|
|
1551
|
+
}));
|
|
1552
|
+
if (writes2.length === 0) {
|
|
1553
|
+
store.setFillPreview(null);
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
if (writes2.length > fillConfirmThreshold) {
|
|
1557
|
+
setPendingWrite({ writes: writes2, origin: "clear", respectDisableFill: true });
|
|
1558
|
+
return;
|
|
1559
|
+
}
|
|
1560
|
+
reportWrite(writeCells(writes2, "clear", true));
|
|
1561
|
+
store.setFillPreview(null);
|
|
1562
|
+
return;
|
|
1563
|
+
}
|
|
1564
|
+
const writes = [];
|
|
1565
|
+
for (const line of buildFillLines(preview)) {
|
|
1566
|
+
if (line.targets.length === 0) continue;
|
|
1567
|
+
const seed = readFillSeed(line.seedCells, line.seedCol);
|
|
1568
|
+
const pattern = detectFillPattern(seed);
|
|
1569
|
+
const mode = fs.modifier ? invertFillMode(pattern.defaultMode) : pattern.defaultMode;
|
|
1570
|
+
const values = generateFill(seed, line.targets.length, preview.backwards ? -1 : 1, mode);
|
|
1571
|
+
line.targets.forEach((cell, i) => {
|
|
1572
|
+
writes.push({ row: cell.row, col: cell.col, value: values[i] });
|
|
1573
|
+
});
|
|
1574
|
+
}
|
|
1575
|
+
if (writes.length === 0) {
|
|
1576
|
+
store.setFillPreview(null);
|
|
1577
|
+
return;
|
|
1578
|
+
}
|
|
1579
|
+
if (writes.length > fillConfirmThreshold) {
|
|
1580
|
+
setPendingWrite({ writes, origin: "fill" });
|
|
1581
|
+
return;
|
|
1582
|
+
}
|
|
1583
|
+
reportWrite(writeCells(writes, "fill"));
|
|
1584
|
+
store.setFillPreview(null);
|
|
1585
|
+
}, [store, fillConfirmThreshold, writeCells, reportWrite, readFillSeed]);
|
|
1586
|
+
const confirmPendingWrite = useCallback(() => {
|
|
1587
|
+
if (pendingWrite) {
|
|
1588
|
+
reportWrite(
|
|
1589
|
+
writeCells(pendingWrite.writes, pendingWrite.origin, pendingWrite.respectDisableFill)
|
|
1590
|
+
);
|
|
1591
|
+
}
|
|
1592
|
+
setPendingWrite(null);
|
|
1593
|
+
store.setFillPreview(null);
|
|
1594
|
+
}, [pendingWrite, writeCells, reportWrite, store]);
|
|
1595
|
+
const cancelPendingWrite = useCallback(() => {
|
|
1596
|
+
setPendingWrite(null);
|
|
1597
|
+
store.setFillPreview(null);
|
|
1598
|
+
}, [store]);
|
|
1599
|
+
const scrollToCell = useCallback((row, col) => {
|
|
1600
|
+
const groupKey = groupingResult.groupKeyOfDataIndex(row);
|
|
1601
|
+
if (groupKey && groupingResult.collapsedGroups.has(groupKey)) {
|
|
1602
|
+
groupingResult.toggleGroup(groupKey);
|
|
1603
|
+
}
|
|
1604
|
+
const visualIndex = groupingResult.visualRows ? groupingResult.dataIndexToVisualIndex(row) : row;
|
|
1605
|
+
rowVirtualizer.scrollToIndex(visualIndex, { align: "center" });
|
|
1606
|
+
columnVirtualizerRef.current.scrollToColumn(col, { align: "auto" });
|
|
1607
|
+
}, [groupingResult, rowVirtualizer]);
|
|
1608
|
+
const handleSearchWholeDataset = useCallback((query) => {
|
|
1609
|
+
if (!tableRef.current) return;
|
|
1610
|
+
dispatch(tableRef.current, TableEvents.SEARCH, { query, timestamp: Date.now() });
|
|
1611
|
+
}, [tableRef]);
|
|
1612
|
+
const handleClearSearch = useCallback(() => {
|
|
1613
|
+
handleSearchWholeDataset("");
|
|
1614
|
+
}, [handleSearchWholeDataset]);
|
|
1615
|
+
const handlePaste = useCallback((e) => {
|
|
1616
|
+
const container = tableRef.current;
|
|
1617
|
+
if (!container || !(e.target instanceof Node) || !container.contains(e.target)) return;
|
|
1618
|
+
if (store.getEditingCell()) return;
|
|
1619
|
+
const bounds = store.getSelectionBounds();
|
|
1620
|
+
if (!bounds) return;
|
|
1621
|
+
const grid = parseClipboardGrid({
|
|
1622
|
+
html: e.clipboardData?.getData("text/html"),
|
|
1623
|
+
text: e.clipboardData?.getData("text/plain")
|
|
1624
|
+
});
|
|
1625
|
+
if (grid.source === "empty") {
|
|
1626
|
+
flash(t("dynamicTable.paste.empty", "The clipboard has nothing to paste"), "info");
|
|
1627
|
+
return;
|
|
1628
|
+
}
|
|
1629
|
+
e.preventDefault();
|
|
1630
|
+
const selRows = bounds.endRow - bounds.startRow + 1;
|
|
1631
|
+
const selCols = bounds.endCol - bounds.startCol + 1;
|
|
1632
|
+
const tile = selRows >= grid.rowCount && selCols >= grid.colCount && selRows % grid.rowCount === 0 && selCols % grid.colCount === 0;
|
|
1633
|
+
const spanRows = tile ? selRows : grid.rowCount;
|
|
1634
|
+
const spanCols = tile ? selCols : grid.colCount;
|
|
1635
|
+
const writes = [];
|
|
1636
|
+
for (let dr = 0; dr < spanRows; dr++) {
|
|
1637
|
+
for (let dc = 0; dc < spanCols; dc++) {
|
|
1638
|
+
writes.push({
|
|
1639
|
+
row: bounds.startRow + dr,
|
|
1640
|
+
col: bounds.startCol + dc,
|
|
1641
|
+
value: grid.rows[dr % grid.rowCount]?.[dc % grid.colCount] ?? ""
|
|
1642
|
+
});
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
submitWrites(writes, "paste");
|
|
1646
|
+
store.setClipboardMarker(null);
|
|
1647
|
+
}, [store, tableRef, submitWrites, t]);
|
|
1648
|
+
const rectWrites = useCallback((bounds, value) => {
|
|
1649
|
+
const writes = [];
|
|
1650
|
+
for (let r = bounds.startRow; r <= bounds.endRow; r++) {
|
|
1651
|
+
for (let c = bounds.startCol; c <= bounds.endCol; c++) {
|
|
1652
|
+
writes.push({ row: r, col: c, value });
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
return writes;
|
|
1656
|
+
}, []);
|
|
1657
|
+
const clearSelectionContents = useCallback(() => {
|
|
1658
|
+
const bounds = store.getSelectionBounds();
|
|
1659
|
+
if (!bounds) return false;
|
|
1660
|
+
submitWrites(rectWrites(bounds, null), "clear");
|
|
1661
|
+
return true;
|
|
1662
|
+
}, [store, rectWrites, submitWrites]);
|
|
1663
|
+
const handleCut = useCallback((e) => {
|
|
1664
|
+
const container = tableRef.current;
|
|
1665
|
+
if (!container || !(e.target instanceof Node) || !container.contains(e.target)) return;
|
|
1666
|
+
if (store.getEditingCell()) return;
|
|
1667
|
+
const bounds = store.getSelectionBounds();
|
|
1668
|
+
const cells = store.getCellsInSelection();
|
|
1669
|
+
if (!bounds || cells.length === 0 || !e.clipboardData) return;
|
|
1670
|
+
e.clipboardData.setData("text/plain", selectionToTsv(cells, bounds));
|
|
1671
|
+
e.preventDefault();
|
|
1672
|
+
submitWrites(rectWrites(bounds, null), "cut");
|
|
1673
|
+
store.setClipboardMarker({ mode: "cut", bounds });
|
|
1674
|
+
}, [store, tableRef, rectWrites, submitWrites]);
|
|
1675
|
+
const applyUndoEntry = useCallback((entry, useOldValue) => {
|
|
1676
|
+
store.setUndoSuppressed(true);
|
|
1677
|
+
try {
|
|
1678
|
+
for (const ch of entry.changes) {
|
|
1679
|
+
const rowIdx = store.findRowIndexById(idColumnName, ch.rowId);
|
|
1680
|
+
const colIdx = cols.findIndex((c) => c.data === ch.colKey);
|
|
1681
|
+
if (rowIdx >= 0 && colIdx >= 0) {
|
|
1682
|
+
handleCellSave(rowIdx, colIdx, useOldValue ? ch.oldValue : ch.newValue, false);
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
} finally {
|
|
1686
|
+
store.setUndoSuppressed(false);
|
|
1687
|
+
}
|
|
1688
|
+
}, [store, cols, idColumnName, handleCellSave]);
|
|
1689
|
+
const undo = useCallback(() => {
|
|
1690
|
+
const entry = store.popUndo();
|
|
1691
|
+
if (!entry) return;
|
|
1692
|
+
applyUndoEntry(entry, true);
|
|
1693
|
+
store.pushRedo(entry);
|
|
1694
|
+
flash(t("dynamicTable.undo.undone", "Undone"), "info");
|
|
1695
|
+
}, [store, applyUndoEntry, t]);
|
|
1696
|
+
const redo = useCallback(() => {
|
|
1697
|
+
const entry = store.popRedo();
|
|
1698
|
+
if (!entry) return;
|
|
1699
|
+
applyUndoEntry(entry, false);
|
|
1700
|
+
store.pushUndo(entry);
|
|
1701
|
+
flash(t("dynamicTable.undo.redone", "Redone"), "info");
|
|
1702
|
+
}, [store, applyUndoEntry, t]);
|
|
1703
|
+
const handleMenuActionClick = useCallback((actionId) => {
|
|
1704
|
+
if (actionId === SELECTION_COPY_ID) {
|
|
1705
|
+
copySelectionToClipboard();
|
|
1706
|
+
setContextMenu(null);
|
|
1707
|
+
clearSelectionAnimated();
|
|
1708
|
+
return;
|
|
1709
|
+
}
|
|
1710
|
+
if (actionId === SELECTION_ANNOTATE_ID) {
|
|
1711
|
+
openAnnotateForSelection();
|
|
1712
|
+
setContextMenu(null);
|
|
1713
|
+
return;
|
|
1714
|
+
}
|
|
1715
|
+
handleContextMenuAction(actionId);
|
|
1716
|
+
}, [copySelectionToClipboard, openAnnotateForSelection, handleContextMenuAction, clearSelectionAnimated]);
|
|
1717
|
+
const handleCellContextMenu = useCallback((e, rowIndex, colIndex) => {
|
|
1718
|
+
const rowData = store.getRowData(rowIndex);
|
|
1719
|
+
const col = cols[colIndex];
|
|
1720
|
+
if (!col) return;
|
|
1721
|
+
const bounds = store.getSelectionBounds();
|
|
1722
|
+
const insideSelection = !!bounds && rowIndex >= bounds.startRow && rowIndex <= bounds.endRow && colIndex >= bounds.startCol && colIndex <= bounds.endCol;
|
|
1723
|
+
if (!insideSelection) {
|
|
1724
|
+
store.setSelection({ type: "range", anchor: { row: rowIndex, col: colIndex }, focus: { row: rowIndex, col: colIndex } });
|
|
1725
|
+
}
|
|
1726
|
+
const actions = [
|
|
1727
|
+
{ id: SELECTION_COPY_ID, label: t("dynamicTable.cellMenu.copy", "Copy") }
|
|
1728
|
+
];
|
|
1729
|
+
if (enableComments && commentsEntityType) {
|
|
1730
|
+
actions.push({ id: SELECTION_ANNOTATE_ID, label: t("dynamicTable.cellMenu.annotate", "Comment / colour") });
|
|
1731
|
+
}
|
|
1732
|
+
if (cellActions) actions.push(...cellActions(rowData, col, rowIndex, colIndex));
|
|
1733
|
+
e.preventDefault();
|
|
1734
|
+
setContextMenu({ isOpen: true, position: { x: e.clientX, y: e.clientY }, actions, type: "cell", index: rowIndex, colIndex });
|
|
1735
|
+
}, [cellActions, store, cols, enableComments, commentsEntityType, t]);
|
|
1736
|
+
const handleCommentDialogClose = useCallback(() => {
|
|
1737
|
+
setCommentDialog(null);
|
|
1738
|
+
clearSelectionAnimated();
|
|
1739
|
+
}, [clearSelectionAnimated]);
|
|
1740
|
+
const handleKeyDown = useCallback((e) => {
|
|
1741
|
+
const key = e.key.toLowerCase();
|
|
1742
|
+
const metaOrCtrl = e.ctrlKey || e.metaKey;
|
|
1743
|
+
if (e.key === "F2" && e.shiftKey && enableComments && commentsEntityType) {
|
|
1744
|
+
if (!isTextEntryTarget(e.target) && !store.getEditingCell()) {
|
|
1745
|
+
e.preventDefault();
|
|
1746
|
+
openAnnotateForSelection();
|
|
1747
|
+
return;
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
if (metaOrCtrl && (key === "z" || key === "y")) {
|
|
1751
|
+
const isTextEntry = isTextEntryTarget(e.target);
|
|
1752
|
+
if (!isTextEntry && !store.getEditingCell()) {
|
|
1753
|
+
e.preventDefault();
|
|
1754
|
+
if (key === "y" || key === "z" && e.shiftKey) redo();
|
|
1755
|
+
else undo();
|
|
1756
|
+
return;
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
const isDeleteCombo = e.key.toLowerCase() === "d" && (e.ctrlKey || e.metaKey);
|
|
1760
|
+
if (isDeleteCombo && selectable && onBulkDelete && selectedRowIds.size > 0) {
|
|
1761
|
+
if (!isTextEntryTarget(e.target) && !store.getEditingCell()) {
|
|
1762
|
+
e.preventDefault();
|
|
1763
|
+
void handleBulkDelete();
|
|
1764
|
+
return;
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
if ((e.key === "Delete" || e.key === "Backspace") && !metaOrCtrl && !e.altKey) {
|
|
1768
|
+
if (!isTextEntryTarget(e.target) && !store.getEditingCell()) {
|
|
1769
|
+
if (clearSelectionContents()) {
|
|
1770
|
+
e.preventDefault();
|
|
1771
|
+
return;
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
if (e.key === "Escape" && !store.getEditingCell() && store.getClipboardMarker()) {
|
|
1776
|
+
e.preventDefault();
|
|
1777
|
+
store.setClipboardMarker(null);
|
|
1778
|
+
return;
|
|
1779
|
+
}
|
|
1780
|
+
if (e.key === "Enter" && !e.shiftKey && !metaOrCtrl && !store.getEditingCell()) {
|
|
1781
|
+
const b = store.getSelectionBounds();
|
|
1782
|
+
if (b && b.startRow === b.endRow && b.startCol === b.endCol && !columnMountsEditor(cols[b.startCol])) {
|
|
1783
|
+
e.preventDefault();
|
|
1784
|
+
flash(
|
|
1785
|
+
t("dynamicTable.cell.readOnlyColumn", '"{column}" is read-only', {
|
|
1786
|
+
column: String(cols[b.startCol]?.title ?? cols[b.startCol]?.data ?? "")
|
|
1787
|
+
}),
|
|
1788
|
+
"info"
|
|
1789
|
+
);
|
|
1790
|
+
return;
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
if (shortcutHandler(e.nativeEvent)) return;
|
|
1794
|
+
keyboardHandler(e.nativeEvent);
|
|
1795
|
+
}, [keyboardHandler, shortcutHandler, selectable, onBulkDelete, selectedRowIds, store, handleBulkDelete, undo, redo, clearSelectionContents, enableComments, commentsEntityType, openAnnotateForSelection, cols, t]);
|
|
1796
|
+
const handleFocus = useCallback(() => {
|
|
1797
|
+
const direction = tableRef.current?.getAttribute("data-focus-direction");
|
|
1798
|
+
const trigger = tableRef.current?.getAttribute("data-focus-trigger");
|
|
1799
|
+
if (direction) tableRef.current?.removeAttribute("data-focus-direction");
|
|
1800
|
+
if (trigger) tableRef.current?.removeAttribute("data-focus-trigger");
|
|
1801
|
+
if (store.getRowCount() === 0) {
|
|
1802
|
+
if (trigger === "tab") {
|
|
1803
|
+
const nextSibling = direction === "up" ? siblingTableRefs?.prev?.current : siblingTableRefs?.next?.current;
|
|
1804
|
+
if (nextSibling) {
|
|
1805
|
+
nextSibling.setAttribute("data-focus-direction", direction || "down");
|
|
1806
|
+
nextSibling.setAttribute("data-focus-trigger", "tab");
|
|
1807
|
+
nextSibling.focus();
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
return;
|
|
1811
|
+
}
|
|
1812
|
+
if (!autoSelectOnFocus || store.getSelection().anchor) return;
|
|
1813
|
+
const rowCount2 = store.getRowCount();
|
|
1814
|
+
const targetRow = direction === "up" ? rowCount2 - 1 : 0;
|
|
1815
|
+
store.setSelection({
|
|
1816
|
+
type: "range",
|
|
1817
|
+
anchor: { row: targetRow, col: 0 },
|
|
1818
|
+
focus: { row: targetRow, col: 0 }
|
|
1819
|
+
});
|
|
1820
|
+
}, [autoSelectOnFocus, store, tableRef, siblingTableRefs]);
|
|
1821
|
+
const isInsideExternalDialog = useCallback((el) => {
|
|
1822
|
+
const dialog = el.closest('[role="dialog"]');
|
|
1823
|
+
if (!dialog) return false;
|
|
1824
|
+
return !dialog.contains(tableRef?.current);
|
|
1825
|
+
}, [tableRef]);
|
|
1826
|
+
const handleBlur = useCallback((e) => {
|
|
1827
|
+
const relatedTarget = e.relatedTarget;
|
|
1828
|
+
if (!relatedTarget) return;
|
|
1829
|
+
if (tableRef?.current?.contains(relatedTarget)) return;
|
|
1830
|
+
if (relatedTarget.closest("[data-radix-popper-content-wrapper]") || relatedTarget.closest(".hot-editor-popup") || relatedTarget.closest(".hot-context-menu") || relatedTarget.closest(".context-menu") || // The find-and-replace bar renders OUTSIDE the grid container (it has
|
|
1831
|
+
// grid. Without this exemption, clicking into it would clear the very
|
|
1832
|
+
// selection the active match just established.
|
|
1833
|
+
relatedTarget.closest(".hot-comment-popover")) return;
|
|
1834
|
+
if (isInsideExternalDialog(relatedTarget)) return;
|
|
1835
|
+
store.clearEditing();
|
|
1836
|
+
clearSelectionAnimated();
|
|
1837
|
+
}, [store, tableRef, isInsideExternalDialog, clearSelectionAnimated]);
|
|
1838
|
+
const handleEnterFullscreen = () => {
|
|
1839
|
+
setIsFullscreen(true);
|
|
1840
|
+
onFullscreenChange?.(true);
|
|
1841
|
+
};
|
|
1842
|
+
const handleExitFullscreen = () => {
|
|
1843
|
+
setIsFullscreen(false);
|
|
1844
|
+
onFullscreenChange?.(false);
|
|
1845
|
+
};
|
|
1846
|
+
useEffect(() => {
|
|
1847
|
+
store.setTableRef(tableRef);
|
|
1848
|
+
}, [store, tableRef]);
|
|
1849
|
+
useEffect(() => {
|
|
1850
|
+
if (store.hasNewRows()) return;
|
|
1851
|
+
store.setData(data);
|
|
1852
|
+
}, [data, store]);
|
|
1853
|
+
useEffect(() => {
|
|
1854
|
+
store.setColumns(cols);
|
|
1855
|
+
}, [cols, store]);
|
|
1856
|
+
const { persistResize } = useColumnWidthPersistence({ tableId, store, cols, userResizedColsRef });
|
|
1857
|
+
persistColumnWidthRef.current = persistResize;
|
|
1858
|
+
useEffect(() => {
|
|
1859
|
+
return store.subscribeToStore(() => {
|
|
1860
|
+
setRowCount(store.getRowCount());
|
|
1861
|
+
setStoreRevision((prev) => prev + 1);
|
|
1862
|
+
});
|
|
1863
|
+
}, [store]);
|
|
1864
|
+
useEffect(() => {
|
|
1865
|
+
const root = tableRef.current;
|
|
1866
|
+
if (!root) return;
|
|
1867
|
+
const raf = requestAnimationFrame(() => {
|
|
1868
|
+
const cache = badgeFitRef.current;
|
|
1869
|
+
root.querySelectorAll("td.hot-cell .cell-badge").forEach((badge) => {
|
|
1870
|
+
const td = badge.closest("td[data-col]");
|
|
1871
|
+
if (!td) return;
|
|
1872
|
+
const colIndex = parseInt(td.getAttribute("data-col") || "", 10);
|
|
1873
|
+
const key = cols[colIndex]?.data;
|
|
1874
|
+
if (!key) return;
|
|
1875
|
+
const hasComment = td.getAttribute("data-has-comment") === "true";
|
|
1876
|
+
recordBadgeFit(cache, key, badgeFitWidth(badge.scrollWidth, hasComment));
|
|
1877
|
+
});
|
|
1878
|
+
planBadgeWidths(
|
|
1879
|
+
cache,
|
|
1880
|
+
cols,
|
|
1881
|
+
// The DECLARED width, never the painted one: the fill surplus is not
|
|
1882
|
+
// the column's own width, and comparing against it would let a badge
|
|
1883
|
+
// stay clipped the moment the container narrows and the surplus goes.
|
|
1884
|
+
(col) => store.getBaseColumnWidth(col),
|
|
1885
|
+
(col) => userResizedColsRef.current.has(col)
|
|
1886
|
+
).forEach(({ col, width: width2 }) => store.setColumnWidth(col, width2));
|
|
1887
|
+
});
|
|
1888
|
+
return () => cancelAnimationFrame(raf);
|
|
1889
|
+
}, [data, cols, store, tableRef, annotations]);
|
|
1890
|
+
useEffect(() => {
|
|
1891
|
+
if (!highlightedRowId || !tableRef?.current) return;
|
|
1892
|
+
const rowIndex = data.findIndex((row) => row[idColumnName] === highlightedRowId);
|
|
1893
|
+
if (rowIndex === -1) return;
|
|
1894
|
+
rowVirtualizer.scrollToIndex(rowIndex, { align: "center", behavior: "smooth" });
|
|
1895
|
+
}, [highlightedRowId, data, idColumnName, rowVirtualizer]);
|
|
1896
|
+
useEffect(() => {
|
|
1897
|
+
document.addEventListener("copy", handleCopy);
|
|
1898
|
+
return () => document.removeEventListener("copy", handleCopy);
|
|
1899
|
+
}, [handleCopy]);
|
|
1900
|
+
useEffect(() => {
|
|
1901
|
+
document.addEventListener("cut", handleCut);
|
|
1902
|
+
return () => document.removeEventListener("cut", handleCut);
|
|
1903
|
+
}, [handleCut]);
|
|
1904
|
+
useEffect(() => {
|
|
1905
|
+
document.addEventListener("paste", handlePaste);
|
|
1906
|
+
return () => document.removeEventListener("paste", handlePaste);
|
|
1907
|
+
}, [handlePaste]);
|
|
1908
|
+
useEffect(() => {
|
|
1909
|
+
const handleGlobalMouseUp = () => {
|
|
1910
|
+
if (fillStateRef.current) {
|
|
1911
|
+
commitFill();
|
|
1912
|
+
}
|
|
1913
|
+
if (dragStateRef.current.isDragging) {
|
|
1914
|
+
dragHandlers.handleDragEnd();
|
|
1915
|
+
}
|
|
1916
|
+
};
|
|
1917
|
+
document.addEventListener("mouseup", handleGlobalMouseUp);
|
|
1918
|
+
return () => document.removeEventListener("mouseup", handleGlobalMouseUp);
|
|
1919
|
+
}, [dragHandlers, commitFill]);
|
|
1920
|
+
useEffect(() => {
|
|
1921
|
+
const handleClickOutside = (e) => {
|
|
1922
|
+
const target = e.target;
|
|
1923
|
+
if (tableRef?.current?.contains(target)) {
|
|
1924
|
+
return;
|
|
1925
|
+
}
|
|
1926
|
+
if (target.closest("[data-radix-popper-content-wrapper]") || target.closest(".hot-context-menu") || target.closest(".context-menu") || target.closest(".hot-comment-popover") || document.querySelector(".hot-editor-popup")) {
|
|
1927
|
+
return;
|
|
1928
|
+
}
|
|
1929
|
+
if (isInsideExternalDialog(target)) {
|
|
1930
|
+
return;
|
|
1931
|
+
}
|
|
1932
|
+
const editingCell = store.getEditingCell();
|
|
1933
|
+
if (editingCell) {
|
|
1934
|
+
setTimeout(() => {
|
|
1935
|
+
store.clearEditing();
|
|
1936
|
+
clearSelectionAnimated();
|
|
1937
|
+
}, 0);
|
|
1938
|
+
} else {
|
|
1939
|
+
store.clearEditing();
|
|
1940
|
+
clearSelectionAnimated();
|
|
1941
|
+
}
|
|
1942
|
+
};
|
|
1943
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1944
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1945
|
+
}, [store, tableRef, isInsideExternalDialog, clearSelectionAnimated]);
|
|
1946
|
+
useEffect(() => {
|
|
1947
|
+
if (!tableRef?.current) return;
|
|
1948
|
+
dispatch(
|
|
1949
|
+
tableRef.current,
|
|
1950
|
+
TableEvents.FILTER_CHANGE,
|
|
1951
|
+
{ filters, savedFilterId: activePerspectiveId }
|
|
1952
|
+
);
|
|
1953
|
+
}, [filters, activePerspectiveId, tableRef]);
|
|
1954
|
+
useEffect(() => {
|
|
1955
|
+
if (!tableRef?.current) return;
|
|
1956
|
+
dispatch(
|
|
1957
|
+
tableRef.current,
|
|
1958
|
+
TableEvents.PERSPECTIVE_CHANGE,
|
|
1959
|
+
{
|
|
1960
|
+
config: {
|
|
1961
|
+
columns: { visible: visibleColumns, hidden: hiddenColumns },
|
|
1962
|
+
filters,
|
|
1963
|
+
sorting: sortRules,
|
|
1964
|
+
grouping: groupRules,
|
|
1965
|
+
aggregations,
|
|
1966
|
+
lookupColumns,
|
|
1967
|
+
rollupColumns,
|
|
1968
|
+
formulas,
|
|
1969
|
+
conditionalFormats,
|
|
1970
|
+
dateFormat,
|
|
1971
|
+
viewMode
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
);
|
|
1975
|
+
}, [visibleColumns, hiddenColumns, filters, sortRules, groupRules, aggregations, lookupColumns, rollupColumns, formulas, conditionalFormats, dateFormat, viewMode, tableRef]);
|
|
1976
|
+
useEventHandlers({
|
|
1977
|
+
[TableEvents.CELL_SAVE_START]: (payload) => {
|
|
1978
|
+
store.setSaveState(payload.rowIndex, payload.colIndex, "saving");
|
|
1979
|
+
},
|
|
1980
|
+
[TableEvents.CELL_SAVE_SUCCESS]: (payload) => {
|
|
1981
|
+
store.setSaveState(payload.rowIndex, payload.colIndex, "success");
|
|
1982
|
+
setTimeout(() => store.setSaveState(payload.rowIndex, payload.colIndex, null), 2e3);
|
|
1983
|
+
},
|
|
1984
|
+
[TableEvents.CELL_SAVE_ERROR]: (payload) => {
|
|
1985
|
+
store.setSaveState(payload.rowIndex, payload.colIndex, "error");
|
|
1986
|
+
setTimeout(() => store.setSaveState(payload.rowIndex, payload.colIndex, null), 3e3);
|
|
1987
|
+
},
|
|
1988
|
+
[TableEvents.NEW_ROW_SAVE_SUCCESS]: (payload) => {
|
|
1989
|
+
store.markRowAsSaved(payload.rowIndex, payload.savedRowData);
|
|
1990
|
+
},
|
|
1991
|
+
[TableEvents.NEW_ROW_SAVE_ERROR]: (payload) => {
|
|
1992
|
+
console.error("Failed to save new row:", payload.error);
|
|
1993
|
+
if (store.isNewRow(payload.rowIndex)) {
|
|
1994
|
+
store.setSaveState(payload.rowIndex, 0, "error");
|
|
1995
|
+
setTimeout(() => store.setSaveState(payload.rowIndex, 0, null), 3e3);
|
|
1996
|
+
store.setEditingCell(payload.rowIndex, 0);
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
}, tableRef);
|
|
2000
|
+
const shouldFillHeight = height === "100%" || height === "fill";
|
|
2001
|
+
const isViewportFill = height === "fill";
|
|
2002
|
+
const outerContainerRef = useRef(null);
|
|
2003
|
+
const [fillHeight, setFillHeight] = useState(null);
|
|
2004
|
+
useLayoutEffect(() => {
|
|
2005
|
+
if (!isViewportFill || isFullscreen) return;
|
|
2006
|
+
const el = outerContainerRef.current;
|
|
2007
|
+
if (!el) return;
|
|
2008
|
+
let scrollPane = el.parentElement;
|
|
2009
|
+
while (scrollPane && scrollPane !== document.body) {
|
|
2010
|
+
const oy = getComputedStyle(scrollPane).overflowY;
|
|
2011
|
+
if (oy === "auto" || oy === "scroll") break;
|
|
2012
|
+
scrollPane = scrollPane.parentElement;
|
|
2013
|
+
}
|
|
2014
|
+
const measure = () => {
|
|
2015
|
+
const rect = el.getBoundingClientRect();
|
|
2016
|
+
const paneBottom = scrollPane && scrollPane !== document.body ? Math.min(window.innerHeight, Math.round(scrollPane.getBoundingClientRect().top) + scrollPane.clientHeight) : window.innerHeight;
|
|
2017
|
+
setFillHeight(Math.max(Math.floor(paneBottom - rect.top), 200));
|
|
2018
|
+
};
|
|
2019
|
+
measure();
|
|
2020
|
+
window.addEventListener("resize", measure);
|
|
2021
|
+
const ro = new ResizeObserver(measure);
|
|
2022
|
+
if (scrollPane && scrollPane !== document.body) ro.observe(scrollPane);
|
|
2023
|
+
return () => {
|
|
2024
|
+
window.removeEventListener("resize", measure);
|
|
2025
|
+
ro.disconnect();
|
|
2026
|
+
};
|
|
2027
|
+
}, [isViewportFill, isFullscreen]);
|
|
2028
|
+
const tableContent = /* @__PURE__ */ jsxs(
|
|
2029
|
+
"div",
|
|
2030
|
+
{
|
|
2031
|
+
ref: outerContainerRef,
|
|
2032
|
+
className: `hot-container ${shouldFillHeight ? "flex flex-col flex-1" : ""}${borderless ? " hot-borderless" : ""} hot-appearance-v2`,
|
|
2033
|
+
"data-range-phase": rangePhase === "idle" ? void 0 : rangePhase,
|
|
2034
|
+
"data-readonly-style": readOnlyStyle,
|
|
2035
|
+
"data-density": density || void 0,
|
|
2036
|
+
...densityAttribute,
|
|
2037
|
+
"data-striped": striped ? "true" : void 0,
|
|
2038
|
+
"data-actions-scroll-shadow": actionsScrollShadow ? "true" : void 0,
|
|
2039
|
+
"data-firstcol-scroll-shadow": firstColScrollShadow ? "true" : void 0,
|
|
2040
|
+
"data-frozen-shadow": frozenColShadow ? "true" : void 0,
|
|
2041
|
+
"data-clickable-rows": onRowClick ? "true" : void 0,
|
|
2042
|
+
"data-row-hover-style": onRowClick ? rowHoverStyle : void 0,
|
|
2043
|
+
style: {
|
|
2044
|
+
height: isFullscreen ? "100%" : isViewportFill && fillHeight ? fillHeight : shouldFillHeight ? "100%" : height,
|
|
2045
|
+
width: isFullscreen ? "100%" : width,
|
|
2046
|
+
position: "relative",
|
|
2047
|
+
...shouldFillHeight && { minHeight: 0 }
|
|
2048
|
+
},
|
|
2049
|
+
children: [
|
|
2050
|
+
!hideToolbar && topBarStart && !hidePerspectiveTabs && /* @__PURE__ */ jsx("div", { className: "hot-toolbar-lead-row", children: topBarStart }),
|
|
2051
|
+
/* @__PURE__ */ jsxs("div", { className: hidePerspectiveTabs ? "contents" : `hot-card${shouldFillHeight ? " flex flex-col flex-1 min-h-0" : ""}`, children: [
|
|
2052
|
+
!hideToolbar && /* @__PURE__ */ jsxs("div", { className: "hot-toolbar", children: [
|
|
2053
|
+
hidePerspectiveTabs && topBarStart,
|
|
2054
|
+
!hideTitle && /* @__PURE__ */ jsx("h3", { className: "hot-toolbar-title", children: displayTableName }),
|
|
2055
|
+
!hideSearch && /* @__PURE__ */ jsx(
|
|
2056
|
+
SearchBar,
|
|
2057
|
+
{
|
|
2058
|
+
tableRef,
|
|
2059
|
+
placeholder: searchPlaceholder ?? "Search...",
|
|
2060
|
+
debounceMs: searchDebounceMs,
|
|
2061
|
+
renderSuggestions: searchSuggestions
|
|
2062
|
+
}
|
|
2063
|
+
),
|
|
2064
|
+
/* @__PURE__ */ jsx("div", { className: "hot-toolbar-spacer" }),
|
|
2065
|
+
/* @__PURE__ */ jsxs("div", { className: "hot-toolbar-actions", children: [
|
|
2066
|
+
/* @__PURE__ */ jsx(
|
|
2067
|
+
ActiveFilterChips,
|
|
2068
|
+
{
|
|
2069
|
+
filters,
|
|
2070
|
+
columns: baseColumns,
|
|
2071
|
+
onRemove: (filterId) => handleFiltersChange(filters.filter((f) => f.id !== filterId))
|
|
2072
|
+
}
|
|
2073
|
+
),
|
|
2074
|
+
filters.length > 0 && /* @__PURE__ */ jsxs(
|
|
2075
|
+
"button",
|
|
2076
|
+
{
|
|
2077
|
+
type: "button",
|
|
2078
|
+
className: "hot-clear-filters-btn",
|
|
2079
|
+
onClick: () => handleFiltersChange([]),
|
|
2080
|
+
title: t(
|
|
2081
|
+
"dynamicTable.quickFilter.clearAllHint",
|
|
2082
|
+
"These filters are temporary and are not saved with the view"
|
|
2083
|
+
),
|
|
2084
|
+
"data-clear-all-filters": "",
|
|
2085
|
+
children: [
|
|
2086
|
+
/* @__PURE__ */ jsx(FunnelX, { className: "w-3.5 h-3.5", "aria-hidden": "true" }),
|
|
2087
|
+
/* @__PURE__ */ jsx("span", { className: "text-body-regular-xs", children: t("dynamicTable.quickFilter.clearAll", "Clear all filters ({count})", {
|
|
2088
|
+
count: filters.length
|
|
2089
|
+
}) })
|
|
2090
|
+
]
|
|
2091
|
+
}
|
|
2092
|
+
),
|
|
2093
|
+
typeof searchBarStart === "function" ? searchBarStart({ data, filters, setFilters: handleFiltersChange }) : searchBarStart,
|
|
2094
|
+
!hideAddRowButton && /* @__PURE__ */ jsx(
|
|
2095
|
+
"button",
|
|
2096
|
+
{
|
|
2097
|
+
onClick: handleAddRow,
|
|
2098
|
+
className: "hot-add-row-btn",
|
|
2099
|
+
title: "Add new row",
|
|
2100
|
+
children: "+"
|
|
2101
|
+
}
|
|
2102
|
+
),
|
|
2103
|
+
searchBarEnd,
|
|
2104
|
+
viewModes && viewModes.length > 1 && /* @__PURE__ */ jsx(
|
|
2105
|
+
ViewModeSwitch,
|
|
2106
|
+
{
|
|
2107
|
+
options: viewModes,
|
|
2108
|
+
value: viewMode,
|
|
2109
|
+
onChange: handleViewModeChange
|
|
2110
|
+
}
|
|
2111
|
+
),
|
|
2112
|
+
expandToolbarActions ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2113
|
+
!hideExportButton && /* @__PURE__ */ jsx(ExportMenu, { variant: "toolbar", onExport: handleExportAll, disabled: isExportingAll }),
|
|
2114
|
+
!hideDensityControl && /* @__PURE__ */ jsx(DensityControl, { variant: "toolbar", tableKey: tableId }),
|
|
2115
|
+
enableFullscreen && !isFullscreen && /* @__PURE__ */ jsx("button", { onClick: handleEnterFullscreen, className: "fullscreen-toggle-btn", title: "Enter fullscreen", children: /* @__PURE__ */ jsx(Maximize2, { className: "w-4 h-4" }) })
|
|
2116
|
+
] }) : /* @__PURE__ */ jsx(
|
|
2117
|
+
ToolbarOverflow,
|
|
2118
|
+
{
|
|
2119
|
+
onExport: hideExportButton ? void 0 : handleExportAll,
|
|
2120
|
+
exportDisabled: isExportingAll,
|
|
2121
|
+
showDensity: !hideDensityControl,
|
|
2122
|
+
densityTableKey: tableId,
|
|
2123
|
+
onFullscreen: enableFullscreen && !isFullscreen ? handleEnterFullscreen : void 0,
|
|
2124
|
+
extras: toolbarOverflowExtras
|
|
2125
|
+
}
|
|
2126
|
+
)
|
|
2127
|
+
] }),
|
|
2128
|
+
topBarEnd
|
|
2129
|
+
] }),
|
|
2130
|
+
(!hidePerspectiveTabs || pagination && !hidePagination) && /* @__PURE__ */ jsxs("div", { className: "hot-tabs-row", children: [
|
|
2131
|
+
!hidePerspectiveTabs && /* @__PURE__ */ jsx(
|
|
2132
|
+
PerspectiveTabs,
|
|
2133
|
+
{
|
|
2134
|
+
savedPerspectives,
|
|
2135
|
+
activePerspectiveId,
|
|
2136
|
+
onPerspectiveSelect: handlePerspectiveSelect,
|
|
2137
|
+
onPerspectiveRename: handlePerspectiveRename,
|
|
2138
|
+
onPerspectiveDelete: handlePerspectiveDelete,
|
|
2139
|
+
onPerspectiveDuplicate: handlePerspectiveDuplicate,
|
|
2140
|
+
onPerspectiveSetDefault: handlePerspectiveSetDefault,
|
|
2141
|
+
defaultPerspectiveId,
|
|
2142
|
+
sharedTemplates,
|
|
2143
|
+
publishableRoles: canPublishTemplates ? publishableRoles : void 0,
|
|
2144
|
+
onPerspectivePublish: canPublishTemplates ? handlePerspectivePublish : void 0,
|
|
2145
|
+
onPerspectiveTemplateCopy: handlePerspectiveTemplateCopy,
|
|
2146
|
+
onPerspectiveEdit: (id) => {
|
|
2147
|
+
handlePerspectiveSelect(id);
|
|
2148
|
+
setEditingPerspectiveId(id);
|
|
2149
|
+
setConfigureBaseView(false);
|
|
2150
|
+
setConfigPanelInitialSection(null);
|
|
2151
|
+
setConfigPanelOpen(true);
|
|
2152
|
+
},
|
|
2153
|
+
onConfigureBaseView: () => {
|
|
2154
|
+
setEditingPerspectiveId(null);
|
|
2155
|
+
setConfigureBaseView(true);
|
|
2156
|
+
setConfigPanelInitialSection(null);
|
|
2157
|
+
setConfigPanelOpen(true);
|
|
2158
|
+
},
|
|
2159
|
+
onBaseViewReset: handleBaseViewReset,
|
|
2160
|
+
onAddPerspective: () => {
|
|
2161
|
+
setEditingPerspectiveId(null);
|
|
2162
|
+
setConfigureBaseView(false);
|
|
2163
|
+
setConfigPanelInitialSection(null);
|
|
2164
|
+
setConfigPanelOpen(true);
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
),
|
|
2168
|
+
/* @__PURE__ */ jsx("div", { className: "hot-tabs-row-spacer" }),
|
|
2169
|
+
pagination && !hidePagination && /* @__PURE__ */ jsx(TablePagination, { pagination })
|
|
2170
|
+
] }),
|
|
2171
|
+
loadError && rowCount > 0 && /* @__PURE__ */ jsx(StaleDataBar, { tableName, onRetry: onRetryLoad }),
|
|
2172
|
+
selectable && (() => {
|
|
2173
|
+
const bulkBarOpen = selectedRowIds.size >= 1;
|
|
2174
|
+
if (bulkBarOpen) bulkBarCountRef.current = selectedRowIds.size;
|
|
2175
|
+
return /* @__PURE__ */ jsx(
|
|
2176
|
+
"div",
|
|
2177
|
+
{
|
|
2178
|
+
className: `hot-bulk-bar-wrap${bulkBarOpen ? " is-open" : ""}`,
|
|
2179
|
+
"aria-hidden": !bulkBarOpen,
|
|
2180
|
+
children: /* @__PURE__ */ jsx("div", { className: "hot-bulk-bar-inner", children: /* @__PURE__ */ jsx(
|
|
2181
|
+
BulkActionsBar,
|
|
2182
|
+
{
|
|
2183
|
+
count: bulkBarOpen ? selectedRowIds.size : bulkBarCountRef.current,
|
|
2184
|
+
busy: isBulkDeleting,
|
|
2185
|
+
onCopy: handleBulkCopy,
|
|
2186
|
+
onDelete: onBulkDelete ? handleBulkDelete : void 0,
|
|
2187
|
+
onExport: hideExportButton ? void 0 : handleExportSelection,
|
|
2188
|
+
onClear: clearSelection,
|
|
2189
|
+
actions: bulkActions,
|
|
2190
|
+
selectedIds: Array.from(selectedRowIds)
|
|
2191
|
+
}
|
|
2192
|
+
) })
|
|
2193
|
+
}
|
|
2194
|
+
);
|
|
2195
|
+
})(),
|
|
2196
|
+
beforeBody ? /* @__PURE__ */ jsx("div", { className: "hot-before-body", children: typeof beforeBody === "function" ? beforeBody({ data, filters, setFilters: handleFiltersChange }) : beforeBody }) : null,
|
|
2197
|
+
/* @__PURE__ */ jsx(
|
|
2198
|
+
"div",
|
|
2199
|
+
{
|
|
2200
|
+
ref: tableRef,
|
|
2201
|
+
tabIndex: usingCustomBody ? void 0 : 0,
|
|
2202
|
+
"data-fill-enabled": !usingCustomBody && enableFillHandle ? "true" : void 0,
|
|
2203
|
+
"data-dt-columns": cols.length,
|
|
2204
|
+
"data-dt-rows": data.length,
|
|
2205
|
+
"data-column-window": `${columnVirtualizer.startIndex}:${columnVirtualizer.endIndex}`,
|
|
2206
|
+
"data-column-virtualized": columnVirtualizer.virtualized ? "true" : void 0,
|
|
2207
|
+
role: usingCustomBody ? "presentation" : "grid",
|
|
2208
|
+
"aria-colcount": usingCustomBody ? void 0 : columnVirtualizer.ariaColCount,
|
|
2209
|
+
"aria-rowcount": usingCustomBody ? void 0 : virtualizerCount,
|
|
2210
|
+
className: `hot-virtual-container ${shouldFillHeight ? "flex-1" : ""}${usingCustomBody ? " hot-custom-body" : ""}`,
|
|
2211
|
+
onFocus: usingCustomBody ? void 0 : handleFocus,
|
|
2212
|
+
onBlur: usingCustomBody ? void 0 : handleBlur,
|
|
2213
|
+
onClick: usingCustomBody ? void 0 : (e) => {
|
|
2214
|
+
handleTableClick(e);
|
|
2215
|
+
},
|
|
2216
|
+
onMouseDown: usingCustomBody ? void 0 : (e) => {
|
|
2217
|
+
if (e.target.closest("tr[data-group-header]")) return;
|
|
2218
|
+
if (handleCommentMouseDown(e)) return;
|
|
2219
|
+
if (handleFillMouseDown(e)) return;
|
|
2220
|
+
if (rangePhaseRef.current !== "idle") applyRangePhase("idle");
|
|
2221
|
+
setContextMenu(null);
|
|
2222
|
+
handleMouseDown(e);
|
|
2223
|
+
const editingCell = store.getEditingCell();
|
|
2224
|
+
if (editingCell) {
|
|
2225
|
+
const cell = e.target.closest("td");
|
|
2226
|
+
const clickRow = parseInt(cell?.getAttribute("data-row") || "", 10);
|
|
2227
|
+
const clickCol = parseInt(cell?.getAttribute("data-col") || "", 10);
|
|
2228
|
+
if (clickRow === editingCell.row && clickCol === editingCell.col) {
|
|
2229
|
+
return;
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
tableRef.current?.focus({ preventScroll: true });
|
|
2233
|
+
},
|
|
2234
|
+
onMouseMove: usingCustomBody ? void 0 : (e) => {
|
|
2235
|
+
if (fillStateRef.current) {
|
|
2236
|
+
handleFillMouseMove(e);
|
|
2237
|
+
return;
|
|
2238
|
+
}
|
|
2239
|
+
handleMouseMove(e);
|
|
2240
|
+
},
|
|
2241
|
+
onMouseUp: usingCustomBody ? void 0 : () => {
|
|
2242
|
+
if (fillStateRef.current) {
|
|
2243
|
+
commitFill();
|
|
2244
|
+
return;
|
|
2245
|
+
}
|
|
2246
|
+
handleMouseUpWithMenu();
|
|
2247
|
+
},
|
|
2248
|
+
onMouseOver: usingCustomBody ? void 0 : (e) => {
|
|
2249
|
+
handleCellHoverOver(e);
|
|
2250
|
+
handleCommentHoverOver(e);
|
|
2251
|
+
},
|
|
2252
|
+
onMouseOut: usingCustomBody ? void 0 : handleCommentHoverOut,
|
|
2253
|
+
onMouseLeave: usingCustomBody ? void 0 : () => store.setHoveredCell(null),
|
|
2254
|
+
onDoubleClick: usingCustomBody ? void 0 : handleDoubleClick,
|
|
2255
|
+
onKeyDown: usingCustomBody ? void 0 : handleKeyDown,
|
|
2256
|
+
style: {
|
|
2257
|
+
height: isFullscreen ? "calc(100% - 90px)" : shouldFillHeight ? void 0 : typeof height === "string" && height !== "auto" ? height : "600px",
|
|
2258
|
+
overflow: "auto",
|
|
2259
|
+
position: "relative",
|
|
2260
|
+
outline: "none",
|
|
2261
|
+
...shouldFillHeight && { minHeight: 0 }
|
|
2262
|
+
},
|
|
2263
|
+
children: usingCustomBody ? renderBody({
|
|
2264
|
+
data,
|
|
2265
|
+
columns: cols,
|
|
2266
|
+
visualRows: groupingResult.visualRows,
|
|
2267
|
+
groupRules,
|
|
2268
|
+
collapsedGroups: groupingResult.collapsedGroups,
|
|
2269
|
+
toggleGroup: groupingResult.toggleGroup,
|
|
2270
|
+
selectedRowIds,
|
|
2271
|
+
rowKeyColumn: selectionColumnName,
|
|
2272
|
+
selectable,
|
|
2273
|
+
toggleRowSelect: handleToggleRowSelect,
|
|
2274
|
+
toggleGroupSelect: handleToggleGroupSelect,
|
|
2275
|
+
clearSelection,
|
|
2276
|
+
searchQuery,
|
|
2277
|
+
filters,
|
|
2278
|
+
setFilters: handleFiltersChange,
|
|
2279
|
+
filterCount: filters.length,
|
|
2280
|
+
clearSearch: handleClearSearch,
|
|
2281
|
+
clearFilters: handleFiltersChange ? () => handleFiltersChange([]) : void 0
|
|
2282
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2283
|
+
colHeaders && /* @__PURE__ */ jsx(
|
|
2284
|
+
ColumnHeaders,
|
|
2285
|
+
{
|
|
2286
|
+
columns: cols,
|
|
2287
|
+
rowHeaders,
|
|
2288
|
+
leftOffsets: effectiveLeftOffsets,
|
|
2289
|
+
rightOffsets,
|
|
2290
|
+
totalWidth,
|
|
2291
|
+
sortState,
|
|
2292
|
+
actionsColumnWidth,
|
|
2293
|
+
showActionsColumn,
|
|
2294
|
+
onSort: handleColumnSort,
|
|
2295
|
+
onResizeStart: (e, colIndex) => {
|
|
2296
|
+
userResizedColsRef.current.add(colIndex);
|
|
2297
|
+
handleResizeStart(e, colIndex);
|
|
2298
|
+
},
|
|
2299
|
+
onDoubleClick: handleColumnHeaderDoubleClick,
|
|
2300
|
+
onMouseDown: (e) => handleColumnHeaderMouseDown(e, dragHandlers.handleDragStart),
|
|
2301
|
+
onMouseMove: handleMouseMove,
|
|
2302
|
+
modernLayout: !disableBuiltinColumnMenu,
|
|
2303
|
+
onSortAsc: handleModernSortAsc,
|
|
2304
|
+
onSortDesc: handleModernSortDesc,
|
|
2305
|
+
onFilterByField: handleModernFilterByField,
|
|
2306
|
+
filters,
|
|
2307
|
+
onFiltersChange: handleFiltersChange,
|
|
2308
|
+
loadFilterSuggestions,
|
|
2309
|
+
onFreezeToggle: handleModernFreezeToggle,
|
|
2310
|
+
onHideField: handleModernHideField,
|
|
2311
|
+
onColumnReorder: handleColumnReorder,
|
|
2312
|
+
onColumnMove: handleColumnMove,
|
|
2313
|
+
frozenColumns,
|
|
2314
|
+
lastFrozenColumnKey,
|
|
2315
|
+
columnActions,
|
|
2316
|
+
onColumnAction: handleModernColumnAction,
|
|
2317
|
+
selectable,
|
|
2318
|
+
allSelected,
|
|
2319
|
+
someSelected,
|
|
2320
|
+
onToggleSelectAll: handleToggleSelectAll,
|
|
2321
|
+
columnWindow: columnVirtualizer
|
|
2322
|
+
}
|
|
2323
|
+
),
|
|
2324
|
+
/* @__PURE__ */ jsx("table", { className: "hot-table", style: { width: `${totalWidth}px` }, children: /* @__PURE__ */ jsx(
|
|
2325
|
+
"tbody",
|
|
2326
|
+
{
|
|
2327
|
+
style: {
|
|
2328
|
+
display: "block",
|
|
2329
|
+
height: `${rowVirtualizer.getTotalSize()}px`,
|
|
2330
|
+
position: "relative"
|
|
2331
|
+
},
|
|
2332
|
+
children: virtualRows.map((virtualItem) => {
|
|
2333
|
+
if (isGrouped) {
|
|
2334
|
+
const vr = groupingResult.visualRows[virtualItem.index];
|
|
2335
|
+
if (vr.type === "groupHeader") {
|
|
2336
|
+
const groupRowIds = vr.memberDataIndices.map((idx) => {
|
|
2337
|
+
const r = data[idx];
|
|
2338
|
+
return r == null ? void 0 : r[selectionColumnName];
|
|
2339
|
+
}).filter((id) => id != null).map((id) => String(id));
|
|
2340
|
+
const groupSelected = groupRowIds.length > 0 && groupRowIds.every((id) => selectedRowIds.has(id));
|
|
2341
|
+
const groupSomeSelected = !groupSelected && groupRowIds.some((id) => selectedRowIds.has(id));
|
|
2342
|
+
return /* @__PURE__ */ jsx(
|
|
2343
|
+
GroupHeaderRow,
|
|
2344
|
+
{
|
|
2345
|
+
visualRow: vr,
|
|
2346
|
+
virtualItem,
|
|
2347
|
+
totalWidth,
|
|
2348
|
+
columns: cols,
|
|
2349
|
+
onToggle: groupingResult.toggleGroup,
|
|
2350
|
+
selectable,
|
|
2351
|
+
selected: groupSelected,
|
|
2352
|
+
someSelected: groupSomeSelected,
|
|
2353
|
+
onToggleSelect: () => handleToggleGroupSelect(groupRowIds),
|
|
2354
|
+
formatGroupValue
|
|
2355
|
+
},
|
|
2356
|
+
`gh-${vr.groupKey}`
|
|
2357
|
+
);
|
|
2358
|
+
}
|
|
2359
|
+
if (vr.type === "groupSummary") {
|
|
2360
|
+
return /* @__PURE__ */ jsx(
|
|
2361
|
+
GroupSummaryRow,
|
|
2362
|
+
{
|
|
2363
|
+
visualRow: vr,
|
|
2364
|
+
virtualItem,
|
|
2365
|
+
columns: cols,
|
|
2366
|
+
rowHeaders,
|
|
2367
|
+
leftOffsets: effectiveLeftOffsets,
|
|
2368
|
+
rightOffsets,
|
|
2369
|
+
actionsColumnWidth,
|
|
2370
|
+
showActionsColumn,
|
|
2371
|
+
totalWidth,
|
|
2372
|
+
aggregations,
|
|
2373
|
+
label: t("dynamicTable.aggregation.summaryRowLabel", "Sum"),
|
|
2374
|
+
locale,
|
|
2375
|
+
storeRevision,
|
|
2376
|
+
columnWindow: columnVirtualizer
|
|
2377
|
+
},
|
|
2378
|
+
`gs-${vr.groupKey}`
|
|
2379
|
+
);
|
|
2380
|
+
}
|
|
2381
|
+
return /* @__PURE__ */ jsx(
|
|
2382
|
+
VirtualRow,
|
|
2383
|
+
{
|
|
2384
|
+
rowIndex: vr.dataIndex,
|
|
2385
|
+
columns: cols,
|
|
2386
|
+
virtualRow: virtualItem,
|
|
2387
|
+
rowHeaders,
|
|
2388
|
+
leftOffsets: effectiveLeftOffsets,
|
|
2389
|
+
lastFrozenColumnKey,
|
|
2390
|
+
rightOffsets,
|
|
2391
|
+
actionsColumnWidth,
|
|
2392
|
+
showActionsColumn,
|
|
2393
|
+
totalWidth,
|
|
2394
|
+
storeRevision,
|
|
2395
|
+
onSaveNewRow: handleSaveNewRow,
|
|
2396
|
+
onCancelNewRow: handleCancelNewRow,
|
|
2397
|
+
onRowHeaderDoubleClick: handleRowHeaderDoubleClick,
|
|
2398
|
+
onCellSave: handleCellSave,
|
|
2399
|
+
onCellContextMenu: handleCellContextMenu,
|
|
2400
|
+
actionsRenderer,
|
|
2401
|
+
showRowActionsMenu,
|
|
2402
|
+
rowActions,
|
|
2403
|
+
onRowActionsMenu: handleRowActionsMenu,
|
|
2404
|
+
highlightedRowId,
|
|
2405
|
+
idColumnName,
|
|
2406
|
+
rowKeyColumn: selectionColumnName,
|
|
2407
|
+
annotations: enableComments ? annotations : void 0,
|
|
2408
|
+
commentsEnabled: enableComments && !!commentsEntityType,
|
|
2409
|
+
annotationKeyAt: enableComments ? cellAnnotationKeyAt : void 0,
|
|
2410
|
+
selectable,
|
|
2411
|
+
selectedRowIds,
|
|
2412
|
+
onToggleRowSelect: handleToggleRowSelect,
|
|
2413
|
+
compiledFormats,
|
|
2414
|
+
columnWindow: columnVirtualizer
|
|
2415
|
+
},
|
|
2416
|
+
`dr-${vr.dataIndex}`
|
|
2417
|
+
);
|
|
2418
|
+
}
|
|
2419
|
+
return /* @__PURE__ */ jsx(
|
|
2420
|
+
VirtualRow,
|
|
2421
|
+
{
|
|
2422
|
+
rowIndex: virtualItem.index,
|
|
2423
|
+
columns: cols,
|
|
2424
|
+
virtualRow: virtualItem,
|
|
2425
|
+
rowHeaders,
|
|
2426
|
+
leftOffsets: effectiveLeftOffsets,
|
|
2427
|
+
lastFrozenColumnKey,
|
|
2428
|
+
rightOffsets,
|
|
2429
|
+
actionsColumnWidth,
|
|
2430
|
+
showActionsColumn,
|
|
2431
|
+
totalWidth,
|
|
2432
|
+
storeRevision,
|
|
2433
|
+
onSaveNewRow: handleSaveNewRow,
|
|
2434
|
+
onCancelNewRow: handleCancelNewRow,
|
|
2435
|
+
onRowHeaderDoubleClick: handleRowHeaderDoubleClick,
|
|
2436
|
+
onCellSave: handleCellSave,
|
|
2437
|
+
onCellContextMenu: handleCellContextMenu,
|
|
2438
|
+
actionsRenderer,
|
|
2439
|
+
showRowActionsMenu,
|
|
2440
|
+
rowActions,
|
|
2441
|
+
onRowActionsMenu: handleRowActionsMenu,
|
|
2442
|
+
highlightedRowId,
|
|
2443
|
+
idColumnName,
|
|
2444
|
+
rowKeyColumn: selectionColumnName,
|
|
2445
|
+
annotations: enableComments ? annotations : void 0,
|
|
2446
|
+
commentsEnabled: enableComments && !!commentsEntityType,
|
|
2447
|
+
annotationKeyAt: enableComments ? cellAnnotationKeyAt : void 0,
|
|
2448
|
+
selectable,
|
|
2449
|
+
selectedRowIds,
|
|
2450
|
+
onToggleRowSelect: handleToggleRowSelect,
|
|
2451
|
+
compiledFormats,
|
|
2452
|
+
columnWindow: columnVirtualizer
|
|
2453
|
+
},
|
|
2454
|
+
virtualItem.index
|
|
2455
|
+
);
|
|
2456
|
+
})
|
|
2457
|
+
}
|
|
2458
|
+
) }),
|
|
2459
|
+
rowCount === 0 && (loadError ? /* @__PURE__ */ jsx(LoadErrorState, { tableName, onRetry: onRetryLoad }) : /* @__PURE__ */ jsx(
|
|
2460
|
+
EmptyState,
|
|
2461
|
+
{
|
|
2462
|
+
emptyMessage,
|
|
2463
|
+
searchQuery,
|
|
2464
|
+
filterCount: filters.length,
|
|
2465
|
+
onClearSearch: handleClearSearch,
|
|
2466
|
+
onClearFilters: handleFiltersChange ? () => handleFiltersChange([]) : void 0
|
|
2467
|
+
}
|
|
2468
|
+
)),
|
|
2469
|
+
aggregations.length > 0 && /* @__PURE__ */ jsx(
|
|
2470
|
+
FooterTotalsRow,
|
|
2471
|
+
{
|
|
2472
|
+
columns: cols,
|
|
2473
|
+
aggregations,
|
|
2474
|
+
result: aggregateResult,
|
|
2475
|
+
pageValues: pageAggregateValues,
|
|
2476
|
+
pageBreakdowns: pageAggregateBreakdowns,
|
|
2477
|
+
pageRowCount: data.length,
|
|
2478
|
+
loading: aggregateLoading,
|
|
2479
|
+
error: aggregateError,
|
|
2480
|
+
getColumnWidth,
|
|
2481
|
+
rowHeaders,
|
|
2482
|
+
leftOffsets: effectiveLeftOffsets,
|
|
2483
|
+
rightOffsets,
|
|
2484
|
+
actionsColumnWidth,
|
|
2485
|
+
showActionsColumn,
|
|
2486
|
+
totalWidth,
|
|
2487
|
+
locale,
|
|
2488
|
+
columnWindow: columnVirtualizer
|
|
2489
|
+
}
|
|
2490
|
+
)
|
|
2491
|
+
] })
|
|
2492
|
+
}
|
|
2493
|
+
)
|
|
2494
|
+
] }),
|
|
2495
|
+
/* @__PURE__ */ jsx(
|
|
2496
|
+
ConfigureViewPanel,
|
|
2497
|
+
{
|
|
2498
|
+
isOpen: configPanelOpen,
|
|
2499
|
+
onOpenChange: setConfigPanelOpen,
|
|
2500
|
+
columns: baseColumns,
|
|
2501
|
+
visibleColumns,
|
|
2502
|
+
hiddenColumns,
|
|
2503
|
+
filters,
|
|
2504
|
+
sortRules,
|
|
2505
|
+
groupRules,
|
|
2506
|
+
aggregations,
|
|
2507
|
+
lookupColumns,
|
|
2508
|
+
rollupColumns,
|
|
2509
|
+
formulas,
|
|
2510
|
+
conditionalFormats,
|
|
2511
|
+
sampleRow: data[0],
|
|
2512
|
+
dateFormat,
|
|
2513
|
+
viewMode,
|
|
2514
|
+
dateFormatOptions,
|
|
2515
|
+
onColumnVisibilityChange: handleColumnVisibilityChange,
|
|
2516
|
+
onFiltersChange: handleFiltersChange,
|
|
2517
|
+
onSortRulesChange: handleSortRulesChange,
|
|
2518
|
+
onGroupRulesChange: handleGroupRulesChange,
|
|
2519
|
+
onAggregationsChange: handleAggregationsChange,
|
|
2520
|
+
onLookupColumnsChange: handleLookupColumnsChange,
|
|
2521
|
+
onRollupColumnsChange: handleRollupColumnsChange,
|
|
2522
|
+
onFormulasChange: handleFormulasChange,
|
|
2523
|
+
onConditionalFormatsChange: handleConditionalFormatsChange,
|
|
2524
|
+
onDateFormatChange: handleDateFormatChange,
|
|
2525
|
+
onSavePerspective: handleSavePerspective,
|
|
2526
|
+
activePerspectiveId,
|
|
2527
|
+
editingPerspective: savedPerspectives.find((p) => p.id === editingPerspectiveId) ?? null,
|
|
2528
|
+
baseViewPerspective,
|
|
2529
|
+
isBaseViewMode: configureBaseView,
|
|
2530
|
+
loadFilterSuggestions,
|
|
2531
|
+
loadLookupSources,
|
|
2532
|
+
loadRollupSources,
|
|
2533
|
+
initialExpandedSection: configPanelInitialSection
|
|
2534
|
+
}
|
|
2535
|
+
),
|
|
2536
|
+
/* @__PURE__ */ jsx(Dialog, { open: !!pendingWrite, onOpenChange: (open) => {
|
|
2537
|
+
if (!open) cancelPendingWrite();
|
|
2538
|
+
}, children: /* @__PURE__ */ jsxs(DialogContent, { className: "hot-dialog", children: [
|
|
2539
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
2540
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: pendingWrite?.origin === "paste" ? t("dynamicTable.paste.confirmTitle", "Paste into these cells?") : pendingWrite?.origin === "cut" ? t("dynamicTable.cut.confirmTitle", "Cut these cells?") : pendingWrite?.origin === "clear" ? t("dynamicTable.clear.confirmTitle", "Clear these cells?") : t("dynamicTable.fill.confirmTitle", "Fill cells?") }),
|
|
2541
|
+
/* @__PURE__ */ jsx(DialogDescription, { children: t("dynamicTable.write.confirmBody", "This will overwrite {count} cells.", {
|
|
2542
|
+
count: pendingWrite?.writes.length ?? 0
|
|
2543
|
+
}) })
|
|
2544
|
+
] }),
|
|
2545
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
2546
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", onClick: cancelPendingWrite, children: t("dynamicTable.fill.cancel", "Cancel") }),
|
|
2547
|
+
/* @__PURE__ */ jsx(Button, { onClick: confirmPendingWrite, children: pendingWrite?.origin === "paste" ? t("dynamicTable.paste.confirm", "Paste") : pendingWrite?.origin === "cut" ? t("dynamicTable.cut.confirm", "Cut") : pendingWrite?.origin === "clear" ? t("dynamicTable.clear.confirm", "Clear") : t("dynamicTable.fill.confirm", "Fill") })
|
|
2548
|
+
] })
|
|
2549
|
+
] }) }),
|
|
2550
|
+
enableComments && commentsEntityType && commentDialog && /* @__PURE__ */ jsx(
|
|
2551
|
+
CellCommentDialog,
|
|
2552
|
+
{
|
|
2553
|
+
isOpen: true,
|
|
2554
|
+
onClose: handleCommentDialogClose,
|
|
2555
|
+
entityType: commentDialog.entityType,
|
|
2556
|
+
viewContext: commentsViewContext,
|
|
2557
|
+
rowId: commentDialog.rowId,
|
|
2558
|
+
columnKey: commentDialog.columnKey,
|
|
2559
|
+
columnTitle: commentDialog.columnTitle,
|
|
2560
|
+
rowLabel: commentDialog.rowLabel,
|
|
2561
|
+
annotationId: commentDialog.annotationId,
|
|
2562
|
+
currentColor: commentDialog.currentColor,
|
|
2563
|
+
onAnnotationChange: () => {
|
|
2564
|
+
refreshAnnotations();
|
|
2565
|
+
onAnnotationChange?.();
|
|
2566
|
+
},
|
|
2567
|
+
anchorRect: commentDialog.anchorRect,
|
|
2568
|
+
bulkCells: commentDialog.bulkCells
|
|
2569
|
+
}
|
|
2570
|
+
),
|
|
2571
|
+
enableComments && commentsEntityType && commentHover && !commentDialog && /* @__PURE__ */ jsx(
|
|
2572
|
+
CellCommentHoverPopup,
|
|
2573
|
+
{
|
|
2574
|
+
comments: commentHover.comments,
|
|
2575
|
+
columnTitle: commentHover.columnTitle,
|
|
2576
|
+
anchorRect: commentHover.anchorRect
|
|
2577
|
+
}
|
|
2578
|
+
),
|
|
2579
|
+
contextMenu && /* @__PURE__ */ jsx(
|
|
2580
|
+
ContextMenu,
|
|
2581
|
+
{
|
|
2582
|
+
isOpen: contextMenu.isOpen,
|
|
2583
|
+
position: contextMenu.position,
|
|
2584
|
+
actions: contextMenu.actions,
|
|
2585
|
+
onClose: handleContextMenuClose,
|
|
2586
|
+
onActionClick: handleMenuActionClick
|
|
2587
|
+
}
|
|
2588
|
+
),
|
|
2589
|
+
debug && /* @__PURE__ */ jsx(Debugger, { tableRef })
|
|
2590
|
+
]
|
|
2591
|
+
}
|
|
2592
|
+
);
|
|
2593
|
+
return /* @__PURE__ */ jsx(TableDateFormatContext.Provider, { value: dateFormat, children: /* @__PURE__ */ jsx(CellStoreContext.Provider, { value: store, children: isFullscreen ? /* @__PURE__ */ jsx(
|
|
2594
|
+
FullscreenOverlay,
|
|
2595
|
+
{
|
|
2596
|
+
isOpen: isFullscreen,
|
|
2597
|
+
onClose: handleExitFullscreen,
|
|
2598
|
+
tableName: displayTableName,
|
|
2599
|
+
children: tableContent
|
|
2600
|
+
}
|
|
2601
|
+
) : tableContent }) });
|
|
2602
|
+
};
|
|
2603
|
+
var DynamicTable_default = DynamicTable;
|
|
2604
|
+
export {
|
|
2605
|
+
DynamicTable_default as default
|
|
2606
|
+
};
|
|
2607
|
+
//# sourceMappingURL=DynamicTable.js.map
|