@leapdevuk/component-toolbox 0.1.4 → 0.1.6

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/CHANGELOG.md CHANGED
@@ -1,27 +1,41 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.6 (2026-07-21)
4
+
3
5
  ### Features
4
6
 
7
+ - New ErrorBoundary component exception handler. Wrapper added to DataGrid and DataGridTree
8
+
9
+ ## 0.1.5 (2026-02-26)
10
+
11
+ ### Bug Fixes
12
+
13
+ - Footer bar correct order of OK, Cancel and Close buttons
14
+
5
15
  ## 0.1.4 (2026-02-17)
6
16
 
17
+ ### Features
18
+
7
19
  - DataGrid add params 'getRowClassName' and 'showBorders' to either show or hide borders.
8
20
 
9
21
  ## 0.1.3 (2026-01-20)
10
22
 
23
+ ### Features
24
+
11
25
  - DataGrid fixed issue with column menu not appearing on hover.
12
26
 
13
27
  ## 0.1.2 (2026-01-15)
14
28
 
15
- - DataGrid add params 'loading' If true, a loading overlay is displayed.
16
-
17
29
  ### Features
18
30
 
19
- ## 0.1.1 (2025-12-17)
31
+ - DataGrid add params 'loading' If true, a loading overlay is displayed.
20
32
 
21
- - DataGrid add params 'groupingColDef' grouping column definitions by the tree data.
33
+ ## 0.1.1 (2025-12-17)
22
34
 
23
35
  ### Features
24
36
 
37
+ - DataGrid add params 'groupingColDef' grouping column definitions by the tree data.
38
+
25
39
  ## 0.1.00 (2025-12-09)
26
40
 
27
41
  - Updated node packages to latest
@@ -1,3 +1,4 @@
1
+ import { ErrorInfo, ReactNode } from 'react';
1
2
  import { GridCallbackDetails, GridColDef, GridColumnVisibilityModel, GridGroupingColDefOverride, GridGroupingColDefOverrideParams, GridInitialState, GridProSlotsComponent, GridRowClassNameParams, GridRowParams, GridRowSelectionModel, GridSlotProps, GridSlotsComponentsProps, GridValidRowModel } from '@mui/x-data-grid-pro';
2
3
  interface IDataGridProps {
3
4
  borderTop?: boolean;
@@ -8,6 +9,7 @@ interface IDataGridProps {
8
9
  componentsProps?: GridSlotsComponentsProps | undefined;
9
10
  defaultGroupingExpansionDepth?: number;
10
11
  disableMultipleRowSelection?: boolean;
12
+ errorFallback?: ReactNode | ((error?: Error) => ReactNode);
11
13
  getRowClassName?: ((params: GridRowClassNameParams<GridValidRowModel>) => string) | undefined;
12
14
  getTreeDataPath?: ((row: GridValidRowModel) => readonly string[]) | undefined;
13
15
  groupingColDef?: GridGroupingColDefOverride<GridValidRowModel> | ((params: GridGroupingColDefOverrideParams) => GridGroupingColDefOverride<GridValidRowModel> | null | undefined) | undefined;
@@ -22,6 +24,7 @@ interface IDataGridProps {
22
24
  noDataText?: string;
23
25
  noRowsOverlay?: React.JSXElementConstructor<GridSlotProps["noRowsOverlay"]>;
24
26
  onRowClick?: (params: GridRowParams<any>) => void;
27
+ onGridError?: (error: Error, info: ErrorInfo) => void;
25
28
  onRowDoubleClick?: (params: GridRowParams<any>) => void;
26
29
  onRowSelectionModelChange?: (rowSelectionModel: GridRowSelectionModel, details: GridCallbackDetails) => void;
27
30
  rowHeight?: number;
@@ -1,3 +1,4 @@
1
+ import { ErrorInfo, ReactNode } from 'react';
1
2
  import { GridCallbackDetails, GridColDef, GridColumnVisibilityModel, GridInitialState, GridProSlotsComponent, GridRowParams, GridRowSelectionModel, GridSlotProps, GridSlotsComponentsProps } from '@mui/x-data-grid-pro';
2
3
  import { Api } from '@leapdev/leap-host';
3
4
  interface IDataGridProps {
@@ -11,6 +12,8 @@ interface IDataGridProps {
11
12
  componentsProps?: GridSlotsComponentsProps | undefined;
12
13
  id: (row: any) => any;
13
14
  borderTop?: boolean;
15
+ errorFallback?: ReactNode;
16
+ onGridError?: (error: Error, info: ErrorInfo) => void;
14
17
  noDataText?: string;
15
18
  columnHeaderHeight?: number;
16
19
  rowHeight?: number;
@@ -0,0 +1,26 @@
1
+ import { Component, ErrorInfo, ReactNode } from 'react';
2
+ interface LCTErrorBoundaryProps {
3
+ children: ReactNode;
4
+ /**
5
+ * Rendered when a child throws. Pass a function to receive the caught error
6
+ * (e.g. to display its message); a plain node is rendered as-is.
7
+ */
8
+ fallback?: ReactNode | ((error?: Error) => ReactNode);
9
+ onError?: (error: Error, info: ErrorInfo) => void;
10
+ }
11
+ interface LCTErrorBoundaryState {
12
+ hasError: boolean;
13
+ error?: Error;
14
+ }
15
+ /**
16
+ * Contains render-time exceptions thrown by its children so a failure (e.g. an
17
+ * expired MUI X licence throwing a LicenseError) degrades to a fallback instead
18
+ * of unmounting the consuming app's subtree.
19
+ */
20
+ declare class LCTErrorBoundary extends Component<LCTErrorBoundaryProps, LCTErrorBoundaryState> {
21
+ state: LCTErrorBoundaryState;
22
+ static getDerivedStateFromError(error: Error): LCTErrorBoundaryState;
23
+ componentDidCatch(error: Error, info: ErrorInfo): void;
24
+ render(): ReactNode;
25
+ }
26
+ export default LCTErrorBoundary;
@@ -0,0 +1 @@
1
+ export { default as LCTErrorBoundary } from './ErrorBoundary';
@@ -18,6 +18,7 @@ export * from './daterangepicker';
18
18
  export * from './dialog';
19
19
  export * from './divider';
20
20
  export * from './drawer';
21
+ export * from './errorboundary';
21
22
  export * from './footer';
22
23
  export * from './formcontrollabel';
23
24
  export * from './formdialog';