@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.
Files changed (131) hide show
  1. package/dist/{DataTable-QZH6SEUM.js → DataTable-3Z5HLOWF.js} +2 -2
  2. package/dist/{PublicLoadingSpinner-qqvM-NUe.d.ts → PublicLoadingSpinner-CUAnTvcg.d.ts} +7 -0
  3. package/dist/{chunk-JDBO5NCG.js → chunk-27MGXDD6.js} +34 -16
  4. package/dist/chunk-27MGXDD6.js.map +1 -0
  5. package/dist/{chunk-TMUNK34W.js → chunk-ENE3AB75.js} +37 -9
  6. package/dist/chunk-ENE3AB75.js.map +1 -0
  7. package/dist/components.d.ts +1 -1
  8. package/dist/components.js +2 -2
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.js +2 -2
  11. package/dist/utils.d.ts +1 -1
  12. package/dist/utils.js +1 -1
  13. package/docs/api/classes/ColumnFactory.md +1 -1
  14. package/docs/api/classes/ErrorBoundary.md +1 -1
  15. package/docs/api/classes/InvalidScopeError.md +1 -1
  16. package/docs/api/classes/MissingUserContextError.md +1 -1
  17. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  18. package/docs/api/classes/PermissionDeniedError.md +1 -1
  19. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  20. package/docs/api/classes/RBACAuditManager.md +1 -1
  21. package/docs/api/classes/RBACCache.md +1 -1
  22. package/docs/api/classes/RBACEngine.md +1 -1
  23. package/docs/api/classes/RBACError.md +1 -1
  24. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  25. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  26. package/docs/api/classes/StorageUtils.md +1 -1
  27. package/docs/api/enums/FileCategory.md +1 -1
  28. package/docs/api/interfaces/AggregateConfig.md +1 -1
  29. package/docs/api/interfaces/ButtonProps.md +1 -1
  30. package/docs/api/interfaces/CardProps.md +1 -1
  31. package/docs/api/interfaces/ColorPalette.md +1 -1
  32. package/docs/api/interfaces/ColorShade.md +1 -1
  33. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  34. package/docs/api/interfaces/DataRecord.md +1 -1
  35. package/docs/api/interfaces/DataTableAction.md +1 -1
  36. package/docs/api/interfaces/DataTableColumn.md +1 -1
  37. package/docs/api/interfaces/DataTableProps.md +1 -1
  38. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  39. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  40. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  41. package/docs/api/interfaces/EventAppRoleData.md +1 -1
  42. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  43. package/docs/api/interfaces/FileMetadata.md +1 -1
  44. package/docs/api/interfaces/FileReference.md +1 -1
  45. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  46. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  47. package/docs/api/interfaces/FileUploadProps.md +1 -1
  48. package/docs/api/interfaces/FooterProps.md +1 -1
  49. package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
  50. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  51. package/docs/api/interfaces/InputProps.md +1 -1
  52. package/docs/api/interfaces/LabelProps.md +1 -1
  53. package/docs/api/interfaces/LoginFormProps.md +1 -1
  54. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  55. package/docs/api/interfaces/NavigationContextType.md +1 -1
  56. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  57. package/docs/api/interfaces/NavigationItem.md +1 -1
  58. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  59. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  60. package/docs/api/interfaces/Organisation.md +1 -1
  61. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  62. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  63. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  64. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  65. package/docs/api/interfaces/PaceAppLayoutProps.md +27 -27
  66. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  67. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  68. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  69. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  70. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  71. package/docs/api/interfaces/PaletteData.md +1 -1
  72. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  73. package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
  74. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  75. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  76. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  77. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  78. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  79. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  80. package/docs/api/interfaces/RBACConfig.md +1 -1
  81. package/docs/api/interfaces/RBACLogger.md +1 -1
  82. package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
  83. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  84. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  85. package/docs/api/interfaces/RoleManagementResult.md +1 -1
  86. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  87. package/docs/api/interfaces/RouteConfig.md +1 -1
  88. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  89. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  90. package/docs/api/interfaces/StorageConfig.md +1 -1
  91. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  92. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  93. package/docs/api/interfaces/StorageListOptions.md +1 -1
  94. package/docs/api/interfaces/StorageListResult.md +1 -1
  95. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  96. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  97. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  98. package/docs/api/interfaces/StyleImport.md +1 -1
  99. package/docs/api/interfaces/SwitchProps.md +1 -1
  100. package/docs/api/interfaces/ToastActionElement.md +1 -1
  101. package/docs/api/interfaces/ToastProps.md +1 -1
  102. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  103. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  104. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  105. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  106. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  107. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  108. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
  109. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
  110. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  111. package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
  112. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  113. package/docs/api/interfaces/UserEventAccess.md +1 -1
  114. package/docs/api/interfaces/UserMenuProps.md +1 -1
  115. package/docs/api/interfaces/UserProfile.md +1 -1
  116. package/docs/api/modules.md +10 -3
  117. package/docs/api-reference/components.md +24 -0
  118. package/docs/api-reference/types.md +28 -0
  119. package/docs/implementation-guides/data-tables.md +55 -10
  120. package/docs/implementation-guides/permission-enforcement.md +4 -0
  121. package/docs/rbac/super-admin-guide.md +43 -5
  122. package/package.json +1 -1
  123. package/src/components/DataTable/__tests__/DataTable.export.test.tsx +702 -0
  124. package/src/components/DataTable/components/DataTableCore.tsx +55 -36
  125. package/src/components/DataTable/index.ts +3 -1
  126. package/src/components/DataTable/types.ts +68 -0
  127. package/src/components/PaceAppLayout/PaceAppLayout.tsx +60 -11
  128. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +81 -1
  129. package/dist/chunk-JDBO5NCG.js.map +0 -1
  130. package/dist/chunk-TMUNK34W.js.map +0 -1
  131. /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-JDBO5NCG.js";
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-QZH6SEUM.js.map
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: secureHandlers.onExport || (async () => {
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
- const hasAccessorFn = "accessorFn" in originalCol && originalCol.accessorFn;
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
- await exportToCSVWithTableRows(tableRows, visibleColumns2, columnIdToTableColumn, filename);
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-JDBO5NCG.js.map
12953
+ //# sourceMappingURL=chunk-27MGXDD6.js.map