@clake/react-bootstrap4-window 0.7.0 → 0.7.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 +23 -4
- package/lib/CTable.js +68 -29
- 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/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/WModal.less +2 -2
- 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/WModal.js +0 -479
- package/lib/WModal.js.map +0 -5
package/lib/CTable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/* @clake/react-bootstrap4-window v0.7.
|
|
1
|
+
/* @clake/react-bootstrap4-window v0.7.2 | by Clake
|
|
2
2
|
* Copyright (c) 2024 Clake,
|
|
3
|
-
* 2024-03-
|
|
3
|
+
* 2024-03-13T16:54:23+0800
|
|
4
4
|
*/
|
|
5
5
|
"use strict";
|
|
6
6
|
|
|
@@ -27,6 +27,8 @@ var _CTable2 = _interopRequireDefault(require("./i18n/CTable"));
|
|
|
27
27
|
|
|
28
28
|
var _PageBar = _interopRequireDefault(require("./PageBar"));
|
|
29
29
|
|
|
30
|
+
var _gulpUtil = require("gulp-util");
|
|
31
|
+
|
|
30
32
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
31
33
|
|
|
32
34
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -275,11 +277,34 @@ function (_React$Component) {
|
|
|
275
277
|
// this.selectRows = [];
|
|
276
278
|
|
|
277
279
|
|
|
280
|
+
var selectRows = [];
|
|
281
|
+
var isHalf = false;
|
|
282
|
+
var allchk = false;
|
|
283
|
+
|
|
284
|
+
if (nextProps.data && nextProps.data.length > 0) {
|
|
285
|
+
nextProps.data.forEach(function (item, idx) {
|
|
286
|
+
if (item !== null && item !== void 0 && item.set_chk) {
|
|
287
|
+
selectRows.push(idx);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
if (selectRows.length === nextProps.data.length) {
|
|
292
|
+
allchk = true;
|
|
293
|
+
} else {
|
|
294
|
+
if (selectRows.length > 0) {
|
|
295
|
+
isHalf = true;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
278
300
|
this.setState({
|
|
279
301
|
data: nextProps.data,
|
|
280
302
|
dataCount: nextProps.dataCount,
|
|
281
303
|
page: nextProps.page,
|
|
282
|
-
total: nextProps.total
|
|
304
|
+
total: nextProps.total,
|
|
305
|
+
selectRows: selectRows,
|
|
306
|
+
selectHalf: isHalf,
|
|
307
|
+
selectAll: allchk
|
|
283
308
|
});
|
|
284
309
|
}
|
|
285
310
|
}
|
|
@@ -444,15 +469,16 @@ function (_React$Component) {
|
|
|
444
469
|
value: function setRowCheck(checked, rowIdx) {
|
|
445
470
|
// let row = this.refs['row_'+rowIdx];
|
|
446
471
|
var selectRows = this.props.selectOnce ? [] : this.state.selectRows.slice();
|
|
472
|
+
console.log(checked, rowIdx, selectRows);
|
|
447
473
|
|
|
448
474
|
if (checked) {
|
|
449
|
-
if (selectRows.
|
|
475
|
+
if (!selectRows.includes(rowIdx)) {
|
|
450
476
|
selectRows.push(rowIdx);
|
|
451
477
|
} // ReactDOM.findDOMNode(row).parentNode.parentNode.classList.add('ck-table-selected');
|
|
452
478
|
|
|
453
479
|
} else {
|
|
454
|
-
if (selectRows.
|
|
455
|
-
selectRows.splice(
|
|
480
|
+
if (selectRows.includes(rowIdx)) {
|
|
481
|
+
selectRows.splice(selectRows.indexOf(rowIdx), 1);
|
|
456
482
|
} // ReactDOM.findDOMNode(row).parentNode.parentNode.classList.remove('ck-table-selected');
|
|
457
483
|
|
|
458
484
|
} // this.setState({selectRows: selectRows});
|
|
@@ -971,7 +997,7 @@ function (_React$Component) {
|
|
|
971
997
|
var base = 'ck-ctable-header';
|
|
972
998
|
|
|
973
999
|
if (this.props.headerTheme) {
|
|
974
|
-
base = (0, _bind["default"])(base, '
|
|
1000
|
+
base = (0, _bind["default"])(base, 'table-' + this.props.headerTheme);
|
|
975
1001
|
}
|
|
976
1002
|
|
|
977
1003
|
return (0, _bind["default"])(base, this.props.headClass);
|
|
@@ -1438,13 +1464,19 @@ function (_React$Component) {
|
|
|
1438
1464
|
value: function renderMenu() {
|
|
1439
1465
|
var _this22 = this;
|
|
1440
1466
|
|
|
1441
|
-
var lang
|
|
1467
|
+
var lang;
|
|
1442
1468
|
|
|
1443
|
-
if (!lang) {
|
|
1469
|
+
if (!this.props.lang) {
|
|
1444
1470
|
var i18 = _reactBootstrap.i18n.getLang();
|
|
1445
1471
|
|
|
1446
1472
|
var langStr = typeof lang === 'string' ? lang : i18["short"];
|
|
1447
1473
|
lang = _CTable2["default"][langStr];
|
|
1474
|
+
} else {
|
|
1475
|
+
if (typeof this.props.lang === 'string') {
|
|
1476
|
+
lang = _CTable2["default"][this.props.lang];
|
|
1477
|
+
} else {
|
|
1478
|
+
lang = this.props.lang;
|
|
1479
|
+
}
|
|
1448
1480
|
}
|
|
1449
1481
|
|
|
1450
1482
|
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_reactBootstrap.Menu, {
|
|
@@ -1458,7 +1490,7 @@ function (_React$Component) {
|
|
|
1458
1490
|
document.execCommand("copy");
|
|
1459
1491
|
}
|
|
1460
1492
|
}, _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1461
|
-
className: "
|
|
1493
|
+
className: "me-1",
|
|
1462
1494
|
icon: "copy"
|
|
1463
1495
|
}), lang['Copy']), this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1464
1496
|
step: true
|
|
@@ -1470,7 +1502,7 @@ function (_React$Component) {
|
|
|
1470
1502
|
_this22.filterHandler(select.toString(), data.field, 'contain');
|
|
1471
1503
|
}
|
|
1472
1504
|
}, _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1473
|
-
className: "
|
|
1505
|
+
className: "me-1",
|
|
1474
1506
|
icon: "filter"
|
|
1475
1507
|
}), lang['Filter By Selection']) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1476
1508
|
field: "select_exclude",
|
|
@@ -1480,7 +1512,7 @@ function (_React$Component) {
|
|
|
1480
1512
|
_this22.filterHandler(select.toString(), data.field, 'exclude');
|
|
1481
1513
|
}
|
|
1482
1514
|
}, _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1483
|
-
className: "
|
|
1515
|
+
className: "me-1",
|
|
1484
1516
|
icon: "filter"
|
|
1485
1517
|
}), lang['Filter Excluding Selection']) : null, this.is_filter || this.is_sort ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1486
1518
|
field: "clear_filter",
|
|
@@ -1490,17 +1522,17 @@ function (_React$Component) {
|
|
|
1490
1522
|
}, _react["default"].createElement("span", {
|
|
1491
1523
|
className: "text-danger"
|
|
1492
1524
|
}, _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1493
|
-
className: "
|
|
1525
|
+
className: "me-1",
|
|
1494
1526
|
icon: "brush"
|
|
1495
1527
|
}), lang['Clear Filter / Sort'])) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1496
1528
|
step: true
|
|
1497
1529
|
}) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1498
1530
|
field: "equal"
|
|
1499
1531
|
}, _react["default"].createElement("span", {
|
|
1500
|
-
className: "
|
|
1532
|
+
className: "me-1",
|
|
1501
1533
|
style: inputStyle
|
|
1502
1534
|
}, lang['Equal With']), _react["default"].createElement(_reactBootstrap.Input, {
|
|
1503
|
-
className: "
|
|
1535
|
+
className: "me-1",
|
|
1504
1536
|
size: "xs",
|
|
1505
1537
|
width: "120px",
|
|
1506
1538
|
data: this.state.filter.equal,
|
|
@@ -1519,10 +1551,10 @@ function (_React$Component) {
|
|
|
1519
1551
|
})) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1520
1552
|
field: "filter"
|
|
1521
1553
|
}, _react["default"].createElement("span", {
|
|
1522
|
-
className: "
|
|
1554
|
+
className: "me-1",
|
|
1523
1555
|
style: inputStyle
|
|
1524
1556
|
}, lang['Start With']), _react["default"].createElement(_reactBootstrap.Input, {
|
|
1525
|
-
className: "
|
|
1557
|
+
className: "me-1",
|
|
1526
1558
|
size: "xs",
|
|
1527
1559
|
width: "120px",
|
|
1528
1560
|
data: this.state.filter.start,
|
|
@@ -1541,10 +1573,10 @@ function (_React$Component) {
|
|
|
1541
1573
|
})) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1542
1574
|
field: "filter"
|
|
1543
1575
|
}, _react["default"].createElement("span", {
|
|
1544
|
-
className: "
|
|
1576
|
+
className: "me-1",
|
|
1545
1577
|
style: inputStyle
|
|
1546
1578
|
}, lang['End With']), _react["default"].createElement(_reactBootstrap.Input, {
|
|
1547
|
-
className: "
|
|
1579
|
+
className: "me-1",
|
|
1548
1580
|
size: "xs",
|
|
1549
1581
|
width: "120px",
|
|
1550
1582
|
data: this.state.filter.end,
|
|
@@ -1563,10 +1595,10 @@ function (_React$Component) {
|
|
|
1563
1595
|
})) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1564
1596
|
field: "filter"
|
|
1565
1597
|
}, _react["default"].createElement("span", {
|
|
1566
|
-
className: "
|
|
1598
|
+
className: "me-1",
|
|
1567
1599
|
style: inputStyle
|
|
1568
1600
|
}, lang['Contain with']), _react["default"].createElement(_reactBootstrap.Input, {
|
|
1569
|
-
className: "
|
|
1601
|
+
className: "me-1",
|
|
1570
1602
|
size: "xs",
|
|
1571
1603
|
width: "120px",
|
|
1572
1604
|
data: this.state.filter.contain,
|
|
@@ -1615,13 +1647,19 @@ function (_React$Component) {
|
|
|
1615
1647
|
value: function renderNumberMenu() {
|
|
1616
1648
|
var _this23 = this;
|
|
1617
1649
|
|
|
1618
|
-
var lang
|
|
1650
|
+
var lang;
|
|
1619
1651
|
|
|
1620
|
-
if (!lang) {
|
|
1652
|
+
if (!this.props.lang) {
|
|
1621
1653
|
var i18 = _reactBootstrap.i18n.getLang();
|
|
1622
1654
|
|
|
1623
1655
|
var langStr = typeof lang === 'string' ? lang : i18["short"];
|
|
1624
1656
|
lang = _CTable2["default"][langStr];
|
|
1657
|
+
} else {
|
|
1658
|
+
if (typeof this.props.lang === 'string') {
|
|
1659
|
+
lang = _CTable2["default"][this.props.lang];
|
|
1660
|
+
} else {
|
|
1661
|
+
lang = this.props.lang;
|
|
1662
|
+
}
|
|
1625
1663
|
}
|
|
1626
1664
|
|
|
1627
1665
|
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_reactBootstrap.Menu, {
|
|
@@ -1635,7 +1673,7 @@ function (_React$Component) {
|
|
|
1635
1673
|
document.execCommand("copy");
|
|
1636
1674
|
}
|
|
1637
1675
|
}, _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1638
|
-
className: "
|
|
1676
|
+
className: "me-1",
|
|
1639
1677
|
icon: "copy"
|
|
1640
1678
|
}), lang['Copy']), this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1641
1679
|
step: true
|
|
@@ -1647,7 +1685,7 @@ function (_React$Component) {
|
|
|
1647
1685
|
_this23.filterHandler(select.toString(), data.field, 'contain');
|
|
1648
1686
|
}
|
|
1649
1687
|
}, _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1650
|
-
className: "
|
|
1688
|
+
className: "me-1",
|
|
1651
1689
|
icon: "filter"
|
|
1652
1690
|
}), lang['Filter By Selection']) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1653
1691
|
field: "select_exclude",
|
|
@@ -1657,7 +1695,7 @@ function (_React$Component) {
|
|
|
1657
1695
|
_this23.filterHandler(select.toString(), data.field, 'exclude');
|
|
1658
1696
|
}
|
|
1659
1697
|
}, _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1660
|
-
className: "
|
|
1698
|
+
className: "me-1",
|
|
1661
1699
|
icon: "filter"
|
|
1662
1700
|
}), lang['Filter Excluding Selection']) : null, this.is_filter || this.is_sort ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1663
1701
|
field: "clear_filter",
|
|
@@ -1667,7 +1705,7 @@ function (_React$Component) {
|
|
|
1667
1705
|
}, _react["default"].createElement("span", {
|
|
1668
1706
|
className: "text-danger"
|
|
1669
1707
|
}, _react["default"].createElement(_reactBootstrap.Icon, {
|
|
1670
|
-
className: "
|
|
1708
|
+
className: "me-1",
|
|
1671
1709
|
icon: "brush"
|
|
1672
1710
|
}), lang['Clear Filter / Sort'])) : null, this.is_filter ? _react["default"].createElement(_reactBootstrap.Menu.Item, {
|
|
1673
1711
|
step: true
|
|
@@ -1828,7 +1866,7 @@ CTable.defaultProps = {
|
|
|
1828
1866
|
align: 'left',
|
|
1829
1867
|
sm: true,
|
|
1830
1868
|
fontSm: true,
|
|
1831
|
-
headerTheme: '
|
|
1869
|
+
headerTheme: 'primary',
|
|
1832
1870
|
noWrap: true,
|
|
1833
1871
|
bordered: true,
|
|
1834
1872
|
move: true,
|
|
@@ -1836,7 +1874,8 @@ CTable.defaultProps = {
|
|
|
1836
1874
|
showNumbers: 30,
|
|
1837
1875
|
showPages: 10,
|
|
1838
1876
|
source: null,
|
|
1839
|
-
total: null
|
|
1877
|
+
total: null,
|
|
1878
|
+
lang: 'en'
|
|
1840
1879
|
};
|
|
1841
1880
|
var _default = CTable;
|
|
1842
1881
|
exports["default"] = _default;
|