@jmruthers/pace-core 0.5.106 → 0.5.108
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-BE0OXZKQ.d.ts → DataTable-D5cBRca8.d.ts} +1 -1
- package/dist/{DataTable-LWHFLTEW.js → DataTable-WFCHVWTY.js} +3 -3
- package/dist/{PublicLoadingSpinner-48ewSMKK.d.ts → PublicLoadingSpinner-DgDWTFqn.d.ts} +4 -2
- package/dist/{chunk-QPCAGLUS.js → chunk-4OX5PXHX.js} +5 -2
- package/dist/chunk-4OX5PXHX.js.map +1 -0
- package/dist/{chunk-IBZBNBTE.js → chunk-B3QX32P5.js} +177 -54
- package/dist/chunk-B3QX32P5.js.map +1 -0
- package/dist/{chunk-75G3NZWN.js → chunk-IMZGJ2X7.js} +373 -95
- package/dist/chunk-IMZGJ2X7.js.map +1 -0
- package/dist/{chunk-4BWGRQBG.js → chunk-NFPV7MRN.js} +22 -2
- package/dist/chunk-NFPV7MRN.js.map +1 -0
- package/dist/components.d.ts +4 -4
- package/dist/components.js +3 -3
- package/dist/{formatting-BfDeV-ja.d.ts → formatting-BiEv5oEk.d.ts} +32 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +4 -4
- package/dist/{types-BDg1mAGG.d.ts → types-D4TVpDa1.d.ts} +24 -1
- package/dist/{useToast-Bm6TnSK-.d.ts → useToast-DRah6K-g.d.ts} +5 -2
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +2 -2
- 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 +4 -4
- 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 +18 -18
- package/docs/api/interfaces/DataTableColumn.md +115 -10
- package/docs/api/interfaces/DataTableProps.md +38 -38
- package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
- package/docs/api/interfaces/EmptyStateConfig.md +5 -5
- package/docs/api/interfaces/EnhancedNavigationMenuProps.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/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 +42 -19
- package/docs/api-reference/utilities.md +26 -3
- package/docs/implementation-guides/data-tables.md +390 -0
- package/package.json +1 -1
- package/src/components/DataTable/DataTable.tsx +4 -0
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +25 -10
- package/src/components/DataTable/components/ColumnFilter.tsx +2 -1
- package/src/components/DataTable/components/EditableRow.tsx +179 -16
- package/src/components/DataTable/components/FilterRow.tsx +22 -11
- package/src/components/DataTable/components/PaginationControls.tsx +1 -1
- package/src/components/DataTable/components/UnifiedTableBody.tsx +231 -32
- package/src/components/DataTable/types.ts +34 -4
- package/src/components/FileDisplay/FileDisplay.test.tsx +184 -201
- package/src/components/FileDisplay/FileDisplay.tsx +40 -39
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +189 -13
- package/src/components/NavigationMenu/NavigationMenu.tsx +142 -35
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +79 -10
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +4 -4
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/hooks/useEventTheme.test.ts +11 -0
- package/src/hooks/useSecureDataAccess.test.ts +22 -5
- package/src/hooks/useToast.ts +11 -2
- package/src/providers/UnifiedAuthProvider.smoke.test.tsx +67 -3
- package/src/providers/__tests__/ProviderLifecycle.test.tsx +72 -4
- package/src/services/__tests__/OrganisationService.pagination.test.ts +10 -2
- package/src/styles/core.css +11 -0
- package/src/utils/__tests__/formatting.unit.test.ts +33 -0
- package/src/utils/file-reference.test.ts +44 -5
- package/src/utils/formatting.ts +57 -2
- package/src/validation/__tests__/passwordSchema.unit.test.ts +3 -3
- package/dist/chunk-4BWGRQBG.js.map +0 -1
- package/dist/chunk-75G3NZWN.js.map +0 -1
- package/dist/chunk-IBZBNBTE.js.map +0 -1
- package/dist/chunk-QPCAGLUS.js.map +0 -1
- /package/dist/{DataTable-LWHFLTEW.js.map → DataTable-WFCHVWTY.js.map} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
toast,
|
|
7
7
|
useDataTablePerformance
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-4OX5PXHX.js";
|
|
9
9
|
import {
|
|
10
10
|
init_UnifiedAuthProvider
|
|
11
11
|
} from "./chunk-KBG34SVL.js";
|
|
@@ -5502,10 +5502,10 @@ var require_lodash = __commonJS({
|
|
|
5502
5502
|
});
|
|
5503
5503
|
|
|
5504
5504
|
// src/components/DataTable/DataTable.tsx
|
|
5505
|
-
import
|
|
5505
|
+
import React20 from "react";
|
|
5506
5506
|
|
|
5507
5507
|
// src/components/DataTable/components/DataTableCore.tsx
|
|
5508
|
-
import
|
|
5508
|
+
import React19, { 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
|
|
|
@@ -6649,7 +6649,7 @@ function DataTableToolbar({
|
|
|
6649
6649
|
}
|
|
6650
6650
|
|
|
6651
6651
|
// src/components/DataTable/components/UnifiedTableBody.tsx
|
|
6652
|
-
import
|
|
6652
|
+
import React10, { useRef as useRef3, useEffect as useEffect3 } from "react";
|
|
6653
6653
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
6654
6654
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
6655
6655
|
import { ChevronDown as ChevronDown2, ChevronRight } from "lucide-react";
|
|
@@ -6700,6 +6700,9 @@ function EmptyState({
|
|
|
6700
6700
|
);
|
|
6701
6701
|
}
|
|
6702
6702
|
|
|
6703
|
+
// src/components/DataTable/components/FilterRow.tsx
|
|
6704
|
+
import React7 from "react";
|
|
6705
|
+
|
|
6703
6706
|
// src/components/DataTable/components/ColumnFilter.tsx
|
|
6704
6707
|
import { X as X2 } from "lucide-react";
|
|
6705
6708
|
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
@@ -6750,7 +6753,7 @@ function ColumnFilter({
|
|
|
6750
6753
|
value: columnFilterValue || "",
|
|
6751
6754
|
onChange: (e) => handleFilterChange(e.target.value ? Number(e.target.value) : void 0),
|
|
6752
6755
|
placeholder: placeholder || `Filter ${column.id}...`,
|
|
6753
|
-
className: "h-8"
|
|
6756
|
+
className: "h-8 datatable-number-no-spinners"
|
|
6754
6757
|
}
|
|
6755
6758
|
);
|
|
6756
6759
|
case "date":
|
|
@@ -6795,7 +6798,7 @@ import { jsx as jsx11 } from "react/jsx-runtime";
|
|
|
6795
6798
|
function FilterRow({ table, visibleColumns }) {
|
|
6796
6799
|
const { getState } = table;
|
|
6797
6800
|
const { columnFilters } = getState();
|
|
6798
|
-
const getColumnOptions = (columnId) => {
|
|
6801
|
+
const getColumnOptions = React7.useCallback((columnId) => {
|
|
6799
6802
|
const column = table.getColumn(columnId);
|
|
6800
6803
|
if (!column) return [];
|
|
6801
6804
|
const columnDef = column.columnDef;
|
|
@@ -6813,13 +6816,14 @@ function FilterRow({ table, visibleColumns }) {
|
|
|
6813
6816
|
}
|
|
6814
6817
|
});
|
|
6815
6818
|
return Array.from(uniqueValues).sort().map((value) => ({ value, label: value }));
|
|
6816
|
-
};
|
|
6817
|
-
const getFilterType = (columnId) => {
|
|
6819
|
+
}, [table]);
|
|
6820
|
+
const getFilterType = React7.useCallback((columnId) => {
|
|
6818
6821
|
const column = table.getColumn(columnId);
|
|
6819
6822
|
if (!column) return "text";
|
|
6820
6823
|
const columnDef = column.columnDef;
|
|
6821
|
-
|
|
6822
|
-
|
|
6824
|
+
const explicitFilterType = columnDef.filterType;
|
|
6825
|
+
if (explicitFilterType !== void 0 && explicitFilterType !== null && explicitFilterType !== "") {
|
|
6826
|
+
return explicitFilterType;
|
|
6823
6827
|
}
|
|
6824
6828
|
if (columnDef.filterSelectOptions && Array.isArray(columnDef.filterSelectOptions)) {
|
|
6825
6829
|
return "select";
|
|
@@ -6836,7 +6840,7 @@ function FilterRow({ table, visibleColumns }) {
|
|
|
6836
6840
|
return "select";
|
|
6837
6841
|
}
|
|
6838
6842
|
return "text";
|
|
6839
|
-
};
|
|
6843
|
+
}, [table, getColumnOptions]);
|
|
6840
6844
|
return /* @__PURE__ */ jsx11("tr", { className: "border-b bg-sec-50/50", children: visibleColumns.map((header) => {
|
|
6841
6845
|
const column = header.column;
|
|
6842
6846
|
const canFilter = column.getCanFilter();
|
|
@@ -6862,7 +6866,7 @@ function FilterRow({ table, visibleColumns }) {
|
|
|
6862
6866
|
}
|
|
6863
6867
|
|
|
6864
6868
|
// src/components/DataTable/components/ActionButtons.tsx
|
|
6865
|
-
import
|
|
6869
|
+
import React8, { useMemo as useMemo2 } from "react";
|
|
6866
6870
|
import { MoreHorizontal } from "lucide-react";
|
|
6867
6871
|
|
|
6868
6872
|
// src/utils/logger.ts
|
|
@@ -7105,13 +7109,134 @@ function ActionButtonsComponent({
|
|
|
7105
7109
|
}) })
|
|
7106
7110
|
] });
|
|
7107
7111
|
}
|
|
7108
|
-
var ActionButtons =
|
|
7112
|
+
var ActionButtons = React8.memo(ActionButtonsComponent);
|
|
7109
7113
|
|
|
7110
7114
|
// src/components/DataTable/components/EditableRow.tsx
|
|
7111
|
-
import
|
|
7115
|
+
import React9 from "react";
|
|
7112
7116
|
import { flexRender } from "@tanstack/react-table";
|
|
7113
7117
|
import { X as X3, Check as Check3 } from "lucide-react";
|
|
7114
7118
|
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
7119
|
+
function SelectEditField({
|
|
7120
|
+
columnDef,
|
|
7121
|
+
accessorKey,
|
|
7122
|
+
currentValue,
|
|
7123
|
+
placeholder,
|
|
7124
|
+
onChange,
|
|
7125
|
+
className
|
|
7126
|
+
}) {
|
|
7127
|
+
const isSearchable = columnDef.selectSearchable !== false;
|
|
7128
|
+
const isCreatable = columnDef.creatable === true;
|
|
7129
|
+
const selectRef = React9.useRef(null);
|
|
7130
|
+
const [searchTerm, setSearchTerm] = React9.useState("");
|
|
7131
|
+
const [isOpen, setIsOpen] = React9.useState(false);
|
|
7132
|
+
const [showCreateOption, setShowCreateOption] = React9.useState(false);
|
|
7133
|
+
React9.useEffect(() => {
|
|
7134
|
+
if (!isOpen || !isSearchable || !isCreatable || !selectRef.current) return;
|
|
7135
|
+
const searchInput = selectRef.current.querySelector('[data-testid="select-search-input"]');
|
|
7136
|
+
if (!searchInput) return;
|
|
7137
|
+
const handleInput = (e) => {
|
|
7138
|
+
const target = e.target;
|
|
7139
|
+
const currentSearch = target.value;
|
|
7140
|
+
setSearchTerm(currentSearch);
|
|
7141
|
+
if (currentSearch.trim()) {
|
|
7142
|
+
const searchLower = currentSearch.toLowerCase().trim();
|
|
7143
|
+
const checkMatch = (opt) => {
|
|
7144
|
+
if ("value" in opt && !("type" in opt)) {
|
|
7145
|
+
return opt.label.toLowerCase().includes(searchLower);
|
|
7146
|
+
}
|
|
7147
|
+
if ("type" in opt && opt.type === "group") {
|
|
7148
|
+
return opt.items.some((item) => item.label.toLowerCase().includes(searchLower));
|
|
7149
|
+
}
|
|
7150
|
+
return false;
|
|
7151
|
+
};
|
|
7152
|
+
const hasMatch = (columnDef.fieldOptions || []).some(checkMatch);
|
|
7153
|
+
setShowCreateOption(!hasMatch);
|
|
7154
|
+
} else {
|
|
7155
|
+
setShowCreateOption(false);
|
|
7156
|
+
}
|
|
7157
|
+
};
|
|
7158
|
+
searchInput.addEventListener("input", handleInput);
|
|
7159
|
+
return () => {
|
|
7160
|
+
searchInput.removeEventListener("input", handleInput);
|
|
7161
|
+
};
|
|
7162
|
+
}, [isOpen, isSearchable, isCreatable, columnDef.fieldOptions]);
|
|
7163
|
+
const handleCreateNew = React9.useCallback(async () => {
|
|
7164
|
+
if (!isCreatable || !columnDef.onCreateNew || !searchTerm.trim()) return;
|
|
7165
|
+
try {
|
|
7166
|
+
const newValue = await columnDef.onCreateNew(searchTerm.trim());
|
|
7167
|
+
onChange(newValue);
|
|
7168
|
+
setSearchTerm("");
|
|
7169
|
+
setShowCreateOption(false);
|
|
7170
|
+
} catch (error) {
|
|
7171
|
+
console.error("Error creating new item:", error);
|
|
7172
|
+
}
|
|
7173
|
+
}, [isCreatable, columnDef.onCreateNew, searchTerm, onChange]);
|
|
7174
|
+
return /* @__PURE__ */ jsxs9(
|
|
7175
|
+
Select,
|
|
7176
|
+
{
|
|
7177
|
+
ref: selectRef,
|
|
7178
|
+
value: String(currentValue),
|
|
7179
|
+
onValueChange: (newValue) => {
|
|
7180
|
+
if (newValue.startsWith("__create_new__")) {
|
|
7181
|
+
handleCreateNew();
|
|
7182
|
+
} else {
|
|
7183
|
+
onChange(newValue);
|
|
7184
|
+
}
|
|
7185
|
+
},
|
|
7186
|
+
onOpenChange: (open) => {
|
|
7187
|
+
setIsOpen(open);
|
|
7188
|
+
if (!open) {
|
|
7189
|
+
setSearchTerm("");
|
|
7190
|
+
setShowCreateOption(false);
|
|
7191
|
+
}
|
|
7192
|
+
},
|
|
7193
|
+
children: [
|
|
7194
|
+
/* @__PURE__ */ jsx13(SelectTrigger, { className: className || "w-full h-7", children: /* @__PURE__ */ jsx13(SelectValue, { placeholder: placeholder || `Select ${columnDef.header || "option"}...` }) }),
|
|
7195
|
+
/* @__PURE__ */ jsxs9(
|
|
7196
|
+
SelectContent,
|
|
7197
|
+
{
|
|
7198
|
+
searchable: Boolean(isSearchable),
|
|
7199
|
+
searchPlaceholder: `Search ${columnDef.header || "options"}...`,
|
|
7200
|
+
maxHeight: columnDef.selectMaxHeight,
|
|
7201
|
+
className: columnDef.selectContentClassName,
|
|
7202
|
+
style: columnDef.selectContentStyle,
|
|
7203
|
+
children: [
|
|
7204
|
+
columnDef.fieldOptions?.map((option, index) => {
|
|
7205
|
+
if ("value" in option && !("type" in option)) {
|
|
7206
|
+
return /* @__PURE__ */ jsx13(SelectItem, { value: String(option.value), children: option.label }, `${option.value}-${index}`);
|
|
7207
|
+
}
|
|
7208
|
+
if ("type" in option && option.type === "separator") {
|
|
7209
|
+
return /* @__PURE__ */ jsx13(SelectSeparator, {}, `separator-${index}`);
|
|
7210
|
+
}
|
|
7211
|
+
if ("type" in option && option.type === "group") {
|
|
7212
|
+
const groupOption = option;
|
|
7213
|
+
return /* @__PURE__ */ jsxs9(SelectGroup, { children: [
|
|
7214
|
+
/* @__PURE__ */ jsx13(SelectLabel, { children: groupOption.label }),
|
|
7215
|
+
groupOption.items.map((item) => /* @__PURE__ */ jsx13(SelectItem, { value: String(item.value), children: item.label }, `${item.value}-${index}`))
|
|
7216
|
+
] }, `group-${groupOption.label}-${index}`);
|
|
7217
|
+
}
|
|
7218
|
+
return null;
|
|
7219
|
+
}),
|
|
7220
|
+
showCreateOption && isCreatable && searchTerm.trim() && /* @__PURE__ */ jsxs9(
|
|
7221
|
+
SelectItem,
|
|
7222
|
+
{
|
|
7223
|
+
value: `__create_new__${searchTerm}`,
|
|
7224
|
+
className: "bg-main-100 font-medium border-t border-main-200",
|
|
7225
|
+
children: [
|
|
7226
|
+
'Create "',
|
|
7227
|
+
searchTerm,
|
|
7228
|
+
'"'
|
|
7229
|
+
]
|
|
7230
|
+
},
|
|
7231
|
+
"__create_new__"
|
|
7232
|
+
)
|
|
7233
|
+
]
|
|
7234
|
+
}
|
|
7235
|
+
)
|
|
7236
|
+
]
|
|
7237
|
+
}
|
|
7238
|
+
);
|
|
7239
|
+
}
|
|
7115
7240
|
var renderEditField = (column, value, onChange, editingData = {}, placeholder, inputRef) => {
|
|
7116
7241
|
const columnDef = column.columnDef;
|
|
7117
7242
|
if (columnDef.editable === false) {
|
|
@@ -7120,15 +7245,15 @@ var renderEditField = (column, value, onChange, editingData = {}, placeholder, i
|
|
|
7120
7245
|
if (columnDef.fieldType === "select" && columnDef.fieldOptions) {
|
|
7121
7246
|
const accessorKey = columnDef.editAccessorKey || column.id;
|
|
7122
7247
|
const currentValue = editingData[accessorKey] ?? value ?? "";
|
|
7123
|
-
return /* @__PURE__ */
|
|
7124
|
-
|
|
7248
|
+
return /* @__PURE__ */ jsx13(
|
|
7249
|
+
SelectEditField,
|
|
7125
7250
|
{
|
|
7126
|
-
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7251
|
+
columnDef,
|
|
7252
|
+
accessorKey,
|
|
7253
|
+
currentValue,
|
|
7254
|
+
placeholder,
|
|
7255
|
+
onChange: (newValue) => onChange({ [accessorKey]: newValue }),
|
|
7256
|
+
className: "w-full h-7"
|
|
7132
7257
|
}
|
|
7133
7258
|
);
|
|
7134
7259
|
}
|
|
@@ -7145,6 +7270,7 @@ var renderEditField = (column, value, onChange, editingData = {}, placeholder, i
|
|
|
7145
7270
|
);
|
|
7146
7271
|
}
|
|
7147
7272
|
if (columnDef.fieldType === "number") {
|
|
7273
|
+
const hideSpinners = columnDef.hideNumberSpinners !== false;
|
|
7148
7274
|
return /* @__PURE__ */ jsx13(
|
|
7149
7275
|
Input,
|
|
7150
7276
|
{
|
|
@@ -7152,7 +7278,7 @@ var renderEditField = (column, value, onChange, editingData = {}, placeholder, i
|
|
|
7152
7278
|
type: "number",
|
|
7153
7279
|
value: String(value ?? ""),
|
|
7154
7280
|
onChange: (e) => onChange(e.target.value),
|
|
7155
|
-
className:
|
|
7281
|
+
className: `w-full h-7 ${hideSpinners ? "datatable-number-no-spinners" : ""}`
|
|
7156
7282
|
}
|
|
7157
7283
|
);
|
|
7158
7284
|
}
|
|
@@ -7180,9 +7306,9 @@ function EditableRow({
|
|
|
7180
7306
|
hierarchical = false
|
|
7181
7307
|
}) {
|
|
7182
7308
|
const rowId = getRowId ? getRowId(row.original, row.index) : String(row.id);
|
|
7183
|
-
const firstInputRef =
|
|
7184
|
-
const hasAssignedRef =
|
|
7185
|
-
|
|
7309
|
+
const firstInputRef = React9.useRef(null);
|
|
7310
|
+
const hasAssignedRef = React9.useRef(false);
|
|
7311
|
+
React9.useEffect(() => {
|
|
7186
7312
|
if (firstInputRef.current) {
|
|
7187
7313
|
firstInputRef.current.focus();
|
|
7188
7314
|
firstInputRef.current.select();
|
|
@@ -7451,6 +7577,126 @@ function hasValidRowId(row, getRowId) {
|
|
|
7451
7577
|
// src/components/DataTable/components/UnifiedTableBody.tsx
|
|
7452
7578
|
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
7453
7579
|
var VIRTUALIZATION_THRESHOLD = 1e3;
|
|
7580
|
+
function SelectEditField2({
|
|
7581
|
+
columnDef,
|
|
7582
|
+
accessorKey,
|
|
7583
|
+
currentValue,
|
|
7584
|
+
placeholder,
|
|
7585
|
+
onChange
|
|
7586
|
+
}) {
|
|
7587
|
+
const isSearchable = columnDef.selectSearchable !== false;
|
|
7588
|
+
const isCreatable = columnDef.creatable === true;
|
|
7589
|
+
const selectRef = React10.useRef(null);
|
|
7590
|
+
const [searchTerm, setSearchTerm] = React10.useState("");
|
|
7591
|
+
const [isOpen, setIsOpen] = React10.useState(false);
|
|
7592
|
+
const [showCreateOption, setShowCreateOption] = React10.useState(false);
|
|
7593
|
+
React10.useEffect(() => {
|
|
7594
|
+
if (!isOpen || !isSearchable || !isCreatable || !selectRef.current) return;
|
|
7595
|
+
const searchInput = selectRef.current.querySelector('[data-testid="select-search-input"]');
|
|
7596
|
+
if (!searchInput) return;
|
|
7597
|
+
const handleInput = (e) => {
|
|
7598
|
+
const target = e.target;
|
|
7599
|
+
const currentSearch = target.value;
|
|
7600
|
+
setSearchTerm(currentSearch);
|
|
7601
|
+
if (currentSearch.trim()) {
|
|
7602
|
+
const searchLower = currentSearch.toLowerCase().trim();
|
|
7603
|
+
const checkMatch = (opt) => {
|
|
7604
|
+
if ("value" in opt && !("type" in opt)) {
|
|
7605
|
+
return opt.label.toLowerCase().includes(searchLower);
|
|
7606
|
+
}
|
|
7607
|
+
if ("type" in opt && opt.type === "group") {
|
|
7608
|
+
return opt.items.some((item) => item.label.toLowerCase().includes(searchLower));
|
|
7609
|
+
}
|
|
7610
|
+
return false;
|
|
7611
|
+
};
|
|
7612
|
+
const hasMatch = (columnDef.fieldOptions || []).some(checkMatch);
|
|
7613
|
+
setShowCreateOption(!hasMatch);
|
|
7614
|
+
} else {
|
|
7615
|
+
setShowCreateOption(false);
|
|
7616
|
+
}
|
|
7617
|
+
};
|
|
7618
|
+
searchInput.addEventListener("input", handleInput);
|
|
7619
|
+
return () => {
|
|
7620
|
+
searchInput.removeEventListener("input", handleInput);
|
|
7621
|
+
};
|
|
7622
|
+
}, [isOpen, isSearchable, isCreatable, columnDef.fieldOptions]);
|
|
7623
|
+
const handleCreateNew = React10.useCallback(async () => {
|
|
7624
|
+
if (!isCreatable || !columnDef.onCreateNew || !searchTerm.trim()) return;
|
|
7625
|
+
try {
|
|
7626
|
+
const newValue = await columnDef.onCreateNew(searchTerm.trim());
|
|
7627
|
+
onChange(newValue);
|
|
7628
|
+
setSearchTerm("");
|
|
7629
|
+
setShowCreateOption(false);
|
|
7630
|
+
} catch (error) {
|
|
7631
|
+
console.error("Error creating new item:", error);
|
|
7632
|
+
}
|
|
7633
|
+
}, [isCreatable, columnDef.onCreateNew, searchTerm, onChange]);
|
|
7634
|
+
return /* @__PURE__ */ jsxs10(
|
|
7635
|
+
Select,
|
|
7636
|
+
{
|
|
7637
|
+
ref: selectRef,
|
|
7638
|
+
value: String(currentValue),
|
|
7639
|
+
onValueChange: (newValue) => {
|
|
7640
|
+
if (newValue.startsWith("__create_new__")) {
|
|
7641
|
+
handleCreateNew();
|
|
7642
|
+
} else {
|
|
7643
|
+
onChange(newValue);
|
|
7644
|
+
}
|
|
7645
|
+
},
|
|
7646
|
+
onOpenChange: (open) => {
|
|
7647
|
+
setIsOpen(open);
|
|
7648
|
+
if (!open) {
|
|
7649
|
+
setSearchTerm("");
|
|
7650
|
+
setShowCreateOption(false);
|
|
7651
|
+
}
|
|
7652
|
+
},
|
|
7653
|
+
children: [
|
|
7654
|
+
/* @__PURE__ */ jsx14(SelectTrigger, { className: "h-8", children: /* @__PURE__ */ jsx14(SelectValue, { placeholder: placeholder || `Select ${columnDef.header || "option"}...` }) }),
|
|
7655
|
+
/* @__PURE__ */ jsxs10(
|
|
7656
|
+
SelectContent,
|
|
7657
|
+
{
|
|
7658
|
+
searchable: Boolean(isSearchable),
|
|
7659
|
+
searchPlaceholder: `Search ${columnDef.header || "options"}...`,
|
|
7660
|
+
maxHeight: columnDef.selectMaxHeight,
|
|
7661
|
+
className: columnDef.selectContentClassName,
|
|
7662
|
+
style: columnDef.selectContentStyle,
|
|
7663
|
+
children: [
|
|
7664
|
+
columnDef.fieldOptions?.map((option, index) => {
|
|
7665
|
+
if ("value" in option && !("type" in option)) {
|
|
7666
|
+
return /* @__PURE__ */ jsx14(SelectItem, { value: String(option.value), children: option.label }, `${option.value}-${index}`);
|
|
7667
|
+
}
|
|
7668
|
+
if ("type" in option && option.type === "separator") {
|
|
7669
|
+
return /* @__PURE__ */ jsx14(SelectSeparator, {}, `separator-${index}`);
|
|
7670
|
+
}
|
|
7671
|
+
if ("type" in option && option.type === "group") {
|
|
7672
|
+
const groupOption = option;
|
|
7673
|
+
return /* @__PURE__ */ jsxs10(SelectGroup, { children: [
|
|
7674
|
+
/* @__PURE__ */ jsx14(SelectLabel, { children: groupOption.label }),
|
|
7675
|
+
groupOption.items.map((item) => /* @__PURE__ */ jsx14(SelectItem, { value: String(item.value), children: item.label }, `${item.value}-${index}`))
|
|
7676
|
+
] }, `group-${groupOption.label}-${index}`);
|
|
7677
|
+
}
|
|
7678
|
+
return null;
|
|
7679
|
+
}),
|
|
7680
|
+
showCreateOption && isCreatable && searchTerm.trim() && /* @__PURE__ */ jsxs10(
|
|
7681
|
+
SelectItem,
|
|
7682
|
+
{
|
|
7683
|
+
value: `__create_new__${searchTerm}`,
|
|
7684
|
+
className: "bg-main-100 font-medium border-t border-main-200",
|
|
7685
|
+
children: [
|
|
7686
|
+
'Create "',
|
|
7687
|
+
searchTerm,
|
|
7688
|
+
'"'
|
|
7689
|
+
]
|
|
7690
|
+
},
|
|
7691
|
+
"__create_new__"
|
|
7692
|
+
)
|
|
7693
|
+
]
|
|
7694
|
+
}
|
|
7695
|
+
)
|
|
7696
|
+
]
|
|
7697
|
+
}
|
|
7698
|
+
);
|
|
7699
|
+
}
|
|
7454
7700
|
var renderEditField2 = (column, value, onChange, editingData = {}, placeholder) => {
|
|
7455
7701
|
const columnDef = column.columnDef;
|
|
7456
7702
|
if (columnDef.editable === false) {
|
|
@@ -7459,19 +7705,19 @@ var renderEditField2 = (column, value, onChange, editingData = {}, placeholder)
|
|
|
7459
7705
|
if (columnDef.fieldType === "select" && columnDef.fieldOptions) {
|
|
7460
7706
|
const accessorKey = columnDef.editAccessorKey || column.id;
|
|
7461
7707
|
const currentValue = editingData[accessorKey] ?? value ?? "";
|
|
7462
|
-
return /* @__PURE__ */
|
|
7463
|
-
|
|
7708
|
+
return /* @__PURE__ */ jsx14(
|
|
7709
|
+
SelectEditField2,
|
|
7464
7710
|
{
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
]
|
|
7711
|
+
columnDef,
|
|
7712
|
+
accessorKey,
|
|
7713
|
+
currentValue,
|
|
7714
|
+
placeholder,
|
|
7715
|
+
onChange: (newValue) => onChange({ [accessorKey]: newValue })
|
|
7471
7716
|
}
|
|
7472
7717
|
);
|
|
7473
7718
|
}
|
|
7474
7719
|
if (columnDef.fieldType === "number") {
|
|
7720
|
+
const hideSpinners = columnDef.hideNumberSpinners !== false;
|
|
7475
7721
|
return /* @__PURE__ */ jsx14(
|
|
7476
7722
|
Input,
|
|
7477
7723
|
{
|
|
@@ -7479,7 +7725,7 @@ var renderEditField2 = (column, value, onChange, editingData = {}, placeholder)
|
|
|
7479
7725
|
value: String(value ?? ""),
|
|
7480
7726
|
onChange: (e) => onChange(e.target.value),
|
|
7481
7727
|
placeholder: placeholder || `Enter ${columnDef.header || column.id}...`,
|
|
7482
|
-
className:
|
|
7728
|
+
className: `h-8 ${hideSpinners ? "datatable-number-no-spinners" : ""}`
|
|
7483
7729
|
}
|
|
7484
7730
|
);
|
|
7485
7731
|
}
|
|
@@ -7505,7 +7751,7 @@ var renderEditField2 = (column, value, onChange, editingData = {}, placeholder)
|
|
|
7505
7751
|
}
|
|
7506
7752
|
);
|
|
7507
7753
|
};
|
|
7508
|
-
var RowComponent =
|
|
7754
|
+
var RowComponent = React10.memo(({
|
|
7509
7755
|
row,
|
|
7510
7756
|
style,
|
|
7511
7757
|
isEditing,
|
|
@@ -7873,23 +8119,55 @@ function UnifiedTableBody({
|
|
|
7873
8119
|
isCreating && /* @__PURE__ */ jsxs10("tr", { children: [
|
|
7874
8120
|
headerGroups[0]?.headers?.filter((header) => {
|
|
7875
8121
|
return typeof header.column.getIsVisible === "function" ? header.column.getIsVisible() : true;
|
|
7876
|
-
})?.filter((header) => header.column.id !== "actions"
|
|
7877
|
-
"
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
8122
|
+
})?.filter((header) => header.column.id !== "actions")?.map((header) => {
|
|
8123
|
+
if (header.column.id === "select") {
|
|
8124
|
+
return /* @__PURE__ */ jsx14(
|
|
8125
|
+
"td",
|
|
8126
|
+
{
|
|
8127
|
+
className: getTableCellClasses({
|
|
8128
|
+
isCompact: true,
|
|
8129
|
+
className: "px-3 py-2"
|
|
8130
|
+
})
|
|
8131
|
+
},
|
|
8132
|
+
header.column.id
|
|
8133
|
+
);
|
|
8134
|
+
}
|
|
8135
|
+
const columnDef = header.column.columnDef;
|
|
8136
|
+
const dataKey = columnDef.editAccessorKey || columnDef.accessorKey || header.column.id;
|
|
8137
|
+
const editField = renderEditField2(
|
|
8138
|
+
header.column,
|
|
8139
|
+
creationData[dataKey] ?? creationData[header.column.id] ?? "",
|
|
8140
|
+
(value) => {
|
|
7884
8141
|
if (typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Date)) {
|
|
7885
8142
|
onCreationDataChange({ ...creationData, ...value });
|
|
7886
8143
|
} else {
|
|
7887
|
-
onCreationDataChange({ ...creationData, [
|
|
8144
|
+
onCreationDataChange({ ...creationData, [dataKey]: value });
|
|
7888
8145
|
}
|
|
7889
|
-
},
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
8146
|
+
},
|
|
8147
|
+
creationData
|
|
8148
|
+
);
|
|
8149
|
+
return /* @__PURE__ */ jsx14(
|
|
8150
|
+
"td",
|
|
8151
|
+
{
|
|
8152
|
+
className: getTableCellClasses({
|
|
8153
|
+
isCompact: true,
|
|
8154
|
+
className: "px-3 py-2"
|
|
8155
|
+
}),
|
|
8156
|
+
children: editField || // Fallback: render a text input if renderEditField somehow returns nothing
|
|
8157
|
+
/* @__PURE__ */ jsx14(
|
|
8158
|
+
Input,
|
|
8159
|
+
{
|
|
8160
|
+
type: "text",
|
|
8161
|
+
value: String(creationData[dataKey] ?? creationData[header.column.id] ?? ""),
|
|
8162
|
+
onChange: (e) => onCreationDataChange({ ...creationData, [dataKey]: e.target.value }),
|
|
8163
|
+
placeholder: `Enter ${columnDef.header || header.column.id}...`,
|
|
8164
|
+
className: "h-8"
|
|
8165
|
+
}
|
|
8166
|
+
)
|
|
8167
|
+
},
|
|
8168
|
+
header.column.id
|
|
8169
|
+
);
|
|
8170
|
+
}),
|
|
7893
8171
|
/* @__PURE__ */ jsxs10(
|
|
7894
8172
|
"td",
|
|
7895
8173
|
{
|
|
@@ -7932,7 +8210,7 @@ function UnifiedTableBody({
|
|
|
7932
8210
|
}
|
|
7933
8211
|
|
|
7934
8212
|
// src/components/DataTable/components/PaginationControls.tsx
|
|
7935
|
-
import
|
|
8213
|
+
import React11 from "react";
|
|
7936
8214
|
import {
|
|
7937
8215
|
ChevronLeft,
|
|
7938
8216
|
ChevronRight as ChevronRight2,
|
|
@@ -8255,7 +8533,7 @@ function EnhancedPaginationControls({
|
|
|
8255
8533
|
showJumpToPage = false,
|
|
8256
8534
|
...props
|
|
8257
8535
|
}) {
|
|
8258
|
-
const [jumpToPage, setJumpToPage] =
|
|
8536
|
+
const [jumpToPage, setJumpToPage] = React11.useState("");
|
|
8259
8537
|
const { table, paginationMode = "client", serverData, onPageChange, totalCount } = props;
|
|
8260
8538
|
const pagination = getPaginationBinding({
|
|
8261
8539
|
mode: paginationMode,
|
|
@@ -8287,7 +8565,7 @@ function EnhancedPaginationControls({
|
|
|
8287
8565
|
max: pageCount,
|
|
8288
8566
|
value: jumpToPage,
|
|
8289
8567
|
onChange: (e) => setJumpToPage(e.target.value),
|
|
8290
|
-
className: "w-16 h-6 px-2 border rounded text-xs",
|
|
8568
|
+
className: "w-16 h-6 px-2 border rounded text-xs datatable-number-no-spinners",
|
|
8291
8569
|
placeholder: "1"
|
|
8292
8570
|
}
|
|
8293
8571
|
),
|
|
@@ -8312,7 +8590,7 @@ import { useEffect as useEffect6 } from "react";
|
|
|
8312
8590
|
import { useState as useState4, useRef as useRef4, useEffect as useEffect5 } from "react";
|
|
8313
8591
|
|
|
8314
8592
|
// src/components/Dialog/Dialog.tsx
|
|
8315
|
-
import * as
|
|
8593
|
+
import * as React12 from "react";
|
|
8316
8594
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
8317
8595
|
import { X as X4 } from "lucide-react";
|
|
8318
8596
|
|
|
@@ -8388,7 +8666,7 @@ var Dialog = DialogPrimitive.Root;
|
|
|
8388
8666
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
8389
8667
|
var DialogPortal = DialogPrimitive.Portal;
|
|
8390
8668
|
var DialogClose = DialogPrimitive.Close;
|
|
8391
|
-
var DialogOverlay =
|
|
8669
|
+
var DialogOverlay = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
8392
8670
|
DialogPrimitive.Overlay,
|
|
8393
8671
|
{
|
|
8394
8672
|
ref,
|
|
@@ -8465,7 +8743,7 @@ var useSmartDimensions = ({
|
|
|
8465
8743
|
}
|
|
8466
8744
|
return result;
|
|
8467
8745
|
};
|
|
8468
|
-
var DialogContent =
|
|
8746
|
+
var DialogContent = React12.forwardRef(({
|
|
8469
8747
|
className,
|
|
8470
8748
|
children,
|
|
8471
8749
|
size = "md",
|
|
@@ -8492,17 +8770,17 @@ var DialogContent = React11.forwardRef(({
|
|
|
8492
8770
|
minWidth,
|
|
8493
8771
|
enableScrolling
|
|
8494
8772
|
});
|
|
8495
|
-
const handleEscapeKeyDown =
|
|
8773
|
+
const handleEscapeKeyDown = React12.useCallback((event) => {
|
|
8496
8774
|
if (preventCloseOnEscape) {
|
|
8497
8775
|
event.preventDefault();
|
|
8498
8776
|
}
|
|
8499
8777
|
}, [preventCloseOnEscape]);
|
|
8500
|
-
const handlePointerDownOutside =
|
|
8778
|
+
const handlePointerDownOutside = React12.useCallback((event) => {
|
|
8501
8779
|
if (preventCloseOnOutsideClick) {
|
|
8502
8780
|
event.preventDefault();
|
|
8503
8781
|
}
|
|
8504
8782
|
}, [preventCloseOnOutsideClick]);
|
|
8505
|
-
const mergedStyle =
|
|
8783
|
+
const mergedStyle = React12.useMemo(() => {
|
|
8506
8784
|
if (Object.keys(smartDimensions).length === 0) {
|
|
8507
8785
|
return style;
|
|
8508
8786
|
}
|
|
@@ -8580,13 +8858,13 @@ var DialogBody = ({
|
|
|
8580
8858
|
children,
|
|
8581
8859
|
...props
|
|
8582
8860
|
}) => {
|
|
8583
|
-
const mergedStyle =
|
|
8861
|
+
const mergedStyle = React12.useMemo(() => {
|
|
8584
8862
|
return {
|
|
8585
8863
|
...maxHeight && { maxHeight },
|
|
8586
8864
|
...style
|
|
8587
8865
|
};
|
|
8588
8866
|
}, [maxHeight, style]);
|
|
8589
|
-
const processedHtmlContent =
|
|
8867
|
+
const processedHtmlContent = React12.useMemo(() => {
|
|
8590
8868
|
if (!htmlContent || !allowHtml) {
|
|
8591
8869
|
return null;
|
|
8592
8870
|
}
|
|
@@ -8649,8 +8927,8 @@ var DialogFooter = ({
|
|
|
8649
8927
|
}
|
|
8650
8928
|
);
|
|
8651
8929
|
DialogFooter.displayName = "DialogFooter";
|
|
8652
|
-
var DialogTitle =
|
|
8653
|
-
const processedHtmlContent =
|
|
8930
|
+
var DialogTitle = React12.forwardRef(({ className, htmlContent, allowHtml = true, children, ...props }, ref) => {
|
|
8931
|
+
const processedHtmlContent = React12.useMemo(() => {
|
|
8654
8932
|
if (!htmlContent || !allowHtml) {
|
|
8655
8933
|
return null;
|
|
8656
8934
|
}
|
|
@@ -8673,8 +8951,8 @@ var DialogTitle = React11.forwardRef(({ className, htmlContent, allowHtml = true
|
|
|
8673
8951
|
);
|
|
8674
8952
|
});
|
|
8675
8953
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
8676
|
-
var DialogDescription =
|
|
8677
|
-
const processedHtmlContent =
|
|
8954
|
+
var DialogDescription = React12.forwardRef(({ className, htmlContent, allowHtml = true, children, ...props }, ref) => {
|
|
8955
|
+
const processedHtmlContent = React12.useMemo(() => {
|
|
8678
8956
|
if (!htmlContent || !allowHtml) {
|
|
8679
8957
|
return null;
|
|
8680
8958
|
}
|
|
@@ -9036,12 +9314,12 @@ function DataTableModals({
|
|
|
9036
9314
|
}
|
|
9037
9315
|
|
|
9038
9316
|
// src/components/DataTable/components/DataTableErrorBoundary.tsx
|
|
9039
|
-
import
|
|
9317
|
+
import React16, { Component } from "react";
|
|
9040
9318
|
|
|
9041
9319
|
// src/components/Alert/Alert.tsx
|
|
9042
|
-
import * as
|
|
9320
|
+
import * as React15 from "react";
|
|
9043
9321
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
9044
|
-
var AlertContext =
|
|
9322
|
+
var AlertContext = React15.createContext({ variant: "default" });
|
|
9045
9323
|
var getAlertClasses = (variant = "default") => {
|
|
9046
9324
|
const baseClasses = "relative w-full rounded-lg border p-4";
|
|
9047
9325
|
const variantClasses = {
|
|
@@ -9052,10 +9330,10 @@ var getAlertClasses = (variant = "default") => {
|
|
|
9052
9330
|
};
|
|
9053
9331
|
return `${baseClasses} ${variantClasses[variant]}`;
|
|
9054
9332
|
};
|
|
9055
|
-
var Alert =
|
|
9056
|
-
const contextValue =
|
|
9333
|
+
var Alert = React15.forwardRef(({ className, variant = "default", ...props }, ref) => {
|
|
9334
|
+
const contextValue = React15.useMemo(() => ({ variant }), [variant]);
|
|
9057
9335
|
if (variant === "inline") {
|
|
9058
|
-
return /* @__PURE__ */ jsx20(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx20(
|
|
9336
|
+
return /* @__PURE__ */ jsx20(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx20(React15.Fragment, { ...props }) });
|
|
9059
9337
|
}
|
|
9060
9338
|
return /* @__PURE__ */ jsx20(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx20(
|
|
9061
9339
|
"div",
|
|
@@ -9068,8 +9346,8 @@ var Alert = React14.forwardRef(({ className, variant = "default", ...props }, re
|
|
|
9068
9346
|
) });
|
|
9069
9347
|
});
|
|
9070
9348
|
Alert.displayName = "Alert";
|
|
9071
|
-
var AlertTitle =
|
|
9072
|
-
const { variant } =
|
|
9349
|
+
var AlertTitle = React15.forwardRef(({ className, ...props }, ref) => {
|
|
9350
|
+
const { variant } = React15.useContext(AlertContext);
|
|
9073
9351
|
if (variant === "inline") {
|
|
9074
9352
|
return /* @__PURE__ */ jsx20("strong", { ...props });
|
|
9075
9353
|
}
|
|
@@ -9083,8 +9361,8 @@ var AlertTitle = React14.forwardRef(({ className, ...props }, ref) => {
|
|
|
9083
9361
|
);
|
|
9084
9362
|
});
|
|
9085
9363
|
AlertTitle.displayName = "AlertTitle";
|
|
9086
|
-
var AlertDescription =
|
|
9087
|
-
const { variant } =
|
|
9364
|
+
var AlertDescription = React15.forwardRef(({ className, ...props }, ref) => {
|
|
9365
|
+
const { variant } = React15.useContext(AlertContext);
|
|
9088
9366
|
if (variant === "inline") {
|
|
9089
9367
|
return /* @__PURE__ */ jsx20("span", { ...props });
|
|
9090
9368
|
}
|
|
@@ -10058,7 +10336,7 @@ function useDataTableConfiguration({
|
|
|
10058
10336
|
}
|
|
10059
10337
|
|
|
10060
10338
|
// src/components/Card/Card.tsx
|
|
10061
|
-
import * as
|
|
10339
|
+
import * as React17 from "react";
|
|
10062
10340
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
10063
10341
|
function getCardClasses(variant = "default", size = "default") {
|
|
10064
10342
|
const baseClasses = "rounded-lg border bg-card text-card-foreground shadow-sm";
|
|
@@ -10074,7 +10352,7 @@ function getCardClasses(variant = "default", size = "default") {
|
|
|
10074
10352
|
};
|
|
10075
10353
|
return `${baseClasses} ${variantClasses[variant]} ${sizeClasses2[size]}`;
|
|
10076
10354
|
}
|
|
10077
|
-
var Card =
|
|
10355
|
+
var Card = React17.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
10078
10356
|
"article",
|
|
10079
10357
|
{
|
|
10080
10358
|
ref,
|
|
@@ -10087,7 +10365,7 @@ var Card = React16.forwardRef(({ className, variant, size, ...props }, ref) => /
|
|
|
10087
10365
|
}
|
|
10088
10366
|
));
|
|
10089
10367
|
Card.displayName = "Card";
|
|
10090
|
-
var CardHeader =
|
|
10368
|
+
var CardHeader = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
10091
10369
|
"header",
|
|
10092
10370
|
{
|
|
10093
10371
|
ref,
|
|
@@ -10096,7 +10374,7 @@ var CardHeader = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
10096
10374
|
}
|
|
10097
10375
|
));
|
|
10098
10376
|
CardHeader.displayName = "CardHeader";
|
|
10099
|
-
var CardTitle =
|
|
10377
|
+
var CardTitle = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
10100
10378
|
"h3",
|
|
10101
10379
|
{
|
|
10102
10380
|
ref,
|
|
@@ -10108,7 +10386,7 @@ var CardTitle = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
10108
10386
|
}
|
|
10109
10387
|
));
|
|
10110
10388
|
CardTitle.displayName = "CardTitle";
|
|
10111
|
-
var CardDescription =
|
|
10389
|
+
var CardDescription = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
10112
10390
|
"p",
|
|
10113
10391
|
{
|
|
10114
10392
|
ref,
|
|
@@ -10117,7 +10395,7 @@ var CardDescription = React16.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
10117
10395
|
}
|
|
10118
10396
|
));
|
|
10119
10397
|
CardDescription.displayName = "CardDescription";
|
|
10120
|
-
var CardContent =
|
|
10398
|
+
var CardContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
10121
10399
|
"main",
|
|
10122
10400
|
{
|
|
10123
10401
|
ref,
|
|
@@ -10126,7 +10404,7 @@ var CardContent = React16.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
10126
10404
|
}
|
|
10127
10405
|
));
|
|
10128
10406
|
CardContent.displayName = "CardContent";
|
|
10129
|
-
var CardFooter =
|
|
10407
|
+
var CardFooter = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
10130
10408
|
"footer",
|
|
10131
10409
|
{
|
|
10132
10410
|
ref,
|
|
@@ -10135,7 +10413,7 @@ var CardFooter = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
10135
10413
|
}
|
|
10136
10414
|
));
|
|
10137
10415
|
CardFooter.displayName = "CardFooter";
|
|
10138
|
-
var CardActions =
|
|
10416
|
+
var CardActions = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
10139
10417
|
"nav",
|
|
10140
10418
|
{
|
|
10141
10419
|
ref,
|
|
@@ -10146,7 +10424,7 @@ var CardActions = React16.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
10146
10424
|
}
|
|
10147
10425
|
));
|
|
10148
10426
|
CardActions.displayName = "CardActions";
|
|
10149
|
-
var HoverCard =
|
|
10427
|
+
var HoverCard = React17.forwardRef(({ children, className, ...props }, ref) => {
|
|
10150
10428
|
return /* @__PURE__ */ jsx22(
|
|
10151
10429
|
"section",
|
|
10152
10430
|
{
|
|
@@ -10158,7 +10436,7 @@ var HoverCard = React16.forwardRef(({ children, className, ...props }, ref) => {
|
|
|
10158
10436
|
);
|
|
10159
10437
|
});
|
|
10160
10438
|
HoverCard.displayName = "HoverCard";
|
|
10161
|
-
var HoverCardTrigger =
|
|
10439
|
+
var HoverCardTrigger = React17.forwardRef(({ className, asChild, children, ...props }, ref) => {
|
|
10162
10440
|
if (asChild) {
|
|
10163
10441
|
return /* @__PURE__ */ jsx22("span", { className: cn("cursor-pointer", className), children });
|
|
10164
10442
|
}
|
|
@@ -10177,7 +10455,7 @@ var HoverCardTrigger = React16.forwardRef(({ className, asChild, children, ...pr
|
|
|
10177
10455
|
);
|
|
10178
10456
|
});
|
|
10179
10457
|
HoverCardTrigger.displayName = "HoverCardTrigger";
|
|
10180
|
-
var HoverCardContent =
|
|
10458
|
+
var HoverCardContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
10181
10459
|
"aside",
|
|
10182
10460
|
{
|
|
10183
10461
|
ref,
|
|
@@ -10563,7 +10841,7 @@ function useDataTablePermissions(rbac, features = {}) {
|
|
|
10563
10841
|
}
|
|
10564
10842
|
|
|
10565
10843
|
// src/components/DataTable/hooks/useTableColumns.ts
|
|
10566
|
-
import
|
|
10844
|
+
import React18, { useMemo as useMemo13 } from "react";
|
|
10567
10845
|
|
|
10568
10846
|
// src/components/DataTable/core/ColumnFactory.ts
|
|
10569
10847
|
var ColumnFactory = class {
|
|
@@ -10769,14 +11047,14 @@ function useTableColumns({
|
|
|
10769
11047
|
header: ({ table }) => {
|
|
10770
11048
|
const isAllSelected = table.getIsAllPageRowsSelected();
|
|
10771
11049
|
const isSomeSelected = table.getIsSomePageRowsSelected();
|
|
10772
|
-
return
|
|
11050
|
+
return React18.createElement(Checkbox, {
|
|
10773
11051
|
checked: isAllSelected ? true : isSomeSelected ? "indeterminate" : false,
|
|
10774
11052
|
onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value),
|
|
10775
11053
|
"aria-label": "Select all"
|
|
10776
11054
|
});
|
|
10777
11055
|
},
|
|
10778
11056
|
cell: ({ row }) => {
|
|
10779
|
-
return
|
|
11057
|
+
return React18.createElement(Checkbox, {
|
|
10780
11058
|
checked: row.getIsSelected(),
|
|
10781
11059
|
onCheckedChange: (value) => row.toggleSelected(!!value),
|
|
10782
11060
|
"aria-label": "Select row"
|
|
@@ -12094,7 +12372,7 @@ function DataTableInternal({
|
|
|
12094
12372
|
grouping: state.grouping,
|
|
12095
12373
|
aggregates,
|
|
12096
12374
|
getRowId: resolvedGetRowId,
|
|
12097
|
-
emptyState:
|
|
12375
|
+
emptyState: React19.isValidElement(emptyState) ? void 0 : emptyState,
|
|
12098
12376
|
isFiltered: searchQuery !== "" || state.columnFilters.length > 0,
|
|
12099
12377
|
onClearFilters: () => {
|
|
12100
12378
|
stateActions.setSearchQuery("");
|
|
@@ -12189,30 +12467,30 @@ function DataTableCore(props) {
|
|
|
12189
12467
|
// src/components/DataTable/DataTable.tsx
|
|
12190
12468
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
12191
12469
|
function DataTable(props) {
|
|
12192
|
-
const logger =
|
|
12470
|
+
const logger = React20.useMemo(() => createLogger("DataTable"), []);
|
|
12193
12471
|
const { features, ...rest } = props;
|
|
12194
12472
|
console.log("[DataTable] \u{1F3AF} DataTable WRAPPER called:", {
|
|
12195
12473
|
dataLength: props.data?.length || 0,
|
|
12196
12474
|
columnsCount: props.columns?.length || 0,
|
|
12197
12475
|
pageName: props.rbac?.pageName || props.rbac?.pageId
|
|
12198
12476
|
});
|
|
12199
|
-
const normalizedFeatures =
|
|
12477
|
+
const normalizedFeatures = React20.useMemo(
|
|
12200
12478
|
() => normalizeDataTableFeatures(features),
|
|
12201
12479
|
[features]
|
|
12202
12480
|
);
|
|
12203
|
-
|
|
12481
|
+
React20.useEffect(() => {
|
|
12204
12482
|
if (!features && import.meta.env?.MODE === "development") {
|
|
12205
12483
|
logger.info("DataTable: no features provided; all capabilities default to disabled. Pass a features object to enable functionality.");
|
|
12206
12484
|
}
|
|
12207
12485
|
}, [features, logger]);
|
|
12208
|
-
|
|
12486
|
+
React20.useEffect(() => {
|
|
12209
12487
|
if (normalizedFeatures.deleteSelected && !normalizedFeatures.deletion) {
|
|
12210
12488
|
logger.warn("deleteSelected requires deletion to be enabled");
|
|
12211
12489
|
}
|
|
12212
12490
|
}, [normalizedFeatures.deleteSelected, normalizedFeatures.deletion, logger]);
|
|
12213
12491
|
return /* @__PURE__ */ jsx25(DataTableCore, { ...rest, features: normalizedFeatures });
|
|
12214
12492
|
}
|
|
12215
|
-
var DataTableComponent =
|
|
12493
|
+
var DataTableComponent = React20.memo(DataTable);
|
|
12216
12494
|
|
|
12217
12495
|
// src/components/DataTable/components/BulkOperationsDropdown.tsx
|
|
12218
12496
|
import {
|
|
@@ -12425,4 +12703,4 @@ lodash/lodash.js:
|
|
|
12425
12703
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
12426
12704
|
*)
|
|
12427
12705
|
*/
|
|
12428
|
-
//# sourceMappingURL=chunk-
|
|
12706
|
+
//# sourceMappingURL=chunk-IMZGJ2X7.js.map
|