@jmruthers/pace-core 0.5.126 → 0.5.128
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-6FN7XDXA.js → DataTable-3Z5HLOWF.js} +6 -6
- package/dist/{PublicLoadingSpinner-CaoRbHvJ.d.ts → PublicLoadingSpinner-CUAnTvcg.d.ts} +41 -21
- package/dist/{UnifiedAuthProvider-6C47WIML.js → UnifiedAuthProvider-CQDZRJIS.js} +3 -3
- package/dist/{chunk-QXGLU2O5.js → chunk-27MGXDD6.js} +282 -147
- package/dist/chunk-27MGXDD6.js.map +1 -0
- package/dist/{chunk-ZBLK676C.js → chunk-3CG5L6RN.js} +1 -19
- package/dist/chunk-3CG5L6RN.js.map +1 -0
- package/dist/{chunk-35ZDPMBM.js → chunk-BYXRHAIF.js} +3 -3
- package/dist/{chunk-IJOZZOGT.js → chunk-CQZU6TFE.js} +5 -5
- package/dist/{chunk-C43QIDN3.js → chunk-CTJRBUX2.js} +2 -2
- package/dist/{chunk-R4CRQUJJ.js → chunk-ENE3AB75.js} +463 -453
- package/dist/chunk-ENE3AB75.js.map +1 -0
- package/dist/{chunk-ESJTIADP.js → chunk-F64FFPOZ.js} +5 -15
- package/dist/{chunk-ESJTIADP.js.map → chunk-F64FFPOZ.js.map} +1 -1
- package/dist/{chunk-4MXVZVNS.js → chunk-TGIY2AR2.js} +2 -2
- package/dist/{chunk-XN6GWKMV.js → chunk-VZ5OR6HD.js} +161 -14
- package/dist/chunk-VZ5OR6HD.js.map +1 -0
- package/dist/{chunk-QWNJCQXZ.js → chunk-ZV77RZMU.js} +2 -2
- package/dist/{chunk-NZGLXZGP.js → chunk-ZYZCRSBD.js} +3 -54
- package/dist/chunk-ZYZCRSBD.js.map +1 -0
- package/dist/components.d.ts +1 -1
- package/dist/components.js +9 -9
- package/dist/hooks.js +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- package/dist/providers.js +2 -2
- package/dist/rbac/index.js +7 -7
- package/dist/utils.d.ts +1 -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/EventAppRoleData.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/GrantEventAppRoleParams.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 +27 -27
- 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 +10 -62
- 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/RevokeEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RoleManagementResult.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 +53 -28
- package/docs/api-reference/components.md +24 -0
- package/docs/api-reference/types.md +28 -0
- package/docs/architecture/rpc-function-standards.md +39 -5
- package/docs/implementation-guides/data-tables.md +55 -10
- package/docs/implementation-guides/permission-enforcement.md +4 -0
- package/docs/rbac/super-admin-guide.md +43 -5
- package/package.json +1 -1
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/DataTable/__tests__/DataTable.export.test.tsx +702 -0
- package/src/components/DataTable/components/DataTableCore.tsx +55 -36
- package/src/components/DataTable/components/ImportModal.tsx +134 -2
- package/src/components/DataTable/index.ts +3 -1
- package/src/components/DataTable/types.ts +68 -0
- package/src/components/Dialog/Dialog.tsx +0 -13
- package/src/components/FileDisplay/FileDisplay.tsx +76 -0
- package/src/components/Header/Header.tsx +5 -0
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +72 -50
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +81 -1
- package/src/components/PublicLayout/PublicPageFooter.tsx +1 -1
- package/src/components/PublicLayout/PublicPageHeader.tsx +69 -128
- package/src/components/PublicLayout/PublicPageLayout.tsx +4 -4
- package/src/components/PublicLayout/PublicPageProvider.tsx +12 -3
- package/src/components/PublicLayout/__tests__/PublicPageFooter.test.tsx +1 -1
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +3 -18
- package/src/hooks/__tests__/useAppConfig.unit.test.ts +3 -1
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +11 -5
- package/src/hooks/__tests__/usePublicRouteParams.unit.test.ts +8 -7
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +41 -46
- package/src/hooks/public/usePublicFileDisplay.ts +176 -7
- package/src/hooks/public/usePublicRouteParams.ts +0 -12
- package/src/hooks/useAppConfig.ts +15 -6
- package/src/hooks/usePermissionCache.test.ts +12 -4
- package/src/hooks/usePermissionCache.ts +3 -19
- package/src/hooks/useSecureDataAccess.ts +0 -63
- package/src/services/EventService.ts +0 -19
- package/dist/chunk-NZGLXZGP.js.map +0 -1
- package/dist/chunk-QXGLU2O5.js.map +0 -1
- package/dist/chunk-R4CRQUJJ.js.map +0 -1
- package/dist/chunk-XN6GWKMV.js.map +0 -1
- package/dist/chunk-ZBLK676C.js.map +0 -1
- /package/dist/{DataTable-6FN7XDXA.js.map → DataTable-3Z5HLOWF.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-6C47WIML.js.map → UnifiedAuthProvider-CQDZRJIS.js.map} +0 -0
- /package/dist/{chunk-35ZDPMBM.js.map → chunk-BYXRHAIF.js.map} +0 -0
- /package/dist/{chunk-IJOZZOGT.js.map → chunk-CQZU6TFE.js.map} +0 -0
- /package/dist/{chunk-C43QIDN3.js.map → chunk-CTJRBUX2.js.map} +0 -0
- /package/dist/{chunk-4MXVZVNS.js.map → chunk-TGIY2AR2.js.map} +0 -0
- /package/dist/{chunk-QWNJCQXZ.js.map → chunk-ZV77RZMU.js.map} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCan,
|
|
3
3
|
useResolvedScope
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BYXRHAIF.js";
|
|
5
5
|
import {
|
|
6
6
|
toast,
|
|
7
7
|
useDataTablePerformance
|
|
8
8
|
} from "./chunk-GKHF54DI.js";
|
|
9
9
|
import {
|
|
10
10
|
init_UnifiedAuthProvider
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CTJRBUX2.js";
|
|
12
12
|
import {
|
|
13
13
|
useUnifiedAuth
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-3CG5L6RN.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 React21 from "react";
|
|
5506
5506
|
|
|
5507
5507
|
// src/components/DataTable/components/DataTableCore.tsx
|
|
5508
|
-
import
|
|
5508
|
+
import React20, { 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
|
|
|
@@ -5549,7 +5549,7 @@ function getButtonClasses(variant = "default", size = "default") {
|
|
|
5549
5549
|
outline: "border border-main-300 bg-background shadow-sm hover:bg-acc-400",
|
|
5550
5550
|
secondary: "bg-sec-100 text-sec-900 shadow-sm hover:bg-acc-400",
|
|
5551
5551
|
ghost: "hover:bg-acc-400",
|
|
5552
|
-
link: "text-
|
|
5552
|
+
link: "text-main-700 underline-offset-4 hover:underline hover:drop-shadow-lg hover:drop-shadow-acc-400"
|
|
5553
5553
|
};
|
|
5554
5554
|
const sizeClasses2 = {
|
|
5555
5555
|
default: "h-9 px-4 py-2",
|
|
@@ -8692,7 +8692,7 @@ function LoadingState() {
|
|
|
8692
8692
|
}
|
|
8693
8693
|
|
|
8694
8694
|
// src/components/DataTable/components/DataTableModals.tsx
|
|
8695
|
-
import
|
|
8695
|
+
import React15, { useEffect as useEffect6 } from "react";
|
|
8696
8696
|
|
|
8697
8697
|
// src/components/DataTable/components/ImportModal.tsx
|
|
8698
8698
|
import { useState as useState4, useRef as useRef4, useEffect as useEffect5 } from "react";
|
|
@@ -8976,21 +8976,10 @@ var DialogBody = ({
|
|
|
8976
8976
|
if (!htmlContent || !allowHtml) {
|
|
8977
8977
|
return null;
|
|
8978
8978
|
}
|
|
8979
|
-
console.log("\u{1F50D} Dialog HTML Debug:", {
|
|
8980
|
-
originalHtml: htmlContent,
|
|
8981
|
-
allowHtml,
|
|
8982
|
-
strictSanitization,
|
|
8983
|
-
logWarnings
|
|
8984
|
-
});
|
|
8985
8979
|
const result = renderSafeHtml(htmlContent, {
|
|
8986
8980
|
strict: strictSanitization,
|
|
8987
8981
|
logWarnings
|
|
8988
8982
|
});
|
|
8989
|
-
console.log("\u{1F50D} Dialog HTML Result:", {
|
|
8990
|
-
sanitizedHtml: result.html,
|
|
8991
|
-
isValid: result.isValid,
|
|
8992
|
-
warnings: result.warnings
|
|
8993
|
-
});
|
|
8994
8983
|
return result.html;
|
|
8995
8984
|
}, [htmlContent, allowHtml, strictSanitization, logWarnings]);
|
|
8996
8985
|
const hasHtmlContent = Boolean(htmlContent && allowHtml);
|
|
@@ -9083,9 +9072,38 @@ var DialogDescription = React12.forwardRef(({ className, htmlContent, allowHtml
|
|
|
9083
9072
|
});
|
|
9084
9073
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
9085
9074
|
|
|
9075
|
+
// src/components/Progress/Progress.tsx
|
|
9076
|
+
import * as React13 from "react";
|
|
9077
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
9078
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
9079
|
+
var Progress = React13.forwardRef(({ className, value, max = 100, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
9080
|
+
ProgressPrimitive.Root,
|
|
9081
|
+
{
|
|
9082
|
+
ref,
|
|
9083
|
+
className: cn(
|
|
9084
|
+
"relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
|
|
9085
|
+
className
|
|
9086
|
+
),
|
|
9087
|
+
...props,
|
|
9088
|
+
value,
|
|
9089
|
+
max,
|
|
9090
|
+
"aria-valuenow": value,
|
|
9091
|
+
"aria-valuemax": max,
|
|
9092
|
+
"aria-valuemin": 0,
|
|
9093
|
+
children: /* @__PURE__ */ jsx18(
|
|
9094
|
+
ProgressPrimitive.Indicator,
|
|
9095
|
+
{
|
|
9096
|
+
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
9097
|
+
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
9098
|
+
}
|
|
9099
|
+
)
|
|
9100
|
+
}
|
|
9101
|
+
));
|
|
9102
|
+
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
9103
|
+
|
|
9086
9104
|
// src/components/DataTable/components/ImportModal.tsx
|
|
9087
9105
|
import { Upload as Upload2, FileText, AlertCircle } from "lucide-react";
|
|
9088
|
-
import { jsx as
|
|
9106
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
9089
9107
|
function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
9090
9108
|
const logger = createLogger("ImportModal");
|
|
9091
9109
|
const [file, setFile] = useState4(null);
|
|
@@ -9094,6 +9112,7 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9094
9112
|
const [previewData, setPreviewData] = useState4(null);
|
|
9095
9113
|
const [totalCount, setTotalCount] = useState4(0);
|
|
9096
9114
|
const [validationErrors, setValidationErrors] = useState4([]);
|
|
9115
|
+
const [importProgress, setImportProgress] = useState4(null);
|
|
9097
9116
|
const fileInputRef = useRef4(null);
|
|
9098
9117
|
const isMountedRef = useRef4(true);
|
|
9099
9118
|
useEffect5(() => {
|
|
@@ -9109,6 +9128,7 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9109
9128
|
setError(null);
|
|
9110
9129
|
setValidationErrors([]);
|
|
9111
9130
|
setIsProcessing(false);
|
|
9131
|
+
setImportProgress(null);
|
|
9112
9132
|
if (fileInputRef.current) {
|
|
9113
9133
|
fileInputRef.current.value = "";
|
|
9114
9134
|
}
|
|
@@ -9169,20 +9189,96 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9169
9189
|
if (!file) return;
|
|
9170
9190
|
setIsProcessing(true);
|
|
9171
9191
|
setError(null);
|
|
9192
|
+
setImportProgress({ current: 0, total: 0, stage: "parsing" });
|
|
9172
9193
|
try {
|
|
9173
9194
|
const text = await file.text();
|
|
9174
|
-
const
|
|
9195
|
+
const lines = text.split("\n").filter((line) => line.trim());
|
|
9196
|
+
const totalLines = lines.length;
|
|
9197
|
+
if (totalLines < 2) {
|
|
9198
|
+
throw new Error("CSV must have at least a header row and one data row");
|
|
9199
|
+
}
|
|
9200
|
+
const CHUNK_SIZE = 1e3;
|
|
9201
|
+
const data = [];
|
|
9202
|
+
if (totalLines > CHUNK_SIZE) {
|
|
9203
|
+
const parseCSVLine = (line) => {
|
|
9204
|
+
const result2 = [];
|
|
9205
|
+
let current = "";
|
|
9206
|
+
let inQuotes = false;
|
|
9207
|
+
for (let i = 0; i < line.length; i++) {
|
|
9208
|
+
const char = line[i];
|
|
9209
|
+
if (char === '"') {
|
|
9210
|
+
inQuotes = !inQuotes;
|
|
9211
|
+
} else if (char === "," && !inQuotes) {
|
|
9212
|
+
result2.push(current.trim());
|
|
9213
|
+
current = "";
|
|
9214
|
+
} else {
|
|
9215
|
+
current += char;
|
|
9216
|
+
}
|
|
9217
|
+
}
|
|
9218
|
+
result2.push(current.trim());
|
|
9219
|
+
return result2;
|
|
9220
|
+
};
|
|
9221
|
+
const headers = parseCSVLine(lines[0]).map((h) => h.replace(/"/g, "").trim());
|
|
9222
|
+
for (let i = 1; i < totalLines; i += CHUNK_SIZE) {
|
|
9223
|
+
const chunkEnd = Math.min(i + CHUNK_SIZE, totalLines);
|
|
9224
|
+
const chunk = lines.slice(i, chunkEnd);
|
|
9225
|
+
chunk.forEach((line, index) => {
|
|
9226
|
+
const values = parseCSVLine(line).map((v) => v.replace(/"/g, "").trim());
|
|
9227
|
+
const row = {};
|
|
9228
|
+
headers.forEach((header, colIndex) => {
|
|
9229
|
+
row[header] = values[colIndex] || "";
|
|
9230
|
+
});
|
|
9231
|
+
data.push(row);
|
|
9232
|
+
});
|
|
9233
|
+
const processed = Math.min(chunkEnd - 1, totalLines - 1);
|
|
9234
|
+
if (isMountedRef.current) {
|
|
9235
|
+
setImportProgress({
|
|
9236
|
+
current: processed,
|
|
9237
|
+
total: totalLines - 1,
|
|
9238
|
+
stage: "parsing"
|
|
9239
|
+
});
|
|
9240
|
+
}
|
|
9241
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
9242
|
+
}
|
|
9243
|
+
} else {
|
|
9244
|
+
const parsedData = processCSV(text);
|
|
9245
|
+
data.push(...parsedData);
|
|
9246
|
+
if (isMountedRef.current) {
|
|
9247
|
+
setImportProgress({
|
|
9248
|
+
current: totalLines - 1,
|
|
9249
|
+
total: totalLines - 1,
|
|
9250
|
+
stage: "parsing"
|
|
9251
|
+
});
|
|
9252
|
+
}
|
|
9253
|
+
}
|
|
9254
|
+
if (isMountedRef.current) {
|
|
9255
|
+
setImportProgress({
|
|
9256
|
+
current: 0,
|
|
9257
|
+
total: data.length,
|
|
9258
|
+
stage: "importing"
|
|
9259
|
+
});
|
|
9260
|
+
}
|
|
9175
9261
|
const result = onImport(data);
|
|
9176
9262
|
if (result && typeof result.then === "function") {
|
|
9177
9263
|
await result;
|
|
9178
9264
|
}
|
|
9265
|
+
if (isMountedRef.current) {
|
|
9266
|
+
setImportProgress({
|
|
9267
|
+
current: data.length,
|
|
9268
|
+
total: data.length,
|
|
9269
|
+
stage: "importing"
|
|
9270
|
+
});
|
|
9271
|
+
}
|
|
9272
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
9179
9273
|
onClose();
|
|
9180
9274
|
setFile(null);
|
|
9181
9275
|
} catch (err) {
|
|
9182
9276
|
setError(err instanceof Error ? err.message : "Failed to process file");
|
|
9277
|
+
setImportProgress(null);
|
|
9183
9278
|
} finally {
|
|
9184
9279
|
if (isMountedRef.current) {
|
|
9185
9280
|
setIsProcessing(false);
|
|
9281
|
+
setImportProgress(null);
|
|
9186
9282
|
}
|
|
9187
9283
|
}
|
|
9188
9284
|
};
|
|
@@ -9192,6 +9288,7 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9192
9288
|
setPreviewData(null);
|
|
9193
9289
|
setTotalCount(0);
|
|
9194
9290
|
setValidationErrors([]);
|
|
9291
|
+
setImportProgress(null);
|
|
9195
9292
|
onClose();
|
|
9196
9293
|
};
|
|
9197
9294
|
const handleFileSelect = async (event) => {
|
|
@@ -9218,16 +9315,16 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9218
9315
|
}
|
|
9219
9316
|
}
|
|
9220
9317
|
};
|
|
9221
|
-
return /* @__PURE__ */
|
|
9318
|
+
return /* @__PURE__ */ jsx19(Dialog, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs14(DialogContent, { className: "sm:max-w-2xl bg-main-50", children: [
|
|
9222
9319
|
/* @__PURE__ */ jsxs14(DialogHeader, { children: [
|
|
9223
|
-
/* @__PURE__ */
|
|
9224
|
-
/* @__PURE__ */
|
|
9320
|
+
/* @__PURE__ */ jsx19(DialogTitle, { children: title }),
|
|
9321
|
+
/* @__PURE__ */ jsx19(DialogDescription, { children: description })
|
|
9225
9322
|
] }),
|
|
9226
9323
|
/* @__PURE__ */ jsxs14("div", { className: "space-y-4", children: [
|
|
9227
9324
|
/* @__PURE__ */ jsxs14("div", { className: "border-2 border-dashed border-sec-200 rounded-lg p-6 text-center", children: [
|
|
9228
|
-
/* @__PURE__ */
|
|
9229
|
-
/* @__PURE__ */
|
|
9230
|
-
file && /* @__PURE__ */
|
|
9325
|
+
/* @__PURE__ */ jsx19(FileText, { className: "h-8 w-8 mx-auto text-sec-400 mb-2" }),
|
|
9326
|
+
/* @__PURE__ */ jsx19("p", { className: "text-sec-600 mb-2", children: file ? `Selected: ${file.name}` : uploadText }),
|
|
9327
|
+
file && /* @__PURE__ */ jsx19("p", { className: "text-xs text-sec-500", children: "File selected, processing preview..." }),
|
|
9231
9328
|
/* @__PURE__ */ jsxs14(
|
|
9232
9329
|
Button,
|
|
9233
9330
|
{
|
|
@@ -9235,12 +9332,12 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9235
9332
|
size: "sm",
|
|
9236
9333
|
onClick: () => fileInputRef.current?.click(),
|
|
9237
9334
|
children: [
|
|
9238
|
-
/* @__PURE__ */
|
|
9335
|
+
/* @__PURE__ */ jsx19(Upload2, { className: "h-4 w-4 mr-2" }),
|
|
9239
9336
|
selectFileButtonText
|
|
9240
9337
|
]
|
|
9241
9338
|
}
|
|
9242
9339
|
),
|
|
9243
|
-
/* @__PURE__ */
|
|
9340
|
+
/* @__PURE__ */ jsx19(
|
|
9244
9341
|
Input,
|
|
9245
9342
|
{
|
|
9246
9343
|
ref: fileInputRef,
|
|
@@ -9252,12 +9349,12 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9252
9349
|
)
|
|
9253
9350
|
] }),
|
|
9254
9351
|
error && /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 p-3 bg-acc-50 border border-acc-200 rounded text-acc-700", children: [
|
|
9255
|
-
/* @__PURE__ */
|
|
9256
|
-
/* @__PURE__ */
|
|
9352
|
+
/* @__PURE__ */ jsx19(AlertCircle, { className: "h-4 w-4" }),
|
|
9353
|
+
/* @__PURE__ */ jsx19("span", { className: "text-sm", children: error })
|
|
9257
9354
|
] }),
|
|
9258
9355
|
validationErrors.length > 0 && /* @__PURE__ */ jsxs14("div", { className: "space-y-2", children: [
|
|
9259
9356
|
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 p-3 bg-acc-50 border border-acc-200 rounded text-acc-700", children: [
|
|
9260
|
-
/* @__PURE__ */
|
|
9357
|
+
/* @__PURE__ */ jsx19(AlertCircle, { className: "h-4 w-4" }),
|
|
9261
9358
|
/* @__PURE__ */ jsxs14("span", { className: "text-sm font-medium", children: [
|
|
9262
9359
|
validationErrors.length,
|
|
9263
9360
|
" validation error",
|
|
@@ -9283,17 +9380,36 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9283
9380
|
] })
|
|
9284
9381
|
] })
|
|
9285
9382
|
] }),
|
|
9286
|
-
|
|
9287
|
-
/* @__PURE__ */
|
|
9288
|
-
|
|
9289
|
-
/* @__PURE__ */
|
|
9290
|
-
|
|
9383
|
+
importProgress && isProcessing && /* @__PURE__ */ jsxs14("div", { className: "space-y-2 p-4 bg-sec-50 rounded-lg border border-sec-200", children: [
|
|
9384
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between", children: [
|
|
9385
|
+
/* @__PURE__ */ jsx19("span", { className: "text-sm font-medium text-sec-900", children: importProgress.stage === "parsing" ? "Parsing CSV file..." : "Importing data..." }),
|
|
9386
|
+
/* @__PURE__ */ jsxs14("span", { className: "text-sm text-sec-600", children: [
|
|
9387
|
+
importProgress.current.toLocaleString(),
|
|
9388
|
+
" / ",
|
|
9389
|
+
importProgress.total.toLocaleString(),
|
|
9390
|
+
" rows"
|
|
9391
|
+
] })
|
|
9392
|
+
] }),
|
|
9393
|
+
/* @__PURE__ */ jsx19(
|
|
9394
|
+
Progress,
|
|
9395
|
+
{
|
|
9396
|
+
value: importProgress.total > 0 ? importProgress.current / importProgress.total * 100 : 0,
|
|
9397
|
+
className: "h-2 bg-sec-200"
|
|
9398
|
+
}
|
|
9399
|
+
),
|
|
9400
|
+
/* @__PURE__ */ jsx19("p", { className: "text-xs text-sec-500", children: importProgress.total > 0 && importProgress.current < importProgress.total ? `${Math.round(importProgress.current / importProgress.total * 100)}% complete` : importProgress.stage === "importing" && importProgress.current === 0 ? "Processing your data..." : importProgress.current === importProgress.total ? "Complete!" : "Processing..." })
|
|
9401
|
+
] }),
|
|
9402
|
+
file && previewData && previewData.length > 0 && !isProcessing ? /* @__PURE__ */ jsxs14("div", { className: "space-y-3", children: [
|
|
9403
|
+
/* @__PURE__ */ jsx19("h4", { className: "text-sec-900", children: previewHeaderText }),
|
|
9404
|
+
/* @__PURE__ */ jsx19("div", { className: "border rounded-lg overflow-hidden", children: /* @__PURE__ */ jsx19("div", { className: "overflow-x-auto max-h-48", children: /* @__PURE__ */ jsxs14("table", { className: "min-w-full text-xs", children: [
|
|
9405
|
+
/* @__PURE__ */ jsx19("thead", { className: "bg-sec-50", children: /* @__PURE__ */ jsx19("tr", { children: Object.keys(previewData[0]).map((header) => /* @__PURE__ */ jsx19("th", { className: "px-2 py-1 text-left font-medium text-sec-900 border-b", children: header }, header)) }) }),
|
|
9406
|
+
/* @__PURE__ */ jsx19("tbody", { children: previewData.map((row, index) => /* @__PURE__ */ jsx19("tr", { className: index % 2 === 0 ? "bg-app-main-50" : "bg-sec-50", children: Object.values(row).map((value, cellIndex) => /* @__PURE__ */ jsx19("td", { className: "px-2 py-1 text-sec-700 border-b", children: String(value) }, cellIndex)) }, index)) })
|
|
9291
9407
|
] }) }) }),
|
|
9292
|
-
/* @__PURE__ */
|
|
9293
|
-
] }) : !file ? /* @__PURE__ */
|
|
9408
|
+
/* @__PURE__ */ jsx19("p", { className: "text-sec-500", children: totalRowsText.replace("{count}", totalCount.toString()) })
|
|
9409
|
+
] }) : !file ? /* @__PURE__ */ jsx19("div", { className: "border rounded-lg p-6 text-center bg-sec-50", children: /* @__PURE__ */ jsx19("p", { className: "text-sec-500", children: "Select a CSV file to preview" }) }) : null,
|
|
9294
9410
|
/* @__PURE__ */ jsxs14("div", { className: "flex justify-end gap-2", children: [
|
|
9295
|
-
/* @__PURE__ */
|
|
9296
|
-
/* @__PURE__ */
|
|
9411
|
+
/* @__PURE__ */ jsx19(Button, { variant: "outline", onClick: handleClose, children: cancelButtonText }),
|
|
9412
|
+
/* @__PURE__ */ jsx19(
|
|
9297
9413
|
Button,
|
|
9298
9414
|
{
|
|
9299
9415
|
onClick: handleImport,
|
|
@@ -9307,7 +9423,7 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
9307
9423
|
}
|
|
9308
9424
|
|
|
9309
9425
|
// src/components/DataTable/components/DataTableModals.tsx
|
|
9310
|
-
import { Fragment as Fragment4, jsx as
|
|
9426
|
+
import { Fragment as Fragment4, jsx as jsx20 } from "react/jsx-runtime";
|
|
9311
9427
|
function mapCSVToTableColumns(csvData, columns) {
|
|
9312
9428
|
const logger = createLogger("mapCSVToTableColumns");
|
|
9313
9429
|
const columnMap = /* @__PURE__ */ new Map();
|
|
@@ -9389,7 +9505,7 @@ function DataTableModals({
|
|
|
9389
9505
|
onStoreFocus,
|
|
9390
9506
|
onRestoreFocus
|
|
9391
9507
|
}) {
|
|
9392
|
-
const logger =
|
|
9508
|
+
const logger = React15.useMemo(() => createLogger("DataTableModals"), []);
|
|
9393
9509
|
useEffect6(() => {
|
|
9394
9510
|
if (showImportModal) {
|
|
9395
9511
|
onStoreFocus?.();
|
|
@@ -9400,7 +9516,7 @@ function DataTableModals({
|
|
|
9400
9516
|
return () => clearTimeout(timeoutId);
|
|
9401
9517
|
}
|
|
9402
9518
|
}, [showImportModal, onStoreFocus, onRestoreFocus]);
|
|
9403
|
-
return /* @__PURE__ */
|
|
9519
|
+
return /* @__PURE__ */ jsx20(Fragment4, { children: /* @__PURE__ */ jsx20(
|
|
9404
9520
|
ImportModal,
|
|
9405
9521
|
{
|
|
9406
9522
|
isOpen: showImportModal,
|
|
@@ -9438,12 +9554,12 @@ function DataTableModals({
|
|
|
9438
9554
|
}
|
|
9439
9555
|
|
|
9440
9556
|
// src/components/DataTable/components/DataTableErrorBoundary.tsx
|
|
9441
|
-
import
|
|
9557
|
+
import React17, { Component } from "react";
|
|
9442
9558
|
|
|
9443
9559
|
// src/components/Alert/Alert.tsx
|
|
9444
|
-
import * as
|
|
9445
|
-
import { jsx as
|
|
9446
|
-
var AlertContext =
|
|
9560
|
+
import * as React16 from "react";
|
|
9561
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
9562
|
+
var AlertContext = React16.createContext({ variant: "default" });
|
|
9447
9563
|
var getAlertClasses = (variant = "default") => {
|
|
9448
9564
|
const baseClasses = "relative w-full rounded-lg border p-4";
|
|
9449
9565
|
const variantClasses = {
|
|
@@ -9454,12 +9570,12 @@ var getAlertClasses = (variant = "default") => {
|
|
|
9454
9570
|
};
|
|
9455
9571
|
return `${baseClasses} ${variantClasses[variant]}`;
|
|
9456
9572
|
};
|
|
9457
|
-
var Alert =
|
|
9458
|
-
const contextValue =
|
|
9573
|
+
var Alert = React16.forwardRef(({ className, variant = "default", ...props }, ref) => {
|
|
9574
|
+
const contextValue = React16.useMemo(() => ({ variant }), [variant]);
|
|
9459
9575
|
if (variant === "inline") {
|
|
9460
|
-
return /* @__PURE__ */
|
|
9576
|
+
return /* @__PURE__ */ jsx21(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx21(React16.Fragment, { ...props }) });
|
|
9461
9577
|
}
|
|
9462
|
-
return /* @__PURE__ */
|
|
9578
|
+
return /* @__PURE__ */ jsx21(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx21(
|
|
9463
9579
|
"div",
|
|
9464
9580
|
{
|
|
9465
9581
|
ref,
|
|
@@ -9470,12 +9586,12 @@ var Alert = React15.forwardRef(({ className, variant = "default", ...props }, re
|
|
|
9470
9586
|
) });
|
|
9471
9587
|
});
|
|
9472
9588
|
Alert.displayName = "Alert";
|
|
9473
|
-
var AlertTitle =
|
|
9474
|
-
const { variant } =
|
|
9589
|
+
var AlertTitle = React16.forwardRef(({ className, ...props }, ref) => {
|
|
9590
|
+
const { variant } = React16.useContext(AlertContext);
|
|
9475
9591
|
if (variant === "inline") {
|
|
9476
|
-
return /* @__PURE__ */
|
|
9592
|
+
return /* @__PURE__ */ jsx21("strong", { ...props });
|
|
9477
9593
|
}
|
|
9478
|
-
return /* @__PURE__ */
|
|
9594
|
+
return /* @__PURE__ */ jsx21(
|
|
9479
9595
|
"h5",
|
|
9480
9596
|
{
|
|
9481
9597
|
ref,
|
|
@@ -9485,12 +9601,12 @@ var AlertTitle = React15.forwardRef(({ className, ...props }, ref) => {
|
|
|
9485
9601
|
);
|
|
9486
9602
|
});
|
|
9487
9603
|
AlertTitle.displayName = "AlertTitle";
|
|
9488
|
-
var AlertDescription =
|
|
9489
|
-
const { variant } =
|
|
9604
|
+
var AlertDescription = React16.forwardRef(({ className, ...props }, ref) => {
|
|
9605
|
+
const { variant } = React16.useContext(AlertContext);
|
|
9490
9606
|
if (variant === "inline") {
|
|
9491
|
-
return /* @__PURE__ */
|
|
9607
|
+
return /* @__PURE__ */ jsx21("span", { ...props });
|
|
9492
9608
|
}
|
|
9493
|
-
return /* @__PURE__ */
|
|
9609
|
+
return /* @__PURE__ */ jsx21(
|
|
9494
9610
|
"p",
|
|
9495
9611
|
{
|
|
9496
9612
|
ref,
|
|
@@ -9502,7 +9618,7 @@ var AlertDescription = React15.forwardRef(({ className, ...props }, ref) => {
|
|
|
9502
9618
|
AlertDescription.displayName = "AlertDescription";
|
|
9503
9619
|
|
|
9504
9620
|
// src/components/DataTable/components/DataTableErrorBoundary.tsx
|
|
9505
|
-
import { Fragment as Fragment6, jsx as
|
|
9621
|
+
import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
9506
9622
|
var DataTableErrorBoundary = class extends Component {
|
|
9507
9623
|
constructor(props) {
|
|
9508
9624
|
super(props);
|
|
@@ -9574,11 +9690,11 @@ var DataTableErrorBoundary = class extends Component {
|
|
|
9574
9690
|
if (fallback) {
|
|
9575
9691
|
return fallback;
|
|
9576
9692
|
}
|
|
9577
|
-
return /* @__PURE__ */
|
|
9578
|
-
/* @__PURE__ */
|
|
9579
|
-
/* @__PURE__ */
|
|
9693
|
+
return /* @__PURE__ */ jsx22("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsxs15(Alert, { variant: "destructive", className: "max-w-md", children: [
|
|
9694
|
+
/* @__PURE__ */ jsx22(AlertTitle, { children: "DataTable Error" }),
|
|
9695
|
+
/* @__PURE__ */ jsx22(AlertDescription, { className: "mt-2", children: /* @__PURE__ */ jsx22("span", { children: "Something went wrong" }) }),
|
|
9580
9696
|
error && error.message ? /* @__PURE__ */ jsxs15("details", { className: "mt-2", children: [
|
|
9581
|
-
/* @__PURE__ */
|
|
9697
|
+
/* @__PURE__ */ jsx22("summary", { className: "cursor-pointer text-sm font-medium", children: "Error Details" }),
|
|
9582
9698
|
/* @__PURE__ */ jsxs15("pre", { className: "mt-2 text-xs overflow-auto max-h-32", children: [
|
|
9583
9699
|
error.message,
|
|
9584
9700
|
showErrorDetails && error.stack && /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
@@ -9586,7 +9702,7 @@ var DataTableErrorBoundary = class extends Component {
|
|
|
9586
9702
|
error.stack
|
|
9587
9703
|
] })
|
|
9588
9704
|
] })
|
|
9589
|
-
] }) : /* @__PURE__ */
|
|
9705
|
+
] }) : /* @__PURE__ */ jsx22("div", { className: "mt-2", children: /* @__PURE__ */ jsx22("span", { children: "An unexpected error occurred" }) }),
|
|
9590
9706
|
/* @__PURE__ */ jsxs15("div", { className: "mt-4 flex gap-2", children: [
|
|
9591
9707
|
showRetryButton && retryCount < maxRetries && /* @__PURE__ */ jsxs15(
|
|
9592
9708
|
Button,
|
|
@@ -9604,7 +9720,7 @@ var DataTableErrorBoundary = class extends Component {
|
|
|
9604
9720
|
]
|
|
9605
9721
|
}
|
|
9606
9722
|
),
|
|
9607
|
-
/* @__PURE__ */
|
|
9723
|
+
/* @__PURE__ */ jsx22(
|
|
9608
9724
|
Button,
|
|
9609
9725
|
{
|
|
9610
9726
|
variant: "outline",
|
|
@@ -10461,8 +10577,8 @@ function useDataTableConfiguration({
|
|
|
10461
10577
|
}
|
|
10462
10578
|
|
|
10463
10579
|
// src/components/Card/Card.tsx
|
|
10464
|
-
import * as
|
|
10465
|
-
import { jsx as
|
|
10580
|
+
import * as React18 from "react";
|
|
10581
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
10466
10582
|
function getCardClasses(variant = "default", size = "default") {
|
|
10467
10583
|
const baseClasses = "rounded-lg border bg-card text-card-foreground shadow-sm";
|
|
10468
10584
|
const variantClasses = {
|
|
@@ -10477,7 +10593,7 @@ function getCardClasses(variant = "default", size = "default") {
|
|
|
10477
10593
|
};
|
|
10478
10594
|
return `${baseClasses} ${variantClasses[variant]} ${sizeClasses2[size]}`;
|
|
10479
10595
|
}
|
|
10480
|
-
var Card =
|
|
10596
|
+
var Card = React18.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10481
10597
|
"article",
|
|
10482
10598
|
{
|
|
10483
10599
|
ref,
|
|
@@ -10490,7 +10606,7 @@ var Card = React17.forwardRef(({ className, variant, size, ...props }, ref) => /
|
|
|
10490
10606
|
}
|
|
10491
10607
|
));
|
|
10492
10608
|
Card.displayName = "Card";
|
|
10493
|
-
var CardHeader =
|
|
10609
|
+
var CardHeader = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10494
10610
|
"header",
|
|
10495
10611
|
{
|
|
10496
10612
|
ref,
|
|
@@ -10499,7 +10615,7 @@ var CardHeader = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
10499
10615
|
}
|
|
10500
10616
|
));
|
|
10501
10617
|
CardHeader.displayName = "CardHeader";
|
|
10502
|
-
var CardTitle =
|
|
10618
|
+
var CardTitle = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10503
10619
|
"h3",
|
|
10504
10620
|
{
|
|
10505
10621
|
ref,
|
|
@@ -10511,7 +10627,7 @@ var CardTitle = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
10511
10627
|
}
|
|
10512
10628
|
));
|
|
10513
10629
|
CardTitle.displayName = "CardTitle";
|
|
10514
|
-
var CardDescription =
|
|
10630
|
+
var CardDescription = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10515
10631
|
"p",
|
|
10516
10632
|
{
|
|
10517
10633
|
ref,
|
|
@@ -10520,7 +10636,7 @@ var CardDescription = React17.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
10520
10636
|
}
|
|
10521
10637
|
));
|
|
10522
10638
|
CardDescription.displayName = "CardDescription";
|
|
10523
|
-
var CardContent =
|
|
10639
|
+
var CardContent = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10524
10640
|
"main",
|
|
10525
10641
|
{
|
|
10526
10642
|
ref,
|
|
@@ -10529,7 +10645,7 @@ var CardContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
10529
10645
|
}
|
|
10530
10646
|
));
|
|
10531
10647
|
CardContent.displayName = "CardContent";
|
|
10532
|
-
var CardFooter =
|
|
10648
|
+
var CardFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10533
10649
|
"footer",
|
|
10534
10650
|
{
|
|
10535
10651
|
ref,
|
|
@@ -10538,7 +10654,7 @@ var CardFooter = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
10538
10654
|
}
|
|
10539
10655
|
));
|
|
10540
10656
|
CardFooter.displayName = "CardFooter";
|
|
10541
|
-
var CardActions =
|
|
10657
|
+
var CardActions = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10542
10658
|
"nav",
|
|
10543
10659
|
{
|
|
10544
10660
|
ref,
|
|
@@ -10549,8 +10665,8 @@ var CardActions = React17.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
10549
10665
|
}
|
|
10550
10666
|
));
|
|
10551
10667
|
CardActions.displayName = "CardActions";
|
|
10552
|
-
var HoverCard =
|
|
10553
|
-
return /* @__PURE__ */
|
|
10668
|
+
var HoverCard = React18.forwardRef(({ children, className, ...props }, ref) => {
|
|
10669
|
+
return /* @__PURE__ */ jsx23(
|
|
10554
10670
|
"section",
|
|
10555
10671
|
{
|
|
10556
10672
|
ref,
|
|
@@ -10561,11 +10677,11 @@ var HoverCard = React17.forwardRef(({ children, className, ...props }, ref) => {
|
|
|
10561
10677
|
);
|
|
10562
10678
|
});
|
|
10563
10679
|
HoverCard.displayName = "HoverCard";
|
|
10564
|
-
var HoverCardTrigger =
|
|
10680
|
+
var HoverCardTrigger = React18.forwardRef(({ className, asChild, children, ...props }, ref) => {
|
|
10565
10681
|
if (asChild) {
|
|
10566
|
-
return /* @__PURE__ */
|
|
10682
|
+
return /* @__PURE__ */ jsx23("span", { className: cn("cursor-pointer", className), children });
|
|
10567
10683
|
}
|
|
10568
|
-
return /* @__PURE__ */
|
|
10684
|
+
return /* @__PURE__ */ jsx23(
|
|
10569
10685
|
"button",
|
|
10570
10686
|
{
|
|
10571
10687
|
ref,
|
|
@@ -10580,7 +10696,7 @@ var HoverCardTrigger = React17.forwardRef(({ className, asChild, children, ...pr
|
|
|
10580
10696
|
);
|
|
10581
10697
|
});
|
|
10582
10698
|
HoverCardTrigger.displayName = "HoverCardTrigger";
|
|
10583
|
-
var HoverCardContent =
|
|
10699
|
+
var HoverCardContent = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
10584
10700
|
"aside",
|
|
10585
10701
|
{
|
|
10586
10702
|
ref,
|
|
@@ -10596,7 +10712,7 @@ HoverCardContent.displayName = "HoverCardContent";
|
|
|
10596
10712
|
|
|
10597
10713
|
// src/components/DataTable/components/AccessDeniedPage.tsx
|
|
10598
10714
|
import { ShieldX, ArrowLeft, RefreshCw } from "lucide-react";
|
|
10599
|
-
import { Fragment as Fragment7, jsx as
|
|
10715
|
+
import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10600
10716
|
function AccessDeniedPage({
|
|
10601
10717
|
resource,
|
|
10602
10718
|
operation = "access",
|
|
@@ -10620,19 +10736,19 @@ function AccessDeniedPage({
|
|
|
10620
10736
|
window.history.back();
|
|
10621
10737
|
}
|
|
10622
10738
|
};
|
|
10623
|
-
return /* @__PURE__ */
|
|
10624
|
-
/* @__PURE__ */
|
|
10739
|
+
return /* @__PURE__ */ jsx24("div", { className: `flex items-center justify-center min-h-[400px] p-8 ${className || ""}`, children: /* @__PURE__ */ jsx24(Card, { className: "max-w-md w-full text-center", children: /* @__PURE__ */ jsxs16("div", { className: "flex flex-col items-center space-y-6 p-8", children: [
|
|
10740
|
+
/* @__PURE__ */ jsx24("div", { className: "flex items-center justify-center w-16 h-16 rounded-full bg-acc-100", children: /* @__PURE__ */ jsx24(ShieldX, { className: "w-8 h-8 text-acc-600" }) }),
|
|
10625
10741
|
/* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
|
|
10626
|
-
/* @__PURE__ */
|
|
10627
|
-
/* @__PURE__ */
|
|
10742
|
+
/* @__PURE__ */ jsx24("h2", { className: "text-xl font-semibold text-sec-900", children: "Access Denied" }),
|
|
10743
|
+
/* @__PURE__ */ jsx24("p", { className: "text-sec-600", children: defaultMessage })
|
|
10628
10744
|
] }),
|
|
10629
10745
|
/* @__PURE__ */ jsxs16("div", { className: "text-sm text-sec-500 bg-sec-50 rounded-lg p-3 w-full", children: [
|
|
10630
|
-
/* @__PURE__ */
|
|
10746
|
+
/* @__PURE__ */ jsx24("strong", { children: "Resource:" }),
|
|
10631
10747
|
" ",
|
|
10632
10748
|
resource,
|
|
10633
10749
|
operation && /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
10634
|
-
/* @__PURE__ */
|
|
10635
|
-
/* @__PURE__ */
|
|
10750
|
+
/* @__PURE__ */ jsx24("br", {}),
|
|
10751
|
+
/* @__PURE__ */ jsx24("strong", { children: "Operation:" }),
|
|
10636
10752
|
" ",
|
|
10637
10753
|
operation
|
|
10638
10754
|
] })
|
|
@@ -10645,7 +10761,7 @@ function AccessDeniedPage({
|
|
|
10645
10761
|
onClick: handleRetry,
|
|
10646
10762
|
className: "flex-1",
|
|
10647
10763
|
children: [
|
|
10648
|
-
/* @__PURE__ */
|
|
10764
|
+
/* @__PURE__ */ jsx24(RefreshCw, { className: "w-4 h-4 mr-2" }),
|
|
10649
10765
|
"Retry"
|
|
10650
10766
|
]
|
|
10651
10767
|
}
|
|
@@ -10657,13 +10773,13 @@ function AccessDeniedPage({
|
|
|
10657
10773
|
onClick: handleBack,
|
|
10658
10774
|
className: "flex-1",
|
|
10659
10775
|
children: [
|
|
10660
|
-
/* @__PURE__ */
|
|
10776
|
+
/* @__PURE__ */ jsx24(ArrowLeft, { className: "w-4 h-4 mr-2" }),
|
|
10661
10777
|
"Go Back"
|
|
10662
10778
|
]
|
|
10663
10779
|
}
|
|
10664
10780
|
)
|
|
10665
10781
|
] }),
|
|
10666
|
-
/* @__PURE__ */
|
|
10782
|
+
/* @__PURE__ */ jsx24("div", { className: "text-xs text-sec-400", children: "If you believe this is an error, please contact your administrator." })
|
|
10667
10783
|
] }) }) });
|
|
10668
10784
|
}
|
|
10669
10785
|
|
|
@@ -10967,7 +11083,7 @@ function useDataTablePermissions(rbac, features = {}) {
|
|
|
10967
11083
|
}
|
|
10968
11084
|
|
|
10969
11085
|
// src/components/DataTable/hooks/useTableColumns.ts
|
|
10970
|
-
import
|
|
11086
|
+
import React19, { useMemo as useMemo13 } from "react";
|
|
10971
11087
|
|
|
10972
11088
|
// src/components/DataTable/core/ColumnFactory.ts
|
|
10973
11089
|
var ColumnFactory = class {
|
|
@@ -11173,14 +11289,14 @@ function useTableColumns({
|
|
|
11173
11289
|
header: ({ table }) => {
|
|
11174
11290
|
const isAllSelected = table.getIsAllPageRowsSelected();
|
|
11175
11291
|
const isSomeSelected = table.getIsSomePageRowsSelected();
|
|
11176
|
-
return
|
|
11292
|
+
return React19.createElement(Checkbox, {
|
|
11177
11293
|
checked: isAllSelected ? true : isSomeSelected ? "indeterminate" : false,
|
|
11178
11294
|
onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value),
|
|
11179
11295
|
"aria-label": "Select all"
|
|
11180
11296
|
});
|
|
11181
11297
|
},
|
|
11182
11298
|
cell: ({ row }) => {
|
|
11183
|
-
return
|
|
11299
|
+
return React19.createElement(Checkbox, {
|
|
11184
11300
|
checked: row.getIsSelected(),
|
|
11185
11301
|
onCheckedChange: (value) => row.toggleSelected(!!value),
|
|
11186
11302
|
"aria-label": "Select row"
|
|
@@ -11658,7 +11774,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
11658
11774
|
}
|
|
11659
11775
|
|
|
11660
11776
|
// src/components/DataTable/components/DataTableCore.tsx
|
|
11661
|
-
import { Fragment as Fragment8, jsx as
|
|
11777
|
+
import { Fragment as Fragment8, jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
11662
11778
|
var isCellValue = (value) => {
|
|
11663
11779
|
if (value === null || value === void 0) {
|
|
11664
11780
|
return true;
|
|
@@ -11725,7 +11841,7 @@ function DataTableInternal({
|
|
|
11725
11841
|
storageKey,
|
|
11726
11842
|
onLayoutChange
|
|
11727
11843
|
}) {
|
|
11728
|
-
const logger =
|
|
11844
|
+
const logger = React20.useMemo(() => createLogger("DataTableCore"), []);
|
|
11729
11845
|
const authResult = useUnifiedAuth();
|
|
11730
11846
|
const user = authResult.user;
|
|
11731
11847
|
const requestedFeatures = useMemo14(
|
|
@@ -12225,7 +12341,7 @@ function DataTableInternal({
|
|
|
12225
12341
|
throw new Error("DataTable requires authenticated user for RBAC");
|
|
12226
12342
|
}
|
|
12227
12343
|
if (permissions.canRead.isLoading) {
|
|
12228
|
-
return /* @__PURE__ */
|
|
12344
|
+
return /* @__PURE__ */ jsx25(LoadingComponent, {});
|
|
12229
12345
|
}
|
|
12230
12346
|
if (!permissions.canRead.can) {
|
|
12231
12347
|
logger.warn("Access denied - no read permission:", {
|
|
@@ -12233,10 +12349,10 @@ function DataTableInternal({
|
|
|
12233
12349
|
pageId: effectivePageId,
|
|
12234
12350
|
isLoading: permissions.canRead.isLoading
|
|
12235
12351
|
});
|
|
12236
|
-
return /* @__PURE__ */
|
|
12352
|
+
return /* @__PURE__ */ jsx25(AccessDeniedPage, { resource: effectivePageId || "unknown-page", operation: "read" });
|
|
12237
12353
|
}
|
|
12238
12354
|
if (isLoading) {
|
|
12239
|
-
return /* @__PURE__ */
|
|
12355
|
+
return /* @__PURE__ */ jsx25(LoadingComponent, {});
|
|
12240
12356
|
}
|
|
12241
12357
|
const PaginationComponent = enhancedPagination || finalPaginationMode !== "client" ? EnhancedPaginationControls : PaginationControls;
|
|
12242
12358
|
const visibleColumns = table?.getVisibleFlatColumns() || [];
|
|
@@ -12261,10 +12377,10 @@ function DataTableInternal({
|
|
|
12261
12377
|
children: [
|
|
12262
12378
|
/* @__PURE__ */ jsxs17("caption", { className: "text-left pb-2", children: [
|
|
12263
12379
|
(title || description) && /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
12264
|
-
title && /* @__PURE__ */
|
|
12265
|
-
description && /* @__PURE__ */
|
|
12380
|
+
title && /* @__PURE__ */ jsx25("h2", { children: title }),
|
|
12381
|
+
description && /* @__PURE__ */ jsx25("p", { id: "table-description", children: description })
|
|
12266
12382
|
] }),
|
|
12267
|
-
/* @__PURE__ */
|
|
12383
|
+
/* @__PURE__ */ jsx25(Fragment8, { children: /* @__PURE__ */ jsx25(
|
|
12268
12384
|
DataTableToolbar,
|
|
12269
12385
|
{
|
|
12270
12386
|
features: secureFeatures,
|
|
@@ -12286,7 +12402,7 @@ function DataTableInternal({
|
|
|
12286
12402
|
}
|
|
12287
12403
|
stateActions.setImportModal(true);
|
|
12288
12404
|
},
|
|
12289
|
-
onExport:
|
|
12405
|
+
onExport: async () => {
|
|
12290
12406
|
try {
|
|
12291
12407
|
const tableRows = table.getFilteredRowModel().rows;
|
|
12292
12408
|
const tableColumns = table.getAllColumns();
|
|
@@ -12303,24 +12419,42 @@ function DataTableInternal({
|
|
|
12303
12419
|
});
|
|
12304
12420
|
if (!originalCol) return;
|
|
12305
12421
|
columnIdToTableColumn.set(tableCol.id, tableCol);
|
|
12306
|
-
|
|
12307
|
-
const editAccessorKey = originalCol.editAccessorKey;
|
|
12308
|
-
const displayHeader = typeof originalCol.header === "string" ? originalCol.header : originalCol.accessorKey || tableCol.id || "Column";
|
|
12309
|
-
visibleColumns2.push({
|
|
12310
|
-
...originalCol,
|
|
12311
|
-
header: displayHeader,
|
|
12312
|
-
// Store table column ID for getValue() lookup
|
|
12313
|
-
id: tableCol.id,
|
|
12314
|
-
// Preserve accessorFn if present (will use getValue() if available)
|
|
12315
|
-
accessorFn: hasAccessorFn ? originalCol.accessorFn : void 0
|
|
12316
|
-
});
|
|
12422
|
+
visibleColumns2.push(originalCol);
|
|
12317
12423
|
});
|
|
12318
12424
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
12319
12425
|
const filename = title ? `${title.replace(/[^a-z0-9]/gi, "_").toLowerCase()}_${timestamp}.csv` : `data_export_${timestamp}.csv`;
|
|
12320
|
-
|
|
12426
|
+
const exportOptions = {
|
|
12427
|
+
tableRows,
|
|
12428
|
+
allColumns: columns,
|
|
12429
|
+
visibleColumns: visibleColumns2,
|
|
12430
|
+
columnIdToTableColumn,
|
|
12431
|
+
data,
|
|
12432
|
+
filename,
|
|
12433
|
+
table
|
|
12434
|
+
};
|
|
12435
|
+
if (secureHandlers.onExport) {
|
|
12436
|
+
await secureHandlers.onExport(exportOptions);
|
|
12437
|
+
return;
|
|
12438
|
+
}
|
|
12439
|
+
const exportColumns = exportOptions.visibleColumns.map((col) => {
|
|
12440
|
+
const colId = col.id || col.accessorKey;
|
|
12441
|
+
const hasAccessorFn = "accessorFn" in col && col.accessorFn;
|
|
12442
|
+
return {
|
|
12443
|
+
...col,
|
|
12444
|
+
header: typeof col.header === "string" ? col.header : col.accessorKey || colId || "Column",
|
|
12445
|
+
id: colId ? String(colId) : void 0,
|
|
12446
|
+
accessorFn: hasAccessorFn ? col.accessorFn : void 0
|
|
12447
|
+
};
|
|
12448
|
+
});
|
|
12449
|
+
await exportToCSVWithTableRows(
|
|
12450
|
+
exportOptions.tableRows,
|
|
12451
|
+
exportColumns,
|
|
12452
|
+
exportOptions.columnIdToTableColumn,
|
|
12453
|
+
exportOptions.filename
|
|
12454
|
+
);
|
|
12321
12455
|
toast({
|
|
12322
12456
|
title: "Export Successful",
|
|
12323
|
-
description: `Data exported to ${filename}`,
|
|
12457
|
+
description: `Data exported to ${exportOptions.filename}`,
|
|
12324
12458
|
variant: "default"
|
|
12325
12459
|
});
|
|
12326
12460
|
logger.debug("Export completed successfully");
|
|
@@ -12333,7 +12467,7 @@ function DataTableInternal({
|
|
|
12333
12467
|
variant: "destructive"
|
|
12334
12468
|
});
|
|
12335
12469
|
}
|
|
12336
|
-
}
|
|
12470
|
+
},
|
|
12337
12471
|
rowSelection,
|
|
12338
12472
|
onDeleteSelected: secureHandlers.onDeleteSelected ? async (selectedRows) => {
|
|
12339
12473
|
const selectedCount = Object.values(selectedRows).filter(Boolean).length;
|
|
@@ -12372,15 +12506,15 @@ function DataTableInternal({
|
|
|
12372
12506
|
) })
|
|
12373
12507
|
] }),
|
|
12374
12508
|
/* @__PURE__ */ jsxs17("colgroup", { children: [
|
|
12375
|
-
hasSelectColumn && /* @__PURE__ */
|
|
12376
|
-
/* @__PURE__ */
|
|
12377
|
-
hasActionsColumn && /* @__PURE__ */
|
|
12509
|
+
hasSelectColumn && /* @__PURE__ */ jsx25("col", { span: 1, "data-col-type": "select" }),
|
|
12510
|
+
/* @__PURE__ */ jsx25("col", { span: dataColumns, "data-col-type": "data" }),
|
|
12511
|
+
hasActionsColumn && /* @__PURE__ */ jsx25("col", { span: 1, "data-col-type": "actions" })
|
|
12378
12512
|
] }),
|
|
12379
|
-
/* @__PURE__ */
|
|
12513
|
+
/* @__PURE__ */ jsx25("thead", { children: table?.getHeaderGroups().map((headerGroup) => {
|
|
12380
12514
|
const visibleHeaders = headerGroup.headers.filter((header) => {
|
|
12381
12515
|
return typeof header.column.getIsVisible === "function" ? header.column.getIsVisible() : true;
|
|
12382
12516
|
});
|
|
12383
|
-
return /* @__PURE__ */
|
|
12517
|
+
return /* @__PURE__ */ jsx25("tr", { children: visibleHeaders.map((header, index) => {
|
|
12384
12518
|
const isFirst = index === 0;
|
|
12385
12519
|
const isLast = index === visibleHeaders.length - 1;
|
|
12386
12520
|
const isSortable = header.column.getCanSort();
|
|
@@ -12409,7 +12543,7 @@ function DataTableInternal({
|
|
|
12409
12543
|
announceSortChange(columnName, newSort);
|
|
12410
12544
|
}
|
|
12411
12545
|
);
|
|
12412
|
-
return /* @__PURE__ */
|
|
12546
|
+
return /* @__PURE__ */ jsx25(
|
|
12413
12547
|
"th",
|
|
12414
12548
|
{
|
|
12415
12549
|
className: cn(
|
|
@@ -12433,7 +12567,7 @@ function DataTableInternal({
|
|
|
12433
12567
|
tabIndex: 0,
|
|
12434
12568
|
children: [
|
|
12435
12569
|
typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header,
|
|
12436
|
-
header.column.getIsSorted() === "asc" ? /* @__PURE__ */
|
|
12570
|
+
header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx25(ChevronUp2, { className: "h-4 w-4" }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx25(ChevronDown3, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx25(ChevronsUpDown, { className: "h-4 w-4" })
|
|
12437
12571
|
]
|
|
12438
12572
|
}
|
|
12439
12573
|
) : typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header
|
|
@@ -12442,7 +12576,7 @@ function DataTableInternal({
|
|
|
12442
12576
|
);
|
|
12443
12577
|
}) }, headerGroup.id);
|
|
12444
12578
|
}) }),
|
|
12445
|
-
/* @__PURE__ */
|
|
12579
|
+
/* @__PURE__ */ jsx25(
|
|
12446
12580
|
UnifiedTableBody,
|
|
12447
12581
|
{
|
|
12448
12582
|
table,
|
|
@@ -12489,7 +12623,7 @@ function DataTableInternal({
|
|
|
12489
12623
|
grouping: state.grouping,
|
|
12490
12624
|
aggregates,
|
|
12491
12625
|
getRowId: resolvedGetRowId,
|
|
12492
|
-
emptyState:
|
|
12626
|
+
emptyState: React20.isValidElement(emptyState) ? void 0 : emptyState,
|
|
12493
12627
|
isFiltered: searchQuery !== "" || state.columnFilters.length > 0,
|
|
12494
12628
|
onClearFilters: () => {
|
|
12495
12629
|
stateActions.setSearchQuery("");
|
|
@@ -12514,7 +12648,7 @@ function DataTableInternal({
|
|
|
12514
12648
|
permissions
|
|
12515
12649
|
}
|
|
12516
12650
|
),
|
|
12517
|
-
secureFeatures.pagination && /* @__PURE__ */
|
|
12651
|
+
secureFeatures.pagination && /* @__PURE__ */ jsx25("tfoot", { children: /* @__PURE__ */ jsx25("tr", { children: /* @__PURE__ */ jsx25("td", { colSpan: visibleColumns.length, children: /* @__PURE__ */ jsx25(
|
|
12518
12652
|
PaginationComponent,
|
|
12519
12653
|
{
|
|
12520
12654
|
table,
|
|
@@ -12527,7 +12661,7 @@ function DataTableInternal({
|
|
|
12527
12661
|
]
|
|
12528
12662
|
}
|
|
12529
12663
|
),
|
|
12530
|
-
/* @__PURE__ */
|
|
12664
|
+
/* @__PURE__ */ jsx25(
|
|
12531
12665
|
DataTableModals,
|
|
12532
12666
|
{
|
|
12533
12667
|
showImportModal: state.showImportModal,
|
|
@@ -12578,31 +12712,31 @@ function DataTableInternal({
|
|
|
12578
12712
|
] });
|
|
12579
12713
|
}
|
|
12580
12714
|
function DataTableCore(props) {
|
|
12581
|
-
return /* @__PURE__ */
|
|
12715
|
+
return /* @__PURE__ */ jsx25(DataTableErrorBoundary, { children: /* @__PURE__ */ jsx25(DataTableInternal, { ...props }) });
|
|
12582
12716
|
}
|
|
12583
12717
|
|
|
12584
12718
|
// src/components/DataTable/DataTable.tsx
|
|
12585
|
-
import { jsx as
|
|
12719
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
12586
12720
|
function DataTable(props) {
|
|
12587
|
-
const logger =
|
|
12721
|
+
const logger = React21.useMemo(() => createLogger("DataTable"), []);
|
|
12588
12722
|
const { features, ...rest } = props;
|
|
12589
|
-
const normalizedFeatures =
|
|
12723
|
+
const normalizedFeatures = React21.useMemo(
|
|
12590
12724
|
() => normalizeDataTableFeatures(features),
|
|
12591
12725
|
[features]
|
|
12592
12726
|
);
|
|
12593
|
-
|
|
12727
|
+
React21.useEffect(() => {
|
|
12594
12728
|
if (!features && import.meta.env?.MODE === "development") {
|
|
12595
12729
|
logger.info("DataTable: no features provided; all capabilities default to disabled. Pass a features object to enable functionality.");
|
|
12596
12730
|
}
|
|
12597
12731
|
}, [features, logger]);
|
|
12598
|
-
|
|
12732
|
+
React21.useEffect(() => {
|
|
12599
12733
|
if (normalizedFeatures.deleteSelected && !normalizedFeatures.deletion) {
|
|
12600
12734
|
logger.warn("deleteSelected requires deletion to be enabled");
|
|
12601
12735
|
}
|
|
12602
12736
|
}, [normalizedFeatures.deleteSelected, normalizedFeatures.deletion, logger]);
|
|
12603
|
-
return /* @__PURE__ */
|
|
12737
|
+
return /* @__PURE__ */ jsx26(DataTableCore, { ...rest, features: normalizedFeatures });
|
|
12604
12738
|
}
|
|
12605
|
-
var DataTableComponent =
|
|
12739
|
+
var DataTableComponent = React21.memo(DataTable);
|
|
12606
12740
|
|
|
12607
12741
|
// src/components/DataTable/components/BulkOperationsDropdown.tsx
|
|
12608
12742
|
import {
|
|
@@ -12610,7 +12744,7 @@ import {
|
|
|
12610
12744
|
Download as Download2,
|
|
12611
12745
|
Trash as Trash3
|
|
12612
12746
|
} from "lucide-react";
|
|
12613
|
-
import { jsx as
|
|
12747
|
+
import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
12614
12748
|
function BulkOperationsDropdown({
|
|
12615
12749
|
operations,
|
|
12616
12750
|
selectedRows = {},
|
|
@@ -12639,7 +12773,7 @@ function BulkOperationsDropdown({
|
|
|
12639
12773
|
}
|
|
12640
12774
|
};
|
|
12641
12775
|
return /* @__PURE__ */ jsxs18(Select, { disabled: !hasSelection, children: [
|
|
12642
|
-
/* @__PURE__ */
|
|
12776
|
+
/* @__PURE__ */ jsx27(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs18(
|
|
12643
12777
|
Button,
|
|
12644
12778
|
{
|
|
12645
12779
|
variant: "outline",
|
|
@@ -12647,7 +12781,7 @@ function BulkOperationsDropdown({
|
|
|
12647
12781
|
disabled: !hasSelection,
|
|
12648
12782
|
className: `min-w-[140px] h-9 px-3 py-2 text-sm font-medium ${className || ""}`,
|
|
12649
12783
|
children: [
|
|
12650
|
-
/* @__PURE__ */
|
|
12784
|
+
/* @__PURE__ */ jsx27(MoreHorizontal2, { className: "h-4 w-4 mr-2 flex-shrink-0" }),
|
|
12651
12785
|
/* @__PURE__ */ jsxs18("span", { className: "truncate", children: [
|
|
12652
12786
|
"Bulk Actions (",
|
|
12653
12787
|
selectedCount,
|
|
@@ -12656,7 +12790,7 @@ function BulkOperationsDropdown({
|
|
|
12656
12790
|
]
|
|
12657
12791
|
}
|
|
12658
12792
|
) }),
|
|
12659
|
-
/* @__PURE__ */
|
|
12793
|
+
/* @__PURE__ */ jsx27(SelectContent, { className: "w-48 !bg-main-50 border border-sec-200 shadow-lg z-[9999]", style: { backgroundColor: "white" }, children: operations.map((operation) => {
|
|
12660
12794
|
const Icon = operationIcons[operation];
|
|
12661
12795
|
const label = operationLabels[operation];
|
|
12662
12796
|
const variant = operationVariants[operation];
|
|
@@ -12668,8 +12802,8 @@ function BulkOperationsDropdown({
|
|
|
12668
12802
|
disabled: !hasSelection,
|
|
12669
12803
|
className: `flex items-center gap-2 ${variant === "destructive" ? "text-destructive focus:text-destructive" : ""}`,
|
|
12670
12804
|
children: [
|
|
12671
|
-
/* @__PURE__ */
|
|
12672
|
-
/* @__PURE__ */
|
|
12805
|
+
/* @__PURE__ */ jsx27(Icon, { className: "h-4 w-4" }),
|
|
12806
|
+
/* @__PURE__ */ jsx27("span", { children: label })
|
|
12673
12807
|
]
|
|
12674
12808
|
},
|
|
12675
12809
|
operation
|
|
@@ -12680,7 +12814,7 @@ function BulkOperationsDropdown({
|
|
|
12680
12814
|
|
|
12681
12815
|
// src/components/DataTable/components/GroupHeader.tsx
|
|
12682
12816
|
import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight3 } from "lucide-react";
|
|
12683
|
-
import { jsx as
|
|
12817
|
+
import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
12684
12818
|
function GroupHeader({
|
|
12685
12819
|
row,
|
|
12686
12820
|
groupByColumn,
|
|
@@ -12690,14 +12824,14 @@ function GroupHeader({
|
|
|
12690
12824
|
}) {
|
|
12691
12825
|
const groupValue = row.getValue(groupByColumn);
|
|
12692
12826
|
return /* @__PURE__ */ jsxs19("div", { className: "flex items-center py-2 px-4 bg-muted/50 border-b font-medium", children: [
|
|
12693
|
-
/* @__PURE__ */
|
|
12827
|
+
/* @__PURE__ */ jsx28(
|
|
12694
12828
|
Button,
|
|
12695
12829
|
{
|
|
12696
12830
|
variant: "ghost",
|
|
12697
12831
|
size: "sm",
|
|
12698
12832
|
onClick: onToggle,
|
|
12699
12833
|
className: "p-0 h-auto mr-2",
|
|
12700
|
-
children: isExpanded ? /* @__PURE__ */
|
|
12834
|
+
children: isExpanded ? /* @__PURE__ */ jsx28(ChevronDown4, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx28(ChevronRight3, { className: "h-4 w-4" })
|
|
12701
12835
|
}
|
|
12702
12836
|
),
|
|
12703
12837
|
/* @__PURE__ */ jsxs19("span", { className: "text-sm", children: [
|
|
@@ -12739,6 +12873,7 @@ export {
|
|
|
12739
12873
|
AlertTitle,
|
|
12740
12874
|
AlertDescription,
|
|
12741
12875
|
Checkbox,
|
|
12876
|
+
Progress,
|
|
12742
12877
|
Select,
|
|
12743
12878
|
SelectTrigger,
|
|
12744
12879
|
SelectValue,
|
|
@@ -12815,4 +12950,4 @@ lodash/lodash.js:
|
|
|
12815
12950
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
12816
12951
|
*)
|
|
12817
12952
|
*/
|
|
12818
|
-
//# sourceMappingURL=chunk-
|
|
12953
|
+
//# sourceMappingURL=chunk-27MGXDD6.js.map
|