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.
- package/dist/index.cjs +17 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +17 -5
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +17 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.js +17 -5
- package/src/domain/ContentEditor.test.js +10 -1
package/dist/index.umd.js
CHANGED
@@ -7666,6 +7666,11 @@
|
|
7666
7666
|
onChange(id, next);
|
7667
7667
|
}
|
7668
7668
|
}
|
7669
|
+
function changeItem(index, fieldID, newValue) {
|
7670
|
+
var next = value.slice();
|
7671
|
+
next[index][fieldID] = newValue;
|
7672
|
+
onChange(id, next);
|
7673
|
+
}
|
7669
7674
|
function reload() {
|
7670
7675
|
if (onReload) onReload();
|
7671
7676
|
}
|
@@ -7686,7 +7691,8 @@
|
|
7686
7691
|
schema: item,
|
7687
7692
|
groupBy: groupBy,
|
7688
7693
|
canDelete: true,
|
7689
|
-
remove: remove
|
7694
|
+
remove: remove,
|
7695
|
+
onChange: changeItem
|
7690
7696
|
}), /*#__PURE__*/React__default["default"].createElement("footer", null, Feeder ? /*#__PURE__*/React__default["default"].createElement(Feeder, {
|
7691
7697
|
onAdd: add,
|
7692
7698
|
onReload: reload
|
@@ -7781,10 +7787,14 @@
|
|
7781
7787
|
remove = props.remove,
|
7782
7788
|
filter = props.filter,
|
7783
7789
|
actions = props.actions,
|
7784
|
-
className = props.className
|
7790
|
+
className = props.className,
|
7791
|
+
onChange = props.onChange;
|
7785
7792
|
var _useState5 = React.useState(props.groupBy),
|
7786
7793
|
groupBy = _useState5[0],
|
7787
7794
|
setGroupBy = _useState5[1];
|
7795
|
+
function change(rowID, fieldID, value) {
|
7796
|
+
if (onChange) onChange(rowID, fieldID, value);
|
7797
|
+
}
|
7788
7798
|
function changeGroup(id, value) {
|
7789
7799
|
setGroupBy(value);
|
7790
7800
|
}
|
@@ -7840,7 +7850,9 @@
|
|
7840
7850
|
};
|
7841
7851
|
}),
|
7842
7852
|
rows: groups[groupName].map(function (item, index) {
|
7843
|
-
|
7853
|
+
var row = Object.assign({}, item);
|
7854
|
+
if (!row.id) row.id = index;
|
7855
|
+
row.actions = actions ? actions.map(function (_action) {
|
7844
7856
|
return _action.filter ? _action.filter(item) ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
7845
7857
|
icon: _action.icon,
|
7846
7858
|
clickable: true,
|
@@ -7857,7 +7869,7 @@
|
|
7857
7869
|
}
|
7858
7870
|
});
|
7859
7871
|
}) : [];
|
7860
|
-
if (canDelete)
|
7872
|
+
if (canDelete) row.actions.push(/*#__PURE__*/React__default["default"].createElement(Icon, {
|
7861
7873
|
icon: "delete",
|
7862
7874
|
size: "small",
|
7863
7875
|
clickable: true,
|
@@ -7865,7 +7877,7 @@
|
|
7865
7877
|
return remove(index);
|
7866
7878
|
}
|
7867
7879
|
}));
|
7868
|
-
return
|
7880
|
+
return row;
|
7869
7881
|
})
|
7870
7882
|
};
|
7871
7883
|
table.columns.push({
|