arengibook 2.0.19-table → 2.0.20-table
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.js +7 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47950,6 +47950,10 @@ var Table = function Table(_ref1) {
|
|
|
47950
47950
|
_useState24 = _slicedToArray$c(_useState23, 2),
|
|
47951
47951
|
data = _useState24[0],
|
|
47952
47952
|
setData = _useState24[1];
|
|
47953
|
+
var onCellChangeRef = useRef(onCellChange);
|
|
47954
|
+
useEffect(function () {
|
|
47955
|
+
onCellChangeRef.current = onCellChange;
|
|
47956
|
+
}, [onCellChange]);
|
|
47953
47957
|
var updateRow = useCallback(function (rowId, field, newVal) {
|
|
47954
47958
|
setData(function (prev) {
|
|
47955
47959
|
var updated = prev.map(function (row) {
|
|
@@ -48360,7 +48364,7 @@ var Table = function Table(_ref1) {
|
|
|
48360
48364
|
}
|
|
48361
48365
|
}, [editable, rowEdit, textEditor, dateEditor, selectEditor, selectMultipleEditor, numericEditor, documentEditor, deviseEditor, treeSelectEditor]);
|
|
48362
48366
|
var onCellEditComplete = useCallback(function (e) {
|
|
48363
|
-
|
|
48367
|
+
var _onCellChangeRef$curr;
|
|
48364
48368
|
var rowData = e.rowData,
|
|
48365
48369
|
newRowData = e.newRowData,
|
|
48366
48370
|
field = e.field;
|
|
@@ -48374,12 +48378,12 @@ var Table = function Table(_ref1) {
|
|
|
48374
48378
|
});
|
|
48375
48379
|
setData(updated);
|
|
48376
48380
|
onChange === null || onChange === void 0 || onChange(updated);
|
|
48377
|
-
|
|
48381
|
+
(_onCellChangeRef$curr = onCellChangeRef.current) === null || _onCellChangeRef$curr === void 0 || _onCellChangeRef$curr.call(onCellChangeRef, {
|
|
48378
48382
|
rowData: rowData,
|
|
48379
48383
|
field: field,
|
|
48380
48384
|
newValue: newRowData[field]
|
|
48381
48385
|
});
|
|
48382
|
-
}, [data, onChange,
|
|
48386
|
+
}, [data, onChange, columns]);
|
|
48383
48387
|
|
|
48384
48388
|
/** Get the body renderer for a column based on its type */
|
|
48385
48389
|
var getBodyTemplate = useCallback(function (col) {
|