aio-table 5.0.3 → 5.2.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.
- package/index.css +28 -24
- package/index.js +203 -213
- package/package.json +1 -1
package/index.css
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
display: flex;
|
|
20
20
|
width:100%;
|
|
21
21
|
flex:1;
|
|
22
|
+
overflow:hidden;
|
|
22
23
|
}
|
|
23
24
|
.aio-table-unit{
|
|
24
25
|
display: grid;
|
|
@@ -35,30 +36,7 @@
|
|
|
35
36
|
overflow-x:scroll;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
.aio-table-unit::-webkit-scrollbar {
|
|
40
|
-
width: 10px !important;
|
|
41
|
-
height:10px !important;
|
|
42
|
-
}
|
|
43
|
-
#aio-table-first-split::-webkit-scrollbar {
|
|
44
|
-
width: 0px !important;
|
|
45
|
-
height: 10px !important;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.aio-table-unit::-webkit-scrollbar-track {
|
|
49
|
-
background-color: transparent;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.aio-table-unit::-webkit-scrollbar-thumb {
|
|
53
|
-
background-color: #cdd4e0;
|
|
54
|
-
border-radius: 20px;
|
|
55
|
-
border: 3px solid transparent;
|
|
56
|
-
background-clip: content-box;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.aio-table-unit::-webkit-scrollbar-thumb:hover {
|
|
60
|
-
background-color: #868e9e;
|
|
61
|
-
}
|
|
39
|
+
|
|
62
40
|
.aio-table-title{
|
|
63
41
|
display:flex;
|
|
64
42
|
align-items: center;
|
|
@@ -264,6 +242,9 @@ select.aio-table-paging-button{
|
|
|
264
242
|
.aio-table-cell.aio-table-relative-filter{
|
|
265
243
|
opacity:.4;
|
|
266
244
|
}
|
|
245
|
+
.aio-table-cell.striped[data-evenodd = even]{
|
|
246
|
+
background:#f5f5f5
|
|
247
|
+
}
|
|
267
248
|
.aio-table-filter-popup{
|
|
268
249
|
background:#e3e6ea;
|
|
269
250
|
padding:6px;
|
|
@@ -497,3 +478,26 @@ display:none;
|
|
|
497
478
|
display: none !important;
|
|
498
479
|
}
|
|
499
480
|
}
|
|
481
|
+
/* custom scrollbar */
|
|
482
|
+
.aio-table-unit::-webkit-scrollbar {
|
|
483
|
+
width: 10px !important;
|
|
484
|
+
height:10px !important;
|
|
485
|
+
}
|
|
486
|
+
#aio-table-first-split::-webkit-scrollbar {
|
|
487
|
+
width: 0px !important;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.aio-table-unit::-webkit-scrollbar-track {
|
|
491
|
+
background-color: transparent;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.aio-table-unit::-webkit-scrollbar-thumb {
|
|
495
|
+
background-color: #cdd4e0;
|
|
496
|
+
border-radius: 20px;
|
|
497
|
+
border: 3px solid transparent;
|
|
498
|
+
background-clip: content-box;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.aio-table-unit::-webkit-scrollbar-thumb:hover {
|
|
502
|
+
background-color: #868e9e;
|
|
503
|
+
}
|
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return !!right[Symbol.hasInstance](left); } else { return left instanceof right; } }
|
|
4
4
|
|
|
5
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
5
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
@@ -49,9 +49,9 @@ function _classCallCheck(instance, Constructor) { if (!_instanceof(instance, Con
|
|
|
49
49
|
|
|
50
50
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
51
51
|
|
|
52
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
52
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
53
53
|
|
|
54
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
54
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
55
55
|
|
|
56
56
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
57
57
|
|
|
@@ -78,7 +78,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
78
78
|
_classCallCheck(this, AIOTable);
|
|
79
79
|
|
|
80
80
|
_this = _super.call(this, props);
|
|
81
|
-
|
|
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: "
|
|
147
|
-
value: function
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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);
|
|
152
155
|
}
|
|
153
156
|
|
|
154
|
-
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
|
|
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();
|
|
168
|
-
}
|
|
169
|
-
}, {
|
|
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);
|
|
157
|
+
this.firstscroll = false;
|
|
175
158
|
}
|
|
176
159
|
}, {
|
|
177
|
-
key: "
|
|
178
|
-
value: function
|
|
179
|
-
this.
|
|
180
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
285
|
+
return _this2.resizeDown(e);
|
|
296
286
|
},
|
|
297
287
|
onTouchStart: function onTouchStart(e) {
|
|
298
|
-
return
|
|
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
|
|
328
|
+
var _this3 = this;
|
|
339
329
|
|
|
340
330
|
var newModel = model.sort(function (a, b) {
|
|
341
|
-
for (var i = 0; i <
|
|
342
|
-
var
|
|
343
|
-
getValue =
|
|
344
|
-
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 !==
|
|
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
|
|
850
|
+
var _this4 = this;
|
|
861
851
|
|
|
862
852
|
var _this$props5 = this.props,
|
|
863
853
|
_this$props5$freezeMo = _this$props5.freezeMode,
|
|
@@ -921,16 +911,16 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
921
911
|
}
|
|
922
912
|
|
|
923
913
|
if (active === true) {
|
|
924
|
-
|
|
914
|
+
_this4.sorts.push({
|
|
925
915
|
getValue: getValue,
|
|
926
916
|
type: type
|
|
927
917
|
});
|
|
928
918
|
}
|
|
929
919
|
|
|
930
920
|
if (toggle) {
|
|
931
|
-
|
|
921
|
+
_this4.toolbar.show = true;
|
|
932
922
|
|
|
933
|
-
|
|
923
|
+
_this4.toolbar.sort.push({
|
|
934
924
|
text: title,
|
|
935
925
|
checked: active === true,
|
|
936
926
|
after: /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -946,7 +936,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
946
936
|
e.stopPropagation();
|
|
947
937
|
sort.type = sort.type === 'dec' ? 'inc' : 'dec';
|
|
948
938
|
|
|
949
|
-
|
|
939
|
+
_this4.setState({
|
|
950
940
|
sorts: sorts
|
|
951
941
|
});
|
|
952
942
|
|
|
@@ -960,7 +950,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
960
950
|
onClick: function onClick() {
|
|
961
951
|
sort.active = !active;
|
|
962
952
|
|
|
963
|
-
|
|
953
|
+
_this4.setState({
|
|
964
954
|
sorts: sorts
|
|
965
955
|
});
|
|
966
956
|
|
|
@@ -1002,13 +992,13 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
1002
992
|
groupDictionary[title] = groupDictionary[title] === undefined ? active : groupDictionary[title];
|
|
1003
993
|
|
|
1004
994
|
if (groupDictionary[title]) {
|
|
1005
|
-
|
|
995
|
+
_this4.groups.push(group);
|
|
1006
996
|
}
|
|
1007
997
|
|
|
1008
998
|
if (toggle) {
|
|
1009
|
-
|
|
999
|
+
_this4.toolbar.show = true;
|
|
1010
1000
|
|
|
1011
|
-
|
|
1001
|
+
_this4.toolbar.groupBy.push({
|
|
1012
1002
|
text: title,
|
|
1013
1003
|
checked: groupDictionary[title],
|
|
1014
1004
|
onClick: function onClick() {
|
|
@@ -1018,7 +1008,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
1018
1008
|
localStorage.setItem('aio table group' + id, JSON.stringify(groupDictionary));
|
|
1019
1009
|
}
|
|
1020
1010
|
|
|
1021
|
-
|
|
1011
|
+
_this4.setState({
|
|
1022
1012
|
groupDictionary: groupDictionary
|
|
1023
1013
|
});
|
|
1024
1014
|
}
|
|
@@ -1068,29 +1058,29 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
1068
1058
|
|
|
1069
1059
|
column._index = _i4;
|
|
1070
1060
|
|
|
1071
|
-
if (show !== false &&
|
|
1072
|
-
|
|
1061
|
+
if (show !== false && _this4.showColumnRelativeGroups(column)) {
|
|
1062
|
+
_this4.visibleColumns.push(column);
|
|
1073
1063
|
|
|
1074
1064
|
if (freezeMode) {
|
|
1075
1065
|
if (column.freeze) {
|
|
1076
|
-
|
|
1066
|
+
_this4.freezeMode = true;
|
|
1077
1067
|
|
|
1078
|
-
|
|
1068
|
+
_this4.freezeColumns.push(column);
|
|
1079
1069
|
} else {
|
|
1080
|
-
|
|
1070
|
+
_this4.unFreezeColumns.push(column);
|
|
1081
1071
|
}
|
|
1082
1072
|
|
|
1083
1073
|
if (column.toggleFreeze) {
|
|
1084
|
-
|
|
1074
|
+
_this4.toolbar.show = true;
|
|
1085
1075
|
|
|
1086
|
-
|
|
1076
|
+
_this4.toolbar.freeze.push({
|
|
1087
1077
|
text: column.title,
|
|
1088
1078
|
checked: column.freeze === true,
|
|
1089
1079
|
onClick: function onClick() {
|
|
1090
1080
|
column.freeze = column.freeze === true ? true : false;
|
|
1091
1081
|
column.freeze = !column.freeze;
|
|
1092
1082
|
|
|
1093
|
-
|
|
1083
|
+
_this4.setState({
|
|
1094
1084
|
columns: columns
|
|
1095
1085
|
});
|
|
1096
1086
|
}
|
|
@@ -1100,9 +1090,9 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
1100
1090
|
}
|
|
1101
1091
|
|
|
1102
1092
|
if (column.toggleShow) {
|
|
1103
|
-
|
|
1093
|
+
_this4.toolbar.show = true;
|
|
1104
1094
|
|
|
1105
|
-
|
|
1095
|
+
_this4.toolbar.toggle.push({
|
|
1106
1096
|
text: column.title,
|
|
1107
1097
|
checked: show !== false,
|
|
1108
1098
|
onClick: function onClick() {
|
|
@@ -1117,7 +1107,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
1117
1107
|
column.show = !column.show;
|
|
1118
1108
|
}
|
|
1119
1109
|
|
|
1120
|
-
|
|
1110
|
+
_this4.setState({
|
|
1121
1111
|
columns: columns
|
|
1122
1112
|
});
|
|
1123
1113
|
}
|
|
@@ -1125,8 +1115,8 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
1125
1115
|
}
|
|
1126
1116
|
|
|
1127
1117
|
if (column.search) {
|
|
1128
|
-
|
|
1129
|
-
|
|
1118
|
+
_this4.toolbar.show = true;
|
|
1119
|
+
_this4.toolbar.searchColumnIndex = column._index;
|
|
1130
1120
|
}
|
|
1131
1121
|
};
|
|
1132
1122
|
|
|
@@ -1141,7 +1131,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
1141
1131
|
}, {
|
|
1142
1132
|
key: "getPaging",
|
|
1143
1133
|
value: function getPaging() {
|
|
1144
|
-
var
|
|
1134
|
+
var _this5 = this;
|
|
1145
1135
|
|
|
1146
1136
|
var paging = this.state.paging;
|
|
1147
1137
|
|
|
@@ -1188,7 +1178,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
1188
1178
|
|
|
1189
1179
|
paging.number = newNumber;
|
|
1190
1180
|
|
|
1191
|
-
|
|
1181
|
+
_this5.setState({
|
|
1192
1182
|
paging: paging
|
|
1193
1183
|
});
|
|
1194
1184
|
|
|
@@ -1246,7 +1236,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
1246
1236
|
onChange: function onChange(e) {
|
|
1247
1237
|
paging.size = parseInt(e.target.value);
|
|
1248
1238
|
|
|
1249
|
-
|
|
1239
|
+
_this5.setState({
|
|
1250
1240
|
paging: paging
|
|
1251
1241
|
});
|
|
1252
1242
|
|
|
@@ -1368,7 +1358,7 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
1368
1358
|
}, {
|
|
1369
1359
|
key: "render",
|
|
1370
1360
|
value: function render() {
|
|
1371
|
-
var
|
|
1361
|
+
var _this6 = this;
|
|
1372
1362
|
|
|
1373
1363
|
if (JSON.stringify(this.props.columns) !== JSON.stringify(this.state.columns)) {
|
|
1374
1364
|
this.setState({
|
|
@@ -1409,23 +1399,22 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
1409
1399
|
var Paging = this.getPaging();
|
|
1410
1400
|
var context = { ...this.props,
|
|
1411
1401
|
...this.state,
|
|
1412
|
-
touch: this.touch,
|
|
1413
1402
|
onDrag: function onDrag(obj) {
|
|
1414
|
-
return
|
|
1403
|
+
return _this6.dragStart = obj;
|
|
1415
1404
|
},
|
|
1416
1405
|
onDrop: function onDrop(obj) {
|
|
1417
|
-
if (!
|
|
1406
|
+
if (!_this6.dragStart) {
|
|
1418
1407
|
return;
|
|
1419
1408
|
}
|
|
1420
1409
|
|
|
1421
|
-
if (
|
|
1410
|
+
if (_this6.dragStart._level !== obj._level) {
|
|
1422
1411
|
return;
|
|
1423
1412
|
}
|
|
1424
1413
|
|
|
1425
|
-
if (
|
|
1426
|
-
onSwap(
|
|
1414
|
+
if (_this6.dragStart._level === 0) {
|
|
1415
|
+
onSwap(_this6.dragStart, obj);
|
|
1427
1416
|
} else {
|
|
1428
|
-
var startParents =
|
|
1417
|
+
var startParents = _this6.dragStart._getParents().map(function (o) {
|
|
1429
1418
|
return o._index;
|
|
1430
1419
|
}).toString();
|
|
1431
1420
|
|
|
@@ -1437,18 +1426,18 @@ var AIOTable = /*#__PURE__*/function (_Component) {
|
|
|
1437
1426
|
return;
|
|
1438
1427
|
}
|
|
1439
1428
|
|
|
1440
|
-
onSwap(
|
|
1429
|
+
onSwap(_this6.dragStart, obj);
|
|
1441
1430
|
}
|
|
1442
1431
|
},
|
|
1443
1432
|
onChangeFilter: onChangeFilter ? this.onChangeFilter.bind(this) : undefined,
|
|
1444
1433
|
SetState: function SetState(obj) {
|
|
1445
|
-
return
|
|
1434
|
+
return _this6.setState(obj);
|
|
1446
1435
|
},
|
|
1447
1436
|
cubes2: this.cubes2.bind(this),
|
|
1448
1437
|
toggleRow: this.toggleRow.bind(this),
|
|
1449
1438
|
getGap: this.getGap.bind(this),
|
|
1450
|
-
|
|
1451
|
-
|
|
1439
|
+
onScroll1: this.onScroll1.bind(this),
|
|
1440
|
+
onScroll2: this.onScroll2.bind(this),
|
|
1452
1441
|
getClient: this.getClient.bind(this),
|
|
1453
1442
|
getLoading: this.getLoading.bind(this),
|
|
1454
1443
|
groups: this.groups
|
|
@@ -1500,7 +1489,7 @@ var RTableToolbar = /*#__PURE__*/function (_Component2) {
|
|
|
1500
1489
|
_createClass(RTableToolbar, [{
|
|
1501
1490
|
key: "changeSearch",
|
|
1502
1491
|
value: function changeSearch(value) {
|
|
1503
|
-
var
|
|
1492
|
+
var _this7 = this;
|
|
1504
1493
|
|
|
1505
1494
|
var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
1506
1495
|
var SetState = this.context.SetState;
|
|
@@ -1509,10 +1498,10 @@ var RTableToolbar = /*#__PURE__*/function (_Component2) {
|
|
|
1509
1498
|
searchText: value
|
|
1510
1499
|
});
|
|
1511
1500
|
this.searchTimeout = setTimeout(function () {
|
|
1512
|
-
var
|
|
1513
|
-
filterDictionary =
|
|
1514
|
-
SetState =
|
|
1515
|
-
var searchColumnIndex =
|
|
1501
|
+
var _this7$context = _this7.context,
|
|
1502
|
+
filterDictionary = _this7$context.filterDictionary,
|
|
1503
|
+
SetState = _this7$context.SetState;
|
|
1504
|
+
var searchColumnIndex = _this7.props.searchColumnIndex;
|
|
1516
1505
|
filterDictionary[searchColumnIndex] = {
|
|
1517
1506
|
items: value ? [{
|
|
1518
1507
|
operator: 'contain',
|
|
@@ -1528,7 +1517,7 @@ var RTableToolbar = /*#__PURE__*/function (_Component2) {
|
|
|
1528
1517
|
}, {
|
|
1529
1518
|
key: "render",
|
|
1530
1519
|
value: function render() {
|
|
1531
|
-
var
|
|
1520
|
+
var _this8 = this;
|
|
1532
1521
|
|
|
1533
1522
|
var _this$context = this.context,
|
|
1534
1523
|
searchText = _this$context.searchText,
|
|
@@ -1587,7 +1576,7 @@ var RTableToolbar = /*#__PURE__*/function (_Component2) {
|
|
|
1587
1576
|
value: searchText,
|
|
1588
1577
|
placeholder: translate('Search'),
|
|
1589
1578
|
onChange: function onChange(e) {
|
|
1590
|
-
return
|
|
1579
|
+
return _this8.changeSearch(e.target.value);
|
|
1591
1580
|
}
|
|
1592
1581
|
}), /*#__PURE__*/_react.default.createElement(_react2.Icon, {
|
|
1593
1582
|
className: "aio-table-search-icon",
|
|
@@ -1598,7 +1587,7 @@ var RTableToolbar = /*#__PURE__*/function (_Component2) {
|
|
|
1598
1587
|
return;
|
|
1599
1588
|
}
|
|
1600
1589
|
|
|
1601
|
-
|
|
1590
|
+
_this8.changeSearch('', 0);
|
|
1602
1591
|
}
|
|
1603
1592
|
})), searchColumnIndex === false && /*#__PURE__*/_react.default.createElement("div", {
|
|
1604
1593
|
style: {
|
|
@@ -1657,13 +1646,13 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
1657
1646
|
var _super3 = _createSuper(RTableUnit);
|
|
1658
1647
|
|
|
1659
1648
|
function RTableUnit(props) {
|
|
1660
|
-
var
|
|
1649
|
+
var _this9;
|
|
1661
1650
|
|
|
1662
1651
|
_classCallCheck(this, RTableUnit);
|
|
1663
1652
|
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
return
|
|
1653
|
+
_this9 = _super3.call(this, props);
|
|
1654
|
+
_this9.dom = /*#__PURE__*/(0, _react.createRef)();
|
|
1655
|
+
return _this9;
|
|
1667
1656
|
}
|
|
1668
1657
|
|
|
1669
1658
|
_createClass(RTableUnit, [{
|
|
@@ -1757,11 +1746,11 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
1757
1746
|
}, {
|
|
1758
1747
|
key: "getTitles",
|
|
1759
1748
|
value: function getTitles() {
|
|
1760
|
-
var
|
|
1749
|
+
var _this10 = this;
|
|
1761
1750
|
|
|
1762
1751
|
var columns = this.props.columns;
|
|
1763
1752
|
return columns.map(function (column) {
|
|
1764
|
-
return
|
|
1753
|
+
return _this10.getTitle(column);
|
|
1765
1754
|
});
|
|
1766
1755
|
}
|
|
1767
1756
|
}, {
|
|
@@ -1811,7 +1800,7 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
1811
1800
|
}, {
|
|
1812
1801
|
key: "getTitle",
|
|
1813
1802
|
value: function getTitle(column) {
|
|
1814
|
-
var
|
|
1803
|
+
var _this11 = this;
|
|
1815
1804
|
|
|
1816
1805
|
if (column.template === 'gantt') {
|
|
1817
1806
|
return this.getGanttTitle(column);
|
|
@@ -1842,7 +1831,7 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
1842
1831
|
},
|
|
1843
1832
|
draggable: false
|
|
1844
1833
|
}, touch ? 'onTouchStart' : 'onMouseDown', function (e) {
|
|
1845
|
-
return column.resizable ?
|
|
1834
|
+
return column.resizable ? _this11.resizeDown(e, column) : undefined;
|
|
1846
1835
|
});
|
|
1847
1836
|
|
|
1848
1837
|
var titleProps = {
|
|
@@ -1853,24 +1842,24 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
1853
1842
|
},
|
|
1854
1843
|
draggable: column.movable !== false,
|
|
1855
1844
|
onDragStart: function onDragStart(e) {
|
|
1856
|
-
|
|
1845
|
+
_this11.startColumnSwap = column._index;
|
|
1857
1846
|
},
|
|
1858
1847
|
onDragOver: function onDragOver(e) {
|
|
1859
1848
|
e.preventDefault();
|
|
1860
|
-
|
|
1849
|
+
_this11.endColumnSwap = column._index;
|
|
1861
1850
|
},
|
|
1862
1851
|
onDrop: function onDrop(e) {
|
|
1863
1852
|
if (column.movable === false) {
|
|
1864
1853
|
return;
|
|
1865
1854
|
}
|
|
1866
1855
|
|
|
1867
|
-
if (
|
|
1856
|
+
if (_this11.startColumnSwap === undefined || _this11.startColumnSwap === _this11.endColumnSwap) {
|
|
1868
1857
|
return;
|
|
1869
1858
|
}
|
|
1870
1859
|
|
|
1871
|
-
var temp = columns[
|
|
1872
|
-
columns[
|
|
1873
|
-
columns[
|
|
1860
|
+
var temp = columns[_this11.startColumnSwap];
|
|
1861
|
+
columns[_this11.startColumnSwap] = columns[_this11.endColumnSwap];
|
|
1862
|
+
columns[_this11.endColumnSwap] = temp;
|
|
1874
1863
|
SetState({
|
|
1875
1864
|
columns: columns
|
|
1876
1865
|
});
|
|
@@ -2051,12 +2040,12 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
2051
2040
|
}, {
|
|
2052
2041
|
key: "card",
|
|
2053
2042
|
value: function card() {
|
|
2054
|
-
var
|
|
2043
|
+
var _this12 = this;
|
|
2055
2044
|
|
|
2056
2045
|
var _this$context11 = this.context,
|
|
2057
2046
|
indent = _this$context11.indent,
|
|
2058
|
-
|
|
2059
|
-
|
|
2047
|
+
onScroll1 = _this$context11.onScroll1,
|
|
2048
|
+
onScroll2 = _this$context11.onScroll2,
|
|
2060
2049
|
rowHeight = _this$context11.rowHeight,
|
|
2061
2050
|
_this$context11$cardG = _this$context11.cardGap,
|
|
2062
2051
|
cardGap = _this$context11$cardG === void 0 ? 0 : _this$context11$cardG,
|
|
@@ -2093,14 +2082,8 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
2093
2082
|
gridColumnGap: columnGap,
|
|
2094
2083
|
gridTemplateColumns: cardRowCount === 'auto' ? undefined : "repeat(".concat(cardRowCount, ",auto)")
|
|
2095
2084
|
},
|
|
2096
|
-
onMouseEnter: function onMouseEnter() {
|
|
2097
|
-
return _onMouseEnter(index);
|
|
2098
|
-
},
|
|
2099
|
-
onMouseDown: function onMouseDown() {
|
|
2100
|
-
return _onMouseEnter(index);
|
|
2101
|
-
},
|
|
2102
2085
|
onScroll: function onScroll(e) {
|
|
2103
|
-
return
|
|
2086
|
+
return index === 0 ? onScroll1() : onScroll2();
|
|
2104
2087
|
}
|
|
2105
2088
|
}, rows && rows.length !== 0 && rows.map(function (row, i) {
|
|
2106
2089
|
if (row._groupId) {
|
|
@@ -2114,7 +2097,7 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
2114
2097
|
width: width,
|
|
2115
2098
|
flexShrink: 0
|
|
2116
2099
|
}
|
|
2117
|
-
}),
|
|
2100
|
+
}), _this12.getGroupToggleIcon(row), /*#__PURE__*/_react.default.createElement("div", {
|
|
2118
2101
|
className: "aio-table-group-text"
|
|
2119
2102
|
}, row._groupValue)));
|
|
2120
2103
|
}
|
|
@@ -2130,7 +2113,7 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
2130
2113
|
}, {
|
|
2131
2114
|
key: "render",
|
|
2132
2115
|
value: function render() {
|
|
2133
|
-
var
|
|
2116
|
+
var _this13 = this;
|
|
2134
2117
|
|
|
2135
2118
|
if (this.context.cardTemplate) {
|
|
2136
2119
|
return this.card();
|
|
@@ -2138,8 +2121,8 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
2138
2121
|
|
|
2139
2122
|
var _this$context12 = this.context,
|
|
2140
2123
|
indent = _this$context12.indent,
|
|
2141
|
-
|
|
2142
|
-
|
|
2124
|
+
onScroll1 = _this$context12.onScroll1,
|
|
2125
|
+
onScroll2 = _this$context12.onScroll2,
|
|
2143
2126
|
rowHeight = _this$context12.rowHeight,
|
|
2144
2127
|
groups = _this$context12.groups,
|
|
2145
2128
|
getLoading = _this$context12.getLoading,
|
|
@@ -2156,14 +2139,8 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
2156
2139
|
onKeyDown: this.keyDown.bind(this),
|
|
2157
2140
|
style: this.getStyle(),
|
|
2158
2141
|
ref: this.dom,
|
|
2159
|
-
onMouseEnter: function onMouseEnter() {
|
|
2160
|
-
return _onMouseEnter2(index);
|
|
2161
|
-
},
|
|
2162
|
-
onMouseDown: function onMouseDown() {
|
|
2163
|
-
return _onMouseEnter2(index);
|
|
2164
|
-
},
|
|
2165
2142
|
onScroll: function onScroll(e) {
|
|
2166
|
-
return
|
|
2143
|
+
return index === 0 ? onScroll1() : onScroll2();
|
|
2167
2144
|
}
|
|
2168
2145
|
}, this.getTitles(), rows && rows.length !== 0 && rows.map(function (row, i) {
|
|
2169
2146
|
if (row._groupId) {
|
|
@@ -2171,7 +2148,7 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
2171
2148
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
2172
2149
|
className: "aio-table-group",
|
|
2173
2150
|
key: 'group' + i + '-' + index,
|
|
2174
|
-
style: { ...
|
|
2151
|
+
style: { ..._this13.getFullCellStyle(),
|
|
2175
2152
|
height: rowHeight
|
|
2176
2153
|
}
|
|
2177
2154
|
}, index !== 1 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -2179,7 +2156,7 @@ var RTableUnit = /*#__PURE__*/function (_Component3) {
|
|
|
2179
2156
|
width: width,
|
|
2180
2157
|
flexShrink: 0
|
|
2181
2158
|
}
|
|
2182
|
-
}),
|
|
2159
|
+
}), _this13.getGroupToggleIcon(row), /*#__PURE__*/_react.default.createElement("div", {
|
|
2183
2160
|
className: "aio-table-group-text"
|
|
2184
2161
|
}, row._groupValue)));
|
|
2185
2162
|
}
|
|
@@ -2208,19 +2185,19 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
|
|
|
2208
2185
|
var _super4 = _createSuper(AIOTableCell);
|
|
2209
2186
|
|
|
2210
2187
|
function AIOTableCell(props) {
|
|
2211
|
-
var
|
|
2188
|
+
var _this14;
|
|
2212
2189
|
|
|
2213
2190
|
_classCallCheck(this, AIOTableCell);
|
|
2214
2191
|
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
var value =
|
|
2218
|
-
|
|
2192
|
+
_this14 = _super4.call(this, props);
|
|
2193
|
+
_this14.dom = /*#__PURE__*/(0, _react.createRef)();
|
|
2194
|
+
var value = _this14.props.value;
|
|
2195
|
+
_this14.state = {
|
|
2219
2196
|
value: value,
|
|
2220
2197
|
error: false,
|
|
2221
2198
|
prevValue: value
|
|
2222
2199
|
};
|
|
2223
|
-
return
|
|
2200
|
+
return _this14;
|
|
2224
2201
|
}
|
|
2225
2202
|
|
|
2226
2203
|
_createClass(AIOTableCell, [{
|
|
@@ -2253,19 +2230,25 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
|
|
|
2253
2230
|
}
|
|
2254
2231
|
}, {
|
|
2255
2232
|
key: "getStyle",
|
|
2256
|
-
value: function getStyle(column) {
|
|
2233
|
+
value: function getStyle(column, row) {
|
|
2257
2234
|
var _column$padding2 = column.padding,
|
|
2258
2235
|
padding = _column$padding2 === void 0 ? '36px' : _column$padding2,
|
|
2259
2236
|
template = column.template,
|
|
2260
2237
|
_column$minWidth = column.minWidth,
|
|
2261
2238
|
minWidth = _column$minWidth === void 0 ? '30px' : _column$minWidth;
|
|
2262
|
-
var
|
|
2239
|
+
var _this$context13 = this.context,
|
|
2240
|
+
rowHeight = _this$context13.rowHeight,
|
|
2241
|
+
striped = _this$context13.striped;
|
|
2263
2242
|
var style = {
|
|
2264
2243
|
height: rowHeight,
|
|
2265
2244
|
overflow: template ? undefined : 'hidden',
|
|
2266
2245
|
minWidth: minWidth
|
|
2267
2246
|
};
|
|
2268
2247
|
|
|
2248
|
+
if (typeof striped === 'string' && row._index % 2 === 0) {
|
|
2249
|
+
style.background = striped;
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2269
2252
|
if (column.template === 'gantt') {
|
|
2270
2253
|
style.padding = "0 ".concat(padding);
|
|
2271
2254
|
}
|
|
@@ -2276,6 +2259,11 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
|
|
|
2276
2259
|
key: "getClassName",
|
|
2277
2260
|
value: function getClassName(row, column) {
|
|
2278
2261
|
var className = 'aio-table-cell';
|
|
2262
|
+
var striped = this.context.striped;
|
|
2263
|
+
|
|
2264
|
+
if (row._index % 2 === 0 && striped === true) {
|
|
2265
|
+
className += ' striped';
|
|
2266
|
+
}
|
|
2279
2267
|
|
|
2280
2268
|
if (column.template) {
|
|
2281
2269
|
className += ' aio-table-cell-template';
|
|
@@ -2302,9 +2290,9 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
|
|
|
2302
2290
|
}, {
|
|
2303
2291
|
key: "getToggleIcon",
|
|
2304
2292
|
value: function getToggleIcon(row) {
|
|
2305
|
-
var _this$
|
|
2306
|
-
rtl = _this$
|
|
2307
|
-
toggleRow = _this$
|
|
2293
|
+
var _this$context14 = this.context,
|
|
2294
|
+
rtl = _this$context14.rtl,
|
|
2295
|
+
toggleRow = _this$context14.toggleRow;
|
|
2308
2296
|
var icon;
|
|
2309
2297
|
|
|
2310
2298
|
if (!row._childsLength) {
|
|
@@ -2508,7 +2496,7 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
|
|
|
2508
2496
|
}, {
|
|
2509
2497
|
key: "getInput",
|
|
2510
2498
|
value: function getInput(row, column) {
|
|
2511
|
-
var
|
|
2499
|
+
var _this15 = this;
|
|
2512
2500
|
|
|
2513
2501
|
var type = column.inlineEdit.type;
|
|
2514
2502
|
var value = this.state.value;
|
|
@@ -2532,23 +2520,23 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
|
|
|
2532
2520
|
textAlign: column.justify ? 'center' : undefined
|
|
2533
2521
|
},
|
|
2534
2522
|
onChange: function onChange(e) {
|
|
2535
|
-
return
|
|
2523
|
+
return _this15.setState({
|
|
2536
2524
|
value: e.target.value
|
|
2537
2525
|
});
|
|
2538
2526
|
},
|
|
2539
2527
|
onBlur: async function onBlur(e) {
|
|
2540
|
-
|
|
2528
|
+
_this15.setState({
|
|
2541
2529
|
loading: true
|
|
2542
2530
|
});
|
|
2543
2531
|
|
|
2544
2532
|
var error = await column.inlineEdit.onChange(row, type === 'number' ? parseFloat(value) : value);
|
|
2545
2533
|
|
|
2546
|
-
|
|
2534
|
+
_this15.setState({
|
|
2547
2535
|
loading: false
|
|
2548
2536
|
});
|
|
2549
2537
|
|
|
2550
2538
|
if (typeof error === 'string') {
|
|
2551
|
-
|
|
2539
|
+
_this15.setState({
|
|
2552
2540
|
error: error
|
|
2553
2541
|
});
|
|
2554
2542
|
}
|
|
@@ -2573,27 +2561,27 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
|
|
|
2573
2561
|
className: "aio-table-input-container"
|
|
2574
2562
|
}, /*#__PURE__*/_react.default.createElement("select", _extends({}, props, {
|
|
2575
2563
|
onFocus: function onFocus() {
|
|
2576
|
-
return
|
|
2564
|
+
return _this15.focus = true;
|
|
2577
2565
|
},
|
|
2578
2566
|
onBlur: function onBlur() {
|
|
2579
|
-
return
|
|
2567
|
+
return _this15.focus = false;
|
|
2580
2568
|
},
|
|
2581
2569
|
onChange: async function onChange(e) {
|
|
2582
2570
|
var value = e.target.value;
|
|
2583
2571
|
|
|
2584
|
-
|
|
2572
|
+
_this15.setState({
|
|
2585
2573
|
loading: true,
|
|
2586
2574
|
value: value
|
|
2587
2575
|
});
|
|
2588
2576
|
|
|
2589
2577
|
var error = await column.inlineEdit.onChange(row, e.target.value);
|
|
2590
2578
|
|
|
2591
|
-
|
|
2579
|
+
_this15.setState({
|
|
2592
2580
|
loading: false
|
|
2593
2581
|
});
|
|
2594
2582
|
|
|
2595
2583
|
if (typeof error === 'string') {
|
|
2596
|
-
|
|
2584
|
+
_this15.setState({
|
|
2597
2585
|
error: error
|
|
2598
2586
|
});
|
|
2599
2587
|
}
|
|
@@ -2623,16 +2611,16 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
|
|
|
2623
2611
|
}, {
|
|
2624
2612
|
key: "render",
|
|
2625
2613
|
value: function render() {
|
|
2626
|
-
var
|
|
2614
|
+
var _this16 = this;
|
|
2627
2615
|
|
|
2628
|
-
var _this$
|
|
2629
|
-
indent = _this$
|
|
2630
|
-
cubes2 = _this$
|
|
2631
|
-
focused = _this$
|
|
2632
|
-
SetState = _this$
|
|
2633
|
-
onDrag = _this$
|
|
2634
|
-
_onDrop = _this$
|
|
2635
|
-
onSwap = _this$
|
|
2616
|
+
var _this$context15 = this.context,
|
|
2617
|
+
indent = _this$context15.indent,
|
|
2618
|
+
cubes2 = _this$context15.cubes2,
|
|
2619
|
+
focused = _this$context15.focused,
|
|
2620
|
+
SetState = _this$context15.SetState,
|
|
2621
|
+
onDrag = _this$context15.onDrag,
|
|
2622
|
+
_onDrop = _this$context15.onDrop,
|
|
2623
|
+
onSwap = _this$context15.onSwap;
|
|
2636
2624
|
var _this$props12 = this.props,
|
|
2637
2625
|
row = _this$props12.row,
|
|
2638
2626
|
column = _this$props12.column,
|
|
@@ -2663,8 +2651,8 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
|
|
|
2663
2651
|
cell = /*#__PURE__*/_react.default.createElement("div", {
|
|
2664
2652
|
className: "aio-table-error",
|
|
2665
2653
|
onClick: function onClick() {
|
|
2666
|
-
|
|
2667
|
-
value:
|
|
2654
|
+
_this16.setState({
|
|
2655
|
+
value: _this16.props.value,
|
|
2668
2656
|
error: false
|
|
2669
2657
|
});
|
|
2670
2658
|
}
|
|
@@ -2690,6 +2678,7 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
|
|
|
2690
2678
|
ref: this.dom,
|
|
2691
2679
|
cellid: cellId,
|
|
2692
2680
|
title: typeof content === 'string' ? content : '',
|
|
2681
|
+
"data-evenodd": row._index % 2 === 0 ? 'even' : 'odd',
|
|
2693
2682
|
rowindex: row._renderIndex,
|
|
2694
2683
|
colindex: column._renderIndex,
|
|
2695
2684
|
childindex: row._childIndex,
|
|
@@ -2697,7 +2686,7 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
|
|
|
2697
2686
|
isfirstchild: row._isFirstChild ? 1 : 0,
|
|
2698
2687
|
islastchild: row._isLastChild ? 1 : 0,
|
|
2699
2688
|
childslength: row._childsLength,
|
|
2700
|
-
style: this.getStyle(column),
|
|
2689
|
+
style: this.getStyle(column, row),
|
|
2701
2690
|
className: this.getClassName(row, column),
|
|
2702
2691
|
draggable: typeof onSwap === 'function' && column.swap,
|
|
2703
2692
|
onDragOver: function onDragOver(e) {
|
|
@@ -2736,14 +2725,14 @@ var AIOSlider = /*#__PURE__*/function (_Component5) {
|
|
|
2736
2725
|
var _super5 = _createSuper(AIOSlider);
|
|
2737
2726
|
|
|
2738
2727
|
function AIOSlider(props) {
|
|
2739
|
-
var
|
|
2728
|
+
var _this17;
|
|
2740
2729
|
|
|
2741
2730
|
_classCallCheck(this, AIOSlider);
|
|
2742
2731
|
|
|
2743
|
-
|
|
2744
|
-
var
|
|
2745
|
-
column =
|
|
2746
|
-
row =
|
|
2732
|
+
_this17 = _super5.call(this, props);
|
|
2733
|
+
var _this17$props = _this17.props,
|
|
2734
|
+
column = _this17$props.column,
|
|
2735
|
+
row = _this17$props.row;
|
|
2747
2736
|
var getValue = column.getValue;
|
|
2748
2737
|
var value = getValue(row);
|
|
2749
2738
|
|
|
@@ -2751,11 +2740,11 @@ var AIOSlider = /*#__PURE__*/function (_Component5) {
|
|
|
2751
2740
|
value = [value];
|
|
2752
2741
|
}
|
|
2753
2742
|
|
|
2754
|
-
|
|
2743
|
+
_this17.state = {
|
|
2755
2744
|
value: value
|
|
2756
2745
|
};
|
|
2757
|
-
|
|
2758
|
-
return
|
|
2746
|
+
_this17.updateMode = 'outside';
|
|
2747
|
+
return _this17;
|
|
2759
2748
|
}
|
|
2760
2749
|
|
|
2761
2750
|
_createClass(AIOSlider, [{
|
|
@@ -2774,7 +2763,7 @@ var AIOSlider = /*#__PURE__*/function (_Component5) {
|
|
|
2774
2763
|
}, {
|
|
2775
2764
|
key: "render",
|
|
2776
2765
|
value: function render() {
|
|
2777
|
-
var
|
|
2766
|
+
var _this18 = this;
|
|
2778
2767
|
|
|
2779
2768
|
var _this$props13 = this.props,
|
|
2780
2769
|
column = _this$props13.column,
|
|
@@ -2868,7 +2857,7 @@ var AIOSlider = /*#__PURE__*/function (_Component5) {
|
|
|
2868
2857
|
fillStyle: {
|
|
2869
2858
|
height: '6px',
|
|
2870
2859
|
borderRadius: '24px',
|
|
2871
|
-
background:
|
|
2860
|
+
background: _this18.getBackground(value.length, i, color)
|
|
2872
2861
|
}
|
|
2873
2862
|
};
|
|
2874
2863
|
}),
|
|
@@ -2891,7 +2880,7 @@ var AIOSlider = /*#__PURE__*/function (_Component5) {
|
|
|
2891
2880
|
return;
|
|
2892
2881
|
}
|
|
2893
2882
|
|
|
2894
|
-
|
|
2883
|
+
_this18.updateMode = 'onChange';
|
|
2895
2884
|
onChange(row, points.length > 1 ? points.map(function (p) {
|
|
2896
2885
|
return p.value;
|
|
2897
2886
|
}) : points[0].value);
|
|
@@ -2901,9 +2890,9 @@ var AIOSlider = /*#__PURE__*/function (_Component5) {
|
|
|
2901
2890
|
},
|
|
2902
2891
|
ondrag: function ondrag(_ref2) {
|
|
2903
2892
|
var points = _ref2.points;
|
|
2904
|
-
|
|
2893
|
+
_this18.updateMode = 'onDrag';
|
|
2905
2894
|
|
|
2906
|
-
|
|
2895
|
+
_this18.setState({
|
|
2907
2896
|
value: points.map(function (p) {
|
|
2908
2897
|
return p.value;
|
|
2909
2898
|
})
|
|
@@ -2932,9 +2921,9 @@ var RTableFilter = /*#__PURE__*/function (_Component6) {
|
|
|
2932
2921
|
_createClass(RTableFilter, [{
|
|
2933
2922
|
key: "render",
|
|
2934
2923
|
value: function render() {
|
|
2935
|
-
var _this$
|
|
2936
|
-
filterDictionary = _this$
|
|
2937
|
-
rtl = _this$
|
|
2924
|
+
var _this$context16 = this.context,
|
|
2925
|
+
filterDictionary = _this$context16.filterDictionary,
|
|
2926
|
+
rtl = _this$context16.rtl;
|
|
2938
2927
|
var column = this.props.column;
|
|
2939
2928
|
|
|
2940
2929
|
if (!column.filter || column.search) {
|
|
@@ -2959,6 +2948,7 @@ var RTableFilter = /*#__PURE__*/function (_Component6) {
|
|
|
2959
2948
|
}, /*#__PURE__*/_react.default.createElement(_aioButton.default, {
|
|
2960
2949
|
type: "button",
|
|
2961
2950
|
rtl: rtl,
|
|
2951
|
+
caret: false,
|
|
2962
2952
|
openRelatedTo: ".aio-table",
|
|
2963
2953
|
text: icon,
|
|
2964
2954
|
popOver: function popOver() {
|
|
@@ -2989,10 +2979,10 @@ var RTableFilterPopup = /*#__PURE__*/function (_Component7) {
|
|
|
2989
2979
|
_createClass(RTableFilterPopup, [{
|
|
2990
2980
|
key: "add",
|
|
2991
2981
|
value: function add() {
|
|
2992
|
-
var _this$
|
|
2993
|
-
filterDictionary = _this$
|
|
2994
|
-
SetState = _this$
|
|
2995
|
-
onChangeFilter = _this$
|
|
2982
|
+
var _this$context17 = this.context,
|
|
2983
|
+
filterDictionary = _this$context17.filterDictionary,
|
|
2984
|
+
SetState = _this$context17.SetState,
|
|
2985
|
+
onChangeFilter = _this$context17.onChangeFilter;
|
|
2996
2986
|
var column = this.props.column;
|
|
2997
2987
|
|
|
2998
2988
|
filterDictionary[column._index].items.push({
|
|
@@ -3011,13 +3001,13 @@ var RTableFilterPopup = /*#__PURE__*/function (_Component7) {
|
|
|
3011
3001
|
}, {
|
|
3012
3002
|
key: "render",
|
|
3013
3003
|
value: function render() {
|
|
3014
|
-
var
|
|
3004
|
+
var _this19 = this;
|
|
3015
3005
|
|
|
3016
3006
|
var column = this.props.column;
|
|
3017
|
-
var _this$
|
|
3018
|
-
filterDictionary = _this$
|
|
3019
|
-
SetState = _this$
|
|
3020
|
-
translate = _this$
|
|
3007
|
+
var _this$context18 = this.context,
|
|
3008
|
+
filterDictionary = _this$context18.filterDictionary,
|
|
3009
|
+
SetState = _this$context18.SetState,
|
|
3010
|
+
translate = _this$context18.translate;
|
|
3021
3011
|
var filters = filterDictionary[column._index].items;
|
|
3022
3012
|
var booleanType = filterDictionary[column._index].booleanType;
|
|
3023
3013
|
var filterItems = filters.map(function (filter, i) {
|
|
@@ -3048,7 +3038,7 @@ var RTableFilterPopup = /*#__PURE__*/function (_Component7) {
|
|
|
3048
3038
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
3049
3039
|
className: "aio-table-filter-add",
|
|
3050
3040
|
onClick: function onClick() {
|
|
3051
|
-
return
|
|
3041
|
+
return _this19.add();
|
|
3052
3042
|
}
|
|
3053
3043
|
}, translate('Add'))));
|
|
3054
3044
|
}
|
|
@@ -3065,26 +3055,26 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
|
|
|
3065
3055
|
var _super8 = _createSuper(RTableFilterItem);
|
|
3066
3056
|
|
|
3067
3057
|
function RTableFilterItem(props) {
|
|
3068
|
-
var
|
|
3058
|
+
var _this20;
|
|
3069
3059
|
|
|
3070
3060
|
_classCallCheck(this, RTableFilterItem);
|
|
3071
3061
|
|
|
3072
|
-
|
|
3073
|
-
var filter =
|
|
3074
|
-
|
|
3062
|
+
_this20 = _super8.call(this, props);
|
|
3063
|
+
var filter = _this20.props.filter;
|
|
3064
|
+
_this20.state = {
|
|
3075
3065
|
value: filter.value,
|
|
3076
3066
|
prevValue: filter.value
|
|
3077
3067
|
};
|
|
3078
|
-
return
|
|
3068
|
+
return _this20;
|
|
3079
3069
|
}
|
|
3080
3070
|
|
|
3081
3071
|
_createClass(RTableFilterItem, [{
|
|
3082
3072
|
key: "remove",
|
|
3083
3073
|
value: function remove(index) {
|
|
3084
|
-
var _this$
|
|
3085
|
-
filterDictionary = _this$
|
|
3086
|
-
SetState = _this$
|
|
3087
|
-
onChangeFilter = _this$
|
|
3074
|
+
var _this$context19 = this.context,
|
|
3075
|
+
filterDictionary = _this$context19.filterDictionary,
|
|
3076
|
+
SetState = _this$context19.SetState,
|
|
3077
|
+
onChangeFilter = _this$context19.onChangeFilter;
|
|
3088
3078
|
var column = this.props.column;
|
|
3089
3079
|
|
|
3090
3080
|
filterDictionary[column._index].items.splice(index, 1);
|
|
@@ -3100,7 +3090,7 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
|
|
|
3100
3090
|
}, {
|
|
3101
3091
|
key: "changeValue",
|
|
3102
3092
|
value: function changeValue(value) {
|
|
3103
|
-
var
|
|
3093
|
+
var _this21 = this;
|
|
3104
3094
|
|
|
3105
3095
|
var onChangeFilter = this.context.onChangeFilter;
|
|
3106
3096
|
clearTimeout(this.timeout);
|
|
@@ -3108,12 +3098,12 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
|
|
|
3108
3098
|
value: value
|
|
3109
3099
|
});
|
|
3110
3100
|
this.timeout = setTimeout(function () {
|
|
3111
|
-
var
|
|
3112
|
-
SetState =
|
|
3113
|
-
filterDictionary =
|
|
3114
|
-
var
|
|
3115
|
-
column =
|
|
3116
|
-
index =
|
|
3101
|
+
var _this21$context = _this21.context,
|
|
3102
|
+
SetState = _this21$context.SetState,
|
|
3103
|
+
filterDictionary = _this21$context.filterDictionary;
|
|
3104
|
+
var _this21$props = _this21.props,
|
|
3105
|
+
column = _this21$props.column,
|
|
3106
|
+
index = _this21$props.index;
|
|
3117
3107
|
filterDictionary[column._index].items[index].value = value;
|
|
3118
3108
|
|
|
3119
3109
|
if (onChangeFilter) {
|
|
@@ -3128,13 +3118,13 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
|
|
|
3128
3118
|
}, {
|
|
3129
3119
|
key: "render",
|
|
3130
3120
|
value: function render() {
|
|
3131
|
-
var
|
|
3121
|
+
var _this22 = this;
|
|
3132
3122
|
|
|
3133
|
-
var _this$
|
|
3134
|
-
filterDictionary = _this$
|
|
3135
|
-
SetState = _this$
|
|
3136
|
-
translate = _this$
|
|
3137
|
-
onChangeFilter = _this$
|
|
3123
|
+
var _this$context20 = this.context,
|
|
3124
|
+
filterDictionary = _this$context20.filterDictionary,
|
|
3125
|
+
SetState = _this$context20.SetState,
|
|
3126
|
+
translate = _this$context20.translate,
|
|
3127
|
+
onChangeFilter = _this$context20.onChangeFilter;
|
|
3138
3128
|
var _this$props14 = this.props,
|
|
3139
3129
|
filter = _this$props14.filter,
|
|
3140
3130
|
column = _this$props14.column,
|
|
@@ -3186,7 +3176,7 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
|
|
|
3186
3176
|
type: type,
|
|
3187
3177
|
value: value,
|
|
3188
3178
|
onChange: function onChange(e) {
|
|
3189
|
-
return
|
|
3179
|
+
return _this22.changeValue(e.target.value);
|
|
3190
3180
|
}
|
|
3191
3181
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
3192
3182
|
style: {
|
|
@@ -3195,7 +3185,7 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
|
|
|
3195
3185
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
3196
3186
|
className: "aio-table-filter-remove",
|
|
3197
3187
|
onClick: function onClick() {
|
|
3198
|
-
return
|
|
3188
|
+
return _this22.remove(index);
|
|
3199
3189
|
}
|
|
3200
3190
|
}, /*#__PURE__*/_react.default.createElement(_react2.Icon, {
|
|
3201
3191
|
path: _js.mdiClose,
|