@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
|
@@ -38,7 +38,27 @@ function formatCurrency(value, currencyCode = "USD", locale = "en-US") {
|
|
|
38
38
|
function formatNumber(value, options = {}, locale = "en-US") {
|
|
39
39
|
return new Intl.NumberFormat(locale, options).format(value);
|
|
40
40
|
}
|
|
41
|
-
function formatPercent(value, locale = "en-US",
|
|
41
|
+
function formatPercent(value, locale = "en-US", decimalsOrOptions) {
|
|
42
|
+
let decimals;
|
|
43
|
+
if (typeof decimalsOrOptions === "number") {
|
|
44
|
+
decimals = decimalsOrOptions;
|
|
45
|
+
} else if (decimalsOrOptions && typeof decimalsOrOptions === "object") {
|
|
46
|
+
if (decimalsOrOptions.preserveDecimals) {
|
|
47
|
+
const valueStr = value.toString();
|
|
48
|
+
const decimalIndex = valueStr.indexOf(".");
|
|
49
|
+
if (decimalIndex !== -1) {
|
|
50
|
+
const detectedDecimals = valueStr.length - decimalIndex - 1;
|
|
51
|
+
const maxDecimals = decimalsOrOptions.maxDecimals ?? 10;
|
|
52
|
+
decimals = Math.min(detectedDecimals, maxDecimals);
|
|
53
|
+
} else {
|
|
54
|
+
decimals = 0;
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
decimals = decimalsOrOptions.decimals ?? 1;
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
decimals = 1;
|
|
61
|
+
}
|
|
42
62
|
return new Intl.NumberFormat(locale, {
|
|
43
63
|
style: "percent",
|
|
44
64
|
minimumFractionDigits: decimals,
|
|
@@ -71,4 +91,4 @@ export {
|
|
|
71
91
|
formatCompactNumber,
|
|
72
92
|
formatFileSize
|
|
73
93
|
};
|
|
74
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-NFPV7MRN.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 * \n * The third parameter can be either:\n * - A number for fixed decimal places (backward compatible): `formatPercent(0.81, 'en-US', 2)`\n * - An options object with:\n * - `decimals`: Fixed number of decimal places (default: 1)\n * - `preserveDecimals`: Auto-detect and preserve decimal places from the input value\n * - `maxDecimals`: Maximum decimal places when preserving (default: 10)\n * \n * @param value - The percentage value as a decimal (e.g., 0.81 for 0.81%)\n * @param locale - The locale string (default: 'en-US')\n * @param decimalsOrOptions - Either a number for fixed decimals, or an options object with:\n * - `decimals` - Fixed number of decimal places (default: 1)\n * - `preserveDecimals` - Auto-detect and preserve decimal places from the input value\n * - `maxDecimals` - Maximum decimal places when preserving (default: 10)\n * @returns Formatted percentage string (e.g., \"0.81%\", \"81%\")\n * \n * @example\n * ```ts\n * // Fixed decimals (default behavior)\n * formatPercent(0.5) // '0.5%'\n * formatPercent(0.81, 'en-US', 1) // '0.8%' (loses precision)\n * \n * // Preserve decimal places dynamically\n * formatPercent(0.81, 'en-US', { preserveDecimals: true }) // '0.81%'\n * formatPercent(0.8123, 'en-US', { preserveDecimals: true, maxDecimals: 2 }) // '0.81%'\n * ```\n */\nexport function formatPercent(\n value: number,\n locale: string = 'en-US',\n decimalsOrOptions?: number | {\n decimals?: number;\n preserveDecimals?: boolean;\n maxDecimals?: number;\n }\n): string {\n let decimals: number;\n\n // Backward compatibility: if decimalsOrOptions is a number, use it directly\n if (typeof decimalsOrOptions === 'number') {\n decimals = decimalsOrOptions;\n } else if (decimalsOrOptions && typeof decimalsOrOptions === 'object') {\n // New options object: check if we should preserve decimals\n if (decimalsOrOptions.preserveDecimals) {\n const valueStr = value.toString();\n const decimalIndex = valueStr.indexOf('.');\n \n if (decimalIndex !== -1) {\n const detectedDecimals = valueStr.length - decimalIndex - 1;\n const maxDecimals = decimalsOrOptions.maxDecimals ?? 10;\n decimals = Math.min(detectedDecimals, maxDecimals);\n } else {\n decimals = 0;\n }\n } else {\n decimals = decimalsOrOptions.decimals ?? 1;\n }\n } else {\n decimals = 1;\n }\n\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;AA+BO,SAAS,cACd,OACA,SAAiB,SACjB,mBAKQ;AACR,MAAI;AAGJ,MAAI,OAAO,sBAAsB,UAAU;AACzC,eAAW;AAAA,EACb,WAAW,qBAAqB,OAAO,sBAAsB,UAAU;AAErE,QAAI,kBAAkB,kBAAkB;AACtC,YAAM,WAAW,MAAM,SAAS;AAChC,YAAM,eAAe,SAAS,QAAQ,GAAG;AAEzC,UAAI,iBAAiB,IAAI;AACvB,cAAM,mBAAmB,SAAS,SAAS,eAAe;AAC1D,cAAM,cAAc,kBAAkB,eAAe;AACrD,mBAAW,KAAK,IAAI,kBAAkB,WAAW;AAAA,MACnD,OAAO;AACL,mBAAW;AAAA,MACb;AAAA,IACF,OAAO;AACL,iBAAW,kBAAkB,YAAY;AAAA,IAC3C;AAAA,EACF,OAAO;AACL,eAAW;AAAA,EACb;AAEA,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":[]}
|
package/dist/components.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { a as UnifiedAuthContextType, c as UnifiedAuthProvider, b as UnifiedAuthProviderProps, u as useUnifiedAuth } from './UnifiedAuthProvider-BVKmQd9u.js';
|
|
2
|
-
export { A as Alert, m as AlertDescription, l as AlertTitle, n as Avatar, p as AvatarFallback, o as AvatarImage, B as Button, a as ButtonProps, C as Card, g as CardActions, i as CardActionsProps, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, q as Checkbox, b3 as DefaultPublicErrorFallback, D as Dialog, K as DialogBody, G as DialogClose, H as DialogContent, U as DialogContentProps, O as DialogDescription, Z as DialogDescriptionProps, M as DialogFooter, X as DialogFooterProps, J as DialogHeader, W as DialogHeaderProps, E as DialogOverlay, V as DialogOverlayProps, z as DialogPortal, Q as DialogProps, _ as DialogSize, N as DialogTitle, Y as DialogTitleProps, F as DialogTrigger, R as DialogTriggerProps, aB as ErrorBoundary, aC as ErrorBoundaryProps, aD as ErrorBoundaryState, aG as EventSelector, aK as FileDisplay, aL as FileDisplayProps, aI as FileUpload, aJ as FileUploadProps, ar as Footer, as as FooterProps, am as Form, an as FormProps, aq as Header, I as Input, j as InputProps, L as Label, k as LabelProps, aE as LoadingSpinner, ao as LoginForm, ap as LoginFormProps, ax as NavigationItem, av as NavigationMenu, aw as NavigationMenuProps, ay as OrganisationSelector, az as OrganisationSelectorProps, be as PaceAppLayout, bd as PaceAppLayoutProps, bg as PaceLoginPage, bf as PaceLoginPageProps, aH as PasswordResetForm, P as Progress, at as ProtectedRoute, au as ProtectedRouteProps, b1 as PublicErrorBoundary, ba as PublicErrorBoundaryProps, bb as PublicErrorBoundaryState, b6 as PublicLoadingSkeleton, b4 as PublicLoadingSpinner, b5 as PublicLoadingSpinnerFullPage, bc as PublicLoadingSpinnerProps, b0 as PublicPageContextChecker, a_ as PublicPageDebugger, a$ as PublicPageDiagnostic, aZ as PublicPageFooter, b9 as PublicPageFooterProps, aV as PublicPageHeader, b8 as PublicPageHeaderProps, aT as PublicPageLayout, b7 as PublicPageLayoutProps, aW as PublicPageProvider, $ as Select, a3 as SelectContent, a0 as SelectGroup, a5 as SelectItem, a4 as SelectLabel, a6 as SelectSeparator, a2 as SelectTrigger, a1 as SelectValue, aF as SessionRestorationLoader, S as Switch, r as SwitchProps, T as Table, t as TableBody, u as TableCaption, v as TableCell, w as TableFooter, x as TableHead, s as TableHeader, y as TableRow, a7 as Toast, a9 as ToastAction, af as ToastActionElement, ae as ToastClose, ad as ToastDescription, ag as ToastProps, aa as ToastProvider, ac as ToastTitle, ab as ToastViewport, a8 as Toaster, ah as Tooltip, aj as TooltipContent, ak as TooltipProvider, al as TooltipRoot, ai as TooltipTrigger, aS as UseFileReferenceForRecordReturn, aQ as UseFileReferenceOptions, aR as UseFileReferenceReturn, aA as UserMenu, b2 as useErrorBoundary, aM as useFileReference, aO as useFileReferenceById, aN as useFileReferenceForRecord, aP as useFilesByCategory, aY as useIsPublicPage, aU as usePublicPageContext, aX as usePublicPageProviderContext } from './PublicLoadingSpinner-
|
|
3
|
-
export { u as useToast } from './useToast-
|
|
4
|
-
export { D as DataTable, a as DataTableProps } from './DataTable-
|
|
5
|
-
export { A as AggregateConfig, D as DataRecord, f as DataTableAction, a as DataTableColumn, g as DataTableToolbarButton, E as EmptyStateConfig, G as GetRowId } from './types-
|
|
2
|
+
export { A as Alert, m as AlertDescription, l as AlertTitle, n as Avatar, p as AvatarFallback, o as AvatarImage, B as Button, a as ButtonProps, C as Card, g as CardActions, i as CardActionsProps, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, q as Checkbox, b3 as DefaultPublicErrorFallback, D as Dialog, K as DialogBody, G as DialogClose, H as DialogContent, U as DialogContentProps, O as DialogDescription, Z as DialogDescriptionProps, M as DialogFooter, X as DialogFooterProps, J as DialogHeader, W as DialogHeaderProps, E as DialogOverlay, V as DialogOverlayProps, z as DialogPortal, Q as DialogProps, _ as DialogSize, N as DialogTitle, Y as DialogTitleProps, F as DialogTrigger, R as DialogTriggerProps, aB as ErrorBoundary, aC as ErrorBoundaryProps, aD as ErrorBoundaryState, aG as EventSelector, aK as FileDisplay, aL as FileDisplayProps, aI as FileUpload, aJ as FileUploadProps, ar as Footer, as as FooterProps, am as Form, an as FormProps, aq as Header, I as Input, j as InputProps, L as Label, k as LabelProps, aE as LoadingSpinner, ao as LoginForm, ap as LoginFormProps, ax as NavigationItem, av as NavigationMenu, aw as NavigationMenuProps, ay as OrganisationSelector, az as OrganisationSelectorProps, be as PaceAppLayout, bd as PaceAppLayoutProps, bg as PaceLoginPage, bf as PaceLoginPageProps, aH as PasswordResetForm, P as Progress, at as ProtectedRoute, au as ProtectedRouteProps, b1 as PublicErrorBoundary, ba as PublicErrorBoundaryProps, bb as PublicErrorBoundaryState, b6 as PublicLoadingSkeleton, b4 as PublicLoadingSpinner, b5 as PublicLoadingSpinnerFullPage, bc as PublicLoadingSpinnerProps, b0 as PublicPageContextChecker, a_ as PublicPageDebugger, a$ as PublicPageDiagnostic, aZ as PublicPageFooter, b9 as PublicPageFooterProps, aV as PublicPageHeader, b8 as PublicPageHeaderProps, aT as PublicPageLayout, b7 as PublicPageLayoutProps, aW as PublicPageProvider, $ as Select, a3 as SelectContent, a0 as SelectGroup, a5 as SelectItem, a4 as SelectLabel, a6 as SelectSeparator, a2 as SelectTrigger, a1 as SelectValue, aF as SessionRestorationLoader, S as Switch, r as SwitchProps, T as Table, t as TableBody, u as TableCaption, v as TableCell, w as TableFooter, x as TableHead, s as TableHeader, y as TableRow, a7 as Toast, a9 as ToastAction, af as ToastActionElement, ae as ToastClose, ad as ToastDescription, ag as ToastProps, aa as ToastProvider, ac as ToastTitle, ab as ToastViewport, a8 as Toaster, ah as Tooltip, aj as TooltipContent, ak as TooltipProvider, al as TooltipRoot, ai as TooltipTrigger, aS as UseFileReferenceForRecordReturn, aQ as UseFileReferenceOptions, aR as UseFileReferenceReturn, aA as UserMenu, b2 as useErrorBoundary, aM as useFileReference, aO as useFileReferenceById, aN as useFileReferenceForRecord, aP as useFilesByCategory, aY as useIsPublicPage, aU as usePublicPageContext, aX as usePublicPageProviderContext } from './PublicLoadingSpinner-DgDWTFqn.js';
|
|
3
|
+
export { u as useToast } from './useToast-DRah6K-g.js';
|
|
4
|
+
export { D as DataTable, a as DataTableProps } from './DataTable-D5cBRca8.js';
|
|
5
|
+
export { A as AggregateConfig, D as DataRecord, f as DataTableAction, a as DataTableColumn, g as DataTableToolbarButton, E as EmptyStateConfig, G as GetRowId } from './types-D4TVpDa1.js';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import React__default from 'react';
|
|
8
8
|
import { FieldValues, FieldPath, UseFormReturn } from 'react-hook-form';
|
package/dist/components.js
CHANGED
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
useFileReferenceForRecord,
|
|
52
52
|
useFilesByCategory,
|
|
53
53
|
usePublicPageContext as usePublicPageContext2
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-B3QX32P5.js";
|
|
55
55
|
import {
|
|
56
56
|
Alert,
|
|
57
57
|
AlertDescription,
|
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
TooltipProvider,
|
|
92
92
|
TooltipRoot,
|
|
93
93
|
TooltipTrigger
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-IMZGJ2X7.js";
|
|
95
95
|
import "./chunk-QDDUU625.js";
|
|
96
96
|
import "./chunk-S63MFSY6.js";
|
|
97
97
|
import "./chunk-Q7APDV6H.js";
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
} from "./chunk-DMNMZKWS.js";
|
|
106
106
|
import {
|
|
107
107
|
useToast
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-4OX5PXHX.js";
|
|
109
109
|
import "./chunk-ZXY5NTJB.js";
|
|
110
110
|
import {
|
|
111
111
|
init_UnifiedAuthProvider
|
|
@@ -92,9 +92,39 @@ declare function formatCurrency(value: number, currencyCode?: string, locale?: s
|
|
|
92
92
|
*/
|
|
93
93
|
declare function formatNumber(value: number, options?: Intl.NumberFormatOptions, locale?: string): string;
|
|
94
94
|
/**
|
|
95
|
-
* Format a number as a percentage
|
|
95
|
+
* Format a number as a percentage.
|
|
96
|
+
*
|
|
97
|
+
* The third parameter can be either:
|
|
98
|
+
* - A number for fixed decimal places (backward compatible): `formatPercent(0.81, 'en-US', 2)`
|
|
99
|
+
* - An options object with:
|
|
100
|
+
* - `decimals`: Fixed number of decimal places (default: 1)
|
|
101
|
+
* - `preserveDecimals`: Auto-detect and preserve decimal places from the input value
|
|
102
|
+
* - `maxDecimals`: Maximum decimal places when preserving (default: 10)
|
|
103
|
+
*
|
|
104
|
+
* @param value - The percentage value as a decimal (e.g., 0.81 for 0.81%)
|
|
105
|
+
* @param locale - The locale string (default: 'en-US')
|
|
106
|
+
* @param decimalsOrOptions - Either a number for fixed decimals, or an options object with:
|
|
107
|
+
* - `decimals` - Fixed number of decimal places (default: 1)
|
|
108
|
+
* - `preserveDecimals` - Auto-detect and preserve decimal places from the input value
|
|
109
|
+
* - `maxDecimals` - Maximum decimal places when preserving (default: 10)
|
|
110
|
+
* @returns Formatted percentage string (e.g., "0.81%", "81%")
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* // Fixed decimals (default behavior)
|
|
115
|
+
* formatPercent(0.5) // '0.5%'
|
|
116
|
+
* formatPercent(0.81, 'en-US', 1) // '0.8%' (loses precision)
|
|
117
|
+
*
|
|
118
|
+
* // Preserve decimal places dynamically
|
|
119
|
+
* formatPercent(0.81, 'en-US', { preserveDecimals: true }) // '0.81%'
|
|
120
|
+
* formatPercent(0.8123, 'en-US', { preserveDecimals: true, maxDecimals: 2 }) // '0.81%'
|
|
121
|
+
* ```
|
|
96
122
|
*/
|
|
97
|
-
declare function formatPercent(value: number, locale?: string,
|
|
123
|
+
declare function formatPercent(value: number, locale?: string, decimalsOrOptions?: number | {
|
|
124
|
+
decimals?: number;
|
|
125
|
+
preserveDecimals?: boolean;
|
|
126
|
+
maxDecimals?: number;
|
|
127
|
+
}): string;
|
|
98
128
|
/**
|
|
99
129
|
* Format a large number with abbreviations (K, M, B)
|
|
100
130
|
*/
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { u as useToast } from './useToast-
|
|
1
|
+
export { u as useToast } from './useToast-DRah6K-g.js';
|
|
2
2
|
export { O as OrganisationSecurityHook, d as UseAppConfigReturn, U as UseOrganisationPermissionsReturn, p as UsePublicEventOptions, o as UsePublicEventReturn, r as UsePublicFileDisplayOptions, q as UsePublicFileDisplayReturn, s as UsePublicRouteParamsReturn, f as clearPublicEventCache, i as clearPublicFileDisplayCache, n as extractEventCodeFromPath, m as generatePublicRoutePath, g as getPublicEventCacheStats, j as getPublicFileDisplayCacheStats, c as useAppConfig, u as useEventTheme, a as useOrganisationPermissions, b as useOrganisationSecurity, e as usePublicEvent, l as usePublicEventCode, h as usePublicFileDisplay, k as usePublicRouteParams } from './usePublicRouteParams-CnM-IK2I.js';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import { SortingState, ColumnFiltersState, ExpandedState } from '@tanstack/react-table';
|
|
5
5
|
import * as react_hook_form from 'react-hook-form';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
export { u as useComponentPerformance } from './useComponentPerformance-DE9l5RkL.js';
|
|
8
|
-
import { D as DataRecord, P as PerformanceConfig, S as ServerSideConfig, C as ChunkingConfig, e as SearchIndexConfig, d as PaginationMode, h as ServerSideParams, i as ServerSideResponse } from './types-
|
|
8
|
+
import { D as DataRecord, P as PerformanceConfig, S as ServerSideConfig, C as ChunkingConfig, e as SearchIndexConfig, d as PaginationMode, h as ServerSideParams, i as ServerSideResponse } from './types-D4TVpDa1.js';
|
|
9
9
|
import { SupabaseClient } from '@supabase/supabase-js';
|
|
10
10
|
import { b as FileCategory, F as FileReference } from './file-reference-C9isKNPn.js';
|
|
11
11
|
import './organisation-D6qRDtbF.js';
|
package/dist/hooks.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -7,14 +7,14 @@ import { E as Event } from './unified-DQ4VcT7H.js';
|
|
|
7
7
|
import { S as SessionRestorationState } from './auth-DReDSLq9.js';
|
|
8
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
9
|
export { ALL_PERMISSIONS, AccessLevel, AccessLevelGuard, AllPermissions, CACHE_PATTERNS, DataAccessRecord, EVENT_APP_PERMISSIONS, EnhancedNavigationMenu, EnhancedNavigationMenuProps, EventAppRole, GLOBAL_PERMISSIONS, GlobalRole, InvalidScopeError, LogLevel, MissingUserContextError, NavigationAccessRecord, NavigationContextType, NavigationGuard, NavigationGuardProps, NavigationProvider, NavigationProviderProps, ORGANISATION_PERMISSIONS, Operation, OrganisationContextRequiredError, OrganisationRole, PAGE_PERMISSIONS, PageAccessRecord, PagePermissionContextType, PagePermissionGuard, PagePermissionGuardProps, PagePermissionProvider, PagePermissionProviderProps, Permission, PermissionCheck, PermissionDeniedError, PermissionEnforcer, PermissionEnforcerProps, PermissionGuard, PermissionMap, RBACAuditManager, RBACCache, RBACConfig, RBACEngine, RBACError, RBACLogger, RBACNotInitializedError, RoleBasedRouter, RoleBasedRouterContextType, RoleBasedRouterProps, RouteAccessRecord, RouteConfig, Scope, SecureDataContextType, SecureDataProvider, SecureDataProviderProps, SecureSupabaseClient, UUID, UseResolvedScopeOptions, UseResolvedScopeReturn, createAuditManager, createRBACConfig, createRBACEngine, createRBACExpressMiddleware, createRBACMiddleware, createSecureClient, emitAuditEvent, fromSupabaseClient, getAccessLevel, getGlobalAuditManager, getPermissionMap, getPermissionsForRole, getRBACConfig, getRBACLogger, getRoleContext, hasAllPermissions, hasAnyPermission, hasAnyPermissionCached, hasPermission, hasPermissionCached, isDebugMode, isDevelopmentMode, isPermitted, isPermittedCached, isValidPermission, rbacCache, resolveAppContext, setGlobalAuditManager, setupRBAC, useAccessLevel, useCachedPermissions, useCan, useHasAllPermissions, useHasAnyPermission, useMultiplePermissions, useNavigationPermissions, usePagePermissions, usePermissions, useRBAC, useResolvedScope, useRoleBasedRouter, useSecureData, withAccessLevelGuard, withPermissionGuard, withRoleGuard } from './rbac/index.js';
|
|
10
|
-
export { A as Alert, m as AlertDescription, l as AlertTitle, n as Avatar, p as AvatarFallback, o as AvatarImage, B as Button, a as ButtonProps, C as Card, g as CardActions, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, q as Checkbox, b3 as DefaultPublicErrorFallback, D as Dialog, K as DialogBody, G as DialogClose, H as DialogContent, O as DialogDescription, M as DialogFooter, J as DialogHeader, E as DialogOverlay, z as DialogPortal, N as DialogTitle, F as DialogTrigger, aB as ErrorBoundary, aG as EventSelector, aK as FileDisplay, aL as FileDisplayProps, aI as FileUpload, aJ as FileUploadProps, ar as Footer, as as FooterProps, am as Form, aq as Header, I as Input, j as InputProps, L as Label, k as LabelProps, aE as LoadingSpinner, ao as LoginForm, ap as LoginFormProps, ax as NavigationItem, av as NavigationMenu, aw as NavigationMenuProps, ay as OrganisationSelector, be as PaceAppLayout, bd as PaceAppLayoutProps, bg as PaceLoginPage, bf as PaceLoginPageProps, aH as PasswordResetForm, P as Progress, at as ProtectedRoute, au as ProtectedRouteProps, b1 as PublicErrorBoundary, ba as PublicErrorBoundaryProps, bb as PublicErrorBoundaryState, b6 as PublicLoadingSkeleton, b4 as PublicLoadingSpinner, b5 as PublicLoadingSpinnerFullPage, bc as PublicLoadingSpinnerProps, b0 as PublicPageContextChecker, a_ as PublicPageDebugger, a$ as PublicPageDiagnostic, aZ as PublicPageFooter, b9 as PublicPageFooterProps, aV as PublicPageHeader, b8 as PublicPageHeaderProps, aT as PublicPageLayout, b7 as PublicPageLayoutProps, aW as PublicPageProvider, $ as Select, a3 as SelectContent, a0 as SelectGroup, a5 as SelectItem, a4 as SelectLabel, a6 as SelectSeparator, a2 as SelectTrigger, a1 as SelectValue, aF as SessionRestorationLoader, S as Switch, r as SwitchProps, T as Table, t as TableBody, u as TableCaption, v as TableCell, w as TableFooter, x as TableHead, s as TableHeader, y as TableRow, a7 as Toast, a9 as ToastAction, af as ToastActionElement, ae as ToastClose, ad as ToastDescription, ag as ToastProps, aa as ToastProvider, ac as ToastTitle, ab as ToastViewport, a8 as Toaster, ah as Tooltip, aj as TooltipContent, ak as TooltipProvider, al as TooltipRoot, ai as TooltipTrigger, aS as UseFileReferenceForRecordReturn, aQ as UseFileReferenceOptions, aR as UseFileReferenceReturn, aA as UserMenu, bh as UserMenuProps, b2 as useErrorBoundary, aM as useFileReference, aO as useFileReferenceById, aN as useFileReferenceForRecord, aP as useFilesByCategory, aY as useIsPublicPage, aU as usePublicPageContext, aX as usePublicPageProviderContext } from './PublicLoadingSpinner-
|
|
11
|
-
export { u as useToast } from './useToast-
|
|
12
|
-
export { D as DataTable, a as DataTableProps } from './DataTable-
|
|
13
|
-
import { D as DataRecord, f as DataTableAction } from './types-
|
|
14
|
-
export { A as AggregateConfig, a as DataTableColumn, g as DataTableToolbarButton, E as EmptyStateConfig, G as GetRowId } from './types-
|
|
10
|
+
export { A as Alert, m as AlertDescription, l as AlertTitle, n as Avatar, p as AvatarFallback, o as AvatarImage, B as Button, a as ButtonProps, C as Card, g as CardActions, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, q as Checkbox, b3 as DefaultPublicErrorFallback, D as Dialog, K as DialogBody, G as DialogClose, H as DialogContent, O as DialogDescription, M as DialogFooter, J as DialogHeader, E as DialogOverlay, z as DialogPortal, N as DialogTitle, F as DialogTrigger, aB as ErrorBoundary, aG as EventSelector, aK as FileDisplay, aL as FileDisplayProps, aI as FileUpload, aJ as FileUploadProps, ar as Footer, as as FooterProps, am as Form, aq as Header, I as Input, j as InputProps, L as Label, k as LabelProps, aE as LoadingSpinner, ao as LoginForm, ap as LoginFormProps, ax as NavigationItem, av as NavigationMenu, aw as NavigationMenuProps, ay as OrganisationSelector, be as PaceAppLayout, bd as PaceAppLayoutProps, bg as PaceLoginPage, bf as PaceLoginPageProps, aH as PasswordResetForm, P as Progress, at as ProtectedRoute, au as ProtectedRouteProps, b1 as PublicErrorBoundary, ba as PublicErrorBoundaryProps, bb as PublicErrorBoundaryState, b6 as PublicLoadingSkeleton, b4 as PublicLoadingSpinner, b5 as PublicLoadingSpinnerFullPage, bc as PublicLoadingSpinnerProps, b0 as PublicPageContextChecker, a_ as PublicPageDebugger, a$ as PublicPageDiagnostic, aZ as PublicPageFooter, b9 as PublicPageFooterProps, aV as PublicPageHeader, b8 as PublicPageHeaderProps, aT as PublicPageLayout, b7 as PublicPageLayoutProps, aW as PublicPageProvider, $ as Select, a3 as SelectContent, a0 as SelectGroup, a5 as SelectItem, a4 as SelectLabel, a6 as SelectSeparator, a2 as SelectTrigger, a1 as SelectValue, aF as SessionRestorationLoader, S as Switch, r as SwitchProps, T as Table, t as TableBody, u as TableCaption, v as TableCell, w as TableFooter, x as TableHead, s as TableHeader, y as TableRow, a7 as Toast, a9 as ToastAction, af as ToastActionElement, ae as ToastClose, ad as ToastDescription, ag as ToastProps, aa as ToastProvider, ac as ToastTitle, ab as ToastViewport, a8 as Toaster, ah as Tooltip, aj as TooltipContent, ak as TooltipProvider, al as TooltipRoot, ai as TooltipTrigger, aS as UseFileReferenceForRecordReturn, aQ as UseFileReferenceOptions, aR as UseFileReferenceReturn, aA as UserMenu, bh as UserMenuProps, b2 as useErrorBoundary, aM as useFileReference, aO as useFileReferenceById, aN as useFileReferenceForRecord, aP as useFilesByCategory, aY as useIsPublicPage, aU as usePublicPageContext, aX as usePublicPageProviderContext } from './PublicLoadingSpinner-DgDWTFqn.js';
|
|
11
|
+
export { u as useToast } from './useToast-DRah6K-g.js';
|
|
12
|
+
export { D as DataTable, a as DataTableProps } from './DataTable-D5cBRca8.js';
|
|
13
|
+
import { D as DataRecord, f as DataTableAction } from './types-D4TVpDa1.js';
|
|
14
|
+
export { A as AggregateConfig, a as DataTableColumn, g as DataTableToolbarButton, E as EmptyStateConfig, G as GetRowId } from './types-D4TVpDa1.js';
|
|
15
15
|
import { ColumnDef } from '@tanstack/react-table';
|
|
16
16
|
export { p as UsePublicEventOptions, o as UsePublicEventReturn, r as UsePublicFileDisplayOptions, q as UsePublicFileDisplayReturn, s as UsePublicRouteParamsReturn, f as clearPublicEventCache, i as clearPublicFileDisplayCache, n as extractEventCodeFromPath, m as generatePublicRoutePath, g as getPublicEventCacheStats, j as getPublicFileDisplayCacheStats, c as useAppConfig, u as useEventTheme, a as useOrganisationPermissions, b as useOrganisationSecurity, e as usePublicEvent, l as usePublicEventCode, h as usePublicFileDisplay, k as usePublicRouteParams } from './usePublicRouteParams-CnM-IK2I.js';
|
|
17
|
-
export { a as cn, c as createSecureDataAccess, j as formatCompactNumber, e as formatCurrency, f as formatDate, k as formatFileSize, h as formatNumber, i as formatPercent, g as getAppConfig, d as getCurrentAppId, b as getCurrentAppName, s as setAppConfig } from './formatting-
|
|
17
|
+
export { a as cn, c as createSecureDataAccess, j as formatCompactNumber, e as formatCurrency, f as formatDate, k as formatFileSize, h as formatNumber, i as formatPercent, g as getAppConfig, d as getCurrentAppId, b as getCurrentAppName, s as setAppConfig } from './formatting-BiEv5oEk.js';
|
|
18
18
|
export { b as FileCategory, a as FileMetadata, F as FileReference, c as FileUploadOptions } from './file-reference-C9isKNPn.js';
|
|
19
19
|
import { SupabaseClient } from '@supabase/supabase-js';
|
|
20
20
|
export { StyleImport, getAllStylePaths, getStylePath, styleConfig } from './styles/index.js';
|
package/dist/index.js
CHANGED
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
useFileReferenceForRecord,
|
|
91
91
|
useFilesByCategory,
|
|
92
92
|
usePublicPageContext as usePublicPageContext2
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-B3QX32P5.js";
|
|
94
94
|
import {
|
|
95
95
|
Alert,
|
|
96
96
|
AlertDescription,
|
|
@@ -131,7 +131,7 @@ import {
|
|
|
131
131
|
TooltipProvider,
|
|
132
132
|
TooltipRoot,
|
|
133
133
|
TooltipTrigger
|
|
134
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-IMZGJ2X7.js";
|
|
135
135
|
import {
|
|
136
136
|
useAccessLevel,
|
|
137
137
|
useCachedPermissions,
|
|
@@ -217,7 +217,7 @@ import {
|
|
|
217
217
|
} from "./chunk-DMNMZKWS.js";
|
|
218
218
|
import {
|
|
219
219
|
useToast
|
|
220
|
-
} from "./chunk-
|
|
220
|
+
} from "./chunk-4OX5PXHX.js";
|
|
221
221
|
import {
|
|
222
222
|
init_useOrganisations,
|
|
223
223
|
useEvents,
|
|
@@ -259,7 +259,7 @@ import {
|
|
|
259
259
|
getCurrentAppId,
|
|
260
260
|
getCurrentAppName,
|
|
261
261
|
setAppConfig
|
|
262
|
-
} from "./chunk-
|
|
262
|
+
} from "./chunk-NFPV7MRN.js";
|
|
263
263
|
import {
|
|
264
264
|
LoadingSpinner
|
|
265
265
|
} from "./chunk-CDQ3PX7L.js";
|
|
@@ -202,11 +202,34 @@ interface DataTableColumn<TData extends DataRecord = DataRecord> extends Omit<Co
|
|
|
202
202
|
}>;
|
|
203
203
|
/** Field type for editing (text, select, date, etc.) */
|
|
204
204
|
fieldType?: 'text' | 'select' | 'date' | 'number' | 'boolean';
|
|
205
|
-
/** Options for select fields */
|
|
205
|
+
/** Options for select fields - can be simple items or grouped with labels and separators */
|
|
206
206
|
fieldOptions?: Array<{
|
|
207
207
|
value: string | number;
|
|
208
208
|
label: string;
|
|
209
|
+
} | {
|
|
210
|
+
type: 'group';
|
|
211
|
+
label: string;
|
|
212
|
+
items: Array<{
|
|
213
|
+
value: string | number;
|
|
214
|
+
label: string;
|
|
215
|
+
}>;
|
|
216
|
+
} | {
|
|
217
|
+
type: 'separator';
|
|
209
218
|
}>;
|
|
219
|
+
/** Enable keyboard search/filtering in select dropdowns within editable columns (default: true). When fieldType is 'select', this controls dropdown searchability, not global search. */
|
|
220
|
+
selectSearchable?: boolean;
|
|
221
|
+
/** Enable creating new items in select dropdowns (default: false) */
|
|
222
|
+
creatable?: boolean;
|
|
223
|
+
/** Callback to create a new item when user types non-matching text in select dropdown */
|
|
224
|
+
onCreateNew?: (inputValue: string) => Promise<string | number> | string | number;
|
|
225
|
+
/** Maximum height for select dropdown content (default: "20rem") */
|
|
226
|
+
selectMaxHeight?: string;
|
|
227
|
+
/** Custom className for select content dropdown */
|
|
228
|
+
selectContentClassName?: string;
|
|
229
|
+
/** Custom style for select content dropdown */
|
|
230
|
+
selectContentStyle?: React__default.CSSProperties;
|
|
231
|
+
/** Hide spinner arrows on number input fields (default: true for DataTable) */
|
|
232
|
+
hideNumberSpinners?: boolean;
|
|
210
233
|
/** Filter type for column filtering (text, select, number, date) */
|
|
211
234
|
filterType?: 'text' | 'select' | 'number' | 'date';
|
|
212
235
|
/** Options for select filters (alternative to fieldOptions) */
|
|
@@ -5,6 +5,9 @@ import * as React from 'react';
|
|
|
5
5
|
* @package @jmruthers/pace-core
|
|
6
6
|
* @module Hooks
|
|
7
7
|
* @since 0.1.0
|
|
8
|
+
*
|
|
9
|
+
* Toast notifications automatically dismiss after 10 seconds by default.
|
|
10
|
+
* You can customize the duration by providing a `duration` prop (in milliseconds).
|
|
8
11
|
*/
|
|
9
12
|
|
|
10
13
|
interface ToastProps {
|
|
@@ -41,10 +44,10 @@ type ToasterToast = ToastProps & {
|
|
|
41
44
|
type Toast = Omit<ToasterToast, "id">;
|
|
42
45
|
/**
|
|
43
46
|
* Creates a new toast notification
|
|
44
|
-
* @param props - Toast configuration
|
|
47
|
+
* @param props - Toast configuration. Duration defaults to 10 seconds (10000ms) if not provided.
|
|
45
48
|
* @returns Object with toast ID and control methods
|
|
46
49
|
*/
|
|
47
|
-
declare function toast({ ...props }: Toast): {
|
|
50
|
+
declare function toast({ duration, ...props }: Toast): {
|
|
48
51
|
id: string;
|
|
49
52
|
dismiss: () => void;
|
|
50
53
|
update: (props: Partial<Omit<ToasterToast, "id">>) => void;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { A as AppConfig, S as SecureDataAccess, a as cn, j as formatCompactNumber, e as formatCurrency, f as formatDate, k as formatFileSize, h as formatNumber, i as formatPercent, g as getAppConfig, d as getCurrentAppId, b as getCurrentAppName, s as setAppConfig } from './formatting-
|
|
1
|
+
export { A as AppConfig, S as SecureDataAccess, a as cn, j as formatCompactNumber, e as formatCurrency, f as formatDate, k as formatFileSize, h as formatNumber, i as formatPercent, g as getAppConfig, d as getCurrentAppId, b as getCurrentAppName, s as setAppConfig } from './formatting-BiEv5oEk.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
export { u as useComponentPerformance } from './useComponentPerformance-DE9l5RkL.js';
|
|
4
4
|
import * as date_fns from 'date-fns';
|
|
5
|
-
import { D as DataTable } from './DataTable-
|
|
5
|
+
import { D as DataTable } from './DataTable-D5cBRca8.js';
|
|
6
6
|
import React__default, { ComponentType } from 'react';
|
|
7
|
-
import './types-
|
|
7
|
+
import './types-D4TVpDa1.js';
|
|
8
8
|
import { SupabaseClient } from '@supabase/supabase-js';
|
|
9
9
|
import 'clsx';
|
|
10
10
|
import 'react/jsx-runtime';
|
package/dist/utils.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
getCurrentAppId,
|
|
10
10
|
getCurrentAppName,
|
|
11
11
|
setAppConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NFPV7MRN.js";
|
|
13
13
|
import {
|
|
14
14
|
LoadingSpinner
|
|
15
15
|
} from "./chunk-CDQ3PX7L.js";
|
|
@@ -594,7 +594,7 @@ function createLazyComponent(importFn, componentName, options = {}) {
|
|
|
594
594
|
return WrappedComponent;
|
|
595
595
|
}
|
|
596
596
|
var LazyDataTable = createLazyComponent(
|
|
597
|
-
() => import("./DataTable-
|
|
597
|
+
() => import("./DataTable-WFCHVWTY.js").then((module) => ({ default: module.DataTable })),
|
|
598
598
|
"DataTable"
|
|
599
599
|
);
|
|
600
600
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[@jmruthers/pace-core - v0.5.
|
|
1
|
+
[@jmruthers/pace-core - v0.5.108](../README.md) / [Exports](../modules.md) / AggregateConfig
|
|
2
2
|
|
|
3
3
|
# Interface: AggregateConfig
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ Aggregate configuration
|
|
|
20
20
|
|
|
21
21
|
#### Defined in
|
|
22
22
|
|
|
23
|
-
[packages/core/src/components/DataTable/types.ts:
|
|
23
|
+
[packages/core/src/components/DataTable/types.ts:446](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/DataTable/types.ts#L446)
|
|
24
24
|
|
|
25
25
|
___
|
|
26
26
|
|
|
@@ -30,7 +30,7 @@ ___
|
|
|
30
30
|
|
|
31
31
|
#### Defined in
|
|
32
32
|
|
|
33
|
-
[packages/core/src/components/DataTable/types.ts:
|
|
33
|
+
[packages/core/src/components/DataTable/types.ts:447](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/DataTable/types.ts#L447)
|
|
34
34
|
|
|
35
35
|
___
|
|
36
36
|
|
|
@@ -40,4 +40,4 @@ ___
|
|
|
40
40
|
|
|
41
41
|
#### Defined in
|
|
42
42
|
|
|
43
|
-
[packages/core/src/components/DataTable/types.ts:
|
|
43
|
+
[packages/core/src/components/DataTable/types.ts:448](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/DataTable/types.ts#L448)
|