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.modern.js
CHANGED
@@ -4079,6 +4079,8 @@ var TablePage = function TablePage(props) {
|
|
4079
4079
|
_props$dev = props.dev,
|
4080
4080
|
dev = _props$dev === void 0 ? false : _props$dev,
|
4081
4081
|
tableActions = props.tableActions,
|
4082
|
+
_props$selectionActio = props.selectionActions,
|
4083
|
+
selectionActions = _props$selectionActio === void 0 ? [] : _props$selectionActio,
|
4082
4084
|
editable = props.editable,
|
4083
4085
|
_props$canFilter = props.canFilter,
|
4084
4086
|
canFilter = _props$canFilter === void 0 ? false : _props$canFilter,
|
@@ -4180,7 +4182,7 @@ var TablePage = function TablePage(props) {
|
|
4180
4182
|
onClose: closeAside
|
4181
4183
|
}) : null, rowChecked ? /*#__PURE__*/React.createElement(TableSelector, {
|
4182
4184
|
schema: schema,
|
4183
|
-
|
4185
|
+
actions: selectionActions
|
4184
4186
|
}) : null);
|
4185
4187
|
}
|
4186
4188
|
|
@@ -4261,24 +4263,32 @@ var TableSelector = function TableSelector(props) {
|
|
4261
4263
|
var all = pageContext.all,
|
4262
4264
|
checked = pageContext.checked;
|
4263
4265
|
var count = checked.size + "/" + all.length;
|
4264
|
-
var rows =
|
4265
|
-
return
|
4266
|
-
return item.id === id;
|
4267
|
-
});
|
4266
|
+
var rows = all.filter(function (item) {
|
4267
|
+
return checked.has(item.id);
|
4268
4268
|
});
|
4269
|
-
console.log(count, rows);
|
4270
4269
|
var table = {
|
4271
4270
|
columns: [{
|
4272
4271
|
id: "idMatricula",
|
4273
4272
|
label: "ID Matricula"
|
4274
4273
|
}],
|
4275
|
-
rows: []
|
4274
|
+
rows: rows || []
|
4276
4275
|
};
|
4276
|
+
var buttons = actions.map(function (_ref) {
|
4277
|
+
var label = _ref.label,
|
4278
|
+
_action = _ref.action;
|
4279
|
+
return /*#__PURE__*/React.createElement(Button$1, {
|
4280
|
+
label: label,
|
4281
|
+
raised: true,
|
4282
|
+
action: function action() {
|
4283
|
+
return _action(rows);
|
4284
|
+
}
|
4285
|
+
});
|
4286
|
+
});
|
4277
4287
|
return /*#__PURE__*/React.createElement("div", {
|
4278
4288
|
className: "table-selector"
|
4279
4289
|
}, /*#__PURE__*/React.createElement(Header, {
|
4280
4290
|
title: "Selection"
|
4281
|
-
}, count), /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement(DataTable, table)), /*#__PURE__*/React.createElement("footer", null,
|
4291
|
+
}, count), /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement(DataTable, table)), /*#__PURE__*/React.createElement("footer", null, buttons));
|
4282
4292
|
};
|
4283
4293
|
/**
|
4284
4294
|
* Table Queries
|
@@ -4479,20 +4489,20 @@ var TableEditor = function TableEditor(props) {
|
|
4479
4489
|
}),
|
4480
4490
|
rows: groups[groupName].map(function (item) {
|
4481
4491
|
item.checked = pageContext.checked ? pageContext.checked.has(item.id) : false;
|
4482
|
-
item.actions = actions ? actions.map(function (
|
4483
|
-
return
|
4484
|
-
icon:
|
4492
|
+
item.actions = actions ? actions.map(function (_action2) {
|
4493
|
+
return _action2.filter ? _action2.filter(item) ? /*#__PURE__*/React.createElement(Icon, {
|
4494
|
+
icon: _action2.icon,
|
4485
4495
|
clickable: true,
|
4486
4496
|
size: "small",
|
4487
4497
|
action: function action() {
|
4488
|
-
return run(
|
4498
|
+
return run(_action2, item);
|
4489
4499
|
}
|
4490
4500
|
}) : null : /*#__PURE__*/React.createElement(Icon, {
|
4491
|
-
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
|
});
|
4498
4508
|
}) : [];
|