sccoreui 5.7.9 → 5.7.11

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.
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const AgGrid_1 = tslib_1.__importDefault(require("./AgGrid"));
7
7
  const advanced_feature_1 = tslib_1.__importDefault(require("./advancedFeature/advanced-feature"));
8
+ const error_ui_1 = tslib_1.__importDefault(require("./error-ui"));
8
9
  function ParentForGrid(props) {
9
10
  const [gridData] = (0, react_1.useState)({
10
11
  rowData: props === null || props === void 0 ? void 0 : props.rowData,
@@ -96,6 +97,6 @@ function ParentForGrid(props) {
96
97
  }, [featureDetails.searchedText]);
97
98
  console.log(gridData, 'grid data');
98
99
  console.log(featureDetails, 'feature details');
99
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ style: { height: style.height, width: style.width } }, { children: [(0, jsx_runtime_1.jsx)(advanced_feature_1.default, { featureDetails: featureDetails, setFeatureDetails: setFeatureDetails, columnData: gridData.columnData, props: props, callGrid: callGrid }), (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: style, gridOptions: gridOptions, onGridReady: onGridReady })] })));
100
+ return ((0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ style: { height: style.height, width: style.width } }, { children: [(0, jsx_runtime_1.jsx)(advanced_feature_1.default, { featureDetails: featureDetails, setFeatureDetails: setFeatureDetails, columnData: gridData.columnData, props: props, callGrid: callGrid }), (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: style, gridOptions: gridOptions, onGridReady: onGridReady })] })) }));
100
101
  }
101
102
  exports.default = ParentForGrid;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const react_1 = require("react");
5
+ function ErrorBoundary({ children }) {
6
+ const [hasError, setHasError] = (0, react_1.useState)(false);
7
+ (0, react_1.useEffect)(() => {
8
+ const errorHandler = (error, errorInfo) => {
9
+ setHasError(true);
10
+ // You can log the error here
11
+ console.error(error, errorInfo, 'error details');
12
+ };
13
+ // Add the error handler to the window object
14
+ window.addEventListener('error', errorHandler);
15
+ // Clean up the error handler
16
+ return () => {
17
+ window.removeEventListener('error', errorHandler);
18
+ };
19
+ }, []);
20
+ if (hasError) {
21
+ console.log(hasError, 'error occured');
22
+ // Fallback UI for when an error occurs
23
+ return (0, jsx_runtime_1.jsx)("div", { children: " Something went wrong" });
24
+ }
25
+ return children;
26
+ }
27
+ exports.default = ErrorBoundary;
@@ -152,12 +152,13 @@ const FormulaComponent = (props) => {
152
152
  }
153
153
  };
154
154
  function getCursorPosition(contentEditableElm) {
155
+ var _a;
155
156
  const selection = window.getSelection();
156
157
  const range = selection.getRangeAt(0);
157
158
  const clonedRange = range.cloneRange();
158
159
  clonedRange.selectNodeContents(contentEditableElm);
159
160
  clonedRange.setEnd(range.endContainer, range.endOffset);
160
- setContentEditableCursorIndex(clonedRange.toString().length);
161
+ setContentEditableCursorIndex((_a = clonedRange === null || clonedRange === void 0 ? void 0 : clonedRange.toString()) === null || _a === void 0 ? void 0 : _a.length);
161
162
  }
162
163
  const onConditionKeyDown = (event) => {
163
164
  const content = event.target.textContent.trim();
@@ -0,0 +1,4 @@
1
+ declare function ErrorBoundary({ children }: {
2
+ children: any;
3
+ }): any;
4
+ export default ErrorBoundary;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "5.7.9",
3
+ "version": "5.7.11",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",