ywana-core8 0.0.57 → 0.0.61

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.
@@ -4189,18 +4189,6 @@ var TableFilters = function TableFilters(props) {
4189
4189
 
4190
4190
 
4191
4191
  var TableEditor = function TableEditor(props) {
4192
- var run = function run(action) {
4193
- try {
4194
- return Promise.resolve(action.action(item.id, pageContext)).then(function () {
4195
- return Promise.resolve(pageContext.load()).then(function () {
4196
- setPageContext(Object.assign({}, pageContext));
4197
- });
4198
- });
4199
- } catch (e) {
4200
- return Promise.reject(e);
4201
- }
4202
- };
4203
-
4204
4192
  var select = function select(row, event) {
4205
4193
  try {
4206
4194
  clear();
@@ -4261,6 +4249,18 @@ var TableEditor = function TableEditor(props) {
4261
4249
  setPageContext(Object.assign({}, pageContext));
4262
4250
  }
4263
4251
 
4252
+ function run(action, item) {
4253
+ action.action(item.id, pageContext, function () {
4254
+ try {
4255
+ return Promise.resolve(pageContext.load()).then(function () {
4256
+ setPageContext(Object.assign({}, pageContext));
4257
+ });
4258
+ } catch (e) {
4259
+ return Promise.reject(e);
4260
+ }
4261
+ });
4262
+ }
4263
+
4264
4264
  function renderGroups() {
4265
4265
  var items = filter ? filter(all) : all;
4266
4266
  var groups = items.reduce(function (groups, filter) {
@@ -4291,12 +4291,19 @@ var TableEditor = function TableEditor(props) {
4291
4291
  }),
4292
4292
  rows: groups[groupName].map(function (item) {
4293
4293
  item.actions = actions ? actions.map(function (_action) {
4294
- return /*#__PURE__*/React.createElement(Icon, {
4294
+ _action.filter ? _action.filter(item) ? /*#__PURE__*/React.createElement(Icon, {
4295
+ icon: _action.icon,
4296
+ clickable: true,
4297
+ size: "small",
4298
+ action: function action() {
4299
+ return run(_action, item);
4300
+ }
4301
+ }) : null : /*#__PURE__*/React.createElement(Icon, {
4295
4302
  icon: _action.icon,
4296
4303
  clickable: true,
4297
4304
  size: "small",
4298
4305
  action: function action() {
4299
- return run(_action);
4306
+ return run(_action, item);
4300
4307
  }
4301
4308
  });
4302
4309
  }) : [];