@clake/react-bootstrap4-window 1.2.3 → 1.2.6

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.2.3 | by Clake
1
+ /* @clake/react-bootstrap4-window v1.2.6 | by Clake
2
2
  * Copyright (c) 2025 Clake,
3
- * 2025-10-27T17:46:53+0800
3
+ * 2025-11-07T11:48:36+0800
4
4
  */
5
5
  "use strict";
6
6
 
@@ -515,6 +515,18 @@ function (_React$Component) {
515
515
  return true;
516
516
  }
517
517
 
518
+ if (this.props.hidden !== nextProps.hidden) {
519
+ return true;
520
+ }
521
+
522
+ if (this.props.edit !== nextProps.edit) {
523
+ return true;
524
+ }
525
+
526
+ if (this.props.select !== nextProps.select) {
527
+ return true;
528
+ }
529
+
518
530
  return nextState.data !== this.state.data;
519
531
  }
520
532
  }, {
@@ -1304,7 +1316,7 @@ function (_React$Component) {
1304
1316
  style: this.getTableStyles(null)
1305
1317
  }, _react["default"].createElement("thead", {
1306
1318
  className: this.getHeaderClasses()
1307
- }, _react["default"].createElement("tr", null, this.state.select || this.props.edit ? _react["default"].createElement("th", {
1319
+ }, _react["default"].createElement("tr", null, this.props.select || this.props.edit ? _react["default"].createElement("th", {
1308
1320
  style: {
1309
1321
  width: '20px',
1310
1322
  textAlign: 'center'
@@ -1318,12 +1330,7 @@ function (_React$Component) {
1318
1330
  onChange: this.selectAll,
1319
1331
  checked: this.state.selectAll,
1320
1332
  half: this.state.selectHalf
1321
- })) : null, this.props.edit && !this.props.nodel ? _react["default"].createElement("th", {
1322
- style: {
1323
- width: '20px',
1324
- textAlign: 'center'
1325
- }
1326
- }) : null, _react["default"].Children.map(this.props.children, function (item, key) {
1333
+ })) : null, _react["default"].Children.map(this.props.children, function (item, key) {
1327
1334
  var _ref, _item$props;
1328
1335
 
1329
1336
  _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 : '';
@@ -1367,7 +1374,12 @@ function (_React$Component) {
1367
1374
  "data-key": _this13.domId + '-' + key,
1368
1375
  className: "ck-column-split"
1369
1376
  }) : null);
1370
- })))));
1377
+ }), this.props.edit && !this.props.nodel ? _react["default"].createElement("th", {
1378
+ style: {
1379
+ width: '20px',
1380
+ textAlign: 'center'
1381
+ }
1382
+ }) : null))));
1371
1383
  }
1372
1384
  }, {
1373
1385
  key: "renderRows",
@@ -1407,7 +1419,7 @@ function (_React$Component) {
1407
1419
  return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement("tr", {
1408
1420
  className: rowClass,
1409
1421
  onClick: this.clickHandler(row, i)
1410
- }, this.state.select ? _react["default"].createElement("th", {
1422
+ }, this.props.select ? _react["default"].createElement("th", {
1411
1423
  style: {
1412
1424
  width: '20px',
1413
1425
  textAlign: 'center'
@@ -1509,20 +1521,7 @@ function (_React$Component) {
1509
1521
  id: "".concat(this.domId, "-edit-row-icon-").concat(i),
1510
1522
  icon: "edit",
1511
1523
  className: this.props.disabled ? 'text-secondary' : 'text-success'
1512
- })), !this.props.nodel ? _react["default"].createElement("th", {
1513
- style: {
1514
- width: '20px',
1515
- textAlign: 'center',
1516
- cursor: 'pointer'
1517
- }
1518
- }, _react["default"].createElement(_reactBootstrap.Icon, {
1519
- icon: "trash",
1520
- className: this.props.disabled ? 'text-secondary' : 'text-danger',
1521
- text: "delete",
1522
- onClick: function onClick() {
1523
- _this16.deleteRowHandler(i);
1524
- }
1525
- })) : null, _react["default"].Children.map(this.props.children, function (item, key) {
1524
+ })), _react["default"].Children.map(this.props.children, function (item, key) {
1526
1525
  if (!item || item.props.hide) {
1527
1526
  return null;
1528
1527
  } //set style
@@ -1555,7 +1554,20 @@ function (_React$Component) {
1555
1554
  },
1556
1555
  "data-row": "".concat(i)
1557
1556
  }, 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));
1558
- })));
1557
+ }), !this.props.nodel ? _react["default"].createElement("th", {
1558
+ style: {
1559
+ width: '20px',
1560
+ textAlign: 'center',
1561
+ cursor: 'pointer'
1562
+ }
1563
+ }, _react["default"].createElement(_reactBootstrap.Icon, {
1564
+ icon: "trash",
1565
+ className: this.props.disabled ? 'text-secondary' : 'text-danger',
1566
+ text: "delete",
1567
+ onClick: function onClick() {
1568
+ _this16.deleteRowHandler(i);
1569
+ }
1570
+ })) : null));
1559
1571
  }
1560
1572
  }, {
1561
1573
  key: "renderEditAddRow",
@@ -1732,16 +1744,11 @@ function (_React$Component) {
1732
1744
  id: "table-total-".concat(this.domId),
1733
1745
  className: this.getClasses(),
1734
1746
  style: this.getTableStyles()
1735
- }, _react["default"].createElement("tbody", null, _react["default"].createElement("tr", null, this.state.select || this.props.edit ? _react["default"].createElement("td", {
1747
+ }, _react["default"].createElement("tbody", null, _react["default"].createElement("tr", null, this.props.select || this.props.edit ? _react["default"].createElement("td", {
1736
1748
  width: "20px"
1737
1749
  }, _react["default"].createElement(_reactBootstrap.Icon, {
1738
1750
  icon: "chart-line"
1739
- })) : null, !this.props.nodel && this.props.edit ? _react["default"].createElement("td", {
1740
- style: {
1741
- width: '20px',
1742
- textAlign: 'center'
1743
- }
1744
- }) : null, _react["default"].Children.map(this.props.children, function (item, key) {
1751
+ })) : null, _react["default"].Children.map(this.props.children, function (item, key) {
1745
1752
  if (!item || item.props.hide) {
1746
1753
  return null;
1747
1754
  }
@@ -1760,7 +1767,12 @@ function (_React$Component) {
1760
1767
  "data-field": item.props.field,
1761
1768
  style: style
1762
1769
  }, item.props.onFormat ? item.props.onFormat(total[item.props.field], total, item.props.field) : total[item.props.field]);
1763
- })))));
1770
+ }), !this.props.nodel && this.props.edit ? _react["default"].createElement("td", {
1771
+ style: {
1772
+ width: '20px',
1773
+ textAlign: 'center'
1774
+ }
1775
+ }) : null))));
1764
1776
  }
1765
1777
  }, {
1766
1778
  key: "renderMenu",