@jmruthers/pace-core 0.5.64 → 0.5.67
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-7BER7PDS.js → DataTable-MFUXNGPR.js} +2 -2
- package/dist/{DataTable-D15XipLZ.d.ts → DataTable-ntgmhO2W.d.ts} +1 -1
- package/dist/{PublicLoadingSpinner-CXJ-W9wZ.d.ts → PublicLoadingSpinner-DdKXTkCZ.d.ts} +94 -1
- package/dist/{chunk-S66AJVI2.js → chunk-4HQ5BOVZ.js} +97 -27
- package/dist/chunk-4HQ5BOVZ.js.map +1 -0
- package/dist/{chunk-2LPYEFXI.js → chunk-ZB6AEA7I.js} +309 -261
- package/dist/chunk-ZB6AEA7I.js.map +1 -0
- package/dist/components.d.ts +4 -3
- package/dist/components.js +4 -2
- package/dist/components.js.map +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/{types-E5WSpEtz.d.ts → types-CGX9Vyf5.d.ts} +8 -0
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +1 -1
- package/docs/api/classes/ColumnFactory.md +6 -6
- 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/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/DataTableAction.md +14 -14
- package/docs/api/interfaces/DataTableColumn.md +21 -21
- package/docs/api/interfaces/DataTableProps.md +1 -1
- 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/EventContextType.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/EventProviderProps.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.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/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/RBACContextType.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACProviderProps.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 +34 -0
- 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/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/UsePublicRouteParamsReturn.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 +38 -4
- package/package.json +2 -1
- package/src/components/DataTable/components/DataTableBody.tsx +27 -11
- package/src/components/DataTable/components/DataTableCore.tsx +13 -13
- package/src/components/DataTable/components/EditableRow.tsx +46 -28
- package/src/components/DataTable/components/UnifiedTableBody.tsx +86 -38
- package/src/components/DataTable/components/VirtualizedDataTable.tsx +5 -3
- package/src/components/DataTable/core/ColumnFactory.ts +4 -0
- package/src/components/DataTable/types.ts +10 -0
- package/src/components/Switch/Switch.test.tsx +438 -0
- package/src/components/Switch/Switch.tsx +140 -0
- package/src/components/Switch/index.ts +9 -0
- package/src/components/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/types/index.ts +2 -0
- package/dist/chunk-2LPYEFXI.js.map +0 -1
- package/dist/chunk-S66AJVI2.js.map +0 -1
- /package/dist/{DataTable-7BER7PDS.js.map → DataTable-MFUXNGPR.js.map} +0 -0
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
useDataTableContext,
|
|
33
33
|
usePluginRegistry,
|
|
34
34
|
useStateManager
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-4HQ5BOVZ.js";
|
|
36
36
|
import "./chunk-C7GUF747.js";
|
|
37
37
|
import "./chunk-NHR52QAQ.js";
|
|
38
38
|
import "./chunk-B2WTCLCV.js";
|
|
@@ -97,4 +97,4 @@ export {
|
|
|
97
97
|
usePluginRegistry,
|
|
98
98
|
useStateManager
|
|
99
99
|
};
|
|
100
|
-
//# sourceMappingURL=DataTable-
|
|
100
|
+
//# sourceMappingURL=DataTable-MFUXNGPR.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { D as DataRecord, a as DataTableColumn, b as DataTableRBACConfig, c as DataTableFeatureConfig, H as HierarchicalConfig, P as PerformanceConfig, S as ServerSideConfig, d as PaginationMode, C as ChunkingConfig, e as SearchIndexConfig, G as GetRowId, E as EmptyStateConfig, A as AggregateConfig, f as DataTableAction } from './types-
|
|
3
|
+
import { D as DataRecord, a as DataTableColumn, b as DataTableRBACConfig, c as DataTableFeatureConfig, H as HierarchicalConfig, P as PerformanceConfig, S as ServerSideConfig, d as PaginationMode, C as ChunkingConfig, e as SearchIndexConfig, G as GetRowId, E as EmptyStateConfig, A as AggregateConfig, f as DataTableAction } from './types-CGX9Vyf5.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Configuration interface for customizing ImportModal text content
|
|
@@ -3,6 +3,7 @@ import React__default, { Component, ReactNode, ErrorInfo } from 'react';
|
|
|
3
3
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
4
4
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
5
5
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
6
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
6
7
|
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
7
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
9
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
@@ -468,6 +469,98 @@ declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimiti
|
|
|
468
469
|
|
|
469
470
|
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
470
471
|
|
|
472
|
+
/**
|
|
473
|
+
* @file Switch Component
|
|
474
|
+
* @package @jmruthers/pace-core
|
|
475
|
+
* @module Components/Switch
|
|
476
|
+
* @since 0.5.67
|
|
477
|
+
*
|
|
478
|
+
* A toggle switch component built on Radix UI primitives.
|
|
479
|
+
* Provides an accessible, keyboard-navigable switch for boolean states.
|
|
480
|
+
*
|
|
481
|
+
* Features:
|
|
482
|
+
* - WCAG 2.1 AA compliant
|
|
483
|
+
* - Keyboard navigation (Space/Enter)
|
|
484
|
+
* - Focus visible indicators
|
|
485
|
+
* - Disabled state support
|
|
486
|
+
* - Smooth animations
|
|
487
|
+
* - Tailwind v4 compatible
|
|
488
|
+
* - Theme-aware colors
|
|
489
|
+
*
|
|
490
|
+
* @example
|
|
491
|
+
* ```tsx
|
|
492
|
+
* import { Switch } from '@jmruthers/pace-core';
|
|
493
|
+
*
|
|
494
|
+
* function Example() {
|
|
495
|
+
* const [checked, setChecked] = React.useState(false);
|
|
496
|
+
*
|
|
497
|
+
* return (
|
|
498
|
+
* <div className="flex items-center gap-2">
|
|
499
|
+
* <Switch
|
|
500
|
+
* checked={checked}
|
|
501
|
+
* onCheckedChange={setChecked}
|
|
502
|
+
* id="notifications"
|
|
503
|
+
* />
|
|
504
|
+
* <label htmlFor="notifications">
|
|
505
|
+
* Enable notifications
|
|
506
|
+
* </label>
|
|
507
|
+
* </div>
|
|
508
|
+
* );
|
|
509
|
+
* }
|
|
510
|
+
* ```
|
|
511
|
+
*
|
|
512
|
+
* @example With Form
|
|
513
|
+
* ```tsx
|
|
514
|
+
* import { Switch, Label } from '@jmruthers/pace-core';
|
|
515
|
+
*
|
|
516
|
+
* function FormExample() {
|
|
517
|
+
* return (
|
|
518
|
+
* <div className="flex items-center gap-2">
|
|
519
|
+
* <Switch id="terms" />
|
|
520
|
+
* <Label htmlFor="terms">
|
|
521
|
+
* I agree to the terms and conditions
|
|
522
|
+
* </Label>
|
|
523
|
+
* </div>
|
|
524
|
+
* );
|
|
525
|
+
* }
|
|
526
|
+
* ```
|
|
527
|
+
*
|
|
528
|
+
* @example Disabled State
|
|
529
|
+
* ```tsx
|
|
530
|
+
* <Switch disabled checked />
|
|
531
|
+
* ```
|
|
532
|
+
*
|
|
533
|
+
* @accessibility
|
|
534
|
+
* - Uses Radix UI's accessible switch primitive
|
|
535
|
+
* - Proper keyboard navigation (Space to toggle)
|
|
536
|
+
* - Screen reader announcements for state changes
|
|
537
|
+
* - Focus visible styles for keyboard users
|
|
538
|
+
* - ARIA attributes handled automatically
|
|
539
|
+
*/
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Switch component props
|
|
543
|
+
* Extends all props from Radix UI Switch.Root
|
|
544
|
+
*/
|
|
545
|
+
interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> {
|
|
546
|
+
/**
|
|
547
|
+
* Additional CSS classes to apply to the switch
|
|
548
|
+
*/
|
|
549
|
+
className?: string;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Switch component
|
|
553
|
+
*
|
|
554
|
+
* A toggle switch for boolean states. Built on Radix UI for accessibility.
|
|
555
|
+
*
|
|
556
|
+
* @component
|
|
557
|
+
* @example
|
|
558
|
+
* ```tsx
|
|
559
|
+
* <Switch checked={isEnabled} onCheckedChange={setIsEnabled} />
|
|
560
|
+
* ```
|
|
561
|
+
*/
|
|
562
|
+
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
|
563
|
+
|
|
471
564
|
/**
|
|
472
565
|
* @file Progress Component
|
|
473
566
|
* @package @jmruthers/pace-core
|
|
@@ -3384,4 +3477,4 @@ declare function PublicLoadingSkeleton({ lines, className }: {
|
|
|
3384
3477
|
className?: string;
|
|
3385
3478
|
}): react_jsx_runtime.JSX.Element;
|
|
3386
3479
|
|
|
3387
|
-
export {
|
|
3480
|
+
export { ToastAction as $, Alert as A, Button as B, Card as C, Dialog as D, DialogTrigger as E, type FileSizeLimits as F, DialogClose as G, DialogContent as H, Input as I, DialogHeader as J, DialogBody as K, Label as L, DialogFooter as M, DialogTitle as N, DialogDescription as O, Progress as P, Select as Q, SelectGroup as R, type StorageConfig as S, SelectValue as T, SelectTrigger as U, SelectContent as V, SelectLabel as W, SelectItem as X, SelectSeparator as Y, Toast as Z, Toaster as _, type StorageUploadOptions as a, type PublicPageHeaderProps as a$, ToastProvider as a0, ToastViewport as a1, ToastTitle as a2, ToastDescription as a3, ToastClose as a4, type ToastActionElement as a5, type ToastProps as a6, Tooltip as a7, TooltipTrigger as a8, TooltipContent as a9, TableBody as aA, TableCaption as aB, TableCell as aC, TableFooter as aD, TableHead as aE, TableRow as aF, type StorageFileInfo as aG, PublicPageLayout as aH, usePublicPageContext$1 as aI, PublicPageHeader as aJ, PublicPageProvider as aK, usePublicPageContext as aL, useIsPublicPage as aM, PublicPageFooter as aN, PublicPageDebugger as aO, PublicPageDiagnostic as aP, PublicPageContextChecker as aQ, EventLogo as aR, EventLogoCompact as aS, EventLogoLarge as aT, PublicErrorBoundary as aU, useErrorBoundary as aV, DefaultPublicErrorFallback as aW, PublicLoadingSpinner as aX, PublicLoadingSpinnerFullPage as aY, PublicLoadingSkeleton as aZ, type PublicPageLayoutProps as a_, TooltipProvider as aa, TooltipRoot as ab, Form as ac, LoginForm as ad, type LoginFormProps as ae, Header as af, Footer as ag, type FooterProps as ah, NavigationMenu as ai, type NavigationMenuProps as aj, type NavigationItem as ak, UserMenu as al, type UserMenuProps as am, PaceAppLayout as an, type PaceAppLayoutProps as ao, PaceLoginPage as ap, type PaceLoginPageProps as aq, ErrorBoundary as ar, LoadingSpinner as as, EventSelector as at, OrganisationSelector as au, PasswordResetForm as av, useStorage as aw, useFileUpload as ax, Table as ay, TableHeader as az, type StorageFileMetadata as b, type PublicPageFooterProps as b0, type EventLogoProps as b1, type PublicErrorBoundaryProps as b2, type PublicErrorBoundaryState as b3, type PublicLoadingSpinnerProps as b4, type CardActionsProps as b5, type DialogProps as b6, type DialogTriggerProps as b7, type DialogContentProps as b8, type DialogOverlayProps as b9, type DialogHeaderProps as ba, type DialogFooterProps as bb, type DialogTitleProps as bc, type DialogDescriptionProps as bd, type DialogSize as be, type FormProps as bf, type OrganisationSelectorProps as bg, type ErrorBoundaryProps as bh, type ErrorBoundaryState as bi, type UseStorageOptions as bj, type UseStorageReturn as bk, type StorageUploadResult as c, type StorageUrlOptions as d, type StorageListOptions as e, type StorageListResult as f, type ButtonProps as g, CardHeader as h, CardFooter as i, CardTitle as j, CardDescription as k, CardContent as l, CardActions as m, type CardProps as n, type InputProps as o, type LabelProps as p, AlertTitle as q, AlertDescription as r, Avatar as s, AvatarImage as t, AvatarFallback as u, Checkbox as v, Switch as w, type SwitchProps as x, DialogPortal as y, DialogOverlay as z };
|
|
@@ -1491,13 +1491,37 @@ var MemoizedRow = ({
|
|
|
1491
1491
|
isCompact: true,
|
|
1492
1492
|
className: "px-3 py-2 pl-8 whitespace-normal break-words"
|
|
1493
1493
|
}),
|
|
1494
|
-
children:
|
|
1495
|
-
if
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1494
|
+
children: /* @__PURE__ */ jsx11("div", { className: `${cell.column.columnDef.meta?.align === "right" ? "text-right" : ""}`, children: isSubRowEditing && cell.column.id !== "actions" ? (
|
|
1495
|
+
// Check if column has a custom cell renderer - if so, use it in edit mode
|
|
1496
|
+
cell.column.columnDef.cell ? flexRender(cell.column.columnDef.cell, {
|
|
1497
|
+
...cell.getContext(),
|
|
1498
|
+
hierarchical,
|
|
1499
|
+
isParent: false,
|
|
1500
|
+
isChild: true,
|
|
1501
|
+
isHierarchical: false,
|
|
1502
|
+
rowId: subRowId,
|
|
1503
|
+
isExpanded: false,
|
|
1504
|
+
hasChildren: false,
|
|
1505
|
+
getIsEditing: () => true,
|
|
1506
|
+
// Always true in edit mode
|
|
1507
|
+
setValue: (value) => {
|
|
1508
|
+
if (typeof value === "object" && value !== null) {
|
|
1509
|
+
onEditingDataChange?.({ ...editingData, ...value });
|
|
1510
|
+
} else {
|
|
1511
|
+
onEditingDataChange?.({ ...editingData, [cell.column.id]: value });
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
}) : (
|
|
1515
|
+
// Fall back to default edit field rendering when no custom cell renderer
|
|
1516
|
+
renderEditField(cell.column, editingData?.[cell.column.id], (value) => {
|
|
1517
|
+
if (typeof value === "object" && value !== null) {
|
|
1518
|
+
onEditingDataChange?.({ ...editingData, ...value });
|
|
1519
|
+
} else {
|
|
1520
|
+
onEditingDataChange?.({ ...editingData, [cell.column.id]: value });
|
|
1521
|
+
}
|
|
1522
|
+
}, editingData)
|
|
1523
|
+
)
|
|
1524
|
+
) : cell.column.id === "actions" ? /* @__PURE__ */ jsx11(
|
|
1501
1525
|
ActionButtons,
|
|
1502
1526
|
{
|
|
1503
1527
|
row,
|
|
@@ -1517,7 +1541,7 @@ var MemoizedRow = ({
|
|
|
1517
1541
|
rowId: subRowId,
|
|
1518
1542
|
isExpanded: false,
|
|
1519
1543
|
hasChildren: false
|
|
1520
|
-
})
|
|
1544
|
+
}) })
|
|
1521
1545
|
},
|
|
1522
1546
|
cell.id
|
|
1523
1547
|
)) }, subRow.id);
|
|
@@ -1577,13 +1601,37 @@ var MemoizedRow = ({
|
|
|
1577
1601
|
children: isExpanded ? /* @__PURE__ */ jsx11(ChevronDown2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx11(ChevronRight, { className: "h-4 w-4" })
|
|
1578
1602
|
}
|
|
1579
1603
|
),
|
|
1580
|
-
/* @__PURE__ */ jsx11("div", { className:
|
|
1581
|
-
if
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1604
|
+
/* @__PURE__ */ jsx11("div", { className: `flex-1 ${cell.column.columnDef.meta?.align === "right" ? "text-right" : ""}`, children: isEditing && cell.column.id !== "actions" ? (
|
|
1605
|
+
// Check if column has a custom cell renderer - if so, use it in edit mode
|
|
1606
|
+
cell.column.columnDef.cell ? flexRender(cell.column.columnDef.cell, {
|
|
1607
|
+
...cell.getContext(),
|
|
1608
|
+
hierarchical,
|
|
1609
|
+
isParent,
|
|
1610
|
+
isChild,
|
|
1611
|
+
isHierarchical,
|
|
1612
|
+
rowId,
|
|
1613
|
+
isExpanded,
|
|
1614
|
+
hasChildren,
|
|
1615
|
+
getIsEditing: () => true,
|
|
1616
|
+
// Always true in edit mode
|
|
1617
|
+
setValue: (value) => {
|
|
1618
|
+
if (typeof value === "object" && value !== null) {
|
|
1619
|
+
onEditingDataChange?.({ ...editingData, ...value });
|
|
1620
|
+
} else {
|
|
1621
|
+
onEditingDataChange?.({ ...editingData, [cell.column.id]: value });
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
}) : (
|
|
1625
|
+
// Fall back to default edit field rendering when no custom cell renderer
|
|
1626
|
+
renderEditField(cell.column, editingData?.[cell.column.id], (value) => {
|
|
1627
|
+
if (typeof value === "object" && value !== null) {
|
|
1628
|
+
onEditingDataChange?.({ ...editingData, ...value });
|
|
1629
|
+
} else {
|
|
1630
|
+
onEditingDataChange?.({ ...editingData, [cell.column.id]: value });
|
|
1631
|
+
}
|
|
1632
|
+
}, editingData)
|
|
1633
|
+
)
|
|
1634
|
+
) : cell.column.id === "actions" ? isEditing ? /* @__PURE__ */ jsxs8("div", { className: "flex gap-1", children: [
|
|
1587
1635
|
/* @__PURE__ */ jsx11(
|
|
1588
1636
|
"button",
|
|
1589
1637
|
{
|
|
@@ -2923,7 +2971,11 @@ var ColumnFactory = class {
|
|
|
2923
2971
|
footer: options.footer,
|
|
2924
2972
|
size: options.size,
|
|
2925
2973
|
minSize: options.minSize,
|
|
2926
|
-
maxSize: options.maxSize
|
|
2974
|
+
maxSize: options.maxSize,
|
|
2975
|
+
meta: {
|
|
2976
|
+
align: "right",
|
|
2977
|
+
type: "number"
|
|
2978
|
+
}
|
|
2927
2979
|
};
|
|
2928
2980
|
}
|
|
2929
2981
|
/**
|
|
@@ -3899,12 +3951,12 @@ function DataTableInternal({
|
|
|
3899
3951
|
onClick: header.column.getToggleSortingHandler(),
|
|
3900
3952
|
"aria-label": `Sort by ${typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "column"}`,
|
|
3901
3953
|
tabIndex: 0,
|
|
3902
|
-
children: /* @__PURE__ */ jsxs14("div", { className:
|
|
3954
|
+
children: /* @__PURE__ */ jsxs14("div", { className: `flex items-center gap-1 ${header.column.columnDef.meta?.align === "right" ? "justify-end" : ""}`, children: [
|
|
3903
3955
|
typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header,
|
|
3904
3956
|
header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx20(ChevronUp2, { className: "h-4 w-4" }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx20(ChevronDown3, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx20(ChevronsUpDown, { className: "h-4 w-4" })
|
|
3905
3957
|
] })
|
|
3906
3958
|
}
|
|
3907
|
-
) : /* @__PURE__ */ jsx20("div", { children: typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header })
|
|
3959
|
+
) : /* @__PURE__ */ jsx20("div", { className: header.column.columnDef.meta?.align === "right" ? "text-right" : "", children: typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header })
|
|
3908
3960
|
},
|
|
3909
3961
|
header.id
|
|
3910
3962
|
);
|
|
@@ -5423,6 +5475,7 @@ function GroupHeader({
|
|
|
5423
5475
|
}
|
|
5424
5476
|
|
|
5425
5477
|
// src/components/DataTable/components/EditableRow.tsx
|
|
5478
|
+
import { flexRender as flexRender3 } from "@tanstack/react-table";
|
|
5426
5479
|
init_Button();
|
|
5427
5480
|
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5428
5481
|
var renderEditField2 = (column, value, onChange, editingData = {}, placeholder) => {
|
|
@@ -5495,13 +5548,30 @@ function EditableRow({
|
|
|
5495
5548
|
visible: true
|
|
5496
5549
|
}));
|
|
5497
5550
|
return /* @__PURE__ */ jsxs17("tr", { children: [
|
|
5498
|
-
row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx25("td", { children: cell.column.
|
|
5499
|
-
if
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5551
|
+
row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx25("td", { children: /* @__PURE__ */ jsx25("div", { className: cell.column.columnDef.meta?.align === "right" ? "text-right" : "", children: cell.column.id !== "actions" ? (
|
|
5552
|
+
// Check if column has a custom cell renderer - if so, use it in edit mode
|
|
5553
|
+
cell.column.columnDef.cell ? flexRender3(cell.column.columnDef.cell, {
|
|
5554
|
+
...cell.getContext(),
|
|
5555
|
+
getIsEditing: () => true,
|
|
5556
|
+
// Always true in edit mode
|
|
5557
|
+
setValue: (value) => {
|
|
5558
|
+
if (typeof value === "object" && value !== null) {
|
|
5559
|
+
onEditingDataChange({ ...editingData, ...value });
|
|
5560
|
+
} else {
|
|
5561
|
+
onEditingDataChange({ ...editingData, [cell.column.id]: value });
|
|
5562
|
+
}
|
|
5563
|
+
}
|
|
5564
|
+
}) : (
|
|
5565
|
+
// Fall back to default edit field rendering when no custom cell renderer
|
|
5566
|
+
renderEditField2(cell.column, editingData[cell.column.id], (value) => {
|
|
5567
|
+
if (typeof value === "object" && value !== null) {
|
|
5568
|
+
onEditingDataChange({ ...editingData, ...value });
|
|
5569
|
+
} else {
|
|
5570
|
+
onEditingDataChange({ ...editingData, [cell.column.id]: value });
|
|
5571
|
+
}
|
|
5572
|
+
}, editingData)
|
|
5573
|
+
)
|
|
5574
|
+
) : /* @__PURE__ */ jsxs17("div", { className: "flex gap-1", children: [
|
|
5505
5575
|
/* @__PURE__ */ jsx25(
|
|
5506
5576
|
Button,
|
|
5507
5577
|
{
|
|
@@ -5520,7 +5590,7 @@ function EditableRow({
|
|
|
5520
5590
|
children: "Cancel"
|
|
5521
5591
|
}
|
|
5522
5592
|
)
|
|
5523
|
-
] }) }, cell.id)),
|
|
5593
|
+
] }) }) }, cell.id)),
|
|
5524
5594
|
actions.length > 0 && /* @__PURE__ */ jsx25("td", { children: /* @__PURE__ */ jsx25(
|
|
5525
5595
|
ActionButtons,
|
|
5526
5596
|
{
|
|
@@ -5591,4 +5661,4 @@ export {
|
|
|
5591
5661
|
GroupHeader,
|
|
5592
5662
|
EditableRow
|
|
5593
5663
|
};
|
|
5594
|
-
//# sourceMappingURL=chunk-
|
|
5664
|
+
//# sourceMappingURL=chunk-4HQ5BOVZ.js.map
|