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.
package/dist/index.cjs CHANGED
@@ -4195,18 +4195,6 @@ var TableFilters = function TableFilters(props) {
4195
4195
 
4196
4196
 
4197
4197
  var TableEditor = function TableEditor(props) {
4198
- var run = function run(action) {
4199
- try {
4200
- return Promise.resolve(action.action(item.id, pageContext)).then(function () {
4201
- return Promise.resolve(pageContext.load()).then(function () {
4202
- setPageContext(Object.assign({}, pageContext));
4203
- });
4204
- });
4205
- } catch (e) {
4206
- return Promise.reject(e);
4207
- }
4208
- };
4209
-
4210
4198
  var select = function select(row, event) {
4211
4199
  try {
4212
4200
  clear();
@@ -4267,6 +4255,18 @@ var TableEditor = function TableEditor(props) {
4267
4255
  setPageContext(Object.assign({}, pageContext));
4268
4256
  }
4269
4257
 
4258
+ function run(action, item) {
4259
+ action.action(item.id, pageContext, function () {
4260
+ try {
4261
+ return Promise.resolve(pageContext.load()).then(function () {
4262
+ setPageContext(Object.assign({}, pageContext));
4263
+ });
4264
+ } catch (e) {
4265
+ return Promise.reject(e);
4266
+ }
4267
+ });
4268
+ }
4269
+
4270
4270
  function renderGroups() {
4271
4271
  var items = filter ? filter(all) : all;
4272
4272
  var groups = items.reduce(function (groups, filter) {
@@ -4297,12 +4297,19 @@ var TableEditor = function TableEditor(props) {
4297
4297
  }),
4298
4298
  rows: groups[groupName].map(function (item) {
4299
4299
  item.actions = actions ? actions.map(function (_action) {
4300
- return /*#__PURE__*/React__default["default"].createElement(Icon, {
4300
+ _action.filter ? _action.filter(item) ? /*#__PURE__*/React__default["default"].createElement(Icon, {
4301
+ icon: _action.icon,
4302
+ clickable: true,
4303
+ size: "small",
4304
+ action: function action() {
4305
+ return run(_action, item);
4306
+ }
4307
+ }) : null : /*#__PURE__*/React__default["default"].createElement(Icon, {
4301
4308
  icon: _action.icon,
4302
4309
  clickable: true,
4303
4310
  size: "small",
4304
4311
  action: function action() {
4305
- return run(_action);
4312
+ return run(_action, item);
4306
4313
  }
4307
4314
  });
4308
4315
  }) : [];