@seafile/seafile-editor 0.3.81 → 0.3.82

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.
@@ -79,25 +79,26 @@ var TableButton = /*#__PURE__*/function (_Component) {
79
79
  };
80
80
 
81
81
  _this.onTableCellMouseEnter = function (rowIndex, columnIndex) {
82
- var _this$state2 = _this.state,
83
- currentMaxColumnCount = _this$state2.currentMaxColumnCount,
84
- currentMaxRowCount = _this$state2.currentMaxRowCount;
85
-
86
- if (columnIndex >= currentMaxColumnCount - 2 && currentMaxColumnCount < _this.maxColumnCount) {
87
- currentMaxColumnCount += 1;
88
- } else if (columnIndex < currentMaxColumnCount - 1 && currentMaxColumnCount > 4) {
89
- currentMaxColumnCount -= 1;
82
+ var columnCount = columnIndex + 1,
83
+ rowCount = rowIndex + 1;
84
+ var currentMaxRowCount = rowCount + 1,
85
+ currentMaxColumnCount = columnCount + 1;
86
+
87
+ if (currentMaxColumnCount > 10) {
88
+ currentMaxColumnCount = 10;
89
+ } else if (currentMaxColumnCount < 4) {
90
+ currentMaxColumnCount = 4;
90
91
  }
91
92
 
92
- if (rowIndex >= currentMaxRowCount - 2 && currentMaxRowCount < _this.maxRowCount) {
93
- currentMaxRowCount += 1;
94
- } else if (rowIndex < currentMaxRowCount - 1 && currentMaxRowCount > 4) {
95
- currentMaxRowCount -= 1;
93
+ if (currentMaxRowCount > 10) {
94
+ currentMaxRowCount = 10;
95
+ } else if (currentMaxRowCount < 4) {
96
+ currentMaxRowCount = 4;
96
97
  }
97
98
 
98
99
  _this.setState({
99
- columnCount: columnIndex + 1,
100
- rowCount: rowIndex + 1,
100
+ columnCount: columnCount,
101
+ rowCount: rowCount,
101
102
  currentMaxColumnCount: currentMaxColumnCount,
102
103
  currentMaxRowCount: currentMaxRowCount
103
104
  });
@@ -110,17 +111,15 @@ var TableButton = /*#__PURE__*/function (_Component) {
110
111
  columnCount: -1,
111
112
  rowCount: -1
112
113
  };
113
- _this.maxColumnCount = 10;
114
- _this.maxRowCount = 10;
115
114
  return _this;
116
115
  }
117
116
 
118
117
  _createClass(TableButton, [{
119
118
  key: "createTableScaleCard",
120
119
  value: function createTableScaleCard(props) {
121
- var _this$state3 = this.state,
122
- columnCount = _this$state3.columnCount,
123
- rowCount = _this$state3.rowCount;
120
+ var _this$state2 = this.state,
121
+ columnCount = _this$state2.columnCount,
122
+ rowCount = _this$state2.rowCount;
124
123
  return /*#__PURE__*/React.createElement("div", {
125
124
  className: "sf-editor-table-count-card"
126
125
  }, /*#__PURE__*/React.createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "0.3.81",
3
+ "version": "0.3.82",
4
4
  "private": false,
5
5
  "dependencies": {
6
6
  "@seafile/slate-react": "^0.54.13",