ywana-core8 0.0.97 → 0.0.101
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 +28 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +28 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +28 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +18 -2
- package/src/html/table.js +12 -5
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
|
+
onChange: 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,19 @@ var TableFilters = function TableFilters(props) {
|
|
4286
4297
|
|
4287
4298
|
|
4288
4299
|
var TableEditor = function TableEditor(props) {
|
4300
|
+
var check = function check(ids) {
|
4301
|
+
if (ids === void 0) {
|
4302
|
+
ids = [];
|
4303
|
+
}
|
4304
|
+
|
4305
|
+
try {
|
4306
|
+
console.log("check: ", ids);
|
4307
|
+
return Promise.resolve();
|
4308
|
+
} catch (e) {
|
4309
|
+
return Promise.reject(e);
|
4310
|
+
}
|
4311
|
+
};
|
4312
|
+
|
4289
4313
|
var select = function select(row, event) {
|
4290
4314
|
try {
|
4291
4315
|
clear();
|
@@ -4428,7 +4452,8 @@ var TableEditor = function TableEditor(props) {
|
|
4428
4452
|
className: "size"
|
4429
4453
|
}, groupSize)), /*#__PURE__*/React.createElement(DataTable, _extends({}, table, {
|
4430
4454
|
onRowSelection: select,
|
4431
|
-
editable: editable
|
4455
|
+
editable: editable,
|
4456
|
+
onCheckAll: check
|
4432
4457
|
})));
|
4433
4458
|
});
|
4434
4459
|
}
|