@jmruthers/pace-core 0.5.101 → 0.5.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DataTable-DXELRJIX.js → DataTable-EEDFYMJP.js} +2 -2
- package/dist/{PublicLoadingSpinner-C2h8zg67.d.ts → PublicLoadingSpinner-48ewSMKK.d.ts} +22 -150
- package/dist/{chunk-2ZYHCFUO.js → chunk-5SGBVBRU.js} +2 -2
- package/dist/{chunk-EVVRUGQ2.js → chunk-62AVH7CM.js} +78 -55
- package/dist/{chunk-EVVRUGQ2.js.map → chunk-62AVH7CM.js.map} +1 -1
- package/dist/{chunk-A5DFMP3O.js → chunk-SZWCMVTQ.js} +135 -669
- package/dist/chunk-SZWCMVTQ.js.map +1 -0
- package/dist/{chunk-MKMKUCPF.js → chunk-X33A4WWI.js} +42 -141
- package/dist/chunk-X33A4WWI.js.map +1 -0
- package/dist/components.d.ts +1 -1
- package/dist/components.js +3 -15
- package/dist/components.js.map +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +2 -9
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -22
- package/dist/index.js.map +1 -1
- package/dist/types.js +3 -3
- package/dist/{usePublicRouteParams-BwMR2uub.d.ts → usePublicRouteParams-BiXgKiYa.d.ts} +1 -117
- package/dist/utils.js +1 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- 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 +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +1 -1
- 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 +2 -1
- package/docs/api/enums/FileCategory.md +1 -1
- 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/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/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +77 -35
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/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 +1 -1
- 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 +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
- 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 +11 -24
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- 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/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +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/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeReturn.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 +29 -244
- package/docs/implementation-guides/file-reference-system.md +84 -21
- package/package.json +1 -1
- package/src/components/DataTable/components/DataTableCore.tsx +23 -13
- package/src/components/DataTable/hooks/useTableColumns.ts +36 -6
- package/src/components/FileDisplay/FileDisplay.test.tsx +1 -1
- package/src/components/FileDisplay/FileDisplay.tsx +189 -300
- package/src/components/PublicLayout/PublicPageHeader.tsx +15 -10
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +25 -35
- package/src/components/PublicLayout/index.ts +2 -5
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/index.ts +0 -2
- package/src/examples/PublicEventPage.tsx +17 -7
- package/src/examples/PublicPageApp.tsx +18 -8
- package/src/hooks/public/index.ts +2 -4
- package/src/hooks/useFileReference.ts +10 -1
- package/src/index.ts +0 -2
- package/src/utils/file-reference.ts +54 -9
- package/src/utils/storage/README.md +22 -20
- package/src/utils/storage/helpers.ts +12 -1
- package/dist/chunk-A5DFMP3O.js.map +0 -1
- package/dist/chunk-MKMKUCPF.js.map +0 -1
- package/docs/api/interfaces/EventLogoProps.md +0 -152
- package/docs/api/interfaces/UseEventLogoOptions.md +0 -74
- package/docs/api/interfaces/UseEventLogoReturn.md +0 -81
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +0 -87
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +0 -81
- package/src/components/PublicLayout/EventLogo.tsx +0 -474
- package/src/hooks/public/usePublicEventLogo.ts +0 -295
- package/src/hooks/useEventLogo.ts +0 -316
- /package/dist/{DataTable-DXELRJIX.js.map → DataTable-EEDFYMJP.js.map} +0 -0
- /package/dist/{chunk-2ZYHCFUO.js.map → chunk-5SGBVBRU.js.map} +0 -0
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
sortHierarchicalDataWithSorting,
|
|
55
55
|
validateHierarchicalData,
|
|
56
56
|
validatePaginationConfig
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-62AVH7CM.js";
|
|
58
58
|
import "./chunk-2KLAOD4M.js";
|
|
59
59
|
import "./chunk-S63MFSY6.js";
|
|
60
60
|
import "./chunk-Q7APDV6H.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
validateHierarchicalData,
|
|
158
158
|
validatePaginationConfig
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=DataTable-
|
|
160
|
+
//# sourceMappingURL=DataTable-EEDFYMJP.js.map
|
|
@@ -2950,15 +2950,12 @@ declare function FileUpload({ supabase, table_name, record_id, organisation_id,
|
|
|
2950
2950
|
multiple, disabled, isPublic, className, showPreview, showProgress, onUploadSuccess, onUploadError, onProgress, children }: FileUploadProps): react_jsx_runtime.JSX.Element;
|
|
2951
2951
|
|
|
2952
2952
|
interface FileDisplayProps {
|
|
2953
|
-
/** Supabase client instance. Optional when used in PublicPageProvider or UnifiedAuthProvider context */
|
|
2954
|
-
supabase?: SupabaseClient;
|
|
2955
2953
|
table_name: string;
|
|
2956
2954
|
record_id: string;
|
|
2957
2955
|
organisation_id: string;
|
|
2958
2956
|
category?: FileCategory;
|
|
2959
2957
|
/** Display only a single file instead of all files. Uses first file (prefers images) from all files, without category filtering */
|
|
2960
2958
|
displayOnly?: boolean;
|
|
2961
|
-
showUpload?: boolean;
|
|
2962
2959
|
showDelete?: boolean;
|
|
2963
2960
|
className?: string;
|
|
2964
2961
|
children?: React__default.ReactNode;
|
|
@@ -2969,6 +2966,14 @@ interface FileDisplayProps {
|
|
|
2969
2966
|
error: Error | string | null;
|
|
2970
2967
|
retry?: () => void;
|
|
2971
2968
|
}>;
|
|
2969
|
+
/** Whether to show fallback UI when no file is available or image fails to load */
|
|
2970
|
+
showFallback?: boolean;
|
|
2971
|
+
/** Custom function to generate fallback text from file name or other context */
|
|
2972
|
+
generateFallbackText?: (fileName?: string) => string;
|
|
2973
|
+
/** Explicit fallback text to display (overrides generateFallbackText) */
|
|
2974
|
+
fallbackText?: string;
|
|
2975
|
+
/** Size variant for fallback display (only applies when showFallback is true) */
|
|
2976
|
+
fallbackSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
2972
2977
|
}
|
|
2973
2978
|
/**
|
|
2974
2979
|
* Component for displaying file references with context-awareness
|
|
@@ -2976,8 +2981,7 @@ interface FileDisplayProps {
|
|
|
2976
2981
|
* This component is context-aware and automatically detects whether it's being used
|
|
2977
2982
|
* in a public or authenticated context. It fetches and displays files from storage.
|
|
2978
2983
|
*
|
|
2979
|
-
*
|
|
2980
|
-
* When `supabase` prop is not provided, it automatically detects context and uses:
|
|
2984
|
+
* The component automatically detects context and uses:
|
|
2981
2985
|
* - PublicPageProvider context for public pages
|
|
2982
2986
|
* - UnifiedAuthProvider context for authenticated pages
|
|
2983
2987
|
*
|
|
@@ -2986,7 +2990,7 @@ interface FileDisplayProps {
|
|
|
2986
2990
|
* @param props.category - Optional category filter. When specified, only displays files matching this category and uses single file display variant.
|
|
2987
2991
|
* @returns React element with file display
|
|
2988
2992
|
*/
|
|
2989
|
-
declare function FileDisplay({
|
|
2993
|
+
declare function FileDisplay({ table_name, record_id, organisation_id, category, displayOnly, showDelete, className, children, loadingComponent, errorComponent, showFallback, generateFallbackText, fallbackText, fallbackSize }: FileDisplayProps): react_jsx_runtime.JSX.Element;
|
|
2990
2994
|
|
|
2991
2995
|
declare function useFileReference(supabase: SupabaseClient): {
|
|
2992
2996
|
isLoading: boolean;
|
|
@@ -3030,7 +3034,16 @@ declare function useFileReferenceById(supabase: SupabaseClient, fileReferenceId:
|
|
|
3030
3034
|
clearError: () => void;
|
|
3031
3035
|
};
|
|
3032
3036
|
/**
|
|
3033
|
-
*
|
|
3037
|
+
* Convenience hook for getting files by category with automatic URL loading.
|
|
3038
|
+
*
|
|
3039
|
+
* This hook wraps useFileReference().getFilesByCategory and automatically:
|
|
3040
|
+
* - Loads file references filtered by category
|
|
3041
|
+
* - Generates URLs for all files (public URLs for public files, signed URLs for private files)
|
|
3042
|
+
* - Manages state for fileReferences and fileUrls
|
|
3043
|
+
* - Auto-refetches when table_name, record_id, category, or organisation_id changes
|
|
3044
|
+
*
|
|
3045
|
+
* Use this hook when you need files by category with their URLs ready to display.
|
|
3046
|
+
* For more control, use useFileReference() directly and manage URLs yourself.
|
|
3034
3047
|
*/
|
|
3035
3048
|
declare function useFilesByCategory(supabase: SupabaseClient, table_name: string, record_id: string, category: FileCategory | null, organisation_id: string | null): {
|
|
3036
3049
|
isLoading: boolean;
|
|
@@ -3074,101 +3087,6 @@ type UseFileReferenceForRecordReturn = {
|
|
|
3074
3087
|
clearError: () => void;
|
|
3075
3088
|
};
|
|
3076
3089
|
|
|
3077
|
-
/**
|
|
3078
|
-
* @file Event Logo Hook (Authenticated)
|
|
3079
|
-
* @package @jmruthers/pace-core
|
|
3080
|
-
* @module Hooks
|
|
3081
|
-
*
|
|
3082
|
-
* A React hook for accessing event logos in authenticated contexts.
|
|
3083
|
-
* Can handle both public and private event logos using the file_references system.
|
|
3084
|
-
*
|
|
3085
|
-
* Features:
|
|
3086
|
-
* - Works in authenticated contexts
|
|
3087
|
-
* - Supports both public and private event logos
|
|
3088
|
-
* - Automatic fallback to event initials
|
|
3089
|
-
* - Bucket-aware URL generation
|
|
3090
|
-
* - Signed URL support for private files
|
|
3091
|
-
* - Caching for performance
|
|
3092
|
-
* - Error handling and loading states
|
|
3093
|
-
*
|
|
3094
|
-
* @example
|
|
3095
|
-
* ```tsx
|
|
3096
|
-
* import { useEventLogo } from '@jmruthers/pace-core';
|
|
3097
|
-
*
|
|
3098
|
-
* function EventHeader() {
|
|
3099
|
-
* const { logoUrl, fallbackText, isLoading, error } = useEventLogo(
|
|
3100
|
-
* supabase,
|
|
3101
|
-
* eventId,
|
|
3102
|
-
* eventName,
|
|
3103
|
-
* organisationId
|
|
3104
|
-
* );
|
|
3105
|
-
*
|
|
3106
|
-
* if (isLoading) return <div>Loading...</div>;
|
|
3107
|
-
* if (error) return <div>Error: {error.message}</div>;
|
|
3108
|
-
*
|
|
3109
|
-
* return (
|
|
3110
|
-
* <div>
|
|
3111
|
-
* {logoUrl ? (
|
|
3112
|
-
* <img src={logoUrl} alt={`${eventName} logo`} />
|
|
3113
|
-
* ) : (
|
|
3114
|
-
* <div className="logo-fallback">{fallbackText}</div>
|
|
3115
|
-
* )}
|
|
3116
|
-
* </div>
|
|
3117
|
-
* );
|
|
3118
|
-
* }
|
|
3119
|
-
* ```
|
|
3120
|
-
*/
|
|
3121
|
-
|
|
3122
|
-
interface UseEventLogoReturn {
|
|
3123
|
-
/** The logo URL if available, null if not found or error */
|
|
3124
|
-
logoUrl: string | null;
|
|
3125
|
-
/** Fallback text (event initials) if no logo is available */
|
|
3126
|
-
fallbackText: string;
|
|
3127
|
-
/** Whether the logo is currently loading */
|
|
3128
|
-
isLoading: boolean;
|
|
3129
|
-
/** Any error that occurred during loading */
|
|
3130
|
-
error: Error | null;
|
|
3131
|
-
/** Function to manually refetch the logo */
|
|
3132
|
-
refetch: () => Promise<void>;
|
|
3133
|
-
}
|
|
3134
|
-
interface UseEventLogoOptions {
|
|
3135
|
-
/** Cache TTL in milliseconds (default: 30 minutes) */
|
|
3136
|
-
cacheTtl?: number;
|
|
3137
|
-
/** Whether to enable caching (default: true) */
|
|
3138
|
-
enableCache?: boolean;
|
|
3139
|
-
/** Whether to validate image existence (default: true) */
|
|
3140
|
-
validateImage?: boolean;
|
|
3141
|
-
/** Custom fallback text generator */
|
|
3142
|
-
generateFallbackText?: (eventName: string) => string;
|
|
3143
|
-
}
|
|
3144
|
-
/**
|
|
3145
|
-
* Hook for accessing event logo URLs in authenticated contexts
|
|
3146
|
-
*
|
|
3147
|
-
* This hook provides access to event logo URLs for authenticated users.
|
|
3148
|
-
* It supports both public and private logos, generating appropriate URLs
|
|
3149
|
-
* (public URLs for public files, signed URLs for private files).
|
|
3150
|
-
*
|
|
3151
|
-
* @param supabase - Supabase client instance (required)
|
|
3152
|
-
* @param eventId - The event ID to fetch logo for
|
|
3153
|
-
* @param eventName - The event name for fallback text generation
|
|
3154
|
-
* @param organisationId - The organisation ID for storage path
|
|
3155
|
-
* @param options - Configuration options for caching and behavior
|
|
3156
|
-
* @returns Object containing logo URL, fallback text, loading state, error, and refetch function
|
|
3157
|
-
*/
|
|
3158
|
-
declare function useEventLogo(supabase: SupabaseClient | null, eventId: string | undefined, eventName: string | undefined, organisationId: string | undefined, options?: UseEventLogoOptions): UseEventLogoReturn;
|
|
3159
|
-
/**
|
|
3160
|
-
* Clear all cached authenticated event logo data
|
|
3161
|
-
* Useful for testing or when you need to force refresh all data
|
|
3162
|
-
*/
|
|
3163
|
-
declare function clearEventLogoCache(): void;
|
|
3164
|
-
/**
|
|
3165
|
-
* Get cache statistics for debugging
|
|
3166
|
-
*/
|
|
3167
|
-
declare function getEventLogoCacheStats(): {
|
|
3168
|
-
size: number;
|
|
3169
|
-
keys: string[];
|
|
3170
|
-
};
|
|
3171
|
-
|
|
3172
3090
|
/**
|
|
3173
3091
|
* @file Table Component System
|
|
3174
3092
|
* @package @jmruthers/pace-core
|
|
@@ -3359,8 +3277,6 @@ interface PublicPageHeaderProps {
|
|
|
3359
3277
|
customAppLogo?: ReactNode;
|
|
3360
3278
|
/** Custom event logo component */
|
|
3361
3279
|
customEventLogo?: ReactNode;
|
|
3362
|
-
/** Optional Supabase client (for testing) */
|
|
3363
|
-
supabase?: SupabaseClient;
|
|
3364
3280
|
}
|
|
3365
3281
|
/**
|
|
3366
3282
|
* Header component for public pages with event-specific branding
|
|
@@ -3371,7 +3287,7 @@ interface PublicPageHeaderProps {
|
|
|
3371
3287
|
* @param props - Header configuration and content
|
|
3372
3288
|
* @returns React element with public page header
|
|
3373
3289
|
*/
|
|
3374
|
-
declare function PublicPageHeader({ event, eventCode, title, description, showEventLogo, showAppLogo, className, children, customAppLogo, customEventLogo
|
|
3290
|
+
declare function PublicPageHeader({ event, eventCode, title, description, showEventLogo, showAppLogo, className, children, customAppLogo, customEventLogo }: PublicPageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
3375
3291
|
|
|
3376
3292
|
interface PublicPageContextType {
|
|
3377
3293
|
isPublicPage: true;
|
|
@@ -3508,50 +3424,6 @@ interface PublicPageContextCheckerProps {
|
|
|
3508
3424
|
*/
|
|
3509
3425
|
declare function PublicPageContextChecker({ enabled, label }: PublicPageContextCheckerProps): react_jsx_runtime.JSX.Element | null;
|
|
3510
3426
|
|
|
3511
|
-
interface EventLogoProps {
|
|
3512
|
-
/** The event ID to fetch logo for */
|
|
3513
|
-
eventId: string;
|
|
3514
|
-
/** The event name for fallback text generation */
|
|
3515
|
-
eventName: string;
|
|
3516
|
-
/** The organisation ID for storage path */
|
|
3517
|
-
organisationId: string;
|
|
3518
|
-
/** Logo size variant */
|
|
3519
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3520
|
-
/** Custom CSS classes */
|
|
3521
|
-
className?: string;
|
|
3522
|
-
/** Whether to show fallback text when no logo is available */
|
|
3523
|
-
showFallback?: boolean;
|
|
3524
|
-
/** Custom fallback text generator */
|
|
3525
|
-
generateFallbackText?: (eventName: string) => string;
|
|
3526
|
-
/** Whether to validate image existence */
|
|
3527
|
-
validateImage?: boolean;
|
|
3528
|
-
/** Custom loading component */
|
|
3529
|
-
loadingComponent?: React__default.ComponentType;
|
|
3530
|
-
/** Custom error component */
|
|
3531
|
-
errorComponent?: React__default.ComponentType<{
|
|
3532
|
-
error: Error;
|
|
3533
|
-
}>;
|
|
3534
|
-
}
|
|
3535
|
-
/**
|
|
3536
|
-
* Component for displaying event logos with fallback to initials
|
|
3537
|
-
*
|
|
3538
|
-
* This component is context-aware and automatically detects whether it's being used
|
|
3539
|
-
* in a public or authenticated context. It fetches and displays event logos from storage,
|
|
3540
|
-
* with automatic fallback to event initials if no logo is available.
|
|
3541
|
-
*
|
|
3542
|
-
* @param props - Logo configuration and styling
|
|
3543
|
-
* @returns React element with event logo or fallback
|
|
3544
|
-
*/
|
|
3545
|
-
declare function EventLogo({ eventId, eventName, organisationId, size, className, showFallback, generateFallbackText, validateImage, loadingComponent: LoadingComponent, errorComponent: ErrorComponent }: EventLogoProps): react_jsx_runtime.JSX.Element;
|
|
3546
|
-
/**
|
|
3547
|
-
* Compact event logo for small spaces
|
|
3548
|
-
*/
|
|
3549
|
-
declare function EventLogoCompact(props: EventLogoProps): react_jsx_runtime.JSX.Element;
|
|
3550
|
-
/**
|
|
3551
|
-
* Large event logo for prominent display
|
|
3552
|
-
*/
|
|
3553
|
-
declare function EventLogoLarge(props: EventLogoProps): react_jsx_runtime.JSX.Element;
|
|
3554
|
-
|
|
3555
3427
|
interface PublicErrorBoundaryProps {
|
|
3556
3428
|
/** Child components to wrap */
|
|
3557
3429
|
children: ReactNode;
|
|
@@ -3680,4 +3552,4 @@ declare function PublicLoadingSkeleton({ lines, className }: {
|
|
|
3680
3552
|
className?: string;
|
|
3681
3553
|
}): react_jsx_runtime.JSX.Element;
|
|
3682
3554
|
|
|
3683
|
-
export { Select as $, Alert as A, Button as B, Card as C, Dialog as D, DialogOverlay as E, DialogTrigger as F, DialogClose as G, DialogContent as H, Input as I, DialogHeader as J, DialogBody as K, Label as L, DialogFooter as M, DialogTitle as N, DialogDescription as O, Progress as P, type DialogProps as Q, type DialogTriggerProps as R, Switch as S, Table as T, type DialogContentProps as U, type DialogOverlayProps as V, type DialogHeaderProps as W, type DialogFooterProps as X, type DialogTitleProps as Y, type DialogDescriptionProps as Z, type DialogSize as _, type ButtonProps as a,
|
|
3555
|
+
export { Select as $, Alert as A, Button as B, Card as C, Dialog as D, DialogOverlay as E, DialogTrigger as F, DialogClose as G, DialogContent as H, Input as I, DialogHeader as J, DialogBody as K, Label as L, DialogFooter as M, DialogTitle as N, DialogDescription as O, Progress as P, type DialogProps as Q, type DialogTriggerProps as R, Switch as S, Table as T, type DialogContentProps as U, type DialogOverlayProps as V, type DialogHeaderProps as W, type DialogFooterProps as X, type DialogTitleProps as Y, type DialogDescriptionProps as Z, type DialogSize as _, type ButtonProps as a, PublicPageDiagnostic as a$, SelectGroup as a0, SelectValue as a1, SelectTrigger as a2, SelectContent as a3, SelectLabel as a4, SelectItem as a5, SelectSeparator as a6, Toast as a7, Toaster as a8, ToastAction as a9, UserMenu as aA, ErrorBoundary as aB, type ErrorBoundaryProps as aC, type ErrorBoundaryState as aD, LoadingSpinner as aE, SessionRestorationLoader as aF, EventSelector as aG, PasswordResetForm as aH, FileUpload as aI, type FileUploadProps as aJ, FileDisplay as aK, type FileDisplayProps as aL, useFileReference as aM, useFileReferenceForRecord as aN, useFileReferenceById as aO, useFilesByCategory as aP, type UseFileReferenceOptions as aQ, type UseFileReferenceReturn as aR, type UseFileReferenceForRecordReturn as aS, PublicPageLayout as aT, usePublicPageContext$1 as aU, PublicPageHeader as aV, PublicPageProvider as aW, usePublicPageContext as aX, useIsPublicPage as aY, PublicPageFooter as aZ, PublicPageDebugger as a_, ToastProvider as aa, ToastViewport as ab, ToastTitle as ac, ToastDescription as ad, ToastClose as ae, type ToastActionElement as af, type ToastProps as ag, Tooltip as ah, TooltipTrigger as ai, TooltipContent as aj, TooltipProvider as ak, TooltipRoot as al, Form as am, type FormProps as an, LoginForm as ao, type LoginFormProps as ap, Header as aq, Footer as ar, type FooterProps as as, ProtectedRoute as at, type ProtectedRouteProps as au, NavigationMenu as av, type NavigationMenuProps as aw, type NavigationItem as ax, OrganisationSelector as ay, type OrganisationSelectorProps as az, CardHeader as b, PublicPageContextChecker as b0, PublicErrorBoundary as b1, useErrorBoundary as b2, DefaultPublicErrorFallback as b3, PublicLoadingSpinner as b4, PublicLoadingSpinnerFullPage as b5, PublicLoadingSkeleton as b6, type PublicPageLayoutProps as b7, type PublicPageHeaderProps as b8, type PublicPageFooterProps as b9, type PublicErrorBoundaryProps as ba, type PublicErrorBoundaryState as bb, type PublicLoadingSpinnerProps as bc, type PaceAppLayoutProps as bd, PaceAppLayout as be, type PaceLoginPageProps as bf, PaceLoginPage as bg, type UserMenuProps as bh, CardFooter as c, CardTitle as d, CardDescription as e, CardContent as f, CardActions as g, type CardProps as h, type CardActionsProps as i, type InputProps as j, type LabelProps as k, AlertTitle as l, AlertDescription as m, Avatar as n, AvatarImage as o, AvatarFallback as p, Checkbox as q, type SwitchProps as r, TableHeader as s, TableBody as t, TableCaption as u, TableCell as v, TableFooter as w, TableHead as x, TableRow as y, DialogPortal as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_OrganisationProvider,
|
|
3
3
|
usePublicPageContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-X33A4WWI.js";
|
|
5
5
|
import {
|
|
6
6
|
init_useOrganisations,
|
|
7
7
|
useEvents,
|
|
@@ -699,4 +699,4 @@ export {
|
|
|
699
699
|
generatePublicRoutePath,
|
|
700
700
|
extractEventCodeFromPath
|
|
701
701
|
};
|
|
702
|
-
//# sourceMappingURL=chunk-
|
|
702
|
+
//# sourceMappingURL=chunk-5SGBVBRU.js.map
|
|
@@ -10745,12 +10745,25 @@ function useTableColumns({
|
|
|
10745
10745
|
columnOrder
|
|
10746
10746
|
}) {
|
|
10747
10747
|
const enhancedColumns = useMemo13(() => {
|
|
10748
|
-
const baseColumns = [...columns].map((column) =>
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10748
|
+
const baseColumns = [...columns].map((column) => {
|
|
10749
|
+
const baseColumn = {
|
|
10750
|
+
...column,
|
|
10751
|
+
enableSorting: features.sorting && column.enableSorting !== false,
|
|
10752
|
+
enableColumnFilter: features.filtering && column.enableColumnFilter !== false,
|
|
10753
|
+
enableGrouping: features.grouping && column.enableGrouping !== false
|
|
10754
|
+
};
|
|
10755
|
+
const dataTableColumn = column;
|
|
10756
|
+
const isNumericColumn = column.meta?.type === "number" || dataTableColumn.fieldType === "number" || dataTableColumn.filterType === "number";
|
|
10757
|
+
const isDateColumn = column.meta?.type === "date" || dataTableColumn.fieldType === "date" || dataTableColumn.filterType === "date";
|
|
10758
|
+
if (isNumericColumn && !isDateColumn) {
|
|
10759
|
+
baseColumn.meta = {
|
|
10760
|
+
...baseColumn.meta,
|
|
10761
|
+
align: "right",
|
|
10762
|
+
type: "number"
|
|
10763
|
+
};
|
|
10764
|
+
}
|
|
10765
|
+
return baseColumn;
|
|
10766
|
+
});
|
|
10754
10767
|
const selectionColumn = features.selection ? {
|
|
10755
10768
|
id: "select",
|
|
10756
10769
|
header: ({ table }) => {
|
|
@@ -11968,62 +11981,72 @@ function DataTableInternal({
|
|
|
11968
11981
|
/* @__PURE__ */ jsx24("col", { span: dataColumns, "data-col-type": "data" }),
|
|
11969
11982
|
hasActionsColumn && /* @__PURE__ */ jsx24("col", { span: 1, "data-col-type": "actions" })
|
|
11970
11983
|
] }),
|
|
11971
|
-
/* @__PURE__ */ jsx24("thead", { children: table?.getHeaderGroups().map((headerGroup) =>
|
|
11972
|
-
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
const
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
|
|
11982
|
-
const columnName = typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "column";
|
|
11983
|
-
const currentSort = header.column.getIsSorted();
|
|
11984
|
-
const newSort = currentSort === "asc" ? "desc" : currentSort === "desc" ? null : "asc";
|
|
11985
|
-
announceSortChange(columnName, newSort);
|
|
11986
|
-
};
|
|
11987
|
-
const headerKeyboardHandlers = keyboardNavigation.getHeaderKeyboardHandlers(
|
|
11988
|
-
header.index,
|
|
11989
|
-
() => {
|
|
11984
|
+
/* @__PURE__ */ jsx24("thead", { children: table?.getHeaderGroups().map((headerGroup) => {
|
|
11985
|
+
const visibleHeaders = headerGroup.headers.filter((header) => {
|
|
11986
|
+
return typeof header.column.getIsVisible === "function" ? header.column.getIsVisible() : true;
|
|
11987
|
+
});
|
|
11988
|
+
return /* @__PURE__ */ jsx24("tr", { children: visibleHeaders.map((header, index) => {
|
|
11989
|
+
const isFirst = index === 0;
|
|
11990
|
+
const isLast = index === visibleHeaders.length - 1;
|
|
11991
|
+
const isSortable = header.column.getCanSort();
|
|
11992
|
+
const ariaSort = isSortable ? header.column.getIsSorted() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : "none" : void 0;
|
|
11993
|
+
const isRightAligned = header.column.columnDef.meta?.align === "right";
|
|
11994
|
+
const handleSortClick = (event) => {
|
|
11990
11995
|
const originalHandler = header.column.getToggleSortingHandler();
|
|
11991
11996
|
if (originalHandler) {
|
|
11992
|
-
originalHandler(
|
|
11997
|
+
originalHandler(event);
|
|
11993
11998
|
}
|
|
11994
11999
|
const columnName = typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "column";
|
|
11995
12000
|
const currentSort = header.column.getIsSorted();
|
|
11996
12001
|
const newSort = currentSort === "asc" ? "desc" : currentSort === "desc" ? null : "asc";
|
|
11997
12002
|
announceSortChange(columnName, newSort);
|
|
11998
|
-
}
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
role: "columnheader",
|
|
12006
|
-
...isSortable ? { "aria-sort": ariaSort } : {},
|
|
12007
|
-
...isSortable ? headerKeyboardHandlers : {},
|
|
12008
|
-
children: header.isPlaceholder ? null : isSortable ? /* @__PURE__ */ jsxs17(
|
|
12009
|
-
Button,
|
|
12010
|
-
{
|
|
12011
|
-
variant: "ghost",
|
|
12012
|
-
className: `h-auto p-0 font-medium hover:bg-transparent ${isRightAligned ? "justify-end" : "justify-start"}`,
|
|
12013
|
-
onClick: handleSortClick,
|
|
12014
|
-
...headerKeyboardHandlers,
|
|
12015
|
-
"aria-label": `Sort by ${typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "column"}`,
|
|
12016
|
-
tabIndex: 0,
|
|
12017
|
-
children: [
|
|
12018
|
-
typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header,
|
|
12019
|
-
header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx24(ChevronUp2, { className: "h-4 w-4" }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx24(ChevronDown3, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx24(ChevronsUpDown, { className: "h-4 w-4" })
|
|
12020
|
-
]
|
|
12003
|
+
};
|
|
12004
|
+
const headerKeyboardHandlers = keyboardNavigation.getHeaderKeyboardHandlers(
|
|
12005
|
+
header.index,
|
|
12006
|
+
() => {
|
|
12007
|
+
const originalHandler = header.column.getToggleSortingHandler();
|
|
12008
|
+
if (originalHandler) {
|
|
12009
|
+
originalHandler({});
|
|
12021
12010
|
}
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
|
|
12011
|
+
const columnName = typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "column";
|
|
12012
|
+
const currentSort = header.column.getIsSorted();
|
|
12013
|
+
const newSort = currentSort === "asc" ? "desc" : currentSort === "desc" ? null : "asc";
|
|
12014
|
+
announceSortChange(columnName, newSort);
|
|
12015
|
+
}
|
|
12016
|
+
);
|
|
12017
|
+
return /* @__PURE__ */ jsx24(
|
|
12018
|
+
"th",
|
|
12019
|
+
{
|
|
12020
|
+
className: cn(
|
|
12021
|
+
"px-3 py-2 bg-main-200",
|
|
12022
|
+
isRightAligned ? "text-right" : "text-left",
|
|
12023
|
+
isFirst && "rounded-l-md",
|
|
12024
|
+
isLast && "rounded-r-md"
|
|
12025
|
+
),
|
|
12026
|
+
scope: "col",
|
|
12027
|
+
role: "columnheader",
|
|
12028
|
+
...isSortable ? { "aria-sort": ariaSort } : {},
|
|
12029
|
+
...isSortable ? headerKeyboardHandlers : {},
|
|
12030
|
+
children: header.isPlaceholder ? null : isSortable ? /* @__PURE__ */ jsxs17(
|
|
12031
|
+
Button,
|
|
12032
|
+
{
|
|
12033
|
+
variant: "ghost",
|
|
12034
|
+
className: `h-auto p-0 font-bold hover:bg-transparent ${isRightAligned ? "justify-end" : "justify-start"}`,
|
|
12035
|
+
onClick: handleSortClick,
|
|
12036
|
+
...headerKeyboardHandlers,
|
|
12037
|
+
"aria-label": `Sort by ${typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "column"}`,
|
|
12038
|
+
tabIndex: 0,
|
|
12039
|
+
children: [
|
|
12040
|
+
typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header,
|
|
12041
|
+
header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx24(ChevronUp2, { className: "h-4 w-4" }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx24(ChevronDown3, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx24(ChevronsUpDown, { className: "h-4 w-4" })
|
|
12042
|
+
]
|
|
12043
|
+
}
|
|
12044
|
+
) : typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header
|
|
12045
|
+
},
|
|
12046
|
+
header.id
|
|
12047
|
+
);
|
|
12048
|
+
}) }, headerGroup.id);
|
|
12049
|
+
}) }),
|
|
12027
12050
|
/* @__PURE__ */ jsx24(
|
|
12028
12051
|
UnifiedTableBody,
|
|
12029
12052
|
{
|
|
@@ -12402,4 +12425,4 @@ lodash/lodash.js:
|
|
|
12402
12425
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
12403
12426
|
*)
|
|
12404
12427
|
*/
|
|
12405
|
-
//# sourceMappingURL=chunk-
|
|
12428
|
+
//# sourceMappingURL=chunk-62AVH7CM.js.map
|