@jmruthers/pace-core 0.5.135 → 0.5.137
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DataTable-A36PJG6N.js → DataTable-6M4L6BI2.js} +26 -13
- package/dist/{DataTable-C7GaRZye.d.ts → DataTable-CWAZZcXC.d.ts} +1 -1
- package/dist/{PublicLoadingSpinner-CUAnTvcg.d.ts → EventLogo-rFL_kRjk.d.ts} +123 -135
- package/dist/{UnifiedAuthProvider-BVKmQd9u.d.ts → UnifiedAuthProvider-DJxGTftH.d.ts} +1 -1
- package/dist/{UnifiedAuthProvider-CQDZRJIS.js → UnifiedAuthProvider-XIQQ7LVU.js} +5 -5
- package/dist/{api-TNIBJWLM.js → api-45XYYO2A.js} +4 -3
- package/dist/{audit-T36HM7IM.js → audit-64X3VJXB.js} +3 -2
- package/dist/{chunk-F64FFPOZ.js → chunk-22WKWKRX.js} +26 -20
- package/dist/chunk-22WKWKRX.js.map +1 -0
- package/dist/{chunk-VZ5OR6HD.js → chunk-4C7EXCAR.js} +62 -150
- package/dist/chunk-4C7EXCAR.js.map +1 -0
- package/dist/{chunk-PYUXFQJ3.js → chunk-56XJ3TU6.js} +2 -2
- package/dist/chunk-56XJ3TU6.js.map +1 -0
- package/dist/{chunk-CTJRBUX2.js → chunk-6LAAY47Q.js} +2 -2
- package/dist/{chunk-UJI6WSMD.js → chunk-7QCC6MCP.js} +90 -3
- package/dist/chunk-7QCC6MCP.js.map +1 -0
- package/dist/{chunk-66C4BSAY.js → chunk-ANBQRTPX.js} +9 -2
- package/dist/chunk-ANBQRTPX.js.map +1 -0
- package/dist/{chunk-CQZU6TFE.js → chunk-BCIBECNB.js} +100 -62
- package/dist/chunk-BCIBECNB.js.map +1 -0
- package/dist/{chunk-GKHF54DI.js → chunk-BESYRHQM.js} +10 -4
- package/dist/chunk-BESYRHQM.js.map +1 -0
- package/dist/chunk-BJPBT3CU.js +21 -0
- package/dist/chunk-BJPBT3CU.js.map +1 -0
- package/dist/{chunk-BYXRHAIF.js → chunk-BLCXZEYF.js} +23 -14
- package/dist/chunk-BLCXZEYF.js.map +1 -0
- package/dist/{chunk-WP5I5GLN.js → chunk-BVYWGZVV.js} +112 -97
- package/dist/chunk-BVYWGZVV.js.map +1 -0
- package/dist/{chunk-GEVIB2UB.js → chunk-ERISIBYU.js} +14 -5
- package/dist/chunk-ERISIBYU.js.map +1 -0
- package/dist/{chunk-O3NWNXDY.js → chunk-FMUCXFII.js} +2 -2
- package/dist/chunk-FMUCXFII.js.map +1 -0
- package/dist/{chunk-GVDR7WNV.js → chunk-HAWZXGR2.js} +334 -614
- package/dist/chunk-HAWZXGR2.js.map +1 -0
- package/dist/{chunk-ZV77RZMU.js → chunk-INQLMHPF.js} +2 -2
- package/dist/chunk-JISYG63F.js +70 -0
- package/dist/chunk-JISYG63F.js.map +1 -0
- package/dist/{chunk-HMNOSGVA.js → chunk-KYRHUBIU.js} +576 -767
- package/dist/chunk-KYRHUBIU.js.map +1 -0
- package/dist/{chunk-M6DDYFUD.js → chunk-LS353YLY.js} +19 -16
- package/dist/chunk-LS353YLY.js.map +1 -0
- package/dist/{chunk-TGIY2AR2.js → chunk-MA6EPSGZ.js} +4 -3
- package/dist/{chunk-TGIY2AR2.js.map → chunk-MA6EPSGZ.js.map} +1 -1
- package/dist/chunk-OWAG3GSU.js +58 -0
- package/dist/chunk-OWAG3GSU.js.map +1 -0
- package/dist/{chunk-JCQZ6LA7.js → chunk-Q5QRDWKI.js} +9 -3
- package/dist/chunk-Q5QRDWKI.js.map +1 -0
- package/dist/chunk-S5OFRT4M.js +94 -0
- package/dist/chunk-S5OFRT4M.js.map +1 -0
- package/dist/{chunk-3DBFLLLU.js → chunk-SBVILCCA.js} +14 -9
- package/dist/chunk-SBVILCCA.js.map +1 -0
- package/dist/{chunk-ZYZCRSBD.js → chunk-T6JN6LH6.js} +16 -11
- package/dist/chunk-T6JN6LH6.js.map +1 -0
- package/dist/chunk-XDNLUEXI.js +138 -0
- package/dist/chunk-XDNLUEXI.js.map +1 -0
- package/dist/{chunk-3CG5L6RN.js → chunk-YCWDTTUK.js} +90 -75
- package/dist/chunk-YCWDTTUK.js.map +1 -0
- package/dist/{chunk-5F3NDPJV.js → chunk-ZZ2SS7NI.js} +10 -5
- package/dist/chunk-ZZ2SS7NI.js.map +1 -0
- package/dist/components.d.ts +7 -287
- package/dist/components.js +27 -157
- package/dist/components.js.map +1 -1
- package/dist/{file-reference-C9isKNPn.d.ts → file-reference-C6Gkn77H.d.ts} +1 -1
- package/dist/{formatting-DFcCxUEk.d.ts → formatting-CvUXy2mF.d.ts} +1 -1
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.js +21 -16
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +101 -9
- package/dist/index.js +44 -31
- package/dist/index.js.map +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +4 -4
- package/dist/rbac/index.js +12 -12
- package/dist/schema-DTDZQe2u.d.ts +28 -0
- package/dist/styles/index.js +2 -1
- package/dist/theming/runtime.d.ts +2 -19
- package/dist/theming/runtime.js +2 -1
- package/dist/{types-D5rqZQXk.d.ts → types-Dfz9dmVH.d.ts} +12 -1
- package/dist/types.d.ts +153 -4
- package/dist/types.js +51 -16
- package/dist/types.js.map +1 -1
- package/dist/{useInactivityTracker-MRUU55XI.js → useInactivityTracker-TO6ZOF35.js} +3 -2
- package/dist/{usePublicRouteParams-Dyt1tzI9.d.ts → usePublicRouteParams-B7PabvuH.d.ts} +1 -1
- package/dist/utils.d.ts +221 -173
- package/dist/utils.js +185 -225
- package/dist/utils.js.map +1 -1
- package/dist/validation.d.ts +24 -115
- package/dist/validation.js +19 -474
- package/dist/validation.js.map +1 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +6 -6
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +6 -6
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +7 -7
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +4 -4
- package/docs/api/interfaces/BadgeProps.md +27 -0
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +29 -4
- package/docs/api/interfaces/DataAccessRecord.md +9 -9
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +18 -18
- package/docs/api/interfaces/DataTableColumn.md +61 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
- package/docs/api/interfaces/EmptyStateConfig.md +5 -5
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +14 -14
- package/docs/api/interfaces/EventAppRoleData.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +152 -0
- package/docs/api/interfaces/ExportColumn.md +1 -1
- package/docs/api/interfaces/ExportOptions.md +8 -8
- package/docs/api/interfaces/FileDisplayProps.md +15 -15
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +10 -10
- package/docs/api/interfaces/NavigationContextType.md +9 -9
- package/docs/api/interfaces/NavigationGuardProps.md +10 -10
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +7 -7
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +27 -27
- package/docs/api/interfaces/PaceLoginPageProps.md +4 -4
- package/docs/api/interfaces/PageAccessRecord.md +8 -8
- package/docs/api/interfaces/PagePermissionContextType.md +8 -8
- package/docs/api/interfaces/PagePermissionGuardProps.md +11 -11
- package/docs/api/interfaces/PagePermissionProviderProps.md +7 -7
- package/docs/api/interfaces/PaletteData.md +4 -4
- package/docs/api/interfaces/PermissionEnforcerProps.md +11 -11
- package/docs/api/interfaces/ProtectedRouteProps.md +6 -6
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +8 -8
- package/docs/api/interfaces/RoleBasedRouterProps.md +10 -10
- package/docs/api/interfaces/RoleManagementResult.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +10 -10
- package/docs/api/interfaces/RouteConfig.md +10 -10
- package/docs/api/interfaces/SecureDataContextType.md +9 -9
- package/docs/api/interfaces/SecureDataProviderProps.md +8 -8
- package/docs/api/interfaces/SessionRestorationLoaderProps.md +21 -0
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +53 -53
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +13 -13
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +9 -9
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +8 -8
- package/docs/api/interfaces/UsePublicEventOptions.md +3 -3
- package/docs/api/interfaces/UsePublicEventReturn.md +5 -5
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +4 -4
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +9 -9
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +4 -4
- package/docs/api/interfaces/UseResolvedScopeReturn.md +4 -4
- package/docs/api/interfaces/UserEventAccess.md +11 -11
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +591 -220
- package/docs/api-reference/components.md +106 -26
- package/docs/architecture/README.md +0 -3
- package/docs/implementation-guides/data-tables.md +277 -13
- package/docs/implementation-guides/forms.md +1 -16
- package/docs/implementation-guides/permission-enforcement.md +8 -2
- package/docs/styles/README.md +0 -2
- package/examples/README.md +30 -14
- package/examples/STRUCTURE.md +125 -0
- package/examples/components 2/DataTable/HierarchicalActionsExample.tsx +421 -0
- package/examples/components 2/DataTable/HierarchicalExample.tsx +475 -0
- package/examples/components 2/DataTable/InitialPageSizeExample.tsx +177 -0
- package/examples/components 2/DataTable/PerformanceExample.tsx +506 -0
- package/examples/components 2/DataTable/index.ts +13 -0
- package/examples/components 2/Dialog/BasicHtmlTest.tsx +55 -0
- package/examples/components 2/Dialog/DebugHtmlExample.tsx +68 -0
- package/examples/components 2/Dialog/HtmlDialogExample.tsx +202 -0
- package/examples/components 2/Dialog/ScrollableDialogExample.tsx +290 -0
- package/examples/components 2/Dialog/SimpleHtmlTest.tsx +61 -0
- package/examples/components 2/Dialog/SmartDialogExample.tsx +322 -0
- package/examples/components 2/Dialog/index.ts +15 -0
- package/examples/components 2/index.ts +11 -0
- package/examples/features/index.ts +12 -0
- package/{src/examples → examples/features/public-pages}/CorrectPublicPageImplementation.tsx +14 -17
- package/{src/examples → examples/features/public-pages}/PublicEventPage.tsx +14 -27
- package/{src/examples → examples/features/public-pages}/PublicPageApp.tsx +15 -28
- package/{src/examples → examples/features/public-pages}/PublicPageUsageExample.tsx +8 -10
- package/examples/features/public-pages/index.ts +14 -0
- package/examples/features/rbac/CompleteRBACExample.tsx +324 -0
- package/examples/features/rbac/EventBasedApp.tsx +239 -0
- package/examples/features/rbac/PermissionExample.tsx +151 -0
- package/examples/features/rbac/index.ts +13 -0
- package/examples/index.ts +11 -3
- package/package.json +30 -19
- package/src/__tests__/TEST_STANDARD.md +92 -0
- package/src/components/Alert/Alert.tsx +1 -1
- package/src/components/Avatar/Avatar.tsx +1 -1
- package/src/components/Badge/Badge.test.tsx +314 -0
- package/src/components/Badge/Badge.tsx +304 -0
- package/src/components/Badge/index.ts +3 -0
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/Checkbox/Checkbox.tsx +1 -1
- package/src/components/DataTable/DataTable.test.tsx +1 -1
- package/src/components/DataTable/DataTable.tsx +1 -30
- package/src/components/DataTable/__tests__/DataTable.grouping-aggregation.test.tsx +562 -0
- package/src/components/DataTable/__tests__/DataTableCore.test-setup.ts +217 -0
- package/src/components/DataTable/__tests__/styles.test.ts +3 -3
- package/src/components/DataTable/components/ActionButtons.tsx +0 -15
- package/src/components/DataTable/components/ColumnFilter.tsx +8 -4
- package/src/components/DataTable/components/DataTableBody.tsx +461 -0
- package/src/components/DataTable/components/DataTableCore.tsx +4 -185
- package/src/components/DataTable/components/DataTableErrorBoundary.tsx +1 -1
- package/src/components/DataTable/components/DataTableModals.tsx +1 -27
- package/src/components/DataTable/components/DraggableColumnHeader.tsx +144 -0
- package/src/components/DataTable/components/EditableRow.tsx +1 -1
- package/src/components/DataTable/components/FilterRow.tsx +9 -3
- package/src/components/DataTable/components/ImportModal.tsx +2 -14
- package/src/components/DataTable/components/PaginationControls.tsx +2 -1
- package/src/components/DataTable/components/UnifiedTableBody.tsx +109 -82
- package/src/components/DataTable/components/VirtualizedDataTable.tsx +513 -0
- package/src/components/DataTable/components/__tests__/AccessDeniedPage.test.tsx +14 -68
- package/src/components/DataTable/components/__tests__/ActionButtons.test.tsx +1 -1
- package/src/components/DataTable/components/__tests__/ColumnFilter.test.tsx +62 -0
- package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.test.tsx +1 -1
- package/src/components/DataTable/components/__tests__/DataTableModals.test.tsx +1 -1
- package/src/components/DataTable/components/__tests__/FilterRow.test.tsx +43 -0
- package/src/components/DataTable/components/__tests__/ImportModal.test.tsx +1 -1
- package/src/components/DataTable/core/ActionManager.ts +235 -0
- package/src/components/DataTable/core/ColumnManager.ts +205 -0
- package/src/components/DataTable/core/DataManager.ts +188 -0
- package/src/components/DataTable/core/DataTableContext.tsx +181 -0
- package/src/components/DataTable/core/LocalDataAdapter.ts +273 -0
- package/src/components/DataTable/core/PluginRegistry.ts +229 -0
- package/src/components/DataTable/core/StateManager.ts +311 -0
- package/src/components/DataTable/core/interfaces.ts +338 -0
- package/src/components/DataTable/examples/GroupingAggregationExample.tsx +273 -0
- package/src/components/DataTable/examples/HierarchicalActionsExample.tsx +1 -1
- package/src/components/DataTable/examples/__tests__/HierarchicalActionsExample.test.tsx +1 -1
- package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +1 -1
- package/src/components/DataTable/hooks/useColumnVisibilityPersistence.ts +1 -1
- package/src/components/DataTable/hooks/useDataTablePermissions.ts +2 -23
- package/src/components/DataTable/index.ts +4 -0
- package/src/components/DataTable/styles.ts +28 -7
- package/src/components/DataTable/types.ts +13 -0
- package/src/components/DataTable/utils/__tests__/columnUtils.test.ts +94 -0
- package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +1 -1
- package/src/components/DataTable/utils/aggregationUtils.ts +161 -0
- package/src/components/DataTable/utils/columnUtils.ts +40 -0
- package/src/components/DataTable/utils/debugTools.ts +609 -0
- package/src/components/DataTable/utils/exportUtils.ts +1 -1
- package/src/components/DataTable/utils/flexibleImport.ts +1 -11
- package/src/components/DataTable/utils/index.ts +2 -0
- package/src/components/DataTable/utils/paginationUtils.ts +1 -1
- package/src/components/Dialog/Dialog.tsx +2 -2
- package/src/components/Dialog/utils/__tests__/safeHtml.unit.test.ts +8 -1
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +35 -7
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +5 -4
- package/src/components/EventSelector/EventSelector.tsx +3 -2
- package/src/components/FileDisplay/FileDisplay.tsx +2 -36
- package/src/components/FileUpload/FileUpload.test.tsx +2 -2
- package/src/components/FileUpload/FileUpload.tsx +2 -2
- package/src/components/Footer/Footer.test.tsx +1 -1
- package/src/components/Footer/Footer.tsx +1 -1
- package/src/components/Form/Form.test.tsx +5 -510
- package/src/components/Form/Form.tsx +1 -1
- package/src/components/Form/FormField.tsx +1 -1
- package/src/components/Form/index.ts +0 -12
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Input/Input.tsx +1 -1
- package/src/components/Label/Label.tsx +1 -1
- package/src/components/LoginForm/LoginForm.test.tsx +1 -1
- package/src/components/LoginForm/LoginForm.tsx +1 -1
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +19 -3
- package/src/components/NavigationMenu/NavigationMenu.tsx +9 -8
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +4 -3
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +14 -12
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.integration.test.tsx +0 -16
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.performance.test.tsx +76 -10
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +0 -1
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.unit.test.tsx +0 -9
- package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +35 -3
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +14 -13
- package/src/components/PasswordReset/PasswordChangeForm.tsx +1 -1
- package/src/components/PasswordReset/index.ts +0 -2
- package/src/components/Progress/Progress.tsx +1 -1
- package/src/components/ProtectedRoute/ProtectedRoute.test.tsx +35 -8
- package/src/components/ProtectedRoute/ProtectedRoute.tsx +3 -2
- package/src/components/PublicLayout/PublicErrorBoundary.tsx +1 -1
- package/src/components/PublicLayout/PublicLoadingSpinner.tsx +1 -1
- package/src/components/PublicLayout/PublicPageContextChecker.tsx +44 -43
- package/src/components/PublicLayout/PublicPageFooter.tsx +1 -1
- package/src/components/PublicLayout/PublicPageHeader.tsx +1 -15
- package/src/components/PublicLayout/PublicPageProvider.tsx +3 -2
- package/src/components/PublicLayout/__tests__/PublicPageContextChecker.test.tsx +2 -0
- package/src/components/PublicLayout/__tests__/PublicPageFooter.test.tsx +1 -1
- package/src/components/PublicLayout/index.ts +4 -2
- package/src/components/Select/Select.test.tsx +1 -1
- package/src/components/Select/Select.tsx +21 -9
- package/src/components/{SessionRestorationLoader.tsx → SessionRestorationLoader/SessionRestorationLoader.tsx} +3 -2
- package/src/components/SessionRestorationLoader/index.ts +3 -0
- package/src/components/Switch/Switch.tsx +1 -1
- package/src/components/Table/Table.tsx +1 -1
- package/src/components/Table/__tests__/Table.test.tsx +1 -1
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/index.ts +7 -10
- package/src/hooks/__tests__/hooks.integration.test.tsx +37 -22
- package/src/hooks/__tests__/useComponentPerformance.unit.test.tsx +33 -17
- package/src/hooks/__tests__/useDataTablePerformance.unit.test.ts +28 -3
- package/src/hooks/__tests__/useFileDisplay.unit.test.ts +36 -9
- package/src/hooks/__tests__/useFileUrl.unit.test.ts +83 -85
- package/src/hooks/__tests__/useInactivityTracker.unit.test.ts +26 -2
- package/src/hooks/__tests__/usePerformanceMonitor.unit.test.ts +19 -6
- package/src/hooks/__tests__/usePermissionCache.simple.test.ts +17 -4
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +17 -4
- package/src/hooks/__tests__/usePublicEvent.simple.test.ts +26 -6
- package/src/hooks/__tests__/usePublicFileDisplay.test.ts +16 -6
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +3 -3
- package/src/hooks/__tests__/useSessionRestoration.unit.test.tsx +17 -3
- package/src/hooks/public/usePublicEvent.ts +7 -6
- package/src/hooks/public/usePublicEventLogo.ts +7 -4
- package/src/hooks/public/usePublicFileDisplay.ts +6 -150
- package/src/hooks/useComponentPerformance.ts +4 -1
- package/src/hooks/useDataTablePerformance.ts +4 -3
- package/src/hooks/useEventTheme.test.ts +18 -5
- package/src/hooks/useEventTheme.ts +4 -1
- package/src/hooks/useEvents.ts +2 -0
- package/src/hooks/useFileDisplay.ts +9 -8
- package/src/hooks/useFileReference.ts +4 -1
- package/src/hooks/useFileUrl.ts +4 -1
- package/src/hooks/useInactivityTracker.ts +5 -4
- package/src/hooks/useOrganisationSecurity.test.ts +33 -12
- package/src/hooks/useOrganisationSecurity.ts +8 -7
- package/src/hooks/usePerformanceMonitor.ts +6 -3
- package/src/hooks/usePermissionCache.ts +13 -6
- package/src/hooks/useSecureDataAccess.test.ts +2 -2
- package/src/hooks/useSecureDataAccess.ts +9 -8
- package/src/hooks/useSessionRestoration.ts +4 -1
- package/src/hooks/useStorage.ts +4 -1
- package/src/index.ts +20 -7
- package/src/providers/services/AuthServiceProvider.tsx +3 -2
- package/src/providers/services/EventServiceProvider.tsx +2 -1
- package/src/providers/services/InactivityServiceProvider.tsx +2 -1
- package/src/providers/services/OrganisationServiceProvider.tsx +2 -1
- package/src/providers/services/UnifiedAuthProvider.tsx +4 -3
- package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +22 -2
- package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +24 -2
- package/src/rbac/__tests__/cache-invalidation.test.ts +20 -6
- package/src/rbac/api.ts +5 -2
- package/src/rbac/audit-enhanced.ts +6 -6
- package/src/rbac/audit.test.ts +60 -38
- package/src/rbac/audit.ts +8 -8
- package/src/rbac/cache-invalidation.ts +7 -4
- package/src/rbac/components/EnhancedNavigationMenu.tsx +11 -5
- package/src/rbac/components/NavigationGuard.tsx +7 -3
- package/src/rbac/components/NavigationProvider.tsx +6 -3
- package/src/rbac/components/PagePermissionGuard.tsx +28 -16
- package/src/rbac/components/PagePermissionProvider.tsx +4 -1
- package/src/rbac/components/PermissionEnforcer.tsx +9 -3
- package/src/rbac/components/RoleBasedRouter.tsx +3 -1
- package/src/rbac/components/SecureDataProvider.tsx +7 -3
- package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +87 -61
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +83 -33
- package/src/rbac/components/__tests__/NavigationProvider.test.tsx +36 -13
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +2 -2
- package/src/rbac/components/__tests__/PagePermissionProvider.test.tsx +22 -8
- package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +19 -6
- package/src/rbac/components/__tests__/SecureDataProvider.fixed.test.tsx +43 -17
- package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +42 -17
- package/src/rbac/engine.ts +15 -7
- package/src/rbac/hooks/usePermissions.ts +7 -3
- package/src/rbac/hooks/useResolvedScope.test.ts +2 -2
- package/src/rbac/hooks/useResolvedScope.ts +10 -7
- package/src/rbac/permissions.ts +5 -2
- package/src/rbac/security.test.ts +27 -16
- package/src/rbac/security.ts +5 -4
- package/src/services/AuthService.ts +22 -21
- package/src/services/EventService.ts +12 -12
- package/src/services/InactivityService.ts +5 -4
- package/src/services/OrganisationService.ts +26 -25
- package/src/services/__tests__/AuthService.test.ts +51 -19
- package/src/services/__tests__/EventService.test.ts +37 -5
- package/src/services/__tests__/InactivityService.test.ts +38 -4
- package/src/services/__tests__/OrganisationService.test.ts +3 -8
- package/src/services/base/BaseService.ts +3 -1
- package/src/styles/core.css +3 -0
- package/src/theming/__tests__/runtime.test.ts +21 -12
- package/src/theming/parseEventColours.ts +5 -19
- package/src/theming/runtime.ts +8 -4
- package/src/types/validation.ts +2 -29
- package/src/utils/__tests__/appConfig.unit.test.ts +1 -1
- package/src/utils/__tests__/audit.unit.test.ts +1 -1
- package/src/utils/__tests__/auth-utils.unit.test.ts +1 -1
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +19 -19
- package/src/utils/__tests__/cn.unit.test.ts +1 -1
- package/src/utils/__tests__/debugLogger.test.ts +1 -1
- package/src/utils/__tests__/deviceFingerprint.unit.test.ts +1 -1
- package/src/utils/__tests__/dynamicUtils.unit.test.ts +1 -1
- package/src/utils/__tests__/formatting.unit.test.ts +1 -1
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +1 -1
- package/src/utils/__tests__/logger.unit.test.ts +1 -1
- package/src/utils/__tests__/organisationContext.unit.test.ts +1 -1
- package/src/utils/__tests__/performanceBenchmark.test.ts +1 -1
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +1 -1
- package/src/utils/__tests__/permissionTypes.unit.test.ts +1 -1
- package/src/utils/__tests__/permissionUtils.unit.test.ts +1 -1
- package/src/utils/__tests__/sanitization.unit.test.ts +1 -1
- package/src/utils/__tests__/schemaUtils.unit.test.ts +1 -1
- package/src/utils/__tests__/secureDataAccess.unit.test.ts +1 -1
- package/src/utils/__tests__/secureErrors.unit.test.ts +33 -15
- package/src/utils/__tests__/secureStorage.unit.test.ts +1 -1
- package/src/utils/__tests__/security.unit.test.ts +40 -18
- package/src/utils/__tests__/securityMonitor.unit.test.ts +1 -1
- package/src/utils/__tests__/sessionTracking.unit.test.ts +40 -29
- package/src/utils/__tests__/validationUtils.unit.test.ts +19 -6
- package/src/utils/app/appConfig.ts +47 -0
- package/src/utils/app/appIdResolver.test.ts +497 -0
- package/src/utils/app/appIdResolver.ts +133 -0
- package/src/utils/app/appNameResolver.simple.test.ts +212 -0
- package/src/utils/app/appNameResolver.test.ts +121 -0
- package/src/utils/app/appNameResolver.ts +195 -0
- package/src/utils/audit/audit.ts +127 -0
- package/src/utils/context/organisationContext.test.ts +322 -0
- package/src/utils/context/organisationContext.ts +156 -0
- package/src/utils/context/sessionTracking.ts +125 -0
- package/src/utils/core/cn.ts +7 -0
- package/src/utils/core/debugLogger.ts +67 -0
- package/src/utils/core/logger.ts +181 -0
- package/src/utils/device/deviceFingerprint.ts +215 -0
- package/src/utils/dynamic/dynamicUtils.ts +105 -0
- package/src/utils/dynamic/lazyLoad.tsx +44 -0
- package/src/utils/file-reference/__tests__/file-reference.test.ts +788 -0
- package/src/utils/file-reference/index.ts +501 -0
- package/src/utils/formatting/formatDate.test.ts +237 -0
- package/src/utils/formatting/formatting.ts +133 -0
- package/src/utils/index.ts +39 -54
- package/src/utils/performance/bundleAnalysis.ts +129 -0
- package/src/utils/performance/performanceBenchmark.ts +64 -0
- package/src/utils/performance/performanceBudgets.ts +110 -0
- package/src/utils/permissions/permissionTypes.ts +37 -0
- package/src/utils/permissions/permissionUtils.test.ts +393 -0
- package/src/utils/permissions/permissionUtils.ts +34 -0
- package/src/utils/security/auth-utils.ts +96 -0
- package/src/utils/security/secureDataAccess.test.ts +711 -0
- package/src/utils/security/secureDataAccess.ts +377 -0
- package/src/utils/security/secureErrors.ts +82 -0
- package/src/utils/security/secureStorage.ts +244 -0
- package/src/utils/security/security.ts +159 -0
- package/src/utils/security/securityMonitor.ts +45 -0
- package/src/utils/storage/__tests__/helpers.unit.test.ts +1 -4
- package/src/utils/storage/helpers.ts +15 -8
- package/src/utils/validation/__tests__/htmlSanitization.unit.test.ts +598 -0
- package/src/{validation → utils/validation}/csrf.ts +1 -1
- package/src/utils/validation/htmlSanitization.ts +184 -0
- package/src/utils/validation/index.ts +79 -0
- package/src/utils/validation/sanitization.ts +333 -0
- package/src/{validation/schemaUtils.ts → utils/validation/schema.ts} +11 -6
- package/src/{validation → utils/validation}/sqlInjectionProtection.ts +2 -0
- package/src/utils/validation/validation.ts +111 -0
- package/src/utils/validation/validationUtils.ts +123 -0
- package/src/validation/index.ts +3 -34
- package/dist/chunk-24MKLB7U.js +0 -81
- package/dist/chunk-24MKLB7U.js.map +0 -1
- package/dist/chunk-3CG5L6RN.js.map +0 -1
- package/dist/chunk-3DBFLLLU.js.map +0 -1
- package/dist/chunk-5F3NDPJV.js.map +0 -1
- package/dist/chunk-66C4BSAY.js.map +0 -1
- package/dist/chunk-BDZUMRBD.js +0 -87
- package/dist/chunk-BDZUMRBD.js.map +0 -1
- package/dist/chunk-BYXRHAIF.js.map +0 -1
- package/dist/chunk-CDQ3PX7L.js +0 -18
- package/dist/chunk-CDQ3PX7L.js.map +0 -1
- package/dist/chunk-CQZU6TFE.js.map +0 -1
- package/dist/chunk-F64FFPOZ.js.map +0 -1
- package/dist/chunk-GEVIB2UB.js.map +0 -1
- package/dist/chunk-GKHF54DI.js.map +0 -1
- package/dist/chunk-GVDR7WNV.js.map +0 -1
- package/dist/chunk-HMNOSGVA.js.map +0 -1
- package/dist/chunk-JCQZ6LA7.js.map +0 -1
- package/dist/chunk-M6DDYFUD.js.map +0 -1
- package/dist/chunk-O3NWNXDY.js.map +0 -1
- package/dist/chunk-PYUXFQJ3.js.map +0 -1
- package/dist/chunk-UJI6WSMD.js.map +0 -1
- package/dist/chunk-VZ5OR6HD.js.map +0 -1
- package/dist/chunk-WP5I5GLN.js.map +0 -1
- package/dist/chunk-ZYZCRSBD.js.map +0 -1
- package/dist/validation-DnhrNMju.d.ts +0 -159
- package/src/components/PublicLayout/__tests__/PublicPageDebugger.test.tsx +0 -185
- package/src/validation/__tests__/common.unit.test.ts +0 -101
- package/src/validation/__tests__/csrf.unit.test.ts +0 -365
- package/src/validation/__tests__/passwordSchema.unit.test.ts +0 -203
- package/src/validation/__tests__/sanitization.unit.test.ts +0 -250
- package/src/validation/__tests__/schemaUtils.unit.test.ts +0 -451
- package/src/validation/__tests__/sqlInjectionProtection.unit.test.ts +0 -462
- package/src/validation/__tests__/user.unit.test.ts +0 -440
- package/src/validation/sanitization.ts +0 -96
- /package/dist/{DataTable-A36PJG6N.js.map → DataTable-6M4L6BI2.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-CQDZRJIS.js.map → UnifiedAuthProvider-XIQQ7LVU.js.map} +0 -0
- /package/dist/{api-TNIBJWLM.js.map → api-45XYYO2A.js.map} +0 -0
- /package/dist/{audit-T36HM7IM.js.map → audit-64X3VJXB.js.map} +0 -0
- /package/dist/{chunk-CTJRBUX2.js.map → chunk-6LAAY47Q.js.map} +0 -0
- /package/dist/{chunk-ZV77RZMU.js.map → chunk-INQLMHPF.js.map} +0 -0
- /package/dist/{useInactivityTracker-MRUU55XI.js.map → useInactivityTracker-TO6ZOF35.js.map} +0 -0
- /package/src/{validation → utils/validation}/common.ts +0 -0
- /package/src/{validation → utils/validation}/passwordSchema.ts +0 -0
- /package/src/{validation → utils/validation}/user.ts +0 -0
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCan,
|
|
3
3
|
useResolvedScope
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BLCXZEYF.js";
|
|
5
5
|
import {
|
|
6
6
|
toast,
|
|
7
7
|
useDataTablePerformance
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-BESYRHQM.js";
|
|
9
9
|
import {
|
|
10
10
|
init_UnifiedAuthProvider
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6LAAY47Q.js";
|
|
12
12
|
import {
|
|
13
13
|
useUnifiedAuth
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YCWDTTUK.js";
|
|
15
|
+
import {
|
|
16
|
+
renderSafeHtml
|
|
17
|
+
} from "./chunk-OWAG3GSU.js";
|
|
15
18
|
import {
|
|
16
19
|
cn
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-56XJ3TU6.js";
|
|
21
|
+
import {
|
|
22
|
+
createLogger,
|
|
23
|
+
init_logger
|
|
24
|
+
} from "./chunk-XDNLUEXI.js";
|
|
18
25
|
import {
|
|
19
26
|
__commonJS,
|
|
20
27
|
__toESM
|
|
@@ -3077,16 +3084,16 @@ var require_lodash = __commonJS({
|
|
|
3077
3084
|
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
|
|
3078
3085
|
}
|
|
3079
3086
|
function shortOut(func) {
|
|
3080
|
-
var
|
|
3087
|
+
var count2 = 0, lastCalled = 0;
|
|
3081
3088
|
return function() {
|
|
3082
3089
|
var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
|
|
3083
3090
|
lastCalled = stamp;
|
|
3084
3091
|
if (remaining > 0) {
|
|
3085
|
-
if (++
|
|
3092
|
+
if (++count2 >= HOT_COUNT) {
|
|
3086
3093
|
return arguments[0];
|
|
3087
3094
|
}
|
|
3088
3095
|
} else {
|
|
3089
|
-
|
|
3096
|
+
count2 = 0;
|
|
3090
3097
|
}
|
|
3091
3098
|
return func.apply(undefined2, arguments);
|
|
3092
3099
|
};
|
|
@@ -4979,7 +4986,7 @@ var require_lodash = __commonJS({
|
|
|
4979
4986
|
return dividend / divisor;
|
|
4980
4987
|
}, 1);
|
|
4981
4988
|
var floor = createRound("floor");
|
|
4982
|
-
function
|
|
4989
|
+
function max2(array) {
|
|
4983
4990
|
return array && array.length ? baseExtremum(array, identity, baseGt) : undefined2;
|
|
4984
4991
|
}
|
|
4985
4992
|
function maxBy(array, iteratee2) {
|
|
@@ -4991,7 +4998,7 @@ var require_lodash = __commonJS({
|
|
|
4991
4998
|
function meanBy(array, iteratee2) {
|
|
4992
4999
|
return baseMean(array, getIteratee(iteratee2, 2));
|
|
4993
5000
|
}
|
|
4994
|
-
function
|
|
5001
|
+
function min2(array) {
|
|
4995
5002
|
return array && array.length ? baseExtremum(array, identity, baseLt) : undefined2;
|
|
4996
5003
|
}
|
|
4997
5004
|
function minBy(array, iteratee2) {
|
|
@@ -5004,7 +5011,7 @@ var require_lodash = __commonJS({
|
|
|
5004
5011
|
var subtract = createMathOperation(function(minuend, subtrahend) {
|
|
5005
5012
|
return minuend - subtrahend;
|
|
5006
5013
|
}, 0);
|
|
5007
|
-
function
|
|
5014
|
+
function sum2(array) {
|
|
5008
5015
|
return array && array.length ? baseSum(array, identity) : 0;
|
|
5009
5016
|
}
|
|
5010
5017
|
function sumBy(array, iteratee2) {
|
|
@@ -5252,11 +5259,11 @@ var require_lodash = __commonJS({
|
|
|
5252
5259
|
lodash.lowerFirst = lowerFirst;
|
|
5253
5260
|
lodash.lt = lt;
|
|
5254
5261
|
lodash.lte = lte;
|
|
5255
|
-
lodash.max =
|
|
5262
|
+
lodash.max = max2;
|
|
5256
5263
|
lodash.maxBy = maxBy;
|
|
5257
5264
|
lodash.mean = mean;
|
|
5258
5265
|
lodash.meanBy = meanBy;
|
|
5259
|
-
lodash.min =
|
|
5266
|
+
lodash.min = min2;
|
|
5260
5267
|
lodash.minBy = minBy;
|
|
5261
5268
|
lodash.stubArray = stubArray;
|
|
5262
5269
|
lodash.stubFalse = stubFalse;
|
|
@@ -5293,7 +5300,7 @@ var require_lodash = __commonJS({
|
|
|
5293
5300
|
lodash.startCase = startCase;
|
|
5294
5301
|
lodash.startsWith = startsWith;
|
|
5295
5302
|
lodash.subtract = subtract;
|
|
5296
|
-
lodash.sum =
|
|
5303
|
+
lodash.sum = sum2;
|
|
5297
5304
|
lodash.sumBy = sumBy;
|
|
5298
5305
|
lodash.template = template;
|
|
5299
5306
|
lodash.times = times;
|
|
@@ -5502,10 +5509,10 @@ var require_lodash = __commonJS({
|
|
|
5502
5509
|
});
|
|
5503
5510
|
|
|
5504
5511
|
// src/components/DataTable/DataTable.tsx
|
|
5505
|
-
import
|
|
5512
|
+
import React22 from "react";
|
|
5506
5513
|
|
|
5507
5514
|
// src/components/DataTable/components/DataTableCore.tsx
|
|
5508
|
-
import
|
|
5515
|
+
import React21, { useMemo as useMemo14, useCallback as useCallback11, useEffect as useEffect12, useRef as useRef7 } from "react";
|
|
5509
5516
|
import { useReactTable } from "@tanstack/react-table";
|
|
5510
5517
|
import { Edit, Trash, ChevronUp as ChevronUp2, ChevronDown as ChevronDown3, ChevronsUpDown } from "lucide-react";
|
|
5511
5518
|
|
|
@@ -5646,12 +5653,24 @@ var getTableCellClasses = (options = {}) => {
|
|
|
5646
5653
|
};
|
|
5647
5654
|
var getTableClasses = (options = {}) => {
|
|
5648
5655
|
const { isFixed = false, variant = "default", className } = options;
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5656
|
+
if (isFixed) {
|
|
5657
|
+
return cn(
|
|
5658
|
+
tableStyles.tableFixed,
|
|
5659
|
+
variant === "compact" && "text-sm",
|
|
5660
|
+
variant === "spacious" && "text-base",
|
|
5661
|
+
className
|
|
5662
|
+
);
|
|
5663
|
+
}
|
|
5664
|
+
if (variant === "compact") {
|
|
5665
|
+
return cn(tableStyles.table, className);
|
|
5666
|
+
}
|
|
5667
|
+
if (variant === "spacious") {
|
|
5668
|
+
return cn(
|
|
5669
|
+
tableStyles.table.replace("text-sm", "text-base"),
|
|
5670
|
+
className
|
|
5671
|
+
);
|
|
5672
|
+
}
|
|
5673
|
+
return cn(tableStyles.table, className);
|
|
5655
5674
|
};
|
|
5656
5675
|
|
|
5657
5676
|
// src/components/Input/Input.tsx
|
|
@@ -5907,6 +5926,7 @@ var Select = React5.forwardRef(
|
|
|
5907
5926
|
({
|
|
5908
5927
|
children,
|
|
5909
5928
|
className,
|
|
5929
|
+
direction = "down",
|
|
5910
5930
|
...selectProps
|
|
5911
5931
|
}, ref) => {
|
|
5912
5932
|
const internalRef = React5.useRef(null);
|
|
@@ -6005,8 +6025,9 @@ var Select = React5.forwardRef(
|
|
|
6005
6025
|
...state,
|
|
6006
6026
|
actions,
|
|
6007
6027
|
registerItem,
|
|
6008
|
-
unregisterItem
|
|
6009
|
-
|
|
6028
|
+
unregisterItem,
|
|
6029
|
+
direction
|
|
6030
|
+
}), [state, actions, registerItem, unregisterItem, direction]);
|
|
6010
6031
|
return /* @__PURE__ */ jsx4(
|
|
6011
6032
|
"form",
|
|
6012
6033
|
{
|
|
@@ -6022,7 +6043,8 @@ var Select = React5.forwardRef(
|
|
|
6022
6043
|
Select.displayName = "Select";
|
|
6023
6044
|
var SelectTrigger = React5.forwardRef(
|
|
6024
6045
|
({ children, className, variant = "outline", size = "default", asChild = false, ...props }, ref) => {
|
|
6025
|
-
const { open, disabled, value, actions } = useSelectContext();
|
|
6046
|
+
const { open, disabled, value, actions, direction = "down" } = useSelectContext();
|
|
6047
|
+
const opensUpward = direction === "up";
|
|
6026
6048
|
const handleClick = () => {
|
|
6027
6049
|
actions.setOpen(!open);
|
|
6028
6050
|
};
|
|
@@ -6054,7 +6076,8 @@ var SelectTrigger = React5.forwardRef(
|
|
|
6054
6076
|
className: cn(
|
|
6055
6077
|
"!justify-between relative w-full",
|
|
6056
6078
|
"[&_svg]:pointer-events-none",
|
|
6057
|
-
open && "!rounded-b-none !border-b-0",
|
|
6079
|
+
open && !opensUpward && "!rounded-b-none !border-b-0",
|
|
6080
|
+
open && opensUpward && "!rounded-t-none !border-t-0",
|
|
6058
6081
|
className
|
|
6059
6082
|
),
|
|
6060
6083
|
style: {
|
|
@@ -6111,7 +6134,8 @@ var SelectTrigger = React5.forwardRef(
|
|
|
6111
6134
|
className: cn(
|
|
6112
6135
|
"!justify-between relative w-full",
|
|
6113
6136
|
"[&_svg]:pointer-events-none",
|
|
6114
|
-
open && "!rounded-b-none !border-b-0",
|
|
6137
|
+
open && !opensUpward && "!rounded-b-none !border-b-0",
|
|
6138
|
+
open && opensUpward && "!rounded-t-none !border-t-0",
|
|
6115
6139
|
className
|
|
6116
6140
|
),
|
|
6117
6141
|
style: {
|
|
@@ -6155,10 +6179,10 @@ var SelectContent = React5.forwardRef(
|
|
|
6155
6179
|
className,
|
|
6156
6180
|
searchable = false,
|
|
6157
6181
|
searchPlaceholder = "Search...",
|
|
6158
|
-
maxHeight = "20rem",
|
|
6182
|
+
maxHeight = "max(20rem, 50vh)",
|
|
6159
6183
|
style
|
|
6160
6184
|
}, ref) => {
|
|
6161
|
-
const { open, actions } = useSelectContext();
|
|
6185
|
+
const { open, actions, direction = "down" } = useSelectContext();
|
|
6162
6186
|
const { searchTerm, setSearchTerm, filteredChildren, searchInputRef } = useSelectSearch({
|
|
6163
6187
|
children,
|
|
6164
6188
|
searchable
|
|
@@ -6180,17 +6204,19 @@ var SelectContent = React5.forwardRef(
|
|
|
6180
6204
|
}
|
|
6181
6205
|
);
|
|
6182
6206
|
}
|
|
6207
|
+
const opensUpward = direction === "up";
|
|
6183
6208
|
return /* @__PURE__ */ jsxs2(
|
|
6184
6209
|
"ul",
|
|
6185
6210
|
{
|
|
6186
6211
|
ref,
|
|
6187
6212
|
className: cn(
|
|
6188
|
-
"absolute z-[99999] w-full overflow-y-auto
|
|
6213
|
+
"absolute z-[99999] w-full overflow-y-auto border border-main-300 bg-main-50 shadow-lg",
|
|
6189
6214
|
"list-none p-0 m-0",
|
|
6215
|
+
opensUpward ? "rounded-t-md border-b-0" : "rounded-b-md border-t-0",
|
|
6190
6216
|
className
|
|
6191
6217
|
),
|
|
6192
6218
|
style: {
|
|
6193
|
-
top: "100%",
|
|
6219
|
+
[opensUpward ? "bottom" : "top"]: "100%",
|
|
6194
6220
|
left: 0,
|
|
6195
6221
|
right: 0,
|
|
6196
6222
|
maxHeight,
|
|
@@ -6656,7 +6682,7 @@ function DataTableToolbar({
|
|
|
6656
6682
|
}
|
|
6657
6683
|
|
|
6658
6684
|
// src/components/DataTable/components/UnifiedTableBody.tsx
|
|
6659
|
-
import
|
|
6685
|
+
import React11, { useRef as useRef3, useEffect as useEffect3 } from "react";
|
|
6660
6686
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
6661
6687
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
6662
6688
|
import { ChevronDown as ChevronDown2, ChevronRight } from "lucide-react";
|
|
@@ -6708,10 +6734,32 @@ function EmptyState({
|
|
|
6708
6734
|
}
|
|
6709
6735
|
|
|
6710
6736
|
// src/components/DataTable/components/FilterRow.tsx
|
|
6711
|
-
import
|
|
6737
|
+
import React8 from "react";
|
|
6712
6738
|
|
|
6713
6739
|
// src/components/DataTable/components/ColumnFilter.tsx
|
|
6714
6740
|
import { X as X2 } from "lucide-react";
|
|
6741
|
+
|
|
6742
|
+
// src/components/DataTable/utils/columnUtils.ts
|
|
6743
|
+
import React7 from "react";
|
|
6744
|
+
function getColumnHeaderText(column) {
|
|
6745
|
+
const header = column.columnDef.header;
|
|
6746
|
+
if (typeof header === "string") {
|
|
6747
|
+
return header;
|
|
6748
|
+
}
|
|
6749
|
+
const getAccessorKey = () => {
|
|
6750
|
+
const def = column.columnDef;
|
|
6751
|
+
return "accessorKey" in def && def.accessorKey ? String(def.accessorKey) : void 0;
|
|
6752
|
+
};
|
|
6753
|
+
if (typeof header === "function") {
|
|
6754
|
+
return getAccessorKey() || column.id;
|
|
6755
|
+
}
|
|
6756
|
+
if (React7.isValidElement(header)) {
|
|
6757
|
+
return getAccessorKey() || column.id;
|
|
6758
|
+
}
|
|
6759
|
+
return getAccessorKey() || column.id;
|
|
6760
|
+
}
|
|
6761
|
+
|
|
6762
|
+
// src/components/DataTable/components/ColumnFilter.tsx
|
|
6715
6763
|
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
6716
6764
|
function ColumnFilter({
|
|
6717
6765
|
column,
|
|
@@ -6735,6 +6783,7 @@ function ColumnFilter({
|
|
|
6735
6783
|
column.setFilterValue(void 0);
|
|
6736
6784
|
};
|
|
6737
6785
|
const hasFilter = columnFilterValue !== void 0 && columnFilterValue !== "";
|
|
6786
|
+
const defaultPlaceholder = `Filter ${getColumnHeaderText(column)}...`;
|
|
6738
6787
|
const renderFilterInput = () => {
|
|
6739
6788
|
switch (filterType) {
|
|
6740
6789
|
case "select":
|
|
@@ -6744,7 +6793,7 @@ function ColumnFilter({
|
|
|
6744
6793
|
value: columnFilterValue || "",
|
|
6745
6794
|
onValueChange: handleFilterChange,
|
|
6746
6795
|
children: [
|
|
6747
|
-
/* @__PURE__ */ jsx10(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsx10(SelectValue, { placeholder: placeholder ||
|
|
6796
|
+
/* @__PURE__ */ jsx10(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsx10(SelectValue, { placeholder: placeholder || defaultPlaceholder }) }),
|
|
6748
6797
|
/* @__PURE__ */ jsxs7(SelectContent, { children: [
|
|
6749
6798
|
/* @__PURE__ */ jsx10(SelectItem, { value: "", children: "All" }),
|
|
6750
6799
|
options.map((option) => /* @__PURE__ */ jsx10(SelectItem, { value: option.value, children: option.label }, option.value))
|
|
@@ -6759,7 +6808,7 @@ function ColumnFilter({
|
|
|
6759
6808
|
type: "number",
|
|
6760
6809
|
value: columnFilterValue || "",
|
|
6761
6810
|
onChange: (e) => handleFilterChange(e.target.value ? Number(e.target.value) : void 0),
|
|
6762
|
-
placeholder: placeholder ||
|
|
6811
|
+
placeholder: placeholder || defaultPlaceholder,
|
|
6763
6812
|
className: "h-8 datatable-number-no-spinners"
|
|
6764
6813
|
}
|
|
6765
6814
|
);
|
|
@@ -6770,7 +6819,7 @@ function ColumnFilter({
|
|
|
6770
6819
|
type: "date",
|
|
6771
6820
|
value: columnFilterValue || "",
|
|
6772
6821
|
onChange: (e) => handleFilterChange(e.target.value || void 0),
|
|
6773
|
-
placeholder: placeholder ||
|
|
6822
|
+
placeholder: placeholder || defaultPlaceholder,
|
|
6774
6823
|
className: "h-8"
|
|
6775
6824
|
}
|
|
6776
6825
|
);
|
|
@@ -6780,7 +6829,7 @@ function ColumnFilter({
|
|
|
6780
6829
|
{
|
|
6781
6830
|
value: columnFilterValue || "",
|
|
6782
6831
|
onChange: (e) => handleFilterChange(e.target.value || void 0),
|
|
6783
|
-
placeholder: placeholder ||
|
|
6832
|
+
placeholder: placeholder || defaultPlaceholder,
|
|
6784
6833
|
className: "h-8"
|
|
6785
6834
|
}
|
|
6786
6835
|
);
|
|
@@ -6805,7 +6854,7 @@ import { jsx as jsx11 } from "react/jsx-runtime";
|
|
|
6805
6854
|
function FilterRow({ table, visibleColumns }) {
|
|
6806
6855
|
const { getState } = table;
|
|
6807
6856
|
const { columnFilters } = getState();
|
|
6808
|
-
const getColumnOptions =
|
|
6857
|
+
const getColumnOptions = React8.useCallback((columnId) => {
|
|
6809
6858
|
const column = table.getColumn(columnId);
|
|
6810
6859
|
if (!column) return [];
|
|
6811
6860
|
const columnDef = column.columnDef;
|
|
@@ -6824,12 +6873,12 @@ function FilterRow({ table, visibleColumns }) {
|
|
|
6824
6873
|
});
|
|
6825
6874
|
return Array.from(uniqueValues).sort().map((value) => ({ value, label: value }));
|
|
6826
6875
|
}, [table]);
|
|
6827
|
-
const getFilterType =
|
|
6876
|
+
const getFilterType = React8.useCallback((columnId) => {
|
|
6828
6877
|
const column = table.getColumn(columnId);
|
|
6829
6878
|
if (!column) return "text";
|
|
6830
6879
|
const columnDef = column.columnDef;
|
|
6831
6880
|
const explicitFilterType = columnDef.filterType;
|
|
6832
|
-
if (explicitFilterType
|
|
6881
|
+
if (explicitFilterType === "text" || explicitFilterType === "select" || explicitFilterType === "number" || explicitFilterType === "date") {
|
|
6833
6882
|
return explicitFilterType;
|
|
6834
6883
|
}
|
|
6835
6884
|
if (columnDef.filterSelectOptions && Array.isArray(columnDef.filterSelectOptions)) {
|
|
@@ -6863,7 +6912,7 @@ function FilterRow({ table, visibleColumns }) {
|
|
|
6863
6912
|
column,
|
|
6864
6913
|
filterType,
|
|
6865
6914
|
options,
|
|
6866
|
-
placeholder: `Filter ${column
|
|
6915
|
+
placeholder: `Filter ${getColumnHeaderText(column)}...`
|
|
6867
6916
|
}
|
|
6868
6917
|
) : /* @__PURE__ */ jsx11("div", { className: "h-8 flex items-center text-sec-400 text-sm", children: "No filter" })
|
|
6869
6918
|
},
|
|
@@ -6873,120 +6922,8 @@ function FilterRow({ table, visibleColumns }) {
|
|
|
6873
6922
|
}
|
|
6874
6923
|
|
|
6875
6924
|
// src/components/DataTable/components/ActionButtons.tsx
|
|
6876
|
-
import
|
|
6925
|
+
import React9, { useMemo as useMemo2 } from "react";
|
|
6877
6926
|
import { MoreHorizontal } from "lucide-react";
|
|
6878
|
-
|
|
6879
|
-
// src/utils/logger.ts
|
|
6880
|
-
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
6881
|
-
LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG";
|
|
6882
|
-
LogLevel2[LogLevel2["INFO"] = 1] = "INFO";
|
|
6883
|
-
LogLevel2[LogLevel2["WARN"] = 2] = "WARN";
|
|
6884
|
-
LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR";
|
|
6885
|
-
return LogLevel2;
|
|
6886
|
-
})(LogLevel || {});
|
|
6887
|
-
var Logger = class {
|
|
6888
|
-
/**
|
|
6889
|
-
* Check if we're in development mode
|
|
6890
|
-
*/
|
|
6891
|
-
static get isDevelopment() {
|
|
6892
|
-
return import.meta.env.MODE === "development";
|
|
6893
|
-
}
|
|
6894
|
-
/**
|
|
6895
|
-
* Configure the logger
|
|
6896
|
-
*/
|
|
6897
|
-
static configure(config) {
|
|
6898
|
-
this.config = { ...this.config, ...config };
|
|
6899
|
-
}
|
|
6900
|
-
/**
|
|
6901
|
-
* Format a log message with optional timestamp and component
|
|
6902
|
-
*/
|
|
6903
|
-
static formatMessage(level, component, message) {
|
|
6904
|
-
const parts = [];
|
|
6905
|
-
if (this.config.prefix) {
|
|
6906
|
-
parts.push(`[${this.config.prefix}]`);
|
|
6907
|
-
}
|
|
6908
|
-
if (this.config.includeTimestamp) {
|
|
6909
|
-
parts.push(`[${(/* @__PURE__ */ new Date()).toISOString()}]`);
|
|
6910
|
-
}
|
|
6911
|
-
parts.push(`[${LogLevel[level]}]`);
|
|
6912
|
-
if (this.config.includeComponent && component) {
|
|
6913
|
-
parts.push(`[${component}]`);
|
|
6914
|
-
}
|
|
6915
|
-
parts.push(message);
|
|
6916
|
-
return parts.join(" ");
|
|
6917
|
-
}
|
|
6918
|
-
/**
|
|
6919
|
-
* Check if a log level should be output
|
|
6920
|
-
*/
|
|
6921
|
-
static shouldLog(level) {
|
|
6922
|
-
return this.isDevelopment && level >= this.config.level;
|
|
6923
|
-
}
|
|
6924
|
-
/**
|
|
6925
|
-
* Log debug information (development only)
|
|
6926
|
-
*/
|
|
6927
|
-
static debug(component, message, ...args) {
|
|
6928
|
-
if (this.shouldLog(0 /* DEBUG */)) {
|
|
6929
|
-
try {
|
|
6930
|
-
console.debug(this.formatMessage(0 /* DEBUG */, component, message), ...args);
|
|
6931
|
-
} catch (e) {
|
|
6932
|
-
}
|
|
6933
|
-
}
|
|
6934
|
-
}
|
|
6935
|
-
/**
|
|
6936
|
-
* Log info information (development only)
|
|
6937
|
-
*/
|
|
6938
|
-
static info(component, message, ...args) {
|
|
6939
|
-
if (this.shouldLog(1 /* INFO */)) {
|
|
6940
|
-
try {
|
|
6941
|
-
console.info(this.formatMessage(1 /* INFO */, component, message), ...args);
|
|
6942
|
-
} catch (e) {
|
|
6943
|
-
}
|
|
6944
|
-
}
|
|
6945
|
-
}
|
|
6946
|
-
/**
|
|
6947
|
-
* Log warning information (development only)
|
|
6948
|
-
*/
|
|
6949
|
-
static warn(component, message, ...args) {
|
|
6950
|
-
if (this.shouldLog(2 /* WARN */)) {
|
|
6951
|
-
try {
|
|
6952
|
-
console.warn(this.formatMessage(2 /* WARN */, component, message), ...args);
|
|
6953
|
-
} catch (e) {
|
|
6954
|
-
}
|
|
6955
|
-
}
|
|
6956
|
-
}
|
|
6957
|
-
/**
|
|
6958
|
-
* Log error information (development only)
|
|
6959
|
-
*/
|
|
6960
|
-
static error(component, message, ...args) {
|
|
6961
|
-
if (this.shouldLog(3 /* ERROR */)) {
|
|
6962
|
-
try {
|
|
6963
|
-
console.error(this.formatMessage(3 /* ERROR */, component, message), ...args);
|
|
6964
|
-
} catch (e) {
|
|
6965
|
-
}
|
|
6966
|
-
}
|
|
6967
|
-
}
|
|
6968
|
-
/**
|
|
6969
|
-
* Create a scoped logger for a specific component
|
|
6970
|
-
*/
|
|
6971
|
-
static createScopedLogger(component) {
|
|
6972
|
-
return {
|
|
6973
|
-
debug: (message, ...args) => this.debug(component, message, ...args),
|
|
6974
|
-
info: (message, ...args) => this.info(component, message, ...args),
|
|
6975
|
-
warn: (message, ...args) => this.warn(component, message, ...args),
|
|
6976
|
-
error: (message, ...args) => this.error(component, message, ...args)
|
|
6977
|
-
};
|
|
6978
|
-
}
|
|
6979
|
-
};
|
|
6980
|
-
Logger.config = {
|
|
6981
|
-
level: 0 /* DEBUG */,
|
|
6982
|
-
includeTimestamp: false,
|
|
6983
|
-
includeComponent: true
|
|
6984
|
-
};
|
|
6985
|
-
function createLogger(component) {
|
|
6986
|
-
return Logger.createScopedLogger(component);
|
|
6987
|
-
}
|
|
6988
|
-
|
|
6989
|
-
// src/components/DataTable/components/ActionButtons.tsx
|
|
6990
6927
|
import { Fragment, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
6991
6928
|
var evaluateCondition = (condition, row, defaultValue) => {
|
|
6992
6929
|
if (typeof condition === "boolean") {
|
|
@@ -7005,7 +6942,6 @@ function ActionButtonsComponent({
|
|
|
7005
6942
|
hierarchical = false,
|
|
7006
6943
|
permissions
|
|
7007
6944
|
}) {
|
|
7008
|
-
const logger = createLogger("ActionButtons");
|
|
7009
6945
|
const rowData = row.original;
|
|
7010
6946
|
if (actions.length === 0) {
|
|
7011
6947
|
return null;
|
|
@@ -7058,13 +6994,6 @@ function ActionButtonsComponent({
|
|
|
7058
6994
|
variant: action.variant === "destructive" ? "destructive" : "ghost",
|
|
7059
6995
|
size: "sm",
|
|
7060
6996
|
onClick: () => {
|
|
7061
|
-
if (import.meta.env.MODE === "development" && !isDisabled) {
|
|
7062
|
-
logger.debug("Action clicked:", {
|
|
7063
|
-
actionLabel: action.label,
|
|
7064
|
-
rowOriginal: rowData,
|
|
7065
|
-
actionOnClick: typeof action.onClick
|
|
7066
|
-
});
|
|
7067
|
-
}
|
|
7068
6997
|
if (!isDisabled) {
|
|
7069
6998
|
action.onClick(rowData);
|
|
7070
6999
|
}
|
|
@@ -7093,12 +7022,6 @@ function ActionButtonsComponent({
|
|
|
7093
7022
|
{
|
|
7094
7023
|
value: `action-${actionIndex}`,
|
|
7095
7024
|
onClick: () => {
|
|
7096
|
-
if (import.meta.env.MODE === "development" && !isDisabled) {
|
|
7097
|
-
logger.debug("Action clicked from dropdown:", {
|
|
7098
|
-
actionLabel: action.label,
|
|
7099
|
-
rowOriginal: rowData
|
|
7100
|
-
});
|
|
7101
|
-
}
|
|
7102
7025
|
if (!isDisabled) {
|
|
7103
7026
|
action.onClick(rowData);
|
|
7104
7027
|
}
|
|
@@ -7116,12 +7039,13 @@ function ActionButtonsComponent({
|
|
|
7116
7039
|
}) })
|
|
7117
7040
|
] });
|
|
7118
7041
|
}
|
|
7119
|
-
var ActionButtons =
|
|
7042
|
+
var ActionButtons = React9.memo(ActionButtonsComponent);
|
|
7120
7043
|
|
|
7121
7044
|
// src/components/DataTable/components/EditableRow.tsx
|
|
7122
|
-
import
|
|
7045
|
+
import React10 from "react";
|
|
7123
7046
|
import { flexRender } from "@tanstack/react-table";
|
|
7124
7047
|
import { X as X3, Check as Check3 } from "lucide-react";
|
|
7048
|
+
init_logger();
|
|
7125
7049
|
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
7126
7050
|
function SelectEditField({
|
|
7127
7051
|
columnDef,
|
|
@@ -7131,14 +7055,14 @@ function SelectEditField({
|
|
|
7131
7055
|
onChange,
|
|
7132
7056
|
className
|
|
7133
7057
|
}) {
|
|
7134
|
-
const logger =
|
|
7058
|
+
const logger = React10.useMemo(() => createLogger("SelectEditField"), []);
|
|
7135
7059
|
const isSearchable = columnDef.selectSearchable !== false;
|
|
7136
7060
|
const isCreatable = columnDef.creatable === true;
|
|
7137
|
-
const selectRef =
|
|
7138
|
-
const [searchTerm, setSearchTerm] =
|
|
7139
|
-
const [isOpen, setIsOpen] =
|
|
7140
|
-
const [showCreateOption, setShowCreateOption] =
|
|
7141
|
-
|
|
7061
|
+
const selectRef = React10.useRef(null);
|
|
7062
|
+
const [searchTerm, setSearchTerm] = React10.useState("");
|
|
7063
|
+
const [isOpen, setIsOpen] = React10.useState(false);
|
|
7064
|
+
const [showCreateOption, setShowCreateOption] = React10.useState(false);
|
|
7065
|
+
React10.useEffect(() => {
|
|
7142
7066
|
if (!isOpen || !isSearchable || !isCreatable) return;
|
|
7143
7067
|
const findAndAttachSearchInput = () => {
|
|
7144
7068
|
let searchInput = null;
|
|
@@ -7216,7 +7140,7 @@ function SelectEditField({
|
|
|
7216
7140
|
}
|
|
7217
7141
|
return cleanup;
|
|
7218
7142
|
}, [isOpen, isSearchable, isCreatable, columnDef.fieldOptions]);
|
|
7219
|
-
const handleCreateNew =
|
|
7143
|
+
const handleCreateNew = React10.useCallback(async () => {
|
|
7220
7144
|
if (!isCreatable || !columnDef.onCreateNew || !searchTerm.trim()) return;
|
|
7221
7145
|
try {
|
|
7222
7146
|
const newValue = await columnDef.onCreateNew(searchTerm.trim());
|
|
@@ -7362,9 +7286,9 @@ function EditableRow({
|
|
|
7362
7286
|
hierarchical = false
|
|
7363
7287
|
}) {
|
|
7364
7288
|
const rowId = getRowId ? getRowId(row.original, row.index) : String(row.id);
|
|
7365
|
-
const firstInputRef =
|
|
7366
|
-
const hasAssignedRef =
|
|
7367
|
-
|
|
7289
|
+
const firstInputRef = React10.useRef(null);
|
|
7290
|
+
const hasAssignedRef = React10.useRef(false);
|
|
7291
|
+
React10.useEffect(() => {
|
|
7368
7292
|
if (firstInputRef.current) {
|
|
7369
7293
|
firstInputRef.current.focus();
|
|
7370
7294
|
firstInputRef.current.select();
|
|
@@ -7430,6 +7354,9 @@ function EditableRow({
|
|
|
7430
7354
|
);
|
|
7431
7355
|
}
|
|
7432
7356
|
|
|
7357
|
+
// src/components/DataTable/components/UnifiedTableBody.tsx
|
|
7358
|
+
init_logger();
|
|
7359
|
+
|
|
7433
7360
|
// src/components/DataTable/utils/hierarchicalUtils.ts
|
|
7434
7361
|
function validateHierarchicalData(data) {
|
|
7435
7362
|
const errors = [];
|
|
@@ -7640,14 +7567,14 @@ function SelectEditField2({
|
|
|
7640
7567
|
placeholder,
|
|
7641
7568
|
onChange
|
|
7642
7569
|
}) {
|
|
7643
|
-
const logger =
|
|
7570
|
+
const logger = React11.useMemo(() => createLogger("SelectEditField"), []);
|
|
7644
7571
|
const isSearchable = columnDef.selectSearchable !== false;
|
|
7645
7572
|
const isCreatable = columnDef.creatable === true;
|
|
7646
|
-
const selectRef =
|
|
7647
|
-
const [searchTerm, setSearchTerm] =
|
|
7648
|
-
const [isOpen, setIsOpen] =
|
|
7649
|
-
const [showCreateOption, setShowCreateOption] =
|
|
7650
|
-
|
|
7573
|
+
const selectRef = React11.useRef(null);
|
|
7574
|
+
const [searchTerm, setSearchTerm] = React11.useState("");
|
|
7575
|
+
const [isOpen, setIsOpen] = React11.useState(false);
|
|
7576
|
+
const [showCreateOption, setShowCreateOption] = React11.useState(false);
|
|
7577
|
+
React11.useEffect(() => {
|
|
7651
7578
|
if (!isOpen || !isSearchable || !isCreatable || !columnDef.onCreateNew) {
|
|
7652
7579
|
if (!isOpen || !isCreatable || !columnDef.onCreateNew) {
|
|
7653
7580
|
setShowCreateOption(false);
|
|
@@ -7687,18 +7614,6 @@ function SelectEditField2({
|
|
|
7687
7614
|
};
|
|
7688
7615
|
const hasMatch = (columnDef.fieldOptions || []).some(checkMatch);
|
|
7689
7616
|
const shouldShow = isCreatable && !!columnDef.onCreateNew;
|
|
7690
|
-
if (import.meta.env.MODE === "development" && isCreatable) {
|
|
7691
|
-
logger.debug("[SelectEditField] Creatable select check:", {
|
|
7692
|
-
searchTerm: currentSearch,
|
|
7693
|
-
searchLower,
|
|
7694
|
-
hasMatch,
|
|
7695
|
-
isCreatable,
|
|
7696
|
-
hasOnCreateNew: !!columnDef.onCreateNew,
|
|
7697
|
-
shouldShow,
|
|
7698
|
-
fieldOptionsCount: columnDef.fieldOptions?.length || 0,
|
|
7699
|
-
note: "Create option shows when search term exists, regardless of matches"
|
|
7700
|
-
});
|
|
7701
|
-
}
|
|
7702
7617
|
setShowCreateOption(shouldShow);
|
|
7703
7618
|
} else {
|
|
7704
7619
|
setShowCreateOption(false);
|
|
@@ -7744,7 +7659,7 @@ function SelectEditField2({
|
|
|
7744
7659
|
}
|
|
7745
7660
|
return cleanup;
|
|
7746
7661
|
}, [isOpen, isSearchable, isCreatable, columnDef.fieldOptions, columnDef.onCreateNew]);
|
|
7747
|
-
const handleCreateNew =
|
|
7662
|
+
const handleCreateNew = React11.useCallback(async () => {
|
|
7748
7663
|
if (!isCreatable || !columnDef.onCreateNew || !searchTerm.trim()) return;
|
|
7749
7664
|
try {
|
|
7750
7665
|
const newValue = await columnDef.onCreateNew(searchTerm.trim());
|
|
@@ -7875,7 +7790,7 @@ var renderEditField2 = (column, value, onChange, editingData = {}, placeholder)
|
|
|
7875
7790
|
}
|
|
7876
7791
|
);
|
|
7877
7792
|
};
|
|
7878
|
-
var RowComponent =
|
|
7793
|
+
var RowComponent = React11.memo(({
|
|
7879
7794
|
row,
|
|
7880
7795
|
style,
|
|
7881
7796
|
isEditing,
|
|
@@ -7893,6 +7808,7 @@ var RowComponent = React10.memo(({
|
|
|
7893
7808
|
}) => {
|
|
7894
7809
|
const rowRef = useRef3(null);
|
|
7895
7810
|
const firstInputRef = useRef3(null);
|
|
7811
|
+
const logger = React11.useMemo(() => createLogger("RowComponent"), []);
|
|
7896
7812
|
const rowId = getRowIdSafe(row.original, row.index, getRowId);
|
|
7897
7813
|
const hierarchicalRow = row.original;
|
|
7898
7814
|
const isHierarchical = hierarchical?.enabled && hierarchicalRow?.isParent !== void 0;
|
|
@@ -7930,34 +7846,100 @@ var RowComponent = React10.memo(({
|
|
|
7930
7846
|
const groupValue = row.getValue(grouping[0]);
|
|
7931
7847
|
const subRowsCount = row.subRows?.length || 0;
|
|
7932
7848
|
const isExpanded = row.getIsExpanded();
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7849
|
+
const visibleCells2 = row.getVisibleCells();
|
|
7850
|
+
const childRows = row.subRows?.map((subRow) => subRow.original) || [];
|
|
7851
|
+
return /* @__PURE__ */ jsx14("tr", { className: "bg-sec-50 hover:bg-sec-100", style, children: visibleCells2.map((cell, cellIndex) => {
|
|
7852
|
+
const columnDef = cell.column.columnDef;
|
|
7853
|
+
const isGroupingColumn = cellIndex === 0 || grouping.includes(cell.column.id || "");
|
|
7854
|
+
if (isGroupingColumn && cellIndex === 0) {
|
|
7855
|
+
return /* @__PURE__ */ jsxs10(
|
|
7856
|
+
"td",
|
|
7857
|
+
{
|
|
7858
|
+
className: getTableCellClasses({
|
|
7859
|
+
isCompact: true,
|
|
7860
|
+
className: "px-3 py-2 flex items-center font-medium"
|
|
7861
|
+
}),
|
|
7862
|
+
children: [
|
|
7863
|
+
/* @__PURE__ */ jsx14(
|
|
7864
|
+
Button,
|
|
7865
|
+
{
|
|
7866
|
+
variant: "ghost",
|
|
7867
|
+
size: "sm",
|
|
7868
|
+
onClick: () => row.toggleExpanded(),
|
|
7869
|
+
className: "p-0 h-auto mr-2",
|
|
7870
|
+
children: isExpanded ? /* @__PURE__ */ jsx14(ChevronDown2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx14(ChevronRight, { className: "h-4 w-4" })
|
|
7871
|
+
}
|
|
7872
|
+
),
|
|
7873
|
+
/* @__PURE__ */ jsxs10("span", { className: "text-sm", children: [
|
|
7874
|
+
String(groupValue),
|
|
7875
|
+
" (",
|
|
7876
|
+
subRowsCount,
|
|
7877
|
+
" items)"
|
|
7878
|
+
] })
|
|
7879
|
+
]
|
|
7880
|
+
},
|
|
7881
|
+
cell.id
|
|
7882
|
+
);
|
|
7883
|
+
}
|
|
7884
|
+
if (columnDef.aggregateFn && childRows.length > 0) {
|
|
7885
|
+
try {
|
|
7886
|
+
const aggregatedValue = columnDef.aggregateFn(childRows, columnDef);
|
|
7887
|
+
let cellContent;
|
|
7888
|
+
if (columnDef.aggregateCell) {
|
|
7889
|
+
cellContent = columnDef.aggregateCell(aggregatedValue, childRows, columnDef);
|
|
7890
|
+
} else if (columnDef.cell) {
|
|
7891
|
+
const mockCell = {
|
|
7892
|
+
...cell,
|
|
7893
|
+
getValue: () => aggregatedValue,
|
|
7894
|
+
renderValue: () => aggregatedValue
|
|
7895
|
+
};
|
|
7896
|
+
cellContent = flexRender2(columnDef.cell, {
|
|
7897
|
+
...mockCell,
|
|
7898
|
+
row,
|
|
7899
|
+
column: cell.column,
|
|
7900
|
+
cell: mockCell,
|
|
7901
|
+
getValue: () => aggregatedValue,
|
|
7902
|
+
renderValue: () => aggregatedValue
|
|
7903
|
+
});
|
|
7904
|
+
} else {
|
|
7905
|
+
cellContent = aggregatedValue != null ? String(aggregatedValue) : "";
|
|
7906
|
+
}
|
|
7907
|
+
return /* @__PURE__ */ jsx14(
|
|
7908
|
+
"td",
|
|
7944
7909
|
{
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
children:
|
|
7950
|
-
}
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
"
|
|
7957
|
-
|
|
7958
|
-
|
|
7910
|
+
className: getTableCellClasses({
|
|
7911
|
+
isCompact: true,
|
|
7912
|
+
className: `px-3 py-2 ${cell.column.columnDef.meta?.align === "right" ? "text-right" : ""}`
|
|
7913
|
+
}),
|
|
7914
|
+
children: cellContent
|
|
7915
|
+
},
|
|
7916
|
+
cell.id
|
|
7917
|
+
);
|
|
7918
|
+
} catch (error) {
|
|
7919
|
+
logger.warn("Error in aggregation function:", error);
|
|
7920
|
+
return /* @__PURE__ */ jsx14(
|
|
7921
|
+
"td",
|
|
7922
|
+
{
|
|
7923
|
+
className: getTableCellClasses({
|
|
7924
|
+
isCompact: true,
|
|
7925
|
+
className: "px-3 py-2"
|
|
7926
|
+
})
|
|
7927
|
+
},
|
|
7928
|
+
cell.id
|
|
7929
|
+
);
|
|
7930
|
+
}
|
|
7959
7931
|
}
|
|
7960
|
-
|
|
7932
|
+
return /* @__PURE__ */ jsx14(
|
|
7933
|
+
"td",
|
|
7934
|
+
{
|
|
7935
|
+
className: getTableCellClasses({
|
|
7936
|
+
isCompact: true,
|
|
7937
|
+
className: "px-3 py-2"
|
|
7938
|
+
})
|
|
7939
|
+
},
|
|
7940
|
+
cell.id
|
|
7941
|
+
);
|
|
7942
|
+
}) });
|
|
7961
7943
|
}
|
|
7962
7944
|
if (isEditing && editingData && onEditingDataChange && onSaveEditing && onCancelEditing) {
|
|
7963
7945
|
return /* @__PURE__ */ jsx14(
|
|
@@ -8076,53 +8058,13 @@ function UnifiedTableBody({
|
|
|
8076
8058
|
rbac,
|
|
8077
8059
|
permissions
|
|
8078
8060
|
}) {
|
|
8079
|
-
const logger =
|
|
8061
|
+
const logger = React11.useMemo(() => createLogger("UnifiedTableBody"), []);
|
|
8080
8062
|
const headerRef = useRef3(null);
|
|
8081
8063
|
const bodyRef = useRef3(null);
|
|
8082
8064
|
const parentRef = useRef3(null);
|
|
8083
8065
|
const shouldVirtualize = forceVirtualization || dataLength > VIRTUALIZATION_THRESHOLD;
|
|
8084
8066
|
const rows = table.getRowModel().rows;
|
|
8085
8067
|
const headerGroups = table.getHeaderGroups();
|
|
8086
|
-
useEffect3(() => {
|
|
8087
|
-
if (rows.length === 0 && dataLength > 0) {
|
|
8088
|
-
const tableState = table.getState();
|
|
8089
|
-
const pagination = tableState.pagination;
|
|
8090
|
-
const columnFilters = tableState.columnFilters;
|
|
8091
|
-
const globalFilter = tableState.globalFilter;
|
|
8092
|
-
const coreRows = table.getCoreRowModel().rows;
|
|
8093
|
-
const prePaginationRows = table.getPrePaginationRowModel?.()?.rows || [];
|
|
8094
|
-
const filteredRows = table.getFilteredRowModel?.()?.rows || [];
|
|
8095
|
-
const sortedRows = table.getSortedRowModel?.()?.rows || [];
|
|
8096
|
-
const rowCount = table.getRowCount();
|
|
8097
|
-
const pageCount = table.getPageCount();
|
|
8098
|
-
logger.warn("Rows empty but data exists!", {
|
|
8099
|
-
dataLength,
|
|
8100
|
-
rowsLength: rows.length,
|
|
8101
|
-
coreRowsLength: coreRows.length,
|
|
8102
|
-
prePaginationRowsLength: prePaginationRows.length,
|
|
8103
|
-
filteredRowsLength: filteredRows.length,
|
|
8104
|
-
sortedRowsLength: sortedRows.length,
|
|
8105
|
-
rowCount,
|
|
8106
|
-
pageCount,
|
|
8107
|
-
pagination: {
|
|
8108
|
-
pageIndex: pagination.pageIndex,
|
|
8109
|
-
pageSize: pagination.pageSize
|
|
8110
|
-
},
|
|
8111
|
-
columnFilters,
|
|
8112
|
-
globalFilter,
|
|
8113
|
-
tableOptions: {
|
|
8114
|
-
getCoreRowModel: !!table.options.getCoreRowModel,
|
|
8115
|
-
getFilteredRowModel: !!table.options.getFilteredRowModel,
|
|
8116
|
-
getSortedRowModel: !!table.options.getSortedRowModel,
|
|
8117
|
-
getPaginationRowModel: !!table.options.getPaginationRowModel,
|
|
8118
|
-
manualPagination: table.options.manualPagination,
|
|
8119
|
-
manualFiltering: table.options.manualFiltering,
|
|
8120
|
-
manualSorting: table.options.manualSorting
|
|
8121
|
-
},
|
|
8122
|
-
tableDataLength: table.options.data?.length || 0
|
|
8123
|
-
});
|
|
8124
|
-
}
|
|
8125
|
-
}, [rows.length, dataLength, table, logger]);
|
|
8126
8068
|
const hasScrollContainer = !!parentRef.current;
|
|
8127
8069
|
const effectiveShouldVirtualize = shouldVirtualize && hasScrollContainer;
|
|
8128
8070
|
const virtualizer = useVirtualizer({
|
|
@@ -8318,7 +8260,7 @@ function UnifiedTableBody({
|
|
|
8318
8260
|
}
|
|
8319
8261
|
|
|
8320
8262
|
// src/components/DataTable/components/PaginationControls.tsx
|
|
8321
|
-
import
|
|
8263
|
+
import React12 from "react";
|
|
8322
8264
|
import {
|
|
8323
8265
|
ChevronLeft,
|
|
8324
8266
|
ChevronRight as ChevronRight2,
|
|
@@ -8330,6 +8272,7 @@ import {
|
|
|
8330
8272
|
} from "lucide-react";
|
|
8331
8273
|
|
|
8332
8274
|
// src/components/DataTable/utils/paginationUtils.ts
|
|
8275
|
+
init_logger();
|
|
8333
8276
|
function getPaginationBinding(config) {
|
|
8334
8277
|
const { mode, table, serverData, totalCount, onPageChange, onPageSizeChange } = config;
|
|
8335
8278
|
const state = calculatePaginationState(config);
|
|
@@ -8555,6 +8498,7 @@ function PaginationControls({
|
|
|
8555
8498
|
selectedText: currentPageSize?.toString() || "10",
|
|
8556
8499
|
onValueChange: (value) => setPageSize(Number(value)),
|
|
8557
8500
|
disabled: isLoading,
|
|
8501
|
+
direction: "up",
|
|
8558
8502
|
className: "w-36 h-8",
|
|
8559
8503
|
children: [
|
|
8560
8504
|
/* @__PURE__ */ jsx15(
|
|
@@ -8641,7 +8585,7 @@ function EnhancedPaginationControls({
|
|
|
8641
8585
|
showJumpToPage = false,
|
|
8642
8586
|
...props
|
|
8643
8587
|
}) {
|
|
8644
|
-
const [jumpToPage, setJumpToPage] =
|
|
8588
|
+
const [jumpToPage, setJumpToPage] = React12.useState("");
|
|
8645
8589
|
const { table, paginationMode = "client", serverData, onPageChange, totalCount } = props;
|
|
8646
8590
|
const pagination = getPaginationBinding({
|
|
8647
8591
|
mode: paginationMode,
|
|
@@ -8692,73 +8636,15 @@ function LoadingState() {
|
|
|
8692
8636
|
}
|
|
8693
8637
|
|
|
8694
8638
|
// src/components/DataTable/components/DataTableModals.tsx
|
|
8695
|
-
import
|
|
8639
|
+
import React16, { useEffect as useEffect6 } from "react";
|
|
8696
8640
|
|
|
8697
8641
|
// src/components/DataTable/components/ImportModal.tsx
|
|
8698
8642
|
import { useState as useState4, useRef as useRef4, useEffect as useEffect5 } from "react";
|
|
8699
8643
|
|
|
8700
8644
|
// src/components/Dialog/Dialog.tsx
|
|
8701
|
-
import * as
|
|
8645
|
+
import * as React13 from "react";
|
|
8702
8646
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
8703
8647
|
import { X as X4 } from "lucide-react";
|
|
8704
|
-
|
|
8705
|
-
// src/components/Dialog/utils/safeHtml.ts
|
|
8706
|
-
function sanitizeHtml(html) {
|
|
8707
|
-
if (!html || typeof html !== "string") {
|
|
8708
|
-
return "";
|
|
8709
|
-
}
|
|
8710
|
-
console.log("\u{1F50D} sanitizeHtml input:", html);
|
|
8711
|
-
let sanitized = html.replace(/<script\b[^>]*>.*?<\/script>/gi, "").replace(/<script\b[^>]*\/>/gi, "").replace(/<iframe\b[^>]*>.*?<\/iframe>/gi, "").replace(/<iframe\b[^>]*\/>/gi, "").replace(/<object\b[^>]*>.*?<\/object>/gi, "").replace(/<object\b[^>]*\/>/gi, "").replace(/<embed\b[^>]*\/?>/gi, "").replace(/<form\b[^>]*>.*?<\/form>/gi, "").replace(/<form\b[^>]*\/>/gi, "").replace(/<input\b[^>]*\/?>/gi, "").replace(/<button\b[^>]*>.*?<\/button>/gi, "").replace(/<button\b[^>]*\/>/gi, "").replace(/\s*on\w+\s*=\s*["'][^"']*["']/gi, "").replace(/javascript:[^"'\s>]*/gi, "").replace(/data:[^"'\s>]*/gi, "");
|
|
8712
|
-
console.log("\u{1F50D} sanitizeHtml output:", sanitized);
|
|
8713
|
-
return sanitized;
|
|
8714
|
-
}
|
|
8715
|
-
function validateHtml(html) {
|
|
8716
|
-
const warnings = [];
|
|
8717
|
-
if (!html || typeof html !== "string") {
|
|
8718
|
-
return { isValid: false, warnings: ["HTML content must be a non-empty string"] };
|
|
8719
|
-
}
|
|
8720
|
-
const dangerousPatterns = [
|
|
8721
|
-
{ pattern: /<script\b[^>]*>.*?<\/script>/gi, message: "Script tags are not allowed" },
|
|
8722
|
-
{ pattern: /<script\b[^>]*\/>/gi, message: "Script tags are not allowed" },
|
|
8723
|
-
{ pattern: /<iframe\b[^>]*>.*?<\/iframe>/gi, message: "Iframe tags are not allowed" },
|
|
8724
|
-
{ pattern: /<iframe\b[^>]*\/>/gi, message: "Iframe tags are not allowed" },
|
|
8725
|
-
{ pattern: /<object\b[^>]*>.*?<\/object>/gi, message: "Object tags are not allowed" },
|
|
8726
|
-
{ pattern: /<object\b[^>]*\/>/gi, message: "Object tags are not allowed" },
|
|
8727
|
-
{ pattern: /<embed\b[^>]*\/?>/gi, message: "Embed tags are not allowed" },
|
|
8728
|
-
{ pattern: /<form\b[^>]*>.*?<\/form>/gi, message: "Form tags are not allowed" },
|
|
8729
|
-
{ pattern: /<form\b[^>]*\/>/gi, message: "Form tags are not allowed" },
|
|
8730
|
-
{ pattern: /<input\b[^>]*\/?>/gi, message: "Input tags are not allowed" },
|
|
8731
|
-
{ pattern: /<button\b[^>]*>.*?<\/button>/gi, message: "Button tags are not allowed" },
|
|
8732
|
-
{ pattern: /<button\b[^>]*\/>/gi, message: "Button tags are not allowed" },
|
|
8733
|
-
{ pattern: /on\w+\s*=/gi, message: "Event handlers are not allowed" },
|
|
8734
|
-
{ pattern: /javascript:/gi, message: "JavaScript protocols are not allowed" },
|
|
8735
|
-
{ pattern: /data:/gi, message: "Data protocols are not allowed" }
|
|
8736
|
-
];
|
|
8737
|
-
dangerousPatterns.forEach(({ pattern, message }) => {
|
|
8738
|
-
if (pattern.test(html)) {
|
|
8739
|
-
warnings.push(message);
|
|
8740
|
-
}
|
|
8741
|
-
});
|
|
8742
|
-
return {
|
|
8743
|
-
isValid: warnings.length === 0,
|
|
8744
|
-
warnings
|
|
8745
|
-
};
|
|
8746
|
-
}
|
|
8747
|
-
function renderSafeHtml(html, options = {}) {
|
|
8748
|
-
const { strict = true, logWarnings = false } = options;
|
|
8749
|
-
const validation = validateHtml(html);
|
|
8750
|
-
const sanitizedHtml = sanitizeHtml(html);
|
|
8751
|
-
if (logWarnings && validation.warnings.length > 0) {
|
|
8752
|
-
console.warn("Dialog HTML content warnings:", validation.warnings);
|
|
8753
|
-
}
|
|
8754
|
-
return {
|
|
8755
|
-
html: sanitizedHtml,
|
|
8756
|
-
isValid: validation.isValid,
|
|
8757
|
-
warnings: validation.warnings
|
|
8758
|
-
};
|
|
8759
|
-
}
|
|
8760
|
-
|
|
8761
|
-
// src/components/Dialog/Dialog.tsx
|
|
8762
8648
|
var import_lodash = __toESM(require_lodash(), 1);
|
|
8763
8649
|
import { useState as useState3, useEffect as useEffect4 } from "react";
|
|
8764
8650
|
import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
@@ -8774,7 +8660,7 @@ var Dialog = DialogPrimitive.Root;
|
|
|
8774
8660
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
8775
8661
|
var DialogPortal = DialogPrimitive.Portal;
|
|
8776
8662
|
var DialogClose = DialogPrimitive.Close;
|
|
8777
|
-
var DialogOverlay =
|
|
8663
|
+
var DialogOverlay = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
8778
8664
|
DialogPrimitive.Overlay,
|
|
8779
8665
|
{
|
|
8780
8666
|
ref,
|
|
@@ -8851,7 +8737,7 @@ var useSmartDimensions = ({
|
|
|
8851
8737
|
}
|
|
8852
8738
|
return result;
|
|
8853
8739
|
};
|
|
8854
|
-
var DialogContent =
|
|
8740
|
+
var DialogContent = React13.forwardRef(({
|
|
8855
8741
|
className,
|
|
8856
8742
|
children,
|
|
8857
8743
|
size = "md",
|
|
@@ -8878,17 +8764,17 @@ var DialogContent = React12.forwardRef(({
|
|
|
8878
8764
|
minWidth,
|
|
8879
8765
|
enableScrolling
|
|
8880
8766
|
});
|
|
8881
|
-
const handleEscapeKeyDown =
|
|
8767
|
+
const handleEscapeKeyDown = React13.useCallback((event) => {
|
|
8882
8768
|
if (preventCloseOnEscape) {
|
|
8883
8769
|
event.preventDefault();
|
|
8884
8770
|
}
|
|
8885
8771
|
}, [preventCloseOnEscape]);
|
|
8886
|
-
const handlePointerDownOutside =
|
|
8772
|
+
const handlePointerDownOutside = React13.useCallback((event) => {
|
|
8887
8773
|
if (preventCloseOnOutsideClick) {
|
|
8888
8774
|
event.preventDefault();
|
|
8889
8775
|
}
|
|
8890
8776
|
}, [preventCloseOnOutsideClick]);
|
|
8891
|
-
const mergedStyle =
|
|
8777
|
+
const mergedStyle = React13.useMemo(() => {
|
|
8892
8778
|
if (Object.keys(smartDimensions).length === 0) {
|
|
8893
8779
|
return style;
|
|
8894
8780
|
}
|
|
@@ -8966,13 +8852,13 @@ var DialogBody = ({
|
|
|
8966
8852
|
children,
|
|
8967
8853
|
...props
|
|
8968
8854
|
}) => {
|
|
8969
|
-
const mergedStyle =
|
|
8855
|
+
const mergedStyle = React13.useMemo(() => {
|
|
8970
8856
|
return {
|
|
8971
8857
|
...maxHeight && { maxHeight },
|
|
8972
8858
|
...style
|
|
8973
8859
|
};
|
|
8974
8860
|
}, [maxHeight, style]);
|
|
8975
|
-
const processedHtmlContent =
|
|
8861
|
+
const processedHtmlContent = React13.useMemo(() => {
|
|
8976
8862
|
if (!htmlContent || !allowHtml) {
|
|
8977
8863
|
return null;
|
|
8978
8864
|
}
|
|
@@ -9025,8 +8911,8 @@ var DialogFooter = ({
|
|
|
9025
8911
|
}
|
|
9026
8912
|
);
|
|
9027
8913
|
DialogFooter.displayName = "DialogFooter";
|
|
9028
|
-
var DialogTitle =
|
|
9029
|
-
const processedHtmlContent =
|
|
8914
|
+
var DialogTitle = React13.forwardRef(({ className, htmlContent, allowHtml = true, children, ...props }, ref) => {
|
|
8915
|
+
const processedHtmlContent = React13.useMemo(() => {
|
|
9030
8916
|
if (!htmlContent || !allowHtml) {
|
|
9031
8917
|
return null;
|
|
9032
8918
|
}
|
|
@@ -9049,8 +8935,8 @@ var DialogTitle = React12.forwardRef(({ className, htmlContent, allowHtml = true
|
|
|
9049
8935
|
);
|
|
9050
8936
|
});
|
|
9051
8937
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
9052
|
-
var DialogDescription =
|
|
9053
|
-
const processedHtmlContent =
|
|
8938
|
+
var DialogDescription = React13.forwardRef(({ className, htmlContent, allowHtml = true, children, ...props }, ref) => {
|
|
8939
|
+
const processedHtmlContent = React13.useMemo(() => {
|
|
9054
8940
|
if (!htmlContent || !allowHtml) {
|
|
9055
8941
|
return null;
|
|
9056
8942
|
}
|
|
@@ -9073,10 +8959,10 @@ var DialogDescription = React12.forwardRef(({ className, htmlContent, allowHtml
|
|
|
9073
8959
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
9074
8960
|
|
|
9075
8961
|
// src/components/Progress/Progress.tsx
|
|
9076
|
-
import * as
|
|
8962
|
+
import * as React14 from "react";
|
|
9077
8963
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
9078
8964
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
9079
|
-
var Progress =
|
|
8965
|
+
var Progress = React14.forwardRef(({ className, value, max: max2 = 100, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
9080
8966
|
ProgressPrimitive.Root,
|
|
9081
8967
|
{
|
|
9082
8968
|
ref,
|
|
@@ -9086,9 +8972,9 @@ var Progress = React13.forwardRef(({ className, value, max = 100, ...props }, re
|
|
|
9086
8972
|
),
|
|
9087
8973
|
...props,
|
|
9088
8974
|
value,
|
|
9089
|
-
max,
|
|
8975
|
+
max: max2,
|
|
9090
8976
|
"aria-valuenow": value,
|
|
9091
|
-
"aria-valuemax":
|
|
8977
|
+
"aria-valuemax": max2,
|
|
9092
8978
|
"aria-valuemin": 0,
|
|
9093
8979
|
children: /* @__PURE__ */ jsx18(
|
|
9094
8980
|
ProgressPrimitive.Indicator,
|
|
@@ -9102,6 +8988,7 @@ var Progress = React13.forwardRef(({ className, value, max = 100, ...props }, re
|
|
|
9102
8988
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
9103
8989
|
|
|
9104
8990
|
// src/components/DataTable/components/ImportModal.tsx
|
|
8991
|
+
init_logger();
|
|
9105
8992
|
import { Upload as Upload2, FileText, AlertCircle } from "lucide-react";
|
|
9106
8993
|
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
9107
8994
|
function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
@@ -9146,10 +9033,7 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9146
9033
|
totalRowsText = "Total rows to import: {count}"
|
|
9147
9034
|
} = config;
|
|
9148
9035
|
const processCSV = (csvText) => {
|
|
9149
|
-
logger.debug("Raw CSV text:", csvText.substring(0, 200) + "...");
|
|
9150
9036
|
const lines = csvText.split("\n").filter((line) => line.trim());
|
|
9151
|
-
logger.debug("CSV lines count:", lines.length);
|
|
9152
|
-
logger.debug("First few lines:", lines.slice(0, 3));
|
|
9153
9037
|
if (lines.length < 2) {
|
|
9154
9038
|
throw new Error("CSV must have at least a header row and one data row");
|
|
9155
9039
|
}
|
|
@@ -9172,17 +9056,14 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9172
9056
|
return result;
|
|
9173
9057
|
};
|
|
9174
9058
|
const headers = parseCSVLine(lines[0]).map((h) => h.replace(/"/g, "").trim());
|
|
9175
|
-
|
|
9176
|
-
const data = lines.slice(1).map((line, index) => {
|
|
9059
|
+
const data = lines.slice(1).map((line) => {
|
|
9177
9060
|
const values = parseCSVLine(line).map((v) => v.replace(/"/g, "").trim());
|
|
9178
9061
|
const row = {};
|
|
9179
9062
|
headers.forEach((header, colIndex) => {
|
|
9180
9063
|
row[header] = values[colIndex] || "";
|
|
9181
9064
|
});
|
|
9182
|
-
logger.debug(`Row ${index + 1}:`, row);
|
|
9183
9065
|
return row;
|
|
9184
9066
|
});
|
|
9185
|
-
logger.debug("Final parsed data:", data);
|
|
9186
9067
|
return data;
|
|
9187
9068
|
};
|
|
9188
9069
|
const handleImport = async () => {
|
|
@@ -9293,20 +9174,15 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9293
9174
|
};
|
|
9294
9175
|
const handleFileSelect = async (event) => {
|
|
9295
9176
|
const selectedFile = event.target.files?.[0];
|
|
9296
|
-
logger.debug("File selected:", selectedFile?.name);
|
|
9297
9177
|
if (selectedFile) {
|
|
9298
9178
|
setFile(selectedFile);
|
|
9299
9179
|
setError(null);
|
|
9300
9180
|
setValidationErrors([]);
|
|
9301
9181
|
try {
|
|
9302
9182
|
const text = await selectedFile.text();
|
|
9303
|
-
logger.debug("File content length:", text.length);
|
|
9304
9183
|
const data = processCSV(text);
|
|
9305
|
-
logger.debug("Parsed CSV data:", data.length, "rows");
|
|
9306
|
-
logger.debug("Setting preview data:", data.slice(0, 5));
|
|
9307
9184
|
setPreviewData(data.slice(0, 5));
|
|
9308
9185
|
setTotalCount(data.length);
|
|
9309
|
-
logger.debug("Preview data state should be updated");
|
|
9310
9186
|
} catch (err) {
|
|
9311
9187
|
logger.error("CSV parsing error:", err);
|
|
9312
9188
|
setError(err instanceof Error ? err.message : "Failed to preview file");
|
|
@@ -9423,30 +9299,26 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9423
9299
|
}
|
|
9424
9300
|
|
|
9425
9301
|
// src/components/DataTable/components/DataTableModals.tsx
|
|
9302
|
+
init_logger();
|
|
9426
9303
|
import { Fragment as Fragment4, jsx as jsx20 } from "react/jsx-runtime";
|
|
9427
9304
|
function mapCSVToTableColumns(csvData, columns) {
|
|
9428
9305
|
const logger = createLogger("mapCSVToTableColumns");
|
|
9429
9306
|
const columnMap = /* @__PURE__ */ new Map();
|
|
9430
|
-
logger.debug("Building column map from", columns.length, "column definitions");
|
|
9431
9307
|
columns.forEach((col) => {
|
|
9432
9308
|
const fieldName = col.editAccessorKey || col.accessorKey || col.id;
|
|
9433
9309
|
const header = typeof col.header === "string" ? col.header : "";
|
|
9434
9310
|
if (fieldName && header) {
|
|
9435
9311
|
const headerLower = header.toLowerCase();
|
|
9436
9312
|
columnMap.set(headerLower, fieldName);
|
|
9437
|
-
logger.debug(`Mapped "${header}" -> "${fieldName}"`);
|
|
9438
9313
|
const colId = col.id || col.accessorKey;
|
|
9439
9314
|
if (colId && colId !== header && colId !== fieldName) {
|
|
9440
9315
|
columnMap.set(colId.toLowerCase(), fieldName);
|
|
9441
|
-
logger.debug(`Also mapped "${colId}" -> "${fieldName}"`);
|
|
9442
9316
|
}
|
|
9443
9317
|
if (col.editAccessorKey && header) {
|
|
9444
9318
|
const editAccessorKey = col.editAccessorKey;
|
|
9445
9319
|
const idColumnHeader = `${header} (ID)`;
|
|
9446
9320
|
columnMap.set(idColumnHeader.toLowerCase(), editAccessorKey);
|
|
9447
|
-
logger.debug(`Mapped ID column "${idColumnHeader}" -> "${editAccessorKey}"`);
|
|
9448
9321
|
columnMap.set(editAccessorKey.toLowerCase(), editAccessorKey);
|
|
9449
|
-
logger.debug(`Also mapped "${editAccessorKey}" -> "${editAccessorKey}"`);
|
|
9450
9322
|
}
|
|
9451
9323
|
} else {
|
|
9452
9324
|
logger.warn("Skipping column with missing fieldName or header:", col);
|
|
@@ -9456,9 +9328,6 @@ function mapCSVToTableColumns(csvData, columns) {
|
|
|
9456
9328
|
logger.warn("No CSV data to map");
|
|
9457
9329
|
return [];
|
|
9458
9330
|
}
|
|
9459
|
-
const csvHeaders = Object.keys(csvData[0]);
|
|
9460
|
-
logger.debug("CSV headers found:", csvHeaders);
|
|
9461
|
-
logger.debug("Column map size:", columnMap.size);
|
|
9462
9331
|
const mappedData = csvData.map((row, index) => {
|
|
9463
9332
|
const mappedRow = {};
|
|
9464
9333
|
Object.keys(row).forEach((csvHeader) => {
|
|
@@ -9469,18 +9338,12 @@ function mapCSVToTableColumns(csvData, columns) {
|
|
|
9469
9338
|
const keyWithSpace = ` ${mapKey}`;
|
|
9470
9339
|
if (csvHeaderLower === mapKey || csvHeaderLower.endsWith(keyWithSpace)) {
|
|
9471
9340
|
fieldName = mapValue;
|
|
9472
|
-
if (index === 0) {
|
|
9473
|
-
logger.debug(`Flexible match: "${csvHeader}" -> "${mapValue}" (matched "${mapKey}")`);
|
|
9474
|
-
}
|
|
9475
9341
|
break;
|
|
9476
9342
|
}
|
|
9477
9343
|
}
|
|
9478
9344
|
}
|
|
9479
9345
|
if (fieldName) {
|
|
9480
9346
|
mappedRow[fieldName] = row[csvHeader];
|
|
9481
|
-
if (index === 0) {
|
|
9482
|
-
logger.debug(`Row 0: "${csvHeader}" -> "${fieldName}"`);
|
|
9483
|
-
}
|
|
9484
9347
|
} else {
|
|
9485
9348
|
mappedRow[csvHeaderLower] = row[csvHeader];
|
|
9486
9349
|
if (index === 0) {
|
|
@@ -9490,10 +9353,6 @@ function mapCSVToTableColumns(csvData, columns) {
|
|
|
9490
9353
|
});
|
|
9491
9354
|
return mappedRow;
|
|
9492
9355
|
});
|
|
9493
|
-
logger.debug("Mapped", mappedData.length, "rows");
|
|
9494
|
-
if (mappedData.length > 0) {
|
|
9495
|
-
logger.debug("First mapped row keys:", Object.keys(mappedData[0]));
|
|
9496
|
-
}
|
|
9497
9356
|
return mappedData;
|
|
9498
9357
|
}
|
|
9499
9358
|
function DataTableModals({
|
|
@@ -9505,7 +9364,7 @@ function DataTableModals({
|
|
|
9505
9364
|
onStoreFocus,
|
|
9506
9365
|
onRestoreFocus
|
|
9507
9366
|
}) {
|
|
9508
|
-
const logger =
|
|
9367
|
+
const logger = React16.useMemo(() => createLogger("DataTableModals"), []);
|
|
9509
9368
|
useEffect6(() => {
|
|
9510
9369
|
if (showImportModal) {
|
|
9511
9370
|
onStoreFocus?.();
|
|
@@ -9525,10 +9384,7 @@ function DataTableModals({
|
|
|
9525
9384
|
try {
|
|
9526
9385
|
let mappedData;
|
|
9527
9386
|
if (columns && columns.length > 0) {
|
|
9528
|
-
logger.debug("Mapping CSV data with", columns.length, "column definitions");
|
|
9529
|
-
logger.debug("Raw CSV headers:", rawData.length > 0 ? Object.keys(rawData[0]) : []);
|
|
9530
9387
|
mappedData = mapCSVToTableColumns(rawData, columns);
|
|
9531
|
-
logger.debug("Mapped data sample:", mappedData.length > 0 ? mappedData[0] : null);
|
|
9532
9388
|
} else {
|
|
9533
9389
|
logger.warn("No columns provided for mapping, using raw data");
|
|
9534
9390
|
mappedData = rawData;
|
|
@@ -9537,12 +9393,10 @@ function DataTableModals({
|
|
|
9537
9393
|
logger.error("onImport callback is not provided");
|
|
9538
9394
|
throw new Error("Import handler is not configured. Please provide an onImport callback.");
|
|
9539
9395
|
}
|
|
9540
|
-
logger.debug("Calling onImport with", mappedData.length, "rows");
|
|
9541
9396
|
const result = onImport(mappedData);
|
|
9542
9397
|
if (result && typeof result.then === "function") {
|
|
9543
9398
|
await result;
|
|
9544
9399
|
}
|
|
9545
|
-
logger.debug("Import completed successfully");
|
|
9546
9400
|
} catch (error) {
|
|
9547
9401
|
logger.error("Import error:", error);
|
|
9548
9402
|
throw error;
|
|
@@ -9554,12 +9408,12 @@ function DataTableModals({
|
|
|
9554
9408
|
}
|
|
9555
9409
|
|
|
9556
9410
|
// src/components/DataTable/components/DataTableErrorBoundary.tsx
|
|
9557
|
-
import
|
|
9411
|
+
import React18, { Component } from "react";
|
|
9558
9412
|
|
|
9559
9413
|
// src/components/Alert/Alert.tsx
|
|
9560
|
-
import * as
|
|
9414
|
+
import * as React17 from "react";
|
|
9561
9415
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
9562
|
-
var AlertContext =
|
|
9416
|
+
var AlertContext = React17.createContext({ variant: "default" });
|
|
9563
9417
|
var getAlertClasses = (variant = "default") => {
|
|
9564
9418
|
const baseClasses = "relative w-full rounded-lg border p-4";
|
|
9565
9419
|
const variantClasses = {
|
|
@@ -9570,10 +9424,10 @@ var getAlertClasses = (variant = "default") => {
|
|
|
9570
9424
|
};
|
|
9571
9425
|
return `${baseClasses} ${variantClasses[variant]}`;
|
|
9572
9426
|
};
|
|
9573
|
-
var Alert =
|
|
9574
|
-
const contextValue =
|
|
9427
|
+
var Alert = React17.forwardRef(({ className, variant = "default", ...props }, ref) => {
|
|
9428
|
+
const contextValue = React17.useMemo(() => ({ variant }), [variant]);
|
|
9575
9429
|
if (variant === "inline") {
|
|
9576
|
-
return /* @__PURE__ */ jsx21(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx21(
|
|
9430
|
+
return /* @__PURE__ */ jsx21(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx21(React17.Fragment, { ...props }) });
|
|
9577
9431
|
}
|
|
9578
9432
|
return /* @__PURE__ */ jsx21(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx21(
|
|
9579
9433
|
"div",
|
|
@@ -9586,8 +9440,8 @@ var Alert = React16.forwardRef(({ className, variant = "default", ...props }, re
|
|
|
9586
9440
|
) });
|
|
9587
9441
|
});
|
|
9588
9442
|
Alert.displayName = "Alert";
|
|
9589
|
-
var AlertTitle =
|
|
9590
|
-
const { variant } =
|
|
9443
|
+
var AlertTitle = React17.forwardRef(({ className, ...props }, ref) => {
|
|
9444
|
+
const { variant } = React17.useContext(AlertContext);
|
|
9591
9445
|
if (variant === "inline") {
|
|
9592
9446
|
return /* @__PURE__ */ jsx21("strong", { ...props });
|
|
9593
9447
|
}
|
|
@@ -9601,8 +9455,8 @@ var AlertTitle = React16.forwardRef(({ className, ...props }, ref) => {
|
|
|
9601
9455
|
);
|
|
9602
9456
|
});
|
|
9603
9457
|
AlertTitle.displayName = "AlertTitle";
|
|
9604
|
-
var AlertDescription =
|
|
9605
|
-
const { variant } =
|
|
9458
|
+
var AlertDescription = React17.forwardRef(({ className, ...props }, ref) => {
|
|
9459
|
+
const { variant } = React17.useContext(AlertContext);
|
|
9606
9460
|
if (variant === "inline") {
|
|
9607
9461
|
return /* @__PURE__ */ jsx21("span", { ...props });
|
|
9608
9462
|
}
|
|
@@ -9618,6 +9472,7 @@ var AlertDescription = React16.forwardRef(({ className, ...props }, ref) => {
|
|
|
9618
9472
|
AlertDescription.displayName = "AlertDescription";
|
|
9619
9473
|
|
|
9620
9474
|
// src/components/DataTable/components/DataTableErrorBoundary.tsx
|
|
9475
|
+
init_logger();
|
|
9621
9476
|
import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
9622
9477
|
var DataTableErrorBoundary = class extends Component {
|
|
9623
9478
|
constructor(props) {
|
|
@@ -9737,6 +9592,7 @@ var DataTableErrorBoundary = class extends Component {
|
|
|
9737
9592
|
};
|
|
9738
9593
|
|
|
9739
9594
|
// src/components/DataTable/hooks/useColumnOrderPersistence.ts
|
|
9595
|
+
init_logger();
|
|
9740
9596
|
import { useState as useState5, useEffect as useEffect7, useCallback as useCallback4 } from "react";
|
|
9741
9597
|
function useColumnOrderPersistence({
|
|
9742
9598
|
tableId,
|
|
@@ -9817,6 +9673,7 @@ function useColumnOrderPersistence({
|
|
|
9817
9673
|
}
|
|
9818
9674
|
|
|
9819
9675
|
// src/components/DataTable/hooks/useColumnVisibilityPersistence.ts
|
|
9676
|
+
init_logger();
|
|
9820
9677
|
import { useState as useState6, useEffect as useEffect8, useCallback as useCallback5 } from "react";
|
|
9821
9678
|
function useColumnVisibilityPersistence({
|
|
9822
9679
|
tableId,
|
|
@@ -10577,7 +10434,7 @@ function useDataTableConfiguration({
|
|
|
10577
10434
|
}
|
|
10578
10435
|
|
|
10579
10436
|
// src/components/Card/Card.tsx
|
|
10580
|
-
import * as
|
|
10437
|
+
import * as React19 from "react";
|
|
10581
10438
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
10582
10439
|
function getCardClasses(variant = "default", size = "default") {
|
|
10583
10440
|
const baseClasses = "rounded-lg border bg-card text-card-foreground shadow-sm";
|
|
@@ -10593,7 +10450,7 @@ function getCardClasses(variant = "default", size = "default") {
|
|
|
10593
10450
|
};
|
|
10594
10451
|
return `${baseClasses} ${variantClasses[variant]} ${sizeClasses2[size]}`;
|
|
10595
10452
|
}
|
|
10596
|
-
var Card =
|
|
10453
|
+
var Card = React19.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10597
10454
|
"article",
|
|
10598
10455
|
{
|
|
10599
10456
|
ref,
|
|
@@ -10606,7 +10463,7 @@ var Card = React18.forwardRef(({ className, variant, size, ...props }, ref) => /
|
|
|
10606
10463
|
}
|
|
10607
10464
|
));
|
|
10608
10465
|
Card.displayName = "Card";
|
|
10609
|
-
var CardHeader =
|
|
10466
|
+
var CardHeader = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10610
10467
|
"header",
|
|
10611
10468
|
{
|
|
10612
10469
|
ref,
|
|
@@ -10615,7 +10472,7 @@ var CardHeader = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
10615
10472
|
}
|
|
10616
10473
|
));
|
|
10617
10474
|
CardHeader.displayName = "CardHeader";
|
|
10618
|
-
var CardTitle =
|
|
10475
|
+
var CardTitle = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10619
10476
|
"h3",
|
|
10620
10477
|
{
|
|
10621
10478
|
ref,
|
|
@@ -10627,7 +10484,7 @@ var CardTitle = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
10627
10484
|
}
|
|
10628
10485
|
));
|
|
10629
10486
|
CardTitle.displayName = "CardTitle";
|
|
10630
|
-
var CardDescription =
|
|
10487
|
+
var CardDescription = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10631
10488
|
"p",
|
|
10632
10489
|
{
|
|
10633
10490
|
ref,
|
|
@@ -10636,7 +10493,7 @@ var CardDescription = React18.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
10636
10493
|
}
|
|
10637
10494
|
));
|
|
10638
10495
|
CardDescription.displayName = "CardDescription";
|
|
10639
|
-
var CardContent =
|
|
10496
|
+
var CardContent = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10640
10497
|
"main",
|
|
10641
10498
|
{
|
|
10642
10499
|
ref,
|
|
@@ -10645,7 +10502,7 @@ var CardContent = React18.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
10645
10502
|
}
|
|
10646
10503
|
));
|
|
10647
10504
|
CardContent.displayName = "CardContent";
|
|
10648
|
-
var CardFooter =
|
|
10505
|
+
var CardFooter = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10649
10506
|
"footer",
|
|
10650
10507
|
{
|
|
10651
10508
|
ref,
|
|
@@ -10654,7 +10511,7 @@ var CardFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
10654
10511
|
}
|
|
10655
10512
|
));
|
|
10656
10513
|
CardFooter.displayName = "CardFooter";
|
|
10657
|
-
var CardActions =
|
|
10514
|
+
var CardActions = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10658
10515
|
"nav",
|
|
10659
10516
|
{
|
|
10660
10517
|
ref,
|
|
@@ -10665,7 +10522,7 @@ var CardActions = React18.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
10665
10522
|
}
|
|
10666
10523
|
));
|
|
10667
10524
|
CardActions.displayName = "CardActions";
|
|
10668
|
-
var HoverCard =
|
|
10525
|
+
var HoverCard = React19.forwardRef(({ children, className, ...props }, ref) => {
|
|
10669
10526
|
return /* @__PURE__ */ jsx23(
|
|
10670
10527
|
"section",
|
|
10671
10528
|
{
|
|
@@ -10677,7 +10534,7 @@ var HoverCard = React18.forwardRef(({ children, className, ...props }, ref) => {
|
|
|
10677
10534
|
);
|
|
10678
10535
|
});
|
|
10679
10536
|
HoverCard.displayName = "HoverCard";
|
|
10680
|
-
var HoverCardTrigger =
|
|
10537
|
+
var HoverCardTrigger = React19.forwardRef(({ className, asChild, children, ...props }, ref) => {
|
|
10681
10538
|
if (asChild) {
|
|
10682
10539
|
return /* @__PURE__ */ jsx23("span", { className: cn("cursor-pointer", className), children });
|
|
10683
10540
|
}
|
|
@@ -10696,7 +10553,7 @@ var HoverCardTrigger = React18.forwardRef(({ className, asChild, children, ...pr
|
|
|
10696
10553
|
);
|
|
10697
10554
|
});
|
|
10698
10555
|
HoverCardTrigger.displayName = "HoverCardTrigger";
|
|
10699
|
-
var HoverCardContent =
|
|
10556
|
+
var HoverCardContent = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10700
10557
|
"aside",
|
|
10701
10558
|
{
|
|
10702
10559
|
ref,
|
|
@@ -10784,6 +10641,7 @@ function AccessDeniedPage({
|
|
|
10784
10641
|
}
|
|
10785
10642
|
|
|
10786
10643
|
// src/components/DataTable/utils/exportUtils.ts
|
|
10644
|
+
init_logger();
|
|
10787
10645
|
function escapeCSVValue(value, sanitizeForSecurity = true) {
|
|
10788
10646
|
if (value === null || value === void 0) {
|
|
10789
10647
|
return sanitizeForSecurity ? '""' : "";
|
|
@@ -10963,6 +10821,7 @@ init_UnifiedAuthProvider();
|
|
|
10963
10821
|
// src/components/DataTable/hooks/useDataTablePermissions.ts
|
|
10964
10822
|
init_UnifiedAuthProvider();
|
|
10965
10823
|
import { useMemo as useMemo12, useRef as useRef5 } from "react";
|
|
10824
|
+
init_logger();
|
|
10966
10825
|
|
|
10967
10826
|
// src/components/DataTable/types.ts
|
|
10968
10827
|
var defaultDataTableFeatures = {
|
|
@@ -11000,14 +10859,7 @@ function useDataTablePermissions(rbac, features = {}) {
|
|
|
11000
10859
|
throw new Error("DataTable requires either rbac.pageId or rbac.pageName for permission checking");
|
|
11001
10860
|
}
|
|
11002
10861
|
const effectivePageId = pageId || pageName;
|
|
11003
|
-
const { selectedOrganisation, selectedEvent, supabase
|
|
11004
|
-
logger.debug("Organisation context:", {
|
|
11005
|
-
hasSelectedOrg: !!selectedOrganisation,
|
|
11006
|
-
selectedOrgId: selectedOrganisation?.id,
|
|
11007
|
-
hasOrganisations: organisations?.length > 0,
|
|
11008
|
-
organisationCount: organisations?.length,
|
|
11009
|
-
selectedEvent: selectedEvent?.event_id
|
|
11010
|
-
});
|
|
10862
|
+
const { selectedOrganisation, selectedEvent, supabase } = useUnifiedAuth();
|
|
11011
10863
|
const { resolvedScope: rawResolvedScope, isLoading: scopeLoading } = useResolvedScope({
|
|
11012
10864
|
supabase,
|
|
11013
10865
|
selectedOrganisationId: selectedOrganisation?.id || null,
|
|
@@ -11052,16 +10904,6 @@ function useDataTablePermissions(rbac, features = {}) {
|
|
|
11052
10904
|
canImport: useCan(userId, consistentScope, createPermission, effectivePageId, true)
|
|
11053
10905
|
// Use create permission for import
|
|
11054
10906
|
};
|
|
11055
|
-
logger.debug("Permission check results:", {
|
|
11056
|
-
canRead: permissions.canRead.can,
|
|
11057
|
-
canReadLoading: permissions.canRead.isLoading,
|
|
11058
|
-
canReadError: permissions.canRead.error?.message,
|
|
11059
|
-
canCreate: permissions.canCreate.can,
|
|
11060
|
-
pageName: effectivePageId,
|
|
11061
|
-
scope: consistentScope,
|
|
11062
|
-
hasValidScope: !!effectiveScope,
|
|
11063
|
-
scopeLoading
|
|
11064
|
-
});
|
|
11065
10907
|
const normalizedFeatures = useMemo12(
|
|
11066
10908
|
() => normalizeDataTableFeatures(features),
|
|
11067
10909
|
[features]
|
|
@@ -11083,7 +10925,7 @@ function useDataTablePermissions(rbac, features = {}) {
|
|
|
11083
10925
|
}
|
|
11084
10926
|
|
|
11085
10927
|
// src/components/DataTable/hooks/useTableColumns.ts
|
|
11086
|
-
import
|
|
10928
|
+
import React20, { useMemo as useMemo13 } from "react";
|
|
11087
10929
|
|
|
11088
10930
|
// src/components/DataTable/core/ColumnFactory.ts
|
|
11089
10931
|
var ColumnFactory = class {
|
|
@@ -11289,14 +11131,14 @@ function useTableColumns({
|
|
|
11289
11131
|
header: ({ table }) => {
|
|
11290
11132
|
const isAllSelected = table.getIsAllPageRowsSelected();
|
|
11291
11133
|
const isSomeSelected = table.getIsSomePageRowsSelected();
|
|
11292
|
-
return
|
|
11134
|
+
return React20.createElement(Checkbox, {
|
|
11293
11135
|
checked: isAllSelected ? true : isSomeSelected ? "indeterminate" : false,
|
|
11294
11136
|
onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value),
|
|
11295
11137
|
"aria-label": "Select all"
|
|
11296
11138
|
});
|
|
11297
11139
|
},
|
|
11298
11140
|
cell: ({ row }) => {
|
|
11299
|
-
return
|
|
11141
|
+
return React20.createElement(Checkbox, {
|
|
11300
11142
|
checked: row.getIsSelected(),
|
|
11301
11143
|
onCheckedChange: (value) => row.toggleSelected(!!value),
|
|
11302
11144
|
"aria-label": "Select row"
|
|
@@ -11464,8 +11306,8 @@ function announceLoadingState(isLoading, hasError = false) {
|
|
|
11464
11306
|
announce("Data loaded");
|
|
11465
11307
|
}
|
|
11466
11308
|
}
|
|
11467
|
-
function announceBulkOperation(operation,
|
|
11468
|
-
const message = `${operation} completed for ${
|
|
11309
|
+
function announceBulkOperation(operation, count2) {
|
|
11310
|
+
const message = `${operation} completed for ${count2} ${count2 === 1 ? "item" : "items"}`;
|
|
11469
11311
|
announce(message);
|
|
11470
11312
|
}
|
|
11471
11313
|
function getAriaSortValue(sortDirection) {
|
|
@@ -11774,6 +11616,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
11774
11616
|
}
|
|
11775
11617
|
|
|
11776
11618
|
// src/components/DataTable/components/DataTableCore.tsx
|
|
11619
|
+
init_logger();
|
|
11777
11620
|
import { Fragment as Fragment8, jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
11778
11621
|
var isCellValue = (value) => {
|
|
11779
11622
|
if (value === null || value === void 0) {
|
|
@@ -11842,13 +11685,7 @@ function DataTableInternal(props) {
|
|
|
11842
11685
|
storageKey,
|
|
11843
11686
|
onLayoutChange
|
|
11844
11687
|
} = props;
|
|
11845
|
-
|
|
11846
|
-
"onExport in props": !!props.onExport,
|
|
11847
|
-
"onExport after destructuring": !!onExport,
|
|
11848
|
-
"onExport type": typeof onExport,
|
|
11849
|
-
"props keys with Export": Object.keys(props).filter((k) => k.toLowerCase().includes("export"))
|
|
11850
|
-
});
|
|
11851
|
-
const logger = React20.useMemo(() => createLogger("DataTableCore"), []);
|
|
11688
|
+
const logger = React21.useMemo(() => createLogger("DataTableCore"), []);
|
|
11852
11689
|
const authResult = useUnifiedAuth();
|
|
11853
11690
|
const user = authResult.user;
|
|
11854
11691
|
const requestedFeatures = useMemo14(
|
|
@@ -11856,15 +11693,6 @@ function DataTableInternal(props) {
|
|
|
11856
11693
|
[incomingFeatures]
|
|
11857
11694
|
);
|
|
11858
11695
|
const { permissions, secureFeatures, effectivePageId } = useDataTablePermissions(rbac, requestedFeatures);
|
|
11859
|
-
if (import.meta.env.MODE === "development") {
|
|
11860
|
-
logger.debug("[DataTableCore] Creation feature check:", {
|
|
11861
|
-
"incomingFeatures.creation": incomingFeatures.creation,
|
|
11862
|
-
"requestedFeatures.creation": requestedFeatures.creation,
|
|
11863
|
-
"secureFeatures.creation": secureFeatures.creation,
|
|
11864
|
-
"permissions.canCreate.can": permissions.canCreate.can,
|
|
11865
|
-
"onCreateRow prop provided": !!onCreateRow
|
|
11866
|
-
});
|
|
11867
|
-
}
|
|
11868
11696
|
const effectiveColumnOrder = useEffectiveColumnOrder({
|
|
11869
11697
|
columns,
|
|
11870
11698
|
externalColumnOrder,
|
|
@@ -12006,20 +11834,6 @@ function DataTableInternal(props) {
|
|
|
12006
11834
|
logger.error("Hierarchical data validation failed:", hierarchicalValidation.errors);
|
|
12007
11835
|
}
|
|
12008
11836
|
}, [hierarchicalValidation, logger]);
|
|
12009
|
-
useEffect12(() => {
|
|
12010
|
-
if (finalTableData.length === 0 && data.length > 0) {
|
|
12011
|
-
logger.warn("Diagnostic: finalTableData empty but input data exists", {
|
|
12012
|
-
inputDataLength: data.length,
|
|
12013
|
-
finalTableDataLength: finalTableData.length,
|
|
12014
|
-
dataCount: finalDataCount,
|
|
12015
|
-
finalPaginationMode,
|
|
12016
|
-
hasServerData: !!serverData,
|
|
12017
|
-
serverDataLength: serverData?.data?.length || 0,
|
|
12018
|
-
hierarchicalEnabled: Boolean(secureFeatures.hierarchical && hierarchical?.enabled),
|
|
12019
|
-
hierarchicalValid: hierarchicalValidation.isValid
|
|
12020
|
-
});
|
|
12021
|
-
}
|
|
12022
|
-
}, [finalTableData.length, data.length, finalDataCount, finalPaginationMode, serverData, secureFeatures.hierarchical, hierarchical, hierarchicalValidation.isValid, logger]);
|
|
12023
11837
|
const {
|
|
12024
11838
|
columnOrder: savedColumnOrder,
|
|
12025
11839
|
isLoaded: isColumnOrderLoaded,
|
|
@@ -12039,16 +11853,12 @@ function DataTableInternal(props) {
|
|
|
12039
11853
|
useEffect12(() => {
|
|
12040
11854
|
if (secureFeatures.selection && state.columnOrder.includes("select") && state.columnOrder[0] !== "select") {
|
|
12041
11855
|
const normalizedOrder = ["select", ...state.columnOrder.filter((id) => id !== "select")];
|
|
12042
|
-
logger.warn("Correcting column order state - moving select to first position:", {
|
|
12043
|
-
before: state.columnOrder,
|
|
12044
|
-
after: normalizedOrder
|
|
12045
|
-
});
|
|
12046
11856
|
stateActions.setColumnOrder(normalizedOrder);
|
|
12047
11857
|
if (secureFeatures.columnReordering) {
|
|
12048
11858
|
updateColumnOrder(normalizedOrder);
|
|
12049
11859
|
}
|
|
12050
11860
|
}
|
|
12051
|
-
}, [secureFeatures.selection, secureFeatures.columnReordering, state.columnOrder, stateActions, updateColumnOrder
|
|
11861
|
+
}, [secureFeatures.selection, secureFeatures.columnReordering, state.columnOrder, stateActions, updateColumnOrder]);
|
|
12052
11862
|
const finalPageSizeOptions = optimizedPageSizeOptions;
|
|
12053
11863
|
const validatedInitialPageSize = useMemo14(() => {
|
|
12054
11864
|
if (!secureFeatures.pagination || !finalPageSizeOptions.length) {
|
|
@@ -12128,62 +11938,10 @@ function DataTableInternal(props) {
|
|
|
12128
11938
|
onExport: permissions.canExport.can ? onExport : void 0,
|
|
12129
11939
|
onDeleteSelected: permissions.canDelete.can ? onDeleteSelected : void 0
|
|
12130
11940
|
};
|
|
12131
|
-
console.log("[DataTableCore] Secure handlers setup:", {
|
|
12132
|
-
"permissions.canExport.can": permissions.canExport.can,
|
|
12133
|
-
"onExport prop provided": !!onExport,
|
|
12134
|
-
"onExport type": typeof onExport,
|
|
12135
|
-
"secureHandlers.onExport": !!handlers.onExport
|
|
12136
|
-
});
|
|
12137
|
-
if (import.meta.env.MODE === "development") {
|
|
12138
|
-
logger.debug("[DataTableCore] Handler check:", {
|
|
12139
|
-
"permissions.canCreate.can": permissions.canCreate.can,
|
|
12140
|
-
"onCreateRow prop provided": !!onCreateRow,
|
|
12141
|
-
"secureHandlers.onCreateRow": !!handlers.onCreateRow,
|
|
12142
|
-
"secureFeatures.creation": secureFeatures.creation,
|
|
12143
|
-
"will pass onCreateRow to toolbar": secureFeatures.creation && !!handlers.onCreateRow,
|
|
12144
|
-
"permissions.canExport.can": permissions.canExport.can,
|
|
12145
|
-
"onExport prop provided": !!onExport,
|
|
12146
|
-
"secureHandlers.onExport": !!handlers.onExport
|
|
12147
|
-
});
|
|
12148
|
-
}
|
|
12149
11941
|
return handlers;
|
|
12150
|
-
}, [permissions.canUpdate.can, permissions.canDelete.can, permissions.canCreate.can, permissions.canImport.can, permissions.canExport.can, onEditRow, onDeleteRow, onCreateRow, onImport, onExport, onDeleteSelected, secureFeatures.creation
|
|
12151
|
-
if (import.meta.env.MODE === "development") {
|
|
12152
|
-
logger.debug("[DataTableCore] \u26A0\uFE0F CREATION BUTTON DIAGNOSIS:", {
|
|
12153
|
-
"\u2705 permissions.canCreate.can": permissions.canCreate.can,
|
|
12154
|
-
"\u2753 features.creation enabled": secureFeatures.creation,
|
|
12155
|
-
"\u2753 onCreateRow handler provided": !!onCreateRow,
|
|
12156
|
-
"\u2753 secureHandlers.onCreateRow": !!secureHandlers.onCreateRow,
|
|
12157
|
-
"\u{1F50D} WILL SHOW BUTTON": secureFeatures.creation && permissions.canCreate.can && !!onCreateRow,
|
|
12158
|
-
"\u{1F4A1} SOLUTION": !secureFeatures.creation ? "Enable features={{ creation: true }} in DataTable props" : !onCreateRow ? "Provide onCreateRow handler in DataTable props" : "All conditions met - button should be visible"
|
|
12159
|
-
});
|
|
12160
|
-
}
|
|
11942
|
+
}, [permissions.canUpdate.can, permissions.canDelete.can, permissions.canCreate.can, permissions.canImport.can, permissions.canExport.can, onEditRow, onDeleteRow, onCreateRow, onImport, onExport, onDeleteSelected, secureFeatures.creation]);
|
|
12161
11943
|
const effectiveActions = useMemo14(() => {
|
|
12162
11944
|
const result = [...actions];
|
|
12163
|
-
logger.debug("Action Configuration Debug:", {
|
|
12164
|
-
originalActions: actions.length,
|
|
12165
|
-
secureFeatures: {
|
|
12166
|
-
editing: secureFeatures.editing,
|
|
12167
|
-
deletion: secureFeatures.deletion,
|
|
12168
|
-
creation: secureFeatures.creation,
|
|
12169
|
-
import: secureFeatures.import,
|
|
12170
|
-
export: secureFeatures.export
|
|
12171
|
-
},
|
|
12172
|
-
secureHandlers: {
|
|
12173
|
-
onEditRow: !!secureHandlers.onEditRow,
|
|
12174
|
-
onDeleteRow: !!secureHandlers.onDeleteRow,
|
|
12175
|
-
onCreateRow: !!secureHandlers.onCreateRow,
|
|
12176
|
-
onImport: !!secureHandlers.onImport,
|
|
12177
|
-
onExport: !!secureHandlers.onExport
|
|
12178
|
-
},
|
|
12179
|
-
permissions: {
|
|
12180
|
-
canUpdate: permissions.canUpdate.can,
|
|
12181
|
-
canDelete: permissions.canDelete.can,
|
|
12182
|
-
canCreate: permissions.canCreate.can,
|
|
12183
|
-
canImport: permissions.canImport.can,
|
|
12184
|
-
canExport: permissions.canExport.can
|
|
12185
|
-
}
|
|
12186
|
-
});
|
|
12187
11945
|
if (secureFeatures.editing && secureHandlers.onEditRow && !result.some((a) => a.label === "Edit")) {
|
|
12188
11946
|
result.push({
|
|
12189
11947
|
label: "Edit",
|
|
@@ -12237,11 +11995,6 @@ function DataTableInternal(props) {
|
|
|
12237
11995
|
hidden: !permissions.canDelete.can
|
|
12238
11996
|
});
|
|
12239
11997
|
}
|
|
12240
|
-
logger.debug("Final Actions:", {
|
|
12241
|
-
totalActions: result.length,
|
|
12242
|
-
actionLabels: result.map((a) => a.label),
|
|
12243
|
-
hiddenActions: result.filter((a) => a.hidden).map((a) => a.label)
|
|
12244
|
-
});
|
|
12245
11998
|
return result;
|
|
12246
11999
|
}, [actions, secureFeatures, permissions, secureHandlers, resolvedGetRowId, stateActions, data]);
|
|
12247
12000
|
const normalizedColumnOrderForColumns = useMemo14(() => {
|
|
@@ -12262,14 +12015,6 @@ function DataTableInternal(props) {
|
|
|
12262
12015
|
}), [state.pagination, effectivePageSize]);
|
|
12263
12016
|
const tableStateSnapshot = useMemo14(() => {
|
|
12264
12017
|
const normalizedColumnOrder = secureFeatures.selection && state.columnOrder.includes("select") ? ["select", ...state.columnOrder.filter((id) => id !== "select")] : state.columnOrder;
|
|
12265
|
-
if (secureFeatures.selection && state.columnOrder[0] !== "select") {
|
|
12266
|
-
logger.warn("Column order normalized:", {
|
|
12267
|
-
original: state.columnOrder,
|
|
12268
|
-
normalized: normalizedColumnOrder,
|
|
12269
|
-
firstColumnOriginal: state.columnOrder[0],
|
|
12270
|
-
firstColumnNormalized: normalizedColumnOrder[0]
|
|
12271
|
-
});
|
|
12272
|
-
}
|
|
12273
12018
|
return {
|
|
12274
12019
|
sorting: state.sorting,
|
|
12275
12020
|
columnFilters: state.columnFilters,
|
|
@@ -12319,40 +12064,6 @@ function DataTableInternal(props) {
|
|
|
12319
12064
|
hasServerSideConfig: !!serverSide
|
|
12320
12065
|
});
|
|
12321
12066
|
const table = useReactTable(tableConfig);
|
|
12322
|
-
useEffect12(() => {
|
|
12323
|
-
const rows = table.getRowModel().rows;
|
|
12324
|
-
if (rows.length === 0 && finalTableData.length > 0) {
|
|
12325
|
-
const coreRows = table.getCoreRowModel().rows;
|
|
12326
|
-
const prePaginationRows = table.getPrePaginationRowModel?.()?.rows || [];
|
|
12327
|
-
const filteredRows = table.getFilteredRowModel?.()?.rows || [];
|
|
12328
|
-
const sortedRows = table.getSortedRowModel?.()?.rows || [];
|
|
12329
|
-
const tableState = table.getState();
|
|
12330
|
-
logger.warn("Table created but rows are empty!", {
|
|
12331
|
-
finalTableDataLength: finalTableData.length,
|
|
12332
|
-
tableConfigDataLength: tableConfig.data?.length || 0,
|
|
12333
|
-
coreRowsLength: coreRows.length,
|
|
12334
|
-
prePaginationRowsLength: prePaginationRows.length,
|
|
12335
|
-
filteredRowsLength: filteredRows.length,
|
|
12336
|
-
sortedRowsLength: sortedRows.length,
|
|
12337
|
-
finalRowsLength: rows.length,
|
|
12338
|
-
pagination: tableState.pagination,
|
|
12339
|
-
finalPaginationMode,
|
|
12340
|
-
hasServerSideConfig: !!serverSide,
|
|
12341
|
-
tableOptions: {
|
|
12342
|
-
getCoreRowModel: !!tableConfig.getCoreRowModel,
|
|
12343
|
-
getFilteredRowModel: !!tableConfig.getFilteredRowModel,
|
|
12344
|
-
getSortedRowModel: !!tableConfig.getSortedRowModel,
|
|
12345
|
-
getPaginationRowModel: !!tableConfig.getPaginationRowModel,
|
|
12346
|
-
manualPagination: tableConfig.manualPagination,
|
|
12347
|
-
manualFiltering: tableConfig.manualFiltering,
|
|
12348
|
-
manualSorting: tableConfig.manualSorting,
|
|
12349
|
-
pageCount: tableConfig.pageCount
|
|
12350
|
-
},
|
|
12351
|
-
hasRowId: !!resolvedGetRowId,
|
|
12352
|
-
effectivePageSize
|
|
12353
|
-
});
|
|
12354
|
-
}
|
|
12355
|
-
}, [table, finalTableData.length, tableConfig, resolvedGetRowId, finalPaginationMode, serverSide, effectivePageSize, logger]);
|
|
12356
12067
|
if (!user) {
|
|
12357
12068
|
throw new Error("DataTable requires authenticated user for RBAC");
|
|
12358
12069
|
}
|
|
@@ -12448,30 +12159,9 @@ function DataTableInternal(props) {
|
|
|
12448
12159
|
filename,
|
|
12449
12160
|
table
|
|
12450
12161
|
};
|
|
12451
|
-
console.log("[DataTableCore] Export handler check:", {
|
|
12452
|
-
"secureHandlers.onExport exists": !!secureHandlers.onExport,
|
|
12453
|
-
"permissions.canExport.can": permissions.canExport.can,
|
|
12454
|
-
"onExport prop provided": !!onExport,
|
|
12455
|
-
"onExport type": typeof onExport
|
|
12456
|
-
});
|
|
12457
12162
|
if (secureHandlers.onExport) {
|
|
12458
|
-
console.log("[DataTableCore] \u2705 Calling custom onExport handler");
|
|
12459
|
-
logger.debug("[DataTableCore] Calling custom onExport handler");
|
|
12460
12163
|
await secureHandlers.onExport(exportOptions);
|
|
12461
|
-
console.log("[DataTableCore] \u2705 Custom onExport handler completed");
|
|
12462
|
-
logger.debug("[DataTableCore] Custom onExport handler completed");
|
|
12463
12164
|
return;
|
|
12464
|
-
} else {
|
|
12465
|
-
console.warn("[DataTableCore] \u26A0\uFE0F No custom onExport handler, using default export", {
|
|
12466
|
-
"secureHandlers.onExport": !!secureHandlers.onExport,
|
|
12467
|
-
"permissions.canExport.can": permissions.canExport.can,
|
|
12468
|
-
"onExport prop provided": !!onExport
|
|
12469
|
-
});
|
|
12470
|
-
logger.debug("[DataTableCore] No custom onExport handler, using default export", {
|
|
12471
|
-
"secureHandlers.onExport": !!secureHandlers.onExport,
|
|
12472
|
-
"permissions.canExport.can": permissions.canExport.can,
|
|
12473
|
-
"onExport prop provided": !!onExport
|
|
12474
|
-
});
|
|
12475
12165
|
}
|
|
12476
12166
|
const exportColumns = exportOptions.visibleColumns.map((col) => {
|
|
12477
12167
|
const colId = col.id || col.accessorKey;
|
|
@@ -12494,7 +12184,6 @@ function DataTableInternal(props) {
|
|
|
12494
12184
|
description: `Data exported to ${exportOptions.filename}`,
|
|
12495
12185
|
variant: "default"
|
|
12496
12186
|
});
|
|
12497
|
-
logger.debug("Export completed successfully");
|
|
12498
12187
|
} catch (error) {
|
|
12499
12188
|
logger.error("Failed to export data:", error);
|
|
12500
12189
|
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
@@ -12660,7 +12349,7 @@ function DataTableInternal(props) {
|
|
|
12660
12349
|
grouping: state.grouping,
|
|
12661
12350
|
aggregates,
|
|
12662
12351
|
getRowId: resolvedGetRowId,
|
|
12663
|
-
emptyState:
|
|
12352
|
+
emptyState: React21.isValidElement(emptyState) ? void 0 : emptyState,
|
|
12664
12353
|
isFiltered: searchQuery !== "" || state.columnFilters.length > 0,
|
|
12665
12354
|
onClearFilters: () => {
|
|
12666
12355
|
stateActions.setSearchQuery("");
|
|
@@ -12706,12 +12395,10 @@ function DataTableInternal(props) {
|
|
|
12706
12395
|
onImport: async (data2) => {
|
|
12707
12396
|
if (onImport) {
|
|
12708
12397
|
try {
|
|
12709
|
-
logger.debug("onImport called with", data2.length, "rows");
|
|
12710
12398
|
const result = onImport(data2);
|
|
12711
12399
|
if (result && typeof result.then === "function") {
|
|
12712
12400
|
await result;
|
|
12713
12401
|
}
|
|
12714
|
-
logger.debug("onImport completed successfully");
|
|
12715
12402
|
toast({
|
|
12716
12403
|
title: "Import Successful",
|
|
12717
12404
|
description: `Successfully imported ${data2.length} ${data2.length === 1 ? "row" : "rows"}`,
|
|
@@ -12753,46 +12440,23 @@ function DataTableCore(props) {
|
|
|
12753
12440
|
}
|
|
12754
12441
|
|
|
12755
12442
|
// src/components/DataTable/DataTable.tsx
|
|
12443
|
+
init_logger();
|
|
12756
12444
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
12757
12445
|
function DataTable(props) {
|
|
12758
|
-
const logger =
|
|
12446
|
+
const logger = React22.useMemo(() => createLogger("DataTable"), []);
|
|
12759
12447
|
const { features, ...rest } = props;
|
|
12760
|
-
const normalizedFeatures =
|
|
12448
|
+
const normalizedFeatures = React22.useMemo(
|
|
12761
12449
|
() => normalizeDataTableFeatures(features),
|
|
12762
12450
|
[features]
|
|
12763
12451
|
);
|
|
12764
|
-
|
|
12765
|
-
if (!features && import.meta.env?.MODE === "development") {
|
|
12766
|
-
logger.info("DataTable: no features provided; all capabilities default to disabled. Pass a features object to enable functionality.");
|
|
12767
|
-
}
|
|
12768
|
-
}, [features, logger]);
|
|
12769
|
-
React21.useEffect(() => {
|
|
12452
|
+
React22.useEffect(() => {
|
|
12770
12453
|
if (normalizedFeatures.deleteSelected && !normalizedFeatures.deletion) {
|
|
12771
12454
|
logger.warn("deleteSelected requires deletion to be enabled");
|
|
12772
12455
|
}
|
|
12773
12456
|
}, [normalizedFeatures.deleteSelected, normalizedFeatures.deletion, logger]);
|
|
12774
|
-
const allPropsKeys = Object.keys(props);
|
|
12775
|
-
const allRestKeys = Object.keys(rest);
|
|
12776
|
-
const tableTitle = props.title || props.description || "unnamed";
|
|
12777
|
-
console.log(`[DataTable] Wrapper prop check (${tableTitle}):`, {
|
|
12778
|
-
"onExport in props": !!props.onExport,
|
|
12779
|
-
"onExport in rest": !!rest.onExport,
|
|
12780
|
-
"onExport type": typeof rest.onExport,
|
|
12781
|
-
"rest keys": Object.keys(rest).filter((k) => k.includes("Export") || k.includes("export")),
|
|
12782
|
-
"all rest keys": allRestKeys,
|
|
12783
|
-
// All keys for debugging
|
|
12784
|
-
"props keys": allPropsKeys,
|
|
12785
|
-
// All props keys
|
|
12786
|
-
"has onExport key": "onExport" in props,
|
|
12787
|
-
"has onExport in rest": "onExport" in rest,
|
|
12788
|
-
"props.onExport value": props.onExport,
|
|
12789
|
-
"rest.onExport value": rest.onExport
|
|
12790
|
-
});
|
|
12791
|
-
console.log(`[DataTable] All props keys for ${tableTitle}:`, allPropsKeys);
|
|
12792
|
-
console.log(`[DataTable] All rest keys for ${tableTitle}:`, allRestKeys);
|
|
12793
12457
|
return /* @__PURE__ */ jsx26(DataTableCore, { ...rest, features: normalizedFeatures });
|
|
12794
12458
|
}
|
|
12795
|
-
var DataTableComponent =
|
|
12459
|
+
var DataTableComponent = React22.memo(DataTable);
|
|
12796
12460
|
|
|
12797
12461
|
// src/components/DataTable/components/BulkOperationsDropdown.tsx
|
|
12798
12462
|
import {
|
|
@@ -12899,6 +12563,56 @@ function GroupHeader({
|
|
|
12899
12563
|
] });
|
|
12900
12564
|
}
|
|
12901
12565
|
|
|
12566
|
+
// src/components/DataTable/utils/aggregationUtils.ts
|
|
12567
|
+
function sum(accessorKey) {
|
|
12568
|
+
return (rows, column) => {
|
|
12569
|
+
return rows.reduce((total, row) => {
|
|
12570
|
+
const value = row[accessorKey];
|
|
12571
|
+
const numValue = typeof value === "number" ? value : parseFloat(String(value || 0));
|
|
12572
|
+
return total + (isNaN(numValue) ? 0 : numValue);
|
|
12573
|
+
}, 0);
|
|
12574
|
+
};
|
|
12575
|
+
}
|
|
12576
|
+
function average(accessorKey) {
|
|
12577
|
+
return (rows, column) => {
|
|
12578
|
+
if (rows.length === 0) return 0;
|
|
12579
|
+
const validValues = rows.map((row) => row[accessorKey]).filter((value) => value != null && value !== "").map((value) => {
|
|
12580
|
+
const numValue = typeof value === "number" ? value : parseFloat(String(value));
|
|
12581
|
+
return isNaN(numValue) ? null : numValue;
|
|
12582
|
+
}).filter((value) => value !== null);
|
|
12583
|
+
if (validValues.length === 0) return 0;
|
|
12584
|
+
const sum2 = validValues.reduce((total, value) => total + value, 0);
|
|
12585
|
+
return sum2 / validValues.length;
|
|
12586
|
+
};
|
|
12587
|
+
}
|
|
12588
|
+
function count() {
|
|
12589
|
+
return (rows, column) => {
|
|
12590
|
+
return rows.length;
|
|
12591
|
+
};
|
|
12592
|
+
}
|
|
12593
|
+
function min(accessorKey) {
|
|
12594
|
+
return (rows, column) => {
|
|
12595
|
+
if (rows.length === 0) return null;
|
|
12596
|
+
const validValues = rows.map((row) => row[accessorKey]).filter((value) => value != null && value !== "").map((value) => {
|
|
12597
|
+
const numValue = typeof value === "number" ? value : parseFloat(String(value));
|
|
12598
|
+
return isNaN(numValue) ? null : numValue;
|
|
12599
|
+
}).filter((value) => value !== null);
|
|
12600
|
+
if (validValues.length === 0) return null;
|
|
12601
|
+
return Math.min(...validValues);
|
|
12602
|
+
};
|
|
12603
|
+
}
|
|
12604
|
+
function max(accessorKey) {
|
|
12605
|
+
return (rows, column) => {
|
|
12606
|
+
if (rows.length === 0) return null;
|
|
12607
|
+
const validValues = rows.map((row) => row[accessorKey]).filter((value) => value != null && value !== "").map((value) => {
|
|
12608
|
+
const numValue = typeof value === "number" ? value : parseFloat(String(value));
|
|
12609
|
+
return isNaN(numValue) ? null : numValue;
|
|
12610
|
+
}).filter((value) => value !== null);
|
|
12611
|
+
if (validValues.length === 0) return null;
|
|
12612
|
+
return Math.max(...validValues);
|
|
12613
|
+
};
|
|
12614
|
+
}
|
|
12615
|
+
|
|
12902
12616
|
export {
|
|
12903
12617
|
Dialog,
|
|
12904
12618
|
DialogTrigger,
|
|
@@ -12942,6 +12656,7 @@ export {
|
|
|
12942
12656
|
ColumnVisibilityDropdown,
|
|
12943
12657
|
DataTableToolbar,
|
|
12944
12658
|
EmptyState,
|
|
12659
|
+
getColumnHeaderText,
|
|
12945
12660
|
ActionButtons,
|
|
12946
12661
|
EditableRow,
|
|
12947
12662
|
validateHierarchicalData,
|
|
@@ -12992,7 +12707,12 @@ export {
|
|
|
12992
12707
|
DataTableCore,
|
|
12993
12708
|
DataTable,
|
|
12994
12709
|
BulkOperationsDropdown,
|
|
12995
|
-
GroupHeader
|
|
12710
|
+
GroupHeader,
|
|
12711
|
+
sum,
|
|
12712
|
+
average,
|
|
12713
|
+
count,
|
|
12714
|
+
min,
|
|
12715
|
+
max
|
|
12996
12716
|
};
|
|
12997
12717
|
/*! Bundled license information:
|
|
12998
12718
|
|
|
@@ -13006,4 +12726,4 @@ lodash/lodash.js:
|
|
|
13006
12726
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
13007
12727
|
*)
|
|
13008
12728
|
*/
|
|
13009
|
-
//# sourceMappingURL=chunk-
|
|
12729
|
+
//# sourceMappingURL=chunk-HAWZXGR2.js.map
|