@jmruthers/pace-core 0.5.61 → 0.5.63
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-5M6MV2VY.js → DataTable-7BER7PDS.js} +6 -6
- package/dist/{DataTable-DqDDvBfI.d.ts → DataTable-D15XipLZ.d.ts} +7 -0
- package/dist/{PublicLoadingSpinner-CrMOrhNz.d.ts → PublicLoadingSpinner-CXJ-W9wZ.d.ts} +2 -2
- package/dist/{chunk-44SAHU2N.js → chunk-2LPYEFXI.js} +5 -5
- package/dist/chunk-4BWGRQBG.js +74 -0
- package/dist/chunk-4BWGRQBG.js.map +1 -0
- package/dist/{chunk-XMTHMOOM.js → chunk-BTCA3ENN.js} +4 -4
- package/dist/{chunk-ESXTFEE6.js → chunk-C7GUF747.js} +3 -3
- package/dist/{chunk-W7PPXKTZ.js → chunk-CKNY7HYS.js} +2 -2
- package/dist/{chunk-5MLDIGHB.js → chunk-FVDOEGGG.js} +3 -3
- package/dist/{chunk-HFDYTSAP.js → chunk-QVEOQVD4.js} +3 -3
- package/dist/{chunk-XDXG6QVH.js → chunk-S66AJVI2.js} +13 -6
- package/dist/chunk-S66AJVI2.js.map +1 -0
- package/dist/{chunk-E4FPK232.js → chunk-T2MQY57J.js} +2 -2
- package/dist/{chunk-4ULBJNIT.js → chunk-T6HVDA24.js} +2 -2
- package/dist/{chunk-STT7INZR.js → chunk-ULBI5JGB.js} +2 -1
- package/dist/{chunk-CGSYCF2W.js → chunk-VTJ5HCZB.js} +2 -2
- package/dist/components.d.ts +82 -5
- package/dist/components.js +258 -9
- package/dist/components.js.map +1 -1
- package/dist/{appConfig-DjpeG6P-.d.ts → formatting-BfDeV-ja.d.ts} +29 -1
- package/dist/hooks.d.ts +3 -2
- package/dist/hooks.js +5 -5
- package/dist/index.d.ts +8 -11
- package/dist/index.js +25 -14
- package/dist/index.js.map +1 -1
- package/dist/{organisation-DD0yBbGU.d.ts → organisation-t-vvQC3g.d.ts} +1 -1
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +4 -4
- package/dist/rbac/index.js +6 -6
- package/dist/types.js +1 -1
- package/dist/{usePublicRouteParams-Cu6oKazv.d.ts → usePublicRouteParams-CdoFxnJK.d.ts} +2 -63
- package/dist/useToast-Bm6TnSK-.d.ts +63 -0
- package/dist/utils.d.ts +3 -31
- package/dist/utils.js +8 -41
- package/dist/utils.js.map +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/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 +44 -18
- 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 -26
- package/docs/implementation-guides/data-tables.md +67 -0
- package/package.json +1 -1
- package/src/components/DataTable/DataTable.tsx +13 -0
- package/src/components/DataTable/__tests__/DataTable.default-state.test.tsx +414 -0
- package/src/components/DataTable/components/DataTableCore.tsx +19 -2
- package/src/components/DataTable/types.ts +9 -0
- package/src/components/Dialog/examples/__tests__/SmartDialogExample.unit.test.tsx +151 -0
- package/src/components/Dialog/utils/__tests__/safeHtml.unit.test.ts +611 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.accessibility.test.tsx +287 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.integration.test.tsx +861 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.performance.test.tsx +628 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +777 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.unit.test.tsx +901 -0
- package/src/components/Toast/index.ts +2 -0
- package/src/components/index.ts +15 -0
- package/src/hooks/__tests__/useApiFetch.unit.test.ts +1 -1
- package/src/hooks/useFileReference.ts +37 -0
- package/src/index.ts +10 -0
- package/src/styles/base.css +208 -0
- package/src/styles/semantic.css +24 -0
- package/dist/chunk-W66AZIOH.js +0 -29
- package/dist/chunk-W66AZIOH.js.map +0 -1
- package/dist/chunk-XDXG6QVH.js.map +0 -1
- /package/dist/{DataTable-5M6MV2VY.js.map → DataTable-7BER7PDS.js.map} +0 -0
- /package/dist/{chunk-44SAHU2N.js.map → chunk-2LPYEFXI.js.map} +0 -0
- /package/dist/{chunk-XMTHMOOM.js.map → chunk-BTCA3ENN.js.map} +0 -0
- /package/dist/{chunk-ESXTFEE6.js.map → chunk-C7GUF747.js.map} +0 -0
- /package/dist/{chunk-W7PPXKTZ.js.map → chunk-CKNY7HYS.js.map} +0 -0
- /package/dist/{chunk-5MLDIGHB.js.map → chunk-FVDOEGGG.js.map} +0 -0
- /package/dist/{chunk-HFDYTSAP.js.map → chunk-QVEOQVD4.js.map} +0 -0
- /package/dist/{chunk-E4FPK232.js.map → chunk-T2MQY57J.js.map} +0 -0
- /package/dist/{chunk-4ULBJNIT.js.map → chunk-T6HVDA24.js.map} +0 -0
- /package/dist/{chunk-STT7INZR.js.map → chunk-ULBI5JGB.js.map} +0 -0
- /package/dist/{chunk-CGSYCF2W.js.map → chunk-VTJ5HCZB.js.map} +0 -0
|
@@ -32,11 +32,11 @@ import {
|
|
|
32
32
|
useDataTableContext,
|
|
33
33
|
usePluginRegistry,
|
|
34
34
|
useStateManager
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-S66AJVI2.js";
|
|
36
|
+
import "./chunk-C7GUF747.js";
|
|
37
37
|
import "./chunk-NHR52QAQ.js";
|
|
38
38
|
import "./chunk-B2WTCLCV.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-VTJ5HCZB.js";
|
|
40
40
|
import {
|
|
41
41
|
DataChunkManager,
|
|
42
42
|
SearchIndex,
|
|
@@ -48,8 +48,8 @@ import {
|
|
|
48
48
|
throttle,
|
|
49
49
|
useDataTablePerformance
|
|
50
50
|
} from "./chunk-YNUBMSMV.js";
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-T2MQY57J.js";
|
|
52
|
+
import "./chunk-ULBI5JGB.js";
|
|
53
53
|
import "./chunk-5BSLGBYI.js";
|
|
54
54
|
import "./chunk-D7ARGIA3.js";
|
|
55
55
|
import "./chunk-PLDDJCW6.js";
|
|
@@ -97,4 +97,4 @@ export {
|
|
|
97
97
|
usePluginRegistry,
|
|
98
98
|
useStateManager
|
|
99
99
|
};
|
|
100
|
-
//# sourceMappingURL=DataTable-
|
|
100
|
+
//# sourceMappingURL=DataTable-7BER7PDS.js.map
|
|
@@ -64,6 +64,13 @@ interface DataTableProps<TData extends DataRecord> {
|
|
|
64
64
|
virtualHeight?: number;
|
|
65
65
|
/** Initial page size for pagination */
|
|
66
66
|
initialPageSize?: number;
|
|
67
|
+
/** Initial grouping configuration - columns to group by on load */
|
|
68
|
+
defaultGrouping?: string[];
|
|
69
|
+
/** Initial sorting configuration - sort state to apply on load */
|
|
70
|
+
defaultSorting?: Array<{
|
|
71
|
+
id: string;
|
|
72
|
+
desc: boolean;
|
|
73
|
+
}>;
|
|
67
74
|
/** Enable enhanced pagination controls */
|
|
68
75
|
enhancedPagination?: boolean;
|
|
69
76
|
/** Custom loading component */
|
|
@@ -12,7 +12,7 @@ import { FieldValues, DefaultValues, SubmitHandler, SubmitErrorHandler, UseFormR
|
|
|
12
12
|
import { z } from 'zod';
|
|
13
13
|
import { User, SupabaseClient, createClient } from '@supabase/supabase-js';
|
|
14
14
|
import { r as Event } from './unified-CMPjE_fv.js';
|
|
15
|
-
import {
|
|
15
|
+
import { b as Organisation } from './organisation-t-vvQC3g.js';
|
|
16
16
|
|
|
17
17
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
18
18
|
/** Visual variant of the button */
|
|
@@ -3384,4 +3384,4 @@ declare function PublicLoadingSkeleton({ lines, className }: {
|
|
|
3384
3384
|
className?: string;
|
|
3385
3385
|
}): react_jsx_runtime.JSX.Element;
|
|
3386
3386
|
|
|
3387
|
-
export {
|
|
3387
|
+
export { ToastViewport as $, Alert as A, Button as B, Card as C, Dialog as D, DialogContent as E, type FileSizeLimits as F, DialogHeader as G, DialogBody as H, Input as I, DialogFooter as J, DialogTitle as K, Label as L, DialogDescription as M, Select as N, SelectGroup as O, Progress as P, SelectValue as Q, SelectTrigger as R, type StorageConfig as S, SelectContent as T, SelectLabel as U, SelectItem as V, SelectSeparator as W, Toast as X, Toaster as Y, ToastAction as Z, ToastProvider as _, type StorageUploadOptions as a, type EventLogoProps as a$, ToastTitle as a0, ToastDescription as a1, ToastClose as a2, type ToastActionElement as a3, type ToastProps as a4, Tooltip as a5, TooltipTrigger as a6, TooltipContent as a7, TooltipProvider as a8, TooltipRoot as a9, TableCell as aA, TableFooter as aB, TableHead as aC, TableRow as aD, type StorageFileInfo as aE, PublicPageLayout as aF, usePublicPageContext$1 as aG, PublicPageHeader as aH, PublicPageProvider as aI, usePublicPageContext as aJ, useIsPublicPage as aK, PublicPageFooter as aL, PublicPageDebugger as aM, PublicPageDiagnostic as aN, PublicPageContextChecker as aO, EventLogo as aP, EventLogoCompact as aQ, EventLogoLarge as aR, PublicErrorBoundary as aS, useErrorBoundary as aT, DefaultPublicErrorFallback as aU, PublicLoadingSpinner as aV, PublicLoadingSpinnerFullPage as aW, PublicLoadingSkeleton as aX, type PublicPageLayoutProps as aY, type PublicPageHeaderProps as aZ, type PublicPageFooterProps as a_, Form as aa, LoginForm as ab, type LoginFormProps as ac, Header as ad, Footer as ae, type FooterProps as af, NavigationMenu as ag, type NavigationMenuProps as ah, type NavigationItem as ai, UserMenu as aj, type UserMenuProps as ak, PaceAppLayout as al, type PaceAppLayoutProps as am, PaceLoginPage as an, type PaceLoginPageProps as ao, ErrorBoundary as ap, LoadingSpinner as aq, EventSelector as ar, OrganisationSelector as as, PasswordResetForm as at, useStorage as au, useFileUpload as av, Table as aw, TableHeader as ax, TableBody as ay, TableCaption as az, type StorageFileMetadata as b, type PublicErrorBoundaryProps as b0, type PublicErrorBoundaryState as b1, type PublicLoadingSpinnerProps as b2, type CardActionsProps as b3, type DialogProps as b4, type DialogTriggerProps as b5, type DialogContentProps as b6, type DialogOverlayProps as b7, type DialogHeaderProps as b8, type DialogFooterProps as b9, type DialogTitleProps as ba, type DialogDescriptionProps as bb, type DialogSize as bc, type FormProps as bd, type OrganisationSelectorProps as be, type ErrorBoundaryProps as bf, type ErrorBoundaryState as bg, type UseStorageOptions as bh, type UseStorageReturn as bi, type StorageUploadResult as c, type StorageUrlOptions as d, type StorageListOptions as e, type StorageListResult as f, type ButtonProps as g, CardHeader as h, CardFooter as i, CardTitle as j, CardDescription as k, CardContent as l, CardActions as m, type CardProps as n, type InputProps as o, type LabelProps as p, AlertTitle as q, AlertDescription as r, Avatar as s, AvatarImage as t, AvatarFallback as u, Checkbox as v, DialogPortal as w, DialogOverlay as x, DialogTrigger as y, DialogClose as z };
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
SelectSeparator,
|
|
16
16
|
SelectTrigger,
|
|
17
17
|
SelectValue
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-S66AJVI2.js";
|
|
19
19
|
import {
|
|
20
20
|
isPermitted
|
|
21
21
|
} from "./chunk-NHR52QAQ.js";
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
EventProvider_exports,
|
|
24
24
|
init_EventProvider,
|
|
25
25
|
useEvents
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-VTJ5HCZB.js";
|
|
27
27
|
import {
|
|
28
28
|
PublicErrorBoundary,
|
|
29
29
|
useAppConfig,
|
|
30
30
|
usePublicEventLogo,
|
|
31
31
|
usePublicPageContext,
|
|
32
32
|
useToast
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-T6HVDA24.js";
|
|
34
34
|
import {
|
|
35
35
|
Button,
|
|
36
36
|
Dialog,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
init_UnifiedAuthProvider,
|
|
47
47
|
useOrganisations,
|
|
48
48
|
useUnifiedAuth
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-T2MQY57J.js";
|
|
50
50
|
import {
|
|
51
51
|
LoadingSpinner
|
|
52
52
|
} from "./chunk-CDQ3PX7L.js";
|
|
@@ -3149,4 +3149,4 @@ export {
|
|
|
3149
3149
|
PublicPageDiagnostic,
|
|
3150
3150
|
PublicPageContextChecker
|
|
3151
3151
|
};
|
|
3152
|
-
//# sourceMappingURL=chunk-
|
|
3152
|
+
//# sourceMappingURL=chunk-2LPYEFXI.js.map
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
// src/utils/formatting.ts
|
|
24
|
+
function formatDate(date) {
|
|
25
|
+
const dateObj = typeof date === "string" || typeof date === "number" ? new Date(date) : date;
|
|
26
|
+
return dateObj.toLocaleDateString(void 0, {
|
|
27
|
+
year: "numeric",
|
|
28
|
+
month: "short",
|
|
29
|
+
day: "numeric"
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function formatCurrency(value, currencyCode = "USD", locale = "en-US") {
|
|
33
|
+
return new Intl.NumberFormat(locale, {
|
|
34
|
+
style: "currency",
|
|
35
|
+
currency: currencyCode
|
|
36
|
+
}).format(value);
|
|
37
|
+
}
|
|
38
|
+
function formatNumber(value, options = {}, locale = "en-US") {
|
|
39
|
+
return new Intl.NumberFormat(locale, options).format(value);
|
|
40
|
+
}
|
|
41
|
+
function formatPercent(value, locale = "en-US", decimals = 1) {
|
|
42
|
+
return new Intl.NumberFormat(locale, {
|
|
43
|
+
style: "percent",
|
|
44
|
+
minimumFractionDigits: decimals,
|
|
45
|
+
maximumFractionDigits: decimals
|
|
46
|
+
}).format(value / 100);
|
|
47
|
+
}
|
|
48
|
+
function formatCompactNumber(value, locale = "en-US") {
|
|
49
|
+
return new Intl.NumberFormat(locale, {
|
|
50
|
+
notation: "compact",
|
|
51
|
+
compactDisplay: "short"
|
|
52
|
+
}).format(value);
|
|
53
|
+
}
|
|
54
|
+
function formatFileSize(bytes) {
|
|
55
|
+
if (bytes === 0) return "0 Bytes";
|
|
56
|
+
const k = 1024;
|
|
57
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB"];
|
|
58
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
59
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export {
|
|
63
|
+
setAppConfig,
|
|
64
|
+
getAppConfig,
|
|
65
|
+
getCurrentAppName,
|
|
66
|
+
getCurrentAppId,
|
|
67
|
+
formatDate,
|
|
68
|
+
formatCurrency,
|
|
69
|
+
formatNumber,
|
|
70
|
+
formatPercent,
|
|
71
|
+
formatCompactNumber,
|
|
72
|
+
formatFileSize
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=chunk-4BWGRQBG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/appConfig.ts","../src/utils/formatting.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","/**\n * Utility functions for formatting data in the application\n */\n\n/**\n * Format a date as a readable string\n */\nexport function formatDate(date: Date | string | number): string {\n const dateObj = typeof date === 'string' || typeof date === 'number' \n ? new Date(date) \n : date;\n \n return dateObj.toLocaleDateString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric'\n });\n}\n\n/**\n * Format a number as a currency\n */\nexport function formatCurrency(value: number, currencyCode = 'USD', locale = 'en-US'): string {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: currencyCode,\n }).format(value);\n}\n\n/**\n * Format a number with custom options\n */\nexport function formatNumber(\n value: number,\n options: Intl.NumberFormatOptions = {},\n locale = 'en-US'\n): string {\n return new Intl.NumberFormat(locale, options).format(value);\n}\n\n/**\n * Format a number as a percentage\n */\nexport function formatPercent(\n value: number,\n locale: string = 'en-US',\n decimals: number = 1\n): string {\n return new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n }).format(value / 100);\n}\n\n/**\n * Format a large number with abbreviations (K, M, B)\n */\nexport function formatCompactNumber(value: number, locale = 'en-US'): string {\n return new Intl.NumberFormat(locale, {\n notation: 'compact',\n compactDisplay: 'short'\n }).format(value);\n}\n\n/**\n * Format a file size in bytes to a human-readable string\n */\nexport function formatFileSize(bytes: number): string {\n if (bytes === 0) return '0 Bytes';\n \n const k = 1024;\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n \n return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\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;;;ACvCO,SAAS,WAAW,MAAsC;AAC/D,QAAM,UAAU,OAAO,SAAS,YAAY,OAAO,SAAS,WACxD,IAAI,KAAK,IAAI,IACb;AAEJ,SAAO,QAAQ,mBAAmB,QAAW;AAAA,IAC3C,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,EACP,CAAC;AACH;AAKO,SAAS,eAAe,OAAe,eAAe,OAAO,SAAS,SAAiB;AAC5F,SAAO,IAAI,KAAK,aAAa,QAAQ;AAAA,IACnC,OAAO;AAAA,IACP,UAAU;AAAA,EACZ,CAAC,EAAE,OAAO,KAAK;AACjB;AAKO,SAAS,aACd,OACA,UAAoC,CAAC,GACrC,SAAS,SACD;AACR,SAAO,IAAI,KAAK,aAAa,QAAQ,OAAO,EAAE,OAAO,KAAK;AAC5D;AAKO,SAAS,cACd,OACA,SAAiB,SACjB,WAAmB,GACX;AACR,SAAO,IAAI,KAAK,aAAa,QAAQ;AAAA,IACnC,OAAO;AAAA,IACP,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,EACzB,CAAC,EAAE,OAAO,QAAQ,GAAG;AACvB;AAKO,SAAS,oBAAoB,OAAe,SAAS,SAAiB;AAC3E,SAAO,IAAI,KAAK,aAAa,QAAQ;AAAA,IACnC,UAAU;AAAA,IACV,gBAAgB;AAAA,EAClB,CAAC,EAAE,OAAO,KAAK;AACjB;AAKO,SAAS,eAAe,OAAuB;AACpD,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,IAAI;AACV,QAAM,QAAQ,CAAC,SAAS,MAAM,MAAM,MAAM,MAAM,IAAI;AACpD,QAAM,IAAI,KAAK,MAAM,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,CAAC,CAAC;AAElD,SAAO,YAAY,QAAQ,KAAK,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,MAAM,MAAM,CAAC;AACxE;","names":[]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
useAccessLevel,
|
|
6
6
|
useCan
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-C7GUF747.js";
|
|
8
8
|
import {
|
|
9
9
|
OrganisationContextRequiredError,
|
|
10
10
|
RBACCache,
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
} from "./chunk-NHR52QAQ.js";
|
|
14
14
|
import {
|
|
15
15
|
useSecureDataAccess
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CKNY7HYS.js";
|
|
17
17
|
import {
|
|
18
18
|
init_RBACProvider,
|
|
19
19
|
init_UnifiedAuthProvider,
|
|
20
20
|
useUnifiedAuth
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-T2MQY57J.js";
|
|
22
22
|
import {
|
|
23
23
|
getCurrentAppName,
|
|
24
24
|
init_appNameResolver
|
|
@@ -1826,4 +1826,4 @@ export {
|
|
|
1826
1826
|
getPermissionsForRole,
|
|
1827
1827
|
ALL_PERMISSIONS
|
|
1828
1828
|
};
|
|
1829
|
-
//# sourceMappingURL=chunk-
|
|
1829
|
+
//# sourceMappingURL=chunk-BTCA3ENN.js.map
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
init_EventProvider,
|
|
9
9
|
useEvents
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VTJ5HCZB.js";
|
|
11
11
|
import {
|
|
12
12
|
init_OrganisationProvider,
|
|
13
13
|
init_UnifiedAuthProvider,
|
|
14
14
|
useOrganisations,
|
|
15
15
|
useUnifiedAuth
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-T2MQY57J.js";
|
|
17
17
|
|
|
18
18
|
// src/rbac/hooks/useRBAC.ts
|
|
19
19
|
init_UnifiedAuthProvider();
|
|
@@ -522,4 +522,4 @@ export {
|
|
|
522
522
|
useHasAllPermissions,
|
|
523
523
|
useCachedPermissions
|
|
524
524
|
};
|
|
525
|
-
//# sourceMappingURL=chunk-
|
|
525
|
+
//# sourceMappingURL=chunk-C7GUF747.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
init_UnifiedAuthProvider,
|
|
4
4
|
useOrganisations,
|
|
5
5
|
useUnifiedAuth
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-T2MQY57J.js";
|
|
7
7
|
import {
|
|
8
8
|
init_organisationContext,
|
|
9
9
|
setOrganisationContext
|
|
@@ -380,4 +380,4 @@ function useSecureDataAccess() {
|
|
|
380
380
|
export {
|
|
381
381
|
useSecureDataAccess
|
|
382
382
|
};
|
|
383
|
-
//# sourceMappingURL=chunk-
|
|
383
|
+
//# sourceMappingURL=chunk-CKNY7HYS.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_EventProvider
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VTJ5HCZB.js";
|
|
4
4
|
import {
|
|
5
5
|
init_AuthProvider,
|
|
6
6
|
init_InactivityProvider,
|
|
7
7
|
init_OrganisationProvider,
|
|
8
8
|
init_UnifiedAuthProvider
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-T2MQY57J.js";
|
|
10
10
|
|
|
11
11
|
// src/providers/index.ts
|
|
12
12
|
init_EventProvider();
|
|
@@ -14,4 +14,4 @@ init_OrganisationProvider();
|
|
|
14
14
|
init_UnifiedAuthProvider();
|
|
15
15
|
init_AuthProvider();
|
|
16
16
|
init_InactivityProvider();
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-FVDOEGGG.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePublicPageContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-T6HVDA24.js";
|
|
4
4
|
import {
|
|
5
5
|
init_OrganisationProvider,
|
|
6
6
|
init_UnifiedAuthProvider,
|
|
7
7
|
useOrganisations,
|
|
8
8
|
useUnifiedAuth
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-T2MQY57J.js";
|
|
10
10
|
|
|
11
11
|
// src/hooks/useOrganisationPermissions.ts
|
|
12
12
|
init_OrganisationProvider();
|
|
@@ -526,4 +526,4 @@ export {
|
|
|
526
526
|
generatePublicRoutePath,
|
|
527
527
|
extractEventCodeFromPath
|
|
528
528
|
};
|
|
529
|
-
//# sourceMappingURL=chunk-
|
|
529
|
+
//# sourceMappingURL=chunk-QVEOQVD4.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-C7GUF747.js";
|
|
4
4
|
import {
|
|
5
5
|
useDataTablePerformance
|
|
6
6
|
} from "./chunk-YNUBMSMV.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
init_Button,
|
|
15
15
|
init_UnifiedAuthProvider,
|
|
16
16
|
useUnifiedAuth
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-T2MQY57J.js";
|
|
18
18
|
import {
|
|
19
19
|
getCurrentAppName,
|
|
20
20
|
init_appNameResolver
|
|
@@ -3295,11 +3295,13 @@ function DataTableInternal({
|
|
|
3295
3295
|
aggregates = [],
|
|
3296
3296
|
importModalConfig,
|
|
3297
3297
|
actions = [],
|
|
3298
|
-
columnOrder: externalColumnOrder
|
|
3298
|
+
columnOrder: externalColumnOrder,
|
|
3299
|
+
defaultGrouping,
|
|
3300
|
+
defaultSorting
|
|
3299
3301
|
}) {
|
|
3300
3302
|
const authResult = useUnifiedAuth();
|
|
3301
3303
|
const user = authResult.user;
|
|
3302
|
-
const [sorting, setSorting] = useState6([]);
|
|
3304
|
+
const [sorting, setSorting] = useState6(defaultSorting || []);
|
|
3303
3305
|
const [columnFilters, setColumnFilters] = useState6([]);
|
|
3304
3306
|
const [columnVisibility, setColumnVisibility] = useState6({});
|
|
3305
3307
|
const [internalRowSelection, setInternalRowSelection] = useState6({});
|
|
@@ -3316,7 +3318,7 @@ function DataTableInternal({
|
|
|
3316
3318
|
}
|
|
3317
3319
|
return columnOrder;
|
|
3318
3320
|
}, [columnOrder, features.selection]);
|
|
3319
|
-
const [grouping, setGrouping] = useState6([]);
|
|
3321
|
+
const [grouping, setGrouping] = useState6(defaultGrouping || []);
|
|
3320
3322
|
const [expanded, setExpanded] = useState6({});
|
|
3321
3323
|
const [pagination, setPagination] = useState6({
|
|
3322
3324
|
pageIndex: 0,
|
|
@@ -3333,6 +3335,11 @@ function DataTableInternal({
|
|
|
3333
3335
|
const editingRowId = tableState.editingRowId;
|
|
3334
3336
|
const editingData = tableState.editingData;
|
|
3335
3337
|
const [showImportModal, setShowImportModal] = useState6(false);
|
|
3338
|
+
useEffect5(() => {
|
|
3339
|
+
if (defaultGrouping && defaultGrouping.length > 0 && Object.keys(expanded).length === 0) {
|
|
3340
|
+
setExpanded(true);
|
|
3341
|
+
}
|
|
3342
|
+
}, [defaultGrouping, expanded]);
|
|
3336
3343
|
const [showFilterRow, setShowFilterRow] = useState6(false);
|
|
3337
3344
|
const performanceHook = useDataTablePerformance({
|
|
3338
3345
|
data,
|
|
@@ -5584,4 +5591,4 @@ export {
|
|
|
5584
5591
|
GroupHeader,
|
|
5585
5592
|
EditableRow
|
|
5586
5593
|
};
|
|
5587
|
-
//# sourceMappingURL=chunk-
|
|
5594
|
+
//# sourceMappingURL=chunk-S66AJVI2.js.map
|