ywana-core8 0.0.97 → 0.0.98
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/index.cjs +20 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +20 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +20 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +3 -1
- package/src/html/table.js +7 -2
package/dist/index.modern.js
CHANGED
@@ -989,6 +989,7 @@ var DataTable = function DataTable(props) {
|
|
989
989
|
rows = _props$rows === void 0 ? [] : _props$rows,
|
990
990
|
onRowSelection = props.onRowSelection,
|
991
991
|
onSort = props.onSort,
|
992
|
+
onCheckAll = props.onCheckAll,
|
992
993
|
editable = props.editable,
|
993
994
|
outlined = props.outlined;
|
994
995
|
|
@@ -1044,13 +1045,23 @@ var DataTable = function DataTable(props) {
|
|
1044
1045
|
if (onSort) onSort(dragged, dropped);
|
1045
1046
|
}
|
1046
1047
|
|
1048
|
+
function checkAll() {
|
1049
|
+
var ids = rows.map(function (row) {
|
1050
|
+
return row.id;
|
1051
|
+
});
|
1052
|
+
if (onCheckAll) onCheckAll(ids);
|
1053
|
+
}
|
1054
|
+
|
1047
1055
|
var style = outlined ? "outlined" : "";
|
1048
1056
|
return /*#__PURE__*/React.createElement("div", {
|
1049
1057
|
className: "datatable8 " + style
|
1050
1058
|
}, /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, columns.map(function (_ref) {
|
1051
|
-
var
|
1059
|
+
var id = _ref.id,
|
1060
|
+
label = _ref.label,
|
1052
1061
|
sortable = _ref.sortable;
|
1053
|
-
return /*#__PURE__*/React.createElement("th", null,
|
1062
|
+
return /*#__PURE__*/React.createElement("th", null, id === "checked" ? /*#__PURE__*/React.createElement(CheckBox, {
|
1063
|
+
action: checkAll
|
1064
|
+
}) : /*#__PURE__*/React.createElement(Text, null, label), sortable ? /*#__PURE__*/React.createElement(Icon, {
|
1054
1065
|
icon: "arrow_up",
|
1055
1066
|
size: "small",
|
1056
1067
|
clickable: true
|
@@ -4286,6 +4297,11 @@ var TableFilters = function TableFilters(props) {
|
|
4286
4297
|
|
4287
4298
|
|
4288
4299
|
var TableEditor = function TableEditor(props) {
|
4300
|
+
var check = function check(ids) {
|
4301
|
+
|
4302
|
+
return Promise.resolve();
|
4303
|
+
};
|
4304
|
+
|
4289
4305
|
var select = function select(row, event) {
|
4290
4306
|
try {
|
4291
4307
|
clear();
|
@@ -4428,7 +4444,8 @@ var TableEditor = function TableEditor(props) {
|
|
4428
4444
|
className: "size"
|
4429
4445
|
}, groupSize)), /*#__PURE__*/React.createElement(DataTable, _extends({}, table, {
|
4430
4446
|
onRowSelection: select,
|
4431
|
-
editable: editable
|
4447
|
+
editable: editable,
|
4448
|
+
onCheckAll: check
|
4432
4449
|
})));
|
4433
4450
|
});
|
4434
4451
|
}
|