@lemon-fe/components 1.5.7-alpha.5 → 1.5.7-alpha.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.
@@ -17,7 +17,7 @@ declare const Editors: {
17
17
  Text: React.ForwardRefExoticComponent<import("ag-grid-community").ICellEditorParams<any, any, any> & import("..").TextEditorParams<any> & React.RefAttributes<import("ag-grid-react").ICellEditorReactComp>>;
18
18
  Date: React.ForwardRefExoticComponent<import("ag-grid-community").ICellEditorParams<any, any, any> & import("..").DateEditorParams<any> & React.RefAttributes<import("ag-grid-react").ICellEditorReactComp>>;
19
19
  Number: React.ForwardRefExoticComponent<import("ag-grid-community").ICellEditorParams<any, any, any> & import("..").NumberEditorParams<any> & React.RefAttributes<import("ag-grid-react").ICellEditorReactComp>>;
20
- Select: React.ForwardRefExoticComponent<import("ag-grid-community").ICellEditorParams<any, any, any> & Pick<import("antd").SelectProps<any, import("antd/lib/select").BaseOptionType>, "disabled" | "allowClear" | "mode" | "showSearch" | "virtual" | "optionFilterProp" | "options" | "listHeight"> & {
20
+ Select: React.ForwardRefExoticComponent<import("ag-grid-community").ICellEditorParams<any, any, any> & Pick<import("antd").SelectProps<any, import("antd/lib/select").BaseOptionType>, "disabled" | "mode" | "virtual" | "allowClear" | "showSearch" | "optionFilterProp" | "options" | "listHeight"> & {
21
21
  fieldNames?: {
22
22
  label: string;
23
23
  value: string;
@@ -800,21 +800,28 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
800
800
  value: function componentWillUnmount() {
801
801
  if (this.isReady) {
802
802
  // 解决agGrid部分内存泄漏
803
-
803
+ var api = this.api;
804
+ setTimeout(function () {
805
+ // 由于下面代码是hack,所以需要捕获边界可能异常,防止崩溃
806
+ try {
807
+ api.setRowData([]);
808
+ api.setColumnDefs([]);
809
+ api.destroy();
810
+ var context = api.__getContext();
811
+ var gridOptionsService = context.getBean('gridOptionsService');
812
+ for (var field in gridOptionsService.gridOptions) {
813
+ delete gridOptionsService.gridOptions[field];
814
+ }
815
+ var userComponentFactory = context.getBean('userComponentFactory');
816
+ userComponentFactory.frameworkComponentWrapper.parent = null;
817
+ var eventService = context.getBean('eventService');
818
+ eventService.allAsyncListeners.clear();
819
+ eventService.globalAsyncListeners.clear();
820
+ } catch (err) {
821
+ console.error('DataGrid unmount error', err);
822
+ }
823
+ }, 0);
804
824
  this.dataSource = [];
805
- this.api.setRowData([]);
806
- this.api.setColumnDefs([]);
807
- this.api.destroy();
808
- var context = this.api.__getContext();
809
- var gridOptionsService = context.getBean('gridOptionsService');
810
- for (var field in gridOptionsService.gridOptions) {
811
- delete gridOptionsService.gridOptions[field];
812
- }
813
- var userComponentFactory = context.getBean('userComponentFactory');
814
- userComponentFactory.frameworkComponentWrapper.parent = null;
815
- var eventService = context.getBean('eventService');
816
- eventService.allAsyncListeners.clear();
817
- eventService.globalAsyncListeners.clear();
818
825
  this.api = new GridApi();
819
826
  this.columnApi = new ColumnApi();
820
827
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/components",
3
- "version": "1.5.7-alpha.5",
3
+ "version": "1.5.7-alpha.6",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "registry": "https://registry.npmjs.org"
60
60
  },
61
- "gitHead": "6171749dce121811f94a7d5d0c7e0c6782c5e4d5"
61
+ "gitHead": "6d26b5ca998c1e9f0455db9dc97880d1aa147bac"
62
62
  }