ywana-core8 0.0.132 → 0.0.136
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 +24 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +24 -14
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +24 -14
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +8 -6
package/dist/index.cjs
CHANGED
@@ -4086,6 +4086,8 @@ var TablePage = function TablePage(props) {
|
|
4086
4086
|
_props$dev = props.dev,
|
4087
4087
|
dev = _props$dev === void 0 ? false : _props$dev,
|
4088
4088
|
tableActions = props.tableActions,
|
4089
|
+
_props$selectionActio = props.selectionActions,
|
4090
|
+
selectionActions = _props$selectionActio === void 0 ? [] : _props$selectionActio,
|
4089
4091
|
editable = props.editable,
|
4090
4092
|
_props$canFilter = props.canFilter,
|
4091
4093
|
canFilter = _props$canFilter === void 0 ? false : _props$canFilter,
|
@@ -4187,7 +4189,7 @@ var TablePage = function TablePage(props) {
|
|
4187
4189
|
onClose: closeAside
|
4188
4190
|
}) : null, rowChecked ? /*#__PURE__*/React__default["default"].createElement(TableSelector, {
|
4189
4191
|
schema: schema,
|
4190
|
-
|
4192
|
+
actions: selectionActions
|
4191
4193
|
}) : null);
|
4192
4194
|
}
|
4193
4195
|
|
@@ -4268,24 +4270,32 @@ var TableSelector = function TableSelector(props) {
|
|
4268
4270
|
var all = pageContext.all,
|
4269
4271
|
checked = pageContext.checked;
|
4270
4272
|
var count = checked.size + "/" + all.length;
|
4271
|
-
var rows =
|
4272
|
-
return
|
4273
|
-
return item.id === id;
|
4274
|
-
});
|
4273
|
+
var rows = all.filter(function (item) {
|
4274
|
+
return checked.has(item.id);
|
4275
4275
|
});
|
4276
|
-
console.log(count, rows);
|
4277
4276
|
var table = {
|
4278
4277
|
columns: [{
|
4279
4278
|
id: "idMatricula",
|
4280
4279
|
label: "ID Matricula"
|
4281
4280
|
}],
|
4282
|
-
rows: []
|
4281
|
+
rows: rows || []
|
4283
4282
|
};
|
4283
|
+
var buttons = actions.map(function (_ref) {
|
4284
|
+
var label = _ref.label,
|
4285
|
+
_action = _ref.action;
|
4286
|
+
return /*#__PURE__*/React__default["default"].createElement(Button$1, {
|
4287
|
+
label: label,
|
4288
|
+
raised: true,
|
4289
|
+
action: function action() {
|
4290
|
+
return _action(rows);
|
4291
|
+
}
|
4292
|
+
});
|
4293
|
+
});
|
4284
4294
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
4285
4295
|
className: "table-selector"
|
4286
4296
|
}, /*#__PURE__*/React__default["default"].createElement(Header, {
|
4287
4297
|
title: "Selection"
|
4288
|
-
}, count), /*#__PURE__*/React__default["default"].createElement("main", null, /*#__PURE__*/React__default["default"].createElement(DataTable, table)), /*#__PURE__*/React__default["default"].createElement("footer", null,
|
4298
|
+
}, count), /*#__PURE__*/React__default["default"].createElement("main", null, /*#__PURE__*/React__default["default"].createElement(DataTable, table)), /*#__PURE__*/React__default["default"].createElement("footer", null, buttons));
|
4289
4299
|
};
|
4290
4300
|
/**
|
4291
4301
|
* Table Queries
|
@@ -4486,20 +4496,20 @@ var TableEditor = function TableEditor(props) {
|
|
4486
4496
|
}),
|
4487
4497
|
rows: groups[groupName].map(function (item) {
|
4488
4498
|
item.checked = pageContext.checked ? pageContext.checked.has(item.id) : false;
|
4489
|
-
item.actions = actions ? actions.map(function (
|
4490
|
-
return
|
4491
|
-
icon:
|
4499
|
+
item.actions = actions ? actions.map(function (_action2) {
|
4500
|
+
return _action2.filter ? _action2.filter(item) ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
4501
|
+
icon: _action2.icon,
|
4492
4502
|
clickable: true,
|
4493
4503
|
size: "small",
|
4494
4504
|
action: function action() {
|
4495
|
-
return run(
|
4505
|
+
return run(_action2, item);
|
4496
4506
|
}
|
4497
4507
|
}) : null : /*#__PURE__*/React__default["default"].createElement(Icon, {
|
4498
|
-
icon:
|
4508
|
+
icon: _action2.icon,
|
4499
4509
|
clickable: true,
|
4500
4510
|
size: "small",
|
4501
4511
|
action: function action() {
|
4502
|
-
return run(
|
4512
|
+
return run(_action2, item);
|
4503
4513
|
}
|
4504
4514
|
});
|
4505
4515
|
}) : [];
|