@jmruthers/pace-core 0.5.102 → 0.5.104
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-Cvgk-V0F.d.ts → PublicLoadingSpinner-48ewSMKK.d.ts} +1 -96
- 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-SZWRW5FD.js → chunk-B6LDHZGA.js} +33 -4
- package/dist/chunk-B6LDHZGA.js.map +1 -0
- package/dist/{chunk-7ME4Z5OY.js → chunk-S7TZKHG3.js} +12 -148
- package/dist/chunk-S7TZKHG3.js.map +1 -0
- package/dist/{chunk-UDWTCBSH.js → chunk-SF6VFEWO.js} +12 -175
- package/dist/chunk-SF6VFEWO.js.map +1 -0
- package/dist/components.d.ts +1 -1
- package/dist/components.js +3 -9
- 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 +2 -2
- package/dist/index.js +4 -16
- 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 +1 -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 +1 -1
- 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 +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/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 +4 -152
- package/docs/implementation-guides/file-reference-system.md +31 -19
- 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/PublicLayout/PublicPageHeader.tsx +1 -1
- package/src/components/index.ts +0 -2
- package/src/hooks/public/index.ts +2 -4
- package/src/hooks/public/usePublicFileDisplay.ts +19 -1
- package/src/index.ts +0 -2
- package/src/utils/file-reference.ts +30 -2
- package/src/utils/storage/README.md +22 -20
- package/dist/chunk-7ME4Z5OY.js.map +0 -1
- package/dist/chunk-SZWRW5FD.js.map +0 -1
- package/dist/chunk-UDWTCBSH.js.map +0 -1
- 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/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
|
@@ -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
|
|
@@ -3087,101 +3087,6 @@ type UseFileReferenceForRecordReturn = {
|
|
|
3087
3087
|
clearError: () => void;
|
|
3088
3088
|
};
|
|
3089
3089
|
|
|
3090
|
-
/**
|
|
3091
|
-
* @file Event Logo Hook (Authenticated)
|
|
3092
|
-
* @package @jmruthers/pace-core
|
|
3093
|
-
* @module Hooks
|
|
3094
|
-
*
|
|
3095
|
-
* A React hook for accessing event logos in authenticated contexts.
|
|
3096
|
-
* Can handle both public and private event logos using the file_references system.
|
|
3097
|
-
*
|
|
3098
|
-
* Features:
|
|
3099
|
-
* - Works in authenticated contexts
|
|
3100
|
-
* - Supports both public and private event logos
|
|
3101
|
-
* - Automatic fallback to event initials
|
|
3102
|
-
* - Bucket-aware URL generation
|
|
3103
|
-
* - Signed URL support for private files
|
|
3104
|
-
* - Caching for performance
|
|
3105
|
-
* - Error handling and loading states
|
|
3106
|
-
*
|
|
3107
|
-
* @example
|
|
3108
|
-
* ```tsx
|
|
3109
|
-
* import { useEventLogo } from '@jmruthers/pace-core';
|
|
3110
|
-
*
|
|
3111
|
-
* function EventHeader() {
|
|
3112
|
-
* const { logoUrl, fallbackText, isLoading, error } = useEventLogo(
|
|
3113
|
-
* supabase,
|
|
3114
|
-
* eventId,
|
|
3115
|
-
* eventName,
|
|
3116
|
-
* organisationId
|
|
3117
|
-
* );
|
|
3118
|
-
*
|
|
3119
|
-
* if (isLoading) return <div>Loading...</div>;
|
|
3120
|
-
* if (error) return <div>Error: {error.message}</div>;
|
|
3121
|
-
*
|
|
3122
|
-
* return (
|
|
3123
|
-
* <div>
|
|
3124
|
-
* {logoUrl ? (
|
|
3125
|
-
* <img src={logoUrl} alt={`${eventName} logo`} />
|
|
3126
|
-
* ) : (
|
|
3127
|
-
* <div className="logo-fallback">{fallbackText}</div>
|
|
3128
|
-
* )}
|
|
3129
|
-
* </div>
|
|
3130
|
-
* );
|
|
3131
|
-
* }
|
|
3132
|
-
* ```
|
|
3133
|
-
*/
|
|
3134
|
-
|
|
3135
|
-
interface UseEventLogoReturn {
|
|
3136
|
-
/** The logo URL if available, null if not found or error */
|
|
3137
|
-
logoUrl: string | null;
|
|
3138
|
-
/** Fallback text (event initials) if no logo is available */
|
|
3139
|
-
fallbackText: string;
|
|
3140
|
-
/** Whether the logo is currently loading */
|
|
3141
|
-
isLoading: boolean;
|
|
3142
|
-
/** Any error that occurred during loading */
|
|
3143
|
-
error: Error | null;
|
|
3144
|
-
/** Function to manually refetch the logo */
|
|
3145
|
-
refetch: () => Promise<void>;
|
|
3146
|
-
}
|
|
3147
|
-
interface UseEventLogoOptions {
|
|
3148
|
-
/** Cache TTL in milliseconds (default: 30 minutes) */
|
|
3149
|
-
cacheTtl?: number;
|
|
3150
|
-
/** Whether to enable caching (default: true) */
|
|
3151
|
-
enableCache?: boolean;
|
|
3152
|
-
/** Whether to validate image existence (default: true) */
|
|
3153
|
-
validateImage?: boolean;
|
|
3154
|
-
/** Custom fallback text generator */
|
|
3155
|
-
generateFallbackText?: (eventName: string) => string;
|
|
3156
|
-
}
|
|
3157
|
-
/**
|
|
3158
|
-
* Hook for accessing event logo URLs in authenticated contexts
|
|
3159
|
-
*
|
|
3160
|
-
* This hook provides access to event logo URLs for authenticated users.
|
|
3161
|
-
* It supports both public and private logos, generating appropriate URLs
|
|
3162
|
-
* (public URLs for public files, signed URLs for private files).
|
|
3163
|
-
*
|
|
3164
|
-
* @param supabase - Supabase client instance (required)
|
|
3165
|
-
* @param eventId - The event ID to fetch logo for
|
|
3166
|
-
* @param eventName - The event name for fallback text generation
|
|
3167
|
-
* @param organisationId - The organisation ID for storage path
|
|
3168
|
-
* @param options - Configuration options for caching and behavior
|
|
3169
|
-
* @returns Object containing logo URL, fallback text, loading state, error, and refetch function
|
|
3170
|
-
*/
|
|
3171
|
-
declare function useEventLogo(supabase: SupabaseClient | null, eventId: string | undefined, eventName: string | undefined, organisationId: string | undefined, options?: UseEventLogoOptions): UseEventLogoReturn;
|
|
3172
|
-
/**
|
|
3173
|
-
* Clear all cached authenticated event logo data
|
|
3174
|
-
* Useful for testing or when you need to force refresh all data
|
|
3175
|
-
*/
|
|
3176
|
-
declare function clearEventLogoCache(): void;
|
|
3177
|
-
/**
|
|
3178
|
-
* Get cache statistics for debugging
|
|
3179
|
-
*/
|
|
3180
|
-
declare function getEventLogoCacheStats(): {
|
|
3181
|
-
size: number;
|
|
3182
|
-
keys: string[];
|
|
3183
|
-
};
|
|
3184
|
-
|
|
3185
3090
|
/**
|
|
3186
3091
|
* @file Table Component System
|
|
3187
3092
|
* @package @jmruthers/pace-core
|
|
@@ -3647,4 +3552,4 @@ declare function PublicLoadingSkeleton({ lines, className }: {
|
|
|
3647
3552
|
className?: string;
|
|
3648
3553
|
}): react_jsx_runtime.JSX.Element;
|
|
3649
3554
|
|
|
3650
|
-
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 };
|
|
@@ -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
|