@jmruthers/pace-core 0.5.102 → 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-Cvgk-V0F.d.ts → PublicLoadingSpinner-48ewSMKK.d.ts} +1 -96
- package/dist/{chunk-7ME4Z5OY.js → chunk-5SGBVBRU.js} +12 -148
- package/dist/chunk-5SGBVBRU.js.map +1 -0
- 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-UDWTCBSH.js → chunk-SZWCMVTQ.js} +12 -175
- package/dist/chunk-SZWCMVTQ.js.map +1 -0
- package/dist/{chunk-SZWRW5FD.js → chunk-X33A4WWI.js} +23 -3
- package/dist/{chunk-SZWRW5FD.js.map → chunk-X33A4WWI.js.map} +1 -1
- 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 +2 -150
- 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/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-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
|
@@ -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
|