@jmruthers/pace-core 0.5.92 → 0.5.94
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-HC5S4RKB.js → DataTable-CHX2EFO3.js} +6 -6
- package/dist/{PublicLoadingSpinner-n74JgA9h.d.ts → PublicLoadingSpinner-BWUD6bLU.d.ts} +24 -3
- package/dist/{UnifiedAuthProvider-ZM7VUC45.js → UnifiedAuthProvider-H7RI4KYD.js} +3 -3
- package/dist/{chunk-AZ2QJYKU.js → chunk-2KLAOD4M.js} +3 -3
- package/dist/{chunk-HW5BGOWB.js → chunk-2ZYHCFUO.js} +4 -4
- package/dist/{chunk-AAM57AEU.js → chunk-5RYPBJYL.js} +16 -19
- package/dist/chunk-5RYPBJYL.js.map +1 -0
- package/dist/{chunk-XIBSVWJW.js → chunk-7TQDRDSM.js} +5 -5
- package/dist/{chunk-GP3HU6WS.js → chunk-G7UUVEAP.js} +3 -3
- package/dist/{chunk-M52CQP5W.js → chunk-MKMKUCPF.js} +762 -12
- package/dist/chunk-MKMKUCPF.js.map +1 -0
- package/dist/{chunk-OXFOS62D.js → chunk-MVNOAHOP.js} +2 -2
- package/dist/{chunk-5LAY74WM.js → chunk-O6GASC4Q.js} +877 -788
- package/dist/chunk-O6GASC4Q.js.map +1 -0
- package/dist/{chunk-AYC2P377.js → chunk-ORACUZ7H.js} +2 -2
- package/dist/{chunk-TZXYSZT3.js → chunk-PRM6EYO3.js} +298 -238
- package/dist/{chunk-TZXYSZT3.js.map → chunk-PRM6EYO3.js.map} +1 -1
- package/dist/{chunk-6WFM22A4.js → chunk-ZGCVJ7WW.js} +2 -2
- package/dist/components.d.ts +1 -1
- package/dist/components.js +8 -8
- package/dist/hooks.d.ts +94 -3
- package/dist/hooks.js +20 -8
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -11
- package/dist/index.js.map +1 -1
- package/dist/providers.js +2 -2
- package/dist/rbac/index.js +7 -7
- package/dist/{usePublicRouteParams-BlgwXweB.d.ts → usePublicRouteParams-BwMR2uub.d.ts} +93 -1
- package/dist/utils.js +1 -1
- 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 +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/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +26 -11
- 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 +24 -11
- 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/UseEventLogoOptions.md +1 -1
- package/docs/api/interfaces/UseEventLogoReturn.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/UsePublicFileDisplayOptions.md +47 -0
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +120 -0
- 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 +105 -19
- package/docs/api-reference/components.md +146 -1
- package/docs/best-practices/common-patterns.md +26 -8
- package/docs/getting-started/examples/README.md +10 -26
- package/docs/getting-started/quick-reference.md +23 -0
- package/docs/implementation-guides/authentication.md +39 -16
- package/docs/implementation-guides/file-reference-system.md +15 -0
- package/docs/implementation-guides/file-upload-storage.md +16 -0
- package/package.json +1 -1
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +9 -7
- package/src/components/DataTable/components/DataTableCore.tsx +8 -1
- package/src/components/DataTable/components/EditableRow.tsx +62 -22
- package/src/components/DataTable/components/UnifiedTableBody.tsx +25 -101
- package/src/components/FileDisplay/FileDisplay.test.tsx +263 -39
- package/src/components/FileDisplay/FileDisplay.tsx +605 -83
- package/src/components/ProtectedRoute/README.md +164 -0
- package/src/components/PublicLayout/EventLogo.tsx +8 -2
- package/src/components/PublicLayout/PublicPageHeader.tsx +20 -18
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +75 -29
- package/src/components/Select/Select.test.tsx +83 -6
- package/src/components/Select/Select.tsx +236 -16
- package/src/examples/CorrectPublicPageImplementation.tsx +16 -13
- package/src/examples/PublicEventPage.tsx +9 -6
- package/src/examples/PublicPageApp.tsx +9 -6
- package/src/examples/PublicPageUsageExample.tsx +9 -7
- package/src/hooks/index.ts +4 -0
- package/src/hooks/public/index.ts +2 -0
- package/src/hooks/public/usePublicFileDisplay.ts +355 -0
- package/src/hooks/useFileDisplay.ts +370 -0
- package/src/services/AuthService.ts +19 -22
- package/dist/chunk-5LAY74WM.js.map +0 -1
- package/dist/chunk-AAM57AEU.js.map +0 -1
- package/dist/chunk-M52CQP5W.js.map +0 -1
- /package/dist/{DataTable-HC5S4RKB.js.map → DataTable-CHX2EFO3.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-ZM7VUC45.js.map → UnifiedAuthProvider-H7RI4KYD.js.map} +0 -0
- /package/dist/{chunk-AZ2QJYKU.js.map → chunk-2KLAOD4M.js.map} +0 -0
- /package/dist/{chunk-HW5BGOWB.js.map → chunk-2ZYHCFUO.js.map} +0 -0
- /package/dist/{chunk-XIBSVWJW.js.map → chunk-7TQDRDSM.js.map} +0 -0
- /package/dist/{chunk-GP3HU6WS.js.map → chunk-G7UUVEAP.js.map} +0 -0
- /package/dist/{chunk-OXFOS62D.js.map → chunk-MVNOAHOP.js.map} +0 -0
- /package/dist/{chunk-AYC2P377.js.map → chunk-ORACUZ7H.js.map} +0 -0
- /package/dist/{chunk-6WFM22A4.js.map → chunk-ZGCVJ7WW.js.map} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCan,
|
|
3
3
|
useResolvedScope
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2KLAOD4M.js";
|
|
5
5
|
import {
|
|
6
6
|
toast,
|
|
7
7
|
useDataTablePerformance
|
|
8
8
|
} from "./chunk-QPCAGLUS.js";
|
|
9
9
|
import {
|
|
10
10
|
init_UnifiedAuthProvider
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ORACUZ7H.js";
|
|
12
12
|
import {
|
|
13
13
|
useUnifiedAuth
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5RYPBJYL.js";
|
|
15
15
|
import {
|
|
16
16
|
cn
|
|
17
17
|
} from "./chunk-PYUXFQJ3.js";
|
|
@@ -5502,10 +5502,10 @@ var require_lodash = __commonJS({
|
|
|
5502
5502
|
});
|
|
5503
5503
|
|
|
5504
5504
|
// src/components/DataTable/DataTable.tsx
|
|
5505
|
-
import
|
|
5505
|
+
import React19 from "react";
|
|
5506
5506
|
|
|
5507
5507
|
// src/components/DataTable/components/DataTableCore.tsx
|
|
5508
|
-
import
|
|
5508
|
+
import React18, { useMemo as useMemo14, useCallback as useCallback11, useEffect as useEffect12, useRef as useRef7 } from "react";
|
|
5509
5509
|
import { useReactTable } from "@tanstack/react-table";
|
|
5510
5510
|
import { Edit, Trash, ChevronUp as ChevronUp2, ChevronDown as ChevronDown3, ChevronsUpDown } from "lucide-react";
|
|
5511
5511
|
|
|
@@ -5918,24 +5918,95 @@ var Select = React5.forwardRef(
|
|
|
5918
5918
|
}, [ref]);
|
|
5919
5919
|
const { state, actions } = useSelectState(selectProps);
|
|
5920
5920
|
const { isSelecting } = useSelectEvents({ state, actions, selectRef });
|
|
5921
|
+
const itemsMapRef = React5.useRef(/* @__PURE__ */ new Map());
|
|
5922
|
+
const currentValueRef = React5.useRef(state.value);
|
|
5921
5923
|
React5.useEffect(() => {
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5924
|
+
currentValueRef.current = state.value;
|
|
5925
|
+
}, [state.value]);
|
|
5926
|
+
const updateSelectedTextIfNeeded = React5.useCallback((value) => {
|
|
5927
|
+
if (value && value === currentValueRef.current) {
|
|
5928
|
+
const registeredText = itemsMapRef.current.get(value);
|
|
5929
|
+
if (registeredText) {
|
|
5930
|
+
actions.setSelectedText(registeredText);
|
|
5931
|
+
return true;
|
|
5932
|
+
}
|
|
5933
|
+
}
|
|
5934
|
+
return false;
|
|
5935
|
+
}, [actions.setSelectedText]);
|
|
5936
|
+
const registerItem = React5.useCallback((value, text) => {
|
|
5937
|
+
itemsMapRef.current.set(value, text);
|
|
5938
|
+
updateSelectedTextIfNeeded(value);
|
|
5939
|
+
}, [updateSelectedTextIfNeeded]);
|
|
5940
|
+
const unregisterItem = React5.useCallback((value) => {
|
|
5941
|
+
itemsMapRef.current.delete(value);
|
|
5942
|
+
}, []);
|
|
5943
|
+
const findAndSetSelectedText = React5.useCallback(() => {
|
|
5944
|
+
if (!state.value) {
|
|
5945
|
+
actions.setSelectedText("");
|
|
5946
|
+
return;
|
|
5947
|
+
}
|
|
5948
|
+
const selectElement = selectRef.current;
|
|
5949
|
+
if (!selectElement) return;
|
|
5950
|
+
let selectItem = selectElement.querySelector(`[data-testid="select-item"][data-value="${state.value}"]`);
|
|
5951
|
+
if (!selectItem) {
|
|
5952
|
+
const hiddenContent = selectElement.querySelector('[data-testid="select-content-hidden"]');
|
|
5953
|
+
if (hiddenContent) {
|
|
5954
|
+
selectItem = hiddenContent.querySelector(`[data-testid="select-item"][data-value="${state.value}"]`);
|
|
5955
|
+
}
|
|
5956
|
+
}
|
|
5957
|
+
if (!selectItem) {
|
|
5958
|
+
const visibleContent = selectElement.querySelector('[data-testid="select-content"]');
|
|
5959
|
+
if (visibleContent) {
|
|
5960
|
+
selectItem = visibleContent.querySelector(`[data-testid="select-item"][data-value="${state.value}"]`);
|
|
5961
|
+
}
|
|
5962
|
+
}
|
|
5963
|
+
if (selectItem) {
|
|
5964
|
+
let textContent = selectItem.textContent?.trim() || "";
|
|
5965
|
+
textContent = textContent.split("\n").map((line) => line.trim()).filter((line) => line).join(" ");
|
|
5966
|
+
if (textContent) {
|
|
5967
|
+
actions.setSelectedText(textContent);
|
|
5968
|
+
itemsMapRef.current.set(state.value, textContent);
|
|
5969
|
+
return;
|
|
5932
5970
|
}
|
|
5933
5971
|
}
|
|
5934
|
-
|
|
5972
|
+
const hasContentContainer = selectElement.querySelector('[data-testid="select-content-hidden"]') || selectElement.querySelector('[data-testid="select-content"]');
|
|
5973
|
+
if (!hasContentContainer) {
|
|
5974
|
+
actions.setSelectedText("");
|
|
5975
|
+
}
|
|
5976
|
+
}, [state.value, actions.setSelectedText, selectRef]);
|
|
5977
|
+
React5.useLayoutEffect(() => {
|
|
5978
|
+
findAndSetSelectedText();
|
|
5979
|
+
}, [findAndSetSelectedText]);
|
|
5980
|
+
React5.useEffect(() => {
|
|
5981
|
+
if (state.value && !state.selectedText) {
|
|
5982
|
+
const timeoutId = setTimeout(() => {
|
|
5983
|
+
findAndSetSelectedText();
|
|
5984
|
+
}, 0);
|
|
5985
|
+
return () => clearTimeout(timeoutId);
|
|
5986
|
+
}
|
|
5987
|
+
}, [state.value, state.selectedText, findAndSetSelectedText]);
|
|
5988
|
+
React5.useEffect(() => {
|
|
5989
|
+
if (!state.value || state.selectedText) return;
|
|
5990
|
+
const selectElement = selectRef.current;
|
|
5991
|
+
if (!selectElement) return;
|
|
5992
|
+
findAndSetSelectedText();
|
|
5993
|
+
const observer = new MutationObserver(() => {
|
|
5994
|
+
if (!state.selectedText) {
|
|
5995
|
+
findAndSetSelectedText();
|
|
5996
|
+
}
|
|
5997
|
+
});
|
|
5998
|
+
observer.observe(selectElement, {
|
|
5999
|
+
childList: true,
|
|
6000
|
+
subtree: true
|
|
6001
|
+
});
|
|
6002
|
+
return () => observer.disconnect();
|
|
6003
|
+
}, [state.value, state.selectedText, findAndSetSelectedText, selectRef]);
|
|
5935
6004
|
const contextValue = React5.useMemo(() => ({
|
|
5936
6005
|
...state,
|
|
5937
|
-
actions
|
|
5938
|
-
|
|
6006
|
+
actions,
|
|
6007
|
+
registerItem,
|
|
6008
|
+
unregisterItem
|
|
6009
|
+
}), [state, actions, registerItem, unregisterItem]);
|
|
5939
6010
|
return /* @__PURE__ */ jsx4(
|
|
5940
6011
|
"form",
|
|
5941
6012
|
{
|
|
@@ -6092,7 +6163,16 @@ var SelectContent = React5.forwardRef(
|
|
|
6092
6163
|
}
|
|
6093
6164
|
}, [open, searchable]);
|
|
6094
6165
|
if (!open) {
|
|
6095
|
-
return
|
|
6166
|
+
return /* @__PURE__ */ jsx4(
|
|
6167
|
+
"ul",
|
|
6168
|
+
{
|
|
6169
|
+
ref,
|
|
6170
|
+
style: { display: "none", visibility: "hidden", position: "absolute" },
|
|
6171
|
+
"aria-hidden": "true",
|
|
6172
|
+
"data-testid": "select-content-hidden",
|
|
6173
|
+
children
|
|
6174
|
+
}
|
|
6175
|
+
);
|
|
6096
6176
|
}
|
|
6097
6177
|
return /* @__PURE__ */ jsxs2(
|
|
6098
6178
|
"ul",
|
|
@@ -6157,7 +6237,7 @@ var SelectContent = React5.forwardRef(
|
|
|
6157
6237
|
SelectContent.displayName = "SelectContent";
|
|
6158
6238
|
var SelectItem = React5.forwardRef(
|
|
6159
6239
|
({ value, children, disabled = false, className, onClick }, ref) => {
|
|
6160
|
-
const { value: selectedValue, actions } = useSelectContext();
|
|
6240
|
+
const { value: selectedValue, actions, registerItem, unregisterItem } = useSelectContext();
|
|
6161
6241
|
const isSelected = selectedValue === value;
|
|
6162
6242
|
const getTextContent = (children2) => {
|
|
6163
6243
|
if (typeof children2 === "string") return children2;
|
|
@@ -6171,6 +6251,16 @@ var SelectItem = React5.forwardRef(
|
|
|
6171
6251
|
return "";
|
|
6172
6252
|
};
|
|
6173
6253
|
const itemText = getTextContent(children);
|
|
6254
|
+
React5.useLayoutEffect(() => {
|
|
6255
|
+
if (registerItem && itemText) {
|
|
6256
|
+
registerItem(value, itemText);
|
|
6257
|
+
}
|
|
6258
|
+
return () => {
|
|
6259
|
+
if (unregisterItem) {
|
|
6260
|
+
unregisterItem(value);
|
|
6261
|
+
}
|
|
6262
|
+
};
|
|
6263
|
+
}, [value, itemText, registerItem, unregisterItem]);
|
|
6174
6264
|
const handleMouseDown = (e) => {
|
|
6175
6265
|
if (!disabled) {
|
|
6176
6266
|
const event = new CustomEvent("selectItemMouseDown", { detail: { value } });
|
|
@@ -6559,7 +6649,7 @@ function DataTableToolbar({
|
|
|
6559
6649
|
}
|
|
6560
6650
|
|
|
6561
6651
|
// src/components/DataTable/components/UnifiedTableBody.tsx
|
|
6562
|
-
import
|
|
6652
|
+
import React9, { useRef as useRef3, useEffect as useEffect3 } from "react";
|
|
6563
6653
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
6564
6654
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
6565
6655
|
import { ChevronDown as ChevronDown2, ChevronRight } from "lucide-react";
|
|
@@ -7018,9 +7108,11 @@ function ActionButtonsComponent({
|
|
|
7018
7108
|
var ActionButtons = React7.memo(ActionButtonsComponent);
|
|
7019
7109
|
|
|
7020
7110
|
// src/components/DataTable/components/EditableRow.tsx
|
|
7111
|
+
import React8 from "react";
|
|
7021
7112
|
import { flexRender } from "@tanstack/react-table";
|
|
7113
|
+
import { X as X3, Check as Check3 } from "lucide-react";
|
|
7022
7114
|
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
7023
|
-
var renderEditField = (column, value, onChange, editingData = {}) => {
|
|
7115
|
+
var renderEditField = (column, value, onChange, editingData = {}, placeholder, inputRef) => {
|
|
7024
7116
|
const columnDef = column.columnDef;
|
|
7025
7117
|
if (columnDef.editable === false) {
|
|
7026
7118
|
return /* @__PURE__ */ jsx13("span", { className: "text-sm text-gray-600", children: String(value ?? "") });
|
|
@@ -7044,6 +7136,7 @@ var renderEditField = (column, value, onChange, editingData = {}) => {
|
|
|
7044
7136
|
return /* @__PURE__ */ jsx13(
|
|
7045
7137
|
Input,
|
|
7046
7138
|
{
|
|
7139
|
+
ref: inputRef,
|
|
7047
7140
|
type: "date",
|
|
7048
7141
|
value: String(value ?? ""),
|
|
7049
7142
|
onChange: (e) => onChange(e.target.value),
|
|
@@ -7055,6 +7148,7 @@ var renderEditField = (column, value, onChange, editingData = {}) => {
|
|
|
7055
7148
|
return /* @__PURE__ */ jsx13(
|
|
7056
7149
|
Input,
|
|
7057
7150
|
{
|
|
7151
|
+
ref: inputRef,
|
|
7058
7152
|
type: "number",
|
|
7059
7153
|
value: String(value ?? ""),
|
|
7060
7154
|
onChange: (e) => onChange(e.target.value),
|
|
@@ -7065,11 +7159,12 @@ var renderEditField = (column, value, onChange, editingData = {}) => {
|
|
|
7065
7159
|
return /* @__PURE__ */ jsx13(
|
|
7066
7160
|
Input,
|
|
7067
7161
|
{
|
|
7162
|
+
ref: inputRef,
|
|
7068
7163
|
type: "text",
|
|
7069
7164
|
value: String(value ?? ""),
|
|
7070
7165
|
onChange: (e) => onChange(e.target.value),
|
|
7071
7166
|
className: "w-full h-7",
|
|
7072
|
-
placeholder: `Enter ${column.id}`
|
|
7167
|
+
placeholder: placeholder || `Enter ${column.id}`
|
|
7073
7168
|
}
|
|
7074
7169
|
);
|
|
7075
7170
|
};
|
|
@@ -7085,6 +7180,14 @@ function EditableRow({
|
|
|
7085
7180
|
hierarchical = false
|
|
7086
7181
|
}) {
|
|
7087
7182
|
const rowId = getRowId ? getRowId(row.original, row.index) : String(row.id);
|
|
7183
|
+
const firstInputRef = React8.useRef(null);
|
|
7184
|
+
const hasAssignedRef = React8.useRef(false);
|
|
7185
|
+
React8.useEffect(() => {
|
|
7186
|
+
if (firstInputRef.current) {
|
|
7187
|
+
firstInputRef.current.focus();
|
|
7188
|
+
firstInputRef.current.select();
|
|
7189
|
+
}
|
|
7190
|
+
}, []);
|
|
7088
7191
|
return /* @__PURE__ */ jsxs9(
|
|
7089
7192
|
"tr",
|
|
7090
7193
|
{
|
|
@@ -7092,25 +7195,47 @@ function EditableRow({
|
|
|
7092
7195
|
"aria-selected": typeof row.getIsSelected === "function" ? row.getIsSelected() ? "true" : "false" : "false",
|
|
7093
7196
|
"aria-rowindex": row.index + 1,
|
|
7094
7197
|
children: [
|
|
7095
|
-
row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx13("td", { role: "cell", children: /* @__PURE__ */ jsx13("div", { className: cell.column.columnDef.meta?.align === "right" ? "text-right" : "", children: cell.column.id !== "actions" ?
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7198
|
+
row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx13("td", { role: "cell", children: /* @__PURE__ */ jsx13("div", { className: cell.column.columnDef.meta?.align === "right" ? "text-right" : "", children: cell.column.id !== "actions" ? (
|
|
7199
|
+
// In edit mode, always use renderEditField for editable columns
|
|
7200
|
+
// Custom cell renderers are for display mode only
|
|
7201
|
+
(() => {
|
|
7202
|
+
const columnDef = cell.column.columnDef;
|
|
7203
|
+
if (columnDef.editable === false) {
|
|
7204
|
+
return cell.column.columnDef.cell ? flexRender(cell.column.columnDef.cell, {
|
|
7205
|
+
...cell.getContext(),
|
|
7206
|
+
getIsEditing: () => true,
|
|
7207
|
+
setValue: (value) => {
|
|
7208
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Date)) {
|
|
7209
|
+
onEditingDataChange({ ...editingData, ...value });
|
|
7210
|
+
} else {
|
|
7211
|
+
onEditingDataChange({ ...editingData, [cell.column.id]: value });
|
|
7212
|
+
}
|
|
7213
|
+
}
|
|
7214
|
+
}) : /* @__PURE__ */ jsx13("span", { className: "text-sm text-gray-600", children: String(cell.getValue() ?? "") });
|
|
7215
|
+
}
|
|
7216
|
+
const shouldGetRef = !hasAssignedRef.current;
|
|
7217
|
+
if (shouldGetRef) {
|
|
7218
|
+
hasAssignedRef.current = true;
|
|
7219
|
+
}
|
|
7220
|
+
return renderEditField(
|
|
7221
|
+
cell.column,
|
|
7222
|
+
editingData[cell.column.id] ?? cell.getValue(),
|
|
7223
|
+
(value) => {
|
|
7224
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Date)) {
|
|
7225
|
+
onEditingDataChange({ ...editingData, ...value });
|
|
7226
|
+
} else {
|
|
7227
|
+
onEditingDataChange({ ...editingData, [cell.column.id]: value });
|
|
7228
|
+
}
|
|
7229
|
+
},
|
|
7230
|
+
editingData,
|
|
7231
|
+
void 0,
|
|
7232
|
+
// placeholder
|
|
7233
|
+
shouldGetRef ? firstInputRef : void 0
|
|
7234
|
+
);
|
|
7235
|
+
})()
|
|
7236
|
+
) : /* @__PURE__ */ jsxs9("div", { className: "flex gap-1", children: [
|
|
7237
|
+
/* @__PURE__ */ jsx13(Button, { onClick: onSave, size: "sm", variant: "default", "aria-label": "Save changes", children: /* @__PURE__ */ jsx13(Check3, { className: "h-4 w-4" }) }),
|
|
7238
|
+
/* @__PURE__ */ jsx13(Button, { onClick: onCancel, size: "sm", variant: "outline", "aria-label": "Cancel editing", children: /* @__PURE__ */ jsx13(X3, { className: "h-4 w-4" }) })
|
|
7114
7239
|
] }) }) }, cell.id)),
|
|
7115
7240
|
actions.length > 0 && /* @__PURE__ */ jsx13("td", { children: /* @__PURE__ */ jsx13(
|
|
7116
7241
|
ActionButtons,
|
|
@@ -7386,7 +7511,7 @@ var renderEditField2 = (column, value, onChange, editingData = {}, placeholder)
|
|
|
7386
7511
|
}
|
|
7387
7512
|
);
|
|
7388
7513
|
};
|
|
7389
|
-
var RowComponent =
|
|
7514
|
+
var RowComponent = React9.memo(({
|
|
7390
7515
|
row,
|
|
7391
7516
|
style,
|
|
7392
7517
|
isEditing,
|
|
@@ -7441,101 +7566,34 @@ var RowComponent = React8.memo(({
|
|
|
7441
7566
|
const groupValue = row.getValue(grouping[0]);
|
|
7442
7567
|
const subRowsCount = row.subRows?.length || 0;
|
|
7443
7568
|
const isExpanded = row.getIsExpanded();
|
|
7444
|
-
return /* @__PURE__ */
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
{
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
) }),
|
|
7473
|
-
isExpanded && row.subRows?.map((subRow) => {
|
|
7474
|
-
const subRowId = getRowId ? getRowId(subRow.original, subRow.index) : String(subRow.index);
|
|
7475
|
-
const isSubRowEditing = editingRowId === subRowId;
|
|
7476
|
-
return /* @__PURE__ */ jsx14("tr", { className: "border-l-2 border-l-blue-200", style, children: subRow.getVisibleCells().map((cell) => /* @__PURE__ */ jsx14(
|
|
7477
|
-
"td",
|
|
7478
|
-
{
|
|
7479
|
-
className: getTableCellClasses({
|
|
7480
|
-
isCompact: true,
|
|
7481
|
-
className: `px-3 py-2 pl-8 ${cell.column.id === "actions" ? "whitespace-nowrap" : "whitespace-normal break-words"} ${cell.column.columnDef.meta?.align === "right" ? "text-right" : ""}`
|
|
7482
|
-
}),
|
|
7483
|
-
children: isSubRowEditing && cell.column.id !== "actions" ? (
|
|
7484
|
-
// Check if column has a custom cell renderer - if so, use it in edit mode
|
|
7485
|
-
cell.column.columnDef.cell ? flexRender2(cell.column.columnDef.cell, {
|
|
7486
|
-
...cell.getContext(),
|
|
7487
|
-
hierarchical,
|
|
7488
|
-
isParent: false,
|
|
7489
|
-
isChild: true,
|
|
7490
|
-
isHierarchical: false,
|
|
7491
|
-
rowId: subRowId,
|
|
7492
|
-
isExpanded: false,
|
|
7493
|
-
hasChildren: false,
|
|
7494
|
-
getIsEditing: () => true,
|
|
7495
|
-
// Always true in edit mode
|
|
7496
|
-
setValue: (value) => {
|
|
7497
|
-
if (typeof value === "object" && value !== null) {
|
|
7498
|
-
onEditingDataChange?.({ ...editingData, ...value });
|
|
7499
|
-
} else {
|
|
7500
|
-
onEditingDataChange?.({ ...editingData, [cell.column.id]: value });
|
|
7501
|
-
}
|
|
7502
|
-
}
|
|
7503
|
-
}) : (
|
|
7504
|
-
// Fall back to default edit field rendering when no custom cell renderer
|
|
7505
|
-
renderEditField2(cell.column, editingData?.[cell.column.id], (value) => {
|
|
7506
|
-
if (typeof value === "object" && value !== null) {
|
|
7507
|
-
onEditingDataChange?.({ ...editingData, ...value });
|
|
7508
|
-
} else {
|
|
7509
|
-
onEditingDataChange?.({ ...editingData, [cell.column.id]: value });
|
|
7510
|
-
}
|
|
7511
|
-
}, editingData)
|
|
7512
|
-
)
|
|
7513
|
-
) : cell.column.id === "actions" ? /* @__PURE__ */ jsx14(
|
|
7514
|
-
ActionButtons,
|
|
7515
|
-
{
|
|
7516
|
-
row,
|
|
7517
|
-
actions,
|
|
7518
|
-
isEditing,
|
|
7519
|
-
isParent,
|
|
7520
|
-
hierarchical: !!hierarchical,
|
|
7521
|
-
rbac,
|
|
7522
|
-
permissions
|
|
7523
|
-
}
|
|
7524
|
-
) : flexRender2(cell.column.columnDef.cell, {
|
|
7525
|
-
...cell.getContext(),
|
|
7526
|
-
hierarchical,
|
|
7527
|
-
isParent: false,
|
|
7528
|
-
isChild: true,
|
|
7529
|
-
isHierarchical: false,
|
|
7530
|
-
rowId: subRowId,
|
|
7531
|
-
isExpanded: false,
|
|
7532
|
-
hasChildren: false
|
|
7533
|
-
})
|
|
7534
|
-
},
|
|
7535
|
-
cell.id
|
|
7536
|
-
)) }, subRow.id);
|
|
7537
|
-
})
|
|
7538
|
-
] });
|
|
7569
|
+
return /* @__PURE__ */ jsx14("tr", { className: "bg-sec-50 hover:bg-sec-100", style, children: /* @__PURE__ */ jsxs10(
|
|
7570
|
+
"td",
|
|
7571
|
+
{
|
|
7572
|
+
className: getTableCellClasses({
|
|
7573
|
+
isCompact: true,
|
|
7574
|
+
className: "px-3 py-2 flex items-center font-medium"
|
|
7575
|
+
}),
|
|
7576
|
+
colSpan: row.getAllCells().length,
|
|
7577
|
+
children: [
|
|
7578
|
+
/* @__PURE__ */ jsx14(
|
|
7579
|
+
Button,
|
|
7580
|
+
{
|
|
7581
|
+
variant: "ghost",
|
|
7582
|
+
size: "sm",
|
|
7583
|
+
onClick: () => row.toggleExpanded(),
|
|
7584
|
+
className: "p-0 h-auto mr-2",
|
|
7585
|
+
children: isExpanded ? /* @__PURE__ */ jsx14(ChevronDown2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx14(ChevronRight, { className: "h-4 w-4" })
|
|
7586
|
+
}
|
|
7587
|
+
),
|
|
7588
|
+
/* @__PURE__ */ jsxs10("span", { className: "text-sm", children: [
|
|
7589
|
+
String(groupValue),
|
|
7590
|
+
" (",
|
|
7591
|
+
subRowsCount,
|
|
7592
|
+
" items)"
|
|
7593
|
+
] })
|
|
7594
|
+
]
|
|
7595
|
+
}
|
|
7596
|
+
) });
|
|
7539
7597
|
}
|
|
7540
7598
|
if (isEditing && editingData && onEditingDataChange && onSaveEditing && onCancelEditing) {
|
|
7541
7599
|
return /* @__PURE__ */ jsx14(
|
|
@@ -7880,7 +7938,7 @@ function UnifiedTableBody({
|
|
|
7880
7938
|
}
|
|
7881
7939
|
|
|
7882
7940
|
// src/components/DataTable/components/PaginationControls.tsx
|
|
7883
|
-
import
|
|
7941
|
+
import React10 from "react";
|
|
7884
7942
|
import {
|
|
7885
7943
|
ChevronLeft,
|
|
7886
7944
|
ChevronRight as ChevronRight2,
|
|
@@ -8203,7 +8261,7 @@ function EnhancedPaginationControls({
|
|
|
8203
8261
|
showJumpToPage = false,
|
|
8204
8262
|
...props
|
|
8205
8263
|
}) {
|
|
8206
|
-
const [jumpToPage, setJumpToPage] =
|
|
8264
|
+
const [jumpToPage, setJumpToPage] = React10.useState("");
|
|
8207
8265
|
const { table, paginationMode = "client", serverData, onPageChange, totalCount } = props;
|
|
8208
8266
|
const pagination = getPaginationBinding({
|
|
8209
8267
|
mode: paginationMode,
|
|
@@ -8260,9 +8318,9 @@ import { useEffect as useEffect6 } from "react";
|
|
|
8260
8318
|
import { useState as useState4, useRef as useRef4, useEffect as useEffect5 } from "react";
|
|
8261
8319
|
|
|
8262
8320
|
// src/components/Dialog/Dialog.tsx
|
|
8263
|
-
import * as
|
|
8321
|
+
import * as React11 from "react";
|
|
8264
8322
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
8265
|
-
import { X as
|
|
8323
|
+
import { X as X4 } from "lucide-react";
|
|
8266
8324
|
|
|
8267
8325
|
// src/components/Dialog/utils/safeHtml.ts
|
|
8268
8326
|
function sanitizeHtml(html) {
|
|
@@ -8336,7 +8394,7 @@ var Dialog = DialogPrimitive.Root;
|
|
|
8336
8394
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
8337
8395
|
var DialogPortal = DialogPrimitive.Portal;
|
|
8338
8396
|
var DialogClose = DialogPrimitive.Close;
|
|
8339
|
-
var DialogOverlay =
|
|
8397
|
+
var DialogOverlay = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
8340
8398
|
DialogPrimitive.Overlay,
|
|
8341
8399
|
{
|
|
8342
8400
|
ref,
|
|
@@ -8413,7 +8471,7 @@ var useSmartDimensions = ({
|
|
|
8413
8471
|
}
|
|
8414
8472
|
return result;
|
|
8415
8473
|
};
|
|
8416
|
-
var DialogContent =
|
|
8474
|
+
var DialogContent = React11.forwardRef(({
|
|
8417
8475
|
className,
|
|
8418
8476
|
children,
|
|
8419
8477
|
size = "md",
|
|
@@ -8440,17 +8498,17 @@ var DialogContent = React10.forwardRef(({
|
|
|
8440
8498
|
minWidth,
|
|
8441
8499
|
enableScrolling
|
|
8442
8500
|
});
|
|
8443
|
-
const handleEscapeKeyDown =
|
|
8501
|
+
const handleEscapeKeyDown = React11.useCallback((event) => {
|
|
8444
8502
|
if (preventCloseOnEscape) {
|
|
8445
8503
|
event.preventDefault();
|
|
8446
8504
|
}
|
|
8447
8505
|
}, [preventCloseOnEscape]);
|
|
8448
|
-
const handlePointerDownOutside =
|
|
8506
|
+
const handlePointerDownOutside = React11.useCallback((event) => {
|
|
8449
8507
|
if (preventCloseOnOutsideClick) {
|
|
8450
8508
|
event.preventDefault();
|
|
8451
8509
|
}
|
|
8452
8510
|
}, [preventCloseOnOutsideClick]);
|
|
8453
|
-
const mergedStyle =
|
|
8511
|
+
const mergedStyle = React11.useMemo(() => {
|
|
8454
8512
|
if (Object.keys(smartDimensions).length === 0) {
|
|
8455
8513
|
return style;
|
|
8456
8514
|
}
|
|
@@ -8492,7 +8550,7 @@ var DialogContent = React10.forwardRef(({
|
|
|
8492
8550
|
children: [
|
|
8493
8551
|
children,
|
|
8494
8552
|
showCloseButton && /* @__PURE__ */ jsxs13(DialogPrimitive.Close, { className: "absolute right-4 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
8495
|
-
/* @__PURE__ */ jsx17(
|
|
8553
|
+
/* @__PURE__ */ jsx17(X4, { className: "h-4 w-4" }),
|
|
8496
8554
|
/* @__PURE__ */ jsx17("span", { className: "sr-only", children: "Close" })
|
|
8497
8555
|
] })
|
|
8498
8556
|
]
|
|
@@ -8528,13 +8586,13 @@ var DialogBody = ({
|
|
|
8528
8586
|
children,
|
|
8529
8587
|
...props
|
|
8530
8588
|
}) => {
|
|
8531
|
-
const mergedStyle =
|
|
8589
|
+
const mergedStyle = React11.useMemo(() => {
|
|
8532
8590
|
return {
|
|
8533
8591
|
...maxHeight && { maxHeight },
|
|
8534
8592
|
...style
|
|
8535
8593
|
};
|
|
8536
8594
|
}, [maxHeight, style]);
|
|
8537
|
-
const processedHtmlContent =
|
|
8595
|
+
const processedHtmlContent = React11.useMemo(() => {
|
|
8538
8596
|
if (!htmlContent || !allowHtml) {
|
|
8539
8597
|
return null;
|
|
8540
8598
|
}
|
|
@@ -8596,8 +8654,8 @@ var DialogFooter = ({
|
|
|
8596
8654
|
}
|
|
8597
8655
|
);
|
|
8598
8656
|
DialogFooter.displayName = "DialogFooter";
|
|
8599
|
-
var DialogTitle =
|
|
8600
|
-
const processedHtmlContent =
|
|
8657
|
+
var DialogTitle = React11.forwardRef(({ className, htmlContent, allowHtml = true, children, ...props }, ref) => {
|
|
8658
|
+
const processedHtmlContent = React11.useMemo(() => {
|
|
8601
8659
|
if (!htmlContent || !allowHtml) {
|
|
8602
8660
|
return null;
|
|
8603
8661
|
}
|
|
@@ -8621,8 +8679,8 @@ var DialogTitle = React10.forwardRef(({ className, htmlContent, allowHtml = true
|
|
|
8621
8679
|
);
|
|
8622
8680
|
});
|
|
8623
8681
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
8624
|
-
var DialogDescription =
|
|
8625
|
-
const processedHtmlContent =
|
|
8682
|
+
var DialogDescription = React11.forwardRef(({ className, htmlContent, allowHtml = true, children, ...props }, ref) => {
|
|
8683
|
+
const processedHtmlContent = React11.useMemo(() => {
|
|
8626
8684
|
if (!htmlContent || !allowHtml) {
|
|
8627
8685
|
return null;
|
|
8628
8686
|
}
|
|
@@ -8886,12 +8944,12 @@ function DataTableModals({
|
|
|
8886
8944
|
}
|
|
8887
8945
|
|
|
8888
8946
|
// src/components/DataTable/components/DataTableErrorBoundary.tsx
|
|
8889
|
-
import
|
|
8947
|
+
import React15, { Component } from "react";
|
|
8890
8948
|
|
|
8891
8949
|
// src/components/Alert/Alert.tsx
|
|
8892
|
-
import * as
|
|
8950
|
+
import * as React14 from "react";
|
|
8893
8951
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
8894
|
-
var AlertContext =
|
|
8952
|
+
var AlertContext = React14.createContext({ variant: "default" });
|
|
8895
8953
|
var getAlertClasses = (variant = "default") => {
|
|
8896
8954
|
const baseClasses = "relative w-full rounded-lg border p-4";
|
|
8897
8955
|
const variantClasses = {
|
|
@@ -8902,10 +8960,10 @@ var getAlertClasses = (variant = "default") => {
|
|
|
8902
8960
|
};
|
|
8903
8961
|
return `${baseClasses} ${variantClasses[variant]}`;
|
|
8904
8962
|
};
|
|
8905
|
-
var Alert =
|
|
8906
|
-
const contextValue =
|
|
8963
|
+
var Alert = React14.forwardRef(({ className, variant = "default", ...props }, ref) => {
|
|
8964
|
+
const contextValue = React14.useMemo(() => ({ variant }), [variant]);
|
|
8907
8965
|
if (variant === "inline") {
|
|
8908
|
-
return /* @__PURE__ */ jsx20(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx20(
|
|
8966
|
+
return /* @__PURE__ */ jsx20(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx20(React14.Fragment, { ...props }) });
|
|
8909
8967
|
}
|
|
8910
8968
|
return /* @__PURE__ */ jsx20(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx20(
|
|
8911
8969
|
"div",
|
|
@@ -8918,8 +8976,8 @@ var Alert = React13.forwardRef(({ className, variant = "default", ...props }, re
|
|
|
8918
8976
|
) });
|
|
8919
8977
|
});
|
|
8920
8978
|
Alert.displayName = "Alert";
|
|
8921
|
-
var AlertTitle =
|
|
8922
|
-
const { variant } =
|
|
8979
|
+
var AlertTitle = React14.forwardRef(({ className, ...props }, ref) => {
|
|
8980
|
+
const { variant } = React14.useContext(AlertContext);
|
|
8923
8981
|
if (variant === "inline") {
|
|
8924
8982
|
return /* @__PURE__ */ jsx20("strong", { ...props });
|
|
8925
8983
|
}
|
|
@@ -8933,8 +8991,8 @@ var AlertTitle = React13.forwardRef(({ className, ...props }, ref) => {
|
|
|
8933
8991
|
);
|
|
8934
8992
|
});
|
|
8935
8993
|
AlertTitle.displayName = "AlertTitle";
|
|
8936
|
-
var AlertDescription =
|
|
8937
|
-
const { variant } =
|
|
8994
|
+
var AlertDescription = React14.forwardRef(({ className, ...props }, ref) => {
|
|
8995
|
+
const { variant } = React14.useContext(AlertContext);
|
|
8938
8996
|
if (variant === "inline") {
|
|
8939
8997
|
return /* @__PURE__ */ jsx20("span", { ...props });
|
|
8940
8998
|
}
|
|
@@ -9069,7 +9127,7 @@ var DataTableErrorBoundary = class extends Component {
|
|
|
9069
9127
|
};
|
|
9070
9128
|
|
|
9071
9129
|
// src/components/DataTable/hooks/useColumnOrderPersistence.ts
|
|
9072
|
-
import { useState as useState5, useEffect as useEffect7, useCallback as
|
|
9130
|
+
import { useState as useState5, useEffect as useEffect7, useCallback as useCallback4 } from "react";
|
|
9073
9131
|
function useColumnOrderPersistence({
|
|
9074
9132
|
tableId,
|
|
9075
9133
|
defaultOrder = [],
|
|
@@ -9103,7 +9161,7 @@ function useColumnOrderPersistence({
|
|
|
9103
9161
|
setIsLoaded(true);
|
|
9104
9162
|
}
|
|
9105
9163
|
}, [enablePersistence, finalStorageKey, storageKey, tableId]);
|
|
9106
|
-
const saveColumnOrder =
|
|
9164
|
+
const saveColumnOrder = useCallback4((newOrder) => {
|
|
9107
9165
|
if (!enablePersistence || typeof window === "undefined") return;
|
|
9108
9166
|
if (!storageKey && !tableId) return;
|
|
9109
9167
|
try {
|
|
@@ -9112,11 +9170,11 @@ function useColumnOrderPersistence({
|
|
|
9112
9170
|
logger.warn("Failed to save column order to localStorage:", error);
|
|
9113
9171
|
}
|
|
9114
9172
|
}, [enablePersistence, finalStorageKey, storageKey, tableId]);
|
|
9115
|
-
const updateColumnOrder =
|
|
9173
|
+
const updateColumnOrder = useCallback4((newOrder) => {
|
|
9116
9174
|
setColumnOrder(newOrder);
|
|
9117
9175
|
saveColumnOrder(newOrder);
|
|
9118
9176
|
}, [saveColumnOrder]);
|
|
9119
|
-
const resetColumnOrder =
|
|
9177
|
+
const resetColumnOrder = useCallback4(() => {
|
|
9120
9178
|
setColumnOrder(defaultOrder);
|
|
9121
9179
|
if (enablePersistence && (storageKey || tableId) && typeof window !== "undefined") {
|
|
9122
9180
|
try {
|
|
@@ -9126,7 +9184,7 @@ function useColumnOrderPersistence({
|
|
|
9126
9184
|
}
|
|
9127
9185
|
}
|
|
9128
9186
|
}, [defaultOrder, enablePersistence, finalStorageKey, storageKey, tableId]);
|
|
9129
|
-
const clearAllPreferences =
|
|
9187
|
+
const clearAllPreferences = useCallback4(() => {
|
|
9130
9188
|
if (!enablePersistence || typeof window === "undefined") return;
|
|
9131
9189
|
try {
|
|
9132
9190
|
const keys = Object.keys(localStorage);
|
|
@@ -9149,7 +9207,7 @@ function useColumnOrderPersistence({
|
|
|
9149
9207
|
}
|
|
9150
9208
|
|
|
9151
9209
|
// src/components/DataTable/hooks/useColumnVisibilityPersistence.ts
|
|
9152
|
-
import { useState as useState6, useEffect as useEffect8, useCallback as
|
|
9210
|
+
import { useState as useState6, useEffect as useEffect8, useCallback as useCallback5 } from "react";
|
|
9153
9211
|
function useColumnVisibilityPersistence({
|
|
9154
9212
|
tableId,
|
|
9155
9213
|
defaultVisibility = {},
|
|
@@ -9179,7 +9237,7 @@ function useColumnVisibilityPersistence({
|
|
|
9179
9237
|
setIsLoaded(true);
|
|
9180
9238
|
}
|
|
9181
9239
|
}, [enablePersistence, finalStorageKey]);
|
|
9182
|
-
const saveColumnVisibility =
|
|
9240
|
+
const saveColumnVisibility = useCallback5((newVisibility) => {
|
|
9183
9241
|
if (!enablePersistence || typeof window === "undefined") return;
|
|
9184
9242
|
try {
|
|
9185
9243
|
localStorage.setItem(finalStorageKey, JSON.stringify(newVisibility));
|
|
@@ -9187,11 +9245,11 @@ function useColumnVisibilityPersistence({
|
|
|
9187
9245
|
logger.warn("Failed to save column visibility to localStorage:", error);
|
|
9188
9246
|
}
|
|
9189
9247
|
}, [enablePersistence, finalStorageKey]);
|
|
9190
|
-
const updateColumnVisibility =
|
|
9248
|
+
const updateColumnVisibility = useCallback5((newVisibility) => {
|
|
9191
9249
|
setColumnVisibility(newVisibility);
|
|
9192
9250
|
saveColumnVisibility(newVisibility);
|
|
9193
9251
|
}, [saveColumnVisibility]);
|
|
9194
|
-
const resetColumnVisibility =
|
|
9252
|
+
const resetColumnVisibility = useCallback5(() => {
|
|
9195
9253
|
setColumnVisibility(defaultVisibility);
|
|
9196
9254
|
if (enablePersistence && typeof window !== "undefined") {
|
|
9197
9255
|
try {
|
|
@@ -9201,7 +9259,7 @@ function useColumnVisibilityPersistence({
|
|
|
9201
9259
|
}
|
|
9202
9260
|
}
|
|
9203
9261
|
}, [defaultVisibility, enablePersistence, finalStorageKey]);
|
|
9204
|
-
const clearAllPreferences =
|
|
9262
|
+
const clearAllPreferences = useCallback5(() => {
|
|
9205
9263
|
if (!enablePersistence || typeof window === "undefined") return;
|
|
9206
9264
|
try {
|
|
9207
9265
|
const keys = Object.keys(localStorage);
|
|
@@ -9224,7 +9282,7 @@ function useColumnVisibilityPersistence({
|
|
|
9224
9282
|
}
|
|
9225
9283
|
|
|
9226
9284
|
// src/components/DataTable/hooks/useDataTableState.ts
|
|
9227
|
-
import { useReducer, useCallback as
|
|
9285
|
+
import { useReducer, useCallback as useCallback6, useMemo as useMemo6 } from "react";
|
|
9228
9286
|
function dataTableReducer(state, action) {
|
|
9229
9287
|
switch (action.type) {
|
|
9230
9288
|
case "SET_SORTING":
|
|
@@ -9360,7 +9418,7 @@ function useDataTableState({
|
|
|
9360
9418
|
hasFilters: state.columnFilters.length > 0 || state.searchQuery !== "",
|
|
9361
9419
|
canClearFilters: state.columnFilters.length > 0 || state.searchQuery !== ""
|
|
9362
9420
|
}), [state]);
|
|
9363
|
-
const clearFilters =
|
|
9421
|
+
const clearFilters = useCallback6(() => {
|
|
9364
9422
|
dispatch({ type: "SET_COLUMN_FILTERS", payload: [] });
|
|
9365
9423
|
dispatch({ type: "SET_SEARCH_QUERY", payload: "" });
|
|
9366
9424
|
}, []);
|
|
@@ -9376,7 +9434,7 @@ function useDataTableState({
|
|
|
9376
9434
|
import { useMemo as useMemo8 } from "react";
|
|
9377
9435
|
|
|
9378
9436
|
// src/components/DataTable/hooks/useHierarchicalState.ts
|
|
9379
|
-
import { useState as useState7, useCallback as
|
|
9437
|
+
import { useState as useState7, useCallback as useCallback7, useMemo as useMemo7, useEffect as useEffect9 } from "react";
|
|
9380
9438
|
function useHierarchicalState(data, config) {
|
|
9381
9439
|
const initialExpandedState = useMemo7(() => {
|
|
9382
9440
|
if (!config?.defaultExpanded) {
|
|
@@ -9438,7 +9496,7 @@ function useHierarchicalState(data, config) {
|
|
|
9438
9496
|
}
|
|
9439
9497
|
return visible;
|
|
9440
9498
|
}, [data, expandedRows, parentChildMap]);
|
|
9441
|
-
const toggleRow =
|
|
9499
|
+
const toggleRow = useCallback7((rowId) => {
|
|
9442
9500
|
setExpandedRows((prev) => {
|
|
9443
9501
|
const newSet = new Set(prev);
|
|
9444
9502
|
if (newSet.has(rowId)) {
|
|
@@ -9452,32 +9510,32 @@ function useHierarchicalState(data, config) {
|
|
|
9452
9510
|
return newSet;
|
|
9453
9511
|
});
|
|
9454
9512
|
}, [config]);
|
|
9455
|
-
const expandAll =
|
|
9513
|
+
const expandAll = useCallback7(() => {
|
|
9456
9514
|
const parentIds = data.filter((row) => row.isParent).map((row) => row.id);
|
|
9457
9515
|
setExpandedRows(new Set(parentIds));
|
|
9458
9516
|
if (config?.onExpandedChange) {
|
|
9459
9517
|
config.onExpandedChange(parentIds);
|
|
9460
9518
|
}
|
|
9461
9519
|
}, [data, config]);
|
|
9462
|
-
const collapseAll =
|
|
9520
|
+
const collapseAll = useCallback7(() => {
|
|
9463
9521
|
setExpandedRows(/* @__PURE__ */ new Set());
|
|
9464
9522
|
if (config?.onExpandedChange) {
|
|
9465
9523
|
config.onExpandedChange([]);
|
|
9466
9524
|
}
|
|
9467
9525
|
}, [config]);
|
|
9468
|
-
const isExpanded =
|
|
9526
|
+
const isExpanded = useCallback7((rowId) => {
|
|
9469
9527
|
return expandedRows.has(rowId);
|
|
9470
9528
|
}, [expandedRows]);
|
|
9471
|
-
const hasChildren =
|
|
9529
|
+
const hasChildren = useCallback7((rowId) => {
|
|
9472
9530
|
return parentChildMap.has(rowId) && (parentChildMap.get(rowId)?.length || 0) > 0;
|
|
9473
9531
|
}, [parentChildMap]);
|
|
9474
|
-
const getChildrenCount =
|
|
9532
|
+
const getChildrenCount = useCallback7((rowId) => {
|
|
9475
9533
|
return parentChildMap.get(rowId)?.length || 0;
|
|
9476
9534
|
}, [parentChildMap]);
|
|
9477
|
-
const getExpandedIds =
|
|
9535
|
+
const getExpandedIds = useCallback7(() => {
|
|
9478
9536
|
return Array.from(expandedRows);
|
|
9479
9537
|
}, [expandedRows]);
|
|
9480
|
-
const setExpandedIds =
|
|
9538
|
+
const setExpandedIds = useCallback7((ids) => {
|
|
9481
9539
|
setExpandedRows(new Set(ids));
|
|
9482
9540
|
}, []);
|
|
9483
9541
|
return {
|
|
@@ -9658,7 +9716,7 @@ function useDataTableDataPipeline({
|
|
|
9658
9716
|
}
|
|
9659
9717
|
|
|
9660
9718
|
// src/components/DataTable/hooks/useServerSideDataEffect.ts
|
|
9661
|
-
import { useCallback as
|
|
9719
|
+
import { useCallback as useCallback8, useEffect as useEffect10 } from "react";
|
|
9662
9720
|
function useServerSideDataEffect({
|
|
9663
9721
|
finalPaginationMode,
|
|
9664
9722
|
serverSide,
|
|
@@ -9671,7 +9729,7 @@ function useServerSideDataEffect({
|
|
|
9671
9729
|
fetchServerData,
|
|
9672
9730
|
cleanup
|
|
9673
9731
|
}) {
|
|
9674
|
-
const handleServerSideChange =
|
|
9732
|
+
const handleServerSideChange = useCallback8(async () => {
|
|
9675
9733
|
if (finalPaginationMode !== "server" || !serverSide) {
|
|
9676
9734
|
return;
|
|
9677
9735
|
}
|
|
@@ -9738,7 +9796,7 @@ function useEffectiveColumnOrder({
|
|
|
9738
9796
|
}
|
|
9739
9797
|
|
|
9740
9798
|
// src/components/DataTable/hooks/useTableHandlers.ts
|
|
9741
|
-
import { useCallback as
|
|
9799
|
+
import { useCallback as useCallback9, useMemo as useMemo10 } from "react";
|
|
9742
9800
|
function useTableHandlers({
|
|
9743
9801
|
state,
|
|
9744
9802
|
stateSnapshot,
|
|
@@ -9752,15 +9810,15 @@ function useTableHandlers({
|
|
|
9752
9810
|
updateColumnOrder,
|
|
9753
9811
|
onLayoutChange
|
|
9754
9812
|
}) {
|
|
9755
|
-
const handleSortingChange =
|
|
9813
|
+
const handleSortingChange = useCallback9((updaterOrValue) => {
|
|
9756
9814
|
const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.sorting) : updaterOrValue;
|
|
9757
9815
|
actions.setSorting(nextValue);
|
|
9758
9816
|
}, [actions, stateSnapshot.sorting]);
|
|
9759
|
-
const handleColumnFiltersChange =
|
|
9817
|
+
const handleColumnFiltersChange = useCallback9((updaterOrValue) => {
|
|
9760
9818
|
const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.columnFilters) : updaterOrValue;
|
|
9761
9819
|
actions.setColumnFilters(nextValue);
|
|
9762
9820
|
}, [actions, stateSnapshot.columnFilters]);
|
|
9763
|
-
const handleColumnVisibilityChange =
|
|
9821
|
+
const handleColumnVisibilityChange = useCallback9((updaterOrValue) => {
|
|
9764
9822
|
const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.columnVisibility) : updaterOrValue;
|
|
9765
9823
|
actions.setColumnVisibility(nextValue);
|
|
9766
9824
|
if (canPersistVisibility) {
|
|
@@ -9771,7 +9829,7 @@ function useTableHandlers({
|
|
|
9771
9829
|
columnVisibility: nextValue
|
|
9772
9830
|
});
|
|
9773
9831
|
}, [actions, stateSnapshot.columnVisibility, canPersistVisibility, updateSavedColumnVisibility, onLayoutChange, effectiveColumnOrder]);
|
|
9774
|
-
const handleRowSelectionChange =
|
|
9832
|
+
const handleRowSelectionChange = useCallback9((updaterOrValue) => {
|
|
9775
9833
|
const currentSelection = selection ?? state.rowSelection;
|
|
9776
9834
|
const nextSelection = typeof updaterOrValue === "function" ? updaterOrValue(currentSelection) : updaterOrValue;
|
|
9777
9835
|
if (selection === void 0) {
|
|
@@ -9780,19 +9838,19 @@ function useTableHandlers({
|
|
|
9780
9838
|
}
|
|
9781
9839
|
onRowSelectionChange?.(nextSelection);
|
|
9782
9840
|
}, [actions, selection, state.rowSelection, onRowSelectionChange]);
|
|
9783
|
-
const handleGroupingChange =
|
|
9841
|
+
const handleGroupingChange = useCallback9((updaterOrValue) => {
|
|
9784
9842
|
const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.grouping) : updaterOrValue;
|
|
9785
9843
|
actions.setGrouping(nextValue);
|
|
9786
9844
|
}, [actions, stateSnapshot.grouping]);
|
|
9787
|
-
const handleExpandedChange =
|
|
9845
|
+
const handleExpandedChange = useCallback9((updaterOrValue) => {
|
|
9788
9846
|
const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.expanded) : updaterOrValue;
|
|
9789
9847
|
actions.setExpanded(nextValue);
|
|
9790
9848
|
}, [actions, stateSnapshot.expanded]);
|
|
9791
|
-
const handlePaginationChange =
|
|
9849
|
+
const handlePaginationChange = useCallback9((updaterOrValue) => {
|
|
9792
9850
|
const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.pagination) : updaterOrValue;
|
|
9793
9851
|
actions.setPagination(nextValue);
|
|
9794
9852
|
}, [actions, stateSnapshot.pagination]);
|
|
9795
|
-
const handleColumnOrderChange =
|
|
9853
|
+
const handleColumnOrderChange = useCallback9((updaterOrValue) => {
|
|
9796
9854
|
const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.columnOrder) : updaterOrValue;
|
|
9797
9855
|
const normalizedOrder = nextValue.includes("select") ? ["select", ...nextValue.filter((id) => id !== "select")] : nextValue;
|
|
9798
9856
|
actions.setColumnOrder(normalizedOrder);
|
|
@@ -9908,7 +9966,7 @@ function useDataTableConfiguration({
|
|
|
9908
9966
|
}
|
|
9909
9967
|
|
|
9910
9968
|
// src/components/Card/Card.tsx
|
|
9911
|
-
import * as
|
|
9969
|
+
import * as React16 from "react";
|
|
9912
9970
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
9913
9971
|
function getCardClasses(variant = "default", size = "default") {
|
|
9914
9972
|
const baseClasses = "rounded-lg border bg-card text-card-foreground shadow-sm";
|
|
@@ -9924,7 +9982,7 @@ function getCardClasses(variant = "default", size = "default") {
|
|
|
9924
9982
|
};
|
|
9925
9983
|
return `${baseClasses} ${variantClasses[variant]} ${sizeClasses2[size]}`;
|
|
9926
9984
|
}
|
|
9927
|
-
var Card =
|
|
9985
|
+
var Card = React16.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
9928
9986
|
"article",
|
|
9929
9987
|
{
|
|
9930
9988
|
ref,
|
|
@@ -9937,7 +9995,7 @@ var Card = React15.forwardRef(({ className, variant, size, ...props }, ref) => /
|
|
|
9937
9995
|
}
|
|
9938
9996
|
));
|
|
9939
9997
|
Card.displayName = "Card";
|
|
9940
|
-
var CardHeader =
|
|
9998
|
+
var CardHeader = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
9941
9999
|
"header",
|
|
9942
10000
|
{
|
|
9943
10001
|
ref,
|
|
@@ -9946,7 +10004,7 @@ var CardHeader = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
9946
10004
|
}
|
|
9947
10005
|
));
|
|
9948
10006
|
CardHeader.displayName = "CardHeader";
|
|
9949
|
-
var CardTitle =
|
|
10007
|
+
var CardTitle = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
9950
10008
|
"h3",
|
|
9951
10009
|
{
|
|
9952
10010
|
ref,
|
|
@@ -9958,7 +10016,7 @@ var CardTitle = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
9958
10016
|
}
|
|
9959
10017
|
));
|
|
9960
10018
|
CardTitle.displayName = "CardTitle";
|
|
9961
|
-
var CardDescription =
|
|
10019
|
+
var CardDescription = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
9962
10020
|
"p",
|
|
9963
10021
|
{
|
|
9964
10022
|
ref,
|
|
@@ -9967,7 +10025,7 @@ var CardDescription = React15.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
9967
10025
|
}
|
|
9968
10026
|
));
|
|
9969
10027
|
CardDescription.displayName = "CardDescription";
|
|
9970
|
-
var CardContent =
|
|
10028
|
+
var CardContent = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
9971
10029
|
"main",
|
|
9972
10030
|
{
|
|
9973
10031
|
ref,
|
|
@@ -9976,7 +10034,7 @@ var CardContent = React15.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
9976
10034
|
}
|
|
9977
10035
|
));
|
|
9978
10036
|
CardContent.displayName = "CardContent";
|
|
9979
|
-
var CardFooter =
|
|
10037
|
+
var CardFooter = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
9980
10038
|
"footer",
|
|
9981
10039
|
{
|
|
9982
10040
|
ref,
|
|
@@ -9985,7 +10043,7 @@ var CardFooter = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
9985
10043
|
}
|
|
9986
10044
|
));
|
|
9987
10045
|
CardFooter.displayName = "CardFooter";
|
|
9988
|
-
var CardActions =
|
|
10046
|
+
var CardActions = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
9989
10047
|
"nav",
|
|
9990
10048
|
{
|
|
9991
10049
|
ref,
|
|
@@ -9996,7 +10054,7 @@ var CardActions = React15.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
9996
10054
|
}
|
|
9997
10055
|
));
|
|
9998
10056
|
CardActions.displayName = "CardActions";
|
|
9999
|
-
var HoverCard =
|
|
10057
|
+
var HoverCard = React16.forwardRef(({ children, className, ...props }, ref) => {
|
|
10000
10058
|
return /* @__PURE__ */ jsx22(
|
|
10001
10059
|
"section",
|
|
10002
10060
|
{
|
|
@@ -10008,7 +10066,7 @@ var HoverCard = React15.forwardRef(({ children, className, ...props }, ref) => {
|
|
|
10008
10066
|
);
|
|
10009
10067
|
});
|
|
10010
10068
|
HoverCard.displayName = "HoverCard";
|
|
10011
|
-
var HoverCardTrigger =
|
|
10069
|
+
var HoverCardTrigger = React16.forwardRef(({ className, asChild, children, ...props }, ref) => {
|
|
10012
10070
|
if (asChild) {
|
|
10013
10071
|
return /* @__PURE__ */ jsx22("span", { className: cn("cursor-pointer", className), children });
|
|
10014
10072
|
}
|
|
@@ -10027,7 +10085,7 @@ var HoverCardTrigger = React15.forwardRef(({ className, asChild, children, ...pr
|
|
|
10027
10085
|
);
|
|
10028
10086
|
});
|
|
10029
10087
|
HoverCardTrigger.displayName = "HoverCardTrigger";
|
|
10030
|
-
var HoverCardContent =
|
|
10088
|
+
var HoverCardContent = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
10031
10089
|
"aside",
|
|
10032
10090
|
{
|
|
10033
10091
|
ref,
|
|
@@ -10333,7 +10391,7 @@ function useDataTablePermissions(rbac, features = {}) {
|
|
|
10333
10391
|
}
|
|
10334
10392
|
|
|
10335
10393
|
// src/components/DataTable/hooks/useTableColumns.ts
|
|
10336
|
-
import
|
|
10394
|
+
import React17, { useMemo as useMemo13 } from "react";
|
|
10337
10395
|
|
|
10338
10396
|
// src/components/DataTable/core/ColumnFactory.ts
|
|
10339
10397
|
var ColumnFactory = class {
|
|
@@ -10526,14 +10584,14 @@ function useTableColumns({
|
|
|
10526
10584
|
header: ({ table }) => {
|
|
10527
10585
|
const isAllSelected = table.getIsAllPageRowsSelected();
|
|
10528
10586
|
const isSomeSelected = table.getIsSomePageRowsSelected();
|
|
10529
|
-
return
|
|
10587
|
+
return React17.createElement(Checkbox, {
|
|
10530
10588
|
checked: isAllSelected ? true : isSomeSelected ? "indeterminate" : false,
|
|
10531
10589
|
onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value),
|
|
10532
10590
|
"aria-label": "Select all"
|
|
10533
10591
|
});
|
|
10534
10592
|
},
|
|
10535
10593
|
cell: ({ row }) => {
|
|
10536
|
-
return
|
|
10594
|
+
return React17.createElement(Checkbox, {
|
|
10537
10595
|
checked: row.getIsSelected(),
|
|
10538
10596
|
onCheckedChange: (value) => row.toggleSelected(!!value),
|
|
10539
10597
|
"aria-label": "Select row"
|
|
@@ -10722,7 +10780,7 @@ function getRowDescription(rowIndex, totalRows, isSelected = false, isEditing =
|
|
|
10722
10780
|
}
|
|
10723
10781
|
|
|
10724
10782
|
// src/components/DataTable/hooks/useKeyboardNavigation.ts
|
|
10725
|
-
import { useCallback as
|
|
10783
|
+
import { useCallback as useCallback10, useEffect as useEffect11, useRef as useRef6, useState as useState8 } from "react";
|
|
10726
10784
|
function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
10727
10785
|
const {
|
|
10728
10786
|
enabled = true,
|
|
@@ -10741,7 +10799,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
10741
10799
|
const tableRef = externalTableRef || internalTableRef;
|
|
10742
10800
|
const storedFocusRef = useRef6(null);
|
|
10743
10801
|
const navigationTimeoutRef = useRef6();
|
|
10744
|
-
const getCellElement =
|
|
10802
|
+
const getCellElement = useCallback10((rowIndex, columnIndex) => {
|
|
10745
10803
|
if (!tableRef.current) return null;
|
|
10746
10804
|
const tbody = tableRef.current.querySelector("tbody");
|
|
10747
10805
|
if (!tbody) return null;
|
|
@@ -10751,7 +10809,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
10751
10809
|
const cells = row.querySelectorAll('td[role="cell"], th[role="columnheader"]');
|
|
10752
10810
|
return cells[columnIndex] || null;
|
|
10753
10811
|
}, []);
|
|
10754
|
-
const getHeaderElement =
|
|
10812
|
+
const getHeaderElement = useCallback10((columnIndex) => {
|
|
10755
10813
|
if (!tableRef.current) return null;
|
|
10756
10814
|
const thead = tableRef.current.querySelector("thead");
|
|
10757
10815
|
if (!thead) return null;
|
|
@@ -10760,7 +10818,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
10760
10818
|
const headers = headerRow.querySelectorAll('th[role="columnheader"]');
|
|
10761
10819
|
return headers[columnIndex] || null;
|
|
10762
10820
|
}, []);
|
|
10763
|
-
const focusCell =
|
|
10821
|
+
const focusCell = useCallback10((rowIndex, columnIndex) => {
|
|
10764
10822
|
if (!enabled) return;
|
|
10765
10823
|
const clampedRowIndex = Math.max(0, Math.min(rowIndex, rowCount - 1));
|
|
10766
10824
|
const clampedColumnIndex = Math.max(0, Math.min(columnIndex, columnCount - 1));
|
|
@@ -10779,7 +10837,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
10779
10837
|
announce(`Row ${clampedRowIndex + 1}, Column ${clampedColumnIndex + 1}`);
|
|
10780
10838
|
}
|
|
10781
10839
|
}, [enabled, rowCount, columnCount, getCellElement, onFocusChange, announceNavigation]);
|
|
10782
|
-
const focusNext =
|
|
10840
|
+
const focusNext = useCallback10(() => {
|
|
10783
10841
|
const { focusedRowIndex, focusedColumnIndex } = state;
|
|
10784
10842
|
if (focusedColumnIndex < columnCount - 1) {
|
|
10785
10843
|
focusCell(focusedRowIndex, focusedColumnIndex + 1);
|
|
@@ -10787,7 +10845,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
10787
10845
|
focusCell(focusedRowIndex + 1, 0);
|
|
10788
10846
|
}
|
|
10789
10847
|
}, [state, columnCount, rowCount, focusCell]);
|
|
10790
|
-
const focusPrevious =
|
|
10848
|
+
const focusPrevious = useCallback10(() => {
|
|
10791
10849
|
const { focusedRowIndex, focusedColumnIndex } = state;
|
|
10792
10850
|
if (focusedColumnIndex > 0) {
|
|
10793
10851
|
focusCell(focusedRowIndex, focusedColumnIndex - 1);
|
|
@@ -10795,37 +10853,37 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
10795
10853
|
focusCell(focusedRowIndex - 1, columnCount - 1);
|
|
10796
10854
|
}
|
|
10797
10855
|
}, [state, columnCount, focusCell]);
|
|
10798
|
-
const focusUp =
|
|
10856
|
+
const focusUp = useCallback10(() => {
|
|
10799
10857
|
const { focusedRowIndex, focusedColumnIndex } = state;
|
|
10800
10858
|
if (focusedRowIndex > 0) {
|
|
10801
10859
|
focusCell(focusedRowIndex - 1, focusedColumnIndex);
|
|
10802
10860
|
}
|
|
10803
10861
|
}, [state, focusCell]);
|
|
10804
|
-
const focusDown =
|
|
10862
|
+
const focusDown = useCallback10(() => {
|
|
10805
10863
|
const { focusedRowIndex, focusedColumnIndex } = state;
|
|
10806
10864
|
if (focusedRowIndex < rowCount - 1) {
|
|
10807
10865
|
focusCell(focusedRowIndex + 1, focusedColumnIndex);
|
|
10808
10866
|
}
|
|
10809
10867
|
}, [state, rowCount, focusCell]);
|
|
10810
|
-
const focusRowStart =
|
|
10868
|
+
const focusRowStart = useCallback10(() => {
|
|
10811
10869
|
const { focusedRowIndex } = state;
|
|
10812
10870
|
focusCell(focusedRowIndex, 0);
|
|
10813
10871
|
}, [state, focusCell]);
|
|
10814
|
-
const focusRowEnd =
|
|
10872
|
+
const focusRowEnd = useCallback10(() => {
|
|
10815
10873
|
const { focusedRowIndex } = state;
|
|
10816
10874
|
focusCell(focusedRowIndex, columnCount - 1);
|
|
10817
10875
|
}, [state, columnCount, focusCell]);
|
|
10818
|
-
const focusTableStart =
|
|
10876
|
+
const focusTableStart = useCallback10(() => {
|
|
10819
10877
|
focusCell(0, 0);
|
|
10820
10878
|
}, [focusCell]);
|
|
10821
|
-
const focusTableEnd =
|
|
10879
|
+
const focusTableEnd = useCallback10(() => {
|
|
10822
10880
|
focusCell(rowCount - 1, columnCount - 1);
|
|
10823
10881
|
}, [rowCount, columnCount, focusCell]);
|
|
10824
|
-
const getCellTabIndex =
|
|
10882
|
+
const getCellTabIndex = useCallback10((rowIndex, columnIndex) => {
|
|
10825
10883
|
if (!enabled) return -1;
|
|
10826
10884
|
return state.focusedRowIndex === rowIndex && state.focusedColumnIndex === columnIndex ? 0 : -1;
|
|
10827
10885
|
}, [enabled, state.focusedRowIndex, state.focusedColumnIndex]);
|
|
10828
|
-
const getCellKeyboardHandlers =
|
|
10886
|
+
const getCellKeyboardHandlers = useCallback10((rowIndex, columnIndex) => {
|
|
10829
10887
|
const onKeyDown = (event) => {
|
|
10830
10888
|
if (!enabled) return;
|
|
10831
10889
|
switch (event.key) {
|
|
@@ -10905,7 +10963,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
10905
10963
|
};
|
|
10906
10964
|
return { onKeyDown, onFocus, onBlur };
|
|
10907
10965
|
}, [enabled, focusNext, focusPrevious, focusUp, focusDown, focusRowStart, focusRowEnd, focusTableStart, focusTableEnd, onFocusChange]);
|
|
10908
|
-
const getHeaderKeyboardHandlers =
|
|
10966
|
+
const getHeaderKeyboardHandlers = useCallback10((columnIndex, onSort) => {
|
|
10909
10967
|
const onKeyDown = (event) => {
|
|
10910
10968
|
if (!enabled) return;
|
|
10911
10969
|
switch (event.key) {
|
|
@@ -10963,20 +11021,20 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
10963
11021
|
};
|
|
10964
11022
|
return { onKeyDown, onFocus };
|
|
10965
11023
|
}, [enabled, getHeaderElement, columnCount, supportsColumnReorder, supportsColumnResize]);
|
|
10966
|
-
const resetFocus =
|
|
11024
|
+
const resetFocus = useCallback10(() => {
|
|
10967
11025
|
setState({
|
|
10968
11026
|
focusedRowIndex: 0,
|
|
10969
11027
|
focusedColumnIndex: 0,
|
|
10970
11028
|
isNavigating: false
|
|
10971
11029
|
});
|
|
10972
11030
|
}, []);
|
|
10973
|
-
const storeFocus =
|
|
11031
|
+
const storeFocus = useCallback10(() => {
|
|
10974
11032
|
storedFocusRef.current = {
|
|
10975
11033
|
rowIndex: state.focusedRowIndex,
|
|
10976
11034
|
columnIndex: state.focusedColumnIndex
|
|
10977
11035
|
};
|
|
10978
11036
|
}, [state.focusedRowIndex, state.focusedColumnIndex]);
|
|
10979
|
-
const restoreFocus =
|
|
11037
|
+
const restoreFocus = useCallback10(() => {
|
|
10980
11038
|
if (storedFocusRef.current) {
|
|
10981
11039
|
const { rowIndex, columnIndex } = storedFocusRef.current;
|
|
10982
11040
|
focusCell(rowIndex, columnIndex);
|
|
@@ -11129,7 +11187,7 @@ function DataTableInternal({
|
|
|
11129
11187
|
initializeLiveRegion();
|
|
11130
11188
|
}, []);
|
|
11131
11189
|
const rowSelection = selection !== void 0 ? selection : state.rowSelection;
|
|
11132
|
-
const resolvedGetRowId =
|
|
11190
|
+
const resolvedGetRowId = useCallback11(
|
|
11133
11191
|
(row, index) => getRowIdSafe(row, index, getRowId),
|
|
11134
11192
|
[getRowId]
|
|
11135
11193
|
);
|
|
@@ -11313,12 +11371,13 @@ function DataTableInternal({
|
|
|
11313
11371
|
finalDataCount
|
|
11314
11372
|
]);
|
|
11315
11373
|
const isLoading = externalIsLoading || performanceLoading;
|
|
11316
|
-
const handleSearch =
|
|
11374
|
+
const handleSearch = useCallback11((value) => {
|
|
11317
11375
|
stateActions.setSearchQuery(value);
|
|
11376
|
+
setSearchQuery(value);
|
|
11318
11377
|
if (secureFeatures.pagination) {
|
|
11319
11378
|
stateActions.setPagination({ ...state.pagination, pageIndex: 0 });
|
|
11320
11379
|
}
|
|
11321
|
-
}, [stateActions, secureFeatures.pagination, state.pagination]);
|
|
11380
|
+
}, [stateActions, setSearchQuery, secureFeatures.pagination, state.pagination]);
|
|
11322
11381
|
useServerSideDataEffect({
|
|
11323
11382
|
finalPaginationMode,
|
|
11324
11383
|
serverSide,
|
|
@@ -11761,10 +11820,11 @@ function DataTableInternal({
|
|
|
11761
11820
|
grouping: state.grouping,
|
|
11762
11821
|
aggregates,
|
|
11763
11822
|
getRowId: resolvedGetRowId,
|
|
11764
|
-
emptyState:
|
|
11823
|
+
emptyState: React18.isValidElement(emptyState) ? void 0 : emptyState,
|
|
11765
11824
|
isFiltered: searchQuery !== "" || state.columnFilters.length > 0,
|
|
11766
11825
|
onClearFilters: () => {
|
|
11767
11826
|
stateActions.setSearchQuery("");
|
|
11827
|
+
setSearchQuery("");
|
|
11768
11828
|
stateActions.setColumnFilters([]);
|
|
11769
11829
|
},
|
|
11770
11830
|
enableFiltering: secureFeatures.filtering,
|
|
@@ -11824,30 +11884,30 @@ function DataTableCore(props) {
|
|
|
11824
11884
|
// src/components/DataTable/DataTable.tsx
|
|
11825
11885
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
11826
11886
|
function DataTable(props) {
|
|
11827
|
-
const logger =
|
|
11887
|
+
const logger = React19.useMemo(() => createLogger("DataTable"), []);
|
|
11828
11888
|
const { features, ...rest } = props;
|
|
11829
11889
|
console.log("[DataTable] \u{1F3AF} DataTable WRAPPER called:", {
|
|
11830
11890
|
dataLength: props.data?.length || 0,
|
|
11831
11891
|
columnsCount: props.columns?.length || 0,
|
|
11832
11892
|
pageName: props.rbac?.pageName || props.rbac?.pageId
|
|
11833
11893
|
});
|
|
11834
|
-
const normalizedFeatures =
|
|
11894
|
+
const normalizedFeatures = React19.useMemo(
|
|
11835
11895
|
() => normalizeDataTableFeatures(features),
|
|
11836
11896
|
[features]
|
|
11837
11897
|
);
|
|
11838
|
-
|
|
11898
|
+
React19.useEffect(() => {
|
|
11839
11899
|
if (!features && import.meta.env?.MODE === "development") {
|
|
11840
11900
|
logger.info("DataTable: no features provided; all capabilities default to disabled. Pass a features object to enable functionality.");
|
|
11841
11901
|
}
|
|
11842
11902
|
}, [features, logger]);
|
|
11843
|
-
|
|
11903
|
+
React19.useEffect(() => {
|
|
11844
11904
|
if (normalizedFeatures.deleteSelected && !normalizedFeatures.deletion) {
|
|
11845
11905
|
logger.warn("deleteSelected requires deletion to be enabled");
|
|
11846
11906
|
}
|
|
11847
11907
|
}, [normalizedFeatures.deleteSelected, normalizedFeatures.deletion, logger]);
|
|
11848
11908
|
return /* @__PURE__ */ jsx25(DataTableCore, { ...rest, features: normalizedFeatures });
|
|
11849
11909
|
}
|
|
11850
|
-
var DataTableComponent =
|
|
11910
|
+
var DataTableComponent = React19.memo(DataTable);
|
|
11851
11911
|
|
|
11852
11912
|
// src/components/DataTable/components/BulkOperationsDropdown.tsx
|
|
11853
11913
|
import {
|
|
@@ -12059,4 +12119,4 @@ lodash/lodash.js:
|
|
|
12059
12119
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
12060
12120
|
*)
|
|
12061
12121
|
*/
|
|
12062
|
-
//# sourceMappingURL=chunk-
|
|
12122
|
+
//# sourceMappingURL=chunk-PRM6EYO3.js.map
|