@jmruthers/pace-core 0.5.62 → 0.5.64
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/chunk-4BWGRQBG.js +74 -0
- package/dist/chunk-4BWGRQBG.js.map +1 -0
- package/dist/{appConfig-DjpeG6P-.d.ts → formatting-BfDeV-ja.d.ts} +29 -1
- package/dist/index.d.ts +90 -8
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts +2 -30
- package/dist/utils.js +7 -40
- package/dist/utils.js.map +1 -1
- package/docs/api/classes/ColumnFactory.md +243 -0
- 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/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 +148 -25
- package/package.json +1 -1
- package/src/components/Dialog/examples/__tests__/SmartDialogExample.unit.test.tsx +1 -1
- package/src/hooks/__tests__/useApiFetch.unit.test.ts +1 -1
- package/src/index.ts +12 -1
- package/dist/chunk-W66AZIOH.js +0 -29
- package/dist/chunk-W66AZIOH.js.map +0 -1
package/docs/api/modules.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
[@jmruthers/pace-core - v0.5.
|
|
1
|
+
[@jmruthers/pace-core - v0.5.64](README.md) / Exports
|
|
2
2
|
|
|
3
|
-
# @jmruthers/pace-core - v0.5.
|
|
3
|
+
# @jmruthers/pace-core - v0.5.64
|
|
4
4
|
|
|
5
5
|
**`File`**
|
|
6
6
|
|
|
@@ -31,6 +31,7 @@ import { Dialog, NavigationMenu } from '@jmruthers/pace-core/components';
|
|
|
31
31
|
|
|
32
32
|
### Classes
|
|
33
33
|
|
|
34
|
+
- [ColumnFactory](classes/ColumnFactory.md)
|
|
34
35
|
- [ErrorBoundary](classes/ErrorBoundary.md)
|
|
35
36
|
- [PublicErrorBoundary](classes/PublicErrorBoundary.md)
|
|
36
37
|
- [RBACAuditManager](classes/RBACAuditManager.md)
|
|
@@ -342,10 +343,15 @@ import { Dialog, NavigationMenu } from '@jmruthers/pace-core/components';
|
|
|
342
343
|
- [getCurrentAppName](modules.md#getcurrentappname)
|
|
343
344
|
- [getCurrentAppId](modules.md#getcurrentappid)
|
|
344
345
|
- [cn](modules.md#cn)
|
|
346
|
+
- [formatDate](modules.md#formatdate)
|
|
347
|
+
- [formatCurrency](modules.md#formatcurrency)
|
|
348
|
+
- [formatNumber](modules.md#formatnumber)
|
|
349
|
+
- [formatPercent](modules.md#formatpercent)
|
|
350
|
+
- [formatCompactNumber](modules.md#formatcompactnumber)
|
|
351
|
+
- [formatFileSize](modules.md#formatfilesize)
|
|
345
352
|
- [createSecureDataAccess](modules.md#createsecuredataaccess)
|
|
346
353
|
- [getFileSizeLimit](modules.md#getfilesizelimit)
|
|
347
354
|
- [validateFileSize](modules.md#validatefilesize)
|
|
348
|
-
- [formatFileSize](modules.md#formatfilesize)
|
|
349
355
|
- [generateFilePath](modules.md#generatefilepath)
|
|
350
356
|
- [generateUniqueFileName](modules.md#generateuniquefilename)
|
|
351
357
|
- [extractFileMetadata](modules.md#extractfilemetadata)
|
|
@@ -6075,6 +6081,145 @@ ___
|
|
|
6075
6081
|
|
|
6076
6082
|
___
|
|
6077
6083
|
|
|
6084
|
+
### formatDate
|
|
6085
|
+
|
|
6086
|
+
▸ **formatDate**(`date`): `string`
|
|
6087
|
+
|
|
6088
|
+
Format a date as a readable string
|
|
6089
|
+
|
|
6090
|
+
#### Parameters
|
|
6091
|
+
|
|
6092
|
+
| Name | Type |
|
|
6093
|
+
| :------ | :------ |
|
|
6094
|
+
| `date` | `string` \| `number` \| `Date` |
|
|
6095
|
+
|
|
6096
|
+
#### Returns
|
|
6097
|
+
|
|
6098
|
+
`string`
|
|
6099
|
+
|
|
6100
|
+
#### Defined in
|
|
6101
|
+
|
|
6102
|
+
[packages/core/src/utils/formatting.ts:8](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/formatting.ts#L8)
|
|
6103
|
+
|
|
6104
|
+
___
|
|
6105
|
+
|
|
6106
|
+
### formatCurrency
|
|
6107
|
+
|
|
6108
|
+
▸ **formatCurrency**(`value`, `currencyCode?`, `locale?`): `string`
|
|
6109
|
+
|
|
6110
|
+
Format a number as a currency
|
|
6111
|
+
|
|
6112
|
+
#### Parameters
|
|
6113
|
+
|
|
6114
|
+
| Name | Type | Default value |
|
|
6115
|
+
| :------ | :------ | :------ |
|
|
6116
|
+
| `value` | `number` | `undefined` |
|
|
6117
|
+
| `currencyCode` | `string` | `'USD'` |
|
|
6118
|
+
| `locale` | `string` | `'en-US'` |
|
|
6119
|
+
|
|
6120
|
+
#### Returns
|
|
6121
|
+
|
|
6122
|
+
`string`
|
|
6123
|
+
|
|
6124
|
+
#### Defined in
|
|
6125
|
+
|
|
6126
|
+
[packages/core/src/utils/formatting.ts:23](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/formatting.ts#L23)
|
|
6127
|
+
|
|
6128
|
+
___
|
|
6129
|
+
|
|
6130
|
+
### formatNumber
|
|
6131
|
+
|
|
6132
|
+
▸ **formatNumber**(`value`, `options?`, `locale?`): `string`
|
|
6133
|
+
|
|
6134
|
+
Format a number with custom options
|
|
6135
|
+
|
|
6136
|
+
#### Parameters
|
|
6137
|
+
|
|
6138
|
+
| Name | Type | Default value |
|
|
6139
|
+
| :------ | :------ | :------ |
|
|
6140
|
+
| `value` | `number` | `undefined` |
|
|
6141
|
+
| `options` | `NumberFormatOptions` | `{}` |
|
|
6142
|
+
| `locale` | `string` | `'en-US'` |
|
|
6143
|
+
|
|
6144
|
+
#### Returns
|
|
6145
|
+
|
|
6146
|
+
`string`
|
|
6147
|
+
|
|
6148
|
+
#### Defined in
|
|
6149
|
+
|
|
6150
|
+
[packages/core/src/utils/formatting.ts:33](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/formatting.ts#L33)
|
|
6151
|
+
|
|
6152
|
+
___
|
|
6153
|
+
|
|
6154
|
+
### formatPercent
|
|
6155
|
+
|
|
6156
|
+
▸ **formatPercent**(`value`, `locale?`, `decimals?`): `string`
|
|
6157
|
+
|
|
6158
|
+
Format a number as a percentage
|
|
6159
|
+
|
|
6160
|
+
#### Parameters
|
|
6161
|
+
|
|
6162
|
+
| Name | Type | Default value |
|
|
6163
|
+
| :------ | :------ | :------ |
|
|
6164
|
+
| `value` | `number` | `undefined` |
|
|
6165
|
+
| `locale` | `string` | `'en-US'` |
|
|
6166
|
+
| `decimals` | `number` | `1` |
|
|
6167
|
+
|
|
6168
|
+
#### Returns
|
|
6169
|
+
|
|
6170
|
+
`string`
|
|
6171
|
+
|
|
6172
|
+
#### Defined in
|
|
6173
|
+
|
|
6174
|
+
[packages/core/src/utils/formatting.ts:44](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/formatting.ts#L44)
|
|
6175
|
+
|
|
6176
|
+
___
|
|
6177
|
+
|
|
6178
|
+
### formatCompactNumber
|
|
6179
|
+
|
|
6180
|
+
▸ **formatCompactNumber**(`value`, `locale?`): `string`
|
|
6181
|
+
|
|
6182
|
+
Format a large number with abbreviations (K, M, B)
|
|
6183
|
+
|
|
6184
|
+
#### Parameters
|
|
6185
|
+
|
|
6186
|
+
| Name | Type | Default value |
|
|
6187
|
+
| :------ | :------ | :------ |
|
|
6188
|
+
| `value` | `number` | `undefined` |
|
|
6189
|
+
| `locale` | `string` | `'en-US'` |
|
|
6190
|
+
|
|
6191
|
+
#### Returns
|
|
6192
|
+
|
|
6193
|
+
`string`
|
|
6194
|
+
|
|
6195
|
+
#### Defined in
|
|
6196
|
+
|
|
6197
|
+
[packages/core/src/utils/formatting.ts:59](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/formatting.ts#L59)
|
|
6198
|
+
|
|
6199
|
+
___
|
|
6200
|
+
|
|
6201
|
+
### formatFileSize
|
|
6202
|
+
|
|
6203
|
+
▸ **formatFileSize**(`bytes`): `string`
|
|
6204
|
+
|
|
6205
|
+
Format a file size in bytes to a human-readable string
|
|
6206
|
+
|
|
6207
|
+
#### Parameters
|
|
6208
|
+
|
|
6209
|
+
| Name | Type |
|
|
6210
|
+
| :------ | :------ |
|
|
6211
|
+
| `bytes` | `number` |
|
|
6212
|
+
|
|
6213
|
+
#### Returns
|
|
6214
|
+
|
|
6215
|
+
`string`
|
|
6216
|
+
|
|
6217
|
+
#### Defined in
|
|
6218
|
+
|
|
6219
|
+
[packages/core/src/utils/formatting.ts:69](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/formatting.ts#L69)
|
|
6220
|
+
|
|
6221
|
+
___
|
|
6222
|
+
|
|
6078
6223
|
### createSecureDataAccess
|
|
6079
6224
|
|
|
6080
6225
|
▸ **createSecureDataAccess**(`supabase`, `organisationId`, `isSuperAdmin?`): `SecureDataAccess`
|
|
@@ -6150,28 +6295,6 @@ Validate file size against limits
|
|
|
6150
6295
|
|
|
6151
6296
|
___
|
|
6152
6297
|
|
|
6153
|
-
### formatFileSize
|
|
6154
|
-
|
|
6155
|
-
▸ **formatFileSize**(`bytes`): `string`
|
|
6156
|
-
|
|
6157
|
-
Get human-readable file size
|
|
6158
|
-
|
|
6159
|
-
#### Parameters
|
|
6160
|
-
|
|
6161
|
-
| Name | Type |
|
|
6162
|
-
| :------ | :------ |
|
|
6163
|
-
| `bytes` | `number` |
|
|
6164
|
-
|
|
6165
|
-
#### Returns
|
|
6166
|
-
|
|
6167
|
-
`string`
|
|
6168
|
-
|
|
6169
|
-
#### Defined in
|
|
6170
|
-
|
|
6171
|
-
[packages/core/src/utils/storage/config.ts:88](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/storage/config.ts#L88)
|
|
6172
|
-
|
|
6173
|
-
___
|
|
6174
|
-
|
|
6175
6298
|
### generateFilePath
|
|
6176
6299
|
|
|
6177
6300
|
▸ **generateFilePath**(`options`, `fileName`): `string`
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import { screen, waitFor } from '@testing-library/react';
|
|
|
10
10
|
import userEvent from '@testing-library/user-event';
|
|
11
11
|
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
12
12
|
import '@testing-library/jest-dom';
|
|
13
|
-
import { renderWithProviders } from '../../../../__tests__/
|
|
13
|
+
import { renderWithProviders } from '../../../../__tests__/helpers/test-utils';
|
|
14
14
|
import { SmartDialogExample } from '../SmartDialogExample';
|
|
15
15
|
|
|
16
16
|
// Note: We test the actual component without mocking to ensure real behavior works
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { renderHook, waitFor } from '@testing-library/react';
|
|
4
4
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
5
|
-
import { renderWithProviders
|
|
5
|
+
import { renderWithProviders } from '../../__tests__/helpers/test-utils';
|
|
6
6
|
|
|
7
7
|
// Mock fetch globally for all tests
|
|
8
8
|
const mockFetch = vi.fn();
|
package/src/index.ts
CHANGED
|
@@ -120,7 +120,8 @@ export {
|
|
|
120
120
|
type DataTableToolbarButton,
|
|
121
121
|
type AggregateConfig,
|
|
122
122
|
type EmptyStateConfig,
|
|
123
|
-
type GetRowId
|
|
123
|
+
type GetRowId,
|
|
124
|
+
ColumnFactory
|
|
124
125
|
} from './components/DataTable';
|
|
125
126
|
|
|
126
127
|
// Re-export types from DataTable types
|
|
@@ -173,6 +174,16 @@ export { useAppConfig } from './hooks/useAppConfig';
|
|
|
173
174
|
export { cn } from './utils/cn';
|
|
174
175
|
export { setAppConfig, getAppConfig, getCurrentAppName, getCurrentAppId } from './utils/appConfig';
|
|
175
176
|
|
|
177
|
+
// FORMATTING UTILITIES
|
|
178
|
+
export {
|
|
179
|
+
formatDate,
|
|
180
|
+
formatCurrency,
|
|
181
|
+
formatNumber,
|
|
182
|
+
formatPercent,
|
|
183
|
+
formatCompactNumber,
|
|
184
|
+
formatFileSize
|
|
185
|
+
} from './utils/formatting';
|
|
186
|
+
|
|
176
187
|
// STORAGE UTILITIES
|
|
177
188
|
export { FileUpload } from './components/FileUpload/FileUpload';
|
|
178
189
|
export type { FileUploadProps } from './components/FileUpload/FileUpload';
|
package/dist/chunk-W66AZIOH.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// src/utils/appConfig.ts
|
|
2
|
-
var currentAppConfig = null;
|
|
3
|
-
function setAppConfig(config) {
|
|
4
|
-
currentAppConfig = config;
|
|
5
|
-
}
|
|
6
|
-
function getAppConfig() {
|
|
7
|
-
if (!currentAppConfig) {
|
|
8
|
-
const appName = import.meta.env.REACT_APP_NAME || "PACE";
|
|
9
|
-
return {
|
|
10
|
-
appName,
|
|
11
|
-
appId: appName
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
return currentAppConfig;
|
|
15
|
-
}
|
|
16
|
-
function getCurrentAppName() {
|
|
17
|
-
return getAppConfig().appName;
|
|
18
|
-
}
|
|
19
|
-
function getCurrentAppId() {
|
|
20
|
-
return getAppConfig().appId;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
setAppConfig,
|
|
25
|
-
getAppConfig,
|
|
26
|
-
getCurrentAppName,
|
|
27
|
-
getCurrentAppId
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=chunk-W66AZIOH.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/appConfig.ts"],"sourcesContent":["\n/**\n * Application configuration utilities\n */\n\nexport interface AppConfig {\n appName: string;\n appId: string;\n}\n\nlet currentAppConfig: AppConfig | null = null;\n\n/**\n * Set the current application configuration\n */\nexport function setAppConfig(config: AppConfig) {\n currentAppConfig = config;\n}\n\n/**\n * Get the current application configuration\n */\nexport function getAppConfig(): AppConfig {\n if (!currentAppConfig) {\n // Fallback to environment or default\n const appName = import.meta.env.REACT_APP_NAME || 'PACE';\n return {\n appName,\n appId: appName\n };\n }\n return currentAppConfig;\n}\n\n/**\n * Get the current app name\n */\nexport function getCurrentAppName(): string {\n return getAppConfig().appName;\n}\n\n/**\n * Get the current app ID\n */\nexport function getCurrentAppId(): string {\n return getAppConfig().appId;\n}\n"],"mappings":";AAUA,IAAI,mBAAqC;AAKlC,SAAS,aAAa,QAAmB;AAC9C,qBAAmB;AACrB;AAKO,SAAS,eAA0B;AACxC,MAAI,CAAC,kBAAkB;AAErB,UAAM,UAAU,YAAY,IAAI,kBAAkB;AAClD,WAAO;AAAA,MACL;AAAA,MACA,OAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAKO,SAAS,oBAA4B;AAC1C,SAAO,aAAa,EAAE;AACxB;AAKO,SAAS,kBAA0B;AACxC,SAAO,aAAa,EAAE;AACxB;","names":[]}
|