@jmruthers/pace-core 0.5.191 → 0.5.193
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/{AuthService-CbP_utw2.d.ts → AuthService-DjnJHDtC.d.ts} +1 -0
- package/dist/{DataTable-WKRZD47S.js → DataTable-5FU7IESH.js} +7 -6
- package/dist/{PublicPageProvider-ULXC_u6U.d.ts → PublicPageProvider-C0Sm_e5k.d.ts} +3 -1
- package/dist/{UnifiedAuthProvider-BYA9qB-o.d.ts → UnifiedAuthProvider-185Ih4dj.d.ts} +2 -0
- package/dist/{UnifiedAuthProvider-FTSG5XH7.js → UnifiedAuthProvider-RGJTDE2C.js} +3 -3
- package/dist/{api-IHKALJZD.js → api-N774RPUA.js} +2 -2
- package/dist/chunk-6C4YBBJM 5.js +628 -0
- package/dist/chunk-7D4SUZUM.js 2.map +1 -0
- package/dist/{chunk-LOMZXPSN.js → chunk-7EQTDTTJ.js} +47 -74
- package/dist/chunk-7EQTDTTJ.js 2.map +1 -0
- package/dist/chunk-7EQTDTTJ.js.map +1 -0
- package/dist/{chunk-6LTQQAT6.js → chunk-7FLMSG37.js} +336 -137
- package/dist/chunk-7FLMSG37.js 2.map +1 -0
- package/dist/chunk-7FLMSG37.js.map +1 -0
- package/dist/{chunk-XNYQOL3Z.js → chunk-BC4IJKSL.js} +9 -18
- package/dist/chunk-BC4IJKSL.js.map +1 -0
- package/dist/{chunk-ULHIJK66.js → chunk-E3SPN4VZ 5.js } +146 -36
- package/dist/chunk-E3SPN4VZ.js +12917 -0
- package/dist/{chunk-ULHIJK66.js.map → chunk-E3SPN4VZ.js.map} +1 -1
- package/dist/chunk-E66EQZE6 5.js +37 -0
- package/dist/chunk-E66EQZE6.js 2.map +1 -0
- package/dist/{chunk-6TQDD426.js → chunk-HWIIPPNI.js} +40 -221
- package/dist/chunk-HWIIPPNI.js.map +1 -0
- package/dist/chunk-I7PSE6JW 5.js +191 -0
- package/dist/chunk-I7PSE6JW.js 2.map +1 -0
- package/dist/{chunk-OETXORNB.js → chunk-IIELH4DL.js} +211 -136
- package/dist/chunk-IIELH4DL.js.map +1 -0
- package/dist/{chunk-ROXMHMY2.js → chunk-KNC55RTG.js} +13 -3
- package/dist/{chunk-ROXMHMY2.js.map → chunk-KNC55RTG.js 5.map } +1 -1
- package/dist/chunk-KNC55RTG.js.map +1 -0
- package/dist/chunk-KQCRWDSA.js 5.map +1 -0
- package/dist/{chunk-XYXSXPUK.js → chunk-LFNCN2SP.js} +7 -6
- package/dist/chunk-LFNCN2SP.js 2.map +1 -0
- package/dist/chunk-LFNCN2SP.js.map +1 -0
- package/dist/chunk-LMC26NLJ 2.js +84 -0
- package/dist/{chunk-VKB2CO4Z.js → chunk-NOAYCWCX 5.js } +84 -87
- package/dist/chunk-NOAYCWCX.js +4993 -0
- package/dist/chunk-NOAYCWCX.js.map +1 -0
- package/dist/chunk-QWWZ5CAQ.js 3.map +1 -0
- package/dist/chunk-QXHPKYJV 3.js +113 -0
- package/dist/chunk-R77UEZ4E 3.js +68 -0
- package/dist/chunk-VBXEHIUJ.js 6.map +1 -0
- package/dist/{chunk-VRGWKHDB.js → chunk-XNXXZ43G.js} +77 -33
- package/dist/chunk-XNXXZ43G.js.map +1 -0
- package/dist/chunk-ZSAAAMVR 6.js +25 -0
- package/dist/components.d.ts +2 -2
- package/dist/components.js +7 -7
- package/dist/components.js 5.map +1 -0
- package/dist/hooks.js +8 -8
- package/dist/index.d.ts +5 -5
- package/dist/index.js +12 -14
- package/dist/index.js.map +1 -1
- package/dist/providers.d.ts +3 -3
- package/dist/providers.js +2 -2
- package/dist/rbac/index.d.ts +1 -19
- package/dist/rbac/index.js +7 -9
- package/dist/styles/index 2.js +12 -0
- package/dist/styles/index.js 5.map +1 -0
- package/dist/theming/runtime 5.js +19 -0
- package/dist/theming/runtime.js 5.map +1 -0
- 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/Logger.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 +2 -2
- package/docs/api/classes/RBACAuditManager.md +2 -2
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +2 -2
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +10 -10
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/enums/LogLevel.md +1 -1
- package/docs/api/enums/RBACErrorCode.md +1 -1
- package/docs/api/enums/RPCFunction.md +1 -1
- package/docs/api/interfaces/AddressFieldProps.md +1 -1
- package/docs/api/interfaces/AddressFieldRef.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/AutocompleteOptions.md +1 -1
- package/docs/api/interfaces/AvatarProps.md +1 -1
- package/docs/api/interfaces/BadgeProps.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CalendarProps.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/ComplianceResult.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/DatabaseComplianceResult.md +1 -1
- package/docs/api/interfaces/DatabaseIssue.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/ExportColumn.md +1 -1
- package/docs/api/interfaces/ExportOptions.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +24 -11
- 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/FormFieldProps.md +1 -1
- package/docs/api/interfaces/FormProps.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/LoggerConfig.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +2 -2
- 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 +2 -2
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/ParsedAddress.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +4 -4
- package/docs/api/interfaces/ProgressProps.md +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.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/QuickFix.md +1 -1
- package/docs/api/interfaces/RBACAccessValidateParams.md +1 -1
- package/docs/api/interfaces/RBACAccessValidateResult.md +1 -1
- package/docs/api/interfaces/RBACAuditLogParams.md +1 -1
- package/docs/api/interfaces/RBACAuditLogResult.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +2 -2
- package/docs/api/interfaces/RBACContext.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACPageAccessCheckParams.md +1 -1
- package/docs/api/interfaces/RBACPerformanceMetrics.md +1 -1
- package/docs/api/interfaces/RBACPermissionCheckParams.md +1 -1
- package/docs/api/interfaces/RBACPermissionCheckResult.md +2 -2
- package/docs/api/interfaces/RBACPermissionsGetParams.md +1 -1
- package/docs/api/interfaces/RBACPermissionsGetResult.md +1 -1
- package/docs/api/interfaces/RBACResult.md +1 -1
- package/docs/api/interfaces/RBACRoleGrantParams.md +2 -2
- package/docs/api/interfaces/RBACRoleGrantResult.md +1 -1
- package/docs/api/interfaces/RBACRoleRevokeParams.md +2 -2
- package/docs/api/interfaces/RBACRoleRevokeResult.md +1 -1
- package/docs/api/interfaces/RBACRoleValidateParams.md +2 -2
- package/docs/api/interfaces/RBACRoleValidateResult.md +1 -1
- package/docs/api/interfaces/RBACRolesListParams.md +1 -1
- package/docs/api/interfaces/RBACRolesListResult.md +2 -2
- package/docs/api/interfaces/RBACSessionTrackParams.md +1 -1
- package/docs/api/interfaces/RBACSessionTrackResult.md +1 -1
- package/docs/api/interfaces/ResourcePermissions.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 +2 -2
- package/docs/api/interfaces/RouteConfig.md +2 -2
- package/docs/api/interfaces/RuntimeComplianceResult.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/SessionRestorationLoaderProps.md +1 -1
- package/docs/api/interfaces/SetupIssue.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/TabsContentProps.md +1 -1
- package/docs/api/interfaces/TabsListProps.md +1 -1
- package/docs/api/interfaces/TabsProps.md +1 -1
- package/docs/api/interfaces/TabsTriggerProps.md +1 -1
- package/docs/api/interfaces/TextareaProps.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 +60 -38
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +13 -13
- package/docs/api/interfaces/UseFormDialogOptions.md +1 -1
- package/docs/api/interfaces/UseFormDialogReturn.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 +2 -2
- 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/UsePublicFileDisplayOptions.md +2 -2
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +2 -2
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UseResourcePermissionsOptions.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 +194 -209
- package/docs/migration/database-changes-december-2025.md +2 -1
- package/docs/rbac/event-based-apps.md +124 -6
- package/package.json +1 -1
- package/scripts/check-pace-core-compliance.cjs +292 -57
- package/src/__tests__/rls-policies.test.ts +3 -1
- package/src/components/DataTable/__tests__/DataTable.default-state.test.tsx +172 -45
- package/src/components/DataTable/__tests__/DataTable.grouping-aggregation.test.tsx +121 -28
- package/src/components/DataTable/__tests__/DataTableCore.test-setup.ts +9 -8
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +20 -52
- package/src/components/DataTable/__tests__/a11y.basic.test.tsx +170 -34
- package/src/components/DataTable/__tests__/keyboard.test.tsx +75 -12
- package/src/components/DataTable/__tests__/pagination.modes.test.tsx +75 -11
- package/src/components/DataTable/components/UnifiedTableBody.tsx +85 -14
- package/src/components/DataTable/hooks/useDataTablePermissions.ts +75 -10
- package/src/components/FileDisplay/FileDisplay.test.tsx +2 -1
- package/src/components/FileDisplay/FileDisplay.tsx +16 -4
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +6 -4
- package/src/components/NavigationMenu/NavigationMenu.tsx +1 -10
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +0 -1
- package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +25 -2
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +97 -68
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +0 -7
- package/src/components/ProtectedRoute/ProtectedRoute.test.tsx +5 -9
- package/src/components/ProtectedRoute/ProtectedRoute.tsx +0 -1
- package/src/components/PublicLayout/PublicPageProvider.tsx +0 -1
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +14 -7
- package/src/hooks/services/useAuthService.ts +21 -3
- package/src/hooks/services/useEventService.ts +21 -3
- package/src/hooks/services/useInactivityService.ts +21 -3
- package/src/hooks/services/useOrganisationService.ts +21 -3
- package/src/hooks/useFileDisplay.ts +10 -17
- package/src/hooks/useSecureDataAccess.test.ts +16 -9
- package/src/hooks/useSecureDataAccess.ts +3 -2
- package/src/providers/services/EventServiceProvider.tsx +0 -8
- package/src/providers/services/UnifiedAuthProvider.tsx +174 -24
- package/src/rbac/__tests__/adapters.comprehensive.test.tsx +10 -16
- package/src/rbac/__tests__/isSuperAdmin.real.test.ts +82 -0
- package/src/rbac/adapters.tsx +3 -22
- package/src/rbac/api.test.ts +2 -2
- package/src/rbac/api.ts +7 -1
- package/src/rbac/components/EnhancedNavigationMenu.tsx +2 -15
- package/src/rbac/components/NavigationGuard.tsx +1 -10
- package/src/rbac/components/NavigationProvider.tsx +0 -1
- package/src/rbac/components/PermissionEnforcer.tsx +45 -12
- package/src/rbac/components/SecureDataProvider.tsx +0 -1
- package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +7 -43
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +4 -11
- package/src/rbac/components/__tests__/NavigationProvider.test.tsx +3 -3
- package/src/rbac/components/__tests__/SecureDataProvider.fixed.test.tsx +1 -1
- package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +1 -1
- package/src/rbac/engine.ts +14 -2
- package/src/rbac/hooks/index.ts +0 -3
- package/src/rbac/hooks/usePermissions.ts +51 -11
- package/src/rbac/hooks/useRBAC.ts +3 -13
- package/src/rbac/hooks/useResolvedScope.test.ts +75 -54
- package/src/rbac/hooks/useResolvedScope.ts +58 -33
- package/src/rbac/hooks/useSecureSupabase.ts +4 -9
- package/src/rbac/secureClient.ts +31 -0
- package/src/services/EventService.ts +4 -57
- package/src/services/InactivityService.ts +127 -34
- package/src/services/OrganisationService.ts +68 -10
- package/dist/chunk-6LTQQAT6.js.map +0 -1
- package/dist/chunk-6TQDD426.js.map +0 -1
- package/dist/chunk-LOMZXPSN.js.map +0 -1
- package/dist/chunk-OETXORNB.js.map +0 -1
- package/dist/chunk-VKB2CO4Z.js.map +0 -1
- package/dist/chunk-VRGWKHDB.js.map +0 -1
- package/dist/chunk-XNYQOL3Z.js.map +0 -1
- package/dist/chunk-XYXSXPUK.js.map +0 -1
- package/scripts/check-pace-core-compliance.js +0 -512
- package/src/rbac/hooks/useSuperAdminBypass.ts +0 -126
- package/src/utils/context/superAdminOverride.ts +0 -58
- /package/dist/{DataTable-WKRZD47S.js.map → DataTable-5FU7IESH.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-FTSG5XH7.js.map → UnifiedAuthProvider-RGJTDE2C.js.map} +0 -0
- /package/dist/{api-IHKALJZD.js.map → api-N774RPUA.js.map} +0 -0
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XNXXZ43G.js";
|
|
4
4
|
import {
|
|
5
5
|
toast,
|
|
6
6
|
useDataTablePerformance
|
|
7
7
|
} from "./chunk-6C4YBBJM.js";
|
|
8
8
|
import {
|
|
9
9
|
useResolvedScope
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IIELH4DL.js";
|
|
11
11
|
import {
|
|
12
12
|
useUnifiedAuth
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7FLMSG37.js";
|
|
14
|
+
import {
|
|
15
|
+
isSuperAdmin
|
|
16
|
+
} from "./chunk-KNC55RTG.js";
|
|
14
17
|
import {
|
|
15
18
|
cn,
|
|
16
19
|
renderSafeHtml
|
|
@@ -5508,7 +5511,7 @@ var require_lodash = __commonJS({
|
|
|
5508
5511
|
import React21 from "react";
|
|
5509
5512
|
|
|
5510
5513
|
// src/components/DataTable/components/DataTableCore.tsx
|
|
5511
|
-
import React20, { useMemo as useMemo14, useCallback as useCallback10, useEffect as
|
|
5514
|
+
import React20, { useMemo as useMemo14, useCallback as useCallback10, useEffect as useEffect12, useRef as useRef6 } from "react";
|
|
5512
5515
|
import { useReactTable } from "@tanstack/react-table";
|
|
5513
5516
|
import { Edit, Trash, ChevronUp as ChevronUp2, ChevronDown as ChevronDown3, ChevronsUpDown } from "lucide-react";
|
|
5514
5517
|
|
|
@@ -5647,6 +5650,21 @@ var getTableCellClasses = (options = {}) => {
|
|
|
5647
5650
|
className
|
|
5648
5651
|
);
|
|
5649
5652
|
};
|
|
5653
|
+
var getTableRowClasses = (options = {}) => {
|
|
5654
|
+
const { isSelected = false, isVirtualized = false, className } = options;
|
|
5655
|
+
if (isVirtualized) {
|
|
5656
|
+
return cn(
|
|
5657
|
+
tableStyles.rowHover,
|
|
5658
|
+
isSelected && tableStyles.rowSelected,
|
|
5659
|
+
className
|
|
5660
|
+
);
|
|
5661
|
+
}
|
|
5662
|
+
return cn(
|
|
5663
|
+
tableStyles.row,
|
|
5664
|
+
isSelected && tableStyles.rowSelected,
|
|
5665
|
+
className
|
|
5666
|
+
);
|
|
5667
|
+
};
|
|
5650
5668
|
var getTableClasses = (options = {}) => {
|
|
5651
5669
|
const { isFixed = false, variant = "default", className } = options;
|
|
5652
5670
|
if (isFixed) {
|
|
@@ -7863,6 +7881,10 @@ var RowComponent = React10.memo(({
|
|
|
7863
7881
|
const isHierarchical = hierarchical?.enabled && hierarchicalRow?.isParent !== void 0;
|
|
7864
7882
|
const isParent = isHierarchical && hierarchicalRow.isParent;
|
|
7865
7883
|
const isChild = isHierarchical && !hierarchicalRow.isParent;
|
|
7884
|
+
const visibleCells = React10.useMemo(() => row.getVisibleCells(), [row]);
|
|
7885
|
+
const isSelected = React10.useMemo(() => {
|
|
7886
|
+
return typeof row.getIsSelected === "function" ? row.getIsSelected() : false;
|
|
7887
|
+
}, [row]);
|
|
7866
7888
|
useEffect2(() => {
|
|
7867
7889
|
if (isEditing && firstInputRef.current) {
|
|
7868
7890
|
firstInputRef.current.focus();
|
|
@@ -7895,9 +7917,8 @@ var RowComponent = React10.memo(({
|
|
|
7895
7917
|
const groupValue = row.getValue(grouping[0]);
|
|
7896
7918
|
const subRowsCount = row.subRows?.length || 0;
|
|
7897
7919
|
const isExpanded = row.getIsExpanded();
|
|
7898
|
-
const visibleCells2 = row.getVisibleCells();
|
|
7899
7920
|
const childRows = row.subRows?.map((subRow) => subRow.original) || [];
|
|
7900
|
-
return /* @__PURE__ */ jsx14("tr", { className: "bg-sec-50 hover:bg-sec-100", style, children:
|
|
7921
|
+
return /* @__PURE__ */ jsx14("tr", { className: "bg-sec-50 hover:bg-sec-100", style, children: visibleCells.map((cell, cellIndex) => {
|
|
7901
7922
|
const columnDef = cell.column.columnDef;
|
|
7902
7923
|
const isGroupingColumn = cellIndex === 0 || grouping.includes(cell.column.id || "");
|
|
7903
7924
|
if (isGroupingColumn && cellIndex === 0) {
|
|
@@ -8006,11 +8027,20 @@ var RowComponent = React10.memo(({
|
|
|
8006
8027
|
}
|
|
8007
8028
|
);
|
|
8008
8029
|
}
|
|
8009
|
-
const visibleCells = row.getVisibleCells();
|
|
8010
|
-
const allCells = row.getAllCells ? row.getAllCells() : [];
|
|
8011
8030
|
const indentSize = hierarchical?.indentSize || 24;
|
|
8012
|
-
const indentation =
|
|
8013
|
-
|
|
8031
|
+
const indentation = React10.useMemo(() => {
|
|
8032
|
+
return isChild && hierarchical?.state ? calculateIndentation(hierarchicalRow, [], indentSize) : 0;
|
|
8033
|
+
}, [isChild, hierarchical?.state, hierarchicalRow, indentSize]);
|
|
8034
|
+
const rowClassName = React10.useMemo(() => {
|
|
8035
|
+
if (isHierarchical) {
|
|
8036
|
+
const hierarchicalClass = isParent ? hierarchical?.parentRowClassName || "bg-main-50 hover:bg-main-100 font-medium" : hierarchical?.childRowClassName || "bg-sec-25 hover:bg-sec-50";
|
|
8037
|
+
return cn(
|
|
8038
|
+
getTableRowClasses({ isSelected, isVirtualized: false }),
|
|
8039
|
+
hierarchicalClass
|
|
8040
|
+
);
|
|
8041
|
+
}
|
|
8042
|
+
return getTableRowClasses({ isSelected, isVirtualized: false });
|
|
8043
|
+
}, [isHierarchical, isParent, isSelected, hierarchical]);
|
|
8014
8044
|
return /* @__PURE__ */ jsx14(
|
|
8015
8045
|
"tr",
|
|
8016
8046
|
{
|
|
@@ -8021,7 +8051,7 @@ var RowComponent = React10.memo(({
|
|
|
8021
8051
|
...isChild && indentation > 0 ? { paddingLeft: `${indentation}px` } : {}
|
|
8022
8052
|
},
|
|
8023
8053
|
className: rowClassName,
|
|
8024
|
-
"aria-selected":
|
|
8054
|
+
"aria-selected": isSelected ? "true" : "false",
|
|
8025
8055
|
children: visibleCells.map((cell, cellIndex) => {
|
|
8026
8056
|
const isFirstCell = cellIndex === 0;
|
|
8027
8057
|
const shouldShowExpansionButton = isHierarchical && isParent && isFirstCell && hierarchical?.state;
|
|
@@ -8078,7 +8108,43 @@ var RowComponent = React10.memo(({
|
|
|
8078
8108
|
);
|
|
8079
8109
|
});
|
|
8080
8110
|
RowComponent.displayName = "RowComponent";
|
|
8081
|
-
var
|
|
8111
|
+
var areRowPropsEqual = (prevProps, nextProps) => {
|
|
8112
|
+
if (prevProps.row.id !== nextProps.row.id || prevProps.row.index !== nextProps.row.index) {
|
|
8113
|
+
return false;
|
|
8114
|
+
}
|
|
8115
|
+
if (prevProps.isEditing !== nextProps.isEditing) {
|
|
8116
|
+
return false;
|
|
8117
|
+
}
|
|
8118
|
+
if (prevProps.editingRowId !== nextProps.editingRowId) {
|
|
8119
|
+
return false;
|
|
8120
|
+
}
|
|
8121
|
+
if (prevProps.style !== nextProps.style) {
|
|
8122
|
+
if (!prevProps.style || !nextProps.style) {
|
|
8123
|
+
return false;
|
|
8124
|
+
}
|
|
8125
|
+
const prevStyle = prevProps.style;
|
|
8126
|
+
const nextStyle = nextProps.style;
|
|
8127
|
+
const styleKeys = /* @__PURE__ */ new Set([...Object.keys(prevStyle), ...Object.keys(nextStyle)]);
|
|
8128
|
+
for (const key of styleKeys) {
|
|
8129
|
+
if (prevStyle[key] !== nextStyle[key]) {
|
|
8130
|
+
return false;
|
|
8131
|
+
}
|
|
8132
|
+
}
|
|
8133
|
+
}
|
|
8134
|
+
if (prevProps.grouping.length !== nextProps.grouping.length || prevProps.grouping.some((id, i) => id !== nextProps.grouping[i])) {
|
|
8135
|
+
return false;
|
|
8136
|
+
}
|
|
8137
|
+
if (prevProps.hierarchical?.enabled !== nextProps.hierarchical?.enabled) {
|
|
8138
|
+
return false;
|
|
8139
|
+
}
|
|
8140
|
+
const prevSelected = typeof prevProps.row.getIsSelected === "function" ? prevProps.row.getIsSelected() : false;
|
|
8141
|
+
const nextSelected = typeof nextProps.row.getIsSelected === "function" ? nextProps.row.getIsSelected() : false;
|
|
8142
|
+
if (prevSelected !== nextSelected) {
|
|
8143
|
+
return false;
|
|
8144
|
+
}
|
|
8145
|
+
return true;
|
|
8146
|
+
};
|
|
8147
|
+
var MemoizedRow = React10.memo(RowComponent, areRowPropsEqual);
|
|
8082
8148
|
function UnifiedTableBody({
|
|
8083
8149
|
table,
|
|
8084
8150
|
isCreating,
|
|
@@ -10898,7 +10964,7 @@ function exportToCSV(data, columns, filename = "download.csv", options = {}) {
|
|
|
10898
10964
|
}
|
|
10899
10965
|
|
|
10900
10966
|
// src/components/DataTable/hooks/useDataTablePermissions.ts
|
|
10901
|
-
import { useMemo as useMemo12, useRef as useRef4 } from "react";
|
|
10967
|
+
import { useMemo as useMemo12, useRef as useRef4, useState as useState8, useEffect as useEffect10 } from "react";
|
|
10902
10968
|
|
|
10903
10969
|
// src/components/DataTable/types.ts
|
|
10904
10970
|
var defaultDataTableFeatures = {
|
|
@@ -10930,6 +10996,28 @@ function useDataTablePermissions(rbac, features = {}) {
|
|
|
10930
10996
|
const logger2 = createLogger("DataTablePermissions");
|
|
10931
10997
|
const authResult = useUnifiedAuth();
|
|
10932
10998
|
const user = authResult.user;
|
|
10999
|
+
const [isSuperAdminUser, setIsSuperAdminUser] = useState8(false);
|
|
11000
|
+
const [isCheckingSuperAdmin, setIsCheckingSuperAdmin] = useState8(false);
|
|
11001
|
+
useEffect10(() => {
|
|
11002
|
+
const checkSuperAdminStatus = async () => {
|
|
11003
|
+
if (!user?.id) {
|
|
11004
|
+
setIsSuperAdminUser(false);
|
|
11005
|
+
setIsCheckingSuperAdmin(false);
|
|
11006
|
+
return;
|
|
11007
|
+
}
|
|
11008
|
+
setIsCheckingSuperAdmin(true);
|
|
11009
|
+
try {
|
|
11010
|
+
const superAdminStatus = await isSuperAdmin(user.id);
|
|
11011
|
+
setIsSuperAdminUser(superAdminStatus);
|
|
11012
|
+
} catch (error) {
|
|
11013
|
+
logger2.error("useDataTablePermissions", "Error checking super admin status", { userId: user?.id, error });
|
|
11014
|
+
setIsSuperAdminUser(false);
|
|
11015
|
+
} finally {
|
|
11016
|
+
setIsCheckingSuperAdmin(false);
|
|
11017
|
+
}
|
|
11018
|
+
};
|
|
11019
|
+
checkSuperAdminStatus();
|
|
11020
|
+
}, [user?.id, logger2]);
|
|
10933
11021
|
const pageId = rbac?.pageId;
|
|
10934
11022
|
const pageName = rbac?.pageName;
|
|
10935
11023
|
if (!pageId && !pageName) {
|
|
@@ -10974,16 +11062,38 @@ function useDataTablePermissions(rbac, features = {}) {
|
|
|
10974
11062
|
const updatePermission = `update:page.${effectivePageId}`;
|
|
10975
11063
|
const deletePermission = `delete:page.${effectivePageId}`;
|
|
10976
11064
|
const consistentScope = effectiveScope || { organisationId: void 0, eventId: void 0, appId: void 0 };
|
|
10977
|
-
const
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
11065
|
+
const canReadResult = useCan(userId, consistentScope, readPermission, effectivePageId, true);
|
|
11066
|
+
const canCreateResult = useCan(userId, consistentScope, createPermission, effectivePageId, true);
|
|
11067
|
+
const canUpdateResult = useCan(userId, consistentScope, updatePermission, effectivePageId, true);
|
|
11068
|
+
const canDeleteResult = useCan(userId, consistentScope, deletePermission, effectivePageId, true);
|
|
11069
|
+
const canExportResult = useCan(userId, consistentScope, readPermission, effectivePageId, true);
|
|
11070
|
+
const canImportResult = useCan(userId, consistentScope, createPermission, effectivePageId, true);
|
|
11071
|
+
const permissions = useMemo12(() => {
|
|
11072
|
+
const createSuperAdminAwarePermission = (result) => ({
|
|
11073
|
+
can: isSuperAdminUser ? true : result.can,
|
|
11074
|
+
// Show loading if super admin check is in progress OR if the underlying permission check is loading
|
|
11075
|
+
isLoading: isCheckingSuperAdmin || result.isLoading,
|
|
11076
|
+
error: result.error,
|
|
11077
|
+
refetch: result.refetch
|
|
11078
|
+
});
|
|
11079
|
+
return {
|
|
11080
|
+
canRead: createSuperAdminAwarePermission(canReadResult),
|
|
11081
|
+
canCreate: createSuperAdminAwarePermission(canCreateResult),
|
|
11082
|
+
canUpdate: createSuperAdminAwarePermission(canUpdateResult),
|
|
11083
|
+
canDelete: createSuperAdminAwarePermission(canDeleteResult),
|
|
11084
|
+
canExport: createSuperAdminAwarePermission(canExportResult),
|
|
11085
|
+
canImport: createSuperAdminAwarePermission(canImportResult)
|
|
11086
|
+
};
|
|
11087
|
+
}, [
|
|
11088
|
+
isSuperAdminUser,
|
|
11089
|
+
isCheckingSuperAdmin,
|
|
11090
|
+
canReadResult,
|
|
11091
|
+
canCreateResult,
|
|
11092
|
+
canUpdateResult,
|
|
11093
|
+
canDeleteResult,
|
|
11094
|
+
canExportResult,
|
|
11095
|
+
canImportResult
|
|
11096
|
+
]);
|
|
10987
11097
|
const normalizedFeatures = useMemo12(
|
|
10988
11098
|
() => normalizeDataTableFeatures(features),
|
|
10989
11099
|
[features]
|
|
@@ -11407,7 +11517,7 @@ function getRowDescription(rowIndex, totalRows, isSelected = false, isEditing =
|
|
|
11407
11517
|
}
|
|
11408
11518
|
|
|
11409
11519
|
// src/components/DataTable/hooks/useKeyboardNavigation.ts
|
|
11410
|
-
import { useCallback as useCallback9, useEffect as
|
|
11520
|
+
import { useCallback as useCallback9, useEffect as useEffect11, useRef as useRef5, useState as useState9 } from "react";
|
|
11411
11521
|
function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
11412
11522
|
const {
|
|
11413
11523
|
enabled = true,
|
|
@@ -11417,7 +11527,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
11417
11527
|
onFocusChange,
|
|
11418
11528
|
tableRef: externalTableRef
|
|
11419
11529
|
} = options;
|
|
11420
|
-
const [state, setState] =
|
|
11530
|
+
const [state, setState] = useState9({
|
|
11421
11531
|
focusedRowIndex: 0,
|
|
11422
11532
|
focusedColumnIndex: 0,
|
|
11423
11533
|
isNavigating: false
|
|
@@ -11668,7 +11778,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
11668
11778
|
storedFocusRef.current = null;
|
|
11669
11779
|
}
|
|
11670
11780
|
}, [focusCell]);
|
|
11671
|
-
|
|
11781
|
+
useEffect11(() => {
|
|
11672
11782
|
return () => {
|
|
11673
11783
|
if (navigationTimeoutRef.current) {
|
|
11674
11784
|
clearTimeout(navigationTimeoutRef.current);
|
|
@@ -11801,12 +11911,12 @@ function DataTableInternal(props) {
|
|
|
11801
11911
|
defaultSorting: defaultSorting || [],
|
|
11802
11912
|
defaultGrouping: defaultGrouping || []
|
|
11803
11913
|
});
|
|
11804
|
-
|
|
11914
|
+
useEffect12(() => {
|
|
11805
11915
|
if (secureFeatures.columnVisibility && isColumnVisibilityLoaded && Object.keys(initialColumnVisibility).length > 0) {
|
|
11806
11916
|
stateActions.setColumnVisibility(initialColumnVisibility);
|
|
11807
11917
|
}
|
|
11808
11918
|
}, [secureFeatures.columnVisibility, isColumnVisibilityLoaded, initialColumnVisibility, stateActions]);
|
|
11809
|
-
|
|
11919
|
+
useEffect12(() => {
|
|
11810
11920
|
initializeLiveRegion();
|
|
11811
11921
|
}, []);
|
|
11812
11922
|
const rowSelection = selection !== void 0 ? selection : state.rowSelection;
|
|
@@ -11815,7 +11925,7 @@ function DataTableInternal(props) {
|
|
|
11815
11925
|
[getRowId]
|
|
11816
11926
|
);
|
|
11817
11927
|
const hasInitializedExpansion = useRef6(false);
|
|
11818
|
-
|
|
11928
|
+
useEffect12(() => {
|
|
11819
11929
|
if (!hasInitializedExpansion.current && defaultGrouping && defaultGrouping.length > 0) {
|
|
11820
11930
|
stateActions.setExpanded(true);
|
|
11821
11931
|
hasInitializedExpansion.current = true;
|
|
@@ -11868,7 +11978,7 @@ function DataTableInternal(props) {
|
|
|
11868
11978
|
);
|
|
11869
11979
|
const lastFocusedElementRef = useRef6(null);
|
|
11870
11980
|
const wasImportModalOpenRef = useRef6(false);
|
|
11871
|
-
|
|
11981
|
+
useEffect12(() => {
|
|
11872
11982
|
if (state.showImportModal) {
|
|
11873
11983
|
wasImportModalOpenRef.current = true;
|
|
11874
11984
|
keyboardNavigation.storeFocus();
|
|
@@ -11877,7 +11987,7 @@ function DataTableInternal(props) {
|
|
|
11877
11987
|
}
|
|
11878
11988
|
}
|
|
11879
11989
|
}, [state.showImportModal, keyboardNavigation]);
|
|
11880
|
-
|
|
11990
|
+
useEffect12(() => {
|
|
11881
11991
|
if (!state.showImportModal) {
|
|
11882
11992
|
if (!wasImportModalOpenRef.current) {
|
|
11883
11993
|
return;
|
|
@@ -11908,7 +12018,7 @@ function DataTableInternal(props) {
|
|
|
11908
12018
|
finalPaginationMode,
|
|
11909
12019
|
serverData
|
|
11910
12020
|
});
|
|
11911
|
-
|
|
12021
|
+
useEffect12(() => {
|
|
11912
12022
|
if (!hierarchicalValidation.isValid) {
|
|
11913
12023
|
logger2.error("Hierarchical data validation failed:", hierarchicalValidation.errors);
|
|
11914
12024
|
}
|
|
@@ -11923,13 +12033,13 @@ function DataTableInternal(props) {
|
|
|
11923
12033
|
enablePersistence: secureFeatures.columnReordering,
|
|
11924
12034
|
storageKey
|
|
11925
12035
|
});
|
|
11926
|
-
|
|
12036
|
+
useEffect12(() => {
|
|
11927
12037
|
if (secureFeatures.columnReordering && isColumnOrderLoaded && savedColumnOrder && savedColumnOrder.length > 0) {
|
|
11928
12038
|
const normalizedOrder = secureFeatures.selection && savedColumnOrder.includes("select") ? ["select", ...savedColumnOrder.filter((id) => id !== "select")] : savedColumnOrder;
|
|
11929
12039
|
stateActions.setColumnOrder(normalizedOrder);
|
|
11930
12040
|
}
|
|
11931
12041
|
}, [secureFeatures.columnReordering, secureFeatures.selection, isColumnOrderLoaded, savedColumnOrder, stateActions]);
|
|
11932
|
-
|
|
12042
|
+
useEffect12(() => {
|
|
11933
12043
|
if (secureFeatures.selection && state.columnOrder.includes("select") && state.columnOrder[0] !== "select") {
|
|
11934
12044
|
const normalizedOrder = ["select", ...state.columnOrder.filter((id) => id !== "select")];
|
|
11935
12045
|
stateActions.setColumnOrder(normalizedOrder);
|
|
@@ -11964,7 +12074,7 @@ function DataTableInternal(props) {
|
|
|
11964
12074
|
}
|
|
11965
12075
|
return state.pagination.pageSize;
|
|
11966
12076
|
}, [state.pagination.pageSize, validatedInitialPageSize, secureFeatures.pagination, finalPageSizeOptions]);
|
|
11967
|
-
|
|
12077
|
+
useEffect12(() => {
|
|
11968
12078
|
if (secureFeatures.pagination && finalPageSizeOptions.length > 0) {
|
|
11969
12079
|
const needsFix = !finalPageSizeOptions.includes(state.pagination.pageSize);
|
|
11970
12080
|
const currentPageSize = effectivePageSize || validatedInitialPageSize;
|
|
@@ -12804,4 +12914,4 @@ lodash/lodash.js:
|
|
|
12804
12914
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
12805
12915
|
*)
|
|
12806
12916
|
*/
|
|
12807
|
-
//# sourceMappingURL=chunk-
|
|
12917
|
+
//# sourceMappingURL=chunk-E3SPN4VZ.js.map
|