@jmruthers/pace-core 0.5.53 → 0.5.55
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/README.md +0 -4
- package/dist/{DataTable-7FMFXA7A.js → DataTable-4T627QFJ.js} +11 -11
- package/dist/{PublicLoadingSpinner-Bq_-BeK-.d.ts → PublicLoadingSpinner-SL8WaQN7.d.ts} +2 -21
- package/dist/{api-H5A3H4IR.js → api-LUNF5O6M.js} +3 -3
- package/dist/{appConfig-BVGyuvI7.d.ts → appConfig-DjpeG6P-.d.ts} +9 -1
- package/dist/{appNameResolver-7GHF5ED2.js → appNameResolver-UURKN7NF.js} +2 -2
- package/dist/{audit-BUW3LMJB.js → audit-6TOCAMKO.js} +2 -2
- package/dist/{chunk-MZBUOP4P.js → chunk-5BSLGBYI.js} +4 -3
- package/dist/chunk-5BSLGBYI.js.map +1 -0
- package/dist/{chunk-I5Z3QH5X.js → chunk-66C4BSAY.js} +2 -2
- package/dist/{chunk-I5Z3QH5X.js.map → chunk-66C4BSAY.js.map} +1 -1
- package/dist/{chunk-MYP2EGHX.js → chunk-AJ2KMES7.js} +21 -14
- package/dist/chunk-AJ2KMES7.js.map +1 -0
- package/dist/{chunk-EL2O4IUX.js → chunk-AQFRLC7K.js} +16 -24
- package/dist/{chunk-EL2O4IUX.js.map → chunk-AQFRLC7K.js.map} +1 -1
- package/dist/{chunk-7BNPOCLL.js → chunk-B2WTCLCV.js} +6 -2
- package/dist/chunk-B2WTCLCV.js.map +1 -0
- package/dist/{chunk-WJARTBCT.js → chunk-D7ARGIA3.js} +16 -7
- package/dist/chunk-D7ARGIA3.js.map +1 -0
- package/dist/{chunk-NRK4AIHQ.js → chunk-KBRACSJI.js} +3 -3
- package/dist/{chunk-NYUJ4FJR.js → chunk-KJDPSM64.js} +7 -7
- package/dist/chunk-KJDPSM64.js.map +1 -0
- package/dist/{chunk-GWSBHC4J.js → chunk-KLPVOPRI.js} +261 -38
- package/dist/chunk-KLPVOPRI.js.map +1 -0
- package/dist/{chunk-TRIZ7IB7.js → chunk-MPQDF75X.js} +148 -288
- package/dist/chunk-MPQDF75X.js.map +1 -0
- package/dist/{chunk-MSFACPQQ.js → chunk-PAEM3OWN.js} +11 -11
- package/dist/{chunk-MSFACPQQ.js.map → chunk-PAEM3OWN.js.map} +1 -1
- package/dist/{chunk-GIO7BFE7.js → chunk-RQD3D2CO.js} +66 -169
- package/dist/{chunk-GIO7BFE7.js.map → chunk-RQD3D2CO.js.map} +1 -1
- package/dist/{chunk-YDJW5XTN.js → chunk-STT7INZR.js} +25 -1
- package/dist/chunk-STT7INZR.js.map +1 -0
- package/dist/{chunk-6MTY77WU.js → chunk-TNMXZLDR.js} +3 -3
- package/dist/{chunk-BC3S53OZ.js → chunk-UQE2Y64H.js} +30 -14
- package/dist/chunk-UQE2Y64H.js.map +1 -0
- package/dist/{chunk-22KLBHPS.js → chunk-W66AZIOH.js} +2 -2
- package/dist/chunk-W66AZIOH.js.map +1 -0
- package/dist/{chunk-SS3E6QLB.js → chunk-YNUBMSMV.js} +2 -2
- package/dist/chunk-YNUBMSMV.js.map +1 -0
- package/dist/{chunk-NZ655MWE.js → chunk-ZOD2ZY6X.js} +5 -4
- package/dist/chunk-ZOD2ZY6X.js.map +1 -0
- package/dist/{chunk-74C6SNEC.js → chunk-ZPK5656W.js} +3 -3
- package/dist/{chunk-74C6SNEC.js.map → chunk-ZPK5656W.js.map} +1 -1
- package/dist/components.d.ts +22 -899
- package/dist/components.js +436 -3118
- package/dist/components.js.map +1 -1
- package/dist/file-reference-9xUOnwyt.d.ts +70 -0
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +10 -10
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +49 -9
- package/dist/index.js +190 -25
- package/dist/index.js.map +1 -1
- package/dist/{organisation-CO3Sh3_D.d.ts → organisation-t-vvQC3g.d.ts} +1 -8
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +5 -5
- package/dist/rbac/index.d.ts +65 -46
- package/dist/rbac/index.js +10 -12
- package/dist/styles/core.css +0 -125
- package/dist/types.d.ts +2 -1
- package/dist/types.js +3 -1
- package/dist/types.js.map +1 -1
- package/dist/{usePublicRouteParams-B2OcAsur.d.ts → usePublicRouteParams-CdoFxnJK.d.ts} +1 -1
- package/dist/utils.d.ts +3 -4
- package/dist/utils.js +44 -13
- package/dist/utils.js.map +1 -1
- package/docs/FILE_REFERENCE_SYSTEM.md +440 -0
- package/docs/INDEX.md +7 -5
- package/docs/README.md +0 -1
- package/docs/api/README.md +0 -4
- package/docs/api/classes/ErrorBoundary.md +1 -1
- 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 +2 -2
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +12 -12
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +6 -6
- 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 +281 -0
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- 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 +1 -1
- package/docs/api/interfaces/DataAccessRecord.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/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventContextType.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/EventProviderProps.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.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 +2 -2
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- 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 +1 -1
- 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 +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +4 -4
- 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/RBACContextType.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACProviderProps.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +2 -2
- package/docs/api/interfaces/RouteConfig.md +2 -2
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- 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/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.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 +1 -1
- 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/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +204 -200
- package/docs/api-reference/components.md +141 -163
- package/docs/api-reference/hooks.md +347 -0
- package/docs/core-concepts/rbac-system.md +69 -16
- package/docs/getting-started/examples/basic-auth-app.md +0 -1
- package/docs/implementation-guides/datatable-rbac-usage.md +12 -11
- package/docs/implementation-guides/file-upload-storage.md +733 -0
- package/docs/implementation-guides/inactivity-tracking.md +779 -0
- package/docs/implementation-guides/organisation-security.md +748 -0
- package/docs/implementation-guides/public-pages-advanced.md +1022 -0
- package/docs/migration/MIGRATION_GUIDE.md +684 -0
- package/docs/migration/README.md +13 -2
- package/docs/migration/rbac-migration.md +73 -0
- package/docs/rbac/examples/rbac-rls-integration-example.md +11 -13
- package/docs/style-guide.md +269 -1
- package/package.json +1 -1
- package/src/__tests__/TESTING_GUIDELINES.md +331 -18
- package/src/__tests__/helpers/supabaseMock.ts +99 -0
- package/src/__tests__/rbac/PagePermissionGuard.test.tsx +10 -7
- package/src/__tests__/shared.ts +6 -0
- package/src/components/DataTable/components/ActionButtons.tsx +2 -2
- package/src/components/DataTable/components/DataTableCore.tsx +2 -2
- package/src/components/DataTable/components/UnifiedTableBody.tsx +1 -1
- package/src/components/DataTable/utils/debugTools.ts +2 -2
- package/src/components/Dialog/Dialog.test.tsx +12 -2
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +6 -6
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +2 -2
- package/src/components/FileDisplay.tsx +233 -0
- package/src/components/FileUpload.tsx +176 -0
- package/src/components/Footer/Footer.test.tsx +7 -7
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +13 -6
- package/src/components/OrganisationSelector/OrganisationSelector.test.tsx +30 -3
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +1 -1
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.rbac.test.tsx +558 -0
- package/src/components/PublicLayout/PublicErrorBoundary.tsx +1 -1
- package/src/components/PublicLayout/PublicPageDebugger.tsx +2 -2
- package/src/components/PublicLayout/PublicPageDiagnostic.tsx +2 -2
- package/src/components/PublicLayout/PublicPageProvider.tsx +2 -2
- package/src/components/Select/Select.test.tsx +50 -15
- package/src/components/SuperAdminGuard.tsx +2 -2
- package/src/components/__tests__/SuperAdminGuard.test.tsx +559 -0
- package/src/components/index.ts +0 -183
- package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +2 -2
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +1 -1
- package/src/hooks/__tests__/useRBAC.unit.test.ts +191 -138
- package/src/hooks/public/usePublicEvent.ts +2 -2
- package/src/hooks/useAppConfig.ts +3 -3
- package/src/hooks/useComponentPerformance.ts +1 -1
- package/src/hooks/useDataTablePerformance.ts +1 -1
- package/src/hooks/useFileReference.ts +232 -0
- package/src/hooks/useOrganisationPermissions.test.ts +254 -344
- package/src/hooks/useOrganisationPermissions.ts +15 -7
- package/src/hooks/useOrganisationSecurity.test.ts +390 -402
- package/src/hooks/usePerformanceMonitor.ts +1 -1
- package/src/hooks/usePermissionCache.test.ts +264 -395
- package/src/hooks/usePermissionCache.ts +34 -4
- package/src/hooks/useSecureDataAccess.test.ts +486 -0
- package/src/hooks/useSecureDataAccess.ts +4 -1
- package/src/providers/InactivityProvider.tsx +2 -2
- package/src/providers/OrganisationProvider.test.simple.tsx +168 -0
- package/src/providers/OrganisationProvider.test.tsx +168 -0
- package/src/providers/OrganisationProvider.tsx +18 -31
- package/src/providers/UnifiedAuthProvider.test.simple.tsx +205 -0
- package/src/providers/UnifiedAuthProvider.test.tsx +128 -0
- package/src/providers/__tests__/InactivityProvider.test.tsx +3 -4
- package/src/providers/__tests__/OrganisationProvider.test.tsx +19 -14
- package/src/rbac/__tests__/integration.authflow.test.tsx +123 -0
- package/src/rbac/__tests__/integration.navigation.test.tsx +72 -0
- package/src/rbac/__tests__/integration.securedata.test.tsx +92 -0
- package/src/rbac/__tests__/integration.smoke.test.tsx +73 -0
- package/src/rbac/__tests__/rbac-core.test.tsx +26 -22
- package/src/rbac/__tests__/rbac-engine-core-logic.test.ts +411 -0
- package/src/rbac/__tests__/rbac-engine-simplified.test.ts +285 -0
- package/src/rbac/__tests__/rbac-functions.test.ts +655 -0
- package/src/rbac/__tests__/rbac-integration.test.ts +532 -0
- package/src/rbac/__tests__/scenarios.user-role.test.tsx +196 -0
- package/src/rbac/api.test.ts +6 -6
- package/src/rbac/api.ts +2 -2
- package/src/rbac/audit.test.ts +485 -0
- package/src/rbac/audit.ts +7 -1
- package/src/rbac/cache-invalidation.ts +318 -0
- package/src/rbac/cache.test.ts +286 -0
- package/src/rbac/components/EnhancedNavigationMenu.test.tsx +559 -0
- package/src/rbac/components/EnhancedNavigationMenu.tsx +29 -23
- package/src/rbac/components/NavigationProvider.test.tsx +449 -0
- package/src/rbac/components/PagePermissionGuard.tsx +4 -4
- package/src/rbac/components/PagePermissionProvider.test.tsx +479 -0
- package/src/rbac/components/SecureDataProvider.test.tsx +511 -0
- package/src/rbac/components/__tests__/PagePermissionGuard.race-condition.test.tsx +159 -430
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +4 -5
- package/src/rbac/components/__tests__/PagePermissionGuard.verification.test.tsx +112 -118
- package/src/rbac/config.test.ts +410 -0
- package/src/rbac/engine.test.simple.ts +237 -0
- package/src/rbac/engine.test.ts +233 -0
- package/src/rbac/engine.ts +37 -41
- package/src/rbac/examples/CompleteRBACExample.tsx +3 -3
- package/src/rbac/examples/EventBasedApp.tsx +4 -4
- package/src/rbac/hooks/useRBAC.simple.test.ts +16 -0
- package/src/rbac/hooks/useRBAC.test.ts +207 -455
- package/src/rbac/hooks/useRBAC.ts +30 -22
- package/src/rbac/permissions.test.ts +128 -0
- package/src/rbac/permissions.ts +56 -141
- package/src/rbac/providers/RBACProvider.tsx +1 -1
- package/src/rbac/secureClient.test.ts +444 -0
- package/src/rbac/security.test.ts +390 -0
- package/src/rbac/security.ts +1 -1
- package/src/rbac/types.test.ts +382 -0
- package/src/rbac/types.ts +2 -2
- package/src/styles/base.css +208 -0
- package/src/styles/core.css +0 -125
- package/src/styles/semantic.css +24 -0
- package/src/types/file-reference.ts +77 -0
- package/src/types/rbac-functions.ts +290 -0
- package/src/types/supabase.ts +10 -28
- package/src/types/unified.ts +4 -1
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +81 -55
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +21 -12
- package/src/utils/__tests__/organisationContext.unit.test.ts +13 -7
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +3 -3
- package/src/utils/__tests__/sessionTracking.unit.test.ts +32 -12
- package/src/utils/appConfig.ts +1 -1
- package/src/utils/appIdResolver.test.ts +503 -0
- package/src/utils/appIdResolver.ts +1 -1
- package/src/utils/appNameResolver.test.ts +494 -0
- package/src/utils/appNameResolver.ts +3 -2
- package/src/utils/bundleAnalysis.ts +3 -3
- package/src/utils/debugLogger.ts +1 -1
- package/src/utils/file-reference.ts +263 -0
- package/src/utils/formatDate.test.ts +2 -2
- package/src/utils/organisationContext.test.ts +340 -0
- package/src/utils/organisationContext.ts +19 -6
- package/src/utils/performanceBudgets.ts +2 -2
- package/src/utils/permissionUtils.test.ts +393 -0
- package/src/utils/permissionUtils.ts +5 -2
- package/src/utils/secureDataAccess.test.ts +715 -0
- package/src/utils/secureDataAccess.ts +21 -5
- package/src/utils/sessionTracking.ts +34 -4
- package/src/utils/storage/__tests__/helpers.unit.test.ts +328 -0
- package/src/utils/storage/__tests__/index.unit.test.ts +16 -0
- package/src/utils/storage/helpers.ts +20 -25
- package/src/utils/storage/index.ts +29 -1
- package/src/vite-env.d.ts +17 -0
- package/dist/chunk-22KLBHPS.js.map +0 -1
- package/dist/chunk-7BNPOCLL.js.map +0 -1
- package/dist/chunk-BC3S53OZ.js.map +0 -1
- package/dist/chunk-GWSBHC4J.js.map +0 -1
- package/dist/chunk-MYP2EGHX.js.map +0 -1
- package/dist/chunk-MZBUOP4P.js.map +0 -1
- package/dist/chunk-NYUJ4FJR.js.map +0 -1
- package/dist/chunk-NZ655MWE.js.map +0 -1
- package/dist/chunk-SS3E6QLB.js.map +0 -1
- package/dist/chunk-TRIZ7IB7.js.map +0 -1
- package/dist/chunk-WJARTBCT.js.map +0 -1
- package/dist/chunk-YDJW5XTN.js.map +0 -1
- package/docs/print-components/README.md +0 -258
- package/docs/print-components/api-reference.md +0 -636
- package/docs/print-components/examples/README.md +0 -204
- package/docs/print-components/examples/basic-report.tsx +0 -92
- package/docs/print-components/examples/card-catalog.tsx +0 -149
- package/docs/print-components/examples/cover-page-report.tsx +0 -163
- package/docs/print-components/quick-start.md +0 -363
- package/src/components/PrintButton/PrintButton.tsx +0 -321
- package/src/components/PrintButton/PrintButtonGroup.tsx +0 -84
- package/src/components/PrintButton/PrintToolbar.tsx +0 -94
- package/src/components/PrintButton/__tests__/PrintButton.test.tsx +0 -271
- package/src/components/PrintButton/examples/PrintButtonShowcase.tsx +0 -438
- package/src/components/PrintButton/index.ts +0 -33
- package/src/components/PrintButton/types.ts +0 -173
- package/src/components/PrintCard/PrintCard.tsx +0 -154
- package/src/components/PrintCard/PrintCardContent.tsx +0 -57
- package/src/components/PrintCard/PrintCardFooter.tsx +0 -60
- package/src/components/PrintCard/PrintCardGrid.tsx +0 -91
- package/src/components/PrintCard/PrintCardHeader.tsx +0 -78
- package/src/components/PrintCard/PrintCardImage.tsx +0 -81
- package/src/components/PrintCard/examples/PrintCardShowcase.tsx +0 -239
- package/src/components/PrintCard/index.ts +0 -34
- package/src/components/PrintCard/types.ts +0 -171
- package/src/components/PrintDataTable/PrintDataTable.tsx +0 -215
- package/src/components/PrintDataTable/PrintTableGroup.tsx +0 -90
- package/src/components/PrintDataTable/PrintTableRow.tsx +0 -76
- package/src/components/PrintDataTable/index.ts +0 -25
- package/src/components/PrintDataTable/types.ts +0 -67
- package/src/components/PrintFooter/PrintFooter.tsx +0 -183
- package/src/components/PrintFooter/PrintFooterContent.tsx +0 -71
- package/src/components/PrintFooter/PrintFooterInfo.tsx +0 -86
- package/src/components/PrintFooter/PrintPageNumber.tsx +0 -90
- package/src/components/PrintFooter/examples/PrintFooterShowcase.tsx +0 -390
- package/src/components/PrintFooter/index.ts +0 -30
- package/src/components/PrintFooter/types.ts +0 -149
- package/src/components/PrintGrid/PrintGrid.tsx +0 -180
- package/src/components/PrintGrid/PrintGridBreakpoint.tsx +0 -109
- package/src/components/PrintGrid/PrintGridContainer.tsx +0 -128
- package/src/components/PrintGrid/PrintGridItem.tsx +0 -220
- package/src/components/PrintGrid/examples/PrintGridShowcase.tsx +0 -359
- package/src/components/PrintGrid/index.ts +0 -31
- package/src/components/PrintGrid/types.ts +0 -159
- package/src/components/PrintHeader/PrintCoverHeader.tsx +0 -230
- package/src/components/PrintHeader/PrintHeader.tsx +0 -150
- package/src/components/PrintHeader/index.ts +0 -17
- package/src/components/PrintHeader/types.ts +0 -42
- package/src/components/PrintLayout/PrintLayout.tsx +0 -122
- package/src/components/PrintLayout/PrintLayoutContext.tsx +0 -66
- package/src/components/PrintLayout/PrintPageBreak.tsx +0 -52
- package/src/components/PrintLayout/examples/PrintShowcase.tsx +0 -230
- package/src/components/PrintLayout/index.ts +0 -19
- package/src/components/PrintLayout/types.ts +0 -37
- package/src/components/PrintPageBreak/PrintPageBreak.tsx +0 -120
- package/src/components/PrintPageBreak/PrintPageBreakGroup.tsx +0 -90
- package/src/components/PrintPageBreak/PrintPageBreakIndicator.tsx +0 -112
- package/src/components/PrintPageBreak/examples/PrintPageBreakShowcase.tsx +0 -279
- package/src/components/PrintPageBreak/index.ts +0 -23
- package/src/components/PrintPageBreak/types.ts +0 -94
- package/src/components/PrintSection/PrintColumn.tsx +0 -104
- package/src/components/PrintSection/PrintDivider.tsx +0 -101
- package/src/components/PrintSection/PrintSection.tsx +0 -129
- package/src/components/PrintSection/PrintSectionContent.tsx +0 -75
- package/src/components/PrintSection/PrintSectionHeader.tsx +0 -97
- package/src/components/PrintSection/examples/PrintSectionShowcase.tsx +0 -258
- package/src/components/PrintSection/index.ts +0 -33
- package/src/components/PrintSection/types.ts +0 -155
- package/src/components/PrintText/PrintText.tsx +0 -116
- package/src/components/PrintText/index.ts +0 -16
- package/src/components/PrintText/types.ts +0 -24
- package/src/rbac/__tests__/integration.test.tsx +0 -218
- package/src/utils/print/PrintDataProcessor.ts +0 -390
- package/src/utils/print/examples/PrintUtilitiesShowcase.tsx +0 -397
- package/src/utils/print/index.ts +0 -29
- package/src/utils/print/types.ts +0 -196
- package/src/utils/print/usePrintOptimization.ts +0 -272
- /package/dist/{DataTable-7FMFXA7A.js.map → DataTable-4T627QFJ.js.map} +0 -0
- /package/dist/{api-H5A3H4IR.js.map → api-LUNF5O6M.js.map} +0 -0
- /package/dist/{appNameResolver-7GHF5ED2.js.map → appNameResolver-UURKN7NF.js.map} +0 -0
- /package/dist/{audit-BUW3LMJB.js.map → audit-6TOCAMKO.js.map} +0 -0
- /package/dist/{chunk-NRK4AIHQ.js.map → chunk-KBRACSJI.js.map} +0 -0
- /package/dist/{chunk-6MTY77WU.js.map → chunk-TNMXZLDR.js.map} +0 -0
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Print Utilities Showcase Example
|
|
3
|
-
* @package @jmruthers/pace-core
|
|
4
|
-
* @module PrintUtilitiesShowcase
|
|
5
|
-
* @since 0.4.38
|
|
6
|
-
*
|
|
7
|
-
* Example showcasing print utilities usage.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import React, { useState } from 'react';
|
|
11
|
-
import {
|
|
12
|
-
PrintLayout,
|
|
13
|
-
PrintHeader,
|
|
14
|
-
PrintText,
|
|
15
|
-
PrintSection,
|
|
16
|
-
PrintDataTable,
|
|
17
|
-
PrintButton
|
|
18
|
-
} from '../../../components/index';
|
|
19
|
-
import {
|
|
20
|
-
usePrintOptimization,
|
|
21
|
-
usePrintPagination,
|
|
22
|
-
usePrintGrouping,
|
|
23
|
-
usePrintPreview,
|
|
24
|
-
usePrintValidation
|
|
25
|
-
} from '../usePrintOptimization';
|
|
26
|
-
|
|
27
|
-
// Sample data for demonstration
|
|
28
|
-
const sampleData = [
|
|
29
|
-
{ id: 1, name: 'John Doe', email: 'john@example.com', department: 'Engineering', salary: 75000, status: 'Active' },
|
|
30
|
-
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', department: 'Marketing', salary: 65000, status: 'Active' },
|
|
31
|
-
{ id: 3, name: 'Bob Johnson', email: 'bob@example.com', department: 'Engineering', salary: 80000, status: 'Active' },
|
|
32
|
-
{ id: 4, name: 'Alice Brown', email: 'alice@example.com', department: 'Sales', salary: 70000, status: 'Inactive' },
|
|
33
|
-
{ id: 5, name: 'Charlie Wilson', email: 'charlie@example.com', department: 'Marketing', salary: 60000, status: 'Active' },
|
|
34
|
-
{ id: 6, name: 'Diana Davis', email: 'diana@example.com', department: 'Engineering', salary: 85000, status: 'Active' },
|
|
35
|
-
{ id: 7, name: 'Eve Miller', email: 'eve@example.com', department: 'Sales', salary: 72000, status: 'Active' },
|
|
36
|
-
{ id: 8, name: 'Frank Garcia', email: 'frank@example.com', department: 'Marketing', salary: 68000, status: 'Inactive' },
|
|
37
|
-
{ id: 9, name: 'Grace Lee', email: 'grace@example.com', department: 'Engineering', salary: 90000, status: 'Active' },
|
|
38
|
-
{ id: 10, name: 'Henry Taylor', email: 'henry@example.com', department: 'Sales', salary: 75000, status: 'Active' }
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
const tableColumns = [
|
|
42
|
-
{ key: 'id', header: 'ID', align: 'left' as const },
|
|
43
|
-
{ key: 'name', header: 'Name', align: 'left' as const },
|
|
44
|
-
{ key: 'email', header: 'Email', align: 'left' as const },
|
|
45
|
-
{ key: 'department', header: 'Department', align: 'center' as const },
|
|
46
|
-
{ key: 'salary', header: 'Salary', align: 'right' as const, render: (value: number) => `$${value.toLocaleString()}` },
|
|
47
|
-
{ key: 'status', header: 'Status', align: 'center' as const }
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
export function PrintUtilitiesShowcase() {
|
|
51
|
-
const [optimizationLevel, setOptimizationLevel] = useState<'basic' | 'advanced' | 'maximum'>('basic');
|
|
52
|
-
const [itemsPerPage, setItemsPerPage] = useState(5);
|
|
53
|
-
|
|
54
|
-
// Print optimization hook
|
|
55
|
-
const optimization = usePrintOptimization({
|
|
56
|
-
data: sampleData,
|
|
57
|
-
options: {
|
|
58
|
-
optimizationLevel,
|
|
59
|
-
maxItemsPerPage: itemsPerPage,
|
|
60
|
-
maxCharactersPerLine: 80,
|
|
61
|
-
pageBreakStrategy: 'auto'
|
|
62
|
-
},
|
|
63
|
-
autoProcess: true
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
// Pagination hook
|
|
67
|
-
const pagination = usePrintPagination(sampleData, {
|
|
68
|
-
maxItemsPerPage: itemsPerPage
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// Grouping hook
|
|
72
|
-
const grouping = usePrintGrouping(sampleData, 'department', {
|
|
73
|
-
maxItemsPerPage: itemsPerPage
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// Preview hook
|
|
77
|
-
const preview = usePrintPreview(sampleData, {
|
|
78
|
-
maxItemsPerPage: itemsPerPage,
|
|
79
|
-
optimizationLevel
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// Validation hook
|
|
83
|
-
const validation = usePrintValidation(sampleData, {
|
|
84
|
-
maxItemsPerPage: itemsPerPage
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<PrintLayout
|
|
89
|
-
orientation="portrait"
|
|
90
|
-
pageSize="A4"
|
|
91
|
-
firstPageHeader={
|
|
92
|
-
<PrintHeader
|
|
93
|
-
title="Print Utilities Showcase"
|
|
94
|
-
subtitle="Demonstrating data processing and optimization utilities"
|
|
95
|
-
branding={{
|
|
96
|
-
logo: "/pace_logo_square.svg",
|
|
97
|
-
companyName: "Pace Core"
|
|
98
|
-
}}
|
|
99
|
-
metadata={[
|
|
100
|
-
{ label: 'Date', value: new Date().toLocaleDateString() },
|
|
101
|
-
{ label: 'Page', value: "1" }
|
|
102
|
-
]}
|
|
103
|
-
/>
|
|
104
|
-
}
|
|
105
|
-
>
|
|
106
|
-
<div className="space-y-8">
|
|
107
|
-
{/* Print Optimization Controls */}
|
|
108
|
-
<PrintSection title="Print Optimization Controls" background="white" showBorder>
|
|
109
|
-
<PrintSection>
|
|
110
|
-
<PrintText>
|
|
111
|
-
Control print optimization settings and see real-time results.
|
|
112
|
-
</PrintText>
|
|
113
|
-
|
|
114
|
-
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 mt-4">
|
|
115
|
-
<div>
|
|
116
|
-
<PrintText variant="small" weight="semibold">Optimization Level</PrintText>
|
|
117
|
-
<select
|
|
118
|
-
value={optimizationLevel}
|
|
119
|
-
onChange={(e) => setOptimizationLevel(e.target.value as any)}
|
|
120
|
-
className="w-full p-2 border border-border rounded"
|
|
121
|
-
>
|
|
122
|
-
<option value="basic">Basic</option>
|
|
123
|
-
<option value="advanced">Advanced</option>
|
|
124
|
-
<option value="maximum">Maximum</option>
|
|
125
|
-
</select>
|
|
126
|
-
</div>
|
|
127
|
-
|
|
128
|
-
<div>
|
|
129
|
-
<PrintText variant="small" weight="semibold">Items Per Page</PrintText>
|
|
130
|
-
<select
|
|
131
|
-
value={itemsPerPage}
|
|
132
|
-
onChange={(e) => setItemsPerPage(Number(e.target.value))}
|
|
133
|
-
className="w-full p-2 border border-border rounded"
|
|
134
|
-
>
|
|
135
|
-
<option value={3}>3</option>
|
|
136
|
-
<option value={5}>5</option>
|
|
137
|
-
<option value={10}>10</option>
|
|
138
|
-
<option value={20}>20</option>
|
|
139
|
-
</select>
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
|
|
143
|
-
{optimization.result && (
|
|
144
|
-
<div className="mt-4 p-4 bg-muted rounded">
|
|
145
|
-
<PrintText variant="small" weight="semibold">Optimization Results</PrintText>
|
|
146
|
-
<div className="grid grid-cols-2 gap-4 mt-2">
|
|
147
|
-
<div>
|
|
148
|
-
<PrintText variant="small">Total Pages: {optimization.result.pagination.totalPages}</PrintText>
|
|
149
|
-
<PrintText variant="small">Items Per Page: {optimization.result.pagination.itemsPerPage}</PrintText>
|
|
150
|
-
<PrintText variant="small">Total Items: {optimization.result.pagination.totalItems}</PrintText>
|
|
151
|
-
</div>
|
|
152
|
-
<div>
|
|
153
|
-
<PrintText variant="small">Estimated Print Time: {optimization.result.optimization.estimatedPrintTime.toFixed(1)} min</PrintText>
|
|
154
|
-
<PrintText variant="small">Compression Ratio: {(optimization.result.optimization.compressionRatio * 100).toFixed(1)}%</PrintText>
|
|
155
|
-
<PrintText variant="small">Readability Score: {(optimization.result.optimization.readabilityScore * 100).toFixed(1)}%</PrintText>
|
|
156
|
-
</div>
|
|
157
|
-
</div>
|
|
158
|
-
</div>
|
|
159
|
-
)}
|
|
160
|
-
|
|
161
|
-
{optimization.result?.warnings && optimization.result.warnings.length > 0 && (
|
|
162
|
-
<div className="mt-4 p-4 bg-yellow-50 border border-yellow-200 rounded">
|
|
163
|
-
<PrintText variant="small" weight="semibold" color="primary">Warnings</PrintText>
|
|
164
|
-
<ul className="mt-2">
|
|
165
|
-
{optimization.result?.warnings?.map((warning, index) => (
|
|
166
|
-
<li key={index} className="text-sm text-yellow-800">• {warning}</li>
|
|
167
|
-
))}
|
|
168
|
-
</ul>
|
|
169
|
-
</div>
|
|
170
|
-
)}
|
|
171
|
-
|
|
172
|
-
{optimization.result?.suggestions && optimization.result.suggestions.length > 0 && (
|
|
173
|
-
<div className="mt-4 p-4 bg-blue-50 border border-blue-200 rounded">
|
|
174
|
-
<PrintText variant="small" weight="semibold" color="accent">Suggestions</PrintText>
|
|
175
|
-
<ul className="mt-2">
|
|
176
|
-
{optimization.result?.suggestions?.map((suggestion, index) => (
|
|
177
|
-
<li key={index} className="text-sm text-blue-800">• {suggestion}</li>
|
|
178
|
-
))}
|
|
179
|
-
</ul>
|
|
180
|
-
</div>
|
|
181
|
-
)}
|
|
182
|
-
</PrintSection>
|
|
183
|
-
</PrintSection>
|
|
184
|
-
|
|
185
|
-
{/* Pagination Demo */}
|
|
186
|
-
<PrintSection title="Pagination Demo" background="gray">
|
|
187
|
-
<PrintSection>
|
|
188
|
-
<PrintText>
|
|
189
|
-
Navigate through paginated data with print-optimized controls.
|
|
190
|
-
</PrintText>
|
|
191
|
-
|
|
192
|
-
<div className="mt-4">
|
|
193
|
-
<PrintText variant="small" weight="semibold">
|
|
194
|
-
Page {pagination.currentPage} of {pagination.pagination.totalPages}
|
|
195
|
-
</PrintText>
|
|
196
|
-
|
|
197
|
-
<div className="flex gap-2 mt-2">
|
|
198
|
-
<PrintButton
|
|
199
|
-
variant="outline"
|
|
200
|
-
size="sm"
|
|
201
|
-
onClick={pagination.prevPage}
|
|
202
|
-
disabled={pagination.currentPage === 1}
|
|
203
|
-
>
|
|
204
|
-
Previous
|
|
205
|
-
</PrintButton>
|
|
206
|
-
|
|
207
|
-
<PrintButton
|
|
208
|
-
variant="outline"
|
|
209
|
-
size="sm"
|
|
210
|
-
onClick={pagination.nextPage}
|
|
211
|
-
disabled={pagination.currentPage === pagination.pagination.totalPages}
|
|
212
|
-
>
|
|
213
|
-
Next
|
|
214
|
-
</PrintButton>
|
|
215
|
-
|
|
216
|
-
<PrintButton
|
|
217
|
-
variant="outline"
|
|
218
|
-
size="sm"
|
|
219
|
-
onClick={() => pagination.goToPage(1)}
|
|
220
|
-
>
|
|
221
|
-
First
|
|
222
|
-
</PrintButton>
|
|
223
|
-
|
|
224
|
-
<PrintButton
|
|
225
|
-
variant="outline"
|
|
226
|
-
size="sm"
|
|
227
|
-
onClick={() => pagination.goToPage(pagination.pagination.totalPages)}
|
|
228
|
-
>
|
|
229
|
-
Last
|
|
230
|
-
</PrintButton>
|
|
231
|
-
</div>
|
|
232
|
-
</div>
|
|
233
|
-
</PrintSection>
|
|
234
|
-
</PrintSection>
|
|
235
|
-
|
|
236
|
-
{/* Grouping Demo */}
|
|
237
|
-
<PrintSection title="Grouping Demo" background="white" showBorder>
|
|
238
|
-
<PrintSection>
|
|
239
|
-
<PrintText>
|
|
240
|
-
Group data by department with expandable/collapsible sections.
|
|
241
|
-
</PrintText>
|
|
242
|
-
|
|
243
|
-
<div className="mt-4">
|
|
244
|
-
<div className="flex gap-2 mb-4">
|
|
245
|
-
<PrintButton
|
|
246
|
-
variant="outline"
|
|
247
|
-
size="sm"
|
|
248
|
-
onClick={grouping.expandAllGroups}
|
|
249
|
-
>
|
|
250
|
-
Expand All
|
|
251
|
-
</PrintButton>
|
|
252
|
-
|
|
253
|
-
<PrintButton
|
|
254
|
-
variant="outline"
|
|
255
|
-
size="sm"
|
|
256
|
-
onClick={grouping.collapseAllGroups}
|
|
257
|
-
>
|
|
258
|
-
Collapse All
|
|
259
|
-
</PrintButton>
|
|
260
|
-
</div>
|
|
261
|
-
|
|
262
|
-
<div className="space-y-2">
|
|
263
|
-
{grouping.grouping.groups.map((group) => (
|
|
264
|
-
<div key={group.key} className="border border-border rounded">
|
|
265
|
-
<div
|
|
266
|
-
className="p-3 bg-muted cursor-pointer"
|
|
267
|
-
onClick={() => grouping.toggleGroup(group.key)}
|
|
268
|
-
>
|
|
269
|
-
<PrintText weight="semibold">
|
|
270
|
-
{group.key} ({group.items.length} items)
|
|
271
|
-
</PrintText>
|
|
272
|
-
</div>
|
|
273
|
-
|
|
274
|
-
{grouping.isGroupExpanded(group.key) && (
|
|
275
|
-
<div className="p-3">
|
|
276
|
-
<PrintDataTable
|
|
277
|
-
data={group.items}
|
|
278
|
-
columns={tableColumns}
|
|
279
|
-
printOptimized={true}
|
|
280
|
-
/>
|
|
281
|
-
</div>
|
|
282
|
-
)}
|
|
283
|
-
</div>
|
|
284
|
-
))}
|
|
285
|
-
</div>
|
|
286
|
-
</div>
|
|
287
|
-
</PrintSection>
|
|
288
|
-
</PrintSection>
|
|
289
|
-
|
|
290
|
-
{/* Preview Demo */}
|
|
291
|
-
<PrintSection title="Print Preview Demo" background="gray">
|
|
292
|
-
<PrintSection>
|
|
293
|
-
<PrintText>
|
|
294
|
-
Preview print metrics and estimated output before printing.
|
|
295
|
-
</PrintText>
|
|
296
|
-
|
|
297
|
-
<div className="mt-4">
|
|
298
|
-
<PrintButton
|
|
299
|
-
variant="primary"
|
|
300
|
-
onClick={preview.togglePreview}
|
|
301
|
-
>
|
|
302
|
-
{preview.isPreviewVisible ? 'Hide Preview' : 'Show Preview'}
|
|
303
|
-
</PrintButton>
|
|
304
|
-
|
|
305
|
-
{preview.isPreviewVisible && (
|
|
306
|
-
<div className="mt-4 p-4 bg-background border border-border rounded">
|
|
307
|
-
<PrintText variant="small" weight="semibold">Print Preview</PrintText>
|
|
308
|
-
<div className="grid grid-cols-2 gap-4 mt-2">
|
|
309
|
-
<div>
|
|
310
|
-
<PrintText variant="small">Estimated Pages: {preview.preview.estimatedPages}</PrintText>
|
|
311
|
-
<PrintText variant="small">Print Time: {preview.preview.estimatedPrintTime.toFixed(1)} min</PrintText>
|
|
312
|
-
</div>
|
|
313
|
-
<div>
|
|
314
|
-
<PrintText variant="small">Compression: {(preview.preview.compressionRatio * 100).toFixed(1)}%</PrintText>
|
|
315
|
-
<PrintText variant="small">Readability: {(preview.preview.readabilityScore * 100).toFixed(1)}%</PrintText>
|
|
316
|
-
</div>
|
|
317
|
-
</div>
|
|
318
|
-
</div>
|
|
319
|
-
)}
|
|
320
|
-
</div>
|
|
321
|
-
</PrintSection>
|
|
322
|
-
</PrintSection>
|
|
323
|
-
|
|
324
|
-
{/* Validation Demo */}
|
|
325
|
-
<PrintSection title="Data Validation Demo" background="white" showBorder>
|
|
326
|
-
<PrintSection>
|
|
327
|
-
<PrintText>
|
|
328
|
-
Validate data for print compatibility and get recommendations.
|
|
329
|
-
</PrintText>
|
|
330
|
-
|
|
331
|
-
<div className="mt-4">
|
|
332
|
-
<PrintButton
|
|
333
|
-
variant="secondary"
|
|
334
|
-
onClick={validation.validate}
|
|
335
|
-
disabled={validation.isValidating}
|
|
336
|
-
>
|
|
337
|
-
{validation.isValidating ? 'Validating...' : 'Validate Data'}
|
|
338
|
-
</PrintButton>
|
|
339
|
-
|
|
340
|
-
<div className="mt-4 p-4 bg-muted rounded">
|
|
341
|
-
<PrintText variant="small" weight="semibold">Validation Results</PrintText>
|
|
342
|
-
<div className="mt-2">
|
|
343
|
-
<PrintText variant="small">
|
|
344
|
-
Status: {validation.validation.isValid ? '✅ Valid' : '❌ Invalid'}
|
|
345
|
-
</PrintText>
|
|
346
|
-
|
|
347
|
-
{validation.validation.errors.length > 0 && (
|
|
348
|
-
<div className="mt-2">
|
|
349
|
-
<PrintText variant="small" weight="semibold" color="primary">Errors:</PrintText>
|
|
350
|
-
<ul className="mt-1">
|
|
351
|
-
{validation.validation.errors.map((error, index) => (
|
|
352
|
-
<li key={index} className="text-sm text-red-600">• {error}</li>
|
|
353
|
-
))}
|
|
354
|
-
</ul>
|
|
355
|
-
</div>
|
|
356
|
-
)}
|
|
357
|
-
|
|
358
|
-
{validation.validation.warnings.length > 0 && (
|
|
359
|
-
<div className="mt-2">
|
|
360
|
-
<PrintText variant="small" weight="semibold" color="accent">Warnings:</PrintText>
|
|
361
|
-
<ul className="mt-1">
|
|
362
|
-
{validation.validation.warnings.map((warning, index) => (
|
|
363
|
-
<li key={index} className="text-sm text-yellow-600">• {warning}</li>
|
|
364
|
-
))}
|
|
365
|
-
</ul>
|
|
366
|
-
</div>
|
|
367
|
-
)}
|
|
368
|
-
</div>
|
|
369
|
-
</div>
|
|
370
|
-
</div>
|
|
371
|
-
</PrintSection>
|
|
372
|
-
</PrintSection>
|
|
373
|
-
|
|
374
|
-
{/* Data Table with Print Optimization */}
|
|
375
|
-
<PrintSection title="Optimized Data Table" background="gray">
|
|
376
|
-
<PrintSection>
|
|
377
|
-
<PrintText>
|
|
378
|
-
Data table with print optimization applied based on current settings.
|
|
379
|
-
</PrintText>
|
|
380
|
-
|
|
381
|
-
<div className="mt-4">
|
|
382
|
-
<PrintDataTable
|
|
383
|
-
data={pagination.paginatedData}
|
|
384
|
-
columns={tableColumns}
|
|
385
|
-
printOptimized={true}
|
|
386
|
-
grouping={{
|
|
387
|
-
enabled: true,
|
|
388
|
-
groupBy: 'department'
|
|
389
|
-
}}
|
|
390
|
-
/>
|
|
391
|
-
</div>
|
|
392
|
-
</PrintSection>
|
|
393
|
-
</PrintSection>
|
|
394
|
-
</div>
|
|
395
|
-
</PrintLayout>
|
|
396
|
-
);
|
|
397
|
-
}
|
package/src/utils/print/index.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Print Utilities Exports
|
|
3
|
-
* @package @jmruthers/pace-core
|
|
4
|
-
* @module PrintUtilities
|
|
5
|
-
* @since 0.4.38
|
|
6
|
-
*
|
|
7
|
-
* Exports for print data processing utilities.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export { PrintDataProcessorImpl, printDataProcessor } from './PrintDataProcessor';
|
|
11
|
-
export {
|
|
12
|
-
usePrintOptimization,
|
|
13
|
-
usePrintPagination,
|
|
14
|
-
usePrintGrouping,
|
|
15
|
-
usePrintPreview,
|
|
16
|
-
usePrintValidation
|
|
17
|
-
} from './usePrintOptimization';
|
|
18
|
-
|
|
19
|
-
export type {
|
|
20
|
-
PrintDataProcessorOptions,
|
|
21
|
-
PrintDataProcessorResult,
|
|
22
|
-
PrintDataProcessorConfig,
|
|
23
|
-
PrintDataProcessor,
|
|
24
|
-
PrintDataProcessorHookOptions,
|
|
25
|
-
PrintDataProcessorHookResult,
|
|
26
|
-
PrintDataProcessorOptionsKey,
|
|
27
|
-
PrintDataProcessorResultKey,
|
|
28
|
-
PrintDataProcessorConfigKey,
|
|
29
|
-
} from './types';
|
package/src/utils/print/types.ts
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Print Data Processing Types
|
|
3
|
-
* @package @jmruthers/pace-core
|
|
4
|
-
* @module PrintDataProcessor
|
|
5
|
-
* @since 0.4.38
|
|
6
|
-
*
|
|
7
|
-
* Type definitions for print data processing utilities.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export interface PrintDataProcessorOptions {
|
|
11
|
-
/** Maximum items per page */
|
|
12
|
-
maxItemsPerPage?: number;
|
|
13
|
-
|
|
14
|
-
/** Maximum characters per line */
|
|
15
|
-
maxCharactersPerLine?: number;
|
|
16
|
-
|
|
17
|
-
/** Maximum lines per page */
|
|
18
|
-
maxLinesPerPage?: number;
|
|
19
|
-
|
|
20
|
-
/** Page break strategy */
|
|
21
|
-
pageBreakStrategy?: 'auto' | 'avoid' | 'force' | 'smart';
|
|
22
|
-
|
|
23
|
-
/** Grouping strategy */
|
|
24
|
-
groupingStrategy?: 'none' | 'auto' | 'manual' | 'smart';
|
|
25
|
-
|
|
26
|
-
/** Text truncation strategy */
|
|
27
|
-
truncationStrategy?: 'none' | 'ellipsis' | 'word' | 'character';
|
|
28
|
-
|
|
29
|
-
/** Print optimization level */
|
|
30
|
-
optimizationLevel?: 'none' | 'basic' | 'advanced' | 'maximum';
|
|
31
|
-
|
|
32
|
-
/** Custom page size */
|
|
33
|
-
pageSize?: 'A4' | 'A3' | 'A5' | 'Letter' | 'Legal';
|
|
34
|
-
|
|
35
|
-
/** Orientation */
|
|
36
|
-
orientation?: 'portrait' | 'landscape';
|
|
37
|
-
|
|
38
|
-
/** Font size */
|
|
39
|
-
fontSize?: number;
|
|
40
|
-
|
|
41
|
-
/** Line height */
|
|
42
|
-
lineHeight?: number;
|
|
43
|
-
|
|
44
|
-
/** Margins */
|
|
45
|
-
margins?: {
|
|
46
|
-
top: number;
|
|
47
|
-
right: number;
|
|
48
|
-
bottom: number;
|
|
49
|
-
left: number;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface PrintDataProcessorResult<T = any> {
|
|
54
|
-
/** Processed data */
|
|
55
|
-
data: T[];
|
|
56
|
-
|
|
57
|
-
/** Pagination information */
|
|
58
|
-
pagination: {
|
|
59
|
-
totalPages: number;
|
|
60
|
-
currentPage: number;
|
|
61
|
-
itemsPerPage: number;
|
|
62
|
-
totalItems: number;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
/** Grouping information */
|
|
66
|
-
grouping: {
|
|
67
|
-
groups: Array<{
|
|
68
|
-
key: string;
|
|
69
|
-
items: T[];
|
|
70
|
-
startPage: number;
|
|
71
|
-
endPage: number;
|
|
72
|
-
}>;
|
|
73
|
-
totalGroups: number;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
/** Optimization metrics */
|
|
77
|
-
optimization: {
|
|
78
|
-
estimatedPages: number;
|
|
79
|
-
estimatedPrintTime: number;
|
|
80
|
-
compressionRatio: number;
|
|
81
|
-
readabilityScore: number;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
/** Warnings and suggestions */
|
|
85
|
-
warnings: string[];
|
|
86
|
-
suggestions: string[];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface PrintDataProcessorConfig {
|
|
90
|
-
/** Default options */
|
|
91
|
-
defaultOptions: PrintDataProcessorOptions;
|
|
92
|
-
|
|
93
|
-
/** Page size configurations */
|
|
94
|
-
pageSizes: Record<string, {
|
|
95
|
-
width: number;
|
|
96
|
-
height: number;
|
|
97
|
-
margin: {
|
|
98
|
-
top: number;
|
|
99
|
-
right: number;
|
|
100
|
-
bottom: number;
|
|
101
|
-
left: number;
|
|
102
|
-
};
|
|
103
|
-
}>;
|
|
104
|
-
|
|
105
|
-
/** Font configurations */
|
|
106
|
-
fonts: Record<string, {
|
|
107
|
-
size: number;
|
|
108
|
-
lineHeight: number;
|
|
109
|
-
charactersPerLine: number;
|
|
110
|
-
}>;
|
|
111
|
-
|
|
112
|
-
/** Optimization presets */
|
|
113
|
-
presets: Record<string, PrintDataProcessorOptions>;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface PrintDataProcessor {
|
|
117
|
-
/** Process data for print optimization */
|
|
118
|
-
process<T>(data: T[], options?: Partial<PrintDataProcessorOptions>): PrintDataProcessorResult<T>;
|
|
119
|
-
|
|
120
|
-
/** Get pagination information */
|
|
121
|
-
getPagination<T>(data: T[], options?: Partial<PrintDataProcessorOptions>): {
|
|
122
|
-
totalPages: number;
|
|
123
|
-
itemsPerPage: number;
|
|
124
|
-
totalItems: number;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
/** Get grouping information */
|
|
128
|
-
getGrouping<T>(data: T[], groupBy: keyof T, options?: Partial<PrintDataProcessorOptions>): {
|
|
129
|
-
groups: Array<{
|
|
130
|
-
key: string;
|
|
131
|
-
items: T[];
|
|
132
|
-
startPage: number;
|
|
133
|
-
endPage: number;
|
|
134
|
-
}>;
|
|
135
|
-
totalGroups: number;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
/** Optimize data for print */
|
|
139
|
-
optimize<T>(data: T[], options?: Partial<PrintDataProcessorOptions>): T[];
|
|
140
|
-
|
|
141
|
-
/** Validate data for print compatibility */
|
|
142
|
-
validate<T>(data: T[], options?: Partial<PrintDataProcessorOptions>): {
|
|
143
|
-
isValid: boolean;
|
|
144
|
-
errors: string[];
|
|
145
|
-
warnings: string[];
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
/** Get print preview information */
|
|
149
|
-
getPreview<T>(data: T[], options?: Partial<PrintDataProcessorOptions>): {
|
|
150
|
-
estimatedPages: number;
|
|
151
|
-
estimatedPrintTime: number;
|
|
152
|
-
compressionRatio: number;
|
|
153
|
-
readabilityScore: number;
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export interface PrintDataProcessorHookOptions {
|
|
158
|
-
/** Data to process */
|
|
159
|
-
data: any[];
|
|
160
|
-
|
|
161
|
-
/** Processing options */
|
|
162
|
-
options?: Partial<PrintDataProcessorOptions>;
|
|
163
|
-
|
|
164
|
-
/** Auto-process on data change */
|
|
165
|
-
autoProcess?: boolean;
|
|
166
|
-
|
|
167
|
-
/** Debounce delay for auto-processing */
|
|
168
|
-
debounceDelay?: number;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export interface PrintDataProcessorHookResult<T = any> {
|
|
172
|
-
/** Processed data result */
|
|
173
|
-
result: PrintDataProcessorResult<T> | null;
|
|
174
|
-
|
|
175
|
-
/** Processing state */
|
|
176
|
-
isProcessing: boolean;
|
|
177
|
-
|
|
178
|
-
/** Error state */
|
|
179
|
-
error: string | null;
|
|
180
|
-
|
|
181
|
-
/** Process data manually */
|
|
182
|
-
process: (options?: Partial<PrintDataProcessorOptions>) => void;
|
|
183
|
-
|
|
184
|
-
/** Reset processing state */
|
|
185
|
-
reset: () => void;
|
|
186
|
-
|
|
187
|
-
/** Update data */
|
|
188
|
-
updateData: (data: any[]) => void;
|
|
189
|
-
|
|
190
|
-
/** Update options */
|
|
191
|
-
updateOptions: (options: Partial<PrintDataProcessorOptions>) => void;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export type PrintDataProcessorOptionsKey = keyof PrintDataProcessorOptions;
|
|
195
|
-
export type PrintDataProcessorResultKey = keyof PrintDataProcessorResult;
|
|
196
|
-
export type PrintDataProcessorConfigKey = keyof PrintDataProcessorConfig;
|