@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,2091 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useRouter } from "next/navigation";
|
|
5
|
+
import { useReactTable, getCoreRowModel, getSortedRowModel, flexRender } from "@tanstack/react-table";
|
|
6
|
+
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
7
|
+
import { RefreshCw, Loader2, SlidersHorizontal, MoreHorizontal, Circle, Filter, ChevronDown, Check } from "lucide-react";
|
|
8
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../primitives/table.js";
|
|
9
|
+
import { Button } from "../primitives/button.js";
|
|
10
|
+
import { Checkbox } from "../primitives/checkbox.js";
|
|
11
|
+
import { Spinner } from "../primitives/spinner.js";
|
|
12
|
+
import { TooltipProvider } from "../primitives/tooltip.js";
|
|
13
|
+
import { TruncatedCell } from "./TruncatedCell.js";
|
|
14
|
+
import { FilterBar } from "./FilterBar.js";
|
|
15
|
+
import { useCustomFieldFilterDefs } from "./utils/customFieldFilters.js";
|
|
16
|
+
import { fetchCustomFieldDefinitionsPayload } from "./utils/customFieldDefs.js";
|
|
17
|
+
import { RowActions } from "./RowActions.js";
|
|
18
|
+
import { subscribeOrganizationScopeChanged } from "@open-mercato/shared/lib/frontend/organizationEvents";
|
|
19
|
+
import { InjectionSpot } from "./injection/InjectionSpot.js";
|
|
20
|
+
import { useAppEvent } from "./injection/useAppEvent.js";
|
|
21
|
+
import { useInjectionDataWidgets } from "./injection/useInjectionDataWidgets.js";
|
|
22
|
+
import { resolveInjectedIcon } from "./injection/resolveInjectedIcon.js";
|
|
23
|
+
import { serializeExport, defaultExportFilename } from "@open-mercato/shared/lib/crud/exporters";
|
|
24
|
+
import { apiCall } from "./utils/apiCall.js";
|
|
25
|
+
import { raiseCrudError } from "./utils/serverErrors.js";
|
|
26
|
+
import { PerspectiveSidebar } from "./PerspectiveSidebar.js";
|
|
27
|
+
import { Popover, PopoverTrigger, PopoverContent } from "../primitives/popover.js";
|
|
28
|
+
import { cn } from "@open-mercato/shared/lib/utils";
|
|
29
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
30
|
+
import { flash } from "./FlashMessages.js";
|
|
31
|
+
import { useConfirmDialog } from "./confirm-dialog/index.js";
|
|
32
|
+
import { ComponentReplacementHandles } from "@open-mercato/shared/modules/widgets/component-registry";
|
|
33
|
+
import { insertByInjectionPlacement } from "@open-mercato/shared/modules/widgets/injection-position";
|
|
34
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
35
|
+
import { createEmptyCondition, getDefaultOperator } from "@open-mercato/shared/lib/query/advanced-filter";
|
|
36
|
+
import { AdvancedFilterBuilder } from "./filters/AdvancedFilterBuilder.js";
|
|
37
|
+
import { useAutoDiscoveredFields } from "./utils/useAutoDiscoveredFields.js";
|
|
38
|
+
import { useCustomFieldDefs } from "./utils/customFieldDefs.js";
|
|
39
|
+
import {
|
|
40
|
+
DndContext,
|
|
41
|
+
closestCenter,
|
|
42
|
+
PointerSensor,
|
|
43
|
+
useSensor,
|
|
44
|
+
useSensors
|
|
45
|
+
} from "@dnd-kit/core";
|
|
46
|
+
import {
|
|
47
|
+
SortableContext,
|
|
48
|
+
horizontalListSortingStrategy,
|
|
49
|
+
useSortable
|
|
50
|
+
} from "@dnd-kit/sortable";
|
|
51
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
52
|
+
let refreshScheduled = false;
|
|
53
|
+
function scheduleRouterRefresh(router) {
|
|
54
|
+
if (refreshScheduled) return;
|
|
55
|
+
refreshScheduled = true;
|
|
56
|
+
if (typeof window === "undefined") {
|
|
57
|
+
refreshScheduled = false;
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
window.requestAnimationFrame(() => {
|
|
61
|
+
refreshScheduled = false;
|
|
62
|
+
try {
|
|
63
|
+
router.refresh();
|
|
64
|
+
} catch {
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const DEFAULT_ROW_CLICK_ACTION_IDS = ["edit", "open"];
|
|
69
|
+
function withDataTableNamespaces(mappedRow, sourceItem) {
|
|
70
|
+
const namespaced = {};
|
|
71
|
+
for (const [key, value] of Object.entries(sourceItem)) {
|
|
72
|
+
if (!key.startsWith("_")) continue;
|
|
73
|
+
namespaced[key] = value;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
...mappedRow,
|
|
77
|
+
...namespaced
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function resolveDataTableRowId(row, index) {
|
|
81
|
+
if (row && typeof row === "object") {
|
|
82
|
+
const candidate = row.id;
|
|
83
|
+
if (typeof candidate === "string" && candidate.trim().length > 0) {
|
|
84
|
+
return candidate;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return String(index);
|
|
88
|
+
}
|
|
89
|
+
function resolveDefaultRowAction(items, preferredIds) {
|
|
90
|
+
for (const preferredId of preferredIds) {
|
|
91
|
+
const match = items.find((item) => item.id === preferredId && (item.href || item.onSelect));
|
|
92
|
+
if (match) return match;
|
|
93
|
+
}
|
|
94
|
+
for (const preferredId of preferredIds) {
|
|
95
|
+
const match = items.find((item) => item.label.toLowerCase() === preferredId && (item.href || item.onSelect));
|
|
96
|
+
if (match) return match;
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
function pickDefaultRowAction(node, preferredIds) {
|
|
101
|
+
if (!React.isValidElement(node)) return null;
|
|
102
|
+
const items = node.props.items;
|
|
103
|
+
if (!Array.isArray(items)) return null;
|
|
104
|
+
return resolveDefaultRowAction(items, preferredIds);
|
|
105
|
+
}
|
|
106
|
+
const DEFAULT_EXPORT_FORMATS = ["csv", "json", "xml", "markdown"];
|
|
107
|
+
const EXPORT_LABELS = {
|
|
108
|
+
csv: "CSV",
|
|
109
|
+
json: "JSON",
|
|
110
|
+
xml: "XML",
|
|
111
|
+
markdown: "Markdown"
|
|
112
|
+
};
|
|
113
|
+
const EMPTY_FILTER_DEFS = [];
|
|
114
|
+
const EMPTY_FILTER_VALUES = Object.freeze({});
|
|
115
|
+
function collectUniqueById(entries, warningScope) {
|
|
116
|
+
const byId = /* @__PURE__ */ new Map();
|
|
117
|
+
for (const entry of entries) {
|
|
118
|
+
if (!entry.id) continue;
|
|
119
|
+
if (byId.has(entry.id)) {
|
|
120
|
+
if (process.env.NODE_ENV !== "production") {
|
|
121
|
+
console.warn(`[UMES] Duplicate injected ${warningScope} id "${entry.id}" detected. Keeping the first entry.`);
|
|
122
|
+
}
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
byId.set(entry.id, entry);
|
|
126
|
+
}
|
|
127
|
+
return Array.from(byId.values());
|
|
128
|
+
}
|
|
129
|
+
function resolveExportSections(config) {
|
|
130
|
+
if (!config) return [];
|
|
131
|
+
const sections = [];
|
|
132
|
+
const baseFormats = config.formats && config.formats.length > 0 ? config.formats : DEFAULT_EXPORT_FORMATS;
|
|
133
|
+
const addSection = (key, section, fallbackTitle) => {
|
|
134
|
+
if (!section || !section.getUrl && !section.prepare) return;
|
|
135
|
+
const title = section.title?.trim().length ? section.title.trim() : fallbackTitle;
|
|
136
|
+
const seen = /* @__PURE__ */ new Set();
|
|
137
|
+
const formatsSource = section.formats && section.formats.length > 0 ? section.formats : baseFormats;
|
|
138
|
+
const formats = formatsSource.filter((format) => {
|
|
139
|
+
if (seen.has(format)) return false;
|
|
140
|
+
seen.add(format);
|
|
141
|
+
return true;
|
|
142
|
+
});
|
|
143
|
+
if (formats.length === 0) return;
|
|
144
|
+
sections.push({
|
|
145
|
+
key,
|
|
146
|
+
title,
|
|
147
|
+
description: section.description,
|
|
148
|
+
formats,
|
|
149
|
+
getUrl: section.getUrl,
|
|
150
|
+
prepare: section.prepare ? async (format) => {
|
|
151
|
+
const result = await section.prepare(format);
|
|
152
|
+
if (!result) return null;
|
|
153
|
+
if ("prepared" in result) return result;
|
|
154
|
+
return { prepared: result };
|
|
155
|
+
} : void 0,
|
|
156
|
+
filename: section.filename,
|
|
157
|
+
disabled: Boolean(config.disabled || section.disabled)
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
const hasExplicitSections = Array.isArray(config.sections) && config.sections.length > 0;
|
|
161
|
+
if (!config.view && !config.full && !hasExplicitSections && config.getUrl) {
|
|
162
|
+
addSection("view", { getUrl: config.getUrl, formats: config.formats }, "Export what you view");
|
|
163
|
+
} else {
|
|
164
|
+
addSection("view", config.view, "Export what you view");
|
|
165
|
+
}
|
|
166
|
+
if (hasExplicitSections) {
|
|
167
|
+
config.sections.forEach((section, idx) => {
|
|
168
|
+
addSection(`section-${idx}`, section, section.title?.trim().length ? section.title : `Export ${idx + 1}`);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
addSection("full", config.full, "Full data export");
|
|
172
|
+
return sections;
|
|
173
|
+
}
|
|
174
|
+
const PERSPECTIVE_COOKIE_PREFIX = "om_table_perspective";
|
|
175
|
+
const PERSPECTIVE_STORAGE_PREFIX = "om_table_perspective_snapshot";
|
|
176
|
+
function formatDurationLabel(durationMs) {
|
|
177
|
+
if (durationMs == null) return "";
|
|
178
|
+
if (!Number.isFinite(durationMs)) return "";
|
|
179
|
+
if (durationMs < 0) return "";
|
|
180
|
+
if (durationMs < 1e3) return `${Math.round(durationMs)}ms`;
|
|
181
|
+
if (durationMs < 1e4) return `${(durationMs / 1e3).toFixed(1)}s`;
|
|
182
|
+
if (durationMs < 6e4) return `${Math.round(durationMs / 1e3)}s`;
|
|
183
|
+
if (durationMs < 36e5) return `${(durationMs / 6e4).toFixed(durationMs < 6e5 ? 1 : 0)}m`;
|
|
184
|
+
return `${(durationMs / 36e5).toFixed(durationMs < 72e5 ? 1 : 0)}h`;
|
|
185
|
+
}
|
|
186
|
+
function readPerspectiveCookie(tableId) {
|
|
187
|
+
if (typeof document === "undefined") return null;
|
|
188
|
+
const key = `${PERSPECTIVE_COOKIE_PREFIX}:${tableId}`;
|
|
189
|
+
const pattern = new RegExp(`(?:^|;\\s*)${key}=([^;]+)`);
|
|
190
|
+
const match = document.cookie.match(pattern);
|
|
191
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
192
|
+
}
|
|
193
|
+
function writePerspectiveCookie(tableId, perspectiveId) {
|
|
194
|
+
if (typeof document === "undefined") return;
|
|
195
|
+
const key = `${PERSPECTIVE_COOKIE_PREFIX}:${tableId}`;
|
|
196
|
+
const expires = perspectiveId ? "Max-Age=31536000" : "Max-Age=0";
|
|
197
|
+
const value = perspectiveId ? encodeURIComponent(perspectiveId) : "";
|
|
198
|
+
document.cookie = `${key}=${value}; Path=/; ${expires}; SameSite=Lax`;
|
|
199
|
+
}
|
|
200
|
+
function readPerspectiveSnapshot(tableId) {
|
|
201
|
+
if (typeof window === "undefined") return null;
|
|
202
|
+
try {
|
|
203
|
+
const raw = window.localStorage.getItem(`${PERSPECTIVE_STORAGE_PREFIX}:${tableId}`);
|
|
204
|
+
if (!raw) return null;
|
|
205
|
+
const parsed = JSON.parse(raw);
|
|
206
|
+
if (!parsed || typeof parsed !== "object") return null;
|
|
207
|
+
const perspectiveId = typeof parsed.perspectiveId === "string" && parsed.perspectiveId.trim().length > 0 ? parsed.perspectiveId : null;
|
|
208
|
+
const settings = typeof parsed.settings === "object" && parsed.settings !== null ? parsed.settings : null;
|
|
209
|
+
const updatedAt = typeof parsed.updatedAt === "number" ? parsed.updatedAt : Date.now();
|
|
210
|
+
if (!settings) return null;
|
|
211
|
+
return { perspectiveId, settings, updatedAt };
|
|
212
|
+
} catch {
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function writePerspectiveSnapshot(tableId, snapshot) {
|
|
217
|
+
if (typeof window === "undefined") return;
|
|
218
|
+
const key = `${PERSPECTIVE_STORAGE_PREFIX}:${tableId}`;
|
|
219
|
+
try {
|
|
220
|
+
if (!snapshot) {
|
|
221
|
+
window.localStorage.removeItem(key);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
window.localStorage.setItem(key, JSON.stringify(snapshot));
|
|
225
|
+
} catch {
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
function sanitizePerspectiveSettings(source) {
|
|
229
|
+
if (!source || typeof source !== "object") return null;
|
|
230
|
+
const forbidden = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
231
|
+
const result = {};
|
|
232
|
+
if (Array.isArray(source.columnOrder)) {
|
|
233
|
+
const seen = /* @__PURE__ */ new Set();
|
|
234
|
+
const order = source.columnOrder.map((id) => typeof id === "string" ? id.trim() : "").filter((id) => id.length > 0 && !seen.has(id) && (seen.add(id), true));
|
|
235
|
+
if (order.length) result.columnOrder = order;
|
|
236
|
+
}
|
|
237
|
+
if (source.columnVisibility && typeof source.columnVisibility === "object") {
|
|
238
|
+
const entries = Object.entries(source.columnVisibility).filter(([key, value]) => typeof key === "string" && key.trim().length > 0 && !forbidden.has(key) && typeof value === "boolean");
|
|
239
|
+
if (entries.length) {
|
|
240
|
+
const visibility = {};
|
|
241
|
+
entries.forEach(([key, value]) => {
|
|
242
|
+
visibility[key] = value;
|
|
243
|
+
});
|
|
244
|
+
result.columnVisibility = visibility;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (Array.isArray(source.sorting)) {
|
|
248
|
+
const sorting = source.sorting.map((item) => {
|
|
249
|
+
const id = typeof item?.id === "string" ? item.id.trim() : "";
|
|
250
|
+
if (!id || forbidden.has(id)) return null;
|
|
251
|
+
return { id, desc: Boolean(item?.desc) };
|
|
252
|
+
}).filter((item) => item !== null);
|
|
253
|
+
if (sorting.length) result.sorting = sorting;
|
|
254
|
+
}
|
|
255
|
+
if (typeof source.pageSize === "number" && Number.isFinite(source.pageSize)) {
|
|
256
|
+
const pageSize = Math.max(1, Math.min(500, Math.floor(source.pageSize)));
|
|
257
|
+
result.pageSize = pageSize;
|
|
258
|
+
}
|
|
259
|
+
if (typeof source.searchValue === "string" && source.searchValue.trim().length > 0) {
|
|
260
|
+
result.searchValue = source.searchValue.trim().slice(0, 200);
|
|
261
|
+
}
|
|
262
|
+
if (source.filters && typeof source.filters === "object") {
|
|
263
|
+
const filters = {};
|
|
264
|
+
for (const [key, value] of Object.entries(source.filters)) {
|
|
265
|
+
if (typeof key === "string") {
|
|
266
|
+
const trimmed = key.trim();
|
|
267
|
+
if (trimmed.length > 0 && !forbidden.has(trimmed)) filters[trimmed] = value;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (Object.keys(filters).length) result.filters = filters;
|
|
271
|
+
}
|
|
272
|
+
return Object.keys(result).length ? result : null;
|
|
273
|
+
}
|
|
274
|
+
function normalizeLabel(input) {
|
|
275
|
+
if (!input) return "";
|
|
276
|
+
return input.replace(/^cf[_:]/, "").replace(/[_:\-]+/g, " ").replace(/\b\w/g, (ch) => ch.toUpperCase());
|
|
277
|
+
}
|
|
278
|
+
function getColumnTruncateConfig(columnId, accessorKey, columnMeta) {
|
|
279
|
+
const key = accessorKey || columnId;
|
|
280
|
+
const metaMaxWidth = typeof columnMeta?.maxWidth === "string" ? columnMeta.maxWidth.trim() : "";
|
|
281
|
+
if (key.startsWith("cf_") || key.startsWith("cf:")) {
|
|
282
|
+
return {
|
|
283
|
+
maxWidth: metaMaxWidth || "120px",
|
|
284
|
+
truncate: typeof columnMeta?.truncate === "boolean" ? columnMeta.truncate : true
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
const wideColumns = ["title", "name", "description", "source", "companies", "people"];
|
|
288
|
+
if (wideColumns.includes(key)) {
|
|
289
|
+
return {
|
|
290
|
+
maxWidth: metaMaxWidth || "250px",
|
|
291
|
+
truncate: typeof columnMeta?.truncate === "boolean" ? columnMeta.truncate : true
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
const mediumColumns = ["status", "pipelineStage", "pipeline_stage", "type", "category"];
|
|
295
|
+
if (mediumColumns.includes(key)) {
|
|
296
|
+
return {
|
|
297
|
+
maxWidth: metaMaxWidth || "180px",
|
|
298
|
+
truncate: typeof columnMeta?.truncate === "boolean" ? columnMeta.truncate : true
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
if (key.endsWith("_at") || key.endsWith("At") || key.includes("date") || key.includes("Date")) {
|
|
302
|
+
return {
|
|
303
|
+
maxWidth: metaMaxWidth || "120px",
|
|
304
|
+
truncate: typeof columnMeta?.truncate === "boolean" ? columnMeta.truncate : true
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
maxWidth: metaMaxWidth || "150px",
|
|
309
|
+
truncate: typeof columnMeta?.truncate === "boolean" ? columnMeta.truncate : true
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
function readInjectedColumnValue(row, accessorKey) {
|
|
313
|
+
if (!row || typeof row !== "object" || !accessorKey) return void 0;
|
|
314
|
+
const segments = accessorKey.split(".").filter((segment) => segment.length > 0);
|
|
315
|
+
if (segments.length === 0) return void 0;
|
|
316
|
+
let current = row;
|
|
317
|
+
for (const segment of segments) {
|
|
318
|
+
if (!current || typeof current !== "object") return void 0;
|
|
319
|
+
current = current[segment];
|
|
320
|
+
}
|
|
321
|
+
return current;
|
|
322
|
+
}
|
|
323
|
+
function shouldSkipTruncation(columnId) {
|
|
324
|
+
const skipColumns = ["actions", "select", "checkbox", "expand"];
|
|
325
|
+
return skipColumns.includes(columnId.toLowerCase());
|
|
326
|
+
}
|
|
327
|
+
function ExportMenu({ config, sections }) {
|
|
328
|
+
const t = useT();
|
|
329
|
+
const { label } = config;
|
|
330
|
+
const defaultLabel = label ?? t("ui.dataTable.export.label", "Export");
|
|
331
|
+
const disabled = Boolean(config.disabled);
|
|
332
|
+
const hasSections = sections.length > 0;
|
|
333
|
+
const [open, setOpen] = React.useState(false);
|
|
334
|
+
const buttonRef = React.useRef(null);
|
|
335
|
+
const menuRef = React.useRef(null);
|
|
336
|
+
React.useEffect(() => {
|
|
337
|
+
if (!open || !hasSections) return;
|
|
338
|
+
const onDocClick = (event) => {
|
|
339
|
+
const target = event.target;
|
|
340
|
+
if (menuRef.current && !menuRef.current.contains(target) && buttonRef.current && !buttonRef.current.contains(target)) {
|
|
341
|
+
setOpen(false);
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
const onKeyDown = (event) => {
|
|
345
|
+
if (event.key === "Escape") {
|
|
346
|
+
setOpen(false);
|
|
347
|
+
buttonRef.current?.focus();
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
document.addEventListener("mousedown", onDocClick);
|
|
351
|
+
document.addEventListener("keydown", onKeyDown);
|
|
352
|
+
return () => {
|
|
353
|
+
document.removeEventListener("mousedown", onDocClick);
|
|
354
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
355
|
+
};
|
|
356
|
+
}, [hasSections, open]);
|
|
357
|
+
if (!hasSections) return null;
|
|
358
|
+
const handleSelect = async (section, format) => {
|
|
359
|
+
try {
|
|
360
|
+
if (section.prepare) {
|
|
361
|
+
const preparedResult = await section.prepare(format);
|
|
362
|
+
if (!preparedResult) return;
|
|
363
|
+
const prepared = preparedResult.prepared;
|
|
364
|
+
const serialized = serializeExport(prepared, format);
|
|
365
|
+
const filename = preparedResult.filename ?? section.filename?.(format) ?? config.filename?.(format) ?? defaultExportFilename(section.title, format);
|
|
366
|
+
if (typeof window !== "undefined") {
|
|
367
|
+
const blob = new Blob([serialized.body], { type: serialized.contentType });
|
|
368
|
+
const href = URL.createObjectURL(blob);
|
|
369
|
+
const a = document.createElement("a");
|
|
370
|
+
a.href = href;
|
|
371
|
+
a.download = filename;
|
|
372
|
+
document.body.appendChild(a);
|
|
373
|
+
a.click();
|
|
374
|
+
document.body.removeChild(a);
|
|
375
|
+
URL.revokeObjectURL(href);
|
|
376
|
+
}
|
|
377
|
+
} else if (section.getUrl) {
|
|
378
|
+
const url = section.getUrl(format);
|
|
379
|
+
if (url && typeof window !== "undefined") {
|
|
380
|
+
window.open(url, "_blank", "noopener,noreferrer");
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
} catch {
|
|
384
|
+
} finally {
|
|
385
|
+
setOpen(false);
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative inline-block", children: [
|
|
389
|
+
/* @__PURE__ */ jsx(
|
|
390
|
+
Button,
|
|
391
|
+
{
|
|
392
|
+
ref: buttonRef,
|
|
393
|
+
variant: "outline",
|
|
394
|
+
size: "sm",
|
|
395
|
+
type: "button",
|
|
396
|
+
onClick: () => {
|
|
397
|
+
if (disabled) return;
|
|
398
|
+
setOpen((prev) => !prev);
|
|
399
|
+
},
|
|
400
|
+
"aria-haspopup": "menu",
|
|
401
|
+
"aria-expanded": open,
|
|
402
|
+
disabled,
|
|
403
|
+
children: defaultLabel
|
|
404
|
+
}
|
|
405
|
+
),
|
|
406
|
+
open ? /* @__PURE__ */ jsx(
|
|
407
|
+
"div",
|
|
408
|
+
{
|
|
409
|
+
ref: menuRef,
|
|
410
|
+
role: "menu",
|
|
411
|
+
className: "absolute right-0 mt-2 w-60 rounded-md border bg-background py-2 shadow z-20",
|
|
412
|
+
children: sections.map((section, idx) => /* @__PURE__ */ jsxs("div", { className: idx > 0 ? "mt-2 border-t pt-3" : "", children: [
|
|
413
|
+
/* @__PURE__ */ jsxs("div", { className: "px-3", children: [
|
|
414
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs font-semibold uppercase text-muted-foreground", children: section.title }),
|
|
415
|
+
section.description ? /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground leading-snug", children: section.description }) : null
|
|
416
|
+
] }),
|
|
417
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2 space-y-1 px-2 pb-1", children: section.formats.map((format) => /* @__PURE__ */ jsx(
|
|
418
|
+
Button,
|
|
419
|
+
{
|
|
420
|
+
type: "button",
|
|
421
|
+
variant: "ghost",
|
|
422
|
+
size: "sm",
|
|
423
|
+
className: "w-full justify-start font-normal",
|
|
424
|
+
onClick: () => void handleSelect(section, format),
|
|
425
|
+
disabled: section.disabled,
|
|
426
|
+
children: EXPORT_LABELS[format]
|
|
427
|
+
},
|
|
428
|
+
`${section.key}-${format}`
|
|
429
|
+
)) })
|
|
430
|
+
] }, section.key))
|
|
431
|
+
}
|
|
432
|
+
) : null
|
|
433
|
+
] });
|
|
434
|
+
}
|
|
435
|
+
function sanitizeDndContextId(value) {
|
|
436
|
+
const normalized = value.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
437
|
+
return normalized.length > 0 ? normalized : "data-table";
|
|
438
|
+
}
|
|
439
|
+
function HeaderDndWrapper({ enabled, contextId, sensors, columnIds, onDragEnd, children }) {
|
|
440
|
+
if (!enabled) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
441
|
+
return /* @__PURE__ */ jsx(DndContext, { id: contextId, sensors, collisionDetection: closestCenter, onDragEnd, children: /* @__PURE__ */ jsx(SortableContext, { items: columnIds, strategy: horizontalListSortingStrategy, children }) });
|
|
442
|
+
}
|
|
443
|
+
function SortableHeaderCell({ id, children, className }) {
|
|
444
|
+
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id });
|
|
445
|
+
const isSticky = typeof className === "string" && className.includes("sticky");
|
|
446
|
+
const style = {
|
|
447
|
+
transform: CSS.Transform.toString(transform),
|
|
448
|
+
transition,
|
|
449
|
+
opacity: isDragging ? 0.5 : 1,
|
|
450
|
+
cursor: "grab",
|
|
451
|
+
position: isSticky ? "sticky" : "relative"
|
|
452
|
+
};
|
|
453
|
+
return /* @__PURE__ */ jsx(TableHead, { ref: setNodeRef, style, className, ...attributes, ...listeners, children });
|
|
454
|
+
}
|
|
455
|
+
function ViewSwitcherDropdown({
|
|
456
|
+
activePerspectiveId,
|
|
457
|
+
perspectives,
|
|
458
|
+
rolePerspectives,
|
|
459
|
+
onClear,
|
|
460
|
+
onActivate,
|
|
461
|
+
onOpenSidebar,
|
|
462
|
+
t
|
|
463
|
+
}) {
|
|
464
|
+
const [open, setOpen] = React.useState(false);
|
|
465
|
+
const allViews = [...perspectives, ...rolePerspectives];
|
|
466
|
+
const activeName = allViews.find((v) => v.id === activePerspectiveId)?.name.trim() || "";
|
|
467
|
+
const activeLabel = activeName || t("ui.dataTable.perspectives.allViews", "All views");
|
|
468
|
+
return /* @__PURE__ */ jsxs("div", { className: "inline-flex h-9 items-center rounded-md border border-input text-sm", children: [
|
|
469
|
+
/* @__PURE__ */ jsxs(
|
|
470
|
+
Button,
|
|
471
|
+
{
|
|
472
|
+
"data-testid": "data-table-open-views-sidebar",
|
|
473
|
+
type: "button",
|
|
474
|
+
variant: "ghost",
|
|
475
|
+
size: "sm",
|
|
476
|
+
onClick: onOpenSidebar,
|
|
477
|
+
className: "h-full rounded-none rounded-l-md px-3 font-medium",
|
|
478
|
+
children: [
|
|
479
|
+
/* @__PURE__ */ jsx(SlidersHorizontal, { className: "size-4 mr-1.5" }),
|
|
480
|
+
t("ui.dataTable.perspectives.button", "Views")
|
|
481
|
+
]
|
|
482
|
+
}
|
|
483
|
+
),
|
|
484
|
+
/* @__PURE__ */ jsx("div", { className: "h-5 w-px bg-border" }),
|
|
485
|
+
/* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
486
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
487
|
+
Button,
|
|
488
|
+
{
|
|
489
|
+
type: "button",
|
|
490
|
+
variant: "ghost",
|
|
491
|
+
size: "sm",
|
|
492
|
+
className: "h-full max-w-[200px] rounded-none rounded-r-md px-3 font-normal text-muted-foreground",
|
|
493
|
+
children: [
|
|
494
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: activeLabel }),
|
|
495
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5 shrink-0 ml-1.5" })
|
|
496
|
+
]
|
|
497
|
+
}
|
|
498
|
+
) }),
|
|
499
|
+
/* @__PURE__ */ jsxs(PopoverContent, { align: "start", className: "w-[220px] p-1", children: [
|
|
500
|
+
/* @__PURE__ */ jsxs(
|
|
501
|
+
Button,
|
|
502
|
+
{
|
|
503
|
+
type: "button",
|
|
504
|
+
variant: "ghost",
|
|
505
|
+
size: "sm",
|
|
506
|
+
className: cn(
|
|
507
|
+
"w-full justify-start h-auto px-2 py-1.5 text-sm font-normal",
|
|
508
|
+
!activePerspectiveId && "bg-accent text-accent-foreground"
|
|
509
|
+
),
|
|
510
|
+
onClick: () => {
|
|
511
|
+
onClear();
|
|
512
|
+
setOpen(false);
|
|
513
|
+
},
|
|
514
|
+
children: [
|
|
515
|
+
/* @__PURE__ */ jsx(Check, { className: cn("size-4 shrink-0 mr-2", activePerspectiveId ? "invisible" : "") }),
|
|
516
|
+
t("ui.dataTable.perspectives.noView", "\u2014 No view \u2014")
|
|
517
|
+
]
|
|
518
|
+
}
|
|
519
|
+
),
|
|
520
|
+
perspectives.map((p) => /* @__PURE__ */ jsxs(
|
|
521
|
+
Button,
|
|
522
|
+
{
|
|
523
|
+
type: "button",
|
|
524
|
+
variant: "ghost",
|
|
525
|
+
size: "sm",
|
|
526
|
+
className: cn(
|
|
527
|
+
"w-full justify-start h-auto px-2 py-1.5 text-sm font-normal",
|
|
528
|
+
activePerspectiveId === p.id && "bg-accent text-accent-foreground"
|
|
529
|
+
),
|
|
530
|
+
onClick: () => {
|
|
531
|
+
onActivate(p, "personal");
|
|
532
|
+
setOpen(false);
|
|
533
|
+
},
|
|
534
|
+
children: [
|
|
535
|
+
/* @__PURE__ */ jsx(Check, { className: cn("size-4 shrink-0 mr-2", activePerspectiveId !== p.id ? "invisible" : "") }),
|
|
536
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: p.name.trim() || t("ui.perspectives.untitled", "Untitled view") })
|
|
537
|
+
]
|
|
538
|
+
},
|
|
539
|
+
p.id
|
|
540
|
+
)),
|
|
541
|
+
rolePerspectives.map((p) => /* @__PURE__ */ jsxs(
|
|
542
|
+
Button,
|
|
543
|
+
{
|
|
544
|
+
type: "button",
|
|
545
|
+
variant: "ghost",
|
|
546
|
+
size: "sm",
|
|
547
|
+
className: cn(
|
|
548
|
+
"w-full justify-start h-auto px-2 py-1.5 text-sm font-normal",
|
|
549
|
+
activePerspectiveId === p.id && "bg-accent text-accent-foreground"
|
|
550
|
+
),
|
|
551
|
+
onClick: () => {
|
|
552
|
+
onActivate(p, "role");
|
|
553
|
+
setOpen(false);
|
|
554
|
+
},
|
|
555
|
+
children: [
|
|
556
|
+
/* @__PURE__ */ jsx(Check, { className: cn("size-4 shrink-0 mr-2", activePerspectiveId !== p.id ? "invisible" : "") }),
|
|
557
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: p.name.trim() || t("ui.perspectives.untitled", "Untitled view") })
|
|
558
|
+
]
|
|
559
|
+
},
|
|
560
|
+
p.id
|
|
561
|
+
))
|
|
562
|
+
] })
|
|
563
|
+
] })
|
|
564
|
+
] });
|
|
565
|
+
}
|
|
566
|
+
function DataTable({
|
|
567
|
+
columns,
|
|
568
|
+
data,
|
|
569
|
+
toolbar,
|
|
570
|
+
title,
|
|
571
|
+
actions,
|
|
572
|
+
refreshButton,
|
|
573
|
+
sortable,
|
|
574
|
+
sorting: sortingProp,
|
|
575
|
+
onSortingChange,
|
|
576
|
+
pagination,
|
|
577
|
+
isLoading,
|
|
578
|
+
emptyState,
|
|
579
|
+
error,
|
|
580
|
+
rowActions,
|
|
581
|
+
onRowClick,
|
|
582
|
+
rowClickActionIds,
|
|
583
|
+
disableRowClick = false,
|
|
584
|
+
bulkActions: bulkActionsProp,
|
|
585
|
+
searchValue,
|
|
586
|
+
onSearchChange,
|
|
587
|
+
searchPlaceholder,
|
|
588
|
+
searchAlign = "left",
|
|
589
|
+
filters: baseFilters = EMPTY_FILTER_DEFS,
|
|
590
|
+
filterValues = EMPTY_FILTER_VALUES,
|
|
591
|
+
onFiltersApply,
|
|
592
|
+
onFiltersClear,
|
|
593
|
+
entityId,
|
|
594
|
+
entityIds,
|
|
595
|
+
exporter,
|
|
596
|
+
perspective,
|
|
597
|
+
embedded = false,
|
|
598
|
+
onCustomFieldFilterFieldsetChange,
|
|
599
|
+
customFieldFilterKeyExtras,
|
|
600
|
+
injectionSpotId,
|
|
601
|
+
injectionContext,
|
|
602
|
+
replacementHandle,
|
|
603
|
+
stickyFirstColumn = false,
|
|
604
|
+
stickyActionsColumn = false,
|
|
605
|
+
virtualized = false,
|
|
606
|
+
virtualizedMaxHeight,
|
|
607
|
+
virtualizedOverscan = 10,
|
|
608
|
+
advancedFilter,
|
|
609
|
+
columnChooser
|
|
610
|
+
}) {
|
|
611
|
+
const t = useT();
|
|
612
|
+
const { confirm, ConfirmDialogElement } = useConfirmDialog();
|
|
613
|
+
const router = useRouter();
|
|
614
|
+
const resolvedRowClickActionIds = rowClickActionIds ?? DEFAULT_ROW_CLICK_ACTION_IDS;
|
|
615
|
+
const containerRef = React.useRef(null);
|
|
616
|
+
const lastScopeRef = React.useRef(null);
|
|
617
|
+
const hasInitializedScopeRef = React.useRef(false);
|
|
618
|
+
React.useEffect(() => {
|
|
619
|
+
return subscribeOrganizationScopeChanged((detail) => {
|
|
620
|
+
const prev = lastScopeRef.current;
|
|
621
|
+
lastScopeRef.current = detail;
|
|
622
|
+
if (!hasInitializedScopeRef.current) {
|
|
623
|
+
hasInitializedScopeRef.current = true;
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
if (prev && prev.organizationId === detail.organizationId && prev.tenantId === detail.tenantId) {
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
scheduleRouterRefresh(router);
|
|
630
|
+
});
|
|
631
|
+
}, [router]);
|
|
632
|
+
const queryClient = useQueryClient();
|
|
633
|
+
const perspectiveConfig = perspective ?? null;
|
|
634
|
+
const perspectiveTableId = perspectiveConfig?.tableId ?? null;
|
|
635
|
+
const perspectiveEnabled = Boolean(perspectiveTableId);
|
|
636
|
+
const initialSnapshotRef = React.useRef(null);
|
|
637
|
+
const snapshotHydratedTableRef = React.useRef(null);
|
|
638
|
+
const initialSettingsFromConfig = sanitizePerspectiveSettings(perspectiveConfig?.initialState?.initialSettings ?? null);
|
|
639
|
+
const mergedInitialSettings = initialSettingsFromConfig;
|
|
640
|
+
const initialActiveId = perspectiveConfig?.initialState?.activePerspectiveId ?? null;
|
|
641
|
+
const [isPerspectiveOpen, setPerspectiveOpen] = React.useState(false);
|
|
642
|
+
const [isAdvancedFilterOpen, setAdvancedFilterOpen] = React.useState(false);
|
|
643
|
+
const [activePerspectiveId, setActivePerspectiveId] = React.useState(initialActiveId);
|
|
644
|
+
const [columnVisibility, setColumnVisibility] = React.useState(() => mergedInitialSettings?.columnVisibility ?? {});
|
|
645
|
+
const [columnOrder, setColumnOrder] = React.useState(() => mergedInitialSettings?.columnOrder ?? []);
|
|
646
|
+
const [deletingIds, setDeletingIds] = React.useState([]);
|
|
647
|
+
const [roleClearingIds, setRoleClearingIds] = React.useState([]);
|
|
648
|
+
const [perspectiveApiMissing, setPerspectiveApiMissing] = React.useState(false);
|
|
649
|
+
const perspectiveFeatureQuery = useQuery({
|
|
650
|
+
queryKey: ["feature-check", "perspectives"],
|
|
651
|
+
enabled: perspectiveEnabled,
|
|
652
|
+
staleTime: 5 * 60 * 1e3,
|
|
653
|
+
queryFn: async () => {
|
|
654
|
+
try {
|
|
655
|
+
const call = await apiCall(
|
|
656
|
+
"/api/auth/feature-check",
|
|
657
|
+
{
|
|
658
|
+
method: "POST",
|
|
659
|
+
headers: { "Content-Type": "application/json" },
|
|
660
|
+
body: JSON.stringify({ features: ["perspectives.use", "perspectives.role_defaults"] })
|
|
661
|
+
}
|
|
662
|
+
);
|
|
663
|
+
if (!call.ok) throw new Error(`feature-check failed (${call.status})`);
|
|
664
|
+
const data2 = call.result ?? {};
|
|
665
|
+
const granted = Array.isArray(data2?.granted) ? data2.granted.map((f) => String(f)) : [];
|
|
666
|
+
const has = (feature) => granted.some((grantedFeature) => {
|
|
667
|
+
if (grantedFeature === "*") return true;
|
|
668
|
+
if (grantedFeature === feature) return true;
|
|
669
|
+
if (grantedFeature.endsWith(".*")) {
|
|
670
|
+
const prefix = grantedFeature.slice(0, -2);
|
|
671
|
+
return feature === prefix || feature.startsWith(`${prefix}.`);
|
|
672
|
+
}
|
|
673
|
+
return false;
|
|
674
|
+
});
|
|
675
|
+
return {
|
|
676
|
+
use: has("perspectives.use"),
|
|
677
|
+
roleDefaults: has("perspectives.role_defaults")
|
|
678
|
+
};
|
|
679
|
+
} catch {
|
|
680
|
+
return {
|
|
681
|
+
use: true,
|
|
682
|
+
roleDefaults: true
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
const perspectivePermissions = perspectiveFeatureQuery.data;
|
|
688
|
+
const canUsePerspectives = perspectiveEnabled && Boolean(perspectivePermissions?.use);
|
|
689
|
+
const canUseRoleDefaultsFeature = Boolean(perspectivePermissions?.roleDefaults);
|
|
690
|
+
React.useEffect(() => {
|
|
691
|
+
if (!canUsePerspectives && isPerspectiveOpen) {
|
|
692
|
+
setPerspectiveOpen(false);
|
|
693
|
+
}
|
|
694
|
+
}, [canUsePerspectives, isPerspectiveOpen]);
|
|
695
|
+
React.useEffect(() => {
|
|
696
|
+
if (!perspectiveTableId) return;
|
|
697
|
+
if (!mergedInitialSettings) return;
|
|
698
|
+
const snapshot = {
|
|
699
|
+
perspectiveId: initialActiveId,
|
|
700
|
+
settings: mergedInitialSettings,
|
|
701
|
+
updatedAt: Date.now()
|
|
702
|
+
};
|
|
703
|
+
writePerspectiveSnapshot(perspectiveTableId, snapshot);
|
|
704
|
+
initialSnapshotRef.current = snapshot;
|
|
705
|
+
}, [perspectiveTableId, mergedInitialSettings, initialActiveId]);
|
|
706
|
+
const perspectiveQuery = useQuery({
|
|
707
|
+
queryKey: ["table-perspectives", perspectiveTableId],
|
|
708
|
+
queryFn: async () => {
|
|
709
|
+
if (!perspectiveTableId) throw new Error("Missing table id");
|
|
710
|
+
const call = await apiCall(`/api/perspectives/${encodeURIComponent(perspectiveTableId)}`);
|
|
711
|
+
if (call.status === 404) {
|
|
712
|
+
setPerspectiveApiMissing(true);
|
|
713
|
+
return {
|
|
714
|
+
tableId: perspectiveTableId,
|
|
715
|
+
perspectives: [],
|
|
716
|
+
defaultPerspectiveId: null,
|
|
717
|
+
rolePerspectives: [],
|
|
718
|
+
roles: [],
|
|
719
|
+
canApplyToRoles: false
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
if (!call.ok) {
|
|
723
|
+
await raiseCrudError(call.response, t("ui.dataTable.perspectives.error.load", "Failed to load perspectives"));
|
|
724
|
+
}
|
|
725
|
+
setPerspectiveApiMissing(false);
|
|
726
|
+
const payload = call.result;
|
|
727
|
+
if (!payload) throw new Error(t("ui.dataTable.perspectives.error.load", "Failed to load perspectives"));
|
|
728
|
+
return payload;
|
|
729
|
+
},
|
|
730
|
+
enabled: canUsePerspectives,
|
|
731
|
+
initialData: perspectiveConfig?.initialState?.response,
|
|
732
|
+
staleTime: 5 * 60 * 1e3,
|
|
733
|
+
gcTime: 10 * 60 * 1e3
|
|
734
|
+
});
|
|
735
|
+
const perspectiveData = perspectiveQuery.data;
|
|
736
|
+
const initialPerspectiveAppliedRef = React.useRef(Boolean(mergedInitialSettings));
|
|
737
|
+
const extensionTableId = React.useMemo(() => {
|
|
738
|
+
if (perspective?.tableId) return perspective.tableId;
|
|
739
|
+
if (injectionSpotId?.startsWith("data-table:")) return injectionSpotId.slice("data-table:".length);
|
|
740
|
+
return null;
|
|
741
|
+
}, [injectionSpotId, perspective?.tableId]);
|
|
742
|
+
const resolvedInjectionSpotId = injectionSpotId ?? (perspective?.tableId ? `data-table:${perspective.tableId}` : null);
|
|
743
|
+
const resolvedReplacementHandle = replacementHandle ?? ComponentReplacementHandles.dataTable(extensionTableId ?? "unknown");
|
|
744
|
+
const resolvedInjectionContext = React.useMemo(
|
|
745
|
+
() => injectionContext ?? { tableId: perspective?.tableId ?? null, title: typeof title === "string" ? title : void 0 },
|
|
746
|
+
[injectionContext, perspective?.tableId, title]
|
|
747
|
+
);
|
|
748
|
+
const headerInjectionSpotId = React.useMemo(
|
|
749
|
+
() => resolvedInjectionSpotId ? `${resolvedInjectionSpotId}:header` : null,
|
|
750
|
+
[resolvedInjectionSpotId]
|
|
751
|
+
);
|
|
752
|
+
const toolbarInjectionSpotId = React.useMemo(
|
|
753
|
+
() => resolvedInjectionSpotId ? `${resolvedInjectionSpotId}:toolbar` : null,
|
|
754
|
+
[resolvedInjectionSpotId]
|
|
755
|
+
);
|
|
756
|
+
const footerInjectionSpotId = React.useMemo(
|
|
757
|
+
() => resolvedInjectionSpotId ? `${resolvedInjectionSpotId}:footer` : null,
|
|
758
|
+
[resolvedInjectionSpotId]
|
|
759
|
+
);
|
|
760
|
+
const { widgets: columnWidgets } = useInjectionDataWidgets(
|
|
761
|
+
extensionTableId ? `data-table:${extensionTableId}:columns` : "__disabled__:columns"
|
|
762
|
+
);
|
|
763
|
+
const { widgets: rowActionWidgets } = useInjectionDataWidgets(
|
|
764
|
+
extensionTableId ? `data-table:${extensionTableId}:row-actions` : "__disabled__:row-actions"
|
|
765
|
+
);
|
|
766
|
+
const { widgets: bulkActionWidgets } = useInjectionDataWidgets(
|
|
767
|
+
extensionTableId ? `data-table:${extensionTableId}:bulk-actions` : "__disabled__:bulk-actions"
|
|
768
|
+
);
|
|
769
|
+
const { widgets: filterWidgets } = useInjectionDataWidgets(
|
|
770
|
+
extensionTableId ? `data-table:${extensionTableId}:filters` : "__disabled__:filters"
|
|
771
|
+
);
|
|
772
|
+
const injectedColumnDefs = React.useMemo(() => {
|
|
773
|
+
const entries = [];
|
|
774
|
+
for (const widget of columnWidgets) {
|
|
775
|
+
if (!("columns" in widget)) continue;
|
|
776
|
+
for (const definition of widget.columns ?? []) {
|
|
777
|
+
entries.push(definition);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
return collectUniqueById(entries, "column").map((definition) => ({
|
|
781
|
+
def: {
|
|
782
|
+
id: definition.id,
|
|
783
|
+
accessorFn: (row) => readInjectedColumnValue(row, definition.accessorKey),
|
|
784
|
+
header: t(definition.header, definition.header),
|
|
785
|
+
cell: definition.cell,
|
|
786
|
+
size: definition.size,
|
|
787
|
+
enableSorting: definition.sortable === true
|
|
788
|
+
},
|
|
789
|
+
placement: definition.placement
|
|
790
|
+
}));
|
|
791
|
+
}, [columnWidgets, t]);
|
|
792
|
+
const injectedRowActions = React.useMemo(() => {
|
|
793
|
+
const entries = [];
|
|
794
|
+
for (const widget of rowActionWidgets) {
|
|
795
|
+
if (!("rowActions" in widget)) continue;
|
|
796
|
+
for (const definition of widget.rowActions ?? []) {
|
|
797
|
+
entries.push(definition);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
return collectUniqueById(entries, "row action");
|
|
801
|
+
}, [rowActionWidgets]);
|
|
802
|
+
const injectedBulkActions = React.useMemo(() => {
|
|
803
|
+
const entries = [];
|
|
804
|
+
for (const widget of bulkActionWidgets) {
|
|
805
|
+
if (!("bulkActions" in widget)) continue;
|
|
806
|
+
for (const definition of widget.bulkActions ?? []) {
|
|
807
|
+
entries.push(definition);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
return collectUniqueById(entries, "bulk action");
|
|
811
|
+
}, [bulkActionWidgets]);
|
|
812
|
+
const { serverFilters: injectedFilters, clientFilters: injectedClientFilters } = React.useMemo(() => {
|
|
813
|
+
const byId = /* @__PURE__ */ new Map();
|
|
814
|
+
const clientEntries = [];
|
|
815
|
+
for (const widget of filterWidgets) {
|
|
816
|
+
if (!("filters" in widget)) continue;
|
|
817
|
+
for (const definition of widget.filters ?? []) {
|
|
818
|
+
const filter = definition;
|
|
819
|
+
const mappedType = filter.type === "date-range" ? "dateRange" : filter.type === "boolean" ? "checkbox" : filter.type === "select" ? "select" : "text";
|
|
820
|
+
const id = filter.queryParam ?? filter.id;
|
|
821
|
+
if (filter.strategy === "client" && filter.filterFn) {
|
|
822
|
+
clientEntries.push({ id, filterFn: filter.filterFn });
|
|
823
|
+
}
|
|
824
|
+
if (!byId.has(id)) {
|
|
825
|
+
const translatedOptions = Array.isArray(filter.options) ? filter.options.map((option) => ({
|
|
826
|
+
...option,
|
|
827
|
+
label: t(option.label, option.label)
|
|
828
|
+
})) : filter.options;
|
|
829
|
+
byId.set(id, {
|
|
830
|
+
id,
|
|
831
|
+
label: t(filter.label, filter.label),
|
|
832
|
+
type: mappedType,
|
|
833
|
+
options: translatedOptions
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
return { serverFilters: Array.from(byId.values()), clientFilters: clientEntries };
|
|
839
|
+
}, [filterWidgets, t]);
|
|
840
|
+
const mergedColumns = React.useMemo(() => {
|
|
841
|
+
if (!injectedColumnDefs.length) return columns;
|
|
842
|
+
let result = [...columns];
|
|
843
|
+
for (const { def, placement } of injectedColumnDefs) {
|
|
844
|
+
result = insertByInjectionPlacement(
|
|
845
|
+
result,
|
|
846
|
+
def,
|
|
847
|
+
placement,
|
|
848
|
+
(col) => col.id ?? ""
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
return result;
|
|
852
|
+
}, [columns, injectedColumnDefs]);
|
|
853
|
+
const resolvedRowActions = React.useCallback((row) => {
|
|
854
|
+
const injectedItems = injectedRowActions.map((action) => ({
|
|
855
|
+
id: action.id,
|
|
856
|
+
label: t(action.label, action.label),
|
|
857
|
+
onSelect: () => action.onSelect(row, { navigate: (href) => router.push(href) }),
|
|
858
|
+
placement: action.placement
|
|
859
|
+
}));
|
|
860
|
+
const baseNode = rowActions ? rowActions(row) : null;
|
|
861
|
+
if (!injectedItems.length) return baseNode;
|
|
862
|
+
if (React.isValidElement(baseNode)) {
|
|
863
|
+
const baseItems = baseNode.props.items;
|
|
864
|
+
if (Array.isArray(baseItems)) {
|
|
865
|
+
let merged = [...baseItems];
|
|
866
|
+
const existingIds = new Set(
|
|
867
|
+
baseItems.map((item) => item.id).filter((id) => typeof id === "string" && id.length > 0)
|
|
868
|
+
);
|
|
869
|
+
for (const item of injectedItems) {
|
|
870
|
+
if (item.id && existingIds.has(item.id)) continue;
|
|
871
|
+
merged = insertByInjectionPlacement(
|
|
872
|
+
merged,
|
|
873
|
+
item,
|
|
874
|
+
item.placement,
|
|
875
|
+
(entry) => entry.id ?? ""
|
|
876
|
+
);
|
|
877
|
+
}
|
|
878
|
+
return /* @__PURE__ */ jsx(RowActions, { items: merged });
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
return /* @__PURE__ */ jsx(RowActions, { items: injectedItems });
|
|
882
|
+
}, [injectedRowActions, rowActions, router, t]);
|
|
883
|
+
const DATE_FORMAT = process.env.NEXT_PUBLIC_DATE_FORMAT || "YYYY-MM-DD HH:mm";
|
|
884
|
+
const pad2 = (n) => n < 10 ? `0${n}` : String(n);
|
|
885
|
+
const simpleFormat = (d, fmt) => {
|
|
886
|
+
const YYYY = String(d.getFullYear());
|
|
887
|
+
const MM = pad2(d.getMonth() + 1);
|
|
888
|
+
const DD = pad2(d.getDate());
|
|
889
|
+
const HH = pad2(d.getHours());
|
|
890
|
+
const mm = pad2(d.getMinutes());
|
|
891
|
+
const ss = pad2(d.getSeconds());
|
|
892
|
+
return fmt.replace(/YYYY/g, YYYY).replace(/MM/g, MM).replace(/DD/g, DD).replace(/HH/g, HH).replace(/mm/g, mm).replace(/ss/g, ss);
|
|
893
|
+
};
|
|
894
|
+
const tryParseDate = (v) => {
|
|
895
|
+
if (v == null) return null;
|
|
896
|
+
if (v instanceof Date) return isNaN(v.getTime()) ? null : v;
|
|
897
|
+
if (typeof v === "number") {
|
|
898
|
+
const d = new Date(v);
|
|
899
|
+
return isNaN(d.getTime()) ? null : d;
|
|
900
|
+
}
|
|
901
|
+
if (typeof v === "string") {
|
|
902
|
+
const s = v.trim();
|
|
903
|
+
if (!s) return null;
|
|
904
|
+
if (/^\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?)?$/.test(s)) {
|
|
905
|
+
const d2 = new Date(s);
|
|
906
|
+
return isNaN(d2.getTime()) ? null : d2;
|
|
907
|
+
}
|
|
908
|
+
const d = new Date(s);
|
|
909
|
+
return isNaN(d.getTime()) ? null : d;
|
|
910
|
+
}
|
|
911
|
+
return null;
|
|
912
|
+
};
|
|
913
|
+
const [dateColumnIds, setDateColumnIds] = React.useState(null);
|
|
914
|
+
React.useEffect(() => {
|
|
915
|
+
if (dateColumnIds) return;
|
|
916
|
+
if (!data || data.length === 0) return;
|
|
917
|
+
const accessors = mergedColumns.map((c) => {
|
|
918
|
+
const key = c.accessorKey;
|
|
919
|
+
const id = c.id;
|
|
920
|
+
return { id: id || key || "", key };
|
|
921
|
+
});
|
|
922
|
+
const guessed = /* @__PURE__ */ new Set();
|
|
923
|
+
accessors.forEach((a) => {
|
|
924
|
+
if (!a.id) return;
|
|
925
|
+
const name = a.id;
|
|
926
|
+
if (name.endsWith("_at")) {
|
|
927
|
+
guessed.add(name);
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
});
|
|
931
|
+
setDateColumnIds(guessed);
|
|
932
|
+
}, [dateColumnIds, data, mergedColumns]);
|
|
933
|
+
const responsiveClass = (_priority, hidden) => {
|
|
934
|
+
if (hidden) return "";
|
|
935
|
+
return "";
|
|
936
|
+
};
|
|
937
|
+
const resolvePriority = React.useCallback((column) => {
|
|
938
|
+
const meta = column.columnDef?.meta;
|
|
939
|
+
const rawPriority = typeof meta?.priority === "number" ? meta.priority : void 0;
|
|
940
|
+
if (rawPriority && rawPriority > 0) return rawPriority;
|
|
941
|
+
const index = column.getIndex();
|
|
942
|
+
return index <= 1 ? 1 : 2;
|
|
943
|
+
}, []);
|
|
944
|
+
const initialSorting = React.useMemo(() => {
|
|
945
|
+
if (mergedInitialSettings?.sorting) {
|
|
946
|
+
return mergedInitialSettings.sorting.map((item) => ({ id: item.id, desc: Boolean(item.desc) }));
|
|
947
|
+
}
|
|
948
|
+
return [];
|
|
949
|
+
}, [mergedInitialSettings]);
|
|
950
|
+
const [sorting, setSorting] = React.useState(() => {
|
|
951
|
+
if (sortingProp && sortingProp.length) return sortingProp;
|
|
952
|
+
if (initialSorting.length) return initialSorting;
|
|
953
|
+
return [];
|
|
954
|
+
});
|
|
955
|
+
const clientFilteredData = React.useMemo(() => {
|
|
956
|
+
if (!injectedClientFilters.length || !filterValues) return data;
|
|
957
|
+
const activeClientFilters = injectedClientFilters.filter(
|
|
958
|
+
(cf) => filterValues[cf.id] !== void 0 && filterValues[cf.id] !== "" && filterValues[cf.id] !== null
|
|
959
|
+
);
|
|
960
|
+
if (!activeClientFilters.length) return data;
|
|
961
|
+
return data.filter(
|
|
962
|
+
(row) => activeClientFilters.every((cf) => cf.filterFn(row, filterValues[cf.id]))
|
|
963
|
+
);
|
|
964
|
+
}, [data, injectedClientFilters, filterValues]);
|
|
965
|
+
const hasPropBulkActions = Array.isArray(bulkActionsProp) && bulkActionsProp.length > 0;
|
|
966
|
+
const hasInjectedBulkActions = injectedBulkActions.length > 0 || hasPropBulkActions;
|
|
967
|
+
const [rowSelection, setRowSelection] = React.useState({});
|
|
968
|
+
const table = useReactTable({
|
|
969
|
+
data: clientFilteredData,
|
|
970
|
+
columns: mergedColumns,
|
|
971
|
+
getCoreRowModel: getCoreRowModel(),
|
|
972
|
+
...sortable ? { getSortedRowModel: getSortedRowModel() } : {},
|
|
973
|
+
getRowId: resolveDataTableRowId,
|
|
974
|
+
state: { sorting, columnVisibility, columnOrder, rowSelection },
|
|
975
|
+
enableRowSelection: hasInjectedBulkActions,
|
|
976
|
+
onSortingChange: (updater) => {
|
|
977
|
+
const next = typeof updater === "function" ? updater(sorting) : updater;
|
|
978
|
+
setSorting(next);
|
|
979
|
+
onSortingChange?.(next);
|
|
980
|
+
},
|
|
981
|
+
onColumnVisibilityChange: (updater) => {
|
|
982
|
+
const next = typeof updater === "function" ? updater(columnVisibility) : updater;
|
|
983
|
+
setColumnVisibility(next);
|
|
984
|
+
},
|
|
985
|
+
onColumnOrderChange: (updater) => {
|
|
986
|
+
const next = typeof updater === "function" ? updater(columnOrder) : updater;
|
|
987
|
+
setColumnOrder(next);
|
|
988
|
+
},
|
|
989
|
+
onRowSelectionChange: setRowSelection
|
|
990
|
+
});
|
|
991
|
+
React.useEffect(() => {
|
|
992
|
+
if (sortingProp) setSorting(sortingProp);
|
|
993
|
+
}, [sortingProp]);
|
|
994
|
+
React.useEffect(() => {
|
|
995
|
+
if (hasInjectedBulkActions) return;
|
|
996
|
+
if (Object.keys(rowSelection).length === 0) return;
|
|
997
|
+
setRowSelection({});
|
|
998
|
+
}, [hasInjectedBulkActions, rowSelection]);
|
|
999
|
+
React.useEffect(() => {
|
|
1000
|
+
const ids = table.getAllLeafColumns().map((column) => column.id);
|
|
1001
|
+
if (!ids.length) return;
|
|
1002
|
+
setColumnOrder((prev) => {
|
|
1003
|
+
if (!prev.length) return ids;
|
|
1004
|
+
const allowed = ids;
|
|
1005
|
+
const filtered = prev.filter((id) => allowed.includes(id));
|
|
1006
|
+
const seen = new Set(filtered);
|
|
1007
|
+
for (const id of allowed) {
|
|
1008
|
+
if (!seen.has(id)) {
|
|
1009
|
+
filtered.push(id);
|
|
1010
|
+
seen.add(id);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
const changed = filtered.length !== prev.length || filtered.some((id, index) => id !== prev[index]);
|
|
1014
|
+
return changed ? filtered : prev;
|
|
1015
|
+
});
|
|
1016
|
+
}, [table, mergedColumns]);
|
|
1017
|
+
const initialVisibilityApplied = React.useRef(Boolean(mergedInitialSettings?.columnVisibility));
|
|
1018
|
+
React.useEffect(() => {
|
|
1019
|
+
if (initialVisibilityApplied.current) return;
|
|
1020
|
+
const hidden = {};
|
|
1021
|
+
table.getAllLeafColumns().forEach((column) => {
|
|
1022
|
+
const hiddenMeta = column.columnDef?.meta?.hidden;
|
|
1023
|
+
if (hiddenMeta) hidden[column.id] = false;
|
|
1024
|
+
});
|
|
1025
|
+
if (Object.keys(hidden).length) {
|
|
1026
|
+
setColumnVisibility((prev) => ({ ...hidden, ...prev }));
|
|
1027
|
+
}
|
|
1028
|
+
initialVisibilityApplied.current = true;
|
|
1029
|
+
}, [table, mergedColumns]);
|
|
1030
|
+
const getCurrentSettings = React.useCallback(() => {
|
|
1031
|
+
const visibility = {};
|
|
1032
|
+
for (const [key, value] of Object.entries(columnVisibility)) {
|
|
1033
|
+
if (typeof key === "string" && typeof value === "boolean") {
|
|
1034
|
+
visibility[key] = value;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
const filtersRecord = {};
|
|
1038
|
+
for (const [key, value] of Object.entries(filterValues ?? {})) {
|
|
1039
|
+
if (typeof key === "string") filtersRecord[key] = value;
|
|
1040
|
+
}
|
|
1041
|
+
const candidate = {
|
|
1042
|
+
columnOrder,
|
|
1043
|
+
columnVisibility: visibility,
|
|
1044
|
+
sorting,
|
|
1045
|
+
filters: filtersRecord,
|
|
1046
|
+
searchValue
|
|
1047
|
+
};
|
|
1048
|
+
return sanitizePerspectiveSettings(candidate) ?? {};
|
|
1049
|
+
}, [columnOrder, columnVisibility, sorting, filterValues, searchValue]);
|
|
1050
|
+
const applyPerspectiveSettings = React.useCallback((settings, nextId) => {
|
|
1051
|
+
const normalized = sanitizePerspectiveSettings(settings) ?? {};
|
|
1052
|
+
if (normalized.columnOrder && normalized.columnOrder.length) {
|
|
1053
|
+
setColumnOrder(normalized.columnOrder);
|
|
1054
|
+
} else {
|
|
1055
|
+
const ids = table.getAllLeafColumns().map((column) => column.id);
|
|
1056
|
+
if (ids.length) setColumnOrder(ids);
|
|
1057
|
+
}
|
|
1058
|
+
if (normalized.columnVisibility) setColumnVisibility(normalized.columnVisibility);
|
|
1059
|
+
else setColumnVisibility({});
|
|
1060
|
+
if (normalized.sorting) {
|
|
1061
|
+
const sortingState = normalized.sorting.map((item) => ({
|
|
1062
|
+
id: item.id,
|
|
1063
|
+
desc: item.desc === true
|
|
1064
|
+
}));
|
|
1065
|
+
setSorting(sortingState);
|
|
1066
|
+
onSortingChange?.(sortingState);
|
|
1067
|
+
} else {
|
|
1068
|
+
setSorting([]);
|
|
1069
|
+
onSortingChange?.([]);
|
|
1070
|
+
}
|
|
1071
|
+
if (onFiltersApply) {
|
|
1072
|
+
onFiltersApply(normalized.filters ?? {});
|
|
1073
|
+
}
|
|
1074
|
+
if (onSearchChange) {
|
|
1075
|
+
onSearchChange(normalized.searchValue ?? "");
|
|
1076
|
+
}
|
|
1077
|
+
setActivePerspectiveId(nextId);
|
|
1078
|
+
if (perspectiveTableId) {
|
|
1079
|
+
writePerspectiveCookie(perspectiveTableId, nextId);
|
|
1080
|
+
if (nextId) {
|
|
1081
|
+
const snapshot = { perspectiveId: nextId, settings: normalized, updatedAt: Date.now() };
|
|
1082
|
+
writePerspectiveSnapshot(perspectiveTableId, snapshot);
|
|
1083
|
+
initialSnapshotRef.current = snapshot;
|
|
1084
|
+
} else {
|
|
1085
|
+
writePerspectiveSnapshot(perspectiveTableId, null);
|
|
1086
|
+
initialSnapshotRef.current = null;
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}, [onFiltersApply, onSearchChange, onSortingChange, perspectiveTableId, table]);
|
|
1090
|
+
React.useLayoutEffect(() => {
|
|
1091
|
+
if (!perspectiveTableId) return;
|
|
1092
|
+
if (snapshotHydratedTableRef.current === perspectiveTableId) return;
|
|
1093
|
+
snapshotHydratedTableRef.current = perspectiveTableId;
|
|
1094
|
+
const snapshot = readPerspectiveSnapshot(perspectiveTableId);
|
|
1095
|
+
if (!snapshot) return;
|
|
1096
|
+
initialSnapshotRef.current = snapshot;
|
|
1097
|
+
applyPerspectiveSettings(snapshot.settings, snapshot.perspectiveId ?? null);
|
|
1098
|
+
initialPerspectiveAppliedRef.current = true;
|
|
1099
|
+
}, [perspectiveTableId, applyPerspectiveSettings]);
|
|
1100
|
+
const perspectiveQueryKey = ["table-perspectives", perspectiveTableId];
|
|
1101
|
+
const savePerspectiveMutation = useMutation({
|
|
1102
|
+
mutationFn: async (input) => {
|
|
1103
|
+
if (!perspectiveTableId) throw new Error("Missing table id");
|
|
1104
|
+
const payload = {
|
|
1105
|
+
perspectiveId: input.perspectiveId ?? void 0,
|
|
1106
|
+
name: input.name,
|
|
1107
|
+
settings: input.settings ?? getCurrentSettings(),
|
|
1108
|
+
isDefault: input.isDefault,
|
|
1109
|
+
applyToRoles: input.applyToRoles,
|
|
1110
|
+
setRoleDefault: input.setRoleDefault
|
|
1111
|
+
};
|
|
1112
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1113
|
+
console.debug("[DataTable] perspective payload", payload);
|
|
1114
|
+
}
|
|
1115
|
+
const call = await apiCall(
|
|
1116
|
+
`/api/perspectives/${encodeURIComponent(perspectiveTableId)}`,
|
|
1117
|
+
{
|
|
1118
|
+
method: "POST",
|
|
1119
|
+
headers: { "Content-Type": "application/json" },
|
|
1120
|
+
body: JSON.stringify(payload)
|
|
1121
|
+
}
|
|
1122
|
+
);
|
|
1123
|
+
if (call.status === 404) {
|
|
1124
|
+
throw new Error(t("ui.dataTable.perspectives.error.apiUnavailable", "Perspectives API is not available. Run `yarn generate` to regenerate module routes and restart the dev server."));
|
|
1125
|
+
}
|
|
1126
|
+
if (!call.ok) {
|
|
1127
|
+
await raiseCrudError(call.response, t("ui.dataTable.perspectives.error.save", "Failed to save perspective"));
|
|
1128
|
+
}
|
|
1129
|
+
const result = call.result;
|
|
1130
|
+
if (!result) throw new Error(t("ui.dataTable.perspectives.error.save", "Failed to save perspective"));
|
|
1131
|
+
return result;
|
|
1132
|
+
},
|
|
1133
|
+
onSuccess: (data2) => {
|
|
1134
|
+
if (perspectiveTableId) {
|
|
1135
|
+
void queryClient.invalidateQueries({ queryKey: perspectiveQueryKey });
|
|
1136
|
+
}
|
|
1137
|
+
if (data2.perspective) {
|
|
1138
|
+
applyPerspectiveSettings(data2.perspective.settings, data2.perspective.id);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
});
|
|
1142
|
+
const resolveColumnLabel = React.useCallback((column) => {
|
|
1143
|
+
const meta = column.columnDef?.meta;
|
|
1144
|
+
if (typeof meta?.label === "string" && meta.label.trim().length > 0) return meta.label.trim();
|
|
1145
|
+
if (typeof meta?.title === "string" && meta.title.trim().length > 0) return meta.title.trim();
|
|
1146
|
+
const header = column.columnDef.header;
|
|
1147
|
+
if (typeof header === "string") return header;
|
|
1148
|
+
if (typeof header === "function") return normalizeLabel(column.id);
|
|
1149
|
+
return normalizeLabel(column.id);
|
|
1150
|
+
}, []);
|
|
1151
|
+
const activePersonalPerspectiveId = React.useMemo(() => {
|
|
1152
|
+
if (!perspectiveData || !activePerspectiveId) return null;
|
|
1153
|
+
const found = perspectiveData.perspectives.find((p) => p.id === activePerspectiveId);
|
|
1154
|
+
return found ? found.id : null;
|
|
1155
|
+
}, [perspectiveData, activePerspectiveId]);
|
|
1156
|
+
const deletePerspectiveMutation = useMutation({
|
|
1157
|
+
mutationFn: async ({ perspectiveId }) => {
|
|
1158
|
+
if (!perspectiveTableId) throw new Error("Missing table id");
|
|
1159
|
+
const call = await apiCall(
|
|
1160
|
+
`/api/perspectives/${encodeURIComponent(perspectiveTableId)}/${encodeURIComponent(perspectiveId)}`,
|
|
1161
|
+
{ method: "DELETE" }
|
|
1162
|
+
);
|
|
1163
|
+
if (call.status === 404) throw new Error(t("ui.dataTable.perspectives.error.apiUnavailable", "Perspectives API is not available. Run `yarn generate` and restart the dev server."));
|
|
1164
|
+
if (!call.ok) {
|
|
1165
|
+
await raiseCrudError(call.response, t("ui.dataTable.perspectives.error.delete", "Failed to delete perspective"));
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
1168
|
+
onMutate: ({ perspectiveId }) => {
|
|
1169
|
+
setDeletingIds((prev) => prev.includes(perspectiveId) ? prev : [...prev, perspectiveId]);
|
|
1170
|
+
},
|
|
1171
|
+
onSettled: (_data, _error, variables) => {
|
|
1172
|
+
setDeletingIds((prev) => prev.filter((id) => id !== variables.perspectiveId));
|
|
1173
|
+
},
|
|
1174
|
+
onSuccess: (_data, variables) => {
|
|
1175
|
+
const removedActive = activePerspectiveId === variables.perspectiveId;
|
|
1176
|
+
if (perspectiveTableId) {
|
|
1177
|
+
void queryClient.invalidateQueries({ queryKey: perspectiveQueryKey });
|
|
1178
|
+
if (removedActive) {
|
|
1179
|
+
setActivePerspectiveId(null);
|
|
1180
|
+
writePerspectiveCookie(perspectiveTableId, null);
|
|
1181
|
+
writePerspectiveSnapshot(perspectiveTableId, null);
|
|
1182
|
+
initialSnapshotRef.current = null;
|
|
1183
|
+
initialPerspectiveAppliedRef.current = false;
|
|
1184
|
+
}
|
|
1185
|
+
} else if (removedActive) {
|
|
1186
|
+
setActivePerspectiveId(null);
|
|
1187
|
+
initialPerspectiveAppliedRef.current = false;
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
});
|
|
1191
|
+
const clearRoleMutation = useMutation({
|
|
1192
|
+
mutationFn: async ({ roleId }) => {
|
|
1193
|
+
if (!perspectiveTableId) throw new Error("Missing table id");
|
|
1194
|
+
const call = await apiCall(
|
|
1195
|
+
`/api/perspectives/${encodeURIComponent(perspectiveTableId)}/roles/${encodeURIComponent(roleId)}`,
|
|
1196
|
+
{ method: "DELETE" }
|
|
1197
|
+
);
|
|
1198
|
+
if (call.status === 404) throw new Error(t("ui.dataTable.perspectives.error.apiUnavailable", "Perspectives API is not available. Run `yarn generate` and restart the dev server."));
|
|
1199
|
+
if (!call.ok) {
|
|
1200
|
+
await raiseCrudError(call.response, t("ui.dataTable.perspectives.error.clearRoles", "Failed to clear role perspectives"));
|
|
1201
|
+
}
|
|
1202
|
+
},
|
|
1203
|
+
onMutate: ({ roleId }) => {
|
|
1204
|
+
setRoleClearingIds((prev) => prev.includes(roleId) ? prev : [...prev, roleId]);
|
|
1205
|
+
},
|
|
1206
|
+
onSettled: (_data, _error, variables) => {
|
|
1207
|
+
setRoleClearingIds((prev) => prev.filter((id) => id !== variables.roleId));
|
|
1208
|
+
},
|
|
1209
|
+
onSuccess: (_data, variables) => {
|
|
1210
|
+
if (perspectiveTableId) {
|
|
1211
|
+
void queryClient.invalidateQueries({ queryKey: perspectiveQueryKey });
|
|
1212
|
+
}
|
|
1213
|
+
if (activePerspectiveId) {
|
|
1214
|
+
const current = queryClient.getQueryData(perspectiveQueryKey);
|
|
1215
|
+
const match = current?.rolePerspectives.find((rp) => rp.id === activePerspectiveId);
|
|
1216
|
+
if (match && match.roleId === variables.roleId) {
|
|
1217
|
+
setActivePerspectiveId(null);
|
|
1218
|
+
if (perspectiveTableId) writePerspectiveCookie(perspectiveTableId, null);
|
|
1219
|
+
if (perspectiveTableId) writePerspectiveSnapshot(perspectiveTableId, null);
|
|
1220
|
+
initialSnapshotRef.current = null;
|
|
1221
|
+
initialPerspectiveAppliedRef.current = false;
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
});
|
|
1226
|
+
const handlePerspectiveActivate = React.useCallback((item, _source) => {
|
|
1227
|
+
applyPerspectiveSettings(item.settings, item.id);
|
|
1228
|
+
}, [applyPerspectiveSettings]);
|
|
1229
|
+
const handlePerspectiveSave = React.useCallback(async (input) => {
|
|
1230
|
+
const normalizedRoles = Array.from(new Set(input.applyToRoles));
|
|
1231
|
+
await savePerspectiveMutation.mutateAsync({
|
|
1232
|
+
name: input.name.trim(),
|
|
1233
|
+
isDefault: input.isDefault,
|
|
1234
|
+
applyToRoles: normalizedRoles,
|
|
1235
|
+
setRoleDefault: normalizedRoles.length > 0 ? input.setRoleDefault : false,
|
|
1236
|
+
perspectiveId: input.perspectiveId !== void 0 ? input.perspectiveId : activePersonalPerspectiveId,
|
|
1237
|
+
settings: input.settings
|
|
1238
|
+
});
|
|
1239
|
+
}, [savePerspectiveMutation, activePersonalPerspectiveId]);
|
|
1240
|
+
const handlePerspectiveDelete = React.useCallback(async (perspectiveId) => {
|
|
1241
|
+
await deletePerspectiveMutation.mutateAsync({ perspectiveId });
|
|
1242
|
+
}, [deletePerspectiveMutation]);
|
|
1243
|
+
const handleClearRole = React.useCallback(async (roleId) => {
|
|
1244
|
+
await clearRoleMutation.mutateAsync({ roleId });
|
|
1245
|
+
}, [clearRoleMutation]);
|
|
1246
|
+
const handleColumnChooserToggle = React.useCallback((key) => {
|
|
1247
|
+
const column = table.getColumn(key);
|
|
1248
|
+
if (!column) return;
|
|
1249
|
+
const nextVisible = !column.getIsVisible();
|
|
1250
|
+
if (nextVisible) {
|
|
1251
|
+
setColumnOrder((prev) => prev.includes(key) ? prev : [...prev, key]);
|
|
1252
|
+
}
|
|
1253
|
+
setColumnVisibility((prev) => {
|
|
1254
|
+
const next = { ...prev };
|
|
1255
|
+
if (nextVisible) delete next[key];
|
|
1256
|
+
else next[key] = false;
|
|
1257
|
+
return next;
|
|
1258
|
+
});
|
|
1259
|
+
column.toggleVisibility(nextVisible);
|
|
1260
|
+
}, [table]);
|
|
1261
|
+
const handleColumnChooserReorder = React.useCallback((newOrder) => {
|
|
1262
|
+
setColumnOrder(newOrder);
|
|
1263
|
+
table.setColumnOrder(newOrder);
|
|
1264
|
+
}, [table]);
|
|
1265
|
+
const dndSensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 5 } }));
|
|
1266
|
+
const enableHeaderDnd = Boolean(columnChooser);
|
|
1267
|
+
const stableDndContextId = React.useMemo(
|
|
1268
|
+
() => sanitizeDndContextId(
|
|
1269
|
+
extensionTableId ?? perspectiveTableId ?? resolvedReplacementHandle ?? (typeof title === "string" && title.trim().length > 0 ? title : "data-table")
|
|
1270
|
+
),
|
|
1271
|
+
[extensionTableId, perspectiveTableId, resolvedReplacementHandle, title]
|
|
1272
|
+
);
|
|
1273
|
+
const headerColumnIds = React.useMemo(() => {
|
|
1274
|
+
if (!enableHeaderDnd) return [];
|
|
1275
|
+
return table.getHeaderGroups().flatMap((hg) => hg.headers.map((h) => h.id));
|
|
1276
|
+
}, [enableHeaderDnd, table, columnOrder]);
|
|
1277
|
+
const handleHeaderDragEnd = React.useCallback((event) => {
|
|
1278
|
+
const { active, over } = event;
|
|
1279
|
+
if (!over || active.id === over.id) return;
|
|
1280
|
+
const currentIds = columnOrder.length ? columnOrder : table.getAllLeafColumns().map((c) => c.id);
|
|
1281
|
+
const oldIdx = currentIds.indexOf(String(active.id));
|
|
1282
|
+
const newIdx = currentIds.indexOf(String(over.id));
|
|
1283
|
+
if (oldIdx === -1 || newIdx === -1) return;
|
|
1284
|
+
const next = [...currentIds];
|
|
1285
|
+
const [moved] = next.splice(oldIdx, 1);
|
|
1286
|
+
next.splice(newIdx, 0, moved);
|
|
1287
|
+
setColumnOrder(next);
|
|
1288
|
+
table.setColumnOrder(next);
|
|
1289
|
+
}, [columnOrder, table]);
|
|
1290
|
+
const perspectiveApiWarning = perspectiveApiMissing && canUsePerspectives ? t("ui.dataTable.perspectives.warning.apiUnavailable", "Perspectives API is not available yet. Run `yarn generate` to regenerate module routes, then restart the server.") : null;
|
|
1291
|
+
const loadStartRef = React.useRef(null);
|
|
1292
|
+
const [measuredDurationMs, setMeasuredDurationMs] = React.useState(null);
|
|
1293
|
+
React.useEffect(() => {
|
|
1294
|
+
if (typeof isLoading !== "boolean") return;
|
|
1295
|
+
if (isLoading) {
|
|
1296
|
+
if (loadStartRef.current === null) {
|
|
1297
|
+
const now = typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
1298
|
+
loadStartRef.current = now;
|
|
1299
|
+
}
|
|
1300
|
+
return;
|
|
1301
|
+
}
|
|
1302
|
+
if (loadStartRef.current !== null) {
|
|
1303
|
+
const now = typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
1304
|
+
setMeasuredDurationMs(now - loadStartRef.current);
|
|
1305
|
+
loadStartRef.current = null;
|
|
1306
|
+
}
|
|
1307
|
+
}, [isLoading]);
|
|
1308
|
+
React.useLayoutEffect(() => {
|
|
1309
|
+
if (!canUsePerspectives) return;
|
|
1310
|
+
if (!perspectiveTableId) return;
|
|
1311
|
+
if (initialSnapshotRef.current) return;
|
|
1312
|
+
if (initialPerspectiveAppliedRef.current && activePerspectiveId != null) return;
|
|
1313
|
+
const source = perspectiveData ?? perspectiveConfig?.initialState?.response;
|
|
1314
|
+
if (!source) return;
|
|
1315
|
+
const tryResolve = (id) => {
|
|
1316
|
+
if (!id) return void 0;
|
|
1317
|
+
return source.perspectives.find((p) => p.id === id) ?? source.rolePerspectives.find((p) => p.id === id);
|
|
1318
|
+
};
|
|
1319
|
+
let target;
|
|
1320
|
+
if (activePerspectiveId) {
|
|
1321
|
+
target = tryResolve(activePerspectiveId);
|
|
1322
|
+
}
|
|
1323
|
+
const cookieId = readPerspectiveCookie(perspectiveTableId);
|
|
1324
|
+
if (!target && cookieId) target = tryResolve(cookieId);
|
|
1325
|
+
if (!target && source.defaultPerspectiveId) {
|
|
1326
|
+
target = tryResolve(source.defaultPerspectiveId);
|
|
1327
|
+
}
|
|
1328
|
+
if (!target) {
|
|
1329
|
+
target = source.rolePerspectives.find((p) => p.isDefault);
|
|
1330
|
+
}
|
|
1331
|
+
if (!target) {
|
|
1332
|
+
target = source.perspectives[0];
|
|
1333
|
+
}
|
|
1334
|
+
if (target) {
|
|
1335
|
+
applyPerspectiveSettings(target.settings, target.id);
|
|
1336
|
+
}
|
|
1337
|
+
initialPerspectiveAppliedRef.current = true;
|
|
1338
|
+
}, [canUsePerspectives, perspectiveData, perspectiveTableId, perspectiveConfig, applyPerspectiveSettings, activePerspectiveId]);
|
|
1339
|
+
const scrollTableIntoView = React.useCallback(() => {
|
|
1340
|
+
const rect = containerRef.current?.getBoundingClientRect();
|
|
1341
|
+
if (!rect || rect.top >= 0) return;
|
|
1342
|
+
const behavior = window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "instant" : "smooth";
|
|
1343
|
+
containerRef.current?.scrollIntoView({ behavior, block: "start" });
|
|
1344
|
+
}, []);
|
|
1345
|
+
const paginationNode = React.useMemo(() => {
|
|
1346
|
+
if (!pagination || pagination.total === 0) return null;
|
|
1347
|
+
const { page, totalPages, onPageChange, durationMs, cacheStatus } = pagination;
|
|
1348
|
+
const startItem = (page - 1) * pagination.pageSize + 1;
|
|
1349
|
+
const endItem = Math.min(page * pagination.pageSize, pagination.total);
|
|
1350
|
+
const effectiveDuration = typeof durationMs === "number" && Number.isFinite(durationMs) && durationMs >= 0 ? durationMs : measuredDurationMs ?? void 0;
|
|
1351
|
+
const durationLabel = formatDurationLabel(effectiveDuration);
|
|
1352
|
+
const normalizedCacheStatus = cacheStatus === "hit" || cacheStatus === "miss" ? cacheStatus : null;
|
|
1353
|
+
const cacheBadge = normalizedCacheStatus ? /* @__PURE__ */ jsxs(
|
|
1354
|
+
"span",
|
|
1355
|
+
{
|
|
1356
|
+
className: "inline-flex items-center justify-center",
|
|
1357
|
+
"aria-label": t("ui.dataTable.pagination.cache.ariaLabel", "Cache {status}", { status: normalizedCacheStatus.toUpperCase() }),
|
|
1358
|
+
title: t("ui.dataTable.pagination.cache.title", "Cache {status}", { status: normalizedCacheStatus.toUpperCase() }),
|
|
1359
|
+
children: [
|
|
1360
|
+
/* @__PURE__ */ jsx(
|
|
1361
|
+
Circle,
|
|
1362
|
+
{
|
|
1363
|
+
className: `h-3.5 w-3.5 ${normalizedCacheStatus === "hit" ? "text-emerald-500" : "text-amber-500"}`,
|
|
1364
|
+
strokeWidth: 3
|
|
1365
|
+
}
|
|
1366
|
+
),
|
|
1367
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: t("ui.dataTable.pagination.cache.srOnly", "Cache {status}", { status: normalizedCacheStatus.toUpperCase() }) })
|
|
1368
|
+
]
|
|
1369
|
+
}
|
|
1370
|
+
) : null;
|
|
1371
|
+
const pageSizeOptions = Array.isArray(pagination.pageSizeOptions) ? Array.from(new Set(
|
|
1372
|
+
[pagination.pageSize, ...pagination.pageSizeOptions].filter((size) => typeof size === "number" && Number.isFinite(size) && size > 0).map((size) => Math.max(1, Math.floor(size)))
|
|
1373
|
+
)).sort((left, right) => left - right) : [];
|
|
1374
|
+
const pageSizeSelect = pageSizeOptions.length > 0 && pagination.onPageSizeChange ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
1375
|
+
/* @__PURE__ */ jsx(
|
|
1376
|
+
"select",
|
|
1377
|
+
{
|
|
1378
|
+
className: "rounded border bg-background pl-2 pr-7 py-0.5 text-sm min-w-[3.5rem]",
|
|
1379
|
+
value: pagination.pageSize,
|
|
1380
|
+
onChange: (event) => {
|
|
1381
|
+
pagination.onPageSizeChange(Number(event.target.value));
|
|
1382
|
+
scrollTableIntoView();
|
|
1383
|
+
},
|
|
1384
|
+
"aria-label": t("ui.dataTable.pagination.rowsPerPage", "Rows per page"),
|
|
1385
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx("option", { value: size, children: size }, size))
|
|
1386
|
+
}
|
|
1387
|
+
),
|
|
1388
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: t("ui.dataTable.pagination.perPage", "per page") })
|
|
1389
|
+
] }) : null;
|
|
1390
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 px-4 py-3 border-t", children: [
|
|
1391
|
+
/* @__PURE__ */ jsxs("div", { className: "text-sm text-muted-foreground flex items-center justify-center sm:justify-start gap-2 flex-wrap", children: [
|
|
1392
|
+
/* @__PURE__ */ jsx("span", { children: durationLabel ? t("ui.dataTable.pagination.resultsWithDuration", "Showing {start} to {end} of {total} results in {duration}", { start: startItem, end: endItem, total: pagination.total, duration: durationLabel }) : t("ui.dataTable.pagination.results", "Showing {start} to {end} of {total} results", { start: startItem, end: endItem, total: pagination.total }) }),
|
|
1393
|
+
cacheBadge,
|
|
1394
|
+
pageSizeSelect
|
|
1395
|
+
] }),
|
|
1396
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center sm:justify-end gap-2", children: [
|
|
1397
|
+
/* @__PURE__ */ jsx(
|
|
1398
|
+
Button,
|
|
1399
|
+
{
|
|
1400
|
+
variant: "outline",
|
|
1401
|
+
size: "sm",
|
|
1402
|
+
onClick: () => {
|
|
1403
|
+
onPageChange(page - 1);
|
|
1404
|
+
scrollTableIntoView();
|
|
1405
|
+
},
|
|
1406
|
+
disabled: page <= 1,
|
|
1407
|
+
children: t("ui.dataTable.pagination.previous", "Previous")
|
|
1408
|
+
}
|
|
1409
|
+
),
|
|
1410
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm whitespace-nowrap", children: t("ui.dataTable.pagination.pageInfo", "Page {page} of {totalPages}", { page, totalPages }) }),
|
|
1411
|
+
/* @__PURE__ */ jsx(
|
|
1412
|
+
Button,
|
|
1413
|
+
{
|
|
1414
|
+
variant: "outline",
|
|
1415
|
+
size: "sm",
|
|
1416
|
+
onClick: () => {
|
|
1417
|
+
onPageChange(page + 1);
|
|
1418
|
+
scrollTableIntoView();
|
|
1419
|
+
},
|
|
1420
|
+
disabled: page >= totalPages,
|
|
1421
|
+
children: t("ui.dataTable.pagination.next", "Next")
|
|
1422
|
+
}
|
|
1423
|
+
)
|
|
1424
|
+
] })
|
|
1425
|
+
] });
|
|
1426
|
+
}, [pagination, measuredDurationMs, scrollTableIntoView, t]);
|
|
1427
|
+
const resolvedEntityIds = React.useMemo(() => {
|
|
1428
|
+
if (Array.isArray(entityIds) && entityIds.length) {
|
|
1429
|
+
const dedup = /* @__PURE__ */ new Set();
|
|
1430
|
+
const list = [];
|
|
1431
|
+
entityIds.forEach((id) => {
|
|
1432
|
+
const trimmed = typeof id === "string" ? id.trim() : "";
|
|
1433
|
+
if (!trimmed || dedup.has(trimmed)) return;
|
|
1434
|
+
dedup.add(trimmed);
|
|
1435
|
+
list.push(trimmed);
|
|
1436
|
+
});
|
|
1437
|
+
return list;
|
|
1438
|
+
}
|
|
1439
|
+
if (typeof entityId === "string" && entityId.trim().length > 0) {
|
|
1440
|
+
return [entityId.trim()];
|
|
1441
|
+
}
|
|
1442
|
+
return [];
|
|
1443
|
+
}, [entityId, entityIds]);
|
|
1444
|
+
const entityKey = React.useMemo(() => resolvedEntityIds.length ? resolvedEntityIds.join("|") : null, [resolvedEntityIds]);
|
|
1445
|
+
const customFieldFilterExtrasSignature = React.useMemo(
|
|
1446
|
+
() => JSON.stringify(customFieldFilterKeyExtras ?? []),
|
|
1447
|
+
[customFieldFilterKeyExtras]
|
|
1448
|
+
);
|
|
1449
|
+
const [cfFilterFieldsetsByEntity, setCfFilterFieldsetsByEntity] = React.useState({});
|
|
1450
|
+
const [cfFilterFieldsetSelection, setCfFilterFieldsetSelection] = React.useState({});
|
|
1451
|
+
React.useEffect(() => {
|
|
1452
|
+
if (!entityKey) {
|
|
1453
|
+
setCfFilterFieldsetsByEntity({});
|
|
1454
|
+
setCfFilterFieldsetSelection({});
|
|
1455
|
+
return;
|
|
1456
|
+
}
|
|
1457
|
+
let cancelled = false;
|
|
1458
|
+
const loadFieldsets = async () => {
|
|
1459
|
+
try {
|
|
1460
|
+
const payload = await fetchCustomFieldDefinitionsPayload(resolvedEntityIds);
|
|
1461
|
+
if (cancelled) return;
|
|
1462
|
+
const fieldsets = payload.fieldsetsByEntity ?? {};
|
|
1463
|
+
setCfFilterFieldsetsByEntity(fieldsets);
|
|
1464
|
+
const selectionChanges = [];
|
|
1465
|
+
let shouldNotify = false;
|
|
1466
|
+
setCfFilterFieldsetSelection((prev) => {
|
|
1467
|
+
const next = {};
|
|
1468
|
+
let changed = false;
|
|
1469
|
+
resolvedEntityIds.forEach((entityId2) => {
|
|
1470
|
+
const list = fieldsets[entityId2] ?? [];
|
|
1471
|
+
if (!list.length) {
|
|
1472
|
+
if (prev[entityId2] !== void 0) changed = true;
|
|
1473
|
+
return;
|
|
1474
|
+
}
|
|
1475
|
+
const existing = prev[entityId2];
|
|
1476
|
+
const fallback = list[0]?.code ?? null;
|
|
1477
|
+
const isValidExisting = existing ? list.some((entry) => entry.code === existing) : false;
|
|
1478
|
+
const value = isValidExisting ? existing : fallback ?? null;
|
|
1479
|
+
next[entityId2] = value;
|
|
1480
|
+
if (value !== existing) {
|
|
1481
|
+
changed = true;
|
|
1482
|
+
selectionChanges.push([entityId2, value]);
|
|
1483
|
+
}
|
|
1484
|
+
});
|
|
1485
|
+
if (Object.keys(prev).length !== Object.keys(next).length) changed = true;
|
|
1486
|
+
if (changed) {
|
|
1487
|
+
shouldNotify = true;
|
|
1488
|
+
return next;
|
|
1489
|
+
}
|
|
1490
|
+
return prev;
|
|
1491
|
+
});
|
|
1492
|
+
if (shouldNotify && selectionChanges.length && onCustomFieldFilterFieldsetChange) {
|
|
1493
|
+
selectionChanges.forEach(([entityId2, value]) => onCustomFieldFilterFieldsetChange(value, entityId2));
|
|
1494
|
+
}
|
|
1495
|
+
} catch {
|
|
1496
|
+
if (!cancelled) {
|
|
1497
|
+
setCfFilterFieldsetsByEntity({});
|
|
1498
|
+
setCfFilterFieldsetSelection({});
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
};
|
|
1502
|
+
loadFieldsets();
|
|
1503
|
+
return () => {
|
|
1504
|
+
cancelled = true;
|
|
1505
|
+
};
|
|
1506
|
+
}, [customFieldFilterExtrasSignature, entityKey, onCustomFieldFilterFieldsetChange, resolvedEntityIds]);
|
|
1507
|
+
const supportsCustomFieldFilterFieldsets = resolvedEntityIds.length === 1 && (cfFilterFieldsetsByEntity[resolvedEntityIds[0]]?.length ?? 0) > 0;
|
|
1508
|
+
const activeCustomFieldFilterFieldset = supportsCustomFieldFilterFieldsets ? cfFilterFieldsetSelection[resolvedEntityIds[0]] ?? cfFilterFieldsetsByEntity[resolvedEntityIds[0]]?.[0]?.code ?? null : null;
|
|
1509
|
+
const handleCustomFieldFilterFieldsetChange = React.useCallback(
|
|
1510
|
+
(value) => {
|
|
1511
|
+
if (!supportsCustomFieldFilterFieldsets) return;
|
|
1512
|
+
const entityId2 = resolvedEntityIds[0];
|
|
1513
|
+
const nextValue = value || null;
|
|
1514
|
+
setCfFilterFieldsetSelection((prev) => {
|
|
1515
|
+
if (prev[entityId2] === nextValue) return prev;
|
|
1516
|
+
return { ...prev, [entityId2]: nextValue };
|
|
1517
|
+
});
|
|
1518
|
+
if (onCustomFieldFilterFieldsetChange) {
|
|
1519
|
+
onCustomFieldFilterFieldsetChange(nextValue, entityId2);
|
|
1520
|
+
}
|
|
1521
|
+
},
|
|
1522
|
+
[onCustomFieldFilterFieldsetChange, resolvedEntityIds, supportsCustomFieldFilterFieldsets]
|
|
1523
|
+
);
|
|
1524
|
+
const { data: cfFilters = [] } = useCustomFieldFilterDefs(entityKey ? resolvedEntityIds : [], {
|
|
1525
|
+
enabled: !!entityKey,
|
|
1526
|
+
fieldset: supportsCustomFieldFilterFieldsets ? activeCustomFieldFilterFieldset ?? void 0 : void 0,
|
|
1527
|
+
keyExtras: customFieldFilterKeyExtras
|
|
1528
|
+
});
|
|
1529
|
+
const isAutoAdvancedFilter = Boolean(advancedFilter?.auto);
|
|
1530
|
+
const isAutoColumnChooser = Boolean(columnChooser?.auto);
|
|
1531
|
+
const needsAutoDiscovery = isAutoAdvancedFilter || isAutoColumnChooser;
|
|
1532
|
+
const { data: autoDiscoveryDefs = [] } = useCustomFieldDefs(
|
|
1533
|
+
needsAutoDiscovery && entityKey ? resolvedEntityIds : [],
|
|
1534
|
+
{ enabled: needsAutoDiscovery && !!entityKey }
|
|
1535
|
+
);
|
|
1536
|
+
const autoDiscovered = useAutoDiscoveredFields({
|
|
1537
|
+
columns: needsAutoDiscovery ? mergedColumns : [],
|
|
1538
|
+
customFieldDefs: needsAutoDiscovery ? autoDiscoveryDefs : []
|
|
1539
|
+
});
|
|
1540
|
+
const resolvedAdvancedFilterFields = isAutoAdvancedFilter ? autoDiscovered.advancedFilterFields : advancedFilter?.fields ?? [];
|
|
1541
|
+
const resolvedColumnChooserFields = isAutoColumnChooser ? autoDiscovered.columnChooserFields : columnChooser?.availableColumns ?? [];
|
|
1542
|
+
const effectiveColumnChooserFields = React.useMemo(() => {
|
|
1543
|
+
if (resolvedColumnChooserFields.length > 0) return resolvedColumnChooserFields;
|
|
1544
|
+
return table.getAllLeafColumns().map((col) => ({
|
|
1545
|
+
key: col.id,
|
|
1546
|
+
label: resolveColumnLabel(col),
|
|
1547
|
+
group: "Columns",
|
|
1548
|
+
alwaysVisible: !col.getCanHide()
|
|
1549
|
+
}));
|
|
1550
|
+
}, [resolvedColumnChooserFields, table, resolveColumnLabel, columns]);
|
|
1551
|
+
const visibleColumnKeys = React.useMemo(
|
|
1552
|
+
() => table.getAllLeafColumns().filter((c) => c.getIsVisible()).map((c) => c.id),
|
|
1553
|
+
[table, columnVisibility, columns]
|
|
1554
|
+
);
|
|
1555
|
+
const selectedRows = React.useMemo(() => {
|
|
1556
|
+
if (!hasInjectedBulkActions) return [];
|
|
1557
|
+
return table.getSelectedRowModel().rows.map((row) => row.original);
|
|
1558
|
+
}, [hasInjectedBulkActions, table, rowSelection]);
|
|
1559
|
+
const trackedBulkProgressJobIdsRef = React.useRef(/* @__PURE__ */ new Set());
|
|
1560
|
+
const clearTrackedBulkProgressJob = React.useCallback((jobId) => {
|
|
1561
|
+
if (!jobId) return false;
|
|
1562
|
+
return trackedBulkProgressJobIdsRef.current.delete(jobId);
|
|
1563
|
+
}, []);
|
|
1564
|
+
const refreshAfterBulkProgressCompletion = React.useCallback(() => {
|
|
1565
|
+
if (refreshButton?.onRefresh) {
|
|
1566
|
+
refreshButton.onRefresh();
|
|
1567
|
+
return;
|
|
1568
|
+
}
|
|
1569
|
+
scheduleRouterRefresh(router);
|
|
1570
|
+
}, [refreshButton, router]);
|
|
1571
|
+
useAppEvent(
|
|
1572
|
+
"progress.job.completed",
|
|
1573
|
+
(event) => {
|
|
1574
|
+
const payload = event.payload;
|
|
1575
|
+
const jobId = typeof payload?.jobId === "string" ? payload.jobId : null;
|
|
1576
|
+
if (!clearTrackedBulkProgressJob(jobId)) return;
|
|
1577
|
+
refreshAfterBulkProgressCompletion();
|
|
1578
|
+
},
|
|
1579
|
+
[clearTrackedBulkProgressJob, refreshAfterBulkProgressCompletion]
|
|
1580
|
+
);
|
|
1581
|
+
useAppEvent(
|
|
1582
|
+
"progress.job.failed",
|
|
1583
|
+
(event) => {
|
|
1584
|
+
const payload = event.payload;
|
|
1585
|
+
const jobId = typeof payload?.jobId === "string" ? payload.jobId : null;
|
|
1586
|
+
clearTrackedBulkProgressJob(jobId);
|
|
1587
|
+
},
|
|
1588
|
+
[clearTrackedBulkProgressJob]
|
|
1589
|
+
);
|
|
1590
|
+
useAppEvent(
|
|
1591
|
+
"progress.job.cancelled",
|
|
1592
|
+
(event) => {
|
|
1593
|
+
const payload = event.payload;
|
|
1594
|
+
const jobId = typeof payload?.jobId === "string" ? payload.jobId : null;
|
|
1595
|
+
clearTrackedBulkProgressJob(jobId);
|
|
1596
|
+
},
|
|
1597
|
+
[clearTrackedBulkProgressJob]
|
|
1598
|
+
);
|
|
1599
|
+
const runBulkAction = React.useCallback(
|
|
1600
|
+
async (action) => {
|
|
1601
|
+
if (action.requiresSelection !== false && !selectedRows.length) return;
|
|
1602
|
+
try {
|
|
1603
|
+
const result = await action.onExecute(selectedRows, {
|
|
1604
|
+
tableId: extensionTableId,
|
|
1605
|
+
navigate: (href) => router.push(href),
|
|
1606
|
+
confirm,
|
|
1607
|
+
refresh: refreshButton?.onRefresh,
|
|
1608
|
+
injectionContext: resolvedInjectionContext,
|
|
1609
|
+
translate: t
|
|
1610
|
+
});
|
|
1611
|
+
const normalized = result;
|
|
1612
|
+
if (normalized && normalized.ok === false) {
|
|
1613
|
+
if (normalized.message === void 0) return;
|
|
1614
|
+
flash(
|
|
1615
|
+
normalized.message ?? t("ui.dataTable.bulkAction.error", "Bulk action failed."),
|
|
1616
|
+
"error"
|
|
1617
|
+
);
|
|
1618
|
+
return;
|
|
1619
|
+
}
|
|
1620
|
+
if (normalized?.progressJobId) {
|
|
1621
|
+
trackedBulkProgressJobIdsRef.current.add(normalized.progressJobId);
|
|
1622
|
+
setRowSelection({});
|
|
1623
|
+
flash(
|
|
1624
|
+
normalized.message ?? t("ui.dataTable.bulkAction.started", "Bulk action started. Track progress in the top bar."),
|
|
1625
|
+
"success"
|
|
1626
|
+
);
|
|
1627
|
+
return;
|
|
1628
|
+
}
|
|
1629
|
+
flash(
|
|
1630
|
+
normalized?.message ?? t("ui.dataTable.bulkAction.success", "Bulk action completed."),
|
|
1631
|
+
"success"
|
|
1632
|
+
);
|
|
1633
|
+
setRowSelection({});
|
|
1634
|
+
if (refreshButton?.onRefresh) {
|
|
1635
|
+
refreshButton.onRefresh();
|
|
1636
|
+
} else {
|
|
1637
|
+
scheduleRouterRefresh(router);
|
|
1638
|
+
}
|
|
1639
|
+
} catch (error2) {
|
|
1640
|
+
flash(
|
|
1641
|
+
error2 instanceof Error ? error2.message : t("ui.dataTable.bulkAction.error", "Bulk action failed."),
|
|
1642
|
+
"error"
|
|
1643
|
+
);
|
|
1644
|
+
}
|
|
1645
|
+
},
|
|
1646
|
+
[confirm, extensionTableId, refreshButton, resolvedInjectionContext, router, selectedRows, t]
|
|
1647
|
+
);
|
|
1648
|
+
const runPropBulkAction = React.useCallback(
|
|
1649
|
+
async (action) => {
|
|
1650
|
+
const result = await action.onExecute(selectedRows);
|
|
1651
|
+
if (result !== false) {
|
|
1652
|
+
setRowSelection({});
|
|
1653
|
+
}
|
|
1654
|
+
},
|
|
1655
|
+
[selectedRows]
|
|
1656
|
+
);
|
|
1657
|
+
const builtToolbar = React.useMemo(() => {
|
|
1658
|
+
if (toolbar) return toolbar;
|
|
1659
|
+
const anySearch = onSearchChange != null;
|
|
1660
|
+
const anyFilters = baseFilters && baseFilters.length > 0 || cfFilters && cfFilters.length > 0 || injectedFilters.length > 0;
|
|
1661
|
+
const hasBulkButtons = hasInjectedBulkActions || hasPropBulkActions;
|
|
1662
|
+
if (!anySearch && !anyFilters && !hasBulkButtons) return null;
|
|
1663
|
+
const baseList = baseFilters || [];
|
|
1664
|
+
const existing = new Set(baseList.map((f) => f.id));
|
|
1665
|
+
const cfOnly = (cfFilters || []).filter((f) => !existing.has(f.id));
|
|
1666
|
+
const injectedOnly = injectedFilters.filter((f) => !existing.has(f.id) && !cfOnly.some((cf) => cf.id === f.id));
|
|
1667
|
+
const combined = [...baseList, ...cfOnly, ...injectedOnly];
|
|
1668
|
+
const perspectiveButton = canUsePerspectives ? /* @__PURE__ */ jsx(
|
|
1669
|
+
ViewSwitcherDropdown,
|
|
1670
|
+
{
|
|
1671
|
+
activePerspectiveId,
|
|
1672
|
+
perspectives: perspectiveData?.perspectives ?? [],
|
|
1673
|
+
rolePerspectives: perspectiveData?.rolePerspectives ?? [],
|
|
1674
|
+
onClear: () => applyPerspectiveSettings({}, null),
|
|
1675
|
+
onActivate: handlePerspectiveActivate,
|
|
1676
|
+
onOpenSidebar: () => setPerspectiveOpen(true),
|
|
1677
|
+
t
|
|
1678
|
+
}
|
|
1679
|
+
) : null;
|
|
1680
|
+
const fieldsetSelector = supportsCustomFieldFilterFieldsets && resolvedEntityIds.length === 1 ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
1681
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: t("ui.dataTable.fieldset.label", "Fieldset") }),
|
|
1682
|
+
/* @__PURE__ */ jsx(
|
|
1683
|
+
"select",
|
|
1684
|
+
{
|
|
1685
|
+
className: "w-full rounded border bg-background px-2 py-2 text-sm",
|
|
1686
|
+
value: activeCustomFieldFilterFieldset ?? "",
|
|
1687
|
+
onChange: (event) => handleCustomFieldFilterFieldsetChange(event.target.value),
|
|
1688
|
+
children: (cfFilterFieldsetsByEntity[resolvedEntityIds[0]] ?? []).map((fieldset) => /* @__PURE__ */ jsx("option", { value: fieldset.code, children: fieldset.label }, fieldset.code))
|
|
1689
|
+
}
|
|
1690
|
+
)
|
|
1691
|
+
] }) : null;
|
|
1692
|
+
const leadingItems = perspectiveButton ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: perspectiveButton }) : null;
|
|
1693
|
+
const trailingItems = hasBulkButtons ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1694
|
+
selectedRows.length > 0 ? /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: t("ui.dataTable.bulkAction.selectedCount", "{count} selected", { count: selectedRows.length }) }) : null,
|
|
1695
|
+
injectedBulkActions.map((action) => {
|
|
1696
|
+
const label = t(action.label, action.label);
|
|
1697
|
+
const iconNode = resolveInjectedIcon(action.icon, "h-4 w-4 shrink-0");
|
|
1698
|
+
return /* @__PURE__ */ jsxs(
|
|
1699
|
+
Button,
|
|
1700
|
+
{
|
|
1701
|
+
type: "button",
|
|
1702
|
+
size: "sm",
|
|
1703
|
+
variant: "outline",
|
|
1704
|
+
title: label,
|
|
1705
|
+
"aria-label": label,
|
|
1706
|
+
className: iconNode ? "px-2 sm:px-3" : void 0,
|
|
1707
|
+
disabled: action.requiresSelection !== false && selectedRows.length === 0,
|
|
1708
|
+
onClick: () => void runBulkAction(action),
|
|
1709
|
+
children: [
|
|
1710
|
+
iconNode,
|
|
1711
|
+
/* @__PURE__ */ jsx("span", { className: iconNode ? "hidden sm:inline" : void 0, children: label })
|
|
1712
|
+
]
|
|
1713
|
+
},
|
|
1714
|
+
action.id
|
|
1715
|
+
);
|
|
1716
|
+
}),
|
|
1717
|
+
selectedRows.length > 0 ? (bulkActionsProp ?? []).map((action) => {
|
|
1718
|
+
const ActionIcon = action.icon;
|
|
1719
|
+
return /* @__PURE__ */ jsxs(
|
|
1720
|
+
Button,
|
|
1721
|
+
{
|
|
1722
|
+
type: "button",
|
|
1723
|
+
size: "sm",
|
|
1724
|
+
variant: action.destructive ? "destructive" : "outline",
|
|
1725
|
+
onClick: () => void runPropBulkAction(action),
|
|
1726
|
+
children: [
|
|
1727
|
+
ActionIcon ? /* @__PURE__ */ jsx(ActionIcon, { className: "h-4 w-4 shrink-0" }) : null,
|
|
1728
|
+
/* @__PURE__ */ jsx("span", { children: action.label })
|
|
1729
|
+
]
|
|
1730
|
+
},
|
|
1731
|
+
action.id
|
|
1732
|
+
);
|
|
1733
|
+
}) : null
|
|
1734
|
+
] }) : null;
|
|
1735
|
+
return /* @__PURE__ */ jsx(
|
|
1736
|
+
FilterBar,
|
|
1737
|
+
{
|
|
1738
|
+
searchValue,
|
|
1739
|
+
onSearchChange,
|
|
1740
|
+
searchPlaceholder,
|
|
1741
|
+
searchAlign,
|
|
1742
|
+
filters: combined,
|
|
1743
|
+
values: filterValues,
|
|
1744
|
+
onApply: onFiltersApply,
|
|
1745
|
+
onClear: onFiltersClear,
|
|
1746
|
+
leadingItems,
|
|
1747
|
+
trailingItems,
|
|
1748
|
+
filtersExtraContent: fieldsetSelector,
|
|
1749
|
+
layout: embedded ? "inline" : "stacked",
|
|
1750
|
+
className: embedded ? "min-h-[2.25rem]" : void 0
|
|
1751
|
+
}
|
|
1752
|
+
);
|
|
1753
|
+
}, [
|
|
1754
|
+
toolbar,
|
|
1755
|
+
searchValue,
|
|
1756
|
+
onSearchChange,
|
|
1757
|
+
searchPlaceholder,
|
|
1758
|
+
searchAlign,
|
|
1759
|
+
baseFilters,
|
|
1760
|
+
cfFilters,
|
|
1761
|
+
injectedFilters,
|
|
1762
|
+
filterValues,
|
|
1763
|
+
onFiltersApply,
|
|
1764
|
+
onFiltersClear,
|
|
1765
|
+
canUsePerspectives,
|
|
1766
|
+
embedded,
|
|
1767
|
+
supportsCustomFieldFilterFieldsets,
|
|
1768
|
+
resolvedEntityIds,
|
|
1769
|
+
activeCustomFieldFilterFieldset,
|
|
1770
|
+
handleCustomFieldFilterFieldsetChange,
|
|
1771
|
+
cfFilterFieldsetsByEntity,
|
|
1772
|
+
hasInjectedBulkActions,
|
|
1773
|
+
hasPropBulkActions,
|
|
1774
|
+
injectedBulkActions,
|
|
1775
|
+
bulkActionsProp,
|
|
1776
|
+
selectedRows.length,
|
|
1777
|
+
selectedRows,
|
|
1778
|
+
runBulkAction,
|
|
1779
|
+
runPropBulkAction
|
|
1780
|
+
]);
|
|
1781
|
+
const hasTitle = title != null;
|
|
1782
|
+
const hasActions = actions !== void 0 && actions !== null && actions !== false;
|
|
1783
|
+
const shouldReserveActionsSpace = actions === null || actions === false;
|
|
1784
|
+
const exportConfig = exporter === false ? null : exporter || null;
|
|
1785
|
+
const resolvedExportSections = React.useMemo(() => resolveExportSections(exportConfig), [exportConfig]);
|
|
1786
|
+
const hasExport = resolvedExportSections.length > 0;
|
|
1787
|
+
const refreshButtonConfig = refreshButton;
|
|
1788
|
+
const hasRefreshButton = Boolean(refreshButtonConfig);
|
|
1789
|
+
const hasToolbar = builtToolbar != null;
|
|
1790
|
+
const hasToolbarInjection = Boolean(toolbarInjectionSpotId);
|
|
1791
|
+
const shouldRenderActionsWrapper = hasActions || hasRefreshButton || shouldReserveActionsSpace || hasExport || hasToolbarInjection || Boolean(advancedFilter);
|
|
1792
|
+
const renderToolbarInline = embedded && hasToolbar;
|
|
1793
|
+
const shouldRenderToolbarBelow = hasToolbar && !renderToolbarInline;
|
|
1794
|
+
const shouldRenderHeader = hasTitle || renderToolbarInline || shouldRenderActionsWrapper || shouldRenderToolbarBelow;
|
|
1795
|
+
const containerClassName = embedded ? "" : "rounded-lg border bg-card mx-1 sm:mx-2";
|
|
1796
|
+
const headerWrapperClassName = embedded ? "pb-3" : "px-4 py-3 border-b";
|
|
1797
|
+
const headerContentClassName = "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between";
|
|
1798
|
+
const toolbarWrapperClassName = embedded ? "mt-2" : "mt-3 pt-3 border-t";
|
|
1799
|
+
const tableScrollWrapperClassName = embedded ? "" : "overflow-auto";
|
|
1800
|
+
const virtualScrollRef = React.useRef(null);
|
|
1801
|
+
const allRows = table.getRowModel().rows;
|
|
1802
|
+
const rowVirtualizer = virtualized ? useVirtualizer({
|
|
1803
|
+
count: allRows.length,
|
|
1804
|
+
getScrollElement: () => virtualScrollRef.current,
|
|
1805
|
+
estimateSize: () => 48,
|
|
1806
|
+
overscan: virtualizedOverscan
|
|
1807
|
+
}) : null;
|
|
1808
|
+
const virtualMaxHeightStyle = virtualized ? {
|
|
1809
|
+
maxHeight: typeof virtualizedMaxHeight === "number" ? `${virtualizedMaxHeight}px` : virtualizedMaxHeight ?? "calc(100vh - 300px)",
|
|
1810
|
+
overflow: "auto"
|
|
1811
|
+
} : void 0;
|
|
1812
|
+
const titleContent = hasTitle ? /* @__PURE__ */ jsx("div", { className: "text-base font-semibold leading-tight min-h-[2.25rem] flex items-center", children: typeof title === "string" ? /* @__PURE__ */ jsx("h2", { className: "text-base font-semibold", children: title }) : title }) : /* @__PURE__ */ jsx("div", { className: "min-h-[2.25rem]" });
|
|
1813
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxs("div", { ref: containerRef, className: containerClassName, "data-component-handle": resolvedReplacementHandle, children: [
|
|
1814
|
+
shouldRenderHeader && /* @__PURE__ */ jsxs("div", { className: headerWrapperClassName, children: [
|
|
1815
|
+
(hasTitle || shouldRenderActionsWrapper || renderToolbarInline) && /* @__PURE__ */ jsxs("div", { className: headerContentClassName, children: [
|
|
1816
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children: renderToolbarInline ? builtToolbar : titleContent }),
|
|
1817
|
+
shouldRenderActionsWrapper ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 min-h-[2.25rem]", children: [
|
|
1818
|
+
refreshButtonConfig ? /* @__PURE__ */ jsxs(
|
|
1819
|
+
Button,
|
|
1820
|
+
{
|
|
1821
|
+
type: "button",
|
|
1822
|
+
variant: "ghost",
|
|
1823
|
+
size: "icon",
|
|
1824
|
+
onClick: refreshButtonConfig.onRefresh,
|
|
1825
|
+
"aria-label": refreshButtonConfig.label,
|
|
1826
|
+
title: refreshButtonConfig.label,
|
|
1827
|
+
disabled: refreshButtonConfig.disabled || refreshButtonConfig.isRefreshing,
|
|
1828
|
+
children: [
|
|
1829
|
+
refreshButtonConfig.isRefreshing ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" }),
|
|
1830
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: refreshButtonConfig.label })
|
|
1831
|
+
]
|
|
1832
|
+
}
|
|
1833
|
+
) : null,
|
|
1834
|
+
advancedFilter ? /* @__PURE__ */ jsxs(
|
|
1835
|
+
Button,
|
|
1836
|
+
{
|
|
1837
|
+
type: "button",
|
|
1838
|
+
variant: advancedFilter.value.conditions.length > 0 ? "secondary" : "ghost",
|
|
1839
|
+
size: "icon",
|
|
1840
|
+
onClick: () => {
|
|
1841
|
+
const opening = !isAdvancedFilterOpen;
|
|
1842
|
+
if (opening && advancedFilter.value.conditions.length === 0) {
|
|
1843
|
+
const newCondition = createEmptyCondition();
|
|
1844
|
+
if (resolvedAdvancedFilterFields.length > 0) {
|
|
1845
|
+
newCondition.field = resolvedAdvancedFilterFields[0].key;
|
|
1846
|
+
newCondition.operator = getDefaultOperator(resolvedAdvancedFilterFields[0].type);
|
|
1847
|
+
}
|
|
1848
|
+
advancedFilter.onChange({ ...advancedFilter.value, conditions: [newCondition] });
|
|
1849
|
+
}
|
|
1850
|
+
setAdvancedFilterOpen(opening);
|
|
1851
|
+
},
|
|
1852
|
+
"aria-label": t("ui.advancedFilter.toggle", "Advanced filters"),
|
|
1853
|
+
title: t("ui.advancedFilter.toggle", "Advanced filters"),
|
|
1854
|
+
children: [
|
|
1855
|
+
/* @__PURE__ */ jsx(Filter, { className: "h-4 w-4" }),
|
|
1856
|
+
advancedFilter.value.conditions.length > 0 ? /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-[10px] text-primary-foreground", children: advancedFilter.value.conditions.length }) : null
|
|
1857
|
+
]
|
|
1858
|
+
}
|
|
1859
|
+
) : null,
|
|
1860
|
+
canUsePerspectives ? /* @__PURE__ */ jsxs(
|
|
1861
|
+
Button,
|
|
1862
|
+
{
|
|
1863
|
+
type: "button",
|
|
1864
|
+
variant: "ghost",
|
|
1865
|
+
size: "icon",
|
|
1866
|
+
onClick: () => setPerspectiveOpen(true),
|
|
1867
|
+
"aria-label": t("ui.dataTable.customizeColumns.ariaLabel", "Customize columns"),
|
|
1868
|
+
title: t("ui.dataTable.customizeColumns.title", "Customize columns"),
|
|
1869
|
+
children: [
|
|
1870
|
+
/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }),
|
|
1871
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: t("ui.dataTable.customizeColumns.srOnly", "Customize columns") })
|
|
1872
|
+
]
|
|
1873
|
+
}
|
|
1874
|
+
) : null,
|
|
1875
|
+
exportConfig && hasExport ? /* @__PURE__ */ jsx(ExportMenu, { config: exportConfig, sections: resolvedExportSections }) : null,
|
|
1876
|
+
toolbarInjectionSpotId ? /* @__PURE__ */ jsx(InjectionSpot, { spotId: toolbarInjectionSpotId, context: resolvedInjectionContext }) : null,
|
|
1877
|
+
hasActions ? actions : null
|
|
1878
|
+
] }) : null
|
|
1879
|
+
] }),
|
|
1880
|
+
shouldRenderToolbarBelow ? /* @__PURE__ */ jsx("div", { className: toolbarWrapperClassName, children: builtToolbar }) : null,
|
|
1881
|
+
headerInjectionSpotId ? /* @__PURE__ */ jsx("div", { className: embedded ? "mt-2" : "mt-3", children: /* @__PURE__ */ jsx(InjectionSpot, { spotId: headerInjectionSpotId, context: resolvedInjectionContext }) }) : null
|
|
1882
|
+
] }),
|
|
1883
|
+
advancedFilter && isAdvancedFilterOpen ? /* @__PURE__ */ jsx("div", { className: "border-b", children: /* @__PURE__ */ jsx(
|
|
1884
|
+
AdvancedFilterBuilder,
|
|
1885
|
+
{
|
|
1886
|
+
fields: resolvedAdvancedFilterFields,
|
|
1887
|
+
value: advancedFilter.value,
|
|
1888
|
+
onChange: advancedFilter.onChange,
|
|
1889
|
+
onApply: () => {
|
|
1890
|
+
advancedFilter.onApply();
|
|
1891
|
+
setAdvancedFilterOpen(false);
|
|
1892
|
+
},
|
|
1893
|
+
onClear: () => {
|
|
1894
|
+
advancedFilter.onClear();
|
|
1895
|
+
setAdvancedFilterOpen(false);
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
) }) : null,
|
|
1899
|
+
advancedFilter && advancedFilter.value.conditions.length > 0 && !isAdvancedFilterOpen ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap px-4 py-2 border-b text-sm", children: [
|
|
1900
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: t("ui.advancedFilter.activeCount", "{count} active filters", { count: advancedFilter.value.conditions.length }) }),
|
|
1901
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "sm", className: "h-auto px-1 py-0.5 text-xs", onClick: () => setAdvancedFilterOpen(true), children: t("ui.advancedFilter.edit", "Edit") }),
|
|
1902
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "sm", className: "h-auto px-1 py-0.5 text-xs text-muted-foreground", onClick: advancedFilter.onClear, children: t("ui.advancedFilter.clearAll", "Clear all") })
|
|
1903
|
+
] }) : null,
|
|
1904
|
+
/* @__PURE__ */ jsx(
|
|
1905
|
+
HeaderDndWrapper,
|
|
1906
|
+
{
|
|
1907
|
+
enabled: enableHeaderDnd,
|
|
1908
|
+
contextId: `${stableDndContextId}-headers`,
|
|
1909
|
+
sensors: dndSensors,
|
|
1910
|
+
columnIds: headerColumnIds,
|
|
1911
|
+
onDragEnd: handleHeaderDragEnd,
|
|
1912
|
+
children: /* @__PURE__ */ jsx("div", { ref: virtualized ? virtualScrollRef : void 0, className: tableScrollWrapperClassName, style: virtualMaxHeightStyle, children: /* @__PURE__ */ jsxs(Table, { className: "min-w-[640px] md:min-w-0", children: [
|
|
1913
|
+
/* @__PURE__ */ jsx(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
1914
|
+
hasInjectedBulkActions ? /* @__PURE__ */ jsx(TableHead, { className: "w-8", children: /* @__PURE__ */ jsx(
|
|
1915
|
+
Checkbox,
|
|
1916
|
+
{
|
|
1917
|
+
checked: table.getIsAllPageRowsSelected(),
|
|
1918
|
+
onCheckedChange: (checked) => {
|
|
1919
|
+
table.toggleAllPageRowsSelected(Boolean(checked));
|
|
1920
|
+
},
|
|
1921
|
+
"aria-label": t("ui.dataTable.bulkAction.selectAll", "Select all rows")
|
|
1922
|
+
}
|
|
1923
|
+
) }) : null,
|
|
1924
|
+
hg.headers.map((header, headerIndex) => {
|
|
1925
|
+
const columnMeta = header.column.columnDef?.meta;
|
|
1926
|
+
const priority = resolvePriority(header.column);
|
|
1927
|
+
const isFirstDataColumn = headerIndex === 0;
|
|
1928
|
+
const stickyClass = stickyFirstColumn && isFirstDataColumn ? " sticky left-0 z-10 bg-background" : "";
|
|
1929
|
+
const headerCellContent = header.isPlaceholder ? null : /* @__PURE__ */ jsxs(
|
|
1930
|
+
Button,
|
|
1931
|
+
{
|
|
1932
|
+
variant: "ghost",
|
|
1933
|
+
type: "button",
|
|
1934
|
+
className: `h-auto p-0 font-medium ${sortable && header.column.getCanSort?.() ? "cursor-pointer select-none" : ""}`,
|
|
1935
|
+
onClick: () => sortable && header.column.toggleSorting?.(header.column.getIsSorted() === "asc"),
|
|
1936
|
+
children: [
|
|
1937
|
+
flexRender(header.column.columnDef.header, header.getContext()),
|
|
1938
|
+
sortable && header.column.getCanSort?.() ? /* @__PURE__ */ jsxs("span", { className: "ml-1 inline-flex flex-col text-[10px] leading-none gap-px", children: [
|
|
1939
|
+
/* @__PURE__ */ jsx("span", { className: header.column.getIsSorted() === "asc" ? "text-foreground" : "text-muted-foreground/40", children: "\u25B2" }),
|
|
1940
|
+
/* @__PURE__ */ jsx("span", { className: header.column.getIsSorted() === "desc" ? "text-foreground" : "text-muted-foreground/40", children: "\u25BC" })
|
|
1941
|
+
] }) : null
|
|
1942
|
+
]
|
|
1943
|
+
}
|
|
1944
|
+
);
|
|
1945
|
+
return enableHeaderDnd ? /* @__PURE__ */ jsx(SortableHeaderCell, { id: header.id, className: responsiveClass(priority, columnMeta?.hidden) + stickyClass, children: headerCellContent }, header.id) : /* @__PURE__ */ jsx(TableHead, { className: responsiveClass(priority, columnMeta?.hidden) + stickyClass, children: headerCellContent }, header.id);
|
|
1946
|
+
}),
|
|
1947
|
+
rowActions || injectedRowActions.length > 0 ? /* @__PURE__ */ jsx(
|
|
1948
|
+
TableHead,
|
|
1949
|
+
{
|
|
1950
|
+
className: cn(
|
|
1951
|
+
"w-0 text-right",
|
|
1952
|
+
stickyActionsColumn && "sticky right-0 z-20 bg-background"
|
|
1953
|
+
),
|
|
1954
|
+
children: t("ui.dataTable.actionsColumn", "Actions")
|
|
1955
|
+
}
|
|
1956
|
+
) : null
|
|
1957
|
+
] }, hg.id)) }),
|
|
1958
|
+
/* @__PURE__ */ jsx(TableBody, { children: isLoading ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: mergedColumns.length + (rowActions || injectedRowActions.length > 0 ? 1 : 0) + (hasInjectedBulkActions ? 1 : 0), className: "h-24 text-center", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2", children: [
|
|
1959
|
+
/* @__PURE__ */ jsx(Spinner, { size: "md" }),
|
|
1960
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: t("ui.dataTable.loading", "Loading data...") })
|
|
1961
|
+
] }) }) }) : error ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: mergedColumns.length + (rowActions || injectedRowActions.length > 0 ? 1 : 0) + (hasInjectedBulkActions ? 1 : 0), className: "h-24 text-center text-destructive", children: error }) }) : allRows.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1962
|
+
virtualized && rowVirtualizer ? /* @__PURE__ */ jsx(Fragment, { children: rowVirtualizer.getVirtualItems()[0]?.start > 0 ? /* @__PURE__ */ jsx("tr", { style: { height: `${rowVirtualizer.getVirtualItems()[0].start}px` } }) : null }) : null,
|
|
1963
|
+
(virtualized && rowVirtualizer ? rowVirtualizer.getVirtualItems().map((vi) => allRows[vi.index]) : allRows).map((row) => {
|
|
1964
|
+
const rowActionsElement = resolvedRowActions(row.original);
|
|
1965
|
+
const defaultRowAction = onRowClick ? null : pickDefaultRowAction(rowActionsElement, resolvedRowClickActionIds);
|
|
1966
|
+
const isClickable = !disableRowClick && (onRowClick || defaultRowAction);
|
|
1967
|
+
return /* @__PURE__ */ jsxs(
|
|
1968
|
+
TableRow,
|
|
1969
|
+
{
|
|
1970
|
+
"data-state": row.getIsSelected() && "selected",
|
|
1971
|
+
className: isClickable ? "cursor-pointer hover:bg-muted/50 transition-colors" : "",
|
|
1972
|
+
onClick: isClickable ? (e) => {
|
|
1973
|
+
if (e.target.closest("[data-actions-cell]")) {
|
|
1974
|
+
return;
|
|
1975
|
+
}
|
|
1976
|
+
if (onRowClick) {
|
|
1977
|
+
onRowClick(row.original);
|
|
1978
|
+
} else if (defaultRowAction) {
|
|
1979
|
+
if (defaultRowAction.href) {
|
|
1980
|
+
router.push(defaultRowAction.href);
|
|
1981
|
+
} else if (defaultRowAction.onSelect) {
|
|
1982
|
+
defaultRowAction.onSelect();
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
} : void 0,
|
|
1986
|
+
children: [
|
|
1987
|
+
hasInjectedBulkActions ? /* @__PURE__ */ jsx(TableCell, { className: "w-8", children: /* @__PURE__ */ jsx(
|
|
1988
|
+
Checkbox,
|
|
1989
|
+
{
|
|
1990
|
+
checked: row.getIsSelected(),
|
|
1991
|
+
onCheckedChange: (checked) => row.toggleSelected(Boolean(checked)),
|
|
1992
|
+
"aria-label": t("ui.dataTable.bulkAction.selectRow", "Select row"),
|
|
1993
|
+
onClick: (event) => event.stopPropagation()
|
|
1994
|
+
}
|
|
1995
|
+
) }) : null,
|
|
1996
|
+
row.getVisibleCells().map((cell, cellIndex) => {
|
|
1997
|
+
const columnMeta = cell.column.columnDef?.meta;
|
|
1998
|
+
const priority = resolvePriority(cell.column);
|
|
1999
|
+
const isStickyCell = stickyFirstColumn && cellIndex === 0;
|
|
2000
|
+
const hasCustomCell = Boolean(cell.column.columnDef.cell);
|
|
2001
|
+
const columnId = String(cell.column.id || "");
|
|
2002
|
+
const accessorKey = String(cell.column.columnDef?.accessorKey || "");
|
|
2003
|
+
const isDateCol = dateColumnIds ? dateColumnIds.has(columnId) : false;
|
|
2004
|
+
let content;
|
|
2005
|
+
if (isDateCol) {
|
|
2006
|
+
const raw = cell.getValue();
|
|
2007
|
+
const d = tryParseDate(raw);
|
|
2008
|
+
content = d ? simpleFormat(d, DATE_FORMAT) : raw;
|
|
2009
|
+
} else {
|
|
2010
|
+
content = flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
2011
|
+
}
|
|
2012
|
+
const skipTruncation = shouldSkipTruncation(columnId);
|
|
2013
|
+
const truncateConfig = getColumnTruncateConfig(columnId, accessorKey, columnMeta);
|
|
2014
|
+
const shouldTruncate = truncateConfig.truncate && !skipTruncation;
|
|
2015
|
+
const maxWidth = truncateConfig.maxWidth;
|
|
2016
|
+
const cellValue = cell.getValue();
|
|
2017
|
+
const metaTooltipContent = columnMeta?.tooltipContent;
|
|
2018
|
+
let tooltipText;
|
|
2019
|
+
if (metaTooltipContent) {
|
|
2020
|
+
tooltipText = metaTooltipContent(row.original);
|
|
2021
|
+
} else if (isDateCol && cellValue != null) {
|
|
2022
|
+
const parsedDate = tryParseDate(cellValue);
|
|
2023
|
+
tooltipText = parsedDate ? simpleFormat(parsedDate, DATE_FORMAT) : String(cellValue);
|
|
2024
|
+
} else {
|
|
2025
|
+
tooltipText = cellValue != null ? String(cellValue) : void 0;
|
|
2026
|
+
}
|
|
2027
|
+
const wrappedContent = shouldTruncate ? /* @__PURE__ */ jsx(TruncatedCell, { maxWidth, tooltipContent: tooltipText, children: content }) : content;
|
|
2028
|
+
return /* @__PURE__ */ jsx(TableCell, { className: responsiveClass(priority, columnMeta?.hidden) + (isStickyCell ? " sticky left-0 z-10 bg-background" : ""), children: wrappedContent }, cell.id);
|
|
2029
|
+
}),
|
|
2030
|
+
rowActions || injectedRowActions.length > 0 ? /* @__PURE__ */ jsx(
|
|
2031
|
+
TableCell,
|
|
2032
|
+
{
|
|
2033
|
+
className: cn(
|
|
2034
|
+
"text-right whitespace-nowrap",
|
|
2035
|
+
stickyActionsColumn && "sticky right-0 z-10 bg-background"
|
|
2036
|
+
),
|
|
2037
|
+
"data-actions-cell": true,
|
|
2038
|
+
children: rowActionsElement
|
|
2039
|
+
}
|
|
2040
|
+
) : null
|
|
2041
|
+
]
|
|
2042
|
+
},
|
|
2043
|
+
row.id
|
|
2044
|
+
);
|
|
2045
|
+
}),
|
|
2046
|
+
virtualized && rowVirtualizer ? (() => {
|
|
2047
|
+
const virtualItems = rowVirtualizer.getVirtualItems();
|
|
2048
|
+
const lastItem = virtualItems[virtualItems.length - 1];
|
|
2049
|
+
const bottomPadding = lastItem ? rowVirtualizer.getTotalSize() - lastItem.end : 0;
|
|
2050
|
+
return bottomPadding > 0 ? /* @__PURE__ */ jsx("tr", { style: { height: `${bottomPadding}px` } }) : null;
|
|
2051
|
+
})() : null
|
|
2052
|
+
] }) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: mergedColumns.length + (rowActions || injectedRowActions.length > 0 ? 1 : 0) + (hasInjectedBulkActions ? 1 : 0), className: "h-24 text-center text-muted-foreground", children: emptyState ?? t("ui.dataTable.emptyState.default", "No results.") }) }) })
|
|
2053
|
+
] }) })
|
|
2054
|
+
}
|
|
2055
|
+
),
|
|
2056
|
+
footerInjectionSpotId ? /* @__PURE__ */ jsx("div", { className: embedded ? "mt-3" : "px-4 py-3 border-t", children: /* @__PURE__ */ jsx(InjectionSpot, { spotId: footerInjectionSpotId, context: resolvedInjectionContext }) }) : null,
|
|
2057
|
+
paginationNode,
|
|
2058
|
+
ConfirmDialogElement,
|
|
2059
|
+
canUsePerspectives ? /* @__PURE__ */ jsx(
|
|
2060
|
+
PerspectiveSidebar,
|
|
2061
|
+
{
|
|
2062
|
+
open: isPerspectiveOpen,
|
|
2063
|
+
onOpenChange: setPerspectiveOpen,
|
|
2064
|
+
loading: perspectiveQuery.isFetching && !perspectiveQuery.data,
|
|
2065
|
+
perspectives: perspectiveData?.perspectives ?? [],
|
|
2066
|
+
rolePerspectives: perspectiveData?.rolePerspectives ?? [],
|
|
2067
|
+
roles: perspectiveData?.roles ?? [],
|
|
2068
|
+
activePerspectiveId,
|
|
2069
|
+
onActivatePerspective: handlePerspectiveActivate,
|
|
2070
|
+
onDeletePerspective: handlePerspectiveDelete,
|
|
2071
|
+
onClearRole: handleClearRole,
|
|
2072
|
+
onSave: handlePerspectiveSave,
|
|
2073
|
+
canApplyToRoles: Boolean(perspectiveData?.canApplyToRoles && canUseRoleDefaultsFeature),
|
|
2074
|
+
availableColumns: effectiveColumnChooserFields,
|
|
2075
|
+
visibleColumnKeys,
|
|
2076
|
+
columnOrder,
|
|
2077
|
+
onToggleColumn: handleColumnChooserToggle,
|
|
2078
|
+
onReorderColumns: handleColumnChooserReorder,
|
|
2079
|
+
saving: savePerspectiveMutation.isPending,
|
|
2080
|
+
deletingIds,
|
|
2081
|
+
roleClearingIds,
|
|
2082
|
+
apiWarning: perspectiveApiWarning
|
|
2083
|
+
}
|
|
2084
|
+
) : null
|
|
2085
|
+
] }) });
|
|
2086
|
+
}
|
|
2087
|
+
export {
|
|
2088
|
+
DataTable,
|
|
2089
|
+
withDataTableNamespaces
|
|
2090
|
+
};
|
|
2091
|
+
//# sourceMappingURL=DataTable.js.map
|