@lemon-fe/kits 1.0.0-80 → 1.0.0-81

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.
@@ -61,6 +61,7 @@ export default class DataGrid<TData extends Record<string, any>> extends Compone
61
61
  private getPagination;
62
62
  componentDidUpdate(prevProps: DataGridProps<TData>): void;
63
63
  componentWillUnmount(): void;
64
+ componentDidMount(): void;
64
65
  private syncColRender;
65
66
  private syncSelection;
66
67
  private syncRowData;
@@ -438,6 +438,12 @@ var DataGrid = /*#__PURE__*/function (_Component) {
438
438
  key: "componentWillUnmount",
439
439
  value: function componentWillUnmount() {
440
440
  this.isReady = false;
441
+ window.removeEventListener('blur', this.handleFocus);
442
+ }
443
+ }, {
444
+ key: "componentDidMount",
445
+ value: function componentDidMount() {
446
+ window.addEventListener('blur', this.handleFocus);
441
447
  }
442
448
  }, {
443
449
  key: "syncColRender",
@@ -830,6 +836,12 @@ var DataGrid = /*#__PURE__*/function (_Component) {
830
836
 
831
837
  _this4.api.forEachNode(function (node) {
832
838
  if (node.id && _this4.selected.has(node.id)) {
839
+ var rowData = _this4.selected.get(node.id);
840
+
841
+ if (node.data !== undefined && rowData !== node.data) {
842
+ _this4.selected.set(node.id, node.data);
843
+ }
844
+
833
845
  node.setSelected(true, false, true);
834
846
  }
835
847
  });
@@ -908,7 +920,9 @@ var DataGrid = /*#__PURE__*/function (_Component) {
908
920
 
909
921
  _this5.api.setPinnedBottomRowData(pinned);
910
922
 
911
- _this5.api.ensureIndexVisible(0);
923
+ if (res.data.length > 0) {
924
+ _this5.api.ensureIndexVisible(0);
925
+ }
912
926
 
913
927
  if (onLoad) {
914
928
  onLoad(res.extra);
@@ -251,10 +251,10 @@ export var Selection = /*#__PURE__*/function () {
251
251
  }();
252
252
  export var columnTypes = {
253
253
  datetime: {
254
- initialWidth: 150
254
+ initialWidth: 159
255
255
  },
256
256
  date: {
257
- initialWidth: 120,
257
+ initialWidth: 129,
258
258
  valueFormatter: function valueFormatter(_ref) {
259
259
  var value = _ref.value;
260
260
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/kits",
3
- "version": "1.0.0-80",
3
+ "version": "1.0.0-81",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",