@jmruthers/pace-core 0.5.99 → 0.5.101
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-VSJWLCVT.js → DataTable-DXELRJIX.js} +2 -2
- package/dist/{PublicLoadingSpinner-B84QWsvB.d.ts → PublicLoadingSpinner-C2h8zg67.d.ts} +1 -1
- package/dist/{chunk-2PWJ6NFH.js → chunk-A5DFMP3O.js} +2 -2
- package/dist/{chunk-D7CZVI3K.js → chunk-EVVRUGQ2.js} +110 -52
- package/dist/{chunk-D7CZVI3K.js.map → chunk-EVVRUGQ2.js.map} +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- 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 +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- package/docs/api/interfaces/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 +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 +6 -6
- package/docs/implementation-guides/data-tables.md +19 -0
- package/package.json +1 -1
- package/src/components/DataTable/components/DataTableCore.tsx +56 -4
- package/src/components/DataTable/components/DataTableModals.tsx +28 -6
- package/src/components/DataTable/components/EditableRow.tsx +69 -73
- package/src/components/Dialog/Dialog.test.tsx +4 -3
- package/src/components/Dialog/Dialog.tsx +24 -18
- package/src/components/Dialog/examples/ScrollableDialogExample.tsx +290 -0
- /package/dist/{DataTable-VSJWLCVT.js.map → DataTable-DXELRJIX.js.map} +0 -0
- /package/dist/{chunk-2PWJ6NFH.js.map → chunk-A5DFMP3O.js.map} +0 -0
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
sortHierarchicalDataWithSorting,
|
|
55
55
|
validateHierarchicalData,
|
|
56
56
|
validatePaginationConfig
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-EVVRUGQ2.js";
|
|
58
58
|
import "./chunk-2KLAOD4M.js";
|
|
59
59
|
import "./chunk-S63MFSY6.js";
|
|
60
60
|
import "./chunk-Q7APDV6H.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
validateHierarchicalData,
|
|
158
158
|
validatePaginationConfig
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=DataTable-
|
|
160
|
+
//# sourceMappingURL=DataTable-DXELRJIX.js.map
|
|
@@ -853,7 +853,7 @@ declare const DialogFooter: {
|
|
|
853
853
|
displayName: string;
|
|
854
854
|
};
|
|
855
855
|
declare const DialogTitle: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
856
|
-
declare const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<
|
|
856
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
857
857
|
|
|
858
858
|
/**
|
|
859
859
|
* @file Select Hooks - Custom hooks for Select component state management
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
SelectSeparator,
|
|
26
26
|
SelectTrigger,
|
|
27
27
|
SelectValue
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-EVVRUGQ2.js";
|
|
29
29
|
import {
|
|
30
30
|
isPermitted,
|
|
31
31
|
isSuperAdmin
|
|
@@ -4799,4 +4799,4 @@ export {
|
|
|
4799
4799
|
EventLogoCompact,
|
|
4800
4800
|
EventLogoLarge
|
|
4801
4801
|
};
|
|
4802
|
-
//# sourceMappingURL=chunk-
|
|
4802
|
+
//# sourceMappingURL=chunk-A5DFMP3O.js.map
|
|
@@ -7188,16 +7188,25 @@ function EditableRow({
|
|
|
7188
7188
|
firstInputRef.current.select();
|
|
7189
7189
|
}
|
|
7190
7190
|
}, []);
|
|
7191
|
-
return /* @__PURE__ */
|
|
7191
|
+
return /* @__PURE__ */ jsx13(
|
|
7192
7192
|
"tr",
|
|
7193
7193
|
{
|
|
7194
7194
|
role: "row",
|
|
7195
7195
|
"aria-selected": typeof row.getIsSelected === "function" ? row.getIsSelected() ? "true" : "false" : "false",
|
|
7196
7196
|
"aria-rowindex": row.index + 1,
|
|
7197
|
-
children:
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
//
|
|
7197
|
+
children: row.getVisibleCells().map((cell) => {
|
|
7198
|
+
const isSystemColumn = cell.column.id === "select" || cell.column.id === "actions";
|
|
7199
|
+
return /* @__PURE__ */ jsx13("td", { role: "cell", children: /* @__PURE__ */ jsx13("div", { className: cell.column.columnDef.meta?.align === "right" ? "text-right" : "", children: isSystemColumn ? (
|
|
7200
|
+
// System columns: render their normal cell content (checkbox for select, buttons for actions)
|
|
7201
|
+
cell.column.id === "actions" ? /* @__PURE__ */ jsxs9("div", { className: "flex gap-1", children: [
|
|
7202
|
+
/* @__PURE__ */ jsx13(Button, { onClick: onSave, size: "sm", variant: "default", "aria-label": "Save changes", children: /* @__PURE__ */ jsx13(Check3, { className: "h-4 w-4" }) }),
|
|
7203
|
+
/* @__PURE__ */ jsx13(Button, { onClick: onCancel, size: "sm", variant: "outline", "aria-label": "Cancel editing", children: /* @__PURE__ */ jsx13(X3, { className: "h-4 w-4" }) })
|
|
7204
|
+
] }) : (
|
|
7205
|
+
// Select column: render the checkbox normally
|
|
7206
|
+
flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
7207
|
+
)
|
|
7208
|
+
) : (
|
|
7209
|
+
// Data columns: render edit fields
|
|
7201
7210
|
(() => {
|
|
7202
7211
|
const columnDef = cell.column.columnDef;
|
|
7203
7212
|
if (columnDef.editable === false) {
|
|
@@ -7233,23 +7242,8 @@ function EditableRow({
|
|
|
7233
7242
|
shouldGetRef ? firstInputRef : void 0
|
|
7234
7243
|
);
|
|
7235
7244
|
})()
|
|
7236
|
-
)
|
|
7237
|
-
|
|
7238
|
-
/* @__PURE__ */ jsx13(Button, { onClick: onCancel, size: "sm", variant: "outline", "aria-label": "Cancel editing", children: /* @__PURE__ */ jsx13(X3, { className: "h-4 w-4" }) })
|
|
7239
|
-
] }) }) }, cell.id)),
|
|
7240
|
-
actions.length > 0 && /* @__PURE__ */ jsx13("td", { children: /* @__PURE__ */ jsx13(
|
|
7241
|
-
ActionButtons,
|
|
7242
|
-
{
|
|
7243
|
-
row,
|
|
7244
|
-
rowId,
|
|
7245
|
-
index: row.index,
|
|
7246
|
-
actions,
|
|
7247
|
-
isEditing: true,
|
|
7248
|
-
isParent,
|
|
7249
|
-
hierarchical
|
|
7250
|
-
}
|
|
7251
|
-
) })
|
|
7252
|
-
]
|
|
7245
|
+
) }) }, cell.id);
|
|
7246
|
+
})
|
|
7253
7247
|
}
|
|
7254
7248
|
);
|
|
7255
7249
|
}
|
|
@@ -8381,7 +8375,7 @@ function renderSafeHtml(html, options = {}) {
|
|
|
8381
8375
|
// src/components/Dialog/Dialog.tsx
|
|
8382
8376
|
var import_lodash = __toESM(require_lodash(), 1);
|
|
8383
8377
|
import { useState as useState3, useEffect as useEffect4 } from "react";
|
|
8384
|
-
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
8378
|
+
import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
8385
8379
|
var sizeClasses = {
|
|
8386
8380
|
sm: "max-w-sm",
|
|
8387
8381
|
md: "max-w-md",
|
|
@@ -8613,11 +8607,12 @@ var DialogBody = ({
|
|
|
8613
8607
|
});
|
|
8614
8608
|
return result.html;
|
|
8615
8609
|
}, [htmlContent, allowHtml, strictSanitization, logWarnings]);
|
|
8610
|
+
const hasHtmlContent = Boolean(htmlContent && allowHtml);
|
|
8616
8611
|
return /* @__PURE__ */ jsx17(
|
|
8617
8612
|
"main",
|
|
8618
8613
|
{
|
|
8619
8614
|
className: cn(
|
|
8620
|
-
"
|
|
8615
|
+
"overflow-y-auto px-6 py-2",
|
|
8621
8616
|
className
|
|
8622
8617
|
),
|
|
8623
8618
|
style: mergedStyle,
|
|
@@ -8630,8 +8625,8 @@ var DialogBody = ({
|
|
|
8630
8625
|
dangerouslySetInnerHTML: { __html: processedHtmlContent },
|
|
8631
8626
|
className: "prose prose-sm max-w-none"
|
|
8632
8627
|
}
|
|
8633
|
-
) : /* @__PURE__ */ jsxs13(
|
|
8634
|
-
/* @__PURE__ */ jsx17("div", { className: "text-red-500 mb-2", children: "No HTML content processed. Showing children instead." }),
|
|
8628
|
+
) : /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
8629
|
+
hasHtmlContent && !processedHtmlContent && /* @__PURE__ */ jsx17("div", { className: "text-red-500 mb-2", children: "No HTML content processed. Showing children instead." }),
|
|
8635
8630
|
children
|
|
8636
8631
|
] })
|
|
8637
8632
|
}
|
|
@@ -8670,7 +8665,6 @@ var DialogTitle = React11.forwardRef(({ className, htmlContent, allowHtml = true
|
|
|
8670
8665
|
{
|
|
8671
8666
|
ref,
|
|
8672
8667
|
className: cn(
|
|
8673
|
-
"text-lg font-semibold leading-none tracking-tight",
|
|
8674
8668
|
className
|
|
8675
8669
|
),
|
|
8676
8670
|
...props,
|
|
@@ -8690,15 +8684,15 @@ var DialogDescription = React11.forwardRef(({ className, htmlContent, allowHtml
|
|
|
8690
8684
|
});
|
|
8691
8685
|
return result.html;
|
|
8692
8686
|
}, [htmlContent, allowHtml]);
|
|
8693
|
-
return /* @__PURE__ */ jsx17(
|
|
8694
|
-
|
|
8687
|
+
return /* @__PURE__ */ jsx17(DialogPrimitive.Description, { asChild: true, children: /* @__PURE__ */ jsx17(
|
|
8688
|
+
"h5",
|
|
8695
8689
|
{
|
|
8696
8690
|
ref,
|
|
8697
|
-
className: cn(
|
|
8691
|
+
className: cn(className),
|
|
8698
8692
|
...props,
|
|
8699
8693
|
children: processedHtmlContent ? /* @__PURE__ */ jsx17("span", { dangerouslySetInnerHTML: { __html: processedHtmlContent } }) : children
|
|
8700
8694
|
}
|
|
8701
|
-
);
|
|
8695
|
+
) });
|
|
8702
8696
|
});
|
|
8703
8697
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
8704
8698
|
|
|
@@ -8913,7 +8907,7 @@ function ImportModal({ isOpen, onClose, onImport, config = {} }) {
|
|
|
8913
8907
|
}
|
|
8914
8908
|
|
|
8915
8909
|
// src/components/DataTable/components/DataTableModals.tsx
|
|
8916
|
-
import { Fragment as
|
|
8910
|
+
import { Fragment as Fragment4, jsx as jsx19 } from "react/jsx-runtime";
|
|
8917
8911
|
function mapCSVToTableColumns(csvData, columns) {
|
|
8918
8912
|
const columnMap = /* @__PURE__ */ new Map();
|
|
8919
8913
|
console.log("[mapCSVToTableColumns] Building column map from", columns.length, "column definitions");
|
|
@@ -8921,7 +8915,8 @@ function mapCSVToTableColumns(csvData, columns) {
|
|
|
8921
8915
|
const fieldName = col.editAccessorKey || col.accessorKey || col.id;
|
|
8922
8916
|
const header = typeof col.header === "string" ? col.header : "";
|
|
8923
8917
|
if (fieldName && header) {
|
|
8924
|
-
|
|
8918
|
+
const headerLower = header.toLowerCase();
|
|
8919
|
+
columnMap.set(headerLower, fieldName);
|
|
8925
8920
|
console.log(`[mapCSVToTableColumns] Mapped "${header}" -> "${fieldName}"`);
|
|
8926
8921
|
const colId = col.id || col.accessorKey;
|
|
8927
8922
|
if (colId && colId !== header && colId !== fieldName) {
|
|
@@ -8929,11 +8924,12 @@ function mapCSVToTableColumns(csvData, columns) {
|
|
|
8929
8924
|
console.log(`[mapCSVToTableColumns] Also mapped "${colId}" -> "${fieldName}"`);
|
|
8930
8925
|
}
|
|
8931
8926
|
if (col.editAccessorKey && header) {
|
|
8927
|
+
const editAccessorKey = col.editAccessorKey;
|
|
8932
8928
|
const idColumnHeader = `${header} (ID)`;
|
|
8933
|
-
columnMap.set(idColumnHeader.toLowerCase(),
|
|
8934
|
-
console.log(`[mapCSVToTableColumns] Mapped ID column "${idColumnHeader}" -> "${
|
|
8935
|
-
columnMap.set(
|
|
8936
|
-
console.log(`[mapCSVToTableColumns] Also mapped "${
|
|
8929
|
+
columnMap.set(idColumnHeader.toLowerCase(), editAccessorKey);
|
|
8930
|
+
console.log(`[mapCSVToTableColumns] Mapped ID column "${idColumnHeader}" -> "${editAccessorKey}"`);
|
|
8931
|
+
columnMap.set(editAccessorKey.toLowerCase(), editAccessorKey);
|
|
8932
|
+
console.log(`[mapCSVToTableColumns] Also mapped "${editAccessorKey}" -> "${editAccessorKey}"`);
|
|
8937
8933
|
}
|
|
8938
8934
|
} else {
|
|
8939
8935
|
console.warn("[mapCSVToTableColumns] Skipping column with missing fieldName or header:", col);
|
|
@@ -8950,7 +8946,19 @@ function mapCSVToTableColumns(csvData, columns) {
|
|
|
8950
8946
|
const mappedRow = {};
|
|
8951
8947
|
Object.keys(row).forEach((csvHeader) => {
|
|
8952
8948
|
const csvHeaderLower = csvHeader.toLowerCase();
|
|
8953
|
-
|
|
8949
|
+
let fieldName = columnMap.get(csvHeaderLower);
|
|
8950
|
+
if (!fieldName) {
|
|
8951
|
+
for (const [mapKey, mapValue] of columnMap.entries()) {
|
|
8952
|
+
const keyWithSpace = ` ${mapKey}`;
|
|
8953
|
+
if (csvHeaderLower === mapKey || csvHeaderLower.endsWith(keyWithSpace)) {
|
|
8954
|
+
fieldName = mapValue;
|
|
8955
|
+
if (index === 0) {
|
|
8956
|
+
console.log(`[mapCSVToTableColumns] Flexible match: "${csvHeader}" -> "${mapValue}" (matched "${mapKey}")`);
|
|
8957
|
+
}
|
|
8958
|
+
break;
|
|
8959
|
+
}
|
|
8960
|
+
}
|
|
8961
|
+
}
|
|
8954
8962
|
if (fieldName) {
|
|
8955
8963
|
mappedRow[fieldName] = row[csvHeader];
|
|
8956
8964
|
if (index === 0) {
|
|
@@ -8990,7 +8998,7 @@ function DataTableModals({
|
|
|
8990
8998
|
return () => clearTimeout(timeoutId);
|
|
8991
8999
|
}
|
|
8992
9000
|
}, [showImportModal, onStoreFocus, onRestoreFocus]);
|
|
8993
|
-
return /* @__PURE__ */ jsx19(
|
|
9001
|
+
return /* @__PURE__ */ jsx19(Fragment4, { children: /* @__PURE__ */ jsx19(
|
|
8994
9002
|
ImportModal,
|
|
8995
9003
|
{
|
|
8996
9004
|
isOpen: showImportModal,
|
|
@@ -9092,7 +9100,7 @@ var AlertDescription = React14.forwardRef(({ className, ...props }, ref) => {
|
|
|
9092
9100
|
AlertDescription.displayName = "AlertDescription";
|
|
9093
9101
|
|
|
9094
9102
|
// src/components/DataTable/components/DataTableErrorBoundary.tsx
|
|
9095
|
-
import { Fragment as
|
|
9103
|
+
import { Fragment as Fragment6, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
9096
9104
|
var DataTableErrorBoundary = class extends Component {
|
|
9097
9105
|
constructor(props) {
|
|
9098
9106
|
super(props);
|
|
@@ -9171,7 +9179,7 @@ var DataTableErrorBoundary = class extends Component {
|
|
|
9171
9179
|
/* @__PURE__ */ jsx21("summary", { className: "cursor-pointer text-sm font-medium", children: "Error Details" }),
|
|
9172
9180
|
/* @__PURE__ */ jsxs15("pre", { className: "mt-2 text-xs overflow-auto max-h-32", children: [
|
|
9173
9181
|
error.message,
|
|
9174
|
-
showErrorDetails && error.stack && /* @__PURE__ */ jsxs15(
|
|
9182
|
+
showErrorDetails && error.stack && /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
9175
9183
|
"\n\nStack Trace:\n",
|
|
9176
9184
|
error.stack
|
|
9177
9185
|
] })
|
|
@@ -10185,7 +10193,7 @@ HoverCardContent.displayName = "HoverCardContent";
|
|
|
10185
10193
|
|
|
10186
10194
|
// src/components/DataTable/components/AccessDeniedPage.tsx
|
|
10187
10195
|
import { ShieldX, ArrowLeft, RefreshCw } from "lucide-react";
|
|
10188
|
-
import { Fragment as
|
|
10196
|
+
import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10189
10197
|
function AccessDeniedPage({
|
|
10190
10198
|
resource,
|
|
10191
10199
|
operation = "access",
|
|
@@ -10219,7 +10227,7 @@ function AccessDeniedPage({
|
|
|
10219
10227
|
/* @__PURE__ */ jsx23("strong", { children: "Resource:" }),
|
|
10220
10228
|
" ",
|
|
10221
10229
|
resource,
|
|
10222
|
-
operation && /* @__PURE__ */ jsxs16(
|
|
10230
|
+
operation && /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
10223
10231
|
/* @__PURE__ */ jsx23("br", {}),
|
|
10224
10232
|
/* @__PURE__ */ jsx23("strong", { children: "Operation:" }),
|
|
10225
10233
|
" ",
|
|
@@ -11233,7 +11241,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
11233
11241
|
}
|
|
11234
11242
|
|
|
11235
11243
|
// src/components/DataTable/components/DataTableCore.tsx
|
|
11236
|
-
import { Fragment as
|
|
11244
|
+
import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
11237
11245
|
var isCellValue = (value) => {
|
|
11238
11246
|
if (value === null || value === void 0) {
|
|
11239
11247
|
return true;
|
|
@@ -11600,11 +11608,33 @@ function DataTableInternal({
|
|
|
11600
11608
|
if (secureFeatures.deletion && secureHandlers.onDeleteRow && !result.some((a) => a.label === "Delete")) {
|
|
11601
11609
|
result.push({
|
|
11602
11610
|
label: "Delete",
|
|
11603
|
-
onClick: (row) => {
|
|
11611
|
+
onClick: async (row) => {
|
|
11604
11612
|
if (!permissions.canDelete.can) {
|
|
11605
|
-
|
|
11613
|
+
toast({
|
|
11614
|
+
title: "Delete Failed",
|
|
11615
|
+
description: "Insufficient permissions to delete this resource",
|
|
11616
|
+
variant: "destructive"
|
|
11617
|
+
});
|
|
11618
|
+
return;
|
|
11619
|
+
}
|
|
11620
|
+
try {
|
|
11621
|
+
const result2 = secureHandlers.onDeleteRow(row);
|
|
11622
|
+
if (result2 !== void 0 && result2 !== null && typeof result2 === "object" && typeof result2.then === "function") {
|
|
11623
|
+
await result2;
|
|
11624
|
+
}
|
|
11625
|
+
toast({
|
|
11626
|
+
title: "Delete Successful",
|
|
11627
|
+
description: "Row deleted successfully",
|
|
11628
|
+
variant: "default"
|
|
11629
|
+
});
|
|
11630
|
+
} catch (error) {
|
|
11631
|
+
console.error("[DataTable] Delete error:", error);
|
|
11632
|
+
toast({
|
|
11633
|
+
title: "Delete Failed",
|
|
11634
|
+
description: error instanceof Error ? error.message : "Failed to delete row",
|
|
11635
|
+
variant: "destructive"
|
|
11636
|
+
});
|
|
11606
11637
|
}
|
|
11607
|
-
secureHandlers.onDeleteRow(row);
|
|
11608
11638
|
},
|
|
11609
11639
|
icon: Trash,
|
|
11610
11640
|
testId: "delete",
|
|
@@ -11797,7 +11827,7 @@ function DataTableInternal({
|
|
|
11797
11827
|
).length;
|
|
11798
11828
|
const hasSelectColumn = visibleColumns.some((col) => col.id === "select");
|
|
11799
11829
|
const hasActionsColumn = visibleColumns.some((col) => col.id === "actions");
|
|
11800
|
-
return /* @__PURE__ */ jsxs17(
|
|
11830
|
+
return /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
11801
11831
|
/* @__PURE__ */ jsxs17(
|
|
11802
11832
|
"table",
|
|
11803
11833
|
{
|
|
@@ -11812,11 +11842,11 @@ function DataTableInternal({
|
|
|
11812
11842
|
"aria-busy": isLoading ? "true" : "false",
|
|
11813
11843
|
children: [
|
|
11814
11844
|
/* @__PURE__ */ jsxs17("caption", { className: "text-left pb-2", children: [
|
|
11815
|
-
(title || description) && /* @__PURE__ */ jsxs17(
|
|
11845
|
+
(title || description) && /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
11816
11846
|
title && /* @__PURE__ */ jsx24("h2", { children: title }),
|
|
11817
11847
|
description && /* @__PURE__ */ jsx24("p", { id: "table-description", children: description })
|
|
11818
11848
|
] }),
|
|
11819
|
-
/* @__PURE__ */ jsx24(
|
|
11849
|
+
/* @__PURE__ */ jsx24(Fragment8, { children: /* @__PURE__ */ jsx24(
|
|
11820
11850
|
DataTableToolbar,
|
|
11821
11851
|
{
|
|
11822
11852
|
features: secureFeatures,
|
|
@@ -11897,7 +11927,35 @@ function DataTableInternal({
|
|
|
11897
11927
|
}
|
|
11898
11928
|
}),
|
|
11899
11929
|
rowSelection,
|
|
11900
|
-
onDeleteSelected: secureHandlers.onDeleteSelected
|
|
11930
|
+
onDeleteSelected: secureHandlers.onDeleteSelected ? async (selectedRows) => {
|
|
11931
|
+
const selectedCount = Object.values(selectedRows).filter(Boolean).length;
|
|
11932
|
+
if (selectedCount === 0) {
|
|
11933
|
+
toast({
|
|
11934
|
+
title: "No Selection",
|
|
11935
|
+
description: "Please select at least one row to delete",
|
|
11936
|
+
variant: "default"
|
|
11937
|
+
});
|
|
11938
|
+
return;
|
|
11939
|
+
}
|
|
11940
|
+
try {
|
|
11941
|
+
const result = secureHandlers.onDeleteSelected(selectedRows);
|
|
11942
|
+
if (result !== void 0 && result !== null && typeof result === "object" && typeof result.then === "function") {
|
|
11943
|
+
await result;
|
|
11944
|
+
}
|
|
11945
|
+
toast({
|
|
11946
|
+
title: "Delete Successful",
|
|
11947
|
+
description: `Successfully deleted ${selectedCount} ${selectedCount === 1 ? "row" : "rows"}`,
|
|
11948
|
+
variant: "default"
|
|
11949
|
+
});
|
|
11950
|
+
} catch (error) {
|
|
11951
|
+
console.error("[DataTable] Bulk delete error:", error);
|
|
11952
|
+
toast({
|
|
11953
|
+
title: "Delete Failed",
|
|
11954
|
+
description: error instanceof Error ? error.message : "Failed to delete selected rows",
|
|
11955
|
+
variant: "destructive"
|
|
11956
|
+
});
|
|
11957
|
+
}
|
|
11958
|
+
} : void 0,
|
|
11901
11959
|
onToggleFilterRow: () => stateActions.setFilterRow(!state.showFilterRow),
|
|
11902
11960
|
showFilterRow: state.showFilterRow,
|
|
11903
11961
|
rbac,
|
|
@@ -12344,4 +12402,4 @@ lodash/lodash.js:
|
|
|
12344
12402
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
12345
12403
|
*)
|
|
12346
12404
|
*/
|
|
12347
|
-
//# sourceMappingURL=chunk-
|
|
12405
|
+
//# sourceMappingURL=chunk-EVVRUGQ2.js.map
|