@clake/react-bootstrap4-window 0.6.1 → 0.6.2
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/dist/react-bootstrap4-window.js +3 -3
- package/lib/CTable.js +115 -80
- package/lib/CTable.js.map +3 -3
- package/lib/CTableInput.js +2 -2
- package/lib/CTableInput.js.map +2 -2
- package/lib/Drag.js +2 -2
- package/lib/Drag.js.map +2 -2
- package/lib/IconButton.js +2 -2
- package/lib/IconButton.js.map +2 -2
- package/lib/PageBar.js +2 -2
- package/lib/PageBar.js.map +2 -2
- package/lib/TopMenu.js +2 -2
- package/lib/TopMenu.js.map +2 -2
- package/lib/WCalendar.js +2 -2
- package/lib/WCalendar.js.map +2 -2
- package/lib/WCombo.js +2 -2
- package/lib/WCombo.js.map +2 -2
- package/lib/WModal.js +2 -2
- package/lib/WModal.js.map +2 -2
- package/lib/Window.js +2 -2
- package/lib/Window.js.map +2 -2
- package/lib/WindowGroup.js +2 -2
- package/lib/WindowGroup.js.map +2 -2
- package/lib/css/CTable.less +7 -0
- package/lib/i18n/CTable.js +2 -2
- package/lib/i18n/CTable.js.map +2 -2
- package/lib/index.js +2 -2
- package/lib/index.js.map +2 -2
- package/package.json +1 -1
package/lib/CTable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/* @clake/react-bootstrap4-window v0.6.
|
|
1
|
+
/* @clake/react-bootstrap4-window v0.6.2 | by Clake
|
|
2
2
|
* Copyright (c) 2023 Clake,
|
|
3
|
-
* 2023-06-
|
|
3
|
+
* 2023-06-15T17:08:03+0800
|
|
4
4
|
*/
|
|
5
5
|
"use strict";
|
|
6
6
|
|
|
@@ -143,8 +143,9 @@ function (_React$Component) {
|
|
|
143
143
|
});
|
|
144
144
|
|
|
145
145
|
_defineProperty(_assertThisInitialized(_this), "editHandler", function (e, val, row) {
|
|
146
|
-
var
|
|
147
|
-
var
|
|
146
|
+
var dataset = row === 'chk' ? e.currentTarget.dataset : e.target.dataset;
|
|
147
|
+
var index = parseInt(dataset.row);
|
|
148
|
+
var field = dataset.field; //如果是check组件
|
|
148
149
|
|
|
149
150
|
if (row === 'chk') {
|
|
150
151
|
val = val ? 1 : 0;
|
|
@@ -256,7 +257,8 @@ function (_React$Component) {
|
|
|
256
257
|
this.setState({
|
|
257
258
|
data: nextProps.data,
|
|
258
259
|
dataCount: nextProps.dataCount,
|
|
259
|
-
page: nextProps.page
|
|
260
|
+
page: nextProps.page,
|
|
261
|
+
total: nextProps.total
|
|
260
262
|
});
|
|
261
263
|
}
|
|
262
264
|
}
|
|
@@ -267,6 +269,10 @@ function (_React$Component) {
|
|
|
267
269
|
return true;
|
|
268
270
|
}
|
|
269
271
|
|
|
272
|
+
if (nextState.total !== this.state.total) {
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
|
|
270
276
|
return nextState.data !== this.state.data;
|
|
271
277
|
}
|
|
272
278
|
}, {
|
|
@@ -830,8 +836,13 @@ function (_React$Component) {
|
|
|
830
836
|
}
|
|
831
837
|
}, {
|
|
832
838
|
key: "getClasses",
|
|
833
|
-
value: function getClasses() {
|
|
834
|
-
var base = 'table ck-table';
|
|
839
|
+
value: function getClasses(name) {
|
|
840
|
+
var base = 'table ck-table';
|
|
841
|
+
|
|
842
|
+
if (!!name) {
|
|
843
|
+
base = (0, _bind["default"])(base, name);
|
|
844
|
+
} //striped
|
|
845
|
+
|
|
835
846
|
|
|
836
847
|
if (this.props.striped && !this.props.edit) {
|
|
837
848
|
base = (0, _bind["default"])(base, 'table-striped');
|
|
@@ -954,14 +965,35 @@ function (_React$Component) {
|
|
|
954
965
|
var base = 'ck-ctable-body flex-grow-1 d-flex flex-column';
|
|
955
966
|
return base;
|
|
956
967
|
}
|
|
968
|
+
}, {
|
|
969
|
+
key: "calcLocalTotal",
|
|
970
|
+
value: function calcLocalTotal(field) {
|
|
971
|
+
var _this13 = this;
|
|
972
|
+
|
|
973
|
+
return function (e) {
|
|
974
|
+
var list = _this13.state.data;
|
|
975
|
+
var total = 0;
|
|
976
|
+
list.forEach(function (item) {
|
|
977
|
+
if (!!parseFloat(item[field])) {
|
|
978
|
+
total += parseFloat(item[field]);
|
|
979
|
+
}
|
|
980
|
+
});
|
|
981
|
+
var totalData = Object.assign({}, _this13.state.total);
|
|
982
|
+
totalData[field] = total.toFixed(2);
|
|
983
|
+
|
|
984
|
+
_this13.setState({
|
|
985
|
+
total: totalData
|
|
986
|
+
});
|
|
987
|
+
};
|
|
988
|
+
}
|
|
957
989
|
}, {
|
|
958
990
|
key: "render",
|
|
959
991
|
value: function render() {
|
|
960
|
-
var
|
|
992
|
+
var _this14 = this;
|
|
961
993
|
|
|
962
994
|
return _react["default"].createElement("div", {
|
|
963
995
|
ref: function ref(c) {
|
|
964
|
-
return
|
|
996
|
+
return _this14.mainDom = c;
|
|
965
997
|
},
|
|
966
998
|
className: this.getMainClasses(),
|
|
967
999
|
style: this.getStyles()
|
|
@@ -973,7 +1005,7 @@ function (_React$Component) {
|
|
|
973
1005
|
selector: "#table-body-com-".concat(this.domId)
|
|
974
1006
|
})), this.renderFoot(), _react["default"].createElement("div", {
|
|
975
1007
|
ref: function ref(c) {
|
|
976
|
-
return
|
|
1008
|
+
return _this14.split = c;
|
|
977
1009
|
},
|
|
978
1010
|
className: "ck-split d-none"
|
|
979
1011
|
}));
|
|
@@ -981,15 +1013,15 @@ function (_React$Component) {
|
|
|
981
1013
|
}, {
|
|
982
1014
|
key: "renderHeader",
|
|
983
1015
|
value: function renderHeader() {
|
|
984
|
-
var
|
|
1016
|
+
var _this15 = this;
|
|
985
1017
|
|
|
986
1018
|
return _react["default"].createElement("div", {
|
|
987
1019
|
ref: function ref(c) {
|
|
988
|
-
return
|
|
1020
|
+
return _this15.tableHeader = c;
|
|
989
1021
|
}
|
|
990
1022
|
}, _react["default"].createElement("table", {
|
|
991
1023
|
ref: function ref(c) {
|
|
992
|
-
return
|
|
1024
|
+
return _this15.table_head = c;
|
|
993
1025
|
},
|
|
994
1026
|
id: "table-head-".concat(this.domId),
|
|
995
1027
|
className: this.getClasses(),
|
|
@@ -1005,11 +1037,11 @@ function (_React$Component) {
|
|
|
1005
1037
|
icon: "list"
|
|
1006
1038
|
}) : _react["default"].createElement(_reactBootstrap.CCheckbox, {
|
|
1007
1039
|
ref: function ref(c) {
|
|
1008
|
-
return
|
|
1040
|
+
return _this15.allchk = c;
|
|
1009
1041
|
},
|
|
1010
1042
|
onChange: this.selectAll
|
|
1011
1043
|
})) : null, _react["default"].Children.map(this.props.children, function (item, key) {
|
|
1012
|
-
|
|
1044
|
+
_this15.cacheRow[item.props.field] = '';
|
|
1013
1045
|
|
|
1014
1046
|
if (!item || item.props.hide) {
|
|
1015
1047
|
return null;
|
|
@@ -1026,28 +1058,28 @@ function (_React$Component) {
|
|
|
1026
1058
|
|
|
1027
1059
|
var sort_icon = '';
|
|
1028
1060
|
|
|
1029
|
-
if (
|
|
1030
|
-
sort_icon = 'sort-alpha-' + (
|
|
1061
|
+
if (_this15.sortList[item.props.field]) {
|
|
1062
|
+
sort_icon = 'sort-alpha-' + (_this15.sortList[item.props.field] === 'asc' ? 'down' : 'up');
|
|
1031
1063
|
}
|
|
1032
1064
|
|
|
1033
1065
|
return _react["default"].createElement("th", {
|
|
1034
|
-
onContextMenu:
|
|
1035
|
-
id:
|
|
1066
|
+
onContextMenu: _this15.menuContextHandler,
|
|
1067
|
+
id: _this15.domId + '-' + key,
|
|
1036
1068
|
"data-key": 'head_' + key,
|
|
1037
1069
|
style: style
|
|
1038
|
-
},
|
|
1070
|
+
}, _this15.is_sort ? _react["default"].createElement("a", {
|
|
1039
1071
|
className: "ck-ctable-sort",
|
|
1040
1072
|
href: "javascript://",
|
|
1041
|
-
id: "".concat(
|
|
1073
|
+
id: "".concat(_this15.domId, "-sort-").concat(item.props.field),
|
|
1042
1074
|
"data-field": item.props.field,
|
|
1043
|
-
onClick:
|
|
1075
|
+
onClick: _this15.sortHandler
|
|
1044
1076
|
}, item.props.text, " ", _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1045
1077
|
icon: sort_icon
|
|
1046
|
-
})) : item.props.text,
|
|
1078
|
+
})) : item.props.text, _this15.props.move ? _react["default"].createElement("span", {
|
|
1047
1079
|
ref: function ref(c) {
|
|
1048
|
-
return
|
|
1080
|
+
return _this15.headerSplits.push(c);
|
|
1049
1081
|
},
|
|
1050
|
-
"data-key":
|
|
1082
|
+
"data-key": _this15.domId + '-' + key,
|
|
1051
1083
|
className: "ck-column-split"
|
|
1052
1084
|
}) : null);
|
|
1053
1085
|
})))));
|
|
@@ -1055,34 +1087,34 @@ function (_React$Component) {
|
|
|
1055
1087
|
}, {
|
|
1056
1088
|
key: "renderRows",
|
|
1057
1089
|
value: function renderRows() {
|
|
1058
|
-
var
|
|
1090
|
+
var _this16 = this;
|
|
1059
1091
|
|
|
1060
1092
|
return _react["default"].createElement("div", {
|
|
1061
1093
|
ref: function ref(c) {
|
|
1062
|
-
return
|
|
1094
|
+
return _this16.table_rows = c;
|
|
1063
1095
|
},
|
|
1064
1096
|
id: "table-body-com-".concat(this.domId),
|
|
1065
1097
|
className: "flex-grow-1 rows",
|
|
1066
1098
|
onScroll: this.scrollHandler
|
|
1067
1099
|
}, _react["default"].createElement("table", {
|
|
1068
1100
|
ref: function ref(c) {
|
|
1069
|
-
return
|
|
1101
|
+
return _this16.table_body = c;
|
|
1070
1102
|
},
|
|
1071
1103
|
id: "table-body-".concat(this.domId),
|
|
1072
1104
|
className: this.getClasses(),
|
|
1073
1105
|
style: this.getTableStyles()
|
|
1074
1106
|
}, _react["default"].createElement("tbody", null, this.state.data.map(function (row, i) {
|
|
1075
|
-
if (
|
|
1076
|
-
return
|
|
1107
|
+
if (_this16.props.edit) {
|
|
1108
|
+
return _this16.renderEditRow(row, i);
|
|
1077
1109
|
}
|
|
1078
1110
|
|
|
1079
|
-
return
|
|
1111
|
+
return _this16.renderRow(row, i);
|
|
1080
1112
|
}), this.props.edit ? this.renderEditAddRow() : null)), this.props.menu ? this.renderMenu() : null, this.props.menu ? this.renderNumberMenu() : null);
|
|
1081
1113
|
}
|
|
1082
1114
|
}, {
|
|
1083
1115
|
key: "renderRow",
|
|
1084
1116
|
value: function renderRow(row, i, parentRow) {
|
|
1085
|
-
var
|
|
1117
|
+
var _this17 = this;
|
|
1086
1118
|
|
|
1087
1119
|
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement("tr", {
|
|
1088
1120
|
className: this.props.onClick ? 'click-row' : null,
|
|
@@ -1101,9 +1133,9 @@ function (_React$Component) {
|
|
|
1101
1133
|
} //set style
|
|
1102
1134
|
|
|
1103
1135
|
|
|
1104
|
-
var style = _objectSpread({},
|
|
1136
|
+
var style = _objectSpread({}, _this17.props.columnStyle);
|
|
1105
1137
|
|
|
1106
|
-
style.textAlign = item.props.align ||
|
|
1138
|
+
style.textAlign = item.props.align || _this17.props.align;
|
|
1107
1139
|
|
|
1108
1140
|
if (item.props.width) {
|
|
1109
1141
|
style.width = item.props.width;
|
|
@@ -1126,8 +1158,8 @@ function (_React$Component) {
|
|
|
1126
1158
|
|
|
1127
1159
|
if (item.props.children) {
|
|
1128
1160
|
return _react["default"].createElement("td", {
|
|
1129
|
-
onContextMenu:
|
|
1130
|
-
id:
|
|
1161
|
+
onContextMenu: _this17.menuContextHandler(dataType),
|
|
1162
|
+
id: _this17.domId + '-' + key,
|
|
1131
1163
|
"data-row": "".concat(i),
|
|
1132
1164
|
"data-field": item.props.field,
|
|
1133
1165
|
className: item.props.className,
|
|
@@ -1146,8 +1178,8 @@ function (_React$Component) {
|
|
|
1146
1178
|
}
|
|
1147
1179
|
|
|
1148
1180
|
return _react["default"].createElement("td", {
|
|
1149
|
-
onContextMenu:
|
|
1150
|
-
id:
|
|
1181
|
+
onContextMenu: _this17.menuContextHandler(dataType),
|
|
1182
|
+
id: _this17.domId + '-' + key,
|
|
1151
1183
|
"data-field": item.props.field,
|
|
1152
1184
|
style: style,
|
|
1153
1185
|
onClick: function onClick(e) {
|
|
@@ -1161,14 +1193,14 @@ function (_React$Component) {
|
|
|
1161
1193
|
}
|
|
1162
1194
|
},
|
|
1163
1195
|
"data-row": "".concat(i)
|
|
1164
|
-
}, item.props.type ?
|
|
1196
|
+
}, item.props.type ? _this17.renderEditComponent(item.props, row, i) : item.props.onFormat ? item.props.onFormat(row[item.props.field], row, item.props.field) : row[item.props.field]);
|
|
1165
1197
|
}
|
|
1166
1198
|
})));
|
|
1167
1199
|
}
|
|
1168
1200
|
}, {
|
|
1169
1201
|
key: "renderEditRow",
|
|
1170
1202
|
value: function renderEditRow(row, i) {
|
|
1171
|
-
var
|
|
1203
|
+
var _this18 = this;
|
|
1172
1204
|
|
|
1173
1205
|
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement("tr", {
|
|
1174
1206
|
className: this.props.onClick ? 'click-row' : null,
|
|
@@ -1188,9 +1220,9 @@ function (_React$Component) {
|
|
|
1188
1220
|
} //set style
|
|
1189
1221
|
|
|
1190
1222
|
|
|
1191
|
-
var style = _objectSpread({},
|
|
1223
|
+
var style = _objectSpread({}, _this18.props.columnStyle);
|
|
1192
1224
|
|
|
1193
|
-
style.textAlign = item.props.align ||
|
|
1225
|
+
style.textAlign = item.props.align || _this18.props.align;
|
|
1194
1226
|
|
|
1195
1227
|
if (item.props.width) {
|
|
1196
1228
|
style.width = item.props.width;
|
|
@@ -1198,9 +1230,9 @@ function (_React$Component) {
|
|
|
1198
1230
|
|
|
1199
1231
|
var dataType = 'text';
|
|
1200
1232
|
return _react["default"].createElement("td", {
|
|
1201
|
-
onContextMenu:
|
|
1233
|
+
onContextMenu: _this18.menuContextHandler(dataType),
|
|
1202
1234
|
className: item.props.disabled ? 'disabled' : '',
|
|
1203
|
-
id:
|
|
1235
|
+
id: _this18.domId + '-' + key,
|
|
1204
1236
|
"data-field": item.props.field,
|
|
1205
1237
|
style: style,
|
|
1206
1238
|
onClick: function onClick(e) {
|
|
@@ -1214,13 +1246,13 @@ function (_React$Component) {
|
|
|
1214
1246
|
}
|
|
1215
1247
|
},
|
|
1216
1248
|
"data-row": "".concat(i)
|
|
1217
|
-
}, item.props.disabled ? item.props.onFormat ? item.props.onFormat(row[item.props.field], row, item.props.field) : row[item.props.field] :
|
|
1249
|
+
}, item.props.disabled ? item.props.onFormat ? item.props.onFormat(row[item.props.field], row, item.props.field) : row[item.props.field] : _this18.renderEditComponent(item.props, row, i));
|
|
1218
1250
|
})));
|
|
1219
1251
|
}
|
|
1220
1252
|
}, {
|
|
1221
1253
|
key: "renderEditAddRow",
|
|
1222
1254
|
value: function renderEditAddRow() {
|
|
1223
|
-
var
|
|
1255
|
+
var _this19 = this;
|
|
1224
1256
|
|
|
1225
1257
|
return _react["default"].createElement("tr", {
|
|
1226
1258
|
id: this.domId + '-edit'
|
|
@@ -1242,14 +1274,14 @@ function (_React$Component) {
|
|
|
1242
1274
|
return _react["default"].createElement("td", {
|
|
1243
1275
|
style: style
|
|
1244
1276
|
}, _react["default"].createElement(_CTableInput["default"], {
|
|
1245
|
-
onFocus:
|
|
1277
|
+
onFocus: _this19.addNewHandler
|
|
1246
1278
|
}));
|
|
1247
1279
|
}));
|
|
1248
1280
|
}
|
|
1249
1281
|
}, {
|
|
1250
1282
|
key: "renderEditComponent",
|
|
1251
1283
|
value: function renderEditComponent(item, row, i) {
|
|
1252
|
-
var
|
|
1284
|
+
var _this20 = this;
|
|
1253
1285
|
|
|
1254
1286
|
switch (item.type) {
|
|
1255
1287
|
case "combo":
|
|
@@ -1280,7 +1312,7 @@ function (_React$Component) {
|
|
|
1280
1312
|
return _react["default"].createElement(_reactBootstrap.CCheckbox, {
|
|
1281
1313
|
width: "20px",
|
|
1282
1314
|
onChange: function onChange(chk, e) {
|
|
1283
|
-
|
|
1315
|
+
_this20.editHandler(e, chk, 'chk');
|
|
1284
1316
|
},
|
|
1285
1317
|
"data-row": i,
|
|
1286
1318
|
"data-field": item.field,
|
|
@@ -1295,7 +1327,8 @@ function (_React$Component) {
|
|
|
1295
1327
|
"data-field": item.field,
|
|
1296
1328
|
data: row[item.field],
|
|
1297
1329
|
align: item.align,
|
|
1298
|
-
disabled: item.disabled
|
|
1330
|
+
disabled: item.disabled,
|
|
1331
|
+
onBlur: this.state.total && this.state.total.hasOwnProperty(item.field) ? this.calcLocalTotal(item.field) : null
|
|
1299
1332
|
});
|
|
1300
1333
|
}
|
|
1301
1334
|
}
|
|
@@ -1318,7 +1351,7 @@ function (_React$Component) {
|
|
|
1318
1351
|
}, {
|
|
1319
1352
|
key: "renderTotal",
|
|
1320
1353
|
value: function renderTotal() {
|
|
1321
|
-
var
|
|
1354
|
+
var _this21 = this;
|
|
1322
1355
|
|
|
1323
1356
|
if (!this.state.total) {
|
|
1324
1357
|
return null;
|
|
@@ -1327,11 +1360,12 @@ function (_React$Component) {
|
|
|
1327
1360
|
var total = this.state.total;
|
|
1328
1361
|
return _react["default"].createElement("div", {
|
|
1329
1362
|
ref: function ref(c) {
|
|
1330
|
-
return
|
|
1331
|
-
}
|
|
1363
|
+
return _this21.tableTotal = c;
|
|
1364
|
+
},
|
|
1365
|
+
className: "ck-ctable-total"
|
|
1332
1366
|
}, _react["default"].createElement("table", {
|
|
1333
1367
|
ref: function ref(c) {
|
|
1334
|
-
return
|
|
1368
|
+
return _this21.table_total = c;
|
|
1335
1369
|
},
|
|
1336
1370
|
id: "table-total-".concat(this.domId),
|
|
1337
1371
|
className: this.getClasses(),
|
|
@@ -1345,7 +1379,7 @@ function (_React$Component) {
|
|
|
1345
1379
|
return null;
|
|
1346
1380
|
}
|
|
1347
1381
|
|
|
1348
|
-
var align = item.props.align ||
|
|
1382
|
+
var align = item.props.align || _this21.props.align;
|
|
1349
1383
|
var style = {
|
|
1350
1384
|
'textAlign': align
|
|
1351
1385
|
};
|
|
@@ -1355,7 +1389,7 @@ function (_React$Component) {
|
|
|
1355
1389
|
}
|
|
1356
1390
|
|
|
1357
1391
|
return _react["default"].createElement("td", {
|
|
1358
|
-
id:
|
|
1392
|
+
id: _this21.domId + '-' + key,
|
|
1359
1393
|
"data-field": item.props.field,
|
|
1360
1394
|
style: style
|
|
1361
1395
|
}, item.props.onFormat ? item.props.onFormat(total[item.props.field], total, item.props.field) : total[item.props.field]);
|
|
@@ -1364,7 +1398,7 @@ function (_React$Component) {
|
|
|
1364
1398
|
}, {
|
|
1365
1399
|
key: "renderMenu",
|
|
1366
1400
|
value: function renderMenu() {
|
|
1367
|
-
var
|
|
1401
|
+
var _this22 = this;
|
|
1368
1402
|
|
|
1369
1403
|
var lang = this.props.lang;
|
|
1370
1404
|
|
|
@@ -1377,7 +1411,7 @@ function (_React$Component) {
|
|
|
1377
1411
|
|
|
1378
1412
|
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_reactBootstrap.Menu, {
|
|
1379
1413
|
ref: function ref(c) {
|
|
1380
|
-
return
|
|
1414
|
+
return _this22.mainMenu = c;
|
|
1381
1415
|
},
|
|
1382
1416
|
onClick: this.menuClickHandler
|
|
1383
1417
|
}, _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
@@ -1395,7 +1429,7 @@ function (_React$Component) {
|
|
|
1395
1429
|
onClick: function onClick(e, field, data) {
|
|
1396
1430
|
var select = document.getSelection();
|
|
1397
1431
|
|
|
1398
|
-
|
|
1432
|
+
_this22.filterHandler(select.toString(), data.field, 'contain');
|
|
1399
1433
|
}
|
|
1400
1434
|
}, _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1401
1435
|
className: "mr-1",
|
|
@@ -1405,7 +1439,7 @@ function (_React$Component) {
|
|
|
1405
1439
|
onClick: function onClick(e, field, data) {
|
|
1406
1440
|
var select = document.getSelection();
|
|
1407
1441
|
|
|
1408
|
-
|
|
1442
|
+
_this22.filterHandler(select.toString(), data.field, 'exclude');
|
|
1409
1443
|
}
|
|
1410
1444
|
}, _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1411
1445
|
className: "mr-1",
|
|
@@ -1413,7 +1447,7 @@ function (_React$Component) {
|
|
|
1413
1447
|
}), lang['Filter Excluding Selection']) : null, this.is_filter || this.is_sort ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1414
1448
|
field: "clear_filter",
|
|
1415
1449
|
onClick: function onClick() {
|
|
1416
|
-
|
|
1450
|
+
_this22.clearFilter();
|
|
1417
1451
|
}
|
|
1418
1452
|
}, _react["default"].createElement("span", {
|
|
1419
1453
|
className: "text-danger"
|
|
@@ -1435,13 +1469,13 @@ function (_React$Component) {
|
|
|
1435
1469
|
onChange: this.filterChangeHandler('equal'),
|
|
1436
1470
|
onMouseDown: stopEvent,
|
|
1437
1471
|
onEnter: function onEnter() {
|
|
1438
|
-
|
|
1472
|
+
_this22.filterHandler(_this22.state.filter.equal, _this22.mainMenu.data.field, 'equal');
|
|
1439
1473
|
}
|
|
1440
1474
|
}), _react["default"].createElement(_reactBootstrap.Button, {
|
|
1441
1475
|
size: "xs",
|
|
1442
1476
|
onMouseDown: stopEvent,
|
|
1443
1477
|
onClick: function onClick(e) {
|
|
1444
|
-
|
|
1478
|
+
_this22.filterHandler(_this22.state.filter.equal, _this22.mainMenu.data.field, 'equal');
|
|
1445
1479
|
},
|
|
1446
1480
|
icon: "search"
|
|
1447
1481
|
})) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
@@ -1457,13 +1491,13 @@ function (_React$Component) {
|
|
|
1457
1491
|
onChange: this.filterChangeHandler('start'),
|
|
1458
1492
|
onMouseDown: stopEvent,
|
|
1459
1493
|
onEnter: function onEnter() {
|
|
1460
|
-
|
|
1494
|
+
_this22.filterHandler(_this22.state.filter.start, _this22.mainMenu.data.field, 'start');
|
|
1461
1495
|
}
|
|
1462
1496
|
}), _react["default"].createElement(_reactBootstrap.Button, {
|
|
1463
1497
|
size: "xs",
|
|
1464
1498
|
onMouseDown: stopEvent,
|
|
1465
1499
|
onClick: function onClick(e) {
|
|
1466
|
-
|
|
1500
|
+
_this22.filterHandler(_this22.state.filter.start, _this22.mainMenu.data.field, 'start');
|
|
1467
1501
|
},
|
|
1468
1502
|
icon: "search"
|
|
1469
1503
|
})) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
@@ -1479,13 +1513,13 @@ function (_React$Component) {
|
|
|
1479
1513
|
onChange: this.filterChangeHandler('end'),
|
|
1480
1514
|
onMouseDown: stopEvent,
|
|
1481
1515
|
onEnter: function onEnter() {
|
|
1482
|
-
|
|
1516
|
+
_this22.filterHandler(_this22.state.filter.end, _this22.mainMenu.data.field, 'end');
|
|
1483
1517
|
}
|
|
1484
1518
|
}), _react["default"].createElement(_reactBootstrap.Button, {
|
|
1485
1519
|
size: "xs",
|
|
1486
1520
|
onMouseDown: stopEvent,
|
|
1487
1521
|
onClick: function onClick(e) {
|
|
1488
|
-
|
|
1522
|
+
_this22.filterHandler(_this22.state.filter.end, _this22.mainMenu.data.field, 'end');
|
|
1489
1523
|
},
|
|
1490
1524
|
icon: "search"
|
|
1491
1525
|
})) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
@@ -1501,13 +1535,13 @@ function (_React$Component) {
|
|
|
1501
1535
|
onChange: this.filterChangeHandler('contain'),
|
|
1502
1536
|
onMouseDown: stopEvent,
|
|
1503
1537
|
onEnter: function onEnter() {
|
|
1504
|
-
|
|
1538
|
+
_this22.filterHandler(_this22.state.filter.contain, _this22.mainMenu.data.field, 'contain');
|
|
1505
1539
|
}
|
|
1506
1540
|
}), _react["default"].createElement(_reactBootstrap.Button, {
|
|
1507
1541
|
size: "xs",
|
|
1508
1542
|
onMouseDown: stopEvent,
|
|
1509
1543
|
onClick: function onClick(e) {
|
|
1510
|
-
|
|
1544
|
+
_this22.filterHandler(_this22.state.filter.contain, _this22.mainMenu.data.field, 'contain');
|
|
1511
1545
|
},
|
|
1512
1546
|
icon: "search"
|
|
1513
1547
|
})) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
@@ -1524,7 +1558,7 @@ function (_React$Component) {
|
|
|
1524
1558
|
onChange: this.filterChangeHandler('condition'),
|
|
1525
1559
|
onMouseDown: stopEvent,
|
|
1526
1560
|
onEnter: function onEnter() {
|
|
1527
|
-
|
|
1561
|
+
_this22.filterHandler(_this22.state.filter.condition, _this22.mainMenu.data.field, 'condition');
|
|
1528
1562
|
}
|
|
1529
1563
|
})) : null, this.props.edit ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1530
1564
|
step: true
|
|
@@ -1535,13 +1569,13 @@ function (_React$Component) {
|
|
|
1535
1569
|
}, lang['Clone Row']) : null, this.props.customMenu ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1536
1570
|
step: true
|
|
1537
1571
|
}) : null, this.props.customMenu ? this.props.customMenu.map(function (menu) {
|
|
1538
|
-
return
|
|
1572
|
+
return _this22.explainCustomMenu(menu);
|
|
1539
1573
|
}) : null));
|
|
1540
1574
|
}
|
|
1541
1575
|
}, {
|
|
1542
1576
|
key: "renderNumberMenu",
|
|
1543
1577
|
value: function renderNumberMenu() {
|
|
1544
|
-
var
|
|
1578
|
+
var _this23 = this;
|
|
1545
1579
|
|
|
1546
1580
|
var lang = this.props.lang;
|
|
1547
1581
|
|
|
@@ -1554,7 +1588,7 @@ function (_React$Component) {
|
|
|
1554
1588
|
|
|
1555
1589
|
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_reactBootstrap.Menu, {
|
|
1556
1590
|
ref: function ref(c) {
|
|
1557
|
-
return
|
|
1591
|
+
return _this23.numMenu = c;
|
|
1558
1592
|
},
|
|
1559
1593
|
onClick: this.menuClickHandler
|
|
1560
1594
|
}, _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
@@ -1572,7 +1606,7 @@ function (_React$Component) {
|
|
|
1572
1606
|
onClick: function onClick(e, field, data) {
|
|
1573
1607
|
var select = document.getSelection();
|
|
1574
1608
|
|
|
1575
|
-
|
|
1609
|
+
_this23.filterHandler(select.toString(), data.field, 'contain');
|
|
1576
1610
|
}
|
|
1577
1611
|
}, _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1578
1612
|
className: "mr-1",
|
|
@@ -1582,7 +1616,7 @@ function (_React$Component) {
|
|
|
1582
1616
|
onClick: function onClick(e, field, data) {
|
|
1583
1617
|
var select = document.getSelection();
|
|
1584
1618
|
|
|
1585
|
-
|
|
1619
|
+
_this23.filterHandler(select.toString(), data.field, 'exclude');
|
|
1586
1620
|
}
|
|
1587
1621
|
}, _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1588
1622
|
className: "mr-1",
|
|
@@ -1590,7 +1624,7 @@ function (_React$Component) {
|
|
|
1590
1624
|
}), lang['Filter Excluding Selection']) : null, this.is_filter || this.is_sort ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1591
1625
|
field: "clear_filter",
|
|
1592
1626
|
onClick: function onClick() {
|
|
1593
|
-
|
|
1627
|
+
_this23.clearFilter();
|
|
1594
1628
|
}
|
|
1595
1629
|
}, _react["default"].createElement("span", {
|
|
1596
1630
|
className: "text-danger"
|
|
@@ -1611,14 +1645,14 @@ function (_React$Component) {
|
|
|
1611
1645
|
onChange: this.filterChangeHandler('condition'),
|
|
1612
1646
|
onMouseDown: stopEvent,
|
|
1613
1647
|
onEnter: function onEnter() {
|
|
1614
|
-
|
|
1648
|
+
_this23.filterHandler(_this23.state.filter.condition, _this23.numMenu.data.field, 'condition');
|
|
1615
1649
|
}
|
|
1616
1650
|
}), _react["default"].createElement("div", null, "and,or,between,>,>=,<,<=,=")) : null));
|
|
1617
1651
|
}
|
|
1618
1652
|
}, {
|
|
1619
1653
|
key: "explainCustomMenu",
|
|
1620
1654
|
value: function explainCustomMenu(menu) {
|
|
1621
|
-
var
|
|
1655
|
+
var _this24 = this;
|
|
1622
1656
|
|
|
1623
1657
|
if (menu.children && menu.children instanceof Array) {
|
|
1624
1658
|
return _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
@@ -1626,7 +1660,7 @@ function (_React$Component) {
|
|
|
1626
1660
|
text: menu.text,
|
|
1627
1661
|
child: true
|
|
1628
1662
|
}, menu.children.map(function (item) {
|
|
1629
|
-
return
|
|
1663
|
+
return _this24.explainCustomMenu(item);
|
|
1630
1664
|
}));
|
|
1631
1665
|
} else {
|
|
1632
1666
|
return _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
@@ -1763,7 +1797,8 @@ CTable.defaultProps = {
|
|
|
1763
1797
|
menu: true,
|
|
1764
1798
|
showNumbers: 30,
|
|
1765
1799
|
showPages: 10,
|
|
1766
|
-
source: null
|
|
1800
|
+
source: null,
|
|
1801
|
+
total: null
|
|
1767
1802
|
};
|
|
1768
1803
|
var _default = CTable;
|
|
1769
1804
|
exports["default"] = _default;
|