ywana-core8 0.0.96 → 0.0.100
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 +37 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +37 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +37 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +5 -1
- package/src/html/table.js +8 -3
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
|
@@ -1128,7 +1139,15 @@ var DataTableCell = function DataTableCell(_ref2) {
|
|
1128
1139
|
_onChange = column.onChange,
|
1129
1140
|
options = column.options;
|
1130
1141
|
|
1131
|
-
if (id === "checked")
|
1142
|
+
if (id === "checked") {
|
1143
|
+
return /*#__PURE__*/React.createElement(CheckBox, {
|
1144
|
+
id: id,
|
1145
|
+
value: cell,
|
1146
|
+
onChange: function onChange(id, value) {
|
1147
|
+
return _onChange(row.id, id, value);
|
1148
|
+
}
|
1149
|
+
});
|
1150
|
+
} else if (editable && _onChange) {
|
1132
1151
|
switch (type) {
|
1133
1152
|
case "ICON":
|
1134
1153
|
return /*#__PURE__*/React.createElement(Icon, {
|
@@ -4278,6 +4297,19 @@ var TableFilters = function TableFilters(props) {
|
|
4278
4297
|
|
4279
4298
|
|
4280
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
|
+
|
4281
4313
|
var select = function select(row, event) {
|
4282
4314
|
try {
|
4283
4315
|
clear();
|
@@ -4420,7 +4452,8 @@ var TableEditor = function TableEditor(props) {
|
|
4420
4452
|
className: "size"
|
4421
4453
|
}, groupSize)), /*#__PURE__*/React.createElement(DataTable, _extends({}, table, {
|
4422
4454
|
onRowSelection: select,
|
4423
|
-
editable: editable
|
4455
|
+
editable: editable,
|
4456
|
+
onCheckAll: check
|
4424
4457
|
})));
|
4425
4458
|
});
|
4426
4459
|
}
|