ywana-core8 0.0.62 → 0.0.66

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.
@@ -3996,6 +3996,8 @@ var TablePage = function TablePage(props) {
3996
3996
  editable = props.editable,
3997
3997
  _props$canAdd = props.canAdd,
3998
3998
  canAdd = _props$canAdd === void 0 ? true : _props$canAdd,
3999
+ _props$canDelete = props.canDelete,
4000
+ canDelete = _props$canDelete === void 0 ? true : _props$canDelete,
3999
4001
  _props$dev = props.dev,
4000
4002
  dev = _props$dev === void 0 ? false : _props$dev,
4001
4003
  _props$autosave = props.autosave,
@@ -4049,8 +4051,7 @@ var TablePage = function TablePage(props) {
4049
4051
  } catch (e) {
4050
4052
  return Promise.reject(e);
4051
4053
  }
4052
- }; //site.openDialog(<EditContentDialog label={`Crear ${name}`} type={schema} onOK={onOK} validator={validator} />);
4053
-
4054
+ };
4054
4055
 
4055
4056
  site.openDialog( /*#__PURE__*/React.createElement(CreateContentDialog$1, {
4056
4057
  label: "Crear " + name,
@@ -4124,7 +4125,8 @@ var TablePage = function TablePage(props) {
4124
4125
  editable: editable,
4125
4126
  groupBy: groupBy,
4126
4127
  filter: tableFilter,
4127
- actions: tableActions
4128
+ actions: tableActions,
4129
+ canDelete: canDelete
4128
4130
  })), renderAside());
4129
4131
  };
4130
4132
  /**
@@ -4221,6 +4223,7 @@ var TableEditor = function TableEditor(props) {
4221
4223
  title = props.title,
4222
4224
  schema = props.schema,
4223
4225
  editable = props.editable,
4226
+ canDelete = props.canDelete,
4224
4227
  filter = props.filter,
4225
4228
  actions = props.actions;
4226
4229
 
@@ -4291,14 +4294,14 @@ var TableEditor = function TableEditor(props) {
4291
4294
  }),
4292
4295
  rows: groups[groupName].map(function (item) {
4293
4296
  item.actions = actions ? actions.map(function (_action) {
4294
- _action.filter ? _action.filter(item) ? /*#__PURE__*/React.createElement(Icon, {
4297
+ return _action.filter ? _action.filter(item) ? /*#__PURE__*/React.createElement(Icon, {
4295
4298
  icon: _action.icon,
4296
4299
  clickable: true,
4297
4300
  size: "small",
4298
4301
  action: function action() {
4299
4302
  return run(_action, item);
4300
4303
  }
4301
- }) : 'x' : /*#__PURE__*/React.createElement(Icon, {
4304
+ }) : null : /*#__PURE__*/React.createElement(Icon, {
4302
4305
  icon: _action.icon,
4303
4306
  clickable: true,
4304
4307
  size: "small",
@@ -4307,7 +4310,7 @@ var TableEditor = function TableEditor(props) {
4307
4310
  }
4308
4311
  });
4309
4312
  }) : [];
4310
- item.actions.push( /*#__PURE__*/React.createElement(Icon, {
4313
+ if (canDelete) item.actions.push( /*#__PURE__*/React.createElement(Icon, {
4311
4314
  icon: "delete",
4312
4315
  size: "small",
4313
4316
  clickable: true,
@@ -4331,33 +4334,6 @@ var TableEditor = function TableEditor(props) {
4331
4334
  })));
4332
4335
  });
4333
4336
  }
4334
- /* DUPLIDCADO
4335
- const table = {
4336
- columns: Object.values(schema)
4337
- .filter(field => field.column === true)
4338
- .map(field => {
4339
- let options = field.options;
4340
- if (options && typeof (options) == 'function') {
4341
- options = options()
4342
- }
4343
- return {
4344
- id: field.id,
4345
- label: field.label,
4346
- type: field.type,
4347
- onChange: field.editable ? change : null,
4348
- options
4349
- }
4350
- }),
4351
- rows: all
4352
- .map(item => {
4353
- item.actions = [<Icon icon="delete" size="small" clickable action={() => remove(item.id)} />]
4354
- return item
4355
- })
4356
- }
4357
-
4358
- table.columns.push({ id: "actions" })
4359
- */
4360
-
4361
4337
 
4362
4338
  function buildGroupOptions(schema) {
4363
4339
  return Object.values(schema).filter(function (field) {