@jmruthers/pace-core 0.5.38 → 0.5.41

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 (124) hide show
  1. package/dist/{DataTable-SUM2QMUM.js → DataTable-2HA7VQZ4.js} +2 -2
  2. package/dist/{DataTable-Da0D1BHX.d.ts → DataTable-DqDDvBfI.d.ts} +1 -1
  3. package/dist/{chunk-2XAK7GBW.js → chunk-7SLC6HXW.js} +2 -2
  4. package/dist/{chunk-JHQ7DMPJ.js → chunk-MQS7SEE6.js} +57 -3
  5. package/dist/chunk-MQS7SEE6.js.map +1 -0
  6. package/dist/components.d.ts +2 -2
  7. package/dist/components.js +2 -2
  8. package/dist/hooks.d.ts +1 -1
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.js +2 -2
  11. package/dist/rbac/cli/policy-manager.js +278 -0
  12. package/dist/rbac/cli/policy-manager.js.map +1 -0
  13. package/dist/{types-zOqe4P1s.d.ts → types-E5WSpEtz.d.ts} +7 -0
  14. package/dist/utils.d.ts +2 -2
  15. package/dist/utils.js +1 -1
  16. package/docs/api/classes/ErrorBoundary.md +1 -1
  17. package/docs/api/classes/InvalidScopeError.md +1 -1
  18. package/docs/api/classes/MissingUserContextError.md +1 -1
  19. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  20. package/docs/api/classes/PermissionDeniedError.md +1 -1
  21. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  22. package/docs/api/classes/RBACAuditManager.md +1 -1
  23. package/docs/api/classes/RBACCache.md +1 -1
  24. package/docs/api/classes/RBACEngine.md +1 -1
  25. package/docs/api/classes/RBACError.md +1 -1
  26. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  27. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  28. package/docs/api/interfaces/AggregateConfig.md +4 -4
  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/DataTableAction.md +14 -14
  35. package/docs/api/interfaces/DataTableColumn.md +31 -5
  36. package/docs/api/interfaces/DataTableProps.md +1 -1
  37. package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
  38. package/docs/api/interfaces/EmptyStateConfig.md +5 -5
  39. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  40. package/docs/api/interfaces/EventContextType.md +1 -1
  41. package/docs/api/interfaces/EventLogoProps.md +1 -1
  42. package/docs/api/interfaces/EventProviderProps.md +1 -1
  43. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  44. package/docs/api/interfaces/FileUploadProps.md +1 -1
  45. package/docs/api/interfaces/FooterProps.md +1 -1
  46. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  47. package/docs/api/interfaces/InputProps.md +1 -1
  48. package/docs/api/interfaces/LabelProps.md +1 -1
  49. package/docs/api/interfaces/LoginFormProps.md +1 -1
  50. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  51. package/docs/api/interfaces/NavigationContextType.md +1 -1
  52. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  53. package/docs/api/interfaces/NavigationItem.md +1 -1
  54. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  55. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  56. package/docs/api/interfaces/Organisation.md +1 -1
  57. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  58. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  59. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  60. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  61. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  62. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  63. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  64. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  65. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  66. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  67. package/docs/api/interfaces/PaletteData.md +1 -1
  68. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  69. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  70. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  71. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  72. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  73. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  74. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  75. package/docs/api/interfaces/RBACConfig.md +1 -1
  76. package/docs/api/interfaces/RBACContextType.md +1 -1
  77. package/docs/api/interfaces/RBACLogger.md +1 -1
  78. package/docs/api/interfaces/RBACProviderProps.md +1 -1
  79. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  80. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  81. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  82. package/docs/api/interfaces/RouteConfig.md +1 -1
  83. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  84. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  85. package/docs/api/interfaces/StorageConfig.md +1 -1
  86. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  87. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  88. package/docs/api/interfaces/StorageListOptions.md +1 -1
  89. package/docs/api/interfaces/StorageListResult.md +1 -1
  90. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  91. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  92. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  93. package/docs/api/interfaces/StyleImport.md +1 -1
  94. package/docs/api/interfaces/ToastActionElement.md +1 -1
  95. package/docs/api/interfaces/ToastProps.md +1 -1
  96. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  97. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  98. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  99. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  100. package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
  101. package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
  102. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  103. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  104. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  105. package/docs/api/interfaces/UserEventAccess.md +1 -1
  106. package/docs/api/interfaces/UserMenuProps.md +1 -1
  107. package/docs/api/interfaces/UserProfile.md +1 -1
  108. package/docs/api/modules.md +2 -2
  109. package/docs/implementation-guides/data-tables.md +189 -0
  110. package/docs/implementation-guides/datatable-filtering.md +313 -0
  111. package/docs/rbac/README-rbac-rls-integration.md +358 -0
  112. package/docs/rbac/examples/rbac-rls-integration-example.md +332 -0
  113. package/docs/rbac/rbac-rls-integration.md +377 -0
  114. package/package.json +19 -3
  115. package/src/components/DataTable/components/ActionButtons.tsx +22 -2
  116. package/src/components/DataTable/components/DataTableCore.tsx +28 -0
  117. package/src/components/DataTable/components/EditableRow.tsx +6 -0
  118. package/src/components/DataTable/components/FilterRow.tsx +14 -2
  119. package/src/components/DataTable/components/UnifiedTableBody.tsx +6 -0
  120. package/src/components/DataTable/types.ts +4 -0
  121. package/src/rbac/cli/policy-manager.ts +443 -0
  122. package/dist/chunk-JHQ7DMPJ.js.map +0 -1
  123. /package/dist/{DataTable-SUM2QMUM.js.map → DataTable-2HA7VQZ4.js.map} +0 -0
  124. /package/dist/{chunk-2XAK7GBW.js.map → chunk-7SLC6HXW.js.map} +0 -0
@@ -32,7 +32,7 @@ import {
32
32
  useDataTableContext,
33
33
  usePluginRegistry,
34
34
  useStateManager
35
- } from "./chunk-JHQ7DMPJ.js";
35
+ } from "./chunk-MQS7SEE6.js";
36
36
  import "./chunk-YA77BOZM.js";
37
37
  import "./chunk-GWSBHC4J.js";
38
38
  import "./chunk-7BNPOCLL.js";
@@ -97,4 +97,4 @@ export {
97
97
  usePluginRegistry,
98
98
  useStateManager
99
99
  };
100
- //# sourceMappingURL=DataTable-SUM2QMUM.js.map
100
+ //# sourceMappingURL=DataTable-2HA7VQZ4.js.map
@@ -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-zOqe4P1s.js';
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-E5WSpEtz.js';
4
4
 
5
5
  /**
6
6
  * Configuration interface for customizing ImportModal text content
@@ -15,7 +15,7 @@ import {
15
15
  SelectSeparator,
16
16
  SelectTrigger,
17
17
  SelectValue
18
- } from "./chunk-JHQ7DMPJ.js";
18
+ } from "./chunk-MQS7SEE6.js";
19
19
  import {
20
20
  isPermitted
21
21
  } from "./chunk-GWSBHC4J.js";
@@ -3290,4 +3290,4 @@ export {
3290
3290
  PublicPageDiagnostic,
3291
3291
  PublicPageContextChecker
3292
3292
  };
3293
- //# sourceMappingURL=chunk-2XAK7GBW.js.map
3293
+ //# sourceMappingURL=chunk-7SLC6HXW.js.map
@@ -1113,6 +1113,9 @@ function FilterRow({ table, visibleColumns }) {
1113
1113
  const column = table.getColumn(columnId);
1114
1114
  if (!column) return [];
1115
1115
  const columnDef = column.columnDef;
1116
+ if (columnDef.filterSelectOptions && Array.isArray(columnDef.filterSelectOptions)) {
1117
+ return columnDef.filterSelectOptions;
1118
+ }
1116
1119
  if (columnDef.fieldOptions && Array.isArray(columnDef.fieldOptions)) {
1117
1120
  return columnDef.fieldOptions;
1118
1121
  }
@@ -1132,6 +1135,9 @@ function FilterRow({ table, visibleColumns }) {
1132
1135
  if (columnDef.filterType) {
1133
1136
  return columnDef.filterType;
1134
1137
  }
1138
+ if (columnDef.filterSelectOptions && Array.isArray(columnDef.filterSelectOptions)) {
1139
+ return "select";
1140
+ }
1135
1141
  if (columnId.toLowerCase().includes("date") || columnId.toLowerCase().includes("time")) {
1136
1142
  return "date";
1137
1143
  }
@@ -1232,7 +1238,16 @@ function ActionButtons({
1232
1238
  {
1233
1239
  variant: action.variant === "destructive" ? "destructive" : "ghost",
1234
1240
  size: "sm",
1235
- onClick: () => action.onClick(row.original),
1241
+ onClick: () => {
1242
+ if (false) {
1243
+ console.log("[ActionButtons] Action clicked:", {
1244
+ actionLabel: action.label,
1245
+ rowOriginal: row.original,
1246
+ actionOnClick: typeof action.onClick
1247
+ });
1248
+ }
1249
+ action.onClick(row.original);
1250
+ },
1236
1251
  disabled: isDisabled,
1237
1252
  "aria-disabled": isDisabled,
1238
1253
  "data-testid": action.testId,
@@ -1268,7 +1283,16 @@ function ActionButtons({
1268
1283
  SelectItem,
1269
1284
  {
1270
1285
  value: `action-${actionIndex}`,
1271
- onClick: () => action.onClick(row.original),
1286
+ onClick: () => {
1287
+ if (false) {
1288
+ console.log("[ActionButtons] Dropdown action clicked:", {
1289
+ actionLabel: action.label,
1290
+ rowOriginal: row.original,
1291
+ actionOnClick: typeof action.onClick
1292
+ });
1293
+ }
1294
+ action.onClick(row.original);
1295
+ },
1272
1296
  className: action.variant === "destructive" ? "text-acc-600" : "",
1273
1297
  children: [
1274
1298
  Icon && /* @__PURE__ */ jsx10(Icon, { className: "mr-2 h-4 w-4" }),
@@ -1351,6 +1375,9 @@ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
1351
1375
  var VIRTUALIZATION_THRESHOLD = 1e3;
1352
1376
  var renderEditField = (column, value, onChange, editingData = {}, placeholder) => {
1353
1377
  const columnDef = column.columnDef;
1378
+ if (columnDef.editable === false) {
1379
+ return /* @__PURE__ */ jsx11("span", { className: "text-sm text-gray-600", children: value || "" });
1380
+ }
1354
1381
  if (columnDef.fieldType === "select" && columnDef.fieldOptions) {
1355
1382
  const accessorKey = columnDef.editAccessorKey || column.id;
1356
1383
  const currentValue = editingData[accessorKey] || value || "";
@@ -3585,6 +3612,23 @@ function DataTableInternal({
3585
3612
  }), [permissions.canUpdate.can, permissions.canDelete.can, permissions.canCreate.can, permissions.canImport.can, permissions.canExport.can, onEditRow, onDeleteRow, onCreateRow, onImport, onExport, onDeleteSelected]);
3586
3613
  const effectiveActions = useMemo6(() => {
3587
3614
  const result = [...actions];
3615
+ if (false) {
3616
+ console.log("[DataTable] Action Configuration Debug:", {
3617
+ originalActions: actions.length,
3618
+ secureFeatures: {
3619
+ editing: secureFeatures.editing,
3620
+ deletion: secureFeatures.deletion
3621
+ },
3622
+ secureHandlers: {
3623
+ onEditRow: !!secureHandlers.onEditRow,
3624
+ onDeleteRow: !!secureHandlers.onDeleteRow
3625
+ },
3626
+ permissions: {
3627
+ canUpdate: permissions.canUpdate.can,
3628
+ canDelete: permissions.canDelete.can
3629
+ }
3630
+ });
3631
+ }
3588
3632
  if (secureFeatures.editing && secureHandlers.onEditRow && !result.some((a) => a.label === "Edit")) {
3589
3633
  result.push({
3590
3634
  label: "Edit",
@@ -3615,6 +3659,13 @@ function DataTableInternal({
3615
3659
  hidden: !permissions.canDelete.can
3616
3660
  });
3617
3661
  }
3662
+ if (false) {
3663
+ console.log("[DataTable] Final Actions:", {
3664
+ totalActions: result.length,
3665
+ actionLabels: result.map((a) => a.label),
3666
+ hiddenActions: result.filter((a) => a.hidden).map((a) => a.label)
3667
+ });
3668
+ }
3618
3669
  return result;
3619
3670
  }, [actions, secureFeatures, permissions, secureHandlers, getRowId, tableActions]);
3620
3671
  const enhancedColumns = useMemo6(() => {
@@ -5369,6 +5420,9 @@ init_Button();
5369
5420
  import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
5370
5421
  var renderEditField2 = (column, value, onChange, editingData = {}, placeholder) => {
5371
5422
  const columnDef = column.columnDef;
5423
+ if (columnDef.editable === false) {
5424
+ return /* @__PURE__ */ jsx25("span", { className: "text-sm text-gray-600", children: value || "" });
5425
+ }
5372
5426
  if (columnDef.fieldType === "select" && columnDef.fieldOptions) {
5373
5427
  const editKey = columnDef.editAccessorKey || column.id;
5374
5428
  const editValue = editingData[editKey] || value;
@@ -5530,4 +5584,4 @@ export {
5530
5584
  GroupHeader,
5531
5585
  EditableRow
5532
5586
  };
5533
- //# sourceMappingURL=chunk-JHQ7DMPJ.js.map
5587
+ //# sourceMappingURL=chunk-MQS7SEE6.js.map