@clake/react-bootstrap4-window 1.1.6 → 1.1.8

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/lib/CTable.js CHANGED
@@ -1,6 +1,6 @@
1
- /* @clake/react-bootstrap4-window v1.1.6 | by Clake
1
+ /* @clake/react-bootstrap4-window v1.1.8 | by Clake
2
2
  * Copyright (c) 2024 Clake,
3
- * 2024-12-09T15:26:37+0800
3
+ * 2024-12-09T17:54:50+0800
4
4
  */
5
5
  "use strict";
6
6
 
@@ -387,6 +387,33 @@ function (_React$Component) {
387
387
  value: function componentDidMount() {
388
388
  this.bindSplit();
389
389
  }
390
+ }, {
391
+ key: "componentDidUpdate",
392
+ value: function componentDidUpdate(prevProps, prevState, snapshot) {
393
+ var _this2 = this;
394
+
395
+ if (this.table_head) {
396
+ this.table_body.style.width = this.width;
397
+ var list = this.table_head.querySelectorAll('th');
398
+ list.forEach(function (item) {
399
+ if (!item.id) return;
400
+
401
+ var td = _this2.table_body.querySelector("#".concat(item.id));
402
+
403
+ if (td) {
404
+ td.style.width = item.style.width;
405
+ }
406
+
407
+ if (_this2.table_total) {
408
+ var _td = _this2.table_total.querySelector("#".concat(item.id));
409
+
410
+ if (_td) {
411
+ _td.style.width = item.style.width;
412
+ }
413
+ }
414
+ });
415
+ }
416
+ }
390
417
  }, {
391
418
  key: "UNSAFE_componentWillReceiveProps",
392
419
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
@@ -468,7 +495,7 @@ function (_React$Component) {
468
495
  }, {
469
496
  key: "initTableWidth",
470
497
  value: function initTableWidth() {
471
- var _this2 = this;
498
+ var _this3 = this;
472
499
 
473
500
  if (this.props.width) {
474
501
  var width = 0;
@@ -481,10 +508,10 @@ function (_React$Component) {
481
508
  var _matchs = item.props.width.match(reg);
482
509
 
483
510
  width += parseInt(_matchs[1]);
484
- _this2.headers[item.props.field] = item.props;
511
+ _this3.headers[item.props.field] = item.props;
485
512
 
486
513
  if (item.props.noClone) {
487
- _this2.noClone[item.props.field] = "";
514
+ _this3.noClone[item.props.field] = "";
488
515
  }
489
516
  }
490
517
  });
@@ -500,7 +527,7 @@ function (_React$Component) {
500
527
  }, {
501
528
  key: "sourceLoad",
502
529
  value: function sourceLoad() {
503
- var _this3 = this;
530
+ var _this4 = this;
504
531
 
505
532
  if (typeof this.props.sourceFunc !== 'function') return;
506
533
  this.props.sourceFunc({
@@ -508,7 +535,7 @@ function (_React$Component) {
508
535
  page: this.state.page,
509
536
  number: this.props.showNumbers
510
537
  }, function (res) {
511
- _this3.setState({
538
+ _this4.setState({
512
539
  data: res.data,
513
540
  dataCount: res.count,
514
541
  page: res.page
@@ -562,24 +589,24 @@ function (_React$Component) {
562
589
  }, {
563
590
  key: "changeHandler",
564
591
  value: function changeHandler(row, i) {
565
- var _this4 = this;
592
+ var _this5 = this;
566
593
 
567
594
  return function (checked, e) {
568
- var selectRows = _this4.setRowCheck(checked, i);
595
+ var selectRows = _this5.setRowCheck(checked, i);
569
596
 
570
- var _this4$checkAllCheckH = _this4.checkAllCheckHalf(selectRows),
571
- _this4$checkAllCheckH2 = _slicedToArray(_this4$checkAllCheckH, 2),
572
- allChecked = _this4$checkAllCheckH2[0],
573
- half = _this4$checkAllCheckH2[1];
597
+ var _this5$checkAllCheckH = _this5.checkAllCheckHalf(selectRows),
598
+ _this5$checkAllCheckH2 = _slicedToArray(_this5$checkAllCheckH, 2),
599
+ allChecked = _this5$checkAllCheckH2[0],
600
+ half = _this5$checkAllCheckH2[1];
574
601
 
575
- _this4.setState({
602
+ _this5.setState({
576
603
  selectRows: selectRows,
577
604
  selectAll: allChecked,
578
605
  selectHalf: half
579
606
  });
580
607
 
581
- if (typeof _this4.props.onCheck === "function") {
582
- _this4.props.onCheck(checked, row, _this4.props.jsxId);
608
+ if (typeof _this5.props.onCheck === "function") {
609
+ _this5.props.onCheck(checked, row, _this5.props.jsxId);
583
610
  }
584
611
  };
585
612
  }
@@ -622,24 +649,24 @@ function (_React$Component) {
622
649
  }, {
623
650
  key: "clickHandler",
624
651
  value: function clickHandler(row, i) {
625
- var _this5 = this;
652
+ var _this6 = this;
626
653
 
627
654
  return function () {
628
- if (typeof _this5.props.onClick === 'function') {
629
- _this5.props.onClick(row, i, _this5.props.jsxId);
655
+ if (typeof _this6.props.onClick === 'function') {
656
+ _this6.props.onClick(row, i, _this6.props.jsxId);
630
657
  }
631
658
 
632
- if (_this5.props.select && _this5.props.rowCheck) {
633
- var _row = _this5.refs['row_' + i];
659
+ if (_this6.props.select && _this6.props.rowCheck) {
660
+ var _row = _this6.refs['row_' + i];
634
661
 
635
662
  _row.changeHandler(null); // this.setRowCheck(!row.getChecked(),i);
636
663
  // this.checkAllCheckHalf();
637
664
 
638
665
  }
639
666
 
640
- if (_this5.props.focus) {
641
- _this5.setState({
642
- focus: i === _this5.state.focus ? -1 : i
667
+ if (_this6.props.focus) {
668
+ _this6.setState({
669
+ focus: i === _this6.state.focus ? -1 : i
643
670
  });
644
671
  }
645
672
  };
@@ -727,25 +754,25 @@ function (_React$Component) {
727
754
  * @param dataType
728
755
  */
729
756
  value: function menuContextHandler(dataType) {
730
- var _this6 = this;
757
+ var _this7 = this;
731
758
 
732
759
  return function (e) {
733
760
  e.preventDefault();
734
761
  e.stopPropagation();
735
762
  var data = {
736
763
  field: e.currentTarget.dataset.field || '',
737
- data: _this6.state.data[e.currentTarget.dataset.row],
764
+ data: _this7.state.data[e.currentTarget.dataset.row],
738
765
  index: e.currentTarget.dataset.row
739
766
  };
740
767
 
741
768
  if (dataType === "text") {
742
- _this6.mainMenu.show({
769
+ _this7.mainMenu.show({
743
770
  evt: e,
744
771
  type: 'mouse',
745
772
  data: data
746
773
  });
747
774
  } else {
748
- _this6.numMenu.show({
775
+ _this7.numMenu.show({
749
776
  evt: e,
750
777
  type: 'mouse',
751
778
  data: data
@@ -849,14 +876,14 @@ function (_React$Component) {
849
876
  }, {
850
877
  key: "filterChangeHandler",
851
878
  value: function filterChangeHandler(field) {
852
- var _this7 = this;
879
+ var _this8 = this;
853
880
 
854
881
  return function (val) {
855
- var filter = _objectSpread({}, _this7.state.filter);
882
+ var filter = _objectSpread({}, _this8.state.filter);
856
883
 
857
884
  filter[field] = val;
858
885
 
859
- _this7.setState({
886
+ _this8.setState({
860
887
  filter: filter
861
888
  });
862
889
  };
@@ -924,7 +951,7 @@ function (_React$Component) {
924
951
  }, {
925
952
  key: "deleteRow",
926
953
  value: function deleteRow(row_index) {
927
- var _this8 = this;
954
+ var _this9 = this;
928
955
 
929
956
  if (row_index < 0 || row_index >= this.state.data.length) {
930
957
  return;
@@ -939,7 +966,7 @@ function (_React$Component) {
939
966
 
940
967
  this.editRows.forEach(function (item, index) {
941
968
  if (item > row_index) {
942
- _this8.editRows[index] = item - 1;
969
+ _this9.editRows[index] = item - 1;
943
970
  }
944
971
  });
945
972
  this.setState({
@@ -972,10 +999,10 @@ function (_React$Component) {
972
999
  * 得到所有选中的行
973
1000
  */
974
1001
  value: function getSelectRows() {
975
- var _this9 = this;
1002
+ var _this10 = this;
976
1003
 
977
1004
  return this.state.selectRows.map(function (item) {
978
- return _this9.state.data[item];
1005
+ return _this10.state.data[item];
979
1006
  });
980
1007
  }
981
1008
  /**
@@ -1005,50 +1032,50 @@ function (_React$Component) {
1005
1032
  }, {
1006
1033
  key: "bindSplit",
1007
1034
  value: function bindSplit() {
1008
- var _this10 = this;
1035
+ var _this11 = this;
1009
1036
 
1010
1037
  if (this.props.move) {
1011
1038
  this.headerSplits.forEach(function (split) {
1012
- if (!_this10.drag) {
1013
- _this10.dragColumnLeft = 0;
1014
- _this10.dragWidth = 0;
1015
- _this10.drag = new _Drag["default"](_this10.split, split, {
1039
+ if (!_this11.drag) {
1040
+ _this11.dragColumnLeft = 0;
1041
+ _this11.dragWidth = 0;
1042
+ _this11.drag = new _Drag["default"](_this11.split, split, {
1016
1043
  start: function start(dragDom, eventDom) {
1017
- var xy = _reactBootstrap.Common.GetDomXY(eventDom, _this10.mainDom);
1044
+ var xy = _reactBootstrap.Common.GetDomXY(eventDom, _this11.mainDom);
1018
1045
 
1019
- _this10.dragWidth = parseInt((eventDom === null || eventDom === void 0 ? void 0 : eventDom.parentNode).style.width);
1020
- _this10.dragColumnLeft = xy.left - _this10.table_rows.scrollLeft;
1021
- dragDom.style.left = _this10.dragColumnLeft + 'px';
1046
+ _this11.dragWidth = parseInt((eventDom === null || eventDom === void 0 ? void 0 : eventDom.parentNode).style.width);
1047
+ _this11.dragColumnLeft = xy.left - _this11.table_rows.scrollLeft;
1048
+ dragDom.style.left = _this11.dragColumnLeft + 'px';
1022
1049
  dragDom.classList.remove('d-none');
1023
1050
  return true;
1024
1051
  },
1025
1052
  move: function move(_move, dragDom, eventDom) {
1026
- if (_this10.dragWidth + (_move.x - _this10.dragColumnLeft) < 50) {
1027
- _move.x = _this10.dragColumnLeft - _this10.dragWidth + 50;
1053
+ if (_this11.dragWidth + (_move.x - _this11.dragColumnLeft) < 50) {
1054
+ _move.x = _this11.dragColumnLeft - _this11.dragWidth + 50;
1028
1055
  }
1029
1056
  },
1030
1057
  end: function end(dragDom, eventDom) {
1031
1058
  dragDom.classList.add('d-none');
1032
1059
  var column_key = eventDom.dataset.key;
1033
1060
 
1034
- var diff = parseInt(dragDom.style.left) - _this10.dragColumnLeft;
1061
+ var diff = parseInt(dragDom.style.left) - _this11.dragColumnLeft;
1035
1062
 
1036
- _this10.width = parseInt(_this10.width) + diff + 'px';
1037
- _this10.table_head.style.width = _this10.width;
1038
- _this10.table_body.style.width = _this10.width;
1063
+ _this11.width = parseInt(_this11.width) + diff + 'px';
1064
+ _this11.table_head.style.width = _this11.width;
1065
+ _this11.table_body.style.width = _this11.width;
1039
1066
 
1040
- if (_this10.table_total) {
1041
- _this10.table_total.style.width = _this10.width;
1067
+ if (_this11.table_total) {
1068
+ _this11.table_total.style.width = _this11.width;
1042
1069
  }
1043
1070
 
1044
1071
  document.querySelectorAll("#".concat(column_key)).forEach(function (item) {
1045
- item.style.width = "".concat(_this10.dragWidth + diff, "px");
1072
+ item.style.width = "".concat(_this11.dragWidth + diff, "px");
1046
1073
  });
1047
1074
  return true;
1048
1075
  }
1049
1076
  });
1050
1077
  } else {
1051
- _this10.drag.setEventDom(split);
1078
+ _this11.drag.setEventDom(split);
1052
1079
  }
1053
1080
  });
1054
1081
  }
@@ -1187,20 +1214,20 @@ function (_React$Component) {
1187
1214
  }, {
1188
1215
  key: "calcLocalTotal",
1189
1216
  value: function calcLocalTotal(field) {
1190
- var _this11 = this;
1217
+ var _this12 = this;
1191
1218
 
1192
1219
  return function (e) {
1193
- var list = _this11.state.data;
1220
+ var list = _this12.state.data;
1194
1221
  var total = 0;
1195
1222
  list.forEach(function (item) {
1196
1223
  if (!!parseFloat(item[field])) {
1197
1224
  total += parseFloat(item[field]);
1198
1225
  }
1199
1226
  });
1200
- var totalData = Object.assign({}, _this11.state.total);
1227
+ var totalData = Object.assign({}, _this12.state.total);
1201
1228
  totalData[field] = total.toFixed(2);
1202
1229
 
1203
- _this11.setState({
1230
+ _this12.setState({
1204
1231
  total: totalData
1205
1232
  });
1206
1233
  };
@@ -1208,17 +1235,17 @@ function (_React$Component) {
1208
1235
  }, {
1209
1236
  key: "render",
1210
1237
  value: function render() {
1211
- var _this12 = this;
1238
+ var _this13 = this;
1212
1239
 
1213
1240
  return _react["default"].createElement("div", {
1214
1241
  ref: function ref(c) {
1215
- return _this12.mainDom = c;
1242
+ return _this13.mainDom = c;
1216
1243
  },
1217
1244
  className: this.getMainClasses(),
1218
1245
  style: this.getStyles()
1219
1246
  }, _react["default"].createElement("div", {
1220
1247
  ref: function ref(c) {
1221
- return _this12.conDom = c;
1248
+ return _this13.conDom = c;
1222
1249
  },
1223
1250
  className: this.getBodyClasses()
1224
1251
  }, this.renderHeader(), this.renderRows(), this.renderTotal(), _react["default"].createElement(_reactBootstrap.Scroll, {
@@ -1227,7 +1254,7 @@ function (_React$Component) {
1227
1254
  selector: "#table-body-com-".concat(this.domId)
1228
1255
  })), this.renderFoot(), _react["default"].createElement("div", {
1229
1256
  ref: function ref(c) {
1230
- return _this12.split = c;
1257
+ return _this13.split = c;
1231
1258
  },
1232
1259
  className: "ck-split d-none"
1233
1260
  }));
@@ -1235,15 +1262,15 @@ function (_React$Component) {
1235
1262
  }, {
1236
1263
  key: "renderHeader",
1237
1264
  value: function renderHeader() {
1238
- var _this13 = this;
1265
+ var _this14 = this;
1239
1266
 
1240
1267
  return _react["default"].createElement("div", {
1241
1268
  ref: function ref(c) {
1242
- return _this13.tableHeader = c;
1269
+ return _this14.tableHeader = c;
1243
1270
  }
1244
1271
  }, _react["default"].createElement("table", {
1245
1272
  ref: function ref(c) {
1246
- return _this13.table_head = c;
1273
+ return _this14.table_head = c;
1247
1274
  },
1248
1275
  id: "table-head-".concat(this.domId),
1249
1276
  className: this.getClasses(''),
@@ -1259,7 +1286,7 @@ function (_React$Component) {
1259
1286
  icon: "list"
1260
1287
  }) : _react["default"].createElement(_reactBootstrap.CCheckbox, {
1261
1288
  ref: function ref(c) {
1262
- return _this13.allchk = c;
1289
+ return _this14.allchk = c;
1263
1290
  },
1264
1291
  onChange: this.selectAll,
1265
1292
  checked: this.state.selectAll,
@@ -1272,7 +1299,7 @@ function (_React$Component) {
1272
1299
  }) : null, _react["default"].Children.map(this.props.children, function (item, key) {
1273
1300
  var _ref, _item$props;
1274
1301
 
1275
- _this13.cacheRow[item.props.field] = (_ref = (_item$props = item.props) === null || _item$props === void 0 ? void 0 : _item$props.def) !== null && _ref !== void 0 ? _ref : '';
1302
+ _this14.cacheRow[item.props.field] = (_ref = (_item$props = item.props) === null || _item$props === void 0 ? void 0 : _item$props.def) !== null && _ref !== void 0 ? _ref : '';
1276
1303
 
1277
1304
  if (!item || item.props.hide) {
1278
1305
  return null;
@@ -1289,28 +1316,28 @@ function (_React$Component) {
1289
1316
 
1290
1317
  var sort_icon = '';
1291
1318
 
1292
- if (_this13.sortList[item.props.field]) {
1293
- sort_icon = 'sort-alpha-' + (_this13.sortList[item.props.field] === 'asc' ? 'down' : 'up');
1319
+ if (_this14.sortList[item.props.field]) {
1320
+ sort_icon = 'sort-alpha-' + (_this14.sortList[item.props.field] === 'asc' ? 'down' : 'up');
1294
1321
  }
1295
1322
 
1296
1323
  return _react["default"].createElement("th", {
1297
- onContextMenu: _this13.menuContextHandler(''),
1298
- id: _this13.domId + '-' + key,
1324
+ onContextMenu: _this14.menuContextHandler(''),
1325
+ id: _this14.domId + '-' + key,
1299
1326
  "data-key": 'head_' + key,
1300
1327
  style: style
1301
- }, _this13.is_sort ? _react["default"].createElement("a", {
1328
+ }, _this14.is_sort ? _react["default"].createElement("a", {
1302
1329
  className: "ck-ctable-sort",
1303
1330
  href: "javascript://",
1304
- id: "".concat(_this13.domId, "-sort-").concat(item.props.field),
1331
+ id: "".concat(_this14.domId, "-sort-").concat(item.props.field),
1305
1332
  "data-field": item.props.field,
1306
- onClick: _this13.sortHandler
1333
+ onClick: _this14.sortHandler
1307
1334
  }, item.props.text, " ", _react["default"].createElement(_reactBootstrap.Icon, {
1308
1335
  icon: sort_icon
1309
- })) : item.props.text, _this13.props.move ? _react["default"].createElement("span", {
1336
+ })) : item.props.text, _this14.props.move ? _react["default"].createElement("span", {
1310
1337
  ref: function ref(c) {
1311
- return _this13.headerSplits.push(c);
1338
+ return _this14.headerSplits.push(c);
1312
1339
  },
1313
- "data-key": _this13.domId + '-' + key,
1340
+ "data-key": _this14.domId + '-' + key,
1314
1341
  className: "ck-column-split"
1315
1342
  }) : null);
1316
1343
  })))));
@@ -1318,34 +1345,34 @@ function (_React$Component) {
1318
1345
  }, {
1319
1346
  key: "renderRows",
1320
1347
  value: function renderRows() {
1321
- var _this14 = this;
1348
+ var _this15 = this;
1322
1349
 
1323
1350
  return _react["default"].createElement("div", {
1324
1351
  ref: function ref(c) {
1325
- return _this14.table_rows = c;
1352
+ return _this15.table_rows = c;
1326
1353
  },
1327
1354
  id: "table-body-com-".concat(this.domId),
1328
1355
  className: "flex-grow-1 rows",
1329
1356
  onScroll: this.scrollHandler
1330
1357
  }, _react["default"].createElement("table", {
1331
1358
  ref: function ref(c) {
1332
- return _this14.table_body = c;
1359
+ return _this15.table_body = c;
1333
1360
  },
1334
1361
  id: "table-body-".concat(this.domId),
1335
1362
  className: this.getClasses(),
1336
1363
  style: this.getTableStyles()
1337
1364
  }, _react["default"].createElement("tbody", null, this.state.data.map(function (row, i) {
1338
- if (_this14.props.edit) {
1339
- return _this14.renderEditRow(row, i);
1365
+ if (_this15.props.edit) {
1366
+ return _this15.renderEditRow(row, i);
1340
1367
  }
1341
1368
 
1342
- return _this14.renderRow(row, i, null);
1369
+ return _this15.renderRow(row, i, null);
1343
1370
  }), this.props.edit && this.props.newBar ? this.renderEditAddRow() : null)), this.props.menu ? this.renderMenu() : null, this.props.menu ? this.renderNumberMenu() : null);
1344
1371
  }
1345
1372
  }, {
1346
1373
  key: "renderRow",
1347
1374
  value: function renderRow(row, i, parentRow) {
1348
- var _this15 = this;
1375
+ var _this16 = this;
1349
1376
 
1350
1377
  var checked = this.state.selectRows.indexOf(i) !== -1;
1351
1378
  var focus = i === this.state.focus && this.props.focus;
@@ -1368,9 +1395,9 @@ function (_React$Component) {
1368
1395
  } //set style
1369
1396
 
1370
1397
 
1371
- var style = _objectSpread({}, _this15.props.columnStyle);
1398
+ var style = _objectSpread({}, _this16.props.columnStyle);
1372
1399
 
1373
- style.textAlign = item.props.align || _this15.props.align;
1400
+ style.textAlign = item.props.align || _this16.props.align;
1374
1401
 
1375
1402
  if (item.props.width) {
1376
1403
  style.width = item.props.width;
@@ -1402,8 +1429,8 @@ function (_React$Component) {
1402
1429
 
1403
1430
  if (item.props.children) {
1404
1431
  return _react["default"].createElement("td", {
1405
- onContextMenu: _this15.menuContextHandler(dataType),
1406
- id: _this15.domId + '-' + key,
1432
+ onContextMenu: _this16.menuContextHandler(dataType),
1433
+ id: _this16.domId + '-' + key,
1407
1434
  "data-row": "".concat(i),
1408
1435
  "data-field": item.props.field,
1409
1436
  className: item.props.className,
@@ -1419,8 +1446,8 @@ function (_React$Component) {
1419
1446
  }
1420
1447
 
1421
1448
  return _react["default"].createElement("td", {
1422
- onContextMenu: _this15.menuContextHandler(dataType),
1423
- id: _this15.domId + '-' + key,
1449
+ onContextMenu: _this16.menuContextHandler(dataType),
1450
+ id: _this16.domId + '-' + key,
1424
1451
  "data-field": item.props.field,
1425
1452
  style: style,
1426
1453
  onClick: function onClick(e) {
@@ -1434,14 +1461,14 @@ function (_React$Component) {
1434
1461
  }
1435
1462
  },
1436
1463
  "data-row": "".concat(i)
1437
- }, item.props.type ? _this15.renderEditComponent(item.props, row, i) : item.props.onFormat ? item.props.onFormat(row[item.props.field], row, item.props.field) : row[item.props.field]);
1464
+ }, item.props.type ? _this16.renderEditComponent(item.props, row, i) : item.props.onFormat ? item.props.onFormat(row[item.props.field], row, item.props.field) : row[item.props.field]);
1438
1465
  }
1439
1466
  })));
1440
1467
  }
1441
1468
  }, {
1442
1469
  key: "renderEditRow",
1443
1470
  value: function renderEditRow(row, i) {
1444
- var _this16 = this;
1471
+ var _this17 = this;
1445
1472
 
1446
1473
  return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement("tr", {
1447
1474
  className: this.props.onClick ? 'click-row' : undefined,
@@ -1466,7 +1493,7 @@ function (_React$Component) {
1466
1493
  className: this.props.disabled ? 'text-secondary' : 'text-danger',
1467
1494
  text: "delete",
1468
1495
  onClick: function onClick() {
1469
- _this16.deleteRowHandler(i);
1496
+ _this17.deleteRowHandler(i);
1470
1497
  }
1471
1498
  })) : null, _react["default"].Children.map(this.props.children, function (item, key) {
1472
1499
  if (!item || item.props.hide) {
@@ -1474,9 +1501,9 @@ function (_React$Component) {
1474
1501
  } //set style
1475
1502
 
1476
1503
 
1477
- var style = _objectSpread({}, _this16.props.columnStyle);
1504
+ var style = _objectSpread({}, _this17.props.columnStyle);
1478
1505
 
1479
- style.textAlign = item.props.align || _this16.props.align;
1506
+ style.textAlign = item.props.align || _this17.props.align;
1480
1507
 
1481
1508
  if (item.props.width) {
1482
1509
  style.width = item.props.width;
@@ -1484,9 +1511,9 @@ function (_React$Component) {
1484
1511
 
1485
1512
  var dataType = 'text';
1486
1513
  return _react["default"].createElement("td", {
1487
- onContextMenu: _this16.menuContextHandler(dataType),
1514
+ onContextMenu: _this17.menuContextHandler(dataType),
1488
1515
  className: item.props.disabled ? 'disabled' : '',
1489
- id: _this16.domId + '-' + key,
1516
+ id: _this17.domId + '-' + key,
1490
1517
  "data-field": item.props.field,
1491
1518
  style: style,
1492
1519
  onClick: function onClick(e) {
@@ -1500,13 +1527,13 @@ function (_React$Component) {
1500
1527
  }
1501
1528
  },
1502
1529
  "data-row": "".concat(i)
1503
- }, item.props.disabled ? item.props.onFormat ? item.props.onFormat(row[item.props.field], row, item.props.field) : row[item.props.field] : _this16.renderEditComponent(item.props, row, i));
1530
+ }, item.props.disabled ? item.props.onFormat ? item.props.onFormat(row[item.props.field], row, item.props.field) : row[item.props.field] : _this17.renderEditComponent(item.props, row, i));
1504
1531
  })));
1505
1532
  }
1506
1533
  }, {
1507
1534
  key: "renderEditAddRow",
1508
1535
  value: function renderEditAddRow() {
1509
- var _this17 = this;
1536
+ var _this18 = this;
1510
1537
 
1511
1538
  if (this.props.disabled) {
1512
1539
  return null;
@@ -1535,9 +1562,10 @@ function (_React$Component) {
1535
1562
  width: item.props.width
1536
1563
  };
1537
1564
  return _react["default"].createElement("td", {
1538
- style: style
1565
+ style: style,
1566
+ id: _this18.domId + '-' + key
1539
1567
  }, _react["default"].createElement(_CTableInput["default"], {
1540
- onFocus: _this17.addNewHandler
1568
+ onFocus: _this18.addNewHandler
1541
1569
  }));
1542
1570
  }));
1543
1571
  }
@@ -1546,7 +1574,7 @@ function (_React$Component) {
1546
1574
  value: function renderEditComponent(item, row, i) {
1547
1575
  var _item$disabled,
1548
1576
  _item$disabled2,
1549
- _this18 = this,
1577
+ _this19 = this,
1550
1578
  _item$disabled3,
1551
1579
  _item$disabled4,
1552
1580
  _item$disabled5;
@@ -1581,7 +1609,7 @@ function (_React$Component) {
1581
1609
  className: "d-inline",
1582
1610
  width: "20px",
1583
1611
  onChange: function onChange(chk, e) {
1584
- _this18.editHandler(e, chk, 'chk');
1612
+ _this19.editHandler(e, chk, 'chk');
1585
1613
  },
1586
1614
  "data-row": i,
1587
1615
  "data-field": item.field,
@@ -1618,7 +1646,7 @@ function (_React$Component) {
1618
1646
  var _this$props$showNumbe,
1619
1647
  _this$props$showPages,
1620
1648
  _this$props$edit,
1621
- _this19 = this;
1649
+ _this20 = this;
1622
1650
 
1623
1651
  if (!this.props.foot) {
1624
1652
  return null;
@@ -1635,21 +1663,21 @@ function (_React$Component) {
1635
1663
  noPage: (_this$props$edit = this.props.edit) !== null && _this$props$edit !== void 0 ? _this$props$edit : false
1636
1664
  }), _react["default"].createElement("div", {
1637
1665
  ref: function ref(c) {
1638
- _this19.fullButton = c;
1666
+ _this20.fullButton = c;
1639
1667
  },
1640
1668
  className: "full-btn align-self-center ms-auto pe-2 text-primary",
1641
1669
  onClick: function onClick() {
1642
- _this19.fullHandler();
1670
+ _this20.fullHandler();
1643
1671
  }
1644
1672
  }, _react["default"].createElement(_reactBootstrap.Icon, {
1645
1673
  icon: "expand"
1646
1674
  })), _react["default"].createElement("div", {
1647
1675
  ref: function ref(c) {
1648
- _this19.fullButton2 = c;
1676
+ _this20.fullButton2 = c;
1649
1677
  },
1650
1678
  className: "right-full-btn d-none",
1651
1679
  onClick: function onClick() {
1652
- _this19.fullHandler();
1680
+ _this20.fullHandler();
1653
1681
  }
1654
1682
  }, _react["default"].createElement(_reactBootstrap.Icon, {
1655
1683
  icon: "times"
@@ -1658,7 +1686,7 @@ function (_React$Component) {
1658
1686
  }, {
1659
1687
  key: "renderTotal",
1660
1688
  value: function renderTotal() {
1661
- var _this20 = this;
1689
+ var _this21 = this;
1662
1690
 
1663
1691
  if (!this.state.total) {
1664
1692
  return null;
@@ -1667,12 +1695,12 @@ function (_React$Component) {
1667
1695
  var total = this.state.total;
1668
1696
  return _react["default"].createElement("div", {
1669
1697
  ref: function ref(c) {
1670
- return _this20.tableTotal = c;
1698
+ return _this21.tableTotal = c;
1671
1699
  },
1672
1700
  className: "ck-ctable-total"
1673
1701
  }, _react["default"].createElement("table", {
1674
1702
  ref: function ref(c) {
1675
- return _this20.table_total = c;
1703
+ return _this21.table_total = c;
1676
1704
  },
1677
1705
  id: "table-total-".concat(this.domId),
1678
1706
  className: this.getClasses(),
@@ -1681,12 +1709,17 @@ function (_React$Component) {
1681
1709
  width: "20px"
1682
1710
  }, _react["default"].createElement(_reactBootstrap.Icon, {
1683
1711
  icon: "chart-line"
1684
- })) : null, _react["default"].Children.map(this.props.children, function (item, key) {
1712
+ })) : null, !this.props.nodel && this.props.edit ? _react["default"].createElement("td", {
1713
+ style: {
1714
+ width: '20px',
1715
+ textAlign: 'center'
1716
+ }
1717
+ }) : null, _react["default"].Children.map(this.props.children, function (item, key) {
1685
1718
  if (!item || item.props.hide) {
1686
1719
  return null;
1687
1720
  }
1688
1721
 
1689
- var align = item.props.align || _this20.props.align;
1722
+ var align = item.props.align || _this21.props.align;
1690
1723
  var style = {
1691
1724
  'textAlign': align
1692
1725
  };
@@ -1696,7 +1729,7 @@ function (_React$Component) {
1696
1729
  }
1697
1730
 
1698
1731
  return _react["default"].createElement("td", {
1699
- id: _this20.domId + '-' + key,
1732
+ id: _this21.domId + '-' + key,
1700
1733
  "data-field": item.props.field,
1701
1734
  style: style
1702
1735
  }, item.props.onFormat ? item.props.onFormat(total[item.props.field], total, item.props.field) : total[item.props.field]);
@@ -1705,7 +1738,7 @@ function (_React$Component) {
1705
1738
  }, {
1706
1739
  key: "renderMenu",
1707
1740
  value: function renderMenu() {
1708
- var _this21 = this;
1741
+ var _this22 = this;
1709
1742
 
1710
1743
  var lang;
1711
1744
 
@@ -1724,7 +1757,7 @@ function (_React$Component) {
1724
1757
 
1725
1758
  return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_reactBootstrap.Menu, {
1726
1759
  ref: function ref(c) {
1727
- return _this21.mainMenu = c;
1760
+ return _this22.mainMenu = c;
1728
1761
  },
1729
1762
  onClick: this.menuClickHandler
1730
1763
  }, _react["default"].createElement(_reactBootstrap.Menu.Item, {
@@ -1744,7 +1777,7 @@ function (_React$Component) {
1744
1777
  var select = document.getSelection();
1745
1778
  if (!select) return;
1746
1779
 
1747
- _this21.filterHandler(select.toString(), data.field, 'contain');
1780
+ _this22.filterHandler(select.toString(), data.field, 'contain');
1748
1781
  }
1749
1782
  }, _react["default"].createElement(_reactBootstrap.Icon, {
1750
1783
  className: "me-1",
@@ -1755,7 +1788,7 @@ function (_React$Component) {
1755
1788
  var select = document.getSelection();
1756
1789
  if (!select) return;
1757
1790
 
1758
- _this21.filterHandler(select.toString(), data.field, 'exclude');
1791
+ _this22.filterHandler(select.toString(), data.field, 'exclude');
1759
1792
  }
1760
1793
  }, _react["default"].createElement(_reactBootstrap.Icon, {
1761
1794
  className: "me-1",
@@ -1763,7 +1796,7 @@ function (_React$Component) {
1763
1796
  }), lang['Filter Excluding Selection']) : null, this.is_filter || this.is_sort ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
1764
1797
  field: "clear_filter",
1765
1798
  onClick: function onClick() {
1766
- _this21.clearFilter();
1799
+ _this22.clearFilter();
1767
1800
  }
1768
1801
  }, _react["default"].createElement("span", {
1769
1802
  className: "text-danger"
@@ -1780,7 +1813,7 @@ function (_React$Component) {
1780
1813
  style: inputStyle
1781
1814
  }, lang['Equal With']), _react["default"].createElement(_reactBootstrap.Input, {
1782
1815
  ref: function ref(c) {
1783
- return _this21.filter.equal = c;
1816
+ return _this22.filter.equal = c;
1784
1817
  },
1785
1818
  className: "me-1",
1786
1819
  size: "xs",
@@ -1789,13 +1822,13 @@ function (_React$Component) {
1789
1822
  onChange: this.filterChangeHandler('equal'),
1790
1823
  onMouseDown: stopEvent,
1791
1824
  onEnter: function onEnter() {
1792
- _this21.filterHandler(_this21.state.filter.equal, _this21.mainMenu.data.field, 'equal');
1825
+ _this22.filterHandler(_this22.state.filter.equal, _this22.mainMenu.data.field, 'equal');
1793
1826
  }
1794
1827
  }), _react["default"].createElement(_reactBootstrap.Button, {
1795
1828
  size: "xs",
1796
1829
  onMouseDown: stopEvent,
1797
1830
  onClick: function onClick(e) {
1798
- _this21.filterHandler(_this21.state.filter.equal, _this21.mainMenu.data.field, 'equal');
1831
+ _this22.filterHandler(_this22.state.filter.equal, _this22.mainMenu.data.field, 'equal');
1799
1832
  },
1800
1833
  icon: "search"
1801
1834
  })) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
@@ -1805,7 +1838,7 @@ function (_React$Component) {
1805
1838
  style: inputStyle
1806
1839
  }, lang['Start With']), _react["default"].createElement(_reactBootstrap.Input, {
1807
1840
  ref: function ref(c) {
1808
- return _this21.filter.start = c;
1841
+ return _this22.filter.start = c;
1809
1842
  },
1810
1843
  className: "me-1",
1811
1844
  size: "xs",
@@ -1814,13 +1847,13 @@ function (_React$Component) {
1814
1847
  onChange: this.filterChangeHandler('start'),
1815
1848
  onMouseDown: stopEvent,
1816
1849
  onEnter: function onEnter() {
1817
- _this21.filterHandler(_this21.state.filter.start, _this21.mainMenu.data.field, 'start');
1850
+ _this22.filterHandler(_this22.state.filter.start, _this22.mainMenu.data.field, 'start');
1818
1851
  }
1819
1852
  }), _react["default"].createElement(_reactBootstrap.Button, {
1820
1853
  size: "xs",
1821
1854
  onMouseDown: stopEvent,
1822
1855
  onClick: function onClick(e) {
1823
- _this21.filterHandler(_this21.state.filter.start, _this21.mainMenu.data.field, 'start');
1856
+ _this22.filterHandler(_this22.state.filter.start, _this22.mainMenu.data.field, 'start');
1824
1857
  },
1825
1858
  icon: "search"
1826
1859
  })) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
@@ -1830,7 +1863,7 @@ function (_React$Component) {
1830
1863
  style: inputStyle
1831
1864
  }, lang['End With']), _react["default"].createElement(_reactBootstrap.Input, {
1832
1865
  ref: function ref(c) {
1833
- return _this21.filter.end = c;
1866
+ return _this22.filter.end = c;
1834
1867
  },
1835
1868
  className: "me-1",
1836
1869
  size: "xs",
@@ -1839,13 +1872,13 @@ function (_React$Component) {
1839
1872
  onChange: this.filterChangeHandler('end'),
1840
1873
  onMouseDown: stopEvent,
1841
1874
  onEnter: function onEnter() {
1842
- _this21.filterHandler(_this21.state.filter.end, _this21.mainMenu.data.field, 'end');
1875
+ _this22.filterHandler(_this22.state.filter.end, _this22.mainMenu.data.field, 'end');
1843
1876
  }
1844
1877
  }), _react["default"].createElement(_reactBootstrap.Button, {
1845
1878
  size: "xs",
1846
1879
  onMouseDown: stopEvent,
1847
1880
  onClick: function onClick(e) {
1848
- _this21.filterHandler(_this21.state.filter.end, _this21.mainMenu.data.field, 'end');
1881
+ _this22.filterHandler(_this22.state.filter.end, _this22.mainMenu.data.field, 'end');
1849
1882
  },
1850
1883
  icon: "search"
1851
1884
  })) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
@@ -1855,7 +1888,7 @@ function (_React$Component) {
1855
1888
  style: inputStyle
1856
1889
  }, lang['Contain with']), _react["default"].createElement(_reactBootstrap.Input, {
1857
1890
  ref: function ref(c) {
1858
- return _this21.filter.contain = c;
1891
+ return _this22.filter.contain = c;
1859
1892
  },
1860
1893
  className: "me-1",
1861
1894
  size: "xs",
@@ -1864,13 +1897,13 @@ function (_React$Component) {
1864
1897
  onChange: this.filterChangeHandler('contain'),
1865
1898
  onMouseDown: stopEvent,
1866
1899
  onEnter: function onEnter() {
1867
- _this21.filterHandler(_this21.state.filter.contain, _this21.mainMenu.data.field, 'contain');
1900
+ _this22.filterHandler(_this22.state.filter.contain, _this22.mainMenu.data.field, 'contain');
1868
1901
  }
1869
1902
  }), _react["default"].createElement(_reactBootstrap.Button, {
1870
1903
  size: "xs",
1871
1904
  onMouseDown: stopEvent,
1872
1905
  onClick: function onClick(e) {
1873
- _this21.filterHandler(_this21.state.filter.contain, _this21.mainMenu.data.field, 'contain');
1906
+ _this22.filterHandler(_this22.state.filter.contain, _this22.mainMenu.data.field, 'contain');
1874
1907
  },
1875
1908
  icon: "search"
1876
1909
  })) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
@@ -1888,7 +1921,7 @@ function (_React$Component) {
1888
1921
  onChange: this.filterChangeHandler('condition'),
1889
1922
  onMouseDown: stopEvent,
1890
1923
  onEnter: function onEnter() {
1891
- _this21.filterHandler(_this21.state.filter.condition, _this21.mainMenu.data.field, 'condition');
1924
+ _this22.filterHandler(_this22.state.filter.condition, _this22.mainMenu.data.field, 'condition');
1892
1925
  }
1893
1926
  })) : null, this.props.edit && (!this.props.nodel || this.props.newBar) ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
1894
1927
  field: "",
@@ -1901,14 +1934,14 @@ function (_React$Component) {
1901
1934
  field: "",
1902
1935
  step: true
1903
1936
  }) : null, this.props.customMenu ? this.props.customMenu.map(function (menu) {
1904
- return _this21.explainCustomMenu(menu);
1937
+ return _this22.explainCustomMenu(menu);
1905
1938
  }) : null));
1906
1939
  } // MARK:-生成数字菜单
1907
1940
 
1908
1941
  }, {
1909
1942
  key: "renderNumberMenu",
1910
1943
  value: function renderNumberMenu() {
1911
- var _this22 = this;
1944
+ var _this23 = this;
1912
1945
 
1913
1946
  var lang;
1914
1947
 
@@ -1927,7 +1960,7 @@ function (_React$Component) {
1927
1960
 
1928
1961
  return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_reactBootstrap.Menu, {
1929
1962
  ref: function ref(c) {
1930
- return _this22.numMenu = c;
1963
+ return _this23.numMenu = c;
1931
1964
  },
1932
1965
  onClick: this.menuClickHandler
1933
1966
  }, _react["default"].createElement(_reactBootstrap.Menu.Item, {
@@ -1947,7 +1980,7 @@ function (_React$Component) {
1947
1980
  var select = document.getSelection();
1948
1981
  if (!select) return;
1949
1982
 
1950
- _this22.filterHandler(select.toString(), data.field, 'contain');
1983
+ _this23.filterHandler(select.toString(), data.field, 'contain');
1951
1984
  }
1952
1985
  }, _react["default"].createElement(_reactBootstrap.Icon, {
1953
1986
  className: "me-1",
@@ -1958,7 +1991,7 @@ function (_React$Component) {
1958
1991
  var select = document.getSelection();
1959
1992
  if (!select) return;
1960
1993
 
1961
- _this22.filterHandler(select.toString(), data.field, 'exclude');
1994
+ _this23.filterHandler(select.toString(), data.field, 'exclude');
1962
1995
  }
1963
1996
  }, _react["default"].createElement(_reactBootstrap.Icon, {
1964
1997
  className: "me-1",
@@ -1966,7 +1999,7 @@ function (_React$Component) {
1966
1999
  }), lang['Filter Excluding Selection']) : null, this.is_filter || this.is_sort ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
1967
2000
  field: "clear_filter",
1968
2001
  onClick: function onClick() {
1969
- _this22.clearFilter();
2002
+ _this23.clearFilter();
1970
2003
  }
1971
2004
  }, _react["default"].createElement("span", {
1972
2005
  className: "text-danger"
@@ -1989,12 +2022,12 @@ function (_React$Component) {
1989
2022
  onMouseDown: stopEvent,
1990
2023
  onEnter: function onEnter() {
1991
2024
  var reg = /(>=|<=|<|>|=|!=)+\s*(\d+)/i;
1992
- var m = String(_this22.state.filter.condition).match(reg);
2025
+ var m = String(_this23.state.filter.condition).match(reg);
1993
2026
 
1994
2027
  if (m) {
1995
- _this22.filterHandler(m[2], _this22.numMenu.data.field, numberCondition[m[1]]);
2028
+ _this23.filterHandler(m[2], _this23.numMenu.data.field, numberCondition[m[1]]);
1996
2029
  } else {
1997
- _this22.filterHandler(_this22.state.filter.condition, _this22.numMenu.data.field, 'condition');
2030
+ _this23.filterHandler(_this23.state.filter.condition, _this23.numMenu.data.field, 'condition');
1998
2031
  }
1999
2032
  }
2000
2033
  }), _react["default"].createElement("div", null, "and,or,between,>,>=,<,<=,=")) : null));
@@ -2002,7 +2035,7 @@ function (_React$Component) {
2002
2035
  }, {
2003
2036
  key: "explainCustomMenu",
2004
2037
  value: function explainCustomMenu(menu) {
2005
- var _this23 = this;
2038
+ var _this24 = this;
2006
2039
 
2007
2040
  if (menu.children && menu.children instanceof Array) {
2008
2041
  return _react["default"].createElement(_reactBootstrap.Menu.Item, {
@@ -2010,7 +2043,7 @@ function (_React$Component) {
2010
2043
  text: menu.text,
2011
2044
  child: true
2012
2045
  }, menu.children.map(function (item) {
2013
- return _this23.explainCustomMenu(item);
2046
+ return _this24.explainCustomMenu(item);
2014
2047
  }));
2015
2048
  } else {
2016
2049
  return _react["default"].createElement(_reactBootstrap.Menu.Item, {