@jmruthers/pace-core 0.5.106 → 0.5.108
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-BE0OXZKQ.d.ts → DataTable-D5cBRca8.d.ts} +1 -1
- package/dist/{DataTable-LWHFLTEW.js → DataTable-WFCHVWTY.js} +3 -3
- package/dist/{PublicLoadingSpinner-48ewSMKK.d.ts → PublicLoadingSpinner-DgDWTFqn.d.ts} +4 -2
- package/dist/{chunk-QPCAGLUS.js → chunk-4OX5PXHX.js} +5 -2
- package/dist/chunk-4OX5PXHX.js.map +1 -0
- package/dist/{chunk-IBZBNBTE.js → chunk-B3QX32P5.js} +177 -54
- package/dist/chunk-B3QX32P5.js.map +1 -0
- package/dist/{chunk-75G3NZWN.js → chunk-IMZGJ2X7.js} +373 -95
- package/dist/chunk-IMZGJ2X7.js.map +1 -0
- package/dist/{chunk-4BWGRQBG.js → chunk-NFPV7MRN.js} +22 -2
- package/dist/chunk-NFPV7MRN.js.map +1 -0
- package/dist/components.d.ts +4 -4
- package/dist/components.js +3 -3
- package/dist/{formatting-BfDeV-ja.d.ts → formatting-BiEv5oEk.d.ts} +32 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +4 -4
- package/dist/{types-BDg1mAGG.d.ts → types-D4TVpDa1.d.ts} +24 -1
- package/dist/{useToast-Bm6TnSK-.d.ts → useToast-DRah6K-g.d.ts} +5 -2
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +2 -2
- 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 +4 -4
- 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 +18 -18
- package/docs/api/interfaces/DataTableColumn.md +115 -10
- package/docs/api/interfaces/DataTableProps.md +38 -38
- package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
- package/docs/api/interfaces/EmptyStateConfig.md +5 -5
- package/docs/api/interfaces/EnhancedNavigationMenuProps.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/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/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/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/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 +42 -19
- package/docs/api-reference/utilities.md +26 -3
- package/docs/implementation-guides/data-tables.md +390 -0
- package/package.json +1 -1
- package/src/components/DataTable/DataTable.tsx +4 -0
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +25 -10
- package/src/components/DataTable/components/ColumnFilter.tsx +2 -1
- package/src/components/DataTable/components/EditableRow.tsx +179 -16
- package/src/components/DataTable/components/FilterRow.tsx +22 -11
- package/src/components/DataTable/components/PaginationControls.tsx +1 -1
- package/src/components/DataTable/components/UnifiedTableBody.tsx +231 -32
- package/src/components/DataTable/types.ts +34 -4
- package/src/components/FileDisplay/FileDisplay.test.tsx +184 -201
- package/src/components/FileDisplay/FileDisplay.tsx +40 -39
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +189 -13
- package/src/components/NavigationMenu/NavigationMenu.tsx +142 -35
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +79 -10
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +4 -4
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/hooks/useEventTheme.test.ts +11 -0
- package/src/hooks/useSecureDataAccess.test.ts +22 -5
- package/src/hooks/useToast.ts +11 -2
- package/src/providers/UnifiedAuthProvider.smoke.test.tsx +67 -3
- package/src/providers/__tests__/ProviderLifecycle.test.tsx +72 -4
- package/src/services/__tests__/OrganisationService.pagination.test.ts +10 -2
- package/src/styles/core.css +11 -0
- package/src/utils/__tests__/formatting.unit.test.ts +33 -0
- package/src/utils/file-reference.test.ts +44 -5
- package/src/utils/formatting.ts +57 -2
- package/src/validation/__tests__/passwordSchema.unit.test.ts +3 -3
- package/dist/chunk-4BWGRQBG.js.map +0 -1
- package/dist/chunk-75G3NZWN.js.map +0 -1
- package/dist/chunk-IBZBNBTE.js.map +0 -1
- package/dist/chunk-QPCAGLUS.js.map +0 -1
- /package/dist/{DataTable-LWHFLTEW.js.map → DataTable-WFCHVWTY.js.map} +0 -0
package/docs/api/modules.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
[@jmruthers/pace-core - v0.5.
|
|
1
|
+
[@jmruthers/pace-core - v0.5.108](README.md) / Exports
|
|
2
2
|
|
|
3
|
-
# @jmruthers/pace-core - v0.5.
|
|
3
|
+
# @jmruthers/pace-core - v0.5.108
|
|
4
4
|
|
|
5
5
|
**`File`**
|
|
6
6
|
|
|
@@ -1294,7 +1294,7 @@ Features are configured through the unified `features` prop for maximum flexibil
|
|
|
1294
1294
|
|
|
1295
1295
|
#### Defined in
|
|
1296
1296
|
|
|
1297
|
-
[packages/core/src/components/DataTable/DataTable.tsx:
|
|
1297
|
+
[packages/core/src/components/DataTable/DataTable.tsx:463](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/DataTable/DataTable.tsx#L463)
|
|
1298
1298
|
|
|
1299
1299
|
___
|
|
1300
1300
|
|
|
@@ -1661,7 +1661,7 @@ React element with file display
|
|
|
1661
1661
|
|
|
1662
1662
|
#### Defined in
|
|
1663
1663
|
|
|
1664
|
-
[packages/core/src/components/FileDisplay/FileDisplay.tsx:
|
|
1664
|
+
[packages/core/src/components/FileDisplay/FileDisplay.tsx:727](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/FileDisplay/FileDisplay.tsx#L727)
|
|
1665
1665
|
|
|
1666
1666
|
___
|
|
1667
1667
|
|
|
@@ -2248,7 +2248,7 @@ function CustomNavigation() {
|
|
|
2248
2248
|
|
|
2249
2249
|
#### Defined in
|
|
2250
2250
|
|
|
2251
|
-
[packages/core/src/components/NavigationMenu/NavigationMenu.tsx:
|
|
2251
|
+
[packages/core/src/components/NavigationMenu/NavigationMenu.tsx:397](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/NavigationMenu/NavigationMenu.tsx#L397)
|
|
2252
2252
|
|
|
2253
2253
|
___
|
|
2254
2254
|
|
|
@@ -2355,7 +2355,7 @@ function App() {
|
|
|
2355
2355
|
|
|
2356
2356
|
**`Example`**
|
|
2357
2357
|
|
|
2358
|
-
Custom navigation items with permission filtering:
|
|
2358
|
+
Custom navigation items with permission filtering (works independently of route enforcement):
|
|
2359
2359
|
```tsx
|
|
2360
2360
|
import { NavigationItem } from '@jmruthers/pace-core';
|
|
2361
2361
|
|
|
@@ -2373,13 +2373,15 @@ function App() {
|
|
|
2373
2373
|
<PaceAppLayout
|
|
2374
2374
|
appName="My Custom App"
|
|
2375
2375
|
navItems={customNavItems}
|
|
2376
|
-
enforcePermissions
|
|
2376
|
+
// Navigation filtering works independently - no need for enforcePermissions
|
|
2377
2377
|
filterNavigationByPermissions={true}
|
|
2378
2378
|
routePermissions={{
|
|
2379
2379
|
'/components': 'read',
|
|
2380
2380
|
'/styles': 'read',
|
|
2381
2381
|
'/meals': 'read'
|
|
2382
2382
|
}}
|
|
2383
|
+
// Optionally enable route-level enforcement (separate from navigation filtering)
|
|
2384
|
+
// enforcePermissions={true}
|
|
2383
2385
|
/>
|
|
2384
2386
|
}>
|
|
2385
2387
|
<Route path="components" element={<ComponentsPage />} />
|
|
@@ -2433,7 +2435,7 @@ function AdminApp() {
|
|
|
2433
2435
|
|
|
2434
2436
|
#### Defined in
|
|
2435
2437
|
|
|
2436
|
-
[packages/core/src/components/PaceAppLayout/PaceAppLayout.tsx:
|
|
2438
|
+
[packages/core/src/components/PaceAppLayout/PaceAppLayout.tsx:324](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PaceAppLayout/PaceAppLayout.tsx#L324)
|
|
2437
2439
|
|
|
2438
2440
|
___
|
|
2439
2441
|
|
|
@@ -4388,7 +4390,7 @@ Object with toast state and control methods
|
|
|
4388
4390
|
|
|
4389
4391
|
#### Defined in
|
|
4390
4392
|
|
|
4391
|
-
[packages/core/src/hooks/useToast.ts:
|
|
4393
|
+
[packages/core/src/hooks/useToast.ts:230](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/useToast.ts#L230)
|
|
4392
4394
|
|
|
4393
4395
|
___
|
|
4394
4396
|
|
|
@@ -6589,25 +6591,46 @@ ___
|
|
|
6589
6591
|
|
|
6590
6592
|
### formatPercent
|
|
6591
6593
|
|
|
6592
|
-
▸ **formatPercent**(`value`, `locale?`, `
|
|
6594
|
+
▸ **formatPercent**(`value`, `locale?`, `decimalsOrOptions?`): `string`
|
|
6595
|
+
|
|
6596
|
+
Format a number as a percentage.
|
|
6593
6597
|
|
|
6594
|
-
|
|
6598
|
+
The third parameter can be either:
|
|
6599
|
+
- A number for fixed decimal places (backward compatible): `formatPercent(0.81, 'en-US', 2)`
|
|
6600
|
+
- An options object with:
|
|
6601
|
+
- `decimals`: Fixed number of decimal places (default: 1)
|
|
6602
|
+
- `preserveDecimals`: Auto-detect and preserve decimal places from the input value
|
|
6603
|
+
- `maxDecimals`: Maximum decimal places when preserving (default: 10)
|
|
6595
6604
|
|
|
6596
6605
|
#### Parameters
|
|
6597
6606
|
|
|
6598
|
-
| Name | Type | Default value |
|
|
6599
|
-
| :------ | :------ | :------ |
|
|
6600
|
-
| `value` | `number` | `undefined` |
|
|
6601
|
-
| `locale` | `string` | `'en-US'` |
|
|
6602
|
-
| `decimals`
|
|
6607
|
+
| Name | Type | Default value | Description |
|
|
6608
|
+
| :------ | :------ | :------ | :------ |
|
|
6609
|
+
| `value` | `number` | `undefined` | The percentage value as a decimal (e.g., 0.81 for 0.81%) |
|
|
6610
|
+
| `locale` | `string` | `'en-US'` | The locale string (default: 'en-US') |
|
|
6611
|
+
| `decimalsOrOptions?` | `number` \| \{ `decimals?`: `number` ; `preserveDecimals?`: `boolean` ; `maxDecimals?`: `number` } | `undefined` | Either a number for fixed decimals, or an options object with: - `decimals` - Fixed number of decimal places (default: 1) - `preserveDecimals` - Auto-detect and preserve decimal places from the input value - `maxDecimals` - Maximum decimal places when preserving (default: 10) |
|
|
6603
6612
|
|
|
6604
6613
|
#### Returns
|
|
6605
6614
|
|
|
6606
6615
|
`string`
|
|
6607
6616
|
|
|
6617
|
+
Formatted percentage string (e.g., "0.81%", "81%")
|
|
6618
|
+
|
|
6619
|
+
**`Example`**
|
|
6620
|
+
|
|
6621
|
+
```ts
|
|
6622
|
+
// Fixed decimals (default behavior)
|
|
6623
|
+
formatPercent(0.5) // '0.5%'
|
|
6624
|
+
formatPercent(0.81, 'en-US', 1) // '0.8%' (loses precision)
|
|
6625
|
+
|
|
6626
|
+
// Preserve decimal places dynamically
|
|
6627
|
+
formatPercent(0.81, 'en-US', { preserveDecimals: true }) // '0.81%'
|
|
6628
|
+
formatPercent(0.8123, 'en-US', { preserveDecimals: true, maxDecimals: 2 }) // '0.81%'
|
|
6629
|
+
```
|
|
6630
|
+
|
|
6608
6631
|
#### Defined in
|
|
6609
6632
|
|
|
6610
|
-
[packages/core/src/utils/formatting.ts:
|
|
6633
|
+
[packages/core/src/utils/formatting.ts:70](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/formatting.ts#L70)
|
|
6611
6634
|
|
|
6612
6635
|
___
|
|
6613
6636
|
|
|
@@ -6630,7 +6653,7 @@ Format a large number with abbreviations (K, M, B)
|
|
|
6630
6653
|
|
|
6631
6654
|
#### Defined in
|
|
6632
6655
|
|
|
6633
|
-
[packages/core/src/utils/formatting.ts:
|
|
6656
|
+
[packages/core/src/utils/formatting.ts:114](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/formatting.ts#L114)
|
|
6634
6657
|
|
|
6635
6658
|
___
|
|
6636
6659
|
|
|
@@ -6652,7 +6675,7 @@ Format a file size in bytes to a human-readable string
|
|
|
6652
6675
|
|
|
6653
6676
|
#### Defined in
|
|
6654
6677
|
|
|
6655
|
-
[packages/core/src/utils/formatting.ts:
|
|
6678
|
+
[packages/core/src/utils/formatting.ts:124](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/formatting.ts#L124)
|
|
6656
6679
|
|
|
6657
6680
|
___
|
|
6658
6681
|
|
|
@@ -460,17 +460,40 @@ Format a number as a percentage.
|
|
|
460
460
|
function formatPercent(
|
|
461
461
|
value: number,
|
|
462
462
|
locale?: string,
|
|
463
|
-
|
|
463
|
+
decimalsOrOptions?: number | {
|
|
464
|
+
decimals?: number;
|
|
465
|
+
preserveDecimals?: boolean;
|
|
466
|
+
maxDecimals?: number;
|
|
467
|
+
}
|
|
464
468
|
): string;
|
|
465
469
|
```
|
|
466
470
|
|
|
471
|
+
#### Parameters
|
|
472
|
+
|
|
473
|
+
- `value` - The percentage value as a decimal (e.g., 0.81 for 0.81%)
|
|
474
|
+
- `locale` - The locale string (default: 'en-US')
|
|
475
|
+
- `decimalsOrOptions` - Either:
|
|
476
|
+
- A number for fixed decimal places (backward compatible)
|
|
477
|
+
- An options object with:
|
|
478
|
+
- `decimals` - Fixed number of decimal places (default: 1)
|
|
479
|
+
- `preserveDecimals` - Auto-detect and preserve decimal places from the input value
|
|
480
|
+
- `maxDecimals` - Maximum decimal places when preserving (default: 10)
|
|
481
|
+
|
|
467
482
|
#### Usage
|
|
468
483
|
|
|
469
484
|
```typescript
|
|
470
485
|
import { formatPercent } from '@jmruthers/pace-core';
|
|
471
486
|
|
|
472
|
-
|
|
473
|
-
formatPercent(
|
|
487
|
+
// Fixed decimals (default behavior)
|
|
488
|
+
formatPercent(0.5) // '0.5%'
|
|
489
|
+
formatPercent(0.81, 'en-US', 1) // '0.8%' (loses precision)
|
|
490
|
+
|
|
491
|
+
// Preserve decimal places dynamically
|
|
492
|
+
formatPercent(0, 'en-US', { preserveDecimals: true }) // '0%'
|
|
493
|
+
formatPercent(3, 'en-US', { preserveDecimals: true }) // '3%'
|
|
494
|
+
formatPercent(3.1, 'en-US', { preserveDecimals: true }) // '3.1%'
|
|
495
|
+
formatPercent(0.81, 'en-US', { preserveDecimals: true }) // '0.81%' (preserves precision)
|
|
496
|
+
formatPercent(0.8123, 'en-US', { preserveDecimals: true, maxDecimals: 2 }) // '0.81%'
|
|
474
497
|
```
|
|
475
498
|
|
|
476
499
|
### formatCompactNumber
|