@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.
Files changed (131) hide show
  1. package/dist/{DataTable-7BER7PDS.js → DataTable-MFUXNGPR.js} +2 -2
  2. package/dist/{DataTable-D15XipLZ.d.ts → DataTable-ntgmhO2W.d.ts} +1 -1
  3. package/dist/{PublicLoadingSpinner-CXJ-W9wZ.d.ts → PublicLoadingSpinner-DdKXTkCZ.d.ts} +94 -1
  4. package/dist/{chunk-S66AJVI2.js → chunk-4HQ5BOVZ.js} +97 -27
  5. package/dist/chunk-4HQ5BOVZ.js.map +1 -0
  6. package/dist/{chunk-2LPYEFXI.js → chunk-ZB6AEA7I.js} +309 -261
  7. package/dist/chunk-ZB6AEA7I.js.map +1 -0
  8. package/dist/components.d.ts +4 -3
  9. package/dist/components.js +4 -2
  10. package/dist/components.js.map +1 -1
  11. package/dist/hooks.d.ts +1 -1
  12. package/dist/index.d.ts +6 -5
  13. package/dist/index.js +4 -2
  14. package/dist/index.js.map +1 -1
  15. package/dist/{types-E5WSpEtz.d.ts → types-CGX9Vyf5.d.ts} +8 -0
  16. package/dist/types.js.map +1 -1
  17. package/dist/utils.d.ts +2 -2
  18. package/dist/utils.js +1 -1
  19. package/docs/api/classes/ColumnFactory.md +6 -6
  20. package/docs/api/classes/ErrorBoundary.md +1 -1
  21. package/docs/api/classes/InvalidScopeError.md +1 -1
  22. package/docs/api/classes/MissingUserContextError.md +1 -1
  23. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  24. package/docs/api/classes/PermissionDeniedError.md +1 -1
  25. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  26. package/docs/api/classes/RBACAuditManager.md +1 -1
  27. package/docs/api/classes/RBACCache.md +1 -1
  28. package/docs/api/classes/RBACEngine.md +1 -1
  29. package/docs/api/classes/RBACError.md +1 -1
  30. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  31. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  32. package/docs/api/classes/StorageUtils.md +1 -1
  33. package/docs/api/interfaces/AggregateConfig.md +4 -4
  34. package/docs/api/interfaces/ButtonProps.md +1 -1
  35. package/docs/api/interfaces/CardProps.md +1 -1
  36. package/docs/api/interfaces/ColorPalette.md +1 -1
  37. package/docs/api/interfaces/ColorShade.md +1 -1
  38. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  39. package/docs/api/interfaces/DataTableAction.md +14 -14
  40. package/docs/api/interfaces/DataTableColumn.md +21 -21
  41. package/docs/api/interfaces/DataTableProps.md +1 -1
  42. package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
  43. package/docs/api/interfaces/EmptyStateConfig.md +5 -5
  44. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  45. package/docs/api/interfaces/EventContextType.md +1 -1
  46. package/docs/api/interfaces/EventLogoProps.md +1 -1
  47. package/docs/api/interfaces/EventProviderProps.md +1 -1
  48. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  49. package/docs/api/interfaces/FileUploadProps.md +1 -1
  50. package/docs/api/interfaces/FooterProps.md +1 -1
  51. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  52. package/docs/api/interfaces/InputProps.md +1 -1
  53. package/docs/api/interfaces/LabelProps.md +1 -1
  54. package/docs/api/interfaces/LoginFormProps.md +1 -1
  55. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  56. package/docs/api/interfaces/NavigationContextType.md +1 -1
  57. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  58. package/docs/api/interfaces/NavigationItem.md +1 -1
  59. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  60. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  61. package/docs/api/interfaces/Organisation.md +1 -1
  62. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  63. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  64. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  65. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  66. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  67. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  68. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  69. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  70. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  71. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  72. package/docs/api/interfaces/PaletteData.md +1 -1
  73. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  74. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  75. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  76. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  77. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  78. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  79. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  80. package/docs/api/interfaces/RBACConfig.md +1 -1
  81. package/docs/api/interfaces/RBACContextType.md +1 -1
  82. package/docs/api/interfaces/RBACLogger.md +1 -1
  83. package/docs/api/interfaces/RBACProviderProps.md +1 -1
  84. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  85. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  86. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  87. package/docs/api/interfaces/RouteConfig.md +1 -1
  88. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  89. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  90. package/docs/api/interfaces/StorageConfig.md +1 -1
  91. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  92. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  93. package/docs/api/interfaces/StorageListOptions.md +1 -1
  94. package/docs/api/interfaces/StorageListResult.md +1 -1
  95. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  96. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  97. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  98. package/docs/api/interfaces/StyleImport.md +1 -1
  99. package/docs/api/interfaces/SwitchProps.md +34 -0
  100. package/docs/api/interfaces/ToastActionElement.md +1 -1
  101. package/docs/api/interfaces/ToastProps.md +1 -1
  102. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  103. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  104. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  105. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  106. package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
  107. package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
  108. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  109. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  110. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  111. package/docs/api/interfaces/UserEventAccess.md +1 -1
  112. package/docs/api/interfaces/UserMenuProps.md +1 -1
  113. package/docs/api/interfaces/UserProfile.md +1 -1
  114. package/docs/api/modules.md +38 -4
  115. package/package.json +2 -1
  116. package/src/components/DataTable/components/DataTableBody.tsx +27 -11
  117. package/src/components/DataTable/components/DataTableCore.tsx +13 -13
  118. package/src/components/DataTable/components/EditableRow.tsx +46 -28
  119. package/src/components/DataTable/components/UnifiedTableBody.tsx +86 -38
  120. package/src/components/DataTable/components/VirtualizedDataTable.tsx +5 -3
  121. package/src/components/DataTable/core/ColumnFactory.ts +4 -0
  122. package/src/components/DataTable/types.ts +10 -0
  123. package/src/components/Switch/Switch.test.tsx +438 -0
  124. package/src/components/Switch/Switch.tsx +140 -0
  125. package/src/components/Switch/index.ts +9 -0
  126. package/src/components/index.ts +2 -0
  127. package/src/index.ts +2 -0
  128. package/src/types/index.ts +2 -0
  129. package/dist/chunk-2LPYEFXI.js.map +0 -1
  130. package/dist/chunk-S66AJVI2.js.map +0 -1
  131. /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-S66AJVI2.js";
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-7BER7PDS.js.map
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-E5WSpEtz.js';
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 { ToastViewport as $, Alert as A, Button as B, Card as C, Dialog as D, DialogContent as E, type FileSizeLimits as F, DialogHeader as G, DialogBody as H, Input as I, DialogFooter as J, DialogTitle as K, Label as L, DialogDescription as M, Select as N, SelectGroup as O, Progress as P, SelectValue as Q, SelectTrigger as R, type StorageConfig as S, SelectContent as T, SelectLabel as U, SelectItem as V, SelectSeparator as W, Toast as X, Toaster as Y, ToastAction as Z, ToastProvider as _, type StorageUploadOptions as a, type EventLogoProps as a$, ToastTitle as a0, ToastDescription as a1, ToastClose as a2, type ToastActionElement as a3, type ToastProps as a4, Tooltip as a5, TooltipTrigger as a6, TooltipContent as a7, TooltipProvider as a8, TooltipRoot as a9, TableCell as aA, TableFooter as aB, TableHead as aC, TableRow as aD, type StorageFileInfo as aE, PublicPageLayout as aF, usePublicPageContext$1 as aG, PublicPageHeader as aH, PublicPageProvider as aI, usePublicPageContext as aJ, useIsPublicPage as aK, PublicPageFooter as aL, PublicPageDebugger as aM, PublicPageDiagnostic as aN, PublicPageContextChecker as aO, EventLogo as aP, EventLogoCompact as aQ, EventLogoLarge as aR, PublicErrorBoundary as aS, useErrorBoundary as aT, DefaultPublicErrorFallback as aU, PublicLoadingSpinner as aV, PublicLoadingSpinnerFullPage as aW, PublicLoadingSkeleton as aX, type PublicPageLayoutProps as aY, type PublicPageHeaderProps as aZ, type PublicPageFooterProps as a_, Form as aa, LoginForm as ab, type LoginFormProps as ac, Header as ad, Footer as ae, type FooterProps as af, NavigationMenu as ag, type NavigationMenuProps as ah, type NavigationItem as ai, UserMenu as aj, type UserMenuProps as ak, PaceAppLayout as al, type PaceAppLayoutProps as am, PaceLoginPage as an, type PaceLoginPageProps as ao, ErrorBoundary as ap, LoadingSpinner as aq, EventSelector as ar, OrganisationSelector as as, PasswordResetForm as at, useStorage as au, useFileUpload as av, Table as aw, TableHeader as ax, TableBody as ay, TableCaption as az, type StorageFileMetadata as b, type PublicErrorBoundaryProps as b0, type PublicErrorBoundaryState as b1, type PublicLoadingSpinnerProps as b2, type CardActionsProps as b3, type DialogProps as b4, type DialogTriggerProps as b5, type DialogContentProps as b6, type DialogOverlayProps as b7, type DialogHeaderProps as b8, type DialogFooterProps as b9, type DialogTitleProps as ba, type DialogDescriptionProps as bb, type DialogSize as bc, type FormProps as bd, type OrganisationSelectorProps as be, type ErrorBoundaryProps as bf, type ErrorBoundaryState as bg, type UseStorageOptions as bh, type UseStorageReturn as bi, 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, DialogPortal as w, DialogOverlay as x, DialogTrigger as y, DialogClose as z };
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: isSubRowEditing && cell.column.id !== "actions" ? renderEditField(cell.column, editingData?.[cell.column.id], (value) => {
1495
- if (typeof value === "object" && value !== null) {
1496
- onEditingDataChange?.({ ...editingData, ...value });
1497
- } else {
1498
- onEditingDataChange?.({ ...editingData, [cell.column.id]: value });
1499
- }
1500
- }, editingData) : cell.column.id === "actions" ? /* @__PURE__ */ jsx11(
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: "flex-1", children: isEditing && cell.column.id !== "actions" ? renderEditField(cell.column, editingData?.[cell.column.id], (value) => {
1581
- if (typeof value === "object" && value !== null) {
1582
- onEditingDataChange?.({ ...editingData, ...value });
1583
- } else {
1584
- onEditingDataChange?.({ ...editingData, [cell.column.id]: value });
1585
- }
1586
- }, editingData) : cell.column.id === "actions" ? isEditing ? /* @__PURE__ */ jsxs8("div", { className: "flex gap-1", children: [
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: "flex items-center gap-1", children: [
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.id !== "actions" ? renderEditField2(cell.column, editingData[cell.column.id], (value) => {
5499
- if (typeof value === "object" && value !== null) {
5500
- onEditingDataChange({ ...editingData, ...value });
5501
- } else {
5502
- onEditingDataChange({ ...editingData, [cell.column.id]: value });
5503
- }
5504
- }, editingData) : /* @__PURE__ */ jsxs17("div", { className: "flex gap-1", children: [
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-S66AJVI2.js.map
5664
+ //# sourceMappingURL=chunk-4HQ5BOVZ.js.map