@jmruthers/pace-core 0.5.127 → 0.5.128
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-QZH6SEUM.js → DataTable-3Z5HLOWF.js} +2 -2
- package/dist/{PublicLoadingSpinner-qqvM-NUe.d.ts → PublicLoadingSpinner-CUAnTvcg.d.ts} +7 -0
- package/dist/{chunk-JDBO5NCG.js → chunk-27MGXDD6.js} +34 -16
- package/dist/chunk-27MGXDD6.js.map +1 -0
- package/dist/{chunk-TMUNK34W.js → chunk-ENE3AB75.js} +37 -9
- package/dist/chunk-ENE3AB75.js.map +1 -0
- package/dist/components.d.ts +1 -1
- package/dist/components.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/utils.d.ts +1 -1
- 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/EventAppRoleData.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/GrantEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/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 +27 -27
- 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/RevokeEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RoleManagementResult.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 +10 -3
- package/docs/api-reference/components.md +24 -0
- package/docs/api-reference/types.md +28 -0
- package/docs/implementation-guides/data-tables.md +55 -10
- package/docs/implementation-guides/permission-enforcement.md +4 -0
- package/docs/rbac/super-admin-guide.md +43 -5
- package/package.json +1 -1
- package/src/components/DataTable/__tests__/DataTable.export.test.tsx +702 -0
- package/src/components/DataTable/components/DataTableCore.tsx +55 -36
- package/src/components/DataTable/index.ts +3 -1
- package/src/components/DataTable/types.ts +68 -0
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +60 -11
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +81 -1
- package/dist/chunk-JDBO5NCG.js.map +0 -1
- package/dist/chunk-TMUNK34W.js.map +0 -1
- /package/dist/{DataTable-QZH6SEUM.js.map → DataTable-3Z5HLOWF.js.map} +0 -0
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
sortHierarchicalDataWithSorting,
|
|
55
55
|
validateHierarchicalData,
|
|
56
56
|
validatePaginationConfig
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-27MGXDD6.js";
|
|
58
58
|
import "./chunk-BYXRHAIF.js";
|
|
59
59
|
import "./chunk-WP5I5GLN.js";
|
|
60
60
|
import "./chunk-3DBFLLLU.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
validateHierarchicalData,
|
|
158
158
|
validatePaginationConfig
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=DataTable-
|
|
160
|
+
//# sourceMappingURL=DataTable-3Z5HLOWF.js.map
|
|
@@ -2289,6 +2289,12 @@ interface PaceAppLayoutProps {
|
|
|
2289
2289
|
* Outlet to render child routes. It provides integrated authentication, navigation,
|
|
2290
2290
|
* and user management functionality.
|
|
2291
2291
|
*
|
|
2292
|
+
* **Super Admin Access:** When `enforcePermissions={true}`, PaceAppLayout automatically
|
|
2293
|
+
* checks if the user is a super admin before enforcing permissions. Super admins bypass
|
|
2294
|
+
* all permission checks and can access any route without violations. The component extracts
|
|
2295
|
+
* base page names from route paths (e.g., `/organisation/scouts-victoria` → `"organisation"`)
|
|
2296
|
+
* for permission checking, which can be overridden using `pageIdMapping`.
|
|
2297
|
+
*
|
|
2292
2298
|
* **Important:** The appName prop should use an APP_NAME constant declared in your App.tsx
|
|
2293
2299
|
* file. This ensures consistency with public pages (via PublicPageProvider) which should
|
|
2294
2300
|
* also receive the same APP_NAME constant. The logo URL is automatically constructed as
|
|
@@ -2305,6 +2311,7 @@ interface PaceAppLayoutProps {
|
|
|
2305
2311
|
* - Layout-level permission enforcement
|
|
2306
2312
|
* - Permission-based navigation filtering
|
|
2307
2313
|
* - Automatic page permission validation
|
|
2314
|
+
* - Super admin bypass (super admins automatically bypass all permission checks)
|
|
2308
2315
|
*
|
|
2309
2316
|
* @example
|
|
2310
2317
|
* Basic React Router setup with permission enforcement (RECOMMENDED):
|
|
@@ -12402,7 +12402,7 @@ function DataTableInternal({
|
|
|
12402
12402
|
}
|
|
12403
12403
|
stateActions.setImportModal(true);
|
|
12404
12404
|
},
|
|
12405
|
-
onExport:
|
|
12405
|
+
onExport: async () => {
|
|
12406
12406
|
try {
|
|
12407
12407
|
const tableRows = table.getFilteredRowModel().rows;
|
|
12408
12408
|
const tableColumns = table.getAllColumns();
|
|
@@ -12419,24 +12419,42 @@ function DataTableInternal({
|
|
|
12419
12419
|
});
|
|
12420
12420
|
if (!originalCol) return;
|
|
12421
12421
|
columnIdToTableColumn.set(tableCol.id, tableCol);
|
|
12422
|
-
|
|
12423
|
-
const editAccessorKey = originalCol.editAccessorKey;
|
|
12424
|
-
const displayHeader = typeof originalCol.header === "string" ? originalCol.header : originalCol.accessorKey || tableCol.id || "Column";
|
|
12425
|
-
visibleColumns2.push({
|
|
12426
|
-
...originalCol,
|
|
12427
|
-
header: displayHeader,
|
|
12428
|
-
// Store table column ID for getValue() lookup
|
|
12429
|
-
id: tableCol.id,
|
|
12430
|
-
// Preserve accessorFn if present (will use getValue() if available)
|
|
12431
|
-
accessorFn: hasAccessorFn ? originalCol.accessorFn : void 0
|
|
12432
|
-
});
|
|
12422
|
+
visibleColumns2.push(originalCol);
|
|
12433
12423
|
});
|
|
12434
12424
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
12435
12425
|
const filename = title ? `${title.replace(/[^a-z0-9]/gi, "_").toLowerCase()}_${timestamp}.csv` : `data_export_${timestamp}.csv`;
|
|
12436
|
-
|
|
12426
|
+
const exportOptions = {
|
|
12427
|
+
tableRows,
|
|
12428
|
+
allColumns: columns,
|
|
12429
|
+
visibleColumns: visibleColumns2,
|
|
12430
|
+
columnIdToTableColumn,
|
|
12431
|
+
data,
|
|
12432
|
+
filename,
|
|
12433
|
+
table
|
|
12434
|
+
};
|
|
12435
|
+
if (secureHandlers.onExport) {
|
|
12436
|
+
await secureHandlers.onExport(exportOptions);
|
|
12437
|
+
return;
|
|
12438
|
+
}
|
|
12439
|
+
const exportColumns = exportOptions.visibleColumns.map((col) => {
|
|
12440
|
+
const colId = col.id || col.accessorKey;
|
|
12441
|
+
const hasAccessorFn = "accessorFn" in col && col.accessorFn;
|
|
12442
|
+
return {
|
|
12443
|
+
...col,
|
|
12444
|
+
header: typeof col.header === "string" ? col.header : col.accessorKey || colId || "Column",
|
|
12445
|
+
id: colId ? String(colId) : void 0,
|
|
12446
|
+
accessorFn: hasAccessorFn ? col.accessorFn : void 0
|
|
12447
|
+
};
|
|
12448
|
+
});
|
|
12449
|
+
await exportToCSVWithTableRows(
|
|
12450
|
+
exportOptions.tableRows,
|
|
12451
|
+
exportColumns,
|
|
12452
|
+
exportOptions.columnIdToTableColumn,
|
|
12453
|
+
exportOptions.filename
|
|
12454
|
+
);
|
|
12437
12455
|
toast({
|
|
12438
12456
|
title: "Export Successful",
|
|
12439
|
-
description: `Data exported to ${filename}`,
|
|
12457
|
+
description: `Data exported to ${exportOptions.filename}`,
|
|
12440
12458
|
variant: "default"
|
|
12441
12459
|
});
|
|
12442
12460
|
logger.debug("Export completed successfully");
|
|
@@ -12449,7 +12467,7 @@ function DataTableInternal({
|
|
|
12449
12467
|
variant: "destructive"
|
|
12450
12468
|
});
|
|
12451
12469
|
}
|
|
12452
|
-
}
|
|
12470
|
+
},
|
|
12453
12471
|
rowSelection,
|
|
12454
12472
|
onDeleteSelected: secureHandlers.onDeleteSelected ? async (selectedRows) => {
|
|
12455
12473
|
const selectedCount = Object.values(selectedRows).filter(Boolean).length;
|
|
@@ -12932,4 +12950,4 @@ lodash/lodash.js:
|
|
|
12932
12950
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
12933
12951
|
*)
|
|
12934
12952
|
*/
|
|
12935
|
-
//# sourceMappingURL=chunk-
|
|
12953
|
+
//# sourceMappingURL=chunk-27MGXDD6.js.map
|