@leapdevuk/component-toolbox 0.1.5 → 0.1.7

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,33 +1,47 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.7 (2026-07-22)
4
+
5
+ ### Features
6
+
7
+ - ErrorBoundary component exception handler. Truncate the error message upto, and including the first full-stop. This provides a summary of the error. To get full information, open console.
8
+
9
+ ## 0.1.6 (2026-07-21)
10
+
11
+ ### Features
12
+
13
+ - New ErrorBoundary component exception handler. Wrapper added to DataGrid and DataGridTree
14
+
3
15
  ## 0.1.5 (2026-02-26)
4
16
 
5
17
  ### Bug Fixes
6
18
 
7
19
  - Footer bar correct order of OK, Cancel and Close buttons
8
20
 
9
- ### Features
10
-
11
21
  ## 0.1.4 (2026-02-17)
12
22
 
23
+ ### Features
24
+
13
25
  - DataGrid add params 'getRowClassName' and 'showBorders' to either show or hide borders.
14
26
 
15
27
  ## 0.1.3 (2026-01-20)
16
28
 
29
+ ### Features
30
+
17
31
  - DataGrid fixed issue with column menu not appearing on hover.
18
32
 
19
33
  ## 0.1.2 (2026-01-15)
20
34
 
21
- - DataGrid add params 'loading' If true, a loading overlay is displayed.
22
-
23
35
  ### Features
24
36
 
25
- ## 0.1.1 (2025-12-17)
37
+ - DataGrid add params 'loading' If true, a loading overlay is displayed.
26
38
 
27
- - DataGrid add params 'groupingColDef' grouping column definitions by the tree data.
39
+ ## 0.1.1 (2025-12-17)
28
40
 
29
41
  ### Features
30
42
 
43
+ - DataGrid add params 'groupingColDef' grouping column definitions by the tree data.
44
+
31
45
  ## 0.1.00 (2025-12-09)
32
46
 
33
47
  - 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';