@jmruthers/pace-core 0.5.189 → 0.5.191
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/core-usage-manifest.json +0 -4
- package/dist/{AuthService-B-cd2MA4.d.ts → AuthService-CbP_utw2.d.ts} +7 -3
- package/dist/{DataTable-IVYljGJ6.d.ts → DataTable-Be6dH_dR.d.ts} +1 -1
- package/dist/{DataTable-GUFUNZ3N.js → DataTable-WKRZD47S.js} +8 -8
- package/dist/{PublicPageProvider-B8HaLe69.d.ts → PublicPageProvider-ULXC_u6U.d.ts} +84 -25
- package/dist/{UnifiedAuthProvider-BG0AL5eE.d.ts → UnifiedAuthProvider-BYA9qB-o.d.ts} +4 -3
- package/dist/{UnifiedAuthProvider-643PUAIM.js → UnifiedAuthProvider-FTSG5XH7.js} +4 -2
- package/dist/{api-YP7XD5L6.js → api-IHKALJZD.js} +4 -2
- package/dist/{chunk-VGZZXKBR.js → chunk-6LTQQAT6.js} +351 -157
- package/dist/chunk-6LTQQAT6.js.map +1 -0
- package/dist/{chunk-MX64ZF6I.js → chunk-6TQDD426.js} +15 -15
- package/dist/chunk-6TQDD426.js.map +1 -0
- package/dist/{chunk-YHCN776L.js → chunk-G37KK66H.js} +2 -75
- package/dist/chunk-G37KK66H.js.map +1 -0
- package/dist/{chunk-THRPYOFK.js → chunk-HW3OVDUF.js} +5 -5
- package/dist/chunk-HW3OVDUF.js.map +1 -0
- package/dist/{chunk-F2IMUDXZ.js → chunk-I7PSE6JW.js} +75 -2
- package/dist/chunk-I7PSE6JW.js.map +1 -0
- package/dist/{chunk-IM4QE42D.js → chunk-LOMZXPSN.js} +141 -326
- package/dist/chunk-LOMZXPSN.js.map +1 -0
- package/dist/chunk-OETXORNB.js +614 -0
- package/dist/chunk-OETXORNB.js.map +1 -0
- package/dist/{chunk-HESYZWZW.js → chunk-QWWZ5CAQ.js} +2 -2
- package/dist/{chunk-HEHYGYOX.js → chunk-ROXMHMY2.js} +403 -46
- package/dist/chunk-ROXMHMY2.js.map +1 -0
- package/dist/{chunk-2UUZZJFT.js → chunk-ULHIJK66.js} +228 -177
- package/dist/{chunk-2UUZZJFT.js.map → chunk-ULHIJK66.js.map} +1 -1
- package/dist/{chunk-YGPFYGA6.js → chunk-VKB2CO4Z.js} +838 -503
- package/dist/chunk-VKB2CO4Z.js.map +1 -0
- package/dist/{chunk-3GOZZZYH.js → chunk-VRGWKHDB.js} +238 -301
- package/dist/chunk-VRGWKHDB.js.map +1 -0
- package/dist/{chunk-UCQSRW7Z.js → chunk-XNYQOL3Z.js} +431 -384
- package/dist/chunk-XNYQOL3Z.js.map +1 -0
- package/dist/{chunk-DDM4CCYT.js → chunk-XYXSXPUK.js} +79 -59
- package/dist/chunk-XYXSXPUK.js.map +1 -0
- package/dist/{chunk-SAUPYVLF.js → chunk-ZSAAAMVR.js} +1 -1
- package/dist/chunk-ZSAAAMVR.js.map +1 -0
- package/dist/components.d.ts +5 -6
- package/dist/components.js +19 -19
- package/dist/components.js.map +1 -1
- package/dist/{database.generated-DI89OQeI.d.ts → database.generated-CzIvgcPu.d.ts} +165 -201
- package/dist/eslint-rules/pace-core-compliance.cjs +0 -2
- package/dist/{file-reference-D037xOFK.d.ts → file-reference-BavO2eQj.d.ts} +13 -10
- package/dist/hooks.d.ts +20 -15
- package/dist/hooks.js +14 -8
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +17 -15
- package/dist/index.js +86 -81
- package/dist/index.js.map +1 -1
- package/dist/providers.d.ts +3 -3
- package/dist/providers.js +3 -1
- package/dist/rbac/index.d.ts +77 -13
- package/dist/rbac/index.js +12 -9
- package/dist/{types-Bwgl--Xo.d.ts → types-CEpcvwwF.d.ts} +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/types.js +1 -1
- package/dist/{usePublicRouteParams-CTDELQ7H.d.ts → usePublicRouteParams-TZe0gy-4.d.ts} +17 -10
- package/dist/utils.d.ts +8 -8
- package/dist/utils.js +16 -16
- package/docs/README.md +2 -2
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +2 -2
- package/docs/api/classes/Logger.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +2 -2
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +2 -2
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +5 -5
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +2 -2
- package/docs/api/classes/SecureSupabaseClient.md +25 -20
- package/docs/api/classes/StorageUtils.md +7 -4
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/enums/LogLevel.md +1 -1
- package/docs/api/enums/RBACErrorCode.md +1 -1
- package/docs/api/enums/RPCFunction.md +1 -1
- package/docs/api/interfaces/AddressFieldProps.md +1 -1
- package/docs/api/interfaces/AddressFieldRef.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/AutocompleteOptions.md +1 -1
- package/docs/api/interfaces/AvatarProps.md +1 -1
- package/docs/api/interfaces/BadgeProps.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CalendarProps.md +20 -6
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/ComplianceResult.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +9 -9
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/DatabaseComplianceResult.md +1 -1
- package/docs/api/interfaces/DatabaseIssue.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventAppRoleData.md +1 -1
- package/docs/api/interfaces/ExportColumn.md +1 -1
- package/docs/api/interfaces/ExportOptions.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +62 -16
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +2 -2
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +26 -12
- package/docs/api/interfaces/FileUploadProps.md +30 -19
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/FormFieldProps.md +1 -1
- package/docs/api/interfaces/FormProps.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/LoggerConfig.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 +1 -1
- 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 +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +8 -8
- package/docs/api/interfaces/PagePermissionContextType.md +8 -8
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +7 -7
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/ParsedAddress.md +2 -2
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/ProgressProps.md +3 -11
- package/docs/api/interfaces/ProtectedRouteProps.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/QuickFix.md +1 -1
- package/docs/api/interfaces/RBACAccessValidateParams.md +1 -1
- package/docs/api/interfaces/RBACAccessValidateResult.md +1 -1
- package/docs/api/interfaces/RBACAuditLogParams.md +1 -1
- package/docs/api/interfaces/RBACAuditLogResult.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +2 -2
- package/docs/api/interfaces/RBACContext.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACPageAccessCheckParams.md +1 -1
- package/docs/api/interfaces/RBACPerformanceMetrics.md +1 -1
- package/docs/api/interfaces/RBACPermissionCheckParams.md +1 -1
- package/docs/api/interfaces/RBACPermissionCheckResult.md +1 -1
- package/docs/api/interfaces/RBACPermissionsGetParams.md +1 -1
- package/docs/api/interfaces/RBACPermissionsGetResult.md +1 -1
- package/docs/api/interfaces/RBACResult.md +1 -1
- package/docs/api/interfaces/RBACRoleGrantParams.md +1 -1
- package/docs/api/interfaces/RBACRoleGrantResult.md +1 -1
- package/docs/api/interfaces/RBACRoleRevokeParams.md +1 -1
- package/docs/api/interfaces/RBACRoleRevokeResult.md +1 -1
- package/docs/api/interfaces/RBACRoleValidateParams.md +1 -1
- package/docs/api/interfaces/RBACRoleValidateResult.md +1 -1
- package/docs/api/interfaces/RBACRolesListParams.md +1 -1
- package/docs/api/interfaces/RBACRolesListResult.md +1 -1
- package/docs/api/interfaces/RBACSessionTrackParams.md +1 -1
- package/docs/api/interfaces/RBACSessionTrackResult.md +1 -1
- package/docs/api/interfaces/ResourcePermissions.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/RuntimeComplianceResult.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +9 -9
- package/docs/api/interfaces/SecureDataProviderProps.md +8 -8
- package/docs/api/interfaces/SessionRestorationLoaderProps.md +1 -1
- package/docs/api/interfaces/SetupIssue.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +4 -4
- package/docs/api/interfaces/StorageFileInfo.md +7 -7
- package/docs/api/interfaces/StorageFileMetadata.md +25 -14
- package/docs/api/interfaces/StorageListOptions.md +22 -9
- package/docs/api/interfaces/StorageListResult.md +4 -4
- package/docs/api/interfaces/StorageUploadOptions.md +21 -8
- package/docs/api/interfaces/StorageUploadResult.md +6 -6
- package/docs/api/interfaces/StorageUrlOptions.md +19 -6
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/TabsContentProps.md +1 -1
- package/docs/api/interfaces/TabsListProps.md +1 -1
- package/docs/api/interfaces/TabsProps.md +1 -1
- package/docs/api/interfaces/TabsTriggerProps.md +1 -1
- package/docs/api/interfaces/TextareaProps.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/UseFormDialogOptions.md +1 -1
- package/docs/api/interfaces/UseFormDialogReturn.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +2 -2
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +2 -2
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +5 -5
- package/docs/api/interfaces/UseResolvedScopeReturn.md +4 -4
- package/docs/api/interfaces/UseResourcePermissionsOptions.md +1 -1
- 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 +165 -106
- package/docs/api-reference/components.md +15 -7
- package/docs/api-reference/providers.md +2 -2
- package/docs/api-reference/rpc-functions.md +1 -0
- package/docs/best-practices/README.md +1 -1
- package/docs/best-practices/deployment.md +8 -8
- package/docs/getting-started/examples/README.md +2 -2
- package/docs/getting-started/installation-guide.md +4 -4
- package/docs/getting-started/quick-start.md +3 -3
- package/docs/migration/MIGRATION_GUIDE.md +3 -3
- package/docs/migration/README.md +18 -0
- package/docs/migration/database-changes-december-2025.md +767 -0
- package/docs/migration/person-scoped-profiles-migration-guide.md +472 -0
- package/docs/rbac/compliance/compliance-guide.md +2 -2
- package/docs/rbac/event-based-apps.md +2 -2
- package/docs/rbac/getting-started.md +2 -2
- package/docs/rbac/quick-start.md +2 -2
- package/docs/security/README.md +4 -4
- package/docs/standards/07-rbac-and-rls-standard.md +430 -7
- package/docs/troubleshooting/README.md +2 -2
- package/docs/troubleshooting/migration.md +3 -3
- package/package.json +1 -3
- package/scripts/check-pace-core-compliance.cjs +1 -1
- package/scripts/check-pace-core-compliance.js +1 -1
- package/src/__tests__/fixtures/supabase.ts +301 -0
- package/src/__tests__/public-recipe-view.test.ts +19 -19
- package/src/__tests__/rls-policies.test.ts +210 -74
- package/src/components/AddressField/AddressField.test.tsx +42 -0
- package/src/components/AddressField/AddressField.tsx +71 -60
- package/src/components/AddressField/README.md +7 -6
- package/src/components/Alert/Alert.test.tsx +50 -10
- package/src/components/Alert/Alert.tsx +5 -3
- package/src/components/Avatar/Avatar.test.tsx +95 -43
- package/src/components/Avatar/Avatar.tsx +16 -16
- package/src/components/Button/Button.test.tsx +2 -1
- package/src/components/Button/Button.tsx +3 -3
- package/src/components/Calendar/Calendar.test.tsx +53 -37
- package/src/components/Calendar/Calendar.tsx +409 -82
- package/src/components/Card/Card.test.tsx +7 -4
- package/src/components/Card/Card.tsx +3 -6
- package/src/components/Checkbox/Checkbox.tsx +2 -2
- package/src/components/DataTable/components/ActionButtons.tsx +5 -5
- package/src/components/DataTable/components/BulkOperationsDropdown.tsx +2 -2
- package/src/components/DataTable/components/ColumnFilter.tsx +1 -1
- package/src/components/DataTable/components/ColumnVisibilityDropdown.tsx +3 -3
- package/src/components/DataTable/components/DataTableBody.tsx +12 -12
- package/src/components/DataTable/components/DataTableCore.tsx +3 -3
- package/src/components/DataTable/components/DataTableToolbar.tsx +5 -5
- package/src/components/DataTable/components/DraggableColumnHeader.tsx +3 -3
- package/src/components/DataTable/components/EditableRow.tsx +2 -2
- package/src/components/DataTable/components/EmptyState.tsx +3 -3
- package/src/components/DataTable/components/GroupHeader.tsx +2 -2
- package/src/components/DataTable/components/GroupingDropdown.tsx +1 -1
- package/src/components/DataTable/components/ImportModal.tsx +4 -4
- package/src/components/DataTable/components/LoadingState.tsx +1 -1
- package/src/components/DataTable/components/PaginationControls.tsx +11 -11
- package/src/components/DataTable/components/UnifiedTableBody.tsx +9 -9
- package/src/components/DataTable/components/ViewRowModal.tsx +2 -2
- package/src/components/DataTable/components/__tests__/AccessDeniedPage.test.tsx +11 -37
- package/src/components/DataTable/components/__tests__/DataTableToolbar.test.tsx +157 -0
- package/src/components/DataTable/components/__tests__/LoadingState.test.tsx +2 -1
- package/src/components/DataTable/components/__tests__/VirtualizedDataTable.test.tsx +128 -0
- package/src/components/DataTable/core/__tests__/ActionManager.test.ts +19 -0
- package/src/components/DataTable/core/__tests__/ColumnFactory.test.ts +51 -0
- package/src/components/DataTable/core/__tests__/ColumnManager.test.ts +84 -0
- package/src/components/DataTable/core/__tests__/DataManager.test.ts +14 -0
- package/src/components/DataTable/core/__tests__/DataTableContext.test.tsx +136 -0
- package/src/components/DataTable/core/__tests__/LocalDataAdapter.test.ts +16 -0
- package/src/components/DataTable/core/__tests__/PluginRegistry.test.ts +18 -0
- package/src/components/DataTable/hooks/useDataTablePermissions.ts +28 -7
- package/src/components/DataTable/utils/__tests__/hierarchicalUtils.test.ts +30 -1
- package/src/components/DataTable/utils/hierarchicalUtils.ts +38 -10
- package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.test.tsx +8 -3
- package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.tsx +4 -4
- package/src/components/Dialog/Dialog.tsx +2 -2
- package/src/components/EventSelector/EventSelector.tsx +7 -7
- package/src/components/FileDisplay/FileDisplay.tsx +291 -179
- package/src/components/FileUpload/FileUpload.tsx +7 -4
- package/src/components/Header/Header.test.tsx +28 -0
- package/src/components/Header/Header.tsx +22 -9
- package/src/components/InactivityWarningModal/InactivityWarningModal.tsx +2 -2
- package/src/components/LoadingSpinner/LoadingSpinner.test.tsx +19 -14
- package/src/components/LoadingSpinner/LoadingSpinner.tsx +5 -5
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +127 -1
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +42 -22
- package/src/components/PaceAppLayout/PaceAppLayout.integration.test.tsx +4 -0
- package/src/components/PaceAppLayout/PaceAppLayout.performance.test.tsx +3 -0
- package/src/components/PaceAppLayout/PaceAppLayout.security.test.tsx +3 -0
- package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +16 -6
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +37 -3
- package/src/components/PaceAppLayout/test-setup.tsx +1 -0
- package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +66 -45
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +6 -4
- package/src/components/Progress/Progress.test.tsx +18 -19
- package/src/components/Progress/Progress.tsx +31 -32
- package/src/components/PublicLayout/PublicLayout.test.tsx +6 -6
- package/src/components/PublicLayout/PublicPageProvider.tsx +5 -3
- package/src/components/Select/Select.test.tsx +4 -1
- package/src/components/Select/Select.tsx +65 -20
- package/src/components/Switch/Switch.test.tsx +2 -1
- package/src/components/Switch/Switch.tsx +1 -1
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/Tooltip/Tooltip.test.tsx +8 -2
- package/src/components/UserMenu/UserMenu.tsx +3 -3
- package/src/eslint-rules/pace-core-compliance.cjs +0 -2
- package/src/eslint-rules/pace-core-compliance.js +0 -2
- package/src/hooks/__tests__/hooks.integration.test.tsx +4 -1
- package/src/hooks/__tests__/useAppConfig.unit.test.ts +76 -5
- package/src/hooks/__tests__/useDataTableState.test.ts +76 -0
- package/src/hooks/__tests__/useFileUrl.unit.test.ts +25 -69
- package/src/hooks/__tests__/useFileUrlCache.test.ts +129 -0
- package/src/hooks/__tests__/usePreventTabReload.test.ts +88 -0
- package/src/hooks/__tests__/usePublicEvent.simple.test.ts +1 -1
- package/src/hooks/__tests__/usePublicEvent.test.ts +608 -0
- package/src/hooks/__tests__/useQueryCache.test.ts +144 -0
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +67 -24
- package/src/hooks/index.ts +1 -1
- package/src/hooks/public/usePublicEvent.ts +10 -10
- package/src/hooks/public/usePublicFileDisplay.ts +173 -87
- package/src/hooks/useAppConfig.ts +24 -5
- package/src/hooks/useFileDisplay.ts +298 -36
- package/src/hooks/useFileReference.ts +56 -11
- package/src/hooks/useFileUrl.ts +1 -1
- package/src/hooks/useInactivityTracker.ts +16 -7
- package/src/hooks/usePermissionCache.test.ts +85 -8
- package/src/hooks/useQueryCache.ts +27 -6
- package/src/hooks/useSecureDataAccess.test.ts +87 -42
- package/src/hooks/useSecureDataAccess.ts +95 -48
- package/src/providers/__tests__/OrganisationProvider.test.tsx +27 -21
- package/src/providers/services/EventServiceProvider.tsx +37 -17
- package/src/providers/services/InactivityServiceProvider.tsx +4 -4
- package/src/providers/services/OrganisationServiceProvider.tsx +8 -1
- package/src/providers/services/UnifiedAuthProvider.tsx +115 -29
- package/src/rbac/__tests__/auth-rbac.e2e.test.tsx +451 -0
- package/src/rbac/__tests__/engine.comprehensive.test.ts +12 -0
- package/src/rbac/__tests__/rbac-engine-core-logic.test.ts +8 -0
- package/src/rbac/__tests__/rbac-engine-simplified.test.ts +4 -0
- package/src/rbac/api.ts +240 -36
- package/src/rbac/cache-invalidation.ts +21 -7
- package/src/rbac/compliance/quick-fix-suggestions.ts +1 -1
- package/src/rbac/components/NavigationGuard.tsx +23 -63
- package/src/rbac/components/NavigationProvider.test.tsx +52 -23
- package/src/rbac/components/NavigationProvider.tsx +13 -11
- package/src/rbac/components/PagePermissionGuard.tsx +77 -203
- package/src/rbac/components/PagePermissionProvider.tsx +13 -11
- package/src/rbac/components/PermissionEnforcer.tsx +24 -62
- package/src/rbac/components/RoleBasedRouter.tsx +14 -12
- package/src/rbac/components/SecureDataProvider.tsx +13 -11
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +104 -41
- package/src/rbac/components/__tests__/NavigationProvider.test.tsx +49 -12
- package/src/rbac/components/__tests__/PagePermissionGuard.race-condition.test.tsx +22 -1
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +161 -82
- package/src/rbac/components/__tests__/PagePermissionGuard.verification.test.tsx +22 -1
- package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +77 -30
- package/src/rbac/components/__tests__/RoleBasedRouter.test.tsx +39 -5
- package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +47 -4
- package/src/rbac/engine.ts +4 -2
- package/src/rbac/hooks/__tests__/useSecureSupabase.test.ts +144 -52
- package/src/rbac/hooks/index.ts +3 -0
- package/src/rbac/hooks/useCan.test.ts +101 -53
- package/src/rbac/hooks/usePermissions.ts +108 -41
- package/src/rbac/hooks/useRBAC.test.ts +11 -3
- package/src/rbac/hooks/useRBAC.ts +83 -40
- package/src/rbac/hooks/useResolvedScope.test.ts +189 -63
- package/src/rbac/hooks/useResolvedScope.ts +128 -70
- package/src/rbac/hooks/useSecureSupabase.ts +36 -19
- package/src/rbac/hooks/useSuperAdminBypass.ts +126 -0
- package/src/rbac/request-deduplication.ts +1 -1
- package/src/rbac/secureClient.ts +72 -12
- package/src/rbac/security.ts +29 -23
- package/src/rbac/types.ts +10 -0
- package/src/rbac/utils/__tests__/contextValidator.test.ts +150 -0
- package/src/rbac/utils/__tests__/deep-equal.test.ts +53 -0
- package/src/rbac/utils/__tests__/eventContext.test.ts +8 -3
- package/src/rbac/utils/__tests__/eventContext.unit.test.ts +74 -12
- package/src/rbac/utils/contextValidator.ts +288 -0
- package/src/rbac/utils/eventContext.ts +52 -3
- package/src/services/AuthService.ts +37 -8
- package/src/services/EventService.ts +165 -21
- package/src/services/OrganisationService.ts +125 -137
- package/src/services/__tests__/EventService.test.ts +26 -21
- package/src/services/__tests__/OrganisationService.pagination.test.ts +34 -8
- package/src/services/__tests__/OrganisationService.test.ts +218 -86
- package/src/types/database.generated.ts +166 -201
- package/src/types/file-reference.ts +13 -10
- package/src/types/supabase.ts +2 -2
- package/src/utils/__tests__/secureDataAccess.unit.test.ts +3 -2
- package/src/utils/app/appNameResolver.test.ts +346 -73
- package/src/utils/context/superAdminOverride.ts +58 -0
- package/src/utils/file-reference/index.ts +65 -37
- package/src/utils/google-places/googlePlacesUtils.test.ts +98 -0
- package/src/utils/google-places/googlePlacesUtils.ts +1 -1
- package/src/utils/google-places/loadGoogleMapsScript.test.ts +83 -0
- package/src/utils/google-places/types.ts +1 -1
- package/src/utils/request-deduplication.ts +4 -4
- package/src/utils/security/secureDataAccess.test.ts +1 -1
- package/src/utils/security/secureDataAccess.ts +7 -4
- package/src/utils/storage/README.md +1 -1
- package/src/utils/storage/helpers.test.ts +1 -1
- package/src/utils/storage/helpers.ts +38 -19
- package/src/utils/storage/types.ts +15 -8
- package/src/utils/validation/__tests__/csrf.test.ts +105 -0
- package/src/utils/validation/__tests__/sqlInjectionProtection.test.ts +92 -0
- package/src/vite-env.d.ts +2 -2
- package/dist/chunk-3GOZZZYH.js.map +0 -1
- package/dist/chunk-DDM4CCYT.js.map +0 -1
- package/dist/chunk-E7UAOUMY.js +0 -75
- package/dist/chunk-E7UAOUMY.js.map +0 -1
- package/dist/chunk-F2IMUDXZ.js.map +0 -1
- package/dist/chunk-HEHYGYOX.js.map +0 -1
- package/dist/chunk-IM4QE42D.js.map +0 -1
- package/dist/chunk-MX64ZF6I.js.map +0 -1
- package/dist/chunk-SAUPYVLF.js.map +0 -1
- package/dist/chunk-THRPYOFK.js.map +0 -1
- package/dist/chunk-UCQSRW7Z.js.map +0 -1
- package/dist/chunk-VGZZXKBR.js.map +0 -1
- package/dist/chunk-YGPFYGA6.js.map +0 -1
- package/dist/chunk-YHCN776L.js.map +0 -1
- /package/dist/{DataTable-GUFUNZ3N.js.map → DataTable-WKRZD47S.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-643PUAIM.js.map → UnifiedAuthProvider-FTSG5XH7.js.map} +0 -0
- /package/dist/{api-YP7XD5L6.js.map → api-IHKALJZD.js.map} +0 -0
- /package/dist/{chunk-HESYZWZW.js.map → chunk-QWWZ5CAQ.js.map} +0 -0
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
useCan
|
|
3
|
-
|
|
4
|
-
} from "./chunk-3GOZZZYH.js";
|
|
2
|
+
useCan
|
|
3
|
+
} from "./chunk-VRGWKHDB.js";
|
|
5
4
|
import {
|
|
6
5
|
toast,
|
|
7
6
|
useDataTablePerformance
|
|
8
7
|
} from "./chunk-6C4YBBJM.js";
|
|
8
|
+
import {
|
|
9
|
+
useResolvedScope
|
|
10
|
+
} from "./chunk-OETXORNB.js";
|
|
9
11
|
import {
|
|
10
12
|
useUnifiedAuth
|
|
11
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6LTQQAT6.js";
|
|
12
14
|
import {
|
|
13
15
|
cn,
|
|
14
16
|
renderSafeHtml
|
|
@@ -5556,7 +5558,7 @@ function getButtonClasses(variant = "default", size = "default") {
|
|
|
5556
5558
|
default: "h-9 px-4 py-2",
|
|
5557
5559
|
sm: "h-8 rounded-md px-3 text-xs",
|
|
5558
5560
|
lg: "h-10 rounded-md px-8",
|
|
5559
|
-
icon: "
|
|
5561
|
+
icon: "size-8"
|
|
5560
5562
|
};
|
|
5561
5563
|
return `${baseClasses} ${variantClasses[variant]} ${sizeClasses2[size]}`;
|
|
5562
5564
|
}
|
|
@@ -5759,7 +5761,9 @@ var useSelectState = ({
|
|
|
5759
5761
|
onOpenChange?.(false);
|
|
5760
5762
|
}, [controlledValue, onValueChange, controlledOpen, onOpenChange]);
|
|
5761
5763
|
const setOpen = React4.useCallback((newOpen) => {
|
|
5762
|
-
if (disabled)
|
|
5764
|
+
if (disabled) {
|
|
5765
|
+
return;
|
|
5766
|
+
}
|
|
5763
5767
|
if (newOpen) {
|
|
5764
5768
|
const allTriggers = document.querySelectorAll('[data-testid="select-trigger"]');
|
|
5765
5769
|
allTriggers.forEach((trigger) => {
|
|
@@ -5810,22 +5814,22 @@ var useSelectEvents = ({ state, actions, selectRef }) => {
|
|
|
5810
5814
|
}
|
|
5811
5815
|
}, [actions, selectRef]);
|
|
5812
5816
|
React4.useEffect(() => {
|
|
5817
|
+
if (!state.open) return;
|
|
5813
5818
|
const handleClickOutside = (event) => {
|
|
5814
5819
|
const selectElement = selectRef.current;
|
|
5815
|
-
|
|
5816
|
-
const
|
|
5817
|
-
|
|
5818
|
-
const isSelectContent = clickedElement?.closest('[data-testid="select-content"]');
|
|
5819
|
-
if (state.open && selectElement && !selectElement.contains(event.target) && !isSelectItem && !isSearchInput && !isSelectContent && !isSelecting) {
|
|
5820
|
+
if (!selectElement) return;
|
|
5821
|
+
const target = event.target;
|
|
5822
|
+
if (!selectElement.contains(target) && !isSelecting) {
|
|
5820
5823
|
actions.setOpen(false);
|
|
5821
5824
|
}
|
|
5822
5825
|
};
|
|
5823
|
-
|
|
5824
|
-
document.addEventListener("
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5826
|
+
const timeoutId = setTimeout(() => {
|
|
5827
|
+
document.addEventListener("click", handleClickOutside, true);
|
|
5828
|
+
}, 100);
|
|
5829
|
+
return () => {
|
|
5830
|
+
clearTimeout(timeoutId);
|
|
5831
|
+
document.removeEventListener("click", handleClickOutside, true);
|
|
5832
|
+
};
|
|
5829
5833
|
}, [state.open, actions, selectRef, isSelecting]);
|
|
5830
5834
|
React4.useEffect(() => {
|
|
5831
5835
|
let timeoutId = null;
|
|
@@ -6024,6 +6028,10 @@ var Select = React4.forwardRef(
|
|
|
6024
6028
|
className: cn("relative", className),
|
|
6025
6029
|
"data-value": state.value,
|
|
6026
6030
|
"data-testid": "select-root",
|
|
6031
|
+
onSubmit: (e) => {
|
|
6032
|
+
e.preventDefault();
|
|
6033
|
+
e.stopPropagation();
|
|
6034
|
+
},
|
|
6027
6035
|
children: /* @__PURE__ */ jsx4(SelectContext.Provider, { value: contextValue, children })
|
|
6028
6036
|
}
|
|
6029
6037
|
);
|
|
@@ -6034,9 +6042,20 @@ var SelectTrigger = React4.forwardRef(
|
|
|
6034
6042
|
({ children, className, variant = "outline", size = "default", asChild = false, ...props }, ref) => {
|
|
6035
6043
|
const { open, disabled, value, actions, direction = "down" } = useSelectContext();
|
|
6036
6044
|
const opensUpward = direction === "up";
|
|
6037
|
-
const
|
|
6045
|
+
const handleClickRef = React4.useRef();
|
|
6046
|
+
const handleClick = React4.useCallback((e) => {
|
|
6047
|
+
if (disabled) {
|
|
6048
|
+
e.preventDefault();
|
|
6049
|
+
e.stopPropagation();
|
|
6050
|
+
return;
|
|
6051
|
+
}
|
|
6052
|
+
e.preventDefault();
|
|
6053
|
+
e.stopPropagation();
|
|
6038
6054
|
actions.setOpen(!open);
|
|
6039
|
-
};
|
|
6055
|
+
}, [disabled, open, actions]);
|
|
6056
|
+
React4.useEffect(() => {
|
|
6057
|
+
handleClickRef.current = handleClick;
|
|
6058
|
+
}, [handleClick]);
|
|
6040
6059
|
const handleKeyDown = (e) => {
|
|
6041
6060
|
if (disabled) return;
|
|
6042
6061
|
switch (e.key) {
|
|
@@ -6100,7 +6119,7 @@ var SelectTrigger = React4.forwardRef(
|
|
|
6100
6119
|
ChevronDown,
|
|
6101
6120
|
{
|
|
6102
6121
|
className: cn(
|
|
6103
|
-
"
|
|
6122
|
+
"size-4 opacity-50 transition-transform pointer-events-none float-right",
|
|
6104
6123
|
open && "rotate-180"
|
|
6105
6124
|
)
|
|
6106
6125
|
},
|
|
@@ -6109,10 +6128,17 @@ var SelectTrigger = React4.forwardRef(
|
|
|
6109
6128
|
]
|
|
6110
6129
|
});
|
|
6111
6130
|
}
|
|
6131
|
+
const handleRef = React4.useCallback((node) => {
|
|
6132
|
+
if (typeof ref === "function") {
|
|
6133
|
+
ref(node);
|
|
6134
|
+
} else if (ref) {
|
|
6135
|
+
ref.current = node;
|
|
6136
|
+
}
|
|
6137
|
+
}, [ref]);
|
|
6112
6138
|
return /* @__PURE__ */ jsxs2(
|
|
6113
6139
|
Button,
|
|
6114
6140
|
{
|
|
6115
|
-
ref,
|
|
6141
|
+
ref: handleRef,
|
|
6116
6142
|
type: "button",
|
|
6117
6143
|
role: "combobox",
|
|
6118
6144
|
"aria-expanded": open,
|
|
@@ -6133,7 +6159,9 @@ var SelectTrigger = React4.forwardRef(
|
|
|
6133
6159
|
textOverflow: "ellipsis",
|
|
6134
6160
|
whiteSpace: "nowrap"
|
|
6135
6161
|
},
|
|
6136
|
-
onClick:
|
|
6162
|
+
onClick: (e) => {
|
|
6163
|
+
handleClick(e);
|
|
6164
|
+
},
|
|
6137
6165
|
onKeyDown: handleKeyDown,
|
|
6138
6166
|
"data-testid": "select-trigger",
|
|
6139
6167
|
"data-value": value,
|
|
@@ -6144,7 +6172,7 @@ var SelectTrigger = React4.forwardRef(
|
|
|
6144
6172
|
ChevronDown,
|
|
6145
6173
|
{
|
|
6146
6174
|
className: cn(
|
|
6147
|
-
"
|
|
6175
|
+
"size-4 opacity-50 transition-transform pointer-events-none float-right",
|
|
6148
6176
|
open && "rotate-180"
|
|
6149
6177
|
)
|
|
6150
6178
|
}
|
|
@@ -6158,7 +6186,16 @@ SelectTrigger.displayName = "SelectTrigger";
|
|
|
6158
6186
|
var SelectValue = React4.forwardRef(
|
|
6159
6187
|
({ placeholder = "Select an option...", children }, ref) => {
|
|
6160
6188
|
const { selectedText } = useSelectContext();
|
|
6161
|
-
return /* @__PURE__ */ jsx4(
|
|
6189
|
+
return /* @__PURE__ */ jsx4(
|
|
6190
|
+
"span",
|
|
6191
|
+
{
|
|
6192
|
+
ref,
|
|
6193
|
+
"data-testid": "select-value",
|
|
6194
|
+
style: { pointerEvents: "none" },
|
|
6195
|
+
className: "pointer-events-none",
|
|
6196
|
+
children: children || (selectedText ? selectedText : placeholder)
|
|
6197
|
+
}
|
|
6198
|
+
);
|
|
6162
6199
|
}
|
|
6163
6200
|
);
|
|
6164
6201
|
SelectValue.displayName = "SelectValue";
|
|
@@ -6217,7 +6254,7 @@ var SelectContent = React4.forwardRef(
|
|
|
6217
6254
|
role: "listbox",
|
|
6218
6255
|
children: [
|
|
6219
6256
|
searchable && /* @__PURE__ */ jsx4("div", { className: "p-2 border-b border-main-200", children: /* @__PURE__ */ jsxs2("div", { className: "relative", children: [
|
|
6220
|
-
/* @__PURE__ */ jsx4(Search, { className: "absolute left-2 top-1/2 transform -translate-y-1/2
|
|
6257
|
+
/* @__PURE__ */ jsx4(Search, { className: "absolute left-2 top-1/2 transform -translate-y-1/2 size-4 text-main-400" }),
|
|
6221
6258
|
/* @__PURE__ */ jsx4(
|
|
6222
6259
|
"input",
|
|
6223
6260
|
{
|
|
@@ -6245,7 +6282,7 @@ var SelectContent = React4.forwardRef(
|
|
|
6245
6282
|
className: "absolute right-2 top-1/2 transform -translate-y-1/2 text-main-400 hover:text-main-600",
|
|
6246
6283
|
"data-testid": "select-clear-search",
|
|
6247
6284
|
"aria-label": "Clear search",
|
|
6248
|
-
children: /* @__PURE__ */ jsx4(X, { className: "
|
|
6285
|
+
children: /* @__PURE__ */ jsx4(X, { className: "size-4" })
|
|
6249
6286
|
}
|
|
6250
6287
|
)
|
|
6251
6288
|
] }) }),
|
|
@@ -6338,7 +6375,7 @@ var SelectItem = React4.forwardRef(
|
|
|
6338
6375
|
tabIndex: disabled ? -1 : 0,
|
|
6339
6376
|
children: [
|
|
6340
6377
|
children,
|
|
6341
|
-
isSelected && /* @__PURE__ */ jsx4(Check, { className: "absolute right-2
|
|
6378
|
+
isSelected && /* @__PURE__ */ jsx4(Check, { className: "absolute right-2 size-4 flex-shrink-0 mt-0.5" })
|
|
6342
6379
|
]
|
|
6343
6380
|
}
|
|
6344
6381
|
);
|
|
@@ -6413,7 +6450,7 @@ function GroupingDropdown({
|
|
|
6413
6450
|
variant: "outline",
|
|
6414
6451
|
className: className || "",
|
|
6415
6452
|
children: [
|
|
6416
|
-
/* @__PURE__ */ jsx5(Group, { className: "
|
|
6453
|
+
/* @__PURE__ */ jsx5(Group, { className: "size-4 mr-2 flex-shrink-0" }),
|
|
6417
6454
|
/* @__PURE__ */ jsx5("span", { className: "truncate", children: "Grouping" })
|
|
6418
6455
|
]
|
|
6419
6456
|
}
|
|
@@ -6457,7 +6494,7 @@ var Checkbox = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
6457
6494
|
{
|
|
6458
6495
|
ref,
|
|
6459
6496
|
className: cn(
|
|
6460
|
-
"peer
|
|
6497
|
+
"peer size-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
6461
6498
|
className
|
|
6462
6499
|
),
|
|
6463
6500
|
...props,
|
|
@@ -6465,7 +6502,7 @@ var Checkbox = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
6465
6502
|
CheckboxPrimitive.Indicator,
|
|
6466
6503
|
{
|
|
6467
6504
|
className: cn("flex items-center justify-center text-current"),
|
|
6468
|
-
children: /* @__PURE__ */ jsx6(Check2, { className: "
|
|
6505
|
+
children: /* @__PURE__ */ jsx6(Check2, { className: "size-4" })
|
|
6469
6506
|
}
|
|
6470
6507
|
)
|
|
6471
6508
|
}
|
|
@@ -6488,7 +6525,7 @@ function ColumnVisibilityDropdown({
|
|
|
6488
6525
|
{
|
|
6489
6526
|
variant: "outline",
|
|
6490
6527
|
children: [
|
|
6491
|
-
/* @__PURE__ */ jsx7(Settings2, { className: "
|
|
6528
|
+
/* @__PURE__ */ jsx7(Settings2, { className: "size-4 mr-2 flex-shrink-0" }),
|
|
6492
6529
|
/* @__PURE__ */ jsx7("span", { className: "truncate", children: "Columns" })
|
|
6493
6530
|
]
|
|
6494
6531
|
}
|
|
@@ -6509,7 +6546,7 @@ function ColumnVisibilityDropdown({
|
|
|
6509
6546
|
});
|
|
6510
6547
|
},
|
|
6511
6548
|
children: [
|
|
6512
|
-
/* @__PURE__ */ jsx7(Eye, { className: "
|
|
6549
|
+
/* @__PURE__ */ jsx7(Eye, { className: "size-3 mr-1" }),
|
|
6513
6550
|
"Show All"
|
|
6514
6551
|
]
|
|
6515
6552
|
}
|
|
@@ -6528,7 +6565,7 @@ function ColumnVisibilityDropdown({
|
|
|
6528
6565
|
});
|
|
6529
6566
|
},
|
|
6530
6567
|
children: [
|
|
6531
|
-
/* @__PURE__ */ jsx7(EyeOff, { className: "
|
|
6568
|
+
/* @__PURE__ */ jsx7(EyeOff, { className: "size-3 mr-1" }),
|
|
6532
6569
|
"Hide All"
|
|
6533
6570
|
]
|
|
6534
6571
|
}
|
|
@@ -6622,7 +6659,7 @@ function DataTableToolbar({
|
|
|
6622
6659
|
variant: "outline",
|
|
6623
6660
|
onClick: onToggleFilterRow,
|
|
6624
6661
|
children: [
|
|
6625
|
-
/* @__PURE__ */ jsx8(Filter, { className: "
|
|
6662
|
+
/* @__PURE__ */ jsx8(Filter, { className: "size-4 mr-2 flex-shrink-0" }),
|
|
6626
6663
|
/* @__PURE__ */ jsx8("span", { className: "truncate", children: showFilterRow ? "Hide Filters" : "Show Filters" })
|
|
6627
6664
|
]
|
|
6628
6665
|
}
|
|
@@ -6633,7 +6670,7 @@ function DataTableToolbar({
|
|
|
6633
6670
|
variant: "outline",
|
|
6634
6671
|
onClick: onCreateRow,
|
|
6635
6672
|
children: [
|
|
6636
|
-
/* @__PURE__ */ jsx8(Plus, { className: "
|
|
6673
|
+
/* @__PURE__ */ jsx8(Plus, { className: "size-4 mr-2 flex-shrink-0" }),
|
|
6637
6674
|
/* @__PURE__ */ jsx8("span", { className: "truncate", children: "Add Row" })
|
|
6638
6675
|
]
|
|
6639
6676
|
}
|
|
@@ -6645,7 +6682,7 @@ function DataTableToolbar({
|
|
|
6645
6682
|
onClick: onImportClick,
|
|
6646
6683
|
"data-restore-target": "datatable-import-button",
|
|
6647
6684
|
children: [
|
|
6648
|
-
/* @__PURE__ */ jsx8(Upload, { className: "
|
|
6685
|
+
/* @__PURE__ */ jsx8(Upload, { className: "size-4 mr-2 flex-shrink-0" }),
|
|
6649
6686
|
/* @__PURE__ */ jsx8("span", { className: "truncate", children: "Import" })
|
|
6650
6687
|
]
|
|
6651
6688
|
}
|
|
@@ -6656,7 +6693,7 @@ function DataTableToolbar({
|
|
|
6656
6693
|
variant: "outline",
|
|
6657
6694
|
onClick: onExport,
|
|
6658
6695
|
children: [
|
|
6659
|
-
/* @__PURE__ */ jsx8(Download, { className: "
|
|
6696
|
+
/* @__PURE__ */ jsx8(Download, { className: "size-4 mr-2 flex-shrink-0" }),
|
|
6660
6697
|
/* @__PURE__ */ jsx8("span", { className: "truncate", children: "Export" })
|
|
6661
6698
|
]
|
|
6662
6699
|
}
|
|
@@ -6668,7 +6705,7 @@ function DataTableToolbar({
|
|
|
6668
6705
|
onClick: () => onDeleteSelected?.(rowSelection),
|
|
6669
6706
|
disabled: Object.values(rowSelection).filter(Boolean).length === 0,
|
|
6670
6707
|
children: [
|
|
6671
|
-
/* @__PURE__ */ jsx8(Trash2, { className: "
|
|
6708
|
+
/* @__PURE__ */ jsx8(Trash2, { className: "size-4 mr-2 flex-shrink-0" }),
|
|
6672
6709
|
/* @__PURE__ */ jsx8("span", { className: "truncate", children: "Delete" })
|
|
6673
6710
|
]
|
|
6674
6711
|
}
|
|
@@ -6707,7 +6744,7 @@ function EmptyState({
|
|
|
6707
6744
|
{
|
|
6708
6745
|
role: "img",
|
|
6709
6746
|
"aria-hidden": "true",
|
|
6710
|
-
className: "
|
|
6747
|
+
className: "size-12 text-muted-foreground mb-4",
|
|
6711
6748
|
"data-testid": Icon === Database ? "lucide-database" : Icon === User ? "lucide-user" : "custom-icon"
|
|
6712
6749
|
}
|
|
6713
6750
|
),
|
|
@@ -6715,11 +6752,11 @@ function EmptyState({
|
|
|
6715
6752
|
/* @__PURE__ */ jsx9("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: description || defaultDescription }),
|
|
6716
6753
|
isFiltered && onClearFilters || action ? /* @__PURE__ */ jsxs6("div", { className: "flex gap-2", children: [
|
|
6717
6754
|
isFiltered && onClearFilters && /* @__PURE__ */ jsxs6(Button, { variant: "outline", onClick: onClearFilters, children: [
|
|
6718
|
-
/* @__PURE__ */ jsx9(Search3, { className: "
|
|
6755
|
+
/* @__PURE__ */ jsx9(Search3, { className: "size-4 mr-2" }),
|
|
6719
6756
|
"Clear filters"
|
|
6720
6757
|
] }),
|
|
6721
6758
|
action && /* @__PURE__ */ jsxs6(Button, { onClick: action.onClick, children: [
|
|
6722
|
-
/* @__PURE__ */ jsx9(Plus2, { className: "
|
|
6759
|
+
/* @__PURE__ */ jsx9(Plus2, { className: "size-4 mr-2" }),
|
|
6723
6760
|
action.label
|
|
6724
6761
|
] })
|
|
6725
6762
|
] }) : null
|
|
@@ -6837,7 +6874,7 @@ function ColumnFilter({
|
|
|
6837
6874
|
{
|
|
6838
6875
|
variant: "ghost",
|
|
6839
6876
|
onClick: clearFilter,
|
|
6840
|
-
children: /* @__PURE__ */ jsx10(X2, { className: "
|
|
6877
|
+
children: /* @__PURE__ */ jsx10(X2, { className: "size-3" })
|
|
6841
6878
|
}
|
|
6842
6879
|
),
|
|
6843
6880
|
hasFilter && /* @__PURE__ */ jsx10("div", { className: "absolute -top-1 -right-1 h-2 w-2 bg-main-500 rounded-full" })
|
|
@@ -6997,17 +7034,17 @@ function ActionButtonsComponent({
|
|
|
6997
7034
|
"aria-disabled": isDisabled,
|
|
6998
7035
|
"data-testid": action.testId,
|
|
6999
7036
|
"aria-label": label,
|
|
7000
|
-
className: "
|
|
7001
|
-
children: Icon && /* @__PURE__ */ jsx12(Icon, { className: "
|
|
7037
|
+
className: "size-8 p-0",
|
|
7038
|
+
children: Icon && /* @__PURE__ */ jsx12(Icon, { className: "size-4" })
|
|
7002
7039
|
},
|
|
7003
7040
|
actionIndex
|
|
7004
7041
|
);
|
|
7005
7042
|
}) });
|
|
7006
7043
|
}
|
|
7007
7044
|
return /* @__PURE__ */ jsxs8(Select, { children: [
|
|
7008
|
-
/* @__PURE__ */ jsx12(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs8(Button, { variant: "ghost", className: "
|
|
7045
|
+
/* @__PURE__ */ jsx12(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs8(Button, { variant: "ghost", className: "size-8 p-0", children: [
|
|
7009
7046
|
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Open menu" }),
|
|
7010
|
-
/* @__PURE__ */ jsx12(MoreHorizontal, { className: "
|
|
7047
|
+
/* @__PURE__ */ jsx12(MoreHorizontal, { className: "size-4" })
|
|
7011
7048
|
] }) }),
|
|
7012
7049
|
/* @__PURE__ */ jsx12(SelectContent, { className: "!bg-main-50 border border-sec-200 shadow-lg z-[9999]", style: { backgroundColor: "white" }, children: visibleActions.map((action, actionIndex) => {
|
|
7013
7050
|
const { Icon, label } = renderAction(action, actionIndex);
|
|
@@ -7025,7 +7062,7 @@ function ActionButtonsComponent({
|
|
|
7025
7062
|
className: "flex items-center gap-2",
|
|
7026
7063
|
"aria-disabled": isDisabled,
|
|
7027
7064
|
children: [
|
|
7028
|
-
Icon && /* @__PURE__ */ jsx12(Icon, { className: "
|
|
7065
|
+
Icon && /* @__PURE__ */ jsx12(Icon, { className: "size-4" }),
|
|
7029
7066
|
/* @__PURE__ */ jsx12("span", { children: label })
|
|
7030
7067
|
]
|
|
7031
7068
|
},
|
|
@@ -7049,7 +7086,7 @@ function SelectEditField({
|
|
|
7049
7086
|
onChange,
|
|
7050
7087
|
className
|
|
7051
7088
|
}) {
|
|
7052
|
-
const
|
|
7089
|
+
const logger2 = React9.useMemo(() => createLogger("SelectEditField"), []);
|
|
7053
7090
|
const isSearchable = columnDef.selectSearchable !== false;
|
|
7054
7091
|
const isCreatable = columnDef.creatable === true;
|
|
7055
7092
|
const selectRef = React9.useRef(null);
|
|
@@ -7142,9 +7179,9 @@ function SelectEditField({
|
|
|
7142
7179
|
setSearchTerm("");
|
|
7143
7180
|
setShowCreateOption(false);
|
|
7144
7181
|
} catch (error) {
|
|
7145
|
-
|
|
7182
|
+
logger2.error("Error creating new item:", error);
|
|
7146
7183
|
}
|
|
7147
|
-
}, [isCreatable, columnDef.onCreateNew, searchTerm, onChange,
|
|
7184
|
+
}, [isCreatable, columnDef.onCreateNew, searchTerm, onChange, logger2]);
|
|
7148
7185
|
return /* @__PURE__ */ jsxs9(
|
|
7149
7186
|
Select,
|
|
7150
7187
|
{
|
|
@@ -7299,8 +7336,8 @@ function EditableRow({
|
|
|
7299
7336
|
return /* @__PURE__ */ jsx13("td", { role: "cell", children: /* @__PURE__ */ jsx13("div", { className: cell.column.columnDef.meta?.align === "right" ? "text-right" : "", children: isSystemColumn ? (
|
|
7300
7337
|
// System columns: render their normal cell content (checkbox for select, buttons for actions)
|
|
7301
7338
|
cell.column.id === "actions" ? /* @__PURE__ */ jsxs9("div", { className: "flex gap-1", children: [
|
|
7302
|
-
/* @__PURE__ */ jsx13(Button, { onClick: onSave, size: "sm", variant: "default", "aria-label": "Save changes", children: /* @__PURE__ */ jsx13(Check3, { className: "
|
|
7303
|
-
/* @__PURE__ */ jsx13(Button, { onClick: onCancel, size: "sm", variant: "outline", "aria-label": "Cancel editing", children: /* @__PURE__ */ jsx13(X3, { className: "
|
|
7339
|
+
/* @__PURE__ */ jsx13(Button, { onClick: onSave, size: "sm", variant: "default", "aria-label": "Save changes", children: /* @__PURE__ */ jsx13(Check3, { className: "size-4" }) }),
|
|
7340
|
+
/* @__PURE__ */ jsx13(Button, { onClick: onCancel, size: "sm", variant: "outline", "aria-label": "Cancel editing", children: /* @__PURE__ */ jsx13(X3, { className: "size-4" }) })
|
|
7304
7341
|
] }) : (
|
|
7305
7342
|
// Select column: render the checkbox normally
|
|
7306
7343
|
flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
@@ -7396,11 +7433,17 @@ function groupHierarchicalData(data) {
|
|
|
7396
7433
|
return groups;
|
|
7397
7434
|
}
|
|
7398
7435
|
var depthCache = /* @__PURE__ */ new WeakMap();
|
|
7399
|
-
|
|
7400
|
-
|
|
7436
|
+
var logger = createLogger("HierarchicalUtils");
|
|
7437
|
+
function getRowDepth(row, allData, maxDepth = 100) {
|
|
7438
|
+
let cachedDepthsByLimit = depthCache.get(allData);
|
|
7439
|
+
if (!cachedDepthsByLimit) {
|
|
7440
|
+
cachedDepthsByLimit = /* @__PURE__ */ new Map();
|
|
7441
|
+
depthCache.set(allData, cachedDepthsByLimit);
|
|
7442
|
+
}
|
|
7443
|
+
let cachedDepths = cachedDepthsByLimit.get(maxDepth);
|
|
7401
7444
|
if (!cachedDepths) {
|
|
7402
7445
|
cachedDepths = /* @__PURE__ */ new Map();
|
|
7403
|
-
|
|
7446
|
+
cachedDepthsByLimit.set(maxDepth, cachedDepths);
|
|
7404
7447
|
}
|
|
7405
7448
|
if (cachedDepths.has(row.id)) {
|
|
7406
7449
|
return cachedDepths.get(row.id);
|
|
@@ -7417,8 +7460,17 @@ function getRowDepth(row, allData) {
|
|
|
7417
7460
|
parentMap.set(item.id, item);
|
|
7418
7461
|
}
|
|
7419
7462
|
});
|
|
7463
|
+
const visited = /* @__PURE__ */ new Set();
|
|
7420
7464
|
let current = row;
|
|
7421
|
-
while (current.parentId) {
|
|
7465
|
+
while (current.parentId && depth < maxDepth) {
|
|
7466
|
+
if (visited.has(current.id)) {
|
|
7467
|
+
logger.warn("Circular reference detected while calculating row depth", {
|
|
7468
|
+
rowId: row.id,
|
|
7469
|
+
currentId: current.id
|
|
7470
|
+
});
|
|
7471
|
+
break;
|
|
7472
|
+
}
|
|
7473
|
+
visited.add(current.id);
|
|
7422
7474
|
depth++;
|
|
7423
7475
|
const parent = parentMap.get(current.parentId);
|
|
7424
7476
|
if (!parent || parent.isParent) {
|
|
@@ -7430,6 +7482,12 @@ function getRowDepth(row, allData) {
|
|
|
7430
7482
|
break;
|
|
7431
7483
|
}
|
|
7432
7484
|
}
|
|
7485
|
+
if (depth >= maxDepth && current.parentId) {
|
|
7486
|
+
logger.warn("Maximum hierarchy depth reached while calculating row depth", {
|
|
7487
|
+
rowId: row.id,
|
|
7488
|
+
maxDepth
|
|
7489
|
+
});
|
|
7490
|
+
}
|
|
7433
7491
|
}
|
|
7434
7492
|
cachedDepths.set(row.id, depth);
|
|
7435
7493
|
return depth;
|
|
@@ -7558,7 +7616,7 @@ function SelectEditField2({
|
|
|
7558
7616
|
placeholder,
|
|
7559
7617
|
onChange
|
|
7560
7618
|
}) {
|
|
7561
|
-
const
|
|
7619
|
+
const logger2 = React10.useMemo(() => createLogger("SelectEditField"), []);
|
|
7562
7620
|
const isSearchable = columnDef.selectSearchable !== false;
|
|
7563
7621
|
const isCreatable = columnDef.creatable === true;
|
|
7564
7622
|
const selectRef = React10.useRef(null);
|
|
@@ -7658,9 +7716,9 @@ function SelectEditField2({
|
|
|
7658
7716
|
setSearchTerm("");
|
|
7659
7717
|
setShowCreateOption(false);
|
|
7660
7718
|
} catch (error) {
|
|
7661
|
-
|
|
7719
|
+
logger2.error("Error creating new item:", error);
|
|
7662
7720
|
}
|
|
7663
|
-
}, [isCreatable, columnDef.onCreateNew, searchTerm, onChange,
|
|
7721
|
+
}, [isCreatable, columnDef.onCreateNew, searchTerm, onChange, logger2]);
|
|
7664
7722
|
return /* @__PURE__ */ jsxs10(
|
|
7665
7723
|
Select,
|
|
7666
7724
|
{
|
|
@@ -7799,7 +7857,7 @@ var RowComponent = React10.memo(({
|
|
|
7799
7857
|
}) => {
|
|
7800
7858
|
const rowRef = useRef2(null);
|
|
7801
7859
|
const firstInputRef = useRef2(null);
|
|
7802
|
-
const
|
|
7860
|
+
const logger2 = React10.useMemo(() => createLogger("RowComponent"), []);
|
|
7803
7861
|
const rowId = getRowIdSafe(row.original, row.index, getRowId);
|
|
7804
7862
|
const hierarchicalRow = row.original;
|
|
7805
7863
|
const isHierarchical = hierarchical?.enabled && hierarchicalRow?.isParent !== void 0;
|
|
@@ -7858,7 +7916,7 @@ var RowComponent = React10.memo(({
|
|
|
7858
7916
|
size: "sm",
|
|
7859
7917
|
onClick: () => row.toggleExpanded(),
|
|
7860
7918
|
className: "p-0 h-auto mr-2",
|
|
7861
|
-
children: isExpanded ? /* @__PURE__ */ jsx14(ChevronDown2, { className: "
|
|
7919
|
+
children: isExpanded ? /* @__PURE__ */ jsx14(ChevronDown2, { className: "size-4" }) : /* @__PURE__ */ jsx14(ChevronRight, { className: "size-4" })
|
|
7862
7920
|
}
|
|
7863
7921
|
),
|
|
7864
7922
|
/* @__PURE__ */ jsxs10("span", { className: "text-sm", children: [
|
|
@@ -7907,7 +7965,7 @@ var RowComponent = React10.memo(({
|
|
|
7907
7965
|
cell.id
|
|
7908
7966
|
);
|
|
7909
7967
|
} catch (error) {
|
|
7910
|
-
|
|
7968
|
+
logger2.warn("Error in aggregation function:", error);
|
|
7911
7969
|
return /* @__PURE__ */ jsx14(
|
|
7912
7970
|
"td",
|
|
7913
7971
|
{
|
|
@@ -7983,10 +8041,10 @@ var RowComponent = React10.memo(({
|
|
|
7983
8041
|
variant: "ghost",
|
|
7984
8042
|
size: "sm",
|
|
7985
8043
|
onClick: () => hierarchical?.state?.toggleRow(rowId),
|
|
7986
|
-
className: "
|
|
8044
|
+
className: "size-6 p-0 flex-shrink-0",
|
|
7987
8045
|
"aria-label": isExpanded ? "Collapse row" : "Expand row",
|
|
7988
8046
|
title: isExpanded ? "Collapse row" : "Expand row",
|
|
7989
|
-
children: isExpanded ? /* @__PURE__ */ jsx14(ChevronDown2, { className: "
|
|
8047
|
+
children: isExpanded ? /* @__PURE__ */ jsx14(ChevronDown2, { className: "size-4" }) : /* @__PURE__ */ jsx14(ChevronRight, { className: "size-4" })
|
|
7990
8048
|
}
|
|
7991
8049
|
),
|
|
7992
8050
|
cell.column.id === "actions" ? /* @__PURE__ */ jsx14(
|
|
@@ -8049,7 +8107,7 @@ function UnifiedTableBody({
|
|
|
8049
8107
|
rbac,
|
|
8050
8108
|
permissions
|
|
8051
8109
|
}) {
|
|
8052
|
-
const
|
|
8110
|
+
const logger2 = React10.useMemo(() => createLogger("UnifiedTableBody"), []);
|
|
8053
8111
|
const headerRef = useRef2(null);
|
|
8054
8112
|
const bodyRef = useRef2(null);
|
|
8055
8113
|
const parentRef = useRef2(null);
|
|
@@ -8068,12 +8126,12 @@ function UnifiedTableBody({
|
|
|
8068
8126
|
const totalSize = effectiveShouldVirtualize ? virtualizer.getTotalSize() : 0;
|
|
8069
8127
|
useEffect2(() => {
|
|
8070
8128
|
if (shouldVirtualize && !hasScrollContainer) {
|
|
8071
|
-
|
|
8129
|
+
logger2.warn("Virtualization enabled but no scroll container found. Falling back to standard rendering.", {
|
|
8072
8130
|
rowsLength: rows.length,
|
|
8073
8131
|
dataLength
|
|
8074
8132
|
});
|
|
8075
8133
|
}
|
|
8076
|
-
}, [shouldVirtualize, hasScrollContainer, rows.length, dataLength,
|
|
8134
|
+
}, [shouldVirtualize, hasScrollContainer, rows.length, dataLength, logger2]);
|
|
8077
8135
|
const renderTableContent = () => {
|
|
8078
8136
|
if (rows.length === 0) {
|
|
8079
8137
|
return /* @__PURE__ */ jsx14("tr", { children: /* @__PURE__ */ jsx14(
|
|
@@ -8221,18 +8279,18 @@ function UnifiedTableBody({
|
|
|
8221
8279
|
"button",
|
|
8222
8280
|
{
|
|
8223
8281
|
onClick: onSaveCreation,
|
|
8224
|
-
className: "
|
|
8282
|
+
className: "size-8 p-0 hover:bg-muted/50 flex items-center justify-center",
|
|
8225
8283
|
title: "Save new row",
|
|
8226
|
-
children: /* @__PURE__ */ jsx14("svg", { className: "
|
|
8284
|
+
children: /* @__PURE__ */ jsx14("svg", { className: "size-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx14("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) })
|
|
8227
8285
|
}
|
|
8228
8286
|
),
|
|
8229
8287
|
/* @__PURE__ */ jsx14(
|
|
8230
8288
|
"button",
|
|
8231
8289
|
{
|
|
8232
8290
|
onClick: onCancelCreation,
|
|
8233
|
-
className: "
|
|
8291
|
+
className: "size-8 p-0 hover:bg-muted/50 flex items-center justify-center",
|
|
8234
8292
|
title: "Cancel new row",
|
|
8235
|
-
children: /* @__PURE__ */ jsx14("svg", { className: "
|
|
8293
|
+
children: /* @__PURE__ */ jsx14("svg", { className: "size-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx14("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
8236
8294
|
}
|
|
8237
8295
|
)
|
|
8238
8296
|
]
|
|
@@ -8362,29 +8420,29 @@ function calculatePaginationState(config) {
|
|
|
8362
8420
|
}
|
|
8363
8421
|
function validatePaginationConfig(config) {
|
|
8364
8422
|
const { mode, table, serverData, onPageChange, onPageSizeChange } = config;
|
|
8365
|
-
const
|
|
8423
|
+
const logger2 = createLogger("PaginationUtils");
|
|
8366
8424
|
let isValid = true;
|
|
8367
8425
|
if (mode === "server") {
|
|
8368
8426
|
if (!serverData) {
|
|
8369
|
-
|
|
8427
|
+
logger2.warn("Server mode requires serverData");
|
|
8370
8428
|
isValid = false;
|
|
8371
8429
|
}
|
|
8372
8430
|
if (!onPageChange) {
|
|
8373
|
-
|
|
8431
|
+
logger2.warn("Server mode requires onPageChange callback");
|
|
8374
8432
|
isValid = false;
|
|
8375
8433
|
}
|
|
8376
8434
|
if (!onPageSizeChange) {
|
|
8377
|
-
|
|
8435
|
+
logger2.warn("Server mode requires onPageSizeChange callback");
|
|
8378
8436
|
isValid = false;
|
|
8379
8437
|
}
|
|
8380
8438
|
}
|
|
8381
8439
|
if ((mode === "client" || mode === "hybrid") && !table) {
|
|
8382
|
-
|
|
8440
|
+
logger2.warn(`${mode} mode requires table instance`);
|
|
8383
8441
|
isValid = false;
|
|
8384
8442
|
}
|
|
8385
8443
|
if (mode === "hybrid") {
|
|
8386
8444
|
if (!onPageChange) {
|
|
8387
|
-
|
|
8445
|
+
logger2.warn("Hybrid mode requires onPageChange callback for server pagination");
|
|
8388
8446
|
isValid = false;
|
|
8389
8447
|
}
|
|
8390
8448
|
}
|
|
@@ -8457,11 +8515,11 @@ function PaginationControls({
|
|
|
8457
8515
|
const getModeIcon = () => {
|
|
8458
8516
|
switch (paginationMode) {
|
|
8459
8517
|
case "server":
|
|
8460
|
-
return /* @__PURE__ */ jsx15(Server, { className: "
|
|
8518
|
+
return /* @__PURE__ */ jsx15(Server, { className: "size-3" });
|
|
8461
8519
|
case "hybrid":
|
|
8462
|
-
return /* @__PURE__ */ jsx15(Database2, { className: "
|
|
8520
|
+
return /* @__PURE__ */ jsx15(Database2, { className: "size-3" });
|
|
8463
8521
|
default:
|
|
8464
|
-
return /* @__PURE__ */ jsx15(Zap, { className: "
|
|
8522
|
+
return /* @__PURE__ */ jsx15(Zap, { className: "size-3" });
|
|
8465
8523
|
}
|
|
8466
8524
|
};
|
|
8467
8525
|
const getModeLabel = () => {
|
|
@@ -8520,12 +8578,12 @@ function PaginationControls({
|
|
|
8520
8578
|
{
|
|
8521
8579
|
variant: "outline",
|
|
8522
8580
|
size: "sm",
|
|
8523
|
-
className: "
|
|
8581
|
+
className: "size-8 p-0",
|
|
8524
8582
|
onClick: goToFirstPage,
|
|
8525
8583
|
disabled: !canPreviousPage || isLoading,
|
|
8526
8584
|
"aria-label": "Go to first page",
|
|
8527
8585
|
tabIndex: 0,
|
|
8528
|
-
children: /* @__PURE__ */ jsx15(ChevronsLeft, { className: "
|
|
8586
|
+
children: /* @__PURE__ */ jsx15(ChevronsLeft, { className: "size-4" })
|
|
8529
8587
|
}
|
|
8530
8588
|
),
|
|
8531
8589
|
/* @__PURE__ */ jsx15(
|
|
@@ -8533,12 +8591,12 @@ function PaginationControls({
|
|
|
8533
8591
|
{
|
|
8534
8592
|
variant: "outline",
|
|
8535
8593
|
size: "sm",
|
|
8536
|
-
className: "
|
|
8594
|
+
className: "size-8 p-0",
|
|
8537
8595
|
onClick: goToPreviousPage,
|
|
8538
8596
|
disabled: !canPreviousPage || isLoading,
|
|
8539
8597
|
"aria-label": "Go to previous page",
|
|
8540
8598
|
tabIndex: 0,
|
|
8541
|
-
children: /* @__PURE__ */ jsx15(ChevronLeft, { className: "
|
|
8599
|
+
children: /* @__PURE__ */ jsx15(ChevronLeft, { className: "size-4" })
|
|
8542
8600
|
}
|
|
8543
8601
|
),
|
|
8544
8602
|
/* @__PURE__ */ jsx15(
|
|
@@ -8546,12 +8604,12 @@ function PaginationControls({
|
|
|
8546
8604
|
{
|
|
8547
8605
|
variant: "outline",
|
|
8548
8606
|
size: "sm",
|
|
8549
|
-
className: "
|
|
8607
|
+
className: "size-8 p-0",
|
|
8550
8608
|
onClick: goToNextPage,
|
|
8551
8609
|
disabled: !canNextPage || isLoading,
|
|
8552
8610
|
"aria-label": "Go to next page",
|
|
8553
8611
|
tabIndex: 0,
|
|
8554
|
-
children: /* @__PURE__ */ jsx15(ChevronRight2, { className: "
|
|
8612
|
+
children: /* @__PURE__ */ jsx15(ChevronRight2, { className: "size-4" })
|
|
8555
8613
|
}
|
|
8556
8614
|
),
|
|
8557
8615
|
/* @__PURE__ */ jsx15(
|
|
@@ -8559,12 +8617,12 @@ function PaginationControls({
|
|
|
8559
8617
|
{
|
|
8560
8618
|
variant: "outline",
|
|
8561
8619
|
size: "sm",
|
|
8562
|
-
className: "
|
|
8620
|
+
className: "size-8 p-0",
|
|
8563
8621
|
onClick: goToLastPage,
|
|
8564
8622
|
disabled: !canNextPage || isLoading,
|
|
8565
8623
|
"aria-label": "Go to last page",
|
|
8566
8624
|
tabIndex: 0,
|
|
8567
|
-
children: /* @__PURE__ */ jsx15(ChevronsRight, { className: "
|
|
8625
|
+
children: /* @__PURE__ */ jsx15(ChevronsRight, { className: "size-4" })
|
|
8568
8626
|
}
|
|
8569
8627
|
)
|
|
8570
8628
|
]
|
|
@@ -8620,7 +8678,7 @@ function EnhancedPaginationControls({
|
|
|
8620
8678
|
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
8621
8679
|
function LoadingState() {
|
|
8622
8680
|
return /* @__PURE__ */ jsx16("div", { className: "p-8 text-center", children: /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-center space-x-2", children: [
|
|
8623
|
-
/* @__PURE__ */ jsx16("div", { className: "animate-spin rounded-full
|
|
8681
|
+
/* @__PURE__ */ jsx16("div", { className: "animate-spin rounded-full size-6 border-b-2 border-primary" }),
|
|
8624
8682
|
/* @__PURE__ */ jsx16("span", { "aria-live": "polite", className: "text-muted-foreground", children: "Loading..." })
|
|
8625
8683
|
] }) });
|
|
8626
8684
|
}
|
|
@@ -8643,7 +8701,7 @@ var sizeClasses = {
|
|
|
8643
8701
|
md: "max-w-md",
|
|
8644
8702
|
lg: "max-w-lg",
|
|
8645
8703
|
xl: "max-w-xl",
|
|
8646
|
-
full: "max-w-full
|
|
8704
|
+
full: "max-w-full size-full",
|
|
8647
8705
|
auto: "max-w-none w-auto min-w-0"
|
|
8648
8706
|
};
|
|
8649
8707
|
var Dialog = DialogPrimitive.Root;
|
|
@@ -8806,7 +8864,7 @@ var DialogContent = React12.forwardRef(({
|
|
|
8806
8864
|
children: [
|
|
8807
8865
|
children,
|
|
8808
8866
|
showCloseButton && /* @__PURE__ */ jsxs13(DialogPrimitive.Close, { className: "absolute right-4 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
8809
|
-
/* @__PURE__ */ jsx17(X4, { className: "
|
|
8867
|
+
/* @__PURE__ */ jsx17(X4, { className: "size-4" }),
|
|
8810
8868
|
/* @__PURE__ */ jsx17("span", { className: "sr-only", children: "Close" })
|
|
8811
8869
|
] })
|
|
8812
8870
|
]
|
|
@@ -8950,38 +9008,31 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
|
8950
9008
|
|
|
8951
9009
|
// src/components/Progress/Progress.tsx
|
|
8952
9010
|
import * as React13 from "react";
|
|
8953
|
-
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
8954
9011
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
8955
|
-
var Progress = React13.forwardRef(({ className, value, max: max2 = 100, ...props }, ref) =>
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
className
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
style: { transform: `translateX(-${100 - (value || 0) / max2 * 100}%)` }
|
|
8974
|
-
}
|
|
8975
|
-
)
|
|
8976
|
-
}
|
|
8977
|
-
));
|
|
8978
|
-
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
9012
|
+
var Progress = React13.forwardRef(({ className, value, max: max2 = 100, ...props }, ref) => {
|
|
9013
|
+
const isIndeterminate = value === void 0;
|
|
9014
|
+
return /* @__PURE__ */ jsx18(
|
|
9015
|
+
"progress",
|
|
9016
|
+
{
|
|
9017
|
+
ref,
|
|
9018
|
+
className: cn(
|
|
9019
|
+
"appearance-none border-0 h-2 w-full rounded-full overflow-hidden transition-all accent-primary",
|
|
9020
|
+
isIndeterminate ? "bg-gradient-to-r from-primary/10 via-primary/90 to-primary/10" : "bg-primary/20",
|
|
9021
|
+
className
|
|
9022
|
+
),
|
|
9023
|
+
...isIndeterminate ? {} : { value },
|
|
9024
|
+
max: max2,
|
|
9025
|
+
...props
|
|
9026
|
+
}
|
|
9027
|
+
);
|
|
9028
|
+
});
|
|
9029
|
+
Progress.displayName = "Progress";
|
|
8979
9030
|
|
|
8980
9031
|
// src/components/DataTable/components/ImportModal.tsx
|
|
8981
9032
|
import { Upload as Upload2, FileText, AlertCircle } from "lucide-react";
|
|
8982
9033
|
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
8983
9034
|
function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
8984
|
-
const
|
|
9035
|
+
const logger2 = createLogger("ImportModal");
|
|
8985
9036
|
const [file, setFile] = useState4(null);
|
|
8986
9037
|
const [isProcessing, setIsProcessing] = useState4(false);
|
|
8987
9038
|
const [error, setError] = useState4(null);
|
|
@@ -9173,7 +9224,7 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9173
9224
|
setPreviewData(data.slice(0, 5));
|
|
9174
9225
|
setTotalCount(data.length);
|
|
9175
9226
|
} catch (err) {
|
|
9176
|
-
|
|
9227
|
+
logger2.error("CSV parsing error:", err);
|
|
9177
9228
|
setError(err instanceof Error ? err.message : "Failed to preview file");
|
|
9178
9229
|
setPreviewData(null);
|
|
9179
9230
|
setTotalCount(0);
|
|
@@ -9187,7 +9238,7 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9187
9238
|
] }),
|
|
9188
9239
|
/* @__PURE__ */ jsxs14("div", { className: "space-y-4", children: [
|
|
9189
9240
|
/* @__PURE__ */ jsxs14("div", { className: "border-2 border-dashed border-sec-200 rounded-lg p-6 text-center", children: [
|
|
9190
|
-
/* @__PURE__ */ jsx19(FileText, { className: "
|
|
9241
|
+
/* @__PURE__ */ jsx19(FileText, { className: "size-8 mx-auto text-sec-400 mb-2" }),
|
|
9191
9242
|
/* @__PURE__ */ jsx19("p", { className: "text-sec-600 mb-2", children: file ? `Selected: ${file.name}` : uploadText }),
|
|
9192
9243
|
file && /* @__PURE__ */ jsx19("p", { className: "text-xs text-sec-500", children: "File selected, processing preview..." }),
|
|
9193
9244
|
/* @__PURE__ */ jsxs14(
|
|
@@ -9197,7 +9248,7 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9197
9248
|
size: "sm",
|
|
9198
9249
|
onClick: () => fileInputRef.current?.click(),
|
|
9199
9250
|
children: [
|
|
9200
|
-
/* @__PURE__ */ jsx19(Upload2, { className: "
|
|
9251
|
+
/* @__PURE__ */ jsx19(Upload2, { className: "size-4 mr-2" }),
|
|
9201
9252
|
selectFileButtonText
|
|
9202
9253
|
]
|
|
9203
9254
|
}
|
|
@@ -9214,12 +9265,12 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9214
9265
|
)
|
|
9215
9266
|
] }),
|
|
9216
9267
|
error && /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 p-3 bg-acc-50 border border-acc-200 rounded text-acc-700", children: [
|
|
9217
|
-
/* @__PURE__ */ jsx19(AlertCircle, { className: "
|
|
9268
|
+
/* @__PURE__ */ jsx19(AlertCircle, { className: "size-4" }),
|
|
9218
9269
|
/* @__PURE__ */ jsx19("span", { className: "text-sm", children: error })
|
|
9219
9270
|
] }),
|
|
9220
9271
|
validationErrors.length > 0 && /* @__PURE__ */ jsxs14("div", { className: "space-y-2", children: [
|
|
9221
9272
|
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 p-3 bg-acc-50 border border-acc-200 rounded text-acc-700", children: [
|
|
9222
|
-
/* @__PURE__ */ jsx19(AlertCircle, { className: "
|
|
9273
|
+
/* @__PURE__ */ jsx19(AlertCircle, { className: "size-4" }),
|
|
9223
9274
|
/* @__PURE__ */ jsxs14("span", { className: "text-sm font-medium", children: [
|
|
9224
9275
|
validationErrors.length,
|
|
9225
9276
|
" validation error",
|
|
@@ -9290,7 +9341,7 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9290
9341
|
// src/components/DataTable/components/DataTableModals.tsx
|
|
9291
9342
|
import { Fragment as Fragment4, jsx as jsx20 } from "react/jsx-runtime";
|
|
9292
9343
|
function mapCSVToTableColumns(csvData, columns) {
|
|
9293
|
-
const
|
|
9344
|
+
const logger2 = createLogger("mapCSVToTableColumns");
|
|
9294
9345
|
const columnMap = /* @__PURE__ */ new Map();
|
|
9295
9346
|
columns.forEach((col) => {
|
|
9296
9347
|
const fieldName = col.editAccessorKey || col.accessorKey || col.id;
|
|
@@ -9309,11 +9360,11 @@ function mapCSVToTableColumns(csvData, columns) {
|
|
|
9309
9360
|
columnMap.set(editAccessorKey.toLowerCase(), editAccessorKey);
|
|
9310
9361
|
}
|
|
9311
9362
|
} else {
|
|
9312
|
-
|
|
9363
|
+
logger2.warn("Skipping column with missing fieldName or header:", col);
|
|
9313
9364
|
}
|
|
9314
9365
|
});
|
|
9315
9366
|
if (csvData.length === 0) {
|
|
9316
|
-
|
|
9367
|
+
logger2.warn("No CSV data to map");
|
|
9317
9368
|
return [];
|
|
9318
9369
|
}
|
|
9319
9370
|
const mappedData = csvData.map((row, index) => {
|
|
@@ -9335,7 +9386,7 @@ function mapCSVToTableColumns(csvData, columns) {
|
|
|
9335
9386
|
} else {
|
|
9336
9387
|
mappedRow[csvHeaderLower] = row[csvHeader];
|
|
9337
9388
|
if (index === 0) {
|
|
9338
|
-
|
|
9389
|
+
logger2.warn(`No mapping found for "${csvHeader}", using as-is`);
|
|
9339
9390
|
}
|
|
9340
9391
|
}
|
|
9341
9392
|
});
|
|
@@ -9352,7 +9403,7 @@ function DataTableModals({
|
|
|
9352
9403
|
onStoreFocus,
|
|
9353
9404
|
onRestoreFocus
|
|
9354
9405
|
}) {
|
|
9355
|
-
const
|
|
9406
|
+
const logger2 = React15.useMemo(() => createLogger("DataTableModals"), []);
|
|
9356
9407
|
useEffect5(() => {
|
|
9357
9408
|
if (showImportModal) {
|
|
9358
9409
|
onStoreFocus?.();
|
|
@@ -9374,11 +9425,11 @@ function DataTableModals({
|
|
|
9374
9425
|
if (columns && columns.length > 0) {
|
|
9375
9426
|
mappedData = mapCSVToTableColumns(rawData, columns);
|
|
9376
9427
|
} else {
|
|
9377
|
-
|
|
9428
|
+
logger2.warn("No columns provided for mapping, using raw data");
|
|
9378
9429
|
mappedData = rawData;
|
|
9379
9430
|
}
|
|
9380
9431
|
if (!onImport) {
|
|
9381
|
-
|
|
9432
|
+
logger2.error("onImport callback is not provided");
|
|
9382
9433
|
throw new Error("Import handler is not configured. Please provide an onImport callback.");
|
|
9383
9434
|
}
|
|
9384
9435
|
const result = onImport(mappedData);
|
|
@@ -9386,7 +9437,7 @@ function DataTableModals({
|
|
|
9386
9437
|
await result;
|
|
9387
9438
|
}
|
|
9388
9439
|
} catch (error) {
|
|
9389
|
-
|
|
9440
|
+
logger2.error("Import error:", error);
|
|
9390
9441
|
throw error;
|
|
9391
9442
|
}
|
|
9392
9443
|
},
|
|
@@ -9418,7 +9469,7 @@ var Alert = React16.forwardRef(({ className, variant = "default", ...props }, re
|
|
|
9418
9469
|
return /* @__PURE__ */ jsx21(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx21(React16.Fragment, { ...props }) });
|
|
9419
9470
|
}
|
|
9420
9471
|
return /* @__PURE__ */ jsx21(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx21(
|
|
9421
|
-
"
|
|
9472
|
+
"aside",
|
|
9422
9473
|
{
|
|
9423
9474
|
ref,
|
|
9424
9475
|
className: cn(getAlertClasses(variant), className),
|
|
@@ -9586,7 +9637,7 @@ function useColumnOrderPersistence({
|
|
|
9586
9637
|
enablePersistence = false,
|
|
9587
9638
|
storageKey
|
|
9588
9639
|
}) {
|
|
9589
|
-
const
|
|
9640
|
+
const logger2 = createLogger("ColumnOrderPersistence");
|
|
9590
9641
|
const [columnOrder, setColumnOrder] = useState5(defaultOrder);
|
|
9591
9642
|
const [isLoaded, setIsLoaded] = useState5(false);
|
|
9592
9643
|
const finalStorageKey = storageKey ? `${storageKey}-column-order` : tableId ? `datatable-column-order-${tableId}` : "datatable-column-order";
|
|
@@ -9608,7 +9659,7 @@ function useColumnOrderPersistence({
|
|
|
9608
9659
|
}
|
|
9609
9660
|
}
|
|
9610
9661
|
} catch (error) {
|
|
9611
|
-
|
|
9662
|
+
logger2.warn("Failed to load column order from localStorage:", error);
|
|
9612
9663
|
} finally {
|
|
9613
9664
|
setIsLoaded(true);
|
|
9614
9665
|
}
|
|
@@ -9619,7 +9670,7 @@ function useColumnOrderPersistence({
|
|
|
9619
9670
|
try {
|
|
9620
9671
|
localStorage.setItem(finalStorageKey, JSON.stringify(newOrder));
|
|
9621
9672
|
} catch (error) {
|
|
9622
|
-
|
|
9673
|
+
logger2.warn("Failed to save column order to localStorage:", error);
|
|
9623
9674
|
}
|
|
9624
9675
|
}, [enablePersistence, finalStorageKey, storageKey, tableId]);
|
|
9625
9676
|
const updateColumnOrder = useCallback3((newOrder) => {
|
|
@@ -9632,7 +9683,7 @@ function useColumnOrderPersistence({
|
|
|
9632
9683
|
try {
|
|
9633
9684
|
localStorage.removeItem(finalStorageKey);
|
|
9634
9685
|
} catch (error) {
|
|
9635
|
-
|
|
9686
|
+
logger2.warn("Failed to remove column order from localStorage:", error);
|
|
9636
9687
|
}
|
|
9637
9688
|
}
|
|
9638
9689
|
}, [defaultOrder, enablePersistence, finalStorageKey, storageKey, tableId]);
|
|
@@ -9646,7 +9697,7 @@ function useColumnOrderPersistence({
|
|
|
9646
9697
|
}
|
|
9647
9698
|
});
|
|
9648
9699
|
} catch (error) {
|
|
9649
|
-
|
|
9700
|
+
logger2.warn("Failed to clear datatable preferences:", error);
|
|
9650
9701
|
}
|
|
9651
9702
|
}, [enablePersistence]);
|
|
9652
9703
|
return {
|
|
@@ -9666,7 +9717,7 @@ function useColumnVisibilityPersistence({
|
|
|
9666
9717
|
enablePersistence = false,
|
|
9667
9718
|
storageKey
|
|
9668
9719
|
}) {
|
|
9669
|
-
const
|
|
9720
|
+
const logger2 = createLogger("ColumnVisibilityPersistence");
|
|
9670
9721
|
const [columnVisibility, setColumnVisibility] = useState6(defaultVisibility);
|
|
9671
9722
|
const [isLoaded, setIsLoaded] = useState6(false);
|
|
9672
9723
|
const finalStorageKey = storageKey ? `${storageKey}-column-visibility` : tableId ? `datatable-column-visibility-${tableId}` : "datatable-column-visibility";
|
|
@@ -9684,7 +9735,7 @@ function useColumnVisibilityPersistence({
|
|
|
9684
9735
|
}
|
|
9685
9736
|
}
|
|
9686
9737
|
} catch (error) {
|
|
9687
|
-
|
|
9738
|
+
logger2.warn("Failed to load column visibility from localStorage:", error);
|
|
9688
9739
|
} finally {
|
|
9689
9740
|
setIsLoaded(true);
|
|
9690
9741
|
}
|
|
@@ -9694,7 +9745,7 @@ function useColumnVisibilityPersistence({
|
|
|
9694
9745
|
try {
|
|
9695
9746
|
localStorage.setItem(finalStorageKey, JSON.stringify(newVisibility));
|
|
9696
9747
|
} catch (error) {
|
|
9697
|
-
|
|
9748
|
+
logger2.warn("Failed to save column visibility to localStorage:", error);
|
|
9698
9749
|
}
|
|
9699
9750
|
}, [enablePersistence, finalStorageKey]);
|
|
9700
9751
|
const updateColumnVisibility = useCallback4((newVisibility) => {
|
|
@@ -9707,7 +9758,7 @@ function useColumnVisibilityPersistence({
|
|
|
9707
9758
|
try {
|
|
9708
9759
|
localStorage.removeItem(finalStorageKey);
|
|
9709
9760
|
} catch (error) {
|
|
9710
|
-
|
|
9761
|
+
logger2.warn("Failed to remove column visibility from localStorage:", error);
|
|
9711
9762
|
}
|
|
9712
9763
|
}
|
|
9713
9764
|
}, [defaultVisibility, enablePersistence, finalStorageKey]);
|
|
@@ -9721,7 +9772,7 @@ function useColumnVisibilityPersistence({
|
|
|
9721
9772
|
}
|
|
9722
9773
|
});
|
|
9723
9774
|
} catch (error) {
|
|
9724
|
-
|
|
9775
|
+
logger2.warn("Failed to clear datatable preferences:", error);
|
|
9725
9776
|
}
|
|
9726
9777
|
}, [enablePersistence]);
|
|
9727
9778
|
return {
|
|
@@ -10502,7 +10553,7 @@ var CardHeader = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
10502
10553
|
"header",
|
|
10503
10554
|
{
|
|
10504
10555
|
ref,
|
|
10505
|
-
className: cn("
|
|
10556
|
+
className: cn("p-6 min-w-0 w-full", className),
|
|
10506
10557
|
...props
|
|
10507
10558
|
}
|
|
10508
10559
|
));
|
|
@@ -10511,10 +10562,7 @@ var CardTitle = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
10511
10562
|
"h3",
|
|
10512
10563
|
{
|
|
10513
10564
|
ref,
|
|
10514
|
-
className: cn(
|
|
10515
|
-
"text-2xl font-semibold leading-none tracking-tight",
|
|
10516
|
-
className
|
|
10517
|
-
),
|
|
10565
|
+
className: cn(className),
|
|
10518
10566
|
...props
|
|
10519
10567
|
}
|
|
10520
10568
|
));
|
|
@@ -10541,7 +10589,7 @@ var CardFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
10541
10589
|
"footer",
|
|
10542
10590
|
{
|
|
10543
10591
|
ref,
|
|
10544
|
-
className: cn("
|
|
10592
|
+
className: cn("p-6 pt-0 min-w-0 w-full", className),
|
|
10545
10593
|
...props
|
|
10546
10594
|
}
|
|
10547
10595
|
));
|
|
@@ -10709,7 +10757,7 @@ function formatLocaleValue(value, locale) {
|
|
|
10709
10757
|
return String(value);
|
|
10710
10758
|
}
|
|
10711
10759
|
function generateCSVContent(data, columns, options = {}) {
|
|
10712
|
-
const
|
|
10760
|
+
const logger2 = createLogger("generateCSVContent");
|
|
10713
10761
|
if (!data.length) return "";
|
|
10714
10762
|
const {
|
|
10715
10763
|
includeHeaders = true,
|
|
@@ -10727,7 +10775,7 @@ function generateCSVContent(data, columns, options = {}) {
|
|
|
10727
10775
|
try {
|
|
10728
10776
|
value = col.accessorFn(row);
|
|
10729
10777
|
} catch (error) {
|
|
10730
|
-
|
|
10778
|
+
logger2.warn("Error evaluating accessorFn for column:", col.id || col.header, error);
|
|
10731
10779
|
value = void 0;
|
|
10732
10780
|
}
|
|
10733
10781
|
} else {
|
|
@@ -10744,7 +10792,7 @@ function generateCSVContent(data, columns, options = {}) {
|
|
|
10744
10792
|
return csvContent;
|
|
10745
10793
|
}
|
|
10746
10794
|
async function exportToCSVWithTableRows(tableRows, columns, columnIdToTableColumn, filename = "download.csv", options = {}) {
|
|
10747
|
-
const
|
|
10795
|
+
const logger2 = createLogger("ExportUtils");
|
|
10748
10796
|
return new Promise((resolve, reject) => {
|
|
10749
10797
|
try {
|
|
10750
10798
|
if (typeof window === "undefined") {
|
|
@@ -10773,7 +10821,7 @@ async function exportToCSVWithTableRows(tableRows, columns, columnIdToTableColum
|
|
|
10773
10821
|
try {
|
|
10774
10822
|
value = col.accessorFn(tableRow.original);
|
|
10775
10823
|
} catch (accessorError) {
|
|
10776
|
-
|
|
10824
|
+
logger2.warn("Error evaluating accessorFn for column:", col.id || col.header, accessorError);
|
|
10777
10825
|
value = void 0;
|
|
10778
10826
|
}
|
|
10779
10827
|
} else {
|
|
@@ -10808,13 +10856,13 @@ async function exportToCSVWithTableRows(tableRows, columns, columnIdToTableColum
|
|
|
10808
10856
|
link.click();
|
|
10809
10857
|
document.body.removeChild(link);
|
|
10810
10858
|
} catch (error) {
|
|
10811
|
-
|
|
10859
|
+
logger2.error("Failed to export data to CSV:", error);
|
|
10812
10860
|
reject(error);
|
|
10813
10861
|
}
|
|
10814
10862
|
});
|
|
10815
10863
|
}
|
|
10816
10864
|
function exportToCSV(data, columns, filename = "download.csv", options = {}) {
|
|
10817
|
-
const
|
|
10865
|
+
const logger2 = createLogger("ExportUtils");
|
|
10818
10866
|
return new Promise((resolve, reject) => {
|
|
10819
10867
|
try {
|
|
10820
10868
|
if (typeof window === "undefined") {
|
|
@@ -10843,7 +10891,7 @@ function exportToCSV(data, columns, filename = "download.csv", options = {}) {
|
|
|
10843
10891
|
link.click();
|
|
10844
10892
|
document.body.removeChild(link);
|
|
10845
10893
|
} catch (error) {
|
|
10846
|
-
|
|
10894
|
+
logger2.error("Failed to export data to CSV:", error);
|
|
10847
10895
|
reject(error);
|
|
10848
10896
|
}
|
|
10849
10897
|
});
|
|
@@ -10879,7 +10927,7 @@ function normalizeDataTableFeatures(features) {
|
|
|
10879
10927
|
|
|
10880
10928
|
// src/components/DataTable/hooks/useDataTablePermissions.ts
|
|
10881
10929
|
function useDataTablePermissions(rbac, features = {}) {
|
|
10882
|
-
const
|
|
10930
|
+
const logger2 = createLogger("DataTablePermissions");
|
|
10883
10931
|
const authResult = useUnifiedAuth();
|
|
10884
10932
|
const user = authResult.user;
|
|
10885
10933
|
const pageId = rbac?.pageId;
|
|
@@ -10899,7 +10947,7 @@ function useDataTablePermissions(rbac, features = {}) {
|
|
|
10899
10947
|
appId: void 0,
|
|
10900
10948
|
eventId: void 0
|
|
10901
10949
|
});
|
|
10902
|
-
if (rawResolvedScope
|
|
10950
|
+
if (rawResolvedScope) {
|
|
10903
10951
|
const newScope = {
|
|
10904
10952
|
organisationId: rawResolvedScope.organisationId,
|
|
10905
10953
|
appId: rawResolvedScope.appId,
|
|
@@ -10912,11 +10960,14 @@ function useDataTablePermissions(rbac, features = {}) {
|
|
|
10912
10960
|
eventId: newScope.eventId
|
|
10913
10961
|
};
|
|
10914
10962
|
}
|
|
10915
|
-
} else if (!rawResolvedScope) {
|
|
10963
|
+
} else if (!rawResolvedScope && !scopeLoading) {
|
|
10916
10964
|
stableScopeRef.current = { organisationId: void 0, appId: void 0, eventId: void 0 };
|
|
10917
10965
|
}
|
|
10918
10966
|
const stableScope = stableScopeRef.current;
|
|
10919
|
-
const
|
|
10967
|
+
const isPageName = !pageId && !!pageName;
|
|
10968
|
+
const needsAppIdForResolution = isPageName;
|
|
10969
|
+
const shouldWaitForScope = scopeLoading || needsAppIdForResolution && !stableScope.appId;
|
|
10970
|
+
const effectiveScope = !shouldWaitForScope ? stableScope : null;
|
|
10920
10971
|
const userId = user?.id || "";
|
|
10921
10972
|
const readPermission = `read:page.${effectivePageId}`;
|
|
10922
10973
|
const createPermission = `create:page.${effectivePageId}`;
|
|
@@ -11713,7 +11764,7 @@ function DataTableInternal(props) {
|
|
|
11713
11764
|
storageKey,
|
|
11714
11765
|
onLayoutChange
|
|
11715
11766
|
} = props;
|
|
11716
|
-
const
|
|
11767
|
+
const logger2 = React20.useMemo(() => createLogger("DataTableCore"), []);
|
|
11717
11768
|
const authResult = useUnifiedAuth();
|
|
11718
11769
|
const user = authResult.user;
|
|
11719
11770
|
const requestedFeatures = useMemo14(
|
|
@@ -11859,9 +11910,9 @@ function DataTableInternal(props) {
|
|
|
11859
11910
|
});
|
|
11860
11911
|
useEffect11(() => {
|
|
11861
11912
|
if (!hierarchicalValidation.isValid) {
|
|
11862
|
-
|
|
11913
|
+
logger2.error("Hierarchical data validation failed:", hierarchicalValidation.errors);
|
|
11863
11914
|
}
|
|
11864
|
-
}, [hierarchicalValidation,
|
|
11915
|
+
}, [hierarchicalValidation, logger2]);
|
|
11865
11916
|
const {
|
|
11866
11917
|
columnOrder: savedColumnOrder,
|
|
11867
11918
|
isLoaded: isColumnOrderLoaded,
|
|
@@ -11899,11 +11950,11 @@ function DataTableInternal(props) {
|
|
|
11899
11950
|
const closestOption = sortedOptions.reduce(
|
|
11900
11951
|
(prev, curr) => Math.abs(curr - initialPageSize) < Math.abs(prev - initialPageSize) ? curr : prev
|
|
11901
11952
|
);
|
|
11902
|
-
|
|
11953
|
+
logger2.warn(
|
|
11903
11954
|
`initialPageSize ${initialPageSize} is not available in page size options [${finalPageSizeOptions.join(", ")}]. Using closest option: ${closestOption}`
|
|
11904
11955
|
);
|
|
11905
11956
|
return closestOption;
|
|
11906
|
-
}, [initialPageSize, finalPageSizeOptions, secureFeatures.pagination,
|
|
11957
|
+
}, [initialPageSize, finalPageSizeOptions, secureFeatures.pagination, logger2]);
|
|
11907
11958
|
const effectivePageSize = useMemo14(() => {
|
|
11908
11959
|
if (!secureFeatures.pagination || !finalPageSizeOptions.length) {
|
|
11909
11960
|
return state.pagination.pageSize;
|
|
@@ -12009,7 +12060,7 @@ function DataTableInternal(props) {
|
|
|
12009
12060
|
variant: "default"
|
|
12010
12061
|
});
|
|
12011
12062
|
} catch (error) {
|
|
12012
|
-
|
|
12063
|
+
logger2.error("Delete error:", error);
|
|
12013
12064
|
toast({
|
|
12014
12065
|
title: "Delete Failed",
|
|
12015
12066
|
description: error instanceof Error ? error.message : "Failed to delete row",
|
|
@@ -12099,7 +12150,7 @@ function DataTableInternal(props) {
|
|
|
12099
12150
|
return /* @__PURE__ */ jsx25(LoadingComponent, {});
|
|
12100
12151
|
}
|
|
12101
12152
|
if (!permissions.canRead.can) {
|
|
12102
|
-
|
|
12153
|
+
logger2.warn("Access denied - no read permission:", {
|
|
12103
12154
|
canRead: permissions.canRead,
|
|
12104
12155
|
pageId: effectivePageId,
|
|
12105
12156
|
isLoading: permissions.canRead.isLoading
|
|
@@ -12213,7 +12264,7 @@ function DataTableInternal(props) {
|
|
|
12213
12264
|
variant: "default"
|
|
12214
12265
|
});
|
|
12215
12266
|
} catch (error) {
|
|
12216
|
-
|
|
12267
|
+
logger2.error("Failed to export data:", error);
|
|
12217
12268
|
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
12218
12269
|
toast({
|
|
12219
12270
|
title: "Export Failed",
|
|
@@ -12244,7 +12295,7 @@ function DataTableInternal(props) {
|
|
|
12244
12295
|
variant: "default"
|
|
12245
12296
|
});
|
|
12246
12297
|
} catch (error) {
|
|
12247
|
-
|
|
12298
|
+
logger2.error("Bulk delete error:", error);
|
|
12248
12299
|
toast({
|
|
12249
12300
|
title: "Delete Failed",
|
|
12250
12301
|
description: error instanceof Error ? error.message : "Failed to delete selected rows",
|
|
@@ -12321,7 +12372,7 @@ function DataTableInternal(props) {
|
|
|
12321
12372
|
tabIndex: 0,
|
|
12322
12373
|
children: [
|
|
12323
12374
|
typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header,
|
|
12324
|
-
header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx25(ChevronUp2, { className: "
|
|
12375
|
+
header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx25(ChevronUp2, { className: "size-4" }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx25(ChevronDown3, { className: "size-4" }) : /* @__PURE__ */ jsx25(ChevronsUpDown, { className: "size-4" })
|
|
12325
12376
|
]
|
|
12326
12377
|
}
|
|
12327
12378
|
) : typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header
|
|
@@ -12433,7 +12484,7 @@ function DataTableInternal(props) {
|
|
|
12433
12484
|
variant: "default"
|
|
12434
12485
|
});
|
|
12435
12486
|
} catch (error) {
|
|
12436
|
-
|
|
12487
|
+
logger2.error("Import error:", error);
|
|
12437
12488
|
toast({
|
|
12438
12489
|
title: "Import Failed",
|
|
12439
12490
|
description: error instanceof Error ? error.message : "Failed to import data",
|
|
@@ -12442,7 +12493,7 @@ function DataTableInternal(props) {
|
|
|
12442
12493
|
return;
|
|
12443
12494
|
}
|
|
12444
12495
|
} else {
|
|
12445
|
-
|
|
12496
|
+
logger2.error("onImport handler not provided");
|
|
12446
12497
|
toast({
|
|
12447
12498
|
title: "Import Not Configured",
|
|
12448
12499
|
description: "Import functionality requires an onImport handler to be provided.",
|
|
@@ -12470,7 +12521,7 @@ function DataTableCore(props) {
|
|
|
12470
12521
|
// src/components/DataTable/DataTable.tsx
|
|
12471
12522
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
12472
12523
|
function DataTable(props) {
|
|
12473
|
-
const
|
|
12524
|
+
const logger2 = React21.useMemo(() => createLogger("DataTable"), []);
|
|
12474
12525
|
const { features, ...rest } = props;
|
|
12475
12526
|
const normalizedFeatures = React21.useMemo(
|
|
12476
12527
|
() => normalizeDataTableFeatures(features),
|
|
@@ -12478,9 +12529,9 @@ function DataTable(props) {
|
|
|
12478
12529
|
);
|
|
12479
12530
|
React21.useEffect(() => {
|
|
12480
12531
|
if (normalizedFeatures.deleteSelected && !normalizedFeatures.deletion) {
|
|
12481
|
-
|
|
12532
|
+
logger2.warn("deleteSelected requires deletion to be enabled");
|
|
12482
12533
|
}
|
|
12483
|
-
}, [normalizedFeatures.deleteSelected, normalizedFeatures.deletion,
|
|
12534
|
+
}, [normalizedFeatures.deleteSelected, normalizedFeatures.deletion, logger2]);
|
|
12484
12535
|
return /* @__PURE__ */ jsx26(DataTableCore, { ...rest, features: normalizedFeatures });
|
|
12485
12536
|
}
|
|
12486
12537
|
var DataTableComponent = React21.memo(DataTable);
|
|
@@ -12528,7 +12579,7 @@ function BulkOperationsDropdown({
|
|
|
12528
12579
|
disabled: !hasSelection,
|
|
12529
12580
|
className: `min-w-[140px] h-9 px-3 py-2 text-sm font-medium ${className || ""}`,
|
|
12530
12581
|
children: [
|
|
12531
|
-
/* @__PURE__ */ jsx27(MoreHorizontal2, { className: "
|
|
12582
|
+
/* @__PURE__ */ jsx27(MoreHorizontal2, { className: "size-4 mr-2 flex-shrink-0" }),
|
|
12532
12583
|
/* @__PURE__ */ jsxs18("span", { className: "truncate", children: [
|
|
12533
12584
|
"Bulk Actions (",
|
|
12534
12585
|
selectedCount,
|
|
@@ -12549,7 +12600,7 @@ function BulkOperationsDropdown({
|
|
|
12549
12600
|
disabled: !hasSelection,
|
|
12550
12601
|
className: `flex items-center gap-2 ${variant === "destructive" ? "text-destructive focus:text-destructive" : ""}`,
|
|
12551
12602
|
children: [
|
|
12552
|
-
/* @__PURE__ */ jsx27(Icon, { className: "
|
|
12603
|
+
/* @__PURE__ */ jsx27(Icon, { className: "size-4" }),
|
|
12553
12604
|
/* @__PURE__ */ jsx27("span", { children: label })
|
|
12554
12605
|
]
|
|
12555
12606
|
},
|
|
@@ -12578,7 +12629,7 @@ function GroupHeader({
|
|
|
12578
12629
|
size: "sm",
|
|
12579
12630
|
onClick: onToggle,
|
|
12580
12631
|
className: "p-0 h-auto mr-2",
|
|
12581
|
-
children: isExpanded ? /* @__PURE__ */ jsx28(ChevronDown4, { className: "
|
|
12632
|
+
children: isExpanded ? /* @__PURE__ */ jsx28(ChevronDown4, { className: "size-4" }) : /* @__PURE__ */ jsx28(ChevronRight3, { className: "size-4" })
|
|
12582
12633
|
}
|
|
12583
12634
|
),
|
|
12584
12635
|
/* @__PURE__ */ jsxs19("span", { className: "text-sm", children: [
|
|
@@ -12753,4 +12804,4 @@ lodash/lodash.js:
|
|
|
12753
12804
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
12754
12805
|
*)
|
|
12755
12806
|
*/
|
|
12756
|
-
//# sourceMappingURL=chunk-
|
|
12807
|
+
//# sourceMappingURL=chunk-ULHIJK66.js.map
|