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