@gravity-ui/dashkit 8.8.1-beta.0 → 8.8.1-beta.1

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.
@@ -97,16 +97,16 @@ class GridLayout extends react_1.default.PureComponent {
97
97
  this._onDragStart = (group, _newLayout, layoutItem) => {
98
98
  if (this.temporaryLayout)
99
99
  return;
100
- let currentDraggingElement = this.state.currentDraggingElement;
101
- if (!currentDraggingElement) {
102
- const _id = layoutItem.i;
103
- const item = this.context.config.items.find(({ id }) => id === _id);
104
- currentDraggingElement = [group, layoutItem, item];
105
- }
106
100
  if (this.context.dragOverPlugin) {
107
101
  this.setState({ isDragging: true });
108
102
  }
109
103
  else {
104
+ let currentDraggingElement = this.state.currentDraggingElement;
105
+ if (!currentDraggingElement) {
106
+ const _id = layoutItem.i;
107
+ const item = this.context.config.items.find(({ id }) => id === _id);
108
+ currentDraggingElement = [group, layoutItem, item];
109
+ }
110
110
  this.setState({
111
111
  isDragging: true,
112
112
  currentDraggingElement,
@@ -51,11 +51,9 @@ class DragOverLayout extends react_grid_layout_1.default {
51
51
  return { layout: savedLayout, id: hiddenElement.i };
52
52
  };
53
53
  this.extendedOnDrag = (i, x, y, sintEv) => {
54
- var _a, _b;
55
54
  if (!this._isMouseOver) {
56
55
  if (!this._savedDragoutState) {
57
56
  this._savedDragoutState = this.hideLocalPlaceholder(i);
58
- (_b = (_a = this.props).onDragExit) === null || _b === void 0 ? void 0 : _b.call(_a);
59
57
  }
60
58
  return;
61
59
  }
@@ -90,11 +88,13 @@ class DragOverLayout extends react_grid_layout_1.default {
90
88
  };
91
89
  this.extendedOnDragEnter = (...args) => {
92
90
  this._isMouseOver = true;
93
- return this.parentOnDragEnter(...args);
91
+ this.parentOnDragEnter(...args);
94
92
  };
95
93
  this.extendedOnDragLeave = (...args) => {
96
- this._isMouseOver = true;
97
- return this.parentOnDragLeave(...args);
94
+ var _a, _b;
95
+ this._isMouseOver = false;
96
+ this.parentOnDragLeave(...args);
97
+ (_b = (_a = this.props).onDragExit) === null || _b === void 0 ? void 0 : _b.call(_a);
98
98
  };
99
99
  // Proxy mouse events -> drag methods for dnd between groups
100
100
  this.mouseEnterHandler = (e) => {
@@ -104,9 +104,11 @@ class DragOverLayout extends react_grid_layout_1.default {
104
104
  }
105
105
  };
106
106
  this.mouseLeaveHandler = (e) => {
107
+ var _a, _b;
107
108
  this._isMouseOver = false;
108
109
  if (this.props.hasSharedDragItem) {
109
110
  this.parentOnDragLeave(e);
111
+ (_b = (_a = this.props).onDragExit) === null || _b === void 0 ? void 0 : _b.call(_a);
110
112
  }
111
113
  };
112
114
  this.mouseMoveHandler = (e) => {
@@ -94,16 +94,16 @@ class GridLayout extends React.PureComponent {
94
94
  this._onDragStart = (group, _newLayout, layoutItem) => {
95
95
  if (this.temporaryLayout)
96
96
  return;
97
- let currentDraggingElement = this.state.currentDraggingElement;
98
- if (!currentDraggingElement) {
99
- const _id = layoutItem.i;
100
- const item = this.context.config.items.find(({ id }) => id === _id);
101
- currentDraggingElement = [group, layoutItem, item];
102
- }
103
97
  if (this.context.dragOverPlugin) {
104
98
  this.setState({ isDragging: true });
105
99
  }
106
100
  else {
101
+ let currentDraggingElement = this.state.currentDraggingElement;
102
+ if (!currentDraggingElement) {
103
+ const _id = layoutItem.i;
104
+ const item = this.context.config.items.find(({ id }) => id === _id);
105
+ currentDraggingElement = [group, layoutItem, item];
106
+ }
107
107
  this.setState({
108
108
  isDragging: true,
109
109
  currentDraggingElement,
@@ -47,11 +47,9 @@ class DragOverLayout extends ReactGridLayout {
47
47
  return { layout: savedLayout, id: hiddenElement.i };
48
48
  };
49
49
  this.extendedOnDrag = (i, x, y, sintEv) => {
50
- var _a, _b;
51
50
  if (!this._isMouseOver) {
52
51
  if (!this._savedDragoutState) {
53
52
  this._savedDragoutState = this.hideLocalPlaceholder(i);
54
- (_b = (_a = this.props).onDragExit) === null || _b === void 0 ? void 0 : _b.call(_a);
55
53
  }
56
54
  return;
57
55
  }
@@ -86,11 +84,13 @@ class DragOverLayout extends ReactGridLayout {
86
84
  };
87
85
  this.extendedOnDragEnter = (...args) => {
88
86
  this._isMouseOver = true;
89
- return this.parentOnDragEnter(...args);
87
+ this.parentOnDragEnter(...args);
90
88
  };
91
89
  this.extendedOnDragLeave = (...args) => {
92
- this._isMouseOver = true;
93
- return this.parentOnDragLeave(...args);
90
+ var _a, _b;
91
+ this._isMouseOver = false;
92
+ this.parentOnDragLeave(...args);
93
+ (_b = (_a = this.props).onDragExit) === null || _b === void 0 ? void 0 : _b.call(_a);
94
94
  };
95
95
  // Proxy mouse events -> drag methods for dnd between groups
96
96
  this.mouseEnterHandler = (e) => {
@@ -100,9 +100,11 @@ class DragOverLayout extends ReactGridLayout {
100
100
  }
101
101
  };
102
102
  this.mouseLeaveHandler = (e) => {
103
+ var _a, _b;
103
104
  this._isMouseOver = false;
104
105
  if (this.props.hasSharedDragItem) {
105
106
  this.parentOnDragLeave(e);
107
+ (_b = (_a = this.props).onDragExit) === null || _b === void 0 ? void 0 : _b.call(_a);
106
108
  }
107
109
  };
108
110
  this.mouseMoveHandler = (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/dashkit",
3
- "version": "8.8.1-beta.0",
3
+ "version": "8.8.1-beta.1",
4
4
  "description": "Library for rendering dashboard grid layout",
5
5
  "license": "MIT",
6
6
  "repository": {