@jmruthers/pace-core 0.5.102 → 0.5.103

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.
Files changed (141) hide show
  1. package/dist/{DataTable-DXELRJIX.js → DataTable-EEDFYMJP.js} +2 -2
  2. package/dist/{PublicLoadingSpinner-Cvgk-V0F.d.ts → PublicLoadingSpinner-48ewSMKK.d.ts} +1 -96
  3. package/dist/{chunk-7ME4Z5OY.js → chunk-5SGBVBRU.js} +12 -148
  4. package/dist/chunk-5SGBVBRU.js.map +1 -0
  5. package/dist/{chunk-EVVRUGQ2.js → chunk-62AVH7CM.js} +78 -55
  6. package/dist/{chunk-EVVRUGQ2.js.map → chunk-62AVH7CM.js.map} +1 -1
  7. package/dist/{chunk-UDWTCBSH.js → chunk-SZWCMVTQ.js} +12 -175
  8. package/dist/chunk-SZWCMVTQ.js.map +1 -0
  9. package/dist/{chunk-SZWRW5FD.js → chunk-X33A4WWI.js} +23 -3
  10. package/dist/{chunk-SZWRW5FD.js.map → chunk-X33A4WWI.js.map} +1 -1
  11. package/dist/components.d.ts +1 -1
  12. package/dist/components.js +3 -9
  13. package/dist/components.js.map +1 -1
  14. package/dist/hooks.d.ts +1 -1
  15. package/dist/hooks.js +2 -9
  16. package/dist/hooks.js.map +1 -1
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.js +4 -16
  19. package/dist/index.js.map +1 -1
  20. package/dist/types.js +3 -3
  21. package/dist/{usePublicRouteParams-BwMR2uub.d.ts → usePublicRouteParams-BiXgKiYa.d.ts} +1 -117
  22. package/dist/utils.js +1 -1
  23. package/docs/api/classes/ColumnFactory.md +1 -1
  24. package/docs/api/classes/ErrorBoundary.md +1 -1
  25. package/docs/api/classes/InvalidScopeError.md +1 -1
  26. package/docs/api/classes/MissingUserContextError.md +1 -1
  27. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  28. package/docs/api/classes/PermissionDeniedError.md +1 -1
  29. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  30. package/docs/api/classes/RBACAuditManager.md +1 -1
  31. package/docs/api/classes/RBACCache.md +1 -1
  32. package/docs/api/classes/RBACEngine.md +1 -1
  33. package/docs/api/classes/RBACError.md +1 -1
  34. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  35. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  36. package/docs/api/classes/StorageUtils.md +1 -1
  37. package/docs/api/enums/FileCategory.md +1 -1
  38. package/docs/api/interfaces/AggregateConfig.md +1 -1
  39. package/docs/api/interfaces/ButtonProps.md +1 -1
  40. package/docs/api/interfaces/CardProps.md +1 -1
  41. package/docs/api/interfaces/ColorPalette.md +1 -1
  42. package/docs/api/interfaces/ColorShade.md +1 -1
  43. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  44. package/docs/api/interfaces/DataRecord.md +1 -1
  45. package/docs/api/interfaces/DataTableAction.md +1 -1
  46. package/docs/api/interfaces/DataTableColumn.md +1 -1
  47. package/docs/api/interfaces/DataTableProps.md +1 -1
  48. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  49. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  50. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  51. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  52. package/docs/api/interfaces/FileMetadata.md +1 -1
  53. package/docs/api/interfaces/FileReference.md +1 -1
  54. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  55. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  56. package/docs/api/interfaces/FileUploadProps.md +1 -1
  57. package/docs/api/interfaces/FooterProps.md +1 -1
  58. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  59. package/docs/api/interfaces/InputProps.md +1 -1
  60. package/docs/api/interfaces/LabelProps.md +1 -1
  61. package/docs/api/interfaces/LoginFormProps.md +1 -1
  62. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  63. package/docs/api/interfaces/NavigationContextType.md +1 -1
  64. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  65. package/docs/api/interfaces/NavigationItem.md +1 -1
  66. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  67. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  68. package/docs/api/interfaces/Organisation.md +1 -1
  69. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  70. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  71. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  72. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  73. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  74. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  75. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  76. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  77. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  78. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  79. package/docs/api/interfaces/PaletteData.md +1 -1
  80. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  81. package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
  82. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  83. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  84. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  85. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  86. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  87. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  88. package/docs/api/interfaces/RBACConfig.md +1 -1
  89. package/docs/api/interfaces/RBACLogger.md +1 -1
  90. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  91. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  92. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  93. package/docs/api/interfaces/RouteConfig.md +1 -1
  94. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  95. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  96. package/docs/api/interfaces/StorageConfig.md +1 -1
  97. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  98. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  99. package/docs/api/interfaces/StorageListOptions.md +1 -1
  100. package/docs/api/interfaces/StorageListResult.md +1 -1
  101. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  102. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  103. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  104. package/docs/api/interfaces/StyleImport.md +1 -1
  105. package/docs/api/interfaces/SwitchProps.md +1 -1
  106. package/docs/api/interfaces/ToastActionElement.md +1 -1
  107. package/docs/api/interfaces/ToastProps.md +1 -1
  108. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  109. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  110. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  111. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  112. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  113. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  114. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
  115. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
  116. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  117. package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
  118. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  119. package/docs/api/interfaces/UserEventAccess.md +1 -1
  120. package/docs/api/interfaces/UserMenuProps.md +1 -1
  121. package/docs/api/interfaces/UserProfile.md +1 -1
  122. package/docs/api/modules.md +2 -150
  123. package/docs/implementation-guides/file-reference-system.md +31 -19
  124. package/package.json +1 -1
  125. package/src/components/DataTable/components/DataTableCore.tsx +23 -13
  126. package/src/components/DataTable/hooks/useTableColumns.ts +36 -6
  127. package/src/components/PublicLayout/PublicPageHeader.tsx +1 -1
  128. package/src/components/index.ts +0 -2
  129. package/src/hooks/public/index.ts +2 -4
  130. package/src/index.ts +0 -2
  131. package/src/utils/file-reference.ts +30 -2
  132. package/src/utils/storage/README.md +22 -20
  133. package/dist/chunk-7ME4Z5OY.js.map +0 -1
  134. package/dist/chunk-UDWTCBSH.js.map +0 -1
  135. package/docs/api/interfaces/UseEventLogoOptions.md +0 -74
  136. package/docs/api/interfaces/UseEventLogoReturn.md +0 -81
  137. package/docs/api/interfaces/UsePublicEventLogoOptions.md +0 -87
  138. package/docs/api/interfaces/UsePublicEventLogoReturn.md +0 -81
  139. package/src/hooks/public/usePublicEventLogo.ts +0 -295
  140. package/src/hooks/useEventLogo.ts +0 -316
  141. /package/dist/{DataTable-DXELRJIX.js.map → DataTable-EEDFYMJP.js.map} +0 -0
@@ -10745,12 +10745,25 @@ function useTableColumns({
10745
10745
  columnOrder
10746
10746
  }) {
10747
10747
  const enhancedColumns = useMemo13(() => {
10748
- const baseColumns = [...columns].map((column) => ({
10749
- ...column,
10750
- enableSorting: features.sorting && column.enableSorting !== false,
10751
- enableColumnFilter: features.filtering && column.enableColumnFilter !== false,
10752
- enableGrouping: features.grouping && column.enableGrouping !== false
10753
- }));
10748
+ const baseColumns = [...columns].map((column) => {
10749
+ const baseColumn = {
10750
+ ...column,
10751
+ enableSorting: features.sorting && column.enableSorting !== false,
10752
+ enableColumnFilter: features.filtering && column.enableColumnFilter !== false,
10753
+ enableGrouping: features.grouping && column.enableGrouping !== false
10754
+ };
10755
+ const dataTableColumn = column;
10756
+ const isNumericColumn = column.meta?.type === "number" || dataTableColumn.fieldType === "number" || dataTableColumn.filterType === "number";
10757
+ const isDateColumn = column.meta?.type === "date" || dataTableColumn.fieldType === "date" || dataTableColumn.filterType === "date";
10758
+ if (isNumericColumn && !isDateColumn) {
10759
+ baseColumn.meta = {
10760
+ ...baseColumn.meta,
10761
+ align: "right",
10762
+ type: "number"
10763
+ };
10764
+ }
10765
+ return baseColumn;
10766
+ });
10754
10767
  const selectionColumn = features.selection ? {
10755
10768
  id: "select",
10756
10769
  header: ({ table }) => {
@@ -11968,62 +11981,72 @@ function DataTableInternal({
11968
11981
  /* @__PURE__ */ jsx24("col", { span: dataColumns, "data-col-type": "data" }),
11969
11982
  hasActionsColumn && /* @__PURE__ */ jsx24("col", { span: 1, "data-col-type": "actions" })
11970
11983
  ] }),
11971
- /* @__PURE__ */ jsx24("thead", { children: table?.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx24("tr", { children: headerGroup.headers.filter((header) => {
11972
- return typeof header.column.getIsVisible === "function" ? header.column.getIsVisible() : true;
11973
- }).map((header) => {
11974
- const isSortable = header.column.getCanSort();
11975
- const ariaSort = isSortable ? header.column.getIsSorted() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : "none" : void 0;
11976
- const isRightAligned = header.column.columnDef.meta?.align === "right";
11977
- const handleSortClick = (event) => {
11978
- const originalHandler = header.column.getToggleSortingHandler();
11979
- if (originalHandler) {
11980
- originalHandler(event);
11981
- }
11982
- const columnName = typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "column";
11983
- const currentSort = header.column.getIsSorted();
11984
- const newSort = currentSort === "asc" ? "desc" : currentSort === "desc" ? null : "asc";
11985
- announceSortChange(columnName, newSort);
11986
- };
11987
- const headerKeyboardHandlers = keyboardNavigation.getHeaderKeyboardHandlers(
11988
- header.index,
11989
- () => {
11984
+ /* @__PURE__ */ jsx24("thead", { children: table?.getHeaderGroups().map((headerGroup) => {
11985
+ const visibleHeaders = headerGroup.headers.filter((header) => {
11986
+ return typeof header.column.getIsVisible === "function" ? header.column.getIsVisible() : true;
11987
+ });
11988
+ return /* @__PURE__ */ jsx24("tr", { children: visibleHeaders.map((header, index) => {
11989
+ const isFirst = index === 0;
11990
+ const isLast = index === visibleHeaders.length - 1;
11991
+ const isSortable = header.column.getCanSort();
11992
+ const ariaSort = isSortable ? header.column.getIsSorted() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : "none" : void 0;
11993
+ const isRightAligned = header.column.columnDef.meta?.align === "right";
11994
+ const handleSortClick = (event) => {
11990
11995
  const originalHandler = header.column.getToggleSortingHandler();
11991
11996
  if (originalHandler) {
11992
- originalHandler({});
11997
+ originalHandler(event);
11993
11998
  }
11994
11999
  const columnName = typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "column";
11995
12000
  const currentSort = header.column.getIsSorted();
11996
12001
  const newSort = currentSort === "asc" ? "desc" : currentSort === "desc" ? null : "asc";
11997
12002
  announceSortChange(columnName, newSort);
11998
- }
11999
- );
12000
- return /* @__PURE__ */ jsx24(
12001
- "th",
12002
- {
12003
- className: `px-3 py-2 ${isRightAligned ? "text-right" : "text-left"}`,
12004
- scope: "col",
12005
- role: "columnheader",
12006
- ...isSortable ? { "aria-sort": ariaSort } : {},
12007
- ...isSortable ? headerKeyboardHandlers : {},
12008
- children: header.isPlaceholder ? null : isSortable ? /* @__PURE__ */ jsxs17(
12009
- Button,
12010
- {
12011
- variant: "ghost",
12012
- className: `h-auto p-0 font-medium hover:bg-transparent ${isRightAligned ? "justify-end" : "justify-start"}`,
12013
- onClick: handleSortClick,
12014
- ...headerKeyboardHandlers,
12015
- "aria-label": `Sort by ${typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "column"}`,
12016
- tabIndex: 0,
12017
- children: [
12018
- typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header,
12019
- header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx24(ChevronUp2, { className: "h-4 w-4" }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx24(ChevronDown3, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx24(ChevronsUpDown, { className: "h-4 w-4" })
12020
- ]
12003
+ };
12004
+ const headerKeyboardHandlers = keyboardNavigation.getHeaderKeyboardHandlers(
12005
+ header.index,
12006
+ () => {
12007
+ const originalHandler = header.column.getToggleSortingHandler();
12008
+ if (originalHandler) {
12009
+ originalHandler({});
12021
12010
  }
12022
- ) : typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header
12023
- },
12024
- header.id
12025
- );
12026
- }) }, headerGroup.id)) }),
12011
+ const columnName = typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "column";
12012
+ const currentSort = header.column.getIsSorted();
12013
+ const newSort = currentSort === "asc" ? "desc" : currentSort === "desc" ? null : "asc";
12014
+ announceSortChange(columnName, newSort);
12015
+ }
12016
+ );
12017
+ return /* @__PURE__ */ jsx24(
12018
+ "th",
12019
+ {
12020
+ className: cn(
12021
+ "px-3 py-2 bg-main-200",
12022
+ isRightAligned ? "text-right" : "text-left",
12023
+ isFirst && "rounded-l-md",
12024
+ isLast && "rounded-r-md"
12025
+ ),
12026
+ scope: "col",
12027
+ role: "columnheader",
12028
+ ...isSortable ? { "aria-sort": ariaSort } : {},
12029
+ ...isSortable ? headerKeyboardHandlers : {},
12030
+ children: header.isPlaceholder ? null : isSortable ? /* @__PURE__ */ jsxs17(
12031
+ Button,
12032
+ {
12033
+ variant: "ghost",
12034
+ className: `h-auto p-0 font-bold hover:bg-transparent ${isRightAligned ? "justify-end" : "justify-start"}`,
12035
+ onClick: handleSortClick,
12036
+ ...headerKeyboardHandlers,
12037
+ "aria-label": `Sort by ${typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "column"}`,
12038
+ tabIndex: 0,
12039
+ children: [
12040
+ typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header,
12041
+ header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx24(ChevronUp2, { className: "h-4 w-4" }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx24(ChevronDown3, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx24(ChevronsUpDown, { className: "h-4 w-4" })
12042
+ ]
12043
+ }
12044
+ ) : typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header
12045
+ },
12046
+ header.id
12047
+ );
12048
+ }) }, headerGroup.id);
12049
+ }) }),
12027
12050
  /* @__PURE__ */ jsx24(
12028
12051
  UnifiedTableBody,
12029
12052
  {
@@ -12402,4 +12425,4 @@ lodash/lodash.js:
12402
12425
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12403
12426
  *)
12404
12427
  */
12405
- //# sourceMappingURL=chunk-EVVRUGQ2.js.map
12428
+ //# sourceMappingURL=chunk-62AVH7CM.js.map