aio-table 5.0.1 → 5.1.0

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.
Files changed (2) hide show
  1. package/index.js +172 -180
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -78,7 +78,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
78
78
  _classCallCheck(this, AIOTable);
79
79
 
80
80
  _this = _super.call(this, props);
81
- _this.touch = false;
81
+ var touch = ('ontouchstart' in document.documentElement);
82
82
  _this.dom = /*#__PURE__*/(0, _react.createRef)();
83
83
  var _this$props = _this.props,
84
84
  id = _this$props.id,
@@ -127,6 +127,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
127
127
  });
128
128
  });
129
129
  _this.state = {
130
+ touch: touch,
130
131
  openDictionary: openDictionary,
131
132
  filterDictionary: {},
132
133
  groupsOpen: {},
@@ -143,41 +144,30 @@ var AIOTable = /*#__PURE__*/function (_Component) {
143
144
  }
144
145
 
145
146
  _createClass(AIOTable, [{
146
- key: "onScroll",
147
- value: function onScroll(e, index) {
148
- var _this2 = this;
149
-
150
- if (!this.freezeMode) {
151
- return;
152
- }
153
-
154
- if (this.activeTableIndex === undefined) {
155
- return;
147
+ key: "onScroll1",
148
+ value: function onScroll1() {
149
+ if (!this.firstscroll) {
150
+ this.secondscroll = true;
151
+ var unit1 = (0, _jquery.default)(this.dom.current).find('#aio-table-first-split');
152
+ var unit2 = (0, _jquery.default)(this.dom.current).find('#aio-table-second-split');
153
+ var scrollTop = unit1.scrollTop();
154
+ unit2.scrollTop(scrollTop);
156
155
  }
157
156
 
158
- if (index !== this.activeTableIndex) {
159
- this.onMouseEnter(index);
160
- clearTimeout(this.timeo);
161
- this.timeo = setTimeout(function () {
162
- return _this2.bindScroll();
163
- }, 40);
164
- return;
165
- }
166
-
167
- this.bindScroll();
157
+ this.firstscroll = false;
168
158
  }
169
159
  }, {
170
- key: "bindScroll",
171
- value: function bindScroll() {
172
- var units = (0, _jquery.default)(this.dom.current).find('.aio-table-unit');
173
- var scrollTop = units.eq(this.activeTableIndex).scrollTop();
174
- units.eq(this.deactiveTableIndex).scrollTop(scrollTop);
175
- }
176
- }, {
177
- key: "onMouseEnter",
178
- value: function onMouseEnter(index) {
179
- this.activeTableIndex = index;
180
- this.deactiveTableIndex = index === 0 ? 1 : 0;
160
+ key: "onScroll2",
161
+ value: function onScroll2() {
162
+ if (!this.secondscroll) {
163
+ this.firstscroll = true;
164
+ var unit1 = (0, _jquery.default)(this.dom.current).find('#aio-table-first-split');
165
+ var unit2 = (0, _jquery.default)(this.dom.current).find('#aio-table-second-split');
166
+ var scrollTop = unit2.scrollTop();
167
+ unit1.scrollTop(scrollTop);
168
+ }
169
+
170
+ this.secondscroll = false;
181
171
  }
182
172
  }, {
183
173
  key: "getGap",
@@ -192,12 +182,12 @@ var AIOTable = /*#__PURE__*/function (_Component) {
192
182
  }, {
193
183
  key: "getClient",
194
184
  value: function getClient(e) {
195
- return this.context.touch ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [e.clientX, e.clientY];
185
+ return this.state.touch ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [e.clientX, e.clientY];
196
186
  }
197
187
  }, {
198
188
  key: "resizeDown",
199
189
  value: function resizeDown(e) {
200
- var touch = this.context.touch;
190
+ var touch = this.state.touch;
201
191
  (0, _jquery.default)(window).bind(touch ? 'touchmove' : 'mousemove', _jquery.default.proxy(this.resizeMove, this));
202
192
  (0, _jquery.default)(window).bind(touch ? 'touchend' : 'mouseup', _jquery.default.proxy(this.resizeUp, this));
203
193
  this.resizeDetails = {
@@ -228,7 +218,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
228
218
  }, {
229
219
  key: "resizeUp",
230
220
  value: function resizeUp() {
231
- var touch = this.context.touch;
221
+ var touch = this.state.touch;
232
222
  (0, _jquery.default)(window).unbind(touch ? 'touchmove' : 'mousemove', this.resizeMove);
233
223
  (0, _jquery.default)(window).unbind(touch ? 'touchend' : 'mouseup', this.resizeUp);
234
224
  this.setState({
@@ -260,7 +250,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
260
250
  }, {
261
251
  key: "getTable",
262
252
  value: function getTable(Toolbar) {
263
- var _this3 = this;
253
+ var _this2 = this;
264
254
 
265
255
  var rows = this.getRows();
266
256
  this.rows = rows;
@@ -292,10 +282,10 @@ var AIOTable = /*#__PURE__*/function (_Component) {
292
282
  }), /*#__PURE__*/_react.default.createElement("div", {
293
283
  className: "aio-table-splitter",
294
284
  onMouseDown: function onMouseDown(e) {
295
- return _this3.resizeDown(e);
285
+ return _this2.resizeDown(e);
296
286
  },
297
287
  onTouchStart: function onTouchStart(e) {
298
- return _this3.resizeDown(e);
288
+ return _this2.resizeDown(e);
299
289
  }
300
290
  }), true && /*#__PURE__*/_react.default.createElement(RTableUnit, {
301
291
  key: 1,
@@ -335,13 +325,13 @@ var AIOTable = /*#__PURE__*/function (_Component) {
335
325
  }, {
336
326
  key: "sort",
337
327
  value: function sort(model) {
338
- var _this4 = this;
328
+ var _this3 = this;
339
329
 
340
330
  var newModel = model.sort(function (a, b) {
341
- for (var i = 0; i < _this4.sorts.length; i++) {
342
- var _this4$sorts$i = _this4.sorts[i],
343
- getValue = _this4$sorts$i.getValue,
344
- type = _this4$sorts$i.type;
331
+ for (var i = 0; i < _this3.sorts.length; i++) {
332
+ var _this3$sorts$i = _this3.sorts[i],
333
+ getValue = _this3$sorts$i.getValue,
334
+ type = _this3$sorts$i.type;
345
335
  var aValue = getValue(a),
346
336
  bValue = getValue(b);
347
337
 
@@ -353,7 +343,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
353
343
  return 1 * (type === 'dec' ? -1 : 1);
354
344
  }
355
345
 
356
- if (i !== _this4.sorts.length - 1) {
346
+ if (i !== _this3.sorts.length - 1) {
357
347
  continue;
358
348
  }
359
349
 
@@ -857,7 +847,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
857
847
  }, {
858
848
  key: "updateColumns",
859
849
  value: function updateColumns() {
860
- var _this5 = this;
850
+ var _this4 = this;
861
851
 
862
852
  var _this$props5 = this.props,
863
853
  _this$props5$freezeMo = _this$props5.freezeMode,
@@ -868,7 +858,9 @@ var AIOTable = /*#__PURE__*/function (_Component) {
868
858
  onChangeSort = _this$props5.onChangeSort,
869
859
  _this$props5$toggleAl = _this$props5.toggleAll,
870
860
  toggleAll = _this$props5$toggleAl === void 0 ? false : _this$props5$toggleAl,
871
- id = _this$props5.id;
861
+ id = _this$props5.id,
862
+ _this$props5$toolbarI = _this$props5.toolbarItems,
863
+ toolbarItems = _this$props5$toolbarI === void 0 ? [] : _this$props5$toolbarI;
872
864
  var _this$state2 = this.state,
873
865
  groupDictionary = _this$state2.groupDictionary,
874
866
  sorts = _this$state2.sorts,
@@ -880,7 +872,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
880
872
  this.freezeColumns = [];
881
873
  this.unFreezeColumns = [];
882
874
  this.toolbar = {
883
- show: toggleAll,
875
+ show: toggleAll === true || toolbarItems.length > 0,
884
876
  toggle: [{
885
877
  text: translate('Show Columns')
886
878
  }],
@@ -919,16 +911,16 @@ var AIOTable = /*#__PURE__*/function (_Component) {
919
911
  }
920
912
 
921
913
  if (active === true) {
922
- _this5.sorts.push({
914
+ _this4.sorts.push({
923
915
  getValue: getValue,
924
916
  type: type
925
917
  });
926
918
  }
927
919
 
928
920
  if (toggle) {
929
- _this5.toolbar.show = true;
921
+ _this4.toolbar.show = true;
930
922
 
931
- _this5.toolbar.sort.push({
923
+ _this4.toolbar.sort.push({
932
924
  text: title,
933
925
  checked: active === true,
934
926
  after: /*#__PURE__*/_react.default.createElement("div", {
@@ -944,7 +936,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
944
936
  e.stopPropagation();
945
937
  sort.type = sort.type === 'dec' ? 'inc' : 'dec';
946
938
 
947
- _this5.setState({
939
+ _this4.setState({
948
940
  sorts: sorts
949
941
  });
950
942
 
@@ -958,7 +950,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
958
950
  onClick: function onClick() {
959
951
  sort.active = !active;
960
952
 
961
- _this5.setState({
953
+ _this4.setState({
962
954
  sorts: sorts
963
955
  });
964
956
 
@@ -1000,13 +992,13 @@ var AIOTable = /*#__PURE__*/function (_Component) {
1000
992
  groupDictionary[title] = groupDictionary[title] === undefined ? active : groupDictionary[title];
1001
993
 
1002
994
  if (groupDictionary[title]) {
1003
- _this5.groups.push(group);
995
+ _this4.groups.push(group);
1004
996
  }
1005
997
 
1006
998
  if (toggle) {
1007
- _this5.toolbar.show = true;
999
+ _this4.toolbar.show = true;
1008
1000
 
1009
- _this5.toolbar.groupBy.push({
1001
+ _this4.toolbar.groupBy.push({
1010
1002
  text: title,
1011
1003
  checked: groupDictionary[title],
1012
1004
  onClick: function onClick() {
@@ -1016,7 +1008,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
1016
1008
  localStorage.setItem('aio table group' + id, JSON.stringify(groupDictionary));
1017
1009
  }
1018
1010
 
1019
- _this5.setState({
1011
+ _this4.setState({
1020
1012
  groupDictionary: groupDictionary
1021
1013
  });
1022
1014
  }
@@ -1066,29 +1058,29 @@ var AIOTable = /*#__PURE__*/function (_Component) {
1066
1058
 
1067
1059
  column._index = _i4;
1068
1060
 
1069
- if (show !== false && _this5.showColumnRelativeGroups(column)) {
1070
- _this5.visibleColumns.push(column);
1061
+ if (show !== false && _this4.showColumnRelativeGroups(column)) {
1062
+ _this4.visibleColumns.push(column);
1071
1063
 
1072
1064
  if (freezeMode) {
1073
1065
  if (column.freeze) {
1074
- _this5.freezeMode = true;
1066
+ _this4.freezeMode = true;
1075
1067
 
1076
- _this5.freezeColumns.push(column);
1068
+ _this4.freezeColumns.push(column);
1077
1069
  } else {
1078
- _this5.unFreezeColumns.push(column);
1070
+ _this4.unFreezeColumns.push(column);
1079
1071
  }
1080
1072
 
1081
1073
  if (column.toggleFreeze) {
1082
- _this5.toolbar.show = true;
1074
+ _this4.toolbar.show = true;
1083
1075
 
1084
- _this5.toolbar.freeze.push({
1076
+ _this4.toolbar.freeze.push({
1085
1077
  text: column.title,
1086
1078
  checked: column.freeze === true,
1087
1079
  onClick: function onClick() {
1088
1080
  column.freeze = column.freeze === true ? true : false;
1089
1081
  column.freeze = !column.freeze;
1090
1082
 
1091
- _this5.setState({
1083
+ _this4.setState({
1092
1084
  columns: columns
1093
1085
  });
1094
1086
  }
@@ -1098,9 +1090,9 @@ var AIOTable = /*#__PURE__*/function (_Component) {
1098
1090
  }
1099
1091
 
1100
1092
  if (column.toggleShow) {
1101
- _this5.toolbar.show = true;
1093
+ _this4.toolbar.show = true;
1102
1094
 
1103
- _this5.toolbar.toggle.push({
1095
+ _this4.toolbar.toggle.push({
1104
1096
  text: column.title,
1105
1097
  checked: show !== false,
1106
1098
  onClick: function onClick() {
@@ -1115,7 +1107,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
1115
1107
  column.show = !column.show;
1116
1108
  }
1117
1109
 
1118
- _this5.setState({
1110
+ _this4.setState({
1119
1111
  columns: columns
1120
1112
  });
1121
1113
  }
@@ -1123,8 +1115,8 @@ var AIOTable = /*#__PURE__*/function (_Component) {
1123
1115
  }
1124
1116
 
1125
1117
  if (column.search) {
1126
- _this5.toolbar.show = true;
1127
- _this5.toolbar.searchColumnIndex = column._index;
1118
+ _this4.toolbar.show = true;
1119
+ _this4.toolbar.searchColumnIndex = column._index;
1128
1120
  }
1129
1121
  };
1130
1122
 
@@ -1139,7 +1131,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
1139
1131
  }, {
1140
1132
  key: "getPaging",
1141
1133
  value: function getPaging() {
1142
- var _this6 = this;
1134
+ var _this5 = this;
1143
1135
 
1144
1136
  var paging = this.state.paging;
1145
1137
 
@@ -1186,7 +1178,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
1186
1178
 
1187
1179
  paging.number = newNumber;
1188
1180
 
1189
- _this6.setState({
1181
+ _this5.setState({
1190
1182
  paging: paging
1191
1183
  });
1192
1184
 
@@ -1244,7 +1236,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
1244
1236
  onChange: function onChange(e) {
1245
1237
  paging.size = parseInt(e.target.value);
1246
1238
 
1247
- _this6.setState({
1239
+ _this5.setState({
1248
1240
  paging: paging
1249
1241
  });
1250
1242
 
@@ -1366,7 +1358,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
1366
1358
  }, {
1367
1359
  key: "render",
1368
1360
  value: function render() {
1369
- var _this7 = this;
1361
+ var _this6 = this;
1370
1362
 
1371
1363
  if (JSON.stringify(this.props.columns) !== JSON.stringify(this.state.columns)) {
1372
1364
  this.setState({
@@ -1407,23 +1399,22 @@ var AIOTable = /*#__PURE__*/function (_Component) {
1407
1399
  var Paging = this.getPaging();
1408
1400
  var context = { ...this.props,
1409
1401
  ...this.state,
1410
- touch: this.touch,
1411
1402
  onDrag: function onDrag(obj) {
1412
- return _this7.dragStart = obj;
1403
+ return _this6.dragStart = obj;
1413
1404
  },
1414
1405
  onDrop: function onDrop(obj) {
1415
- if (!_this7.dragStart) {
1406
+ if (!_this6.dragStart) {
1416
1407
  return;
1417
1408
  }
1418
1409
 
1419
- if (_this7.dragStart._level !== obj._level) {
1410
+ if (_this6.dragStart._level !== obj._level) {
1420
1411
  return;
1421
1412
  }
1422
1413
 
1423
- if (_this7.dragStart._level === 0) {
1424
- onSwap(_this7.dragStart, obj);
1414
+ if (_this6.dragStart._level === 0) {
1415
+ onSwap(_this6.dragStart, obj);
1425
1416
  } else {
1426
- var startParents = _this7.dragStart._getParents().map(function (o) {
1417
+ var startParents = _this6.dragStart._getParents().map(function (o) {
1427
1418
  return o._index;
1428
1419
  }).toString();
1429
1420
 
@@ -1435,18 +1426,18 @@ var AIOTable = /*#__PURE__*/function (_Component) {
1435
1426
  return;
1436
1427
  }
1437
1428
 
1438
- onSwap(_this7.dragStart, obj);
1429
+ onSwap(_this6.dragStart, obj);
1439
1430
  }
1440
1431
  },
1441
1432
  onChangeFilter: onChangeFilter ? this.onChangeFilter.bind(this) : undefined,
1442
1433
  SetState: function SetState(obj) {
1443
- return _this7.setState(obj);
1434
+ return _this6.setState(obj);
1444
1435
  },
1445
1436
  cubes2: this.cubes2.bind(this),
1446
1437
  toggleRow: this.toggleRow.bind(this),
1447
1438
  getGap: this.getGap.bind(this),
1448
- onScroll: this.onScroll.bind(this),
1449
- onMouseEnter: this.onMouseEnter.bind(this),
1439
+ onScroll1: this.onScroll1.bind(this),
1440
+ onScroll2: this.onScroll2.bind(this),
1450
1441
  getClient: this.getClient.bind(this),
1451
1442
  getLoading: this.getLoading.bind(this),
1452
1443
  groups: this.groups
@@ -1498,7 +1489,7 @@ var RTableToolbar = /*#__PURE__*/function (_Component2) {
1498
1489
  _createClass(RTableToolbar, [{
1499
1490
  key: "changeSearch",
1500
1491
  value: function changeSearch(value) {
1501
- var _this8 = this;
1492
+ var _this7 = this;
1502
1493
 
1503
1494
  var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
1504
1495
  var SetState = this.context.SetState;
@@ -1507,10 +1498,10 @@ var RTableToolbar = /*#__PURE__*/function (_Component2) {
1507
1498
  searchText: value
1508
1499
  });
1509
1500
  this.searchTimeout = setTimeout(function () {
1510
- var _this8$context = _this8.context,
1511
- filterDictionary = _this8$context.filterDictionary,
1512
- SetState = _this8$context.SetState;
1513
- var searchColumnIndex = _this8.props.searchColumnIndex;
1501
+ var _this7$context = _this7.context,
1502
+ filterDictionary = _this7$context.filterDictionary,
1503
+ SetState = _this7$context.SetState;
1504
+ var searchColumnIndex = _this7.props.searchColumnIndex;
1514
1505
  filterDictionary[searchColumnIndex] = {
1515
1506
  items: value ? [{
1516
1507
  operator: 'contain',
@@ -1526,14 +1517,16 @@ var RTableToolbar = /*#__PURE__*/function (_Component2) {
1526
1517
  }, {
1527
1518
  key: "render",
1528
1519
  value: function render() {
1529
- var _this9 = this;
1520
+ var _this8 = this;
1530
1521
 
1531
1522
  var _this$context = this.context,
1532
1523
  searchText = _this$context.searchText,
1533
1524
  translate = _this$context.translate,
1534
1525
  rtl = _this$context.rtl,
1535
1526
  toggleAllState = _this$context.toggleAllState,
1536
- padding = _this$context.padding;
1527
+ padding = _this$context.padding,
1528
+ _this$context$toolbar = _this$context.toolbarItems,
1529
+ toolbarItems = _this$context$toolbar === void 0 ? [] : _this$context$toolbar;
1537
1530
  var _this$props8 = this.props,
1538
1531
  toggle = _this$props8.toggle,
1539
1532
  freeze = _this$props8.freeze,
@@ -1556,6 +1549,7 @@ var RTableToolbar = /*#__PURE__*/function (_Component2) {
1556
1549
  }, toggleAll !== false && /*#__PURE__*/_react.default.createElement(_aioButton.default, _extends({
1557
1550
  key: 0
1558
1551
  }, buttonProps, {
1552
+ type: "button",
1559
1553
  title: translate('Toggle All'),
1560
1554
  onClick: function onClick() {
1561
1555
  return toggleAll();
@@ -1564,7 +1558,16 @@ var RTableToolbar = /*#__PURE__*/function (_Component2) {
1564
1558
  path: !toggleAllState ? _js.mdiCollapseAll : _js.mdiExpandAll,
1565
1559
  size: 0.7
1566
1560
  })
1567
- })), searchColumnIndex !== false && /*#__PURE__*/_react.default.createElement("div", {
1561
+ })), toolbarItems.map(function (o, i) {
1562
+ return /*#__PURE__*/_react.default.createElement(_aioButton.default, _extends({
1563
+ type: "button"
1564
+ }, o, {
1565
+ rtl: rtl,
1566
+ className: "aio-table-toolbar-button",
1567
+ animate: true,
1568
+ key: 'ti' + i
1569
+ }));
1570
+ }), searchColumnIndex !== false && /*#__PURE__*/_react.default.createElement("div", {
1568
1571
  key: 1,
1569
1572
  className: "aio-table-search"
1570
1573
  }, /*#__PURE__*/_react.default.createElement("input", {
@@ -1573,7 +1576,7 @@ var RTableToolbar = /*#__PURE__*/function (_Component2) {
1573
1576
  value: searchText,
1574
1577
  placeholder: translate('Search'),
1575
1578
  onChange: function onChange(e) {
1576
- return _this9.changeSearch(e.target.value);
1579
+ return _this8.changeSearch(e.target.value);
1577
1580
  }
1578
1581
  }), /*#__PURE__*/_react.default.createElement(_react2.Icon, {
1579
1582
  className: "aio-table-search-icon",
@@ -1584,7 +1587,7 @@ var RTableToolbar = /*#__PURE__*/function (_Component2) {
1584
1587
  return;
1585
1588
  }
1586
1589
 
1587
- _this9.changeSearch('', 0);
1590
+ _this8.changeSearch('', 0);
1588
1591
  }
1589
1592
  })), searchColumnIndex === false && /*#__PURE__*/_react.default.createElement("div", {
1590
1593
  style: {
@@ -1643,13 +1646,13 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
1643
1646
  var _super3 = _createSuper(RTableUnit);
1644
1647
 
1645
1648
  function RTableUnit(props) {
1646
- var _this10;
1649
+ var _this9;
1647
1650
 
1648
1651
  _classCallCheck(this, RTableUnit);
1649
1652
 
1650
- _this10 = _super3.call(this, props);
1651
- _this10.dom = /*#__PURE__*/(0, _react.createRef)();
1652
- return _this10;
1653
+ _this9 = _super3.call(this, props);
1654
+ _this9.dom = /*#__PURE__*/(0, _react.createRef)();
1655
+ return _this9;
1653
1656
  }
1654
1657
 
1655
1658
  _createClass(RTableUnit, [{
@@ -1743,11 +1746,11 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
1743
1746
  }, {
1744
1747
  key: "getTitles",
1745
1748
  value: function getTitles() {
1746
- var _this11 = this;
1749
+ var _this10 = this;
1747
1750
 
1748
1751
  var columns = this.props.columns;
1749
1752
  return columns.map(function (column) {
1750
- return _this11.getTitle(column);
1753
+ return _this10.getTitle(column);
1751
1754
  });
1752
1755
  }
1753
1756
  }, {
@@ -1797,7 +1800,7 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
1797
1800
  }, {
1798
1801
  key: "getTitle",
1799
1802
  value: function getTitle(column) {
1800
- var _this12 = this;
1803
+ var _this11 = this;
1801
1804
 
1802
1805
  if (column.template === 'gantt') {
1803
1806
  return this.getGanttTitle(column);
@@ -1828,7 +1831,7 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
1828
1831
  },
1829
1832
  draggable: false
1830
1833
  }, touch ? 'onTouchStart' : 'onMouseDown', function (e) {
1831
- return column.resizable ? _this12.resizeDown(e, column) : undefined;
1834
+ return column.resizable ? _this11.resizeDown(e, column) : undefined;
1832
1835
  });
1833
1836
 
1834
1837
  var titleProps = {
@@ -1839,24 +1842,24 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
1839
1842
  },
1840
1843
  draggable: column.movable !== false,
1841
1844
  onDragStart: function onDragStart(e) {
1842
- _this12.startColumnSwap = column._index;
1845
+ _this11.startColumnSwap = column._index;
1843
1846
  },
1844
1847
  onDragOver: function onDragOver(e) {
1845
1848
  e.preventDefault();
1846
- _this12.endColumnSwap = column._index;
1849
+ _this11.endColumnSwap = column._index;
1847
1850
  },
1848
1851
  onDrop: function onDrop(e) {
1849
1852
  if (column.movable === false) {
1850
1853
  return;
1851
1854
  }
1852
1855
 
1853
- if (_this12.startColumnSwap === undefined || _this12.startColumnSwap === _this12.endColumnSwap) {
1856
+ if (_this11.startColumnSwap === undefined || _this11.startColumnSwap === _this11.endColumnSwap) {
1854
1857
  return;
1855
1858
  }
1856
1859
 
1857
- var temp = columns[_this12.startColumnSwap];
1858
- columns[_this12.startColumnSwap] = columns[_this12.endColumnSwap];
1859
- columns[_this12.endColumnSwap] = temp;
1860
+ var temp = columns[_this11.startColumnSwap];
1861
+ columns[_this11.startColumnSwap] = columns[_this11.endColumnSwap];
1862
+ columns[_this11.endColumnSwap] = temp;
1860
1863
  SetState({
1861
1864
  columns: columns
1862
1865
  });
@@ -2037,12 +2040,12 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
2037
2040
  }, {
2038
2041
  key: "card",
2039
2042
  value: function card() {
2040
- var _this13 = this;
2043
+ var _this12 = this;
2041
2044
 
2042
2045
  var _this$context11 = this.context,
2043
2046
  indent = _this$context11.indent,
2044
- _onMouseEnter = _this$context11.onMouseEnter,
2045
- _onScroll = _this$context11.onScroll,
2047
+ onScroll1 = _this$context11.onScroll1,
2048
+ onScroll2 = _this$context11.onScroll2,
2046
2049
  rowHeight = _this$context11.rowHeight,
2047
2050
  _this$context11$cardG = _this$context11.cardGap,
2048
2051
  cardGap = _this$context11$cardG === void 0 ? 0 : _this$context11$cardG,
@@ -2079,14 +2082,8 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
2079
2082
  gridColumnGap: columnGap,
2080
2083
  gridTemplateColumns: cardRowCount === 'auto' ? undefined : "repeat(".concat(cardRowCount, ",auto)")
2081
2084
  },
2082
- onMouseEnter: function onMouseEnter() {
2083
- return _onMouseEnter(index);
2084
- },
2085
- onMouseDown: function onMouseDown() {
2086
- return _onMouseEnter(index);
2087
- },
2088
2085
  onScroll: function onScroll(e) {
2089
- return _onScroll(e, index);
2086
+ return index === 0 ? onScroll1() : onScroll2();
2090
2087
  }
2091
2088
  }, rows && rows.length !== 0 && rows.map(function (row, i) {
2092
2089
  if (row._groupId) {
@@ -2100,7 +2097,7 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
2100
2097
  width: width,
2101
2098
  flexShrink: 0
2102
2099
  }
2103
- }), _this13.getGroupToggleIcon(row), /*#__PURE__*/_react.default.createElement("div", {
2100
+ }), _this12.getGroupToggleIcon(row), /*#__PURE__*/_react.default.createElement("div", {
2104
2101
  className: "aio-table-group-text"
2105
2102
  }, row._groupValue)));
2106
2103
  }
@@ -2116,7 +2113,7 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
2116
2113
  }, {
2117
2114
  key: "render",
2118
2115
  value: function render() {
2119
- var _this14 = this;
2116
+ var _this13 = this;
2120
2117
 
2121
2118
  if (this.context.cardTemplate) {
2122
2119
  return this.card();
@@ -2124,8 +2121,8 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
2124
2121
 
2125
2122
  var _this$context12 = this.context,
2126
2123
  indent = _this$context12.indent,
2127
- _onMouseEnter2 = _this$context12.onMouseEnter,
2128
- _onScroll2 = _this$context12.onScroll,
2124
+ onScroll1 = _this$context12.onScroll1,
2125
+ onScroll2 = _this$context12.onScroll2,
2129
2126
  rowHeight = _this$context12.rowHeight,
2130
2127
  groups = _this$context12.groups,
2131
2128
  getLoading = _this$context12.getLoading,
@@ -2142,14 +2139,8 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
2142
2139
  onKeyDown: this.keyDown.bind(this),
2143
2140
  style: this.getStyle(),
2144
2141
  ref: this.dom,
2145
- onMouseEnter: function onMouseEnter() {
2146
- return _onMouseEnter2(index);
2147
- },
2148
- onMouseDown: function onMouseDown() {
2149
- return _onMouseEnter2(index);
2150
- },
2151
2142
  onScroll: function onScroll(e) {
2152
- return _onScroll2(e, index);
2143
+ return index === 0 ? onScroll1() : onScroll2();
2153
2144
  }
2154
2145
  }, this.getTitles(), rows && rows.length !== 0 && rows.map(function (row, i) {
2155
2146
  if (row._groupId) {
@@ -2157,7 +2148,7 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
2157
2148
  return /*#__PURE__*/_react.default.createElement("div", {
2158
2149
  className: "aio-table-group",
2159
2150
  key: 'group' + i + '-' + index,
2160
- style: { ..._this14.getFullCellStyle(),
2151
+ style: { ..._this13.getFullCellStyle(),
2161
2152
  height: rowHeight
2162
2153
  }
2163
2154
  }, index !== 1 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
@@ -2165,7 +2156,7 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
2165
2156
  width: width,
2166
2157
  flexShrink: 0
2167
2158
  }
2168
- }), _this14.getGroupToggleIcon(row), /*#__PURE__*/_react.default.createElement("div", {
2159
+ }), _this13.getGroupToggleIcon(row), /*#__PURE__*/_react.default.createElement("div", {
2169
2160
  className: "aio-table-group-text"
2170
2161
  }, row._groupValue)));
2171
2162
  }
@@ -2194,19 +2185,19 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
2194
2185
  var _super4 = _createSuper(AIOTableCell);
2195
2186
 
2196
2187
  function AIOTableCell(props) {
2197
- var _this15;
2188
+ var _this14;
2198
2189
 
2199
2190
  _classCallCheck(this, AIOTableCell);
2200
2191
 
2201
- _this15 = _super4.call(this, props);
2202
- _this15.dom = /*#__PURE__*/(0, _react.createRef)();
2203
- var value = _this15.props.value;
2204
- _this15.state = {
2192
+ _this14 = _super4.call(this, props);
2193
+ _this14.dom = /*#__PURE__*/(0, _react.createRef)();
2194
+ var value = _this14.props.value;
2195
+ _this14.state = {
2205
2196
  value: value,
2206
2197
  error: false,
2207
2198
  prevValue: value
2208
2199
  };
2209
- return _this15;
2200
+ return _this14;
2210
2201
  }
2211
2202
 
2212
2203
  _createClass(AIOTableCell, [{
@@ -2494,7 +2485,7 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
2494
2485
  }, {
2495
2486
  key: "getInput",
2496
2487
  value: function getInput(row, column) {
2497
- var _this16 = this;
2488
+ var _this15 = this;
2498
2489
 
2499
2490
  var type = column.inlineEdit.type;
2500
2491
  var value = this.state.value;
@@ -2518,23 +2509,23 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
2518
2509
  textAlign: column.justify ? 'center' : undefined
2519
2510
  },
2520
2511
  onChange: function onChange(e) {
2521
- return _this16.setState({
2512
+ return _this15.setState({
2522
2513
  value: e.target.value
2523
2514
  });
2524
2515
  },
2525
2516
  onBlur: async function onBlur(e) {
2526
- _this16.setState({
2517
+ _this15.setState({
2527
2518
  loading: true
2528
2519
  });
2529
2520
 
2530
2521
  var error = await column.inlineEdit.onChange(row, type === 'number' ? parseFloat(value) : value);
2531
2522
 
2532
- _this16.setState({
2523
+ _this15.setState({
2533
2524
  loading: false
2534
2525
  });
2535
2526
 
2536
2527
  if (typeof error === 'string') {
2537
- _this16.setState({
2528
+ _this15.setState({
2538
2529
  error: error
2539
2530
  });
2540
2531
  }
@@ -2559,27 +2550,27 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
2559
2550
  className: "aio-table-input-container"
2560
2551
  }, /*#__PURE__*/_react.default.createElement("select", _extends({}, props, {
2561
2552
  onFocus: function onFocus() {
2562
- return _this16.focus = true;
2553
+ return _this15.focus = true;
2563
2554
  },
2564
2555
  onBlur: function onBlur() {
2565
- return _this16.focus = false;
2556
+ return _this15.focus = false;
2566
2557
  },
2567
2558
  onChange: async function onChange(e) {
2568
2559
  var value = e.target.value;
2569
2560
 
2570
- _this16.setState({
2561
+ _this15.setState({
2571
2562
  loading: true,
2572
2563
  value: value
2573
2564
  });
2574
2565
 
2575
2566
  var error = await column.inlineEdit.onChange(row, e.target.value);
2576
2567
 
2577
- _this16.setState({
2568
+ _this15.setState({
2578
2569
  loading: false
2579
2570
  });
2580
2571
 
2581
2572
  if (typeof error === 'string') {
2582
- _this16.setState({
2573
+ _this15.setState({
2583
2574
  error: error
2584
2575
  });
2585
2576
  }
@@ -2609,7 +2600,7 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
2609
2600
  }, {
2610
2601
  key: "render",
2611
2602
  value: function render() {
2612
- var _this17 = this;
2603
+ var _this16 = this;
2613
2604
 
2614
2605
  var _this$context14 = this.context,
2615
2606
  indent = _this$context14.indent,
@@ -2649,8 +2640,8 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
2649
2640
  cell = /*#__PURE__*/_react.default.createElement("div", {
2650
2641
  className: "aio-table-error",
2651
2642
  onClick: function onClick() {
2652
- _this17.setState({
2653
- value: _this17.props.value,
2643
+ _this16.setState({
2644
+ value: _this16.props.value,
2654
2645
  error: false
2655
2646
  });
2656
2647
  }
@@ -2722,14 +2713,14 @@ var AIOSlider = /*#__PURE__*/function (_Component5) {
2722
2713
  var _super5 = _createSuper(AIOSlider);
2723
2714
 
2724
2715
  function AIOSlider(props) {
2725
- var _this18;
2716
+ var _this17;
2726
2717
 
2727
2718
  _classCallCheck(this, AIOSlider);
2728
2719
 
2729
- _this18 = _super5.call(this, props);
2730
- var _this18$props = _this18.props,
2731
- column = _this18$props.column,
2732
- row = _this18$props.row;
2720
+ _this17 = _super5.call(this, props);
2721
+ var _this17$props = _this17.props,
2722
+ column = _this17$props.column,
2723
+ row = _this17$props.row;
2733
2724
  var getValue = column.getValue;
2734
2725
  var value = getValue(row);
2735
2726
 
@@ -2737,11 +2728,11 @@ var AIOSlider = /*#__PURE__*/function (_Component5) {
2737
2728
  value = [value];
2738
2729
  }
2739
2730
 
2740
- _this18.state = {
2731
+ _this17.state = {
2741
2732
  value: value
2742
2733
  };
2743
- _this18.updateMode = 'outside';
2744
- return _this18;
2734
+ _this17.updateMode = 'outside';
2735
+ return _this17;
2745
2736
  }
2746
2737
 
2747
2738
  _createClass(AIOSlider, [{
@@ -2760,7 +2751,7 @@ var AIOSlider = /*#__PURE__*/function (_Component5) {
2760
2751
  }, {
2761
2752
  key: "render",
2762
2753
  value: function render() {
2763
- var _this19 = this;
2754
+ var _this18 = this;
2764
2755
 
2765
2756
  var _this$props13 = this.props,
2766
2757
  column = _this$props13.column,
@@ -2854,7 +2845,7 @@ var AIOSlider = /*#__PURE__*/function (_Component5) {
2854
2845
  fillStyle: {
2855
2846
  height: '6px',
2856
2847
  borderRadius: '24px',
2857
- background: _this19.getBackground(value.length, i, color)
2848
+ background: _this18.getBackground(value.length, i, color)
2858
2849
  }
2859
2850
  };
2860
2851
  }),
@@ -2877,7 +2868,7 @@ var AIOSlider = /*#__PURE__*/function (_Component5) {
2877
2868
  return;
2878
2869
  }
2879
2870
 
2880
- _this19.updateMode = 'onChange';
2871
+ _this18.updateMode = 'onChange';
2881
2872
  onChange(row, points.length > 1 ? points.map(function (p) {
2882
2873
  return p.value;
2883
2874
  }) : points[0].value);
@@ -2887,9 +2878,9 @@ var AIOSlider = /*#__PURE__*/function (_Component5) {
2887
2878
  },
2888
2879
  ondrag: function ondrag(_ref2) {
2889
2880
  var points = _ref2.points;
2890
- _this19.updateMode = 'onDrag';
2881
+ _this18.updateMode = 'onDrag';
2891
2882
 
2892
- _this19.setState({
2883
+ _this18.setState({
2893
2884
  value: points.map(function (p) {
2894
2885
  return p.value;
2895
2886
  })
@@ -2945,6 +2936,7 @@ var RTableFilter = /*#__PURE__*/function (_Component6) {
2945
2936
  }, /*#__PURE__*/_react.default.createElement(_aioButton.default, {
2946
2937
  type: "button",
2947
2938
  rtl: rtl,
2939
+ caret: false,
2948
2940
  openRelatedTo: ".aio-table",
2949
2941
  text: icon,
2950
2942
  popOver: function popOver() {
@@ -2997,7 +2989,7 @@ var RTableFilterPopup = /*#__PURE__*/function (_Component7) {
2997
2989
  }, {
2998
2990
  key: "render",
2999
2991
  value: function render() {
3000
- var _this20 = this;
2992
+ var _this19 = this;
3001
2993
 
3002
2994
  var column = this.props.column;
3003
2995
  var _this$context17 = this.context,
@@ -3034,7 +3026,7 @@ var RTableFilterPopup = /*#__PURE__*/function (_Component7) {
3034
3026
  }, /*#__PURE__*/_react.default.createElement("button", {
3035
3027
  className: "aio-table-filter-add",
3036
3028
  onClick: function onClick() {
3037
- return _this20.add();
3029
+ return _this19.add();
3038
3030
  }
3039
3031
  }, translate('Add'))));
3040
3032
  }
@@ -3051,17 +3043,17 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
3051
3043
  var _super8 = _createSuper(RTableFilterItem);
3052
3044
 
3053
3045
  function RTableFilterItem(props) {
3054
- var _this21;
3046
+ var _this20;
3055
3047
 
3056
3048
  _classCallCheck(this, RTableFilterItem);
3057
3049
 
3058
- _this21 = _super8.call(this, props);
3059
- var filter = _this21.props.filter;
3060
- _this21.state = {
3050
+ _this20 = _super8.call(this, props);
3051
+ var filter = _this20.props.filter;
3052
+ _this20.state = {
3061
3053
  value: filter.value,
3062
3054
  prevValue: filter.value
3063
3055
  };
3064
- return _this21;
3056
+ return _this20;
3065
3057
  }
3066
3058
 
3067
3059
  _createClass(RTableFilterItem, [{
@@ -3086,7 +3078,7 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
3086
3078
  }, {
3087
3079
  key: "changeValue",
3088
3080
  value: function changeValue(value) {
3089
- var _this22 = this;
3081
+ var _this21 = this;
3090
3082
 
3091
3083
  var onChangeFilter = this.context.onChangeFilter;
3092
3084
  clearTimeout(this.timeout);
@@ -3094,12 +3086,12 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
3094
3086
  value: value
3095
3087
  });
3096
3088
  this.timeout = setTimeout(function () {
3097
- var _this22$context = _this22.context,
3098
- SetState = _this22$context.SetState,
3099
- filterDictionary = _this22$context.filterDictionary;
3100
- var _this22$props = _this22.props,
3101
- column = _this22$props.column,
3102
- index = _this22$props.index;
3089
+ var _this21$context = _this21.context,
3090
+ SetState = _this21$context.SetState,
3091
+ filterDictionary = _this21$context.filterDictionary;
3092
+ var _this21$props = _this21.props,
3093
+ column = _this21$props.column,
3094
+ index = _this21$props.index;
3103
3095
  filterDictionary[column._index].items[index].value = value;
3104
3096
 
3105
3097
  if (onChangeFilter) {
@@ -3114,7 +3106,7 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
3114
3106
  }, {
3115
3107
  key: "render",
3116
3108
  value: function render() {
3117
- var _this23 = this;
3109
+ var _this22 = this;
3118
3110
 
3119
3111
  var _this$context19 = this.context,
3120
3112
  filterDictionary = _this$context19.filterDictionary,
@@ -3172,7 +3164,7 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
3172
3164
  type: type,
3173
3165
  value: value,
3174
3166
  onChange: function onChange(e) {
3175
- return _this23.changeValue(e.target.value);
3167
+ return _this22.changeValue(e.target.value);
3176
3168
  }
3177
3169
  }), /*#__PURE__*/_react.default.createElement("div", {
3178
3170
  style: {
@@ -3181,7 +3173,7 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
3181
3173
  }), /*#__PURE__*/_react.default.createElement("div", {
3182
3174
  className: "aio-table-filter-remove",
3183
3175
  onClick: function onClick() {
3184
- return _this23.remove(index);
3176
+ return _this22.remove(index);
3185
3177
  }
3186
3178
  }, /*#__PURE__*/_react.default.createElement(_react2.Icon, {
3187
3179
  path: _js.mdiClose,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aio-table",
3
- "version": "5.0.1",
3
+ "version": "5.1.0",
4
4
  "description": "all in one table. tree mode , simple mode , tree mode, gantt mode , groupby mode, freeze mode.",
5
5
  "main": "index.js",
6
6
  "scripts": {