ywana-core8 0.1.72 → 0.1.73

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.
@@ -7664,6 +7664,11 @@ var CollectionEditor$2 = function CollectionEditor(_ref11) {
7664
7664
  onChange(id, next);
7665
7665
  }
7666
7666
  }
7667
+ function changeItem(index, fieldID, newValue) {
7668
+ var next = value.slice();
7669
+ next[index][fieldID] = newValue;
7670
+ onChange(id, next);
7671
+ }
7667
7672
  function reload() {
7668
7673
  if (onReload) onReload();
7669
7674
  }
@@ -7684,7 +7689,8 @@ var CollectionEditor$2 = function CollectionEditor(_ref11) {
7684
7689
  schema: item,
7685
7690
  groupBy: groupBy,
7686
7691
  canDelete: true,
7687
- remove: remove
7692
+ remove: remove,
7693
+ onChange: changeItem
7688
7694
  }), /*#__PURE__*/React.createElement("footer", null, Feeder ? /*#__PURE__*/React.createElement(Feeder, {
7689
7695
  onAdd: add,
7690
7696
  onReload: reload
@@ -7779,10 +7785,14 @@ var TableEditor$3 = function TableEditor(props) {
7779
7785
  remove = props.remove,
7780
7786
  filter = props.filter,
7781
7787
  actions = props.actions,
7782
- className = props.className;
7788
+ className = props.className,
7789
+ onChange = props.onChange;
7783
7790
  var _useState5 = useState(props.groupBy),
7784
7791
  groupBy = _useState5[0],
7785
7792
  setGroupBy = _useState5[1];
7793
+ function change(rowID, fieldID, value) {
7794
+ if (onChange) onChange(rowID, fieldID, value);
7795
+ }
7786
7796
  function changeGroup(id, value) {
7787
7797
  setGroupBy(value);
7788
7798
  }
@@ -7838,7 +7848,9 @@ var TableEditor$3 = function TableEditor(props) {
7838
7848
  };
7839
7849
  }),
7840
7850
  rows: groups[groupName].map(function (item, index) {
7841
- item.actions = actions ? actions.map(function (_action) {
7851
+ var row = Object.assign({}, item);
7852
+ if (!row.id) row.id = index;
7853
+ row.actions = actions ? actions.map(function (_action) {
7842
7854
  return _action.filter ? _action.filter(item) ? /*#__PURE__*/React.createElement(Icon, {
7843
7855
  icon: _action.icon,
7844
7856
  clickable: true,
@@ -7855,7 +7867,7 @@ var TableEditor$3 = function TableEditor(props) {
7855
7867
  }
7856
7868
  });
7857
7869
  }) : [];
7858
- if (canDelete) item.actions.push(/*#__PURE__*/React.createElement(Icon, {
7870
+ if (canDelete) row.actions.push(/*#__PURE__*/React.createElement(Icon, {
7859
7871
  icon: "delete",
7860
7872
  size: "small",
7861
7873
  clickable: true,
@@ -7863,7 +7875,7 @@ var TableEditor$3 = function TableEditor(props) {
7863
7875
  return remove(index);
7864
7876
  }
7865
7877
  }));
7866
- return item;
7878
+ return row;
7867
7879
  })
7868
7880
  };
7869
7881
  table.columns.push({