@jmruthers/pace-core 0.5.105 → 0.5.107
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-H2WIR2DN.js} +3 -3
- package/dist/{chunk-QPCAGLUS.js → chunk-4OX5PXHX.js} +5 -2
- package/dist/chunk-4OX5PXHX.js.map +1 -0
- package/dist/{chunk-75G3NZWN.js → chunk-5JJCXTVE.js} +293 -37
- package/dist/chunk-5JJCXTVE.js.map +1 -0
- package/dist/{chunk-HBGPLSA5.js → chunk-DMNMZKWS.js} +70 -24
- package/dist/chunk-DMNMZKWS.js.map +1 -0
- package/dist/{chunk-AZFPGDCJ.js → chunk-EWKCROSF.js} +133 -49
- package/dist/chunk-EWKCROSF.js.map +1 -0
- package/dist/{chunk-4BWGRQBG.js → chunk-NFPV7MRN.js} +22 -2
- package/dist/chunk-NFPV7MRN.js.map +1 -0
- package/dist/{chunk-DWYMGSGU.js → chunk-VJ7MPS2K.js} +2 -2
- package/dist/components.d.ts +3 -3
- package/dist/components.js +4 -4
- package/dist/{formatting-BfDeV-ja.d.ts → formatting-BiEv5oEk.d.ts} +32 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -6
- 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 +39 -18
- 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/EditableRow.tsx +174 -16
- package/src/components/DataTable/components/UnifiedTableBody.tsx +205 -35
- 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/PublicLayout/__tests__/PublicPageHeader.test.tsx +4 -4
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/hooks/public/usePublicFileDisplay.ts +25 -15
- package/src/hooks/useEventTheme.test.ts +11 -0
- package/src/hooks/useFileDisplay.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/file-reference.ts +49 -26
- 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-AZFPGDCJ.js.map +0 -1
- package/dist/chunk-HBGPLSA5.js.map +0 -1
- package/dist/chunk-QPCAGLUS.js.map +0 -1
- /package/dist/{DataTable-LWHFLTEW.js.map → DataTable-H2WIR2DN.js.map} +0 -0
- /package/dist/{chunk-DWYMGSGU.js.map → chunk-VJ7MPS2K.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.107](README.md) / Exports
|
|
2
2
|
|
|
3
|
-
# @jmruthers/pace-core - v0.5.
|
|
3
|
+
# @jmruthers/pace-core - v0.5.107
|
|
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
|
|
|
@@ -3837,7 +3837,7 @@ Useful for testing or when you need to force refresh all data
|
|
|
3837
3837
|
|
|
3838
3838
|
#### Defined in
|
|
3839
3839
|
|
|
3840
|
-
[packages/core/src/hooks/public/usePublicFileDisplay.ts:
|
|
3840
|
+
[packages/core/src/hooks/public/usePublicFileDisplay.ts:373](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/public/usePublicFileDisplay.ts#L373)
|
|
3841
3841
|
|
|
3842
3842
|
___
|
|
3843
3843
|
|
|
@@ -3858,7 +3858,7 @@ Get cache statistics for debugging
|
|
|
3858
3858
|
|
|
3859
3859
|
#### Defined in
|
|
3860
3860
|
|
|
3861
|
-
[packages/core/src/hooks/public/usePublicFileDisplay.ts:
|
|
3861
|
+
[packages/core/src/hooks/public/usePublicFileDisplay.ts:384](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/public/usePublicFileDisplay.ts#L384)
|
|
3862
3862
|
|
|
3863
3863
|
___
|
|
3864
3864
|
|
|
@@ -4388,7 +4388,7 @@ Object with toast state and control methods
|
|
|
4388
4388
|
|
|
4389
4389
|
#### Defined in
|
|
4390
4390
|
|
|
4391
|
-
[packages/core/src/hooks/useToast.ts:
|
|
4391
|
+
[packages/core/src/hooks/useToast.ts:230](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/useToast.ts#L230)
|
|
4392
4392
|
|
|
4393
4393
|
___
|
|
4394
4394
|
|
|
@@ -6589,25 +6589,46 @@ ___
|
|
|
6589
6589
|
|
|
6590
6590
|
### formatPercent
|
|
6591
6591
|
|
|
6592
|
-
▸ **formatPercent**(`value`, `locale?`, `
|
|
6592
|
+
▸ **formatPercent**(`value`, `locale?`, `decimalsOrOptions?`): `string`
|
|
6593
6593
|
|
|
6594
|
-
Format a number as a percentage
|
|
6594
|
+
Format a number as a percentage.
|
|
6595
|
+
|
|
6596
|
+
The third parameter can be either:
|
|
6597
|
+
- A number for fixed decimal places (backward compatible): `formatPercent(0.81, 'en-US', 2)`
|
|
6598
|
+
- An options object with:
|
|
6599
|
+
- `decimals`: Fixed number of decimal places (default: 1)
|
|
6600
|
+
- `preserveDecimals`: Auto-detect and preserve decimal places from the input value
|
|
6601
|
+
- `maxDecimals`: Maximum decimal places when preserving (default: 10)
|
|
6595
6602
|
|
|
6596
6603
|
#### Parameters
|
|
6597
6604
|
|
|
6598
|
-
| Name | Type | Default value |
|
|
6599
|
-
| :------ | :------ | :------ |
|
|
6600
|
-
| `value` | `number` | `undefined` |
|
|
6601
|
-
| `locale` | `string` | `'en-US'` |
|
|
6602
|
-
| `decimals`
|
|
6605
|
+
| Name | Type | Default value | Description |
|
|
6606
|
+
| :------ | :------ | :------ | :------ |
|
|
6607
|
+
| `value` | `number` | `undefined` | The percentage value as a decimal (e.g., 0.81 for 0.81%) |
|
|
6608
|
+
| `locale` | `string` | `'en-US'` | The locale string (default: 'en-US') |
|
|
6609
|
+
| `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
6610
|
|
|
6604
6611
|
#### Returns
|
|
6605
6612
|
|
|
6606
6613
|
`string`
|
|
6607
6614
|
|
|
6615
|
+
Formatted percentage string (e.g., "0.81%", "81%")
|
|
6616
|
+
|
|
6617
|
+
**`Example`**
|
|
6618
|
+
|
|
6619
|
+
```ts
|
|
6620
|
+
// Fixed decimals (default behavior)
|
|
6621
|
+
formatPercent(0.5) // '0.5%'
|
|
6622
|
+
formatPercent(0.81, 'en-US', 1) // '0.8%' (loses precision)
|
|
6623
|
+
|
|
6624
|
+
// Preserve decimal places dynamically
|
|
6625
|
+
formatPercent(0.81, 'en-US', { preserveDecimals: true }) // '0.81%'
|
|
6626
|
+
formatPercent(0.8123, 'en-US', { preserveDecimals: true, maxDecimals: 2 }) // '0.81%'
|
|
6627
|
+
```
|
|
6628
|
+
|
|
6608
6629
|
#### Defined in
|
|
6609
6630
|
|
|
6610
|
-
[packages/core/src/utils/formatting.ts:
|
|
6631
|
+
[packages/core/src/utils/formatting.ts:70](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/formatting.ts#L70)
|
|
6611
6632
|
|
|
6612
6633
|
___
|
|
6613
6634
|
|
|
@@ -6630,7 +6651,7 @@ Format a large number with abbreviations (K, M, B)
|
|
|
6630
6651
|
|
|
6631
6652
|
#### Defined in
|
|
6632
6653
|
|
|
6633
|
-
[packages/core/src/utils/formatting.ts:
|
|
6654
|
+
[packages/core/src/utils/formatting.ts:114](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/formatting.ts#L114)
|
|
6634
6655
|
|
|
6635
6656
|
___
|
|
6636
6657
|
|
|
@@ -6652,7 +6673,7 @@ Format a file size in bytes to a human-readable string
|
|
|
6652
6673
|
|
|
6653
6674
|
#### Defined in
|
|
6654
6675
|
|
|
6655
|
-
[packages/core/src/utils/formatting.ts:
|
|
6676
|
+
[packages/core/src/utils/formatting.ts:124](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/formatting.ts#L124)
|
|
6656
6677
|
|
|
6657
6678
|
___
|
|
6658
6679
|
|
|
@@ -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
|