@jmruthers/pace-core 0.5.11 → 0.5.12
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-32L3DDeG.d.ts → DataTable-Da0D1BHX.d.ts} +1 -1
- package/dist/{DataTable-7LYDPZXT.js → DataTable-NNCMQSDG.js} +2 -2
- package/dist/{chunk-ROHDZOP7.js → chunk-BUWLPWDA.js} +14 -12
- package/dist/chunk-BUWLPWDA.js.map +1 -0
- package/dist/{chunk-7KDZXMES.js → chunk-PILT65PA.js} +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/components.js +2 -2
- package/dist/hooks.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{types-CczCVCDt.d.ts → types-zOqe4P1s.d.ts} +11 -3
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +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/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/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/EventContextType.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/EventProviderProps.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.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/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/RBACContextType.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACProviderProps.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/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/UsePublicEventLogoOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.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 -2
- package/docs/implementation-guides/datatable-rbac-usage.md +31 -1
- package/package.json +1 -1
- package/src/components/DataTable/components/ActionButtons.tsx +2 -1
- package/src/components/DataTable/components/DataTableCore.tsx +19 -13
- package/src/components/DataTable/components/UnifiedTableBody.tsx +4 -2
- package/src/components/DataTable/types.ts +11 -3
- package/dist/chunk-ROHDZOP7.js.map +0 -1
- /package/dist/{DataTable-7LYDPZXT.js.map → DataTable-NNCMQSDG.js.map} +0 -0
- /package/dist/{chunk-7KDZXMES.js.map → chunk-PILT65PA.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { D as DataRecord, a as DataTableColumn, b as DataTableRBACConfig, c as DataTableFeatureConfig, H as HierarchicalConfig, P as PerformanceConfig, S as ServerSideConfig, d as PaginationMode, C as ChunkingConfig, e as SearchIndexConfig, G as GetRowId, E as EmptyStateConfig, A as AggregateConfig, f as DataTableAction } from './types-
|
|
3
|
+
import { D as DataRecord, a as DataTableColumn, b as DataTableRBACConfig, c as DataTableFeatureConfig, H as HierarchicalConfig, P as PerformanceConfig, S as ServerSideConfig, d as PaginationMode, C as ChunkingConfig, e as SearchIndexConfig, G as GetRowId, E as EmptyStateConfig, A as AggregateConfig, f as DataTableAction } from './types-zOqe4P1s.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Configuration interface for customizing ImportModal text content
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
useDataTableContext,
|
|
33
33
|
usePluginRegistry,
|
|
34
34
|
useStateManager
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-BUWLPWDA.js";
|
|
36
36
|
import "./chunk-AMOT5ZSZ.js";
|
|
37
37
|
import "./chunk-GWSBHC4J.js";
|
|
38
38
|
import "./chunk-7BNPOCLL.js";
|
|
@@ -96,4 +96,4 @@ export {
|
|
|
96
96
|
usePluginRegistry,
|
|
97
97
|
useStateManager
|
|
98
98
|
};
|
|
99
|
-
//# sourceMappingURL=DataTable-
|
|
99
|
+
//# sourceMappingURL=DataTable-NNCMQSDG.js.map
|
|
@@ -3347,39 +3347,44 @@ function DataTableInternal({
|
|
|
3347
3347
|
defaultOrder: columns.map((col) => col.id || col.accessorKey || ""),
|
|
3348
3348
|
enablePersistence: features.columnReordering
|
|
3349
3349
|
});
|
|
3350
|
-
const pageId = rbac
|
|
3350
|
+
const pageId = rbac?.pageId;
|
|
3351
|
+
const pageName = rbac?.pageName;
|
|
3352
|
+
if (!pageId && !pageName) {
|
|
3353
|
+
throw new Error("DataTable requires either rbac.pageId or rbac.pageName for permission checking");
|
|
3354
|
+
}
|
|
3355
|
+
const effectivePageId = pageId || pageName;
|
|
3351
3356
|
const permissions = {
|
|
3352
3357
|
canRead: useCan(user?.id || "", {
|
|
3353
3358
|
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3354
3359
|
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3355
3360
|
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3356
|
-
}, `read:page.${
|
|
3361
|
+
}, `read:page.${effectivePageId}`, effectivePageId),
|
|
3357
3362
|
canCreate: useCan(user?.id || "", {
|
|
3358
3363
|
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3359
3364
|
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3360
3365
|
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3361
|
-
}, `create:page.${
|
|
3366
|
+
}, `create:page.${effectivePageId}`, effectivePageId),
|
|
3362
3367
|
canUpdate: useCan(user?.id || "", {
|
|
3363
3368
|
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3364
3369
|
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3365
3370
|
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3366
|
-
}, `update:page.${
|
|
3371
|
+
}, `update:page.${effectivePageId}`, effectivePageId),
|
|
3367
3372
|
canDelete: useCan(user?.id || "", {
|
|
3368
3373
|
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3369
3374
|
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3370
3375
|
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3371
|
-
}, `delete:page.${
|
|
3376
|
+
}, `delete:page.${effectivePageId}`, effectivePageId),
|
|
3372
3377
|
canExport: useCan(user?.id || "", {
|
|
3373
3378
|
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3374
3379
|
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3375
3380
|
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3376
|
-
}, `manage:page.${
|
|
3381
|
+
}, `manage:page.${effectivePageId}`, effectivePageId),
|
|
3377
3382
|
// Using manage for export/import
|
|
3378
3383
|
canImport: useCan(user?.id || "", {
|
|
3379
3384
|
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3380
3385
|
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3381
3386
|
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3382
|
-
}, `manage:page.${
|
|
3387
|
+
}, `manage:page.${effectivePageId}`, effectivePageId)
|
|
3383
3388
|
// Using manage for export/import
|
|
3384
3389
|
};
|
|
3385
3390
|
const finalPaginationMode = paginationMode || detectedMode;
|
|
@@ -3689,16 +3694,13 @@ function DataTableInternal({
|
|
|
3689
3694
|
if (!user) {
|
|
3690
3695
|
throw new Error("DataTable requires authenticated user for RBAC");
|
|
3691
3696
|
}
|
|
3692
|
-
if (!rbac?.pageId) {
|
|
3693
|
-
throw new Error("DataTable requires rbac.pageId for permission checking");
|
|
3694
|
-
}
|
|
3695
3697
|
const scope = {
|
|
3696
3698
|
organisationId: user?.user_metadata?.organisationId || user?.app_metadata?.organisationId,
|
|
3697
3699
|
eventId: user?.user_metadata?.eventId || user?.app_metadata?.eventId,
|
|
3698
3700
|
appId: user?.user_metadata?.appId || user?.app_metadata?.appId
|
|
3699
3701
|
};
|
|
3700
3702
|
if (!permissions.canRead.can) {
|
|
3701
|
-
return /* @__PURE__ */ jsx20(AccessDeniedPage, { resource:
|
|
3703
|
+
return /* @__PURE__ */ jsx20(AccessDeniedPage, { resource: effectivePageId || "unknown-page", operation: "read" });
|
|
3702
3704
|
}
|
|
3703
3705
|
if (isLoading) {
|
|
3704
3706
|
return /* @__PURE__ */ jsx20(LoadingComponent, {});
|
|
@@ -5463,4 +5465,4 @@ export {
|
|
|
5463
5465
|
GroupHeader,
|
|
5464
5466
|
EditableRow
|
|
5465
5467
|
};
|
|
5466
|
-
//# sourceMappingURL=chunk-
|
|
5468
|
+
//# sourceMappingURL=chunk-BUWLPWDA.js.map
|