ywana-core8 0.1.71 → 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.
package/dist/index.cjs CHANGED
@@ -1297,6 +1297,13 @@ var ContentType = /*#__PURE__*/function () {
1297
1297
  }) : [];
1298
1298
  }
1299
1299
  break;
1300
+ case "Image":
1301
+ if (entryData) {
1302
+ next[name] = entryData;
1303
+ } else {
1304
+ next[name] = field["default"];
1305
+ }
1306
+ break;
1300
1307
  default:
1301
1308
  next[name] = field;
1302
1309
  break;
@@ -7666,6 +7673,11 @@ var CollectionEditor$2 = function CollectionEditor(_ref11) {
7666
7673
  onChange(id, next);
7667
7674
  }
7668
7675
  }
7676
+ function changeItem(index, fieldID, newValue) {
7677
+ var next = value.slice();
7678
+ next[index][fieldID] = newValue;
7679
+ onChange(id, next);
7680
+ }
7669
7681
  function reload() {
7670
7682
  if (onReload) onReload();
7671
7683
  }
@@ -7686,7 +7698,8 @@ var CollectionEditor$2 = function CollectionEditor(_ref11) {
7686
7698
  schema: item,
7687
7699
  groupBy: groupBy,
7688
7700
  canDelete: true,
7689
- remove: remove
7701
+ remove: remove,
7702
+ onChange: changeItem
7690
7703
  }), /*#__PURE__*/React__default["default"].createElement("footer", null, Feeder ? /*#__PURE__*/React__default["default"].createElement(Feeder, {
7691
7704
  onAdd: add,
7692
7705
  onReload: reload
@@ -7781,10 +7794,14 @@ var TableEditor$3 = function TableEditor(props) {
7781
7794
  remove = props.remove,
7782
7795
  filter = props.filter,
7783
7796
  actions = props.actions,
7784
- className = props.className;
7797
+ className = props.className,
7798
+ onChange = props.onChange;
7785
7799
  var _useState5 = React.useState(props.groupBy),
7786
7800
  groupBy = _useState5[0],
7787
7801
  setGroupBy = _useState5[1];
7802
+ function change(rowID, fieldID, value) {
7803
+ if (onChange) onChange(rowID, fieldID, value);
7804
+ }
7788
7805
  function changeGroup(id, value) {
7789
7806
  setGroupBy(value);
7790
7807
  }
@@ -7840,7 +7857,9 @@ var TableEditor$3 = function TableEditor(props) {
7840
7857
  };
7841
7858
  }),
7842
7859
  rows: groups[groupName].map(function (item, index) {
7843
- item.actions = actions ? actions.map(function (_action) {
7860
+ var row = Object.assign({}, item);
7861
+ if (!row.id) row.id = index;
7862
+ row.actions = actions ? actions.map(function (_action) {
7844
7863
  return _action.filter ? _action.filter(item) ? /*#__PURE__*/React__default["default"].createElement(Icon, {
7845
7864
  icon: _action.icon,
7846
7865
  clickable: true,
@@ -7857,7 +7876,7 @@ var TableEditor$3 = function TableEditor(props) {
7857
7876
  }
7858
7877
  });
7859
7878
  }) : [];
7860
- if (canDelete) item.actions.push(/*#__PURE__*/React__default["default"].createElement(Icon, {
7879
+ if (canDelete) row.actions.push(/*#__PURE__*/React__default["default"].createElement(Icon, {
7861
7880
  icon: "delete",
7862
7881
  size: "small",
7863
7882
  clickable: true,
@@ -7865,7 +7884,7 @@ var TableEditor$3 = function TableEditor(props) {
7865
7884
  return remove(index);
7866
7885
  }
7867
7886
  }));
7868
- return item;
7887
+ return row;
7869
7888
  })
7870
7889
  };
7871
7890
  table.columns.push({