@jmruthers/pace-core 0.5.100 → 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-MHN7PNH3.js → DataTable-DXELRJIX.js} +2 -2
- package/dist/{PublicLoadingSpinner-B84QWsvB.d.ts → PublicLoadingSpinner-C2h8zg67.d.ts} +1 -1
- package/dist/{chunk-Z4HVIZSK.js → chunk-A5DFMP3O.js} +2 -2
- package/dist/{chunk-OLZSC5EH.js → chunk-EVVRUGQ2.js} +90 -46
- package/dist/{chunk-OLZSC5EH.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/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-MHN7PNH3.js.map → DataTable-DXELRJIX.js.map} +0 -0
- /package/dist/{chunk-Z4HVIZSK.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");
|
|
@@ -9004,7 +8998,7 @@ function DataTableModals({
|
|
|
9004
8998
|
return () => clearTimeout(timeoutId);
|
|
9005
8999
|
}
|
|
9006
9000
|
}, [showImportModal, onStoreFocus, onRestoreFocus]);
|
|
9007
|
-
return /* @__PURE__ */ jsx19(
|
|
9001
|
+
return /* @__PURE__ */ jsx19(Fragment4, { children: /* @__PURE__ */ jsx19(
|
|
9008
9002
|
ImportModal,
|
|
9009
9003
|
{
|
|
9010
9004
|
isOpen: showImportModal,
|
|
@@ -9106,7 +9100,7 @@ var AlertDescription = React14.forwardRef(({ className, ...props }, ref) => {
|
|
|
9106
9100
|
AlertDescription.displayName = "AlertDescription";
|
|
9107
9101
|
|
|
9108
9102
|
// src/components/DataTable/components/DataTableErrorBoundary.tsx
|
|
9109
|
-
import { Fragment as
|
|
9103
|
+
import { Fragment as Fragment6, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
9110
9104
|
var DataTableErrorBoundary = class extends Component {
|
|
9111
9105
|
constructor(props) {
|
|
9112
9106
|
super(props);
|
|
@@ -9185,7 +9179,7 @@ var DataTableErrorBoundary = class extends Component {
|
|
|
9185
9179
|
/* @__PURE__ */ jsx21("summary", { className: "cursor-pointer text-sm font-medium", children: "Error Details" }),
|
|
9186
9180
|
/* @__PURE__ */ jsxs15("pre", { className: "mt-2 text-xs overflow-auto max-h-32", children: [
|
|
9187
9181
|
error.message,
|
|
9188
|
-
showErrorDetails && error.stack && /* @__PURE__ */ jsxs15(
|
|
9182
|
+
showErrorDetails && error.stack && /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
9189
9183
|
"\n\nStack Trace:\n",
|
|
9190
9184
|
error.stack
|
|
9191
9185
|
] })
|
|
@@ -10199,7 +10193,7 @@ HoverCardContent.displayName = "HoverCardContent";
|
|
|
10199
10193
|
|
|
10200
10194
|
// src/components/DataTable/components/AccessDeniedPage.tsx
|
|
10201
10195
|
import { ShieldX, ArrowLeft, RefreshCw } from "lucide-react";
|
|
10202
|
-
import { Fragment as
|
|
10196
|
+
import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10203
10197
|
function AccessDeniedPage({
|
|
10204
10198
|
resource,
|
|
10205
10199
|
operation = "access",
|
|
@@ -10233,7 +10227,7 @@ function AccessDeniedPage({
|
|
|
10233
10227
|
/* @__PURE__ */ jsx23("strong", { children: "Resource:" }),
|
|
10234
10228
|
" ",
|
|
10235
10229
|
resource,
|
|
10236
|
-
operation && /* @__PURE__ */ jsxs16(
|
|
10230
|
+
operation && /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
10237
10231
|
/* @__PURE__ */ jsx23("br", {}),
|
|
10238
10232
|
/* @__PURE__ */ jsx23("strong", { children: "Operation:" }),
|
|
10239
10233
|
" ",
|
|
@@ -11247,7 +11241,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
|
|
|
11247
11241
|
}
|
|
11248
11242
|
|
|
11249
11243
|
// src/components/DataTable/components/DataTableCore.tsx
|
|
11250
|
-
import { Fragment as
|
|
11244
|
+
import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
11251
11245
|
var isCellValue = (value) => {
|
|
11252
11246
|
if (value === null || value === void 0) {
|
|
11253
11247
|
return true;
|
|
@@ -11614,11 +11608,33 @@ function DataTableInternal({
|
|
|
11614
11608
|
if (secureFeatures.deletion && secureHandlers.onDeleteRow && !result.some((a) => a.label === "Delete")) {
|
|
11615
11609
|
result.push({
|
|
11616
11610
|
label: "Delete",
|
|
11617
|
-
onClick: (row) => {
|
|
11611
|
+
onClick: async (row) => {
|
|
11618
11612
|
if (!permissions.canDelete.can) {
|
|
11619
|
-
|
|
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
|
+
});
|
|
11620
11637
|
}
|
|
11621
|
-
secureHandlers.onDeleteRow(row);
|
|
11622
11638
|
},
|
|
11623
11639
|
icon: Trash,
|
|
11624
11640
|
testId: "delete",
|
|
@@ -11811,7 +11827,7 @@ function DataTableInternal({
|
|
|
11811
11827
|
).length;
|
|
11812
11828
|
const hasSelectColumn = visibleColumns.some((col) => col.id === "select");
|
|
11813
11829
|
const hasActionsColumn = visibleColumns.some((col) => col.id === "actions");
|
|
11814
|
-
return /* @__PURE__ */ jsxs17(
|
|
11830
|
+
return /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
11815
11831
|
/* @__PURE__ */ jsxs17(
|
|
11816
11832
|
"table",
|
|
11817
11833
|
{
|
|
@@ -11826,11 +11842,11 @@ function DataTableInternal({
|
|
|
11826
11842
|
"aria-busy": isLoading ? "true" : "false",
|
|
11827
11843
|
children: [
|
|
11828
11844
|
/* @__PURE__ */ jsxs17("caption", { className: "text-left pb-2", children: [
|
|
11829
|
-
(title || description) && /* @__PURE__ */ jsxs17(
|
|
11845
|
+
(title || description) && /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
11830
11846
|
title && /* @__PURE__ */ jsx24("h2", { children: title }),
|
|
11831
11847
|
description && /* @__PURE__ */ jsx24("p", { id: "table-description", children: description })
|
|
11832
11848
|
] }),
|
|
11833
|
-
/* @__PURE__ */ jsx24(
|
|
11849
|
+
/* @__PURE__ */ jsx24(Fragment8, { children: /* @__PURE__ */ jsx24(
|
|
11834
11850
|
DataTableToolbar,
|
|
11835
11851
|
{
|
|
11836
11852
|
features: secureFeatures,
|
|
@@ -11911,7 +11927,35 @@ function DataTableInternal({
|
|
|
11911
11927
|
}
|
|
11912
11928
|
}),
|
|
11913
11929
|
rowSelection,
|
|
11914
|
-
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,
|
|
11915
11959
|
onToggleFilterRow: () => stateActions.setFilterRow(!state.showFilterRow),
|
|
11916
11960
|
showFilterRow: state.showFilterRow,
|
|
11917
11961
|
rbac,
|
|
@@ -12358,4 +12402,4 @@ lodash/lodash.js:
|
|
|
12358
12402
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
12359
12403
|
*)
|
|
12360
12404
|
*/
|
|
12361
|
-
//# sourceMappingURL=chunk-
|
|
12405
|
+
//# sourceMappingURL=chunk-EVVRUGQ2.js.map
|