@economic/taco 2.69.2-search-race-condition.0 → 2.69.2-search-race-condition.1
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/taco.cjs +99 -63
- package/dist/taco.cjs.map +1 -1
- package/dist/taco.d.ts +4 -4
- package/dist/taco.js +99 -63
- package/dist/taco.js.map +1 -1
- package/package.json +3 -17
package/dist/taco.d.ts
CHANGED
@@ -1057,7 +1057,7 @@ export declare type DialogContentDrawerRenderProps = DialogContext['drawer'];
|
|
1057
1057
|
export declare type DialogContentProps = Omit<React_2.HTMLAttributes<HTMLDivElement>, 'children'> & {
|
1058
1058
|
/** An accessible label to be announced when the dialog is opened */
|
1059
1059
|
'aria-label': string;
|
1060
|
-
children:
|
1060
|
+
children: React_2.ReactNode | ((props: DialogContentRenderProps) => React_2.ReactNode);
|
1061
1061
|
onOpenAutoFocus?: DialogPrimitive.DialogContentProps['onOpenAutoFocus'];
|
1062
1062
|
onCloseAutoFocus?: DialogPrimitive.DialogContentProps['onCloseAutoFocus'];
|
1063
1063
|
};
|
@@ -1165,7 +1165,7 @@ declare type DrawerCloseProps = default_2.HTMLAttributes<HTMLButtonElement>;
|
|
1165
1165
|
declare type DrawerContentProps = Omit<default_2.HTMLAttributes<HTMLDivElement>, 'children'> & {
|
1166
1166
|
/** An accessible label to be announced when the side drawer is opened */
|
1167
1167
|
'aria-label': string;
|
1168
|
-
children:
|
1168
|
+
children: default_2.ReactNode | ((props: DrawerContentRenderProps) => default_2.ReactNode);
|
1169
1169
|
};
|
1170
1170
|
|
1171
1171
|
declare type DrawerContentRenderProps = {
|
@@ -3071,7 +3071,7 @@ export declare type Table3Ref = TableRef & {
|
|
3071
3071
|
createRow?: (row: unknown) => Promise<void>;
|
3072
3072
|
save: (rowId?: string) => Promise<boolean>;
|
3073
3073
|
removeRowChanges: (rowId: string) => Promise<void>;
|
3074
|
-
forceValidate
|
3074
|
+
forceValidate?: () => Promise<string[]>;
|
3075
3075
|
};
|
3076
3076
|
};
|
3077
3077
|
};
|
@@ -3930,7 +3930,7 @@ export declare const Truncate: ({ children, tooltip }: TruncateProps) => default
|
|
3930
3930
|
|
3931
3931
|
export declare type TruncateProps = {
|
3932
3932
|
children: default_2.ReactElement;
|
3933
|
-
tooltip: string;
|
3933
|
+
tooltip: string | JSX.Element;
|
3934
3934
|
};
|
3935
3935
|
|
3936
3936
|
export declare interface UncontrolledCheckboxProps extends CheckboxBaseProps {
|
package/dist/taco.js
CHANGED
@@ -45080,10 +45080,10 @@ function Search$1(props) {
|
|
45080
45080
|
};
|
45081
45081
|
const [loading, setLoading] = React__default.useState(false);
|
45082
45082
|
const handleSearch = React__default.useCallback(
|
45083
|
-
_.debounce((query2) => {
|
45083
|
+
_.debounce((query2, hiddenColumns2) => {
|
45084
45084
|
var _a2, _b, _c;
|
45085
45085
|
setLoading(true);
|
45086
|
-
(_c = (_b = (_a2 = tableMeta.search).handleSearch) == null ? void 0 : _b.call(_a2, query2,
|
45086
|
+
(_c = (_b = (_a2 = tableMeta.search).handleSearch) == null ? void 0 : _b.call(_a2, query2, hiddenColumns2)) == null ? void 0 : _c.then(() => {
|
45087
45087
|
setLoading(false);
|
45088
45088
|
});
|
45089
45089
|
}, 400),
|
@@ -45092,7 +45092,7 @@ function Search$1(props) {
|
|
45092
45092
|
const handleChange = (query2) => {
|
45093
45093
|
table.setGlobalFilter(String(query2 ?? ""));
|
45094
45094
|
if (tableMeta.search.enableGlobalFilter && tableMeta.search.handleSearch) {
|
45095
|
-
handleSearch(query2);
|
45095
|
+
handleSearch(query2, hiddenColumns);
|
45096
45096
|
}
|
45097
45097
|
};
|
45098
45098
|
const handleToggleExcludeUnmatchedResults = async (enabled) => {
|
@@ -49633,7 +49633,14 @@ const EditPopover = (props) => {
|
|
49633
49633
|
onChangeColor: setColor,
|
49634
49634
|
onKeyDown: preventKeyDownPropagation
|
49635
49635
|
}
|
49636
|
-
)) : null, /* @__PURE__ */ React__default.createElement(Group$6, null, /* @__PURE__ */ React__default.createElement(Button$4, { onClick: close }, texts.select2.cancel), /* @__PURE__ */ React__default.createElement(
|
49636
|
+
)) : null, /* @__PURE__ */ React__default.createElement(Group$6, null, /* @__PURE__ */ React__default.createElement(Button$4, { onClick: close }, texts.select2.cancel), /* @__PURE__ */ React__default.createElement(
|
49637
|
+
Button$4,
|
49638
|
+
{
|
49639
|
+
appearance: "primary",
|
49640
|
+
onClick: handleSave(close)
|
49641
|
+
},
|
49642
|
+
texts.select2.save
|
49643
|
+
))) : null, onEdit && onDelete ? /* @__PURE__ */ React__default.createElement("hr", null) : null, onDelete ? /* @__PURE__ */ React__default.createElement(
|
49637
49644
|
"button",
|
49638
49645
|
{
|
49639
49646
|
className: "hover:text-grey-700 flex items-center justify-start gap-1",
|
@@ -50899,6 +50906,7 @@ function Control(props) {
|
|
50899
50906
|
const controlRenderer = (_a = column == null ? void 0 : column.columnDef.meta) == null ? void 0 : _a.control;
|
50900
50907
|
const dataType = (_b = column == null ? void 0 : column.columnDef.meta) == null ? void 0 : _b.dataType;
|
50901
50908
|
const filters = React__default.useContext(FilterContext);
|
50909
|
+
const ref = React__default.useRef(null);
|
50902
50910
|
useEffect(() => {
|
50903
50911
|
if ((controlRenderer === "switch" || controlRenderer === "checkbox") && value === void 0) {
|
50904
50912
|
onChange(false);
|
@@ -50908,8 +50916,9 @@ function Control(props) {
|
|
50908
50916
|
const control = controlRenderer(
|
50909
50917
|
{
|
50910
50918
|
...attributes,
|
50911
|
-
setValue:
|
50912
|
-
value
|
50919
|
+
setValue: onChange,
|
50920
|
+
value,
|
50921
|
+
ref
|
50913
50922
|
},
|
50914
50923
|
void 0,
|
50915
50924
|
filters
|
@@ -57171,7 +57180,9 @@ const useRowSelect = (onSelectedRows) => {
|
|
57171
57180
|
const { onChange: _2, ...props } = getToggleAllRowsSelectedProps();
|
57172
57181
|
const onChange = (checked) => {
|
57173
57182
|
if (checked) {
|
57174
|
-
onSelectedRows(
|
57183
|
+
onSelectedRows(
|
57184
|
+
Object.assign({}, Array.from({ length: rows.length }).fill(true))
|
57185
|
+
);
|
57175
57186
|
} else {
|
57176
57187
|
onSelectedRows({});
|
57177
57188
|
}
|
@@ -60618,7 +60629,8 @@ var setWithExports = requireSetWith();
|
|
60618
60629
|
const setWith = /* @__PURE__ */ getDefaultExportFromCjs(setWithExports);
|
60619
60630
|
const DELAY_BEFORE_REMOVING_SAVE_STATUS = 3e3;
|
60620
60631
|
function reducer(state, action) {
|
60621
|
-
|
60632
|
+
var _a;
|
60633
|
+
const { type, payload } = action;
|
60622
60634
|
switch (type) {
|
60623
60635
|
case "setCellValue": {
|
60624
60636
|
const { columnId, index: index2, row, value } = payload;
|
@@ -60626,26 +60638,26 @@ function reducer(state, action) {
|
|
60626
60638
|
...state,
|
60627
60639
|
changes: {
|
60628
60640
|
...state.changes,
|
60629
|
-
rows: setWith(state.changes.rows, `${rowId}.${columnId}`, value, Object),
|
60630
|
-
originals: setWith(state.changes.originals, rowId, row, Object),
|
60631
|
-
dirty: setWith(state.changes.dirty, rowId, true, Object)
|
60641
|
+
rows: setWith(state.changes.rows, `${action.rowId}.${columnId}`, value, Object),
|
60642
|
+
originals: setWith(state.changes.originals, action.rowId, row, Object),
|
60643
|
+
dirty: setWith(state.changes.dirty, action.rowId, true, Object)
|
60632
60644
|
},
|
60633
|
-
indexes: setWith(state.indexes, rowId, index2, Object)
|
60645
|
+
indexes: setWith(state.indexes, action.rowId, index2, Object)
|
60634
60646
|
};
|
60635
60647
|
}
|
60636
60648
|
case "removeCellValue": {
|
60637
60649
|
const { columnId, rowIdentityAccessor } = payload;
|
60638
|
-
const changes = omit$1(state.changes.rows, `${rowId}.${columnId}`);
|
60639
|
-
if (!Object.keys(changes[rowId]).length) {
|
60640
|
-
return reducer(state, { type: "removeRow", rowId, payload: { rowIdentityAccessor } });
|
60650
|
+
const changes = omit$1(state.changes.rows, `${action.rowId}.${columnId}`);
|
60651
|
+
if (!Object.keys(changes[action.rowId]).length) {
|
60652
|
+
return reducer(state, { type: "removeRow", rowId: action.rowId, payload: { rowIdentityAccessor } });
|
60641
60653
|
}
|
60642
60654
|
return {
|
60643
60655
|
...state,
|
60644
60656
|
changes: {
|
60645
60657
|
...state.changes,
|
60646
|
-
rows: omit$1(state.changes.rows, `${rowId}.${columnId}`),
|
60647
|
-
errors: omit$1(state.changes.errors, `${rowId}.cells.${columnId}`),
|
60648
|
-
moveReasons: omit$1(state.changes.moveReasons, `${rowId}.${columnId}`)
|
60658
|
+
rows: omit$1(state.changes.rows, `${action.rowId}.${columnId}`),
|
60659
|
+
errors: omit$1(state.changes.errors, `${action.rowId}.cells.${columnId}`),
|
60660
|
+
moveReasons: omit$1(state.changes.moveReasons, `${action.rowId}.${columnId}`)
|
60649
60661
|
}
|
60650
60662
|
};
|
60651
60663
|
}
|
@@ -60655,24 +60667,28 @@ function reducer(state, action) {
|
|
60655
60667
|
...state,
|
60656
60668
|
changes: {
|
60657
60669
|
...state.changes,
|
60658
|
-
rows: setWith(state.changes.rows, rowId, value, Object),
|
60670
|
+
rows: setWith(state.changes.rows, action.rowId, value, Object),
|
60659
60671
|
errors: setWith(
|
60660
60672
|
state.changes.errors,
|
60661
|
-
`${rowId}.cells`,
|
60662
|
-
cellErrors ?? state.changes.errors.
|
60673
|
+
`${action.rowId}.cells`,
|
60674
|
+
cellErrors ?? ((_a = state.changes.errors[action.rowId]) == null ? void 0 : _a.cells),
|
60675
|
+
Object
|
60676
|
+
),
|
60677
|
+
originals: setWith(
|
60678
|
+
state.changes.originals,
|
60679
|
+
action.rowId,
|
60680
|
+
original ?? state.changes.originals[action.rowId],
|
60663
60681
|
Object
|
60664
60682
|
),
|
60665
|
-
originals: setWith(state.changes.originals, rowId, original ?? state.changes.originals[rowId], Object),
|
60666
60683
|
moveReasons: setWith(
|
60667
60684
|
state.changes.moveReasons,
|
60668
|
-
rowId,
|
60669
|
-
moveReasons ?? state.changes.moveReasons[rowId],
|
60685
|
+
action.rowId,
|
60686
|
+
moveReasons ?? state.changes.moveReasons[action.rowId],
|
60670
60687
|
Object
|
60671
|
-
)
|
60672
|
-
// status can be undefined, so don't use ??
|
60673
|
-
status: setWith(state.changes.status, rowId, void 0, Object)
|
60688
|
+
)
|
60674
60689
|
},
|
60675
|
-
indexes: setWith(state.indexes, rowId, index2, Object)
|
60690
|
+
indexes: setWith(state.indexes, action.rowId, index2, Object),
|
60691
|
+
statuses: omit$1(state.statuses, action.rowId)
|
60676
60692
|
};
|
60677
60693
|
}
|
60678
60694
|
case "removeRow": {
|
@@ -60681,28 +60697,27 @@ function reducer(state, action) {
|
|
60681
60697
|
...state,
|
60682
60698
|
changes: {
|
60683
60699
|
...state.changes,
|
60684
|
-
rows: omit$1(state.changes.rows, rowId),
|
60685
|
-
errors: omit$1(state.changes.errors, rowId),
|
60686
|
-
moveReasons: omit$1(state.changes.moveReasons, rowId),
|
60687
|
-
originals: omit$1(state.changes.originals, rowId),
|
60688
|
-
|
60689
|
-
dirty: omit$1(state.changes.dirty, rowId)
|
60700
|
+
rows: omit$1(state.changes.rows, action.rowId),
|
60701
|
+
errors: omit$1(state.changes.errors, action.rowId),
|
60702
|
+
moveReasons: omit$1(state.changes.moveReasons, action.rowId),
|
60703
|
+
originals: omit$1(state.changes.originals, action.rowId),
|
60704
|
+
dirty: omit$1(state.changes.dirty, action.rowId)
|
60690
60705
|
},
|
60691
|
-
indexes: omit$1(state.indexes, rowId),
|
60692
|
-
temporaryRows: state.temporaryRows.filter((row) => row[rowIdentityAccessor] !== rowId)
|
60706
|
+
indexes: omit$1(state.indexes, action.rowId),
|
60707
|
+
temporaryRows: state.temporaryRows.filter((row) => row[rowIdentityAccessor] !== action.rowId)
|
60693
60708
|
};
|
60694
60709
|
}
|
60695
60710
|
case "complete": {
|
60696
60711
|
const { changes, handleDiscard } = payload;
|
60697
|
-
if (JSON.stringify(changes) !== JSON.stringify(state.changes.rows[rowId])) {
|
60712
|
+
if (JSON.stringify(changes) !== JSON.stringify(state.changes.rows[action.rowId])) {
|
60698
60713
|
return {
|
60699
60714
|
...state,
|
60700
60715
|
changes: {
|
60701
60716
|
...state.changes,
|
60702
60717
|
originals: setWith(
|
60703
60718
|
state.changes.originals,
|
60704
|
-
rowId,
|
60705
|
-
{ ...state.changes.originals[rowId], ...changes },
|
60719
|
+
action.rowId,
|
60720
|
+
{ ...state.changes.originals[action.rowId], ...changes },
|
60706
60721
|
Object
|
60707
60722
|
)
|
60708
60723
|
}
|
@@ -60715,12 +60730,15 @@ function reducer(state, action) {
|
|
60715
60730
|
}
|
60716
60731
|
case "setRowStatus": {
|
60717
60732
|
const { status } = payload;
|
60733
|
+
if (status) {
|
60734
|
+
return {
|
60735
|
+
...state,
|
60736
|
+
statuses: setWith(state.statuses, action.rowId, status, Object)
|
60737
|
+
};
|
60738
|
+
}
|
60718
60739
|
return {
|
60719
60740
|
...state,
|
60720
|
-
|
60721
|
-
...state.changes,
|
60722
|
-
status: status ? setWith(state.changes.status, rowId, status, Object) : omit$1(state.changes.status, rowId)
|
60723
|
-
}
|
60741
|
+
statuses: omit$1(state.statuses, action.rowId)
|
60724
60742
|
};
|
60725
60743
|
}
|
60726
60744
|
case "setRowErrors": {
|
@@ -60729,7 +60747,7 @@ function reducer(state, action) {
|
|
60729
60747
|
...state,
|
60730
60748
|
changes: {
|
60731
60749
|
...state.changes,
|
60732
|
-
errors: setWith(state.changes.errors, rowId, errors, Object)
|
60750
|
+
errors: setWith(state.changes.errors, action.rowId, errors, Object)
|
60733
60751
|
}
|
60734
60752
|
};
|
60735
60753
|
}
|
@@ -60740,10 +60758,10 @@ function reducer(state, action) {
|
|
60740
60758
|
temporaryRows: state.temporaryRows.concat(value),
|
60741
60759
|
changes: {
|
60742
60760
|
...state.changes,
|
60743
|
-
rows: setWith(state.changes.rows, rowId, value, Object),
|
60744
|
-
originals: setWith(state.changes.originals, rowId, value, Object)
|
60761
|
+
rows: setWith(state.changes.rows, action.rowId, value, Object),
|
60762
|
+
originals: setWith(state.changes.originals, action.rowId, value, Object)
|
60745
60763
|
},
|
60746
|
-
indexes: setWith(state.indexes, rowId, index2, Object)
|
60764
|
+
indexes: setWith(state.indexes, action.rowId, index2, Object)
|
60747
60765
|
};
|
60748
60766
|
}
|
60749
60767
|
case "forceValidate": {
|
@@ -60760,9 +60778,10 @@ function reducer(state, action) {
|
|
60760
60778
|
function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIdentityAccessor, validator) {
|
60761
60779
|
const localization = useLocalization();
|
60762
60780
|
const [state, dispatch] = React__default.useReducer(reducer, {
|
60763
|
-
changes: { rows: {}, errors: {}, moveReasons: {}, originals: {},
|
60781
|
+
changes: { rows: {}, errors: {}, moveReasons: {}, originals: {}, dirty: {} },
|
60764
60782
|
indexes: {},
|
60765
|
-
temporaryRows: []
|
60783
|
+
temporaryRows: [],
|
60784
|
+
statuses: {}
|
60766
60785
|
});
|
60767
60786
|
function getRowValue(rowId) {
|
60768
60787
|
var _a;
|
@@ -60790,7 +60809,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
60790
60809
|
return !!((_b = state.changes.errors[rowId]) == null ? void 0 : _b.row) || !!Object.keys(((_c = state.changes.errors[rowId]) == null ? void 0 : _c.cells) ?? {}).length;
|
60791
60810
|
}
|
60792
60811
|
function getRowStatus(rowId) {
|
60793
|
-
return state.
|
60812
|
+
return state.statuses[rowId];
|
60794
60813
|
}
|
60795
60814
|
function setRowStatus(rowId, status) {
|
60796
60815
|
dispatch({
|
@@ -60801,6 +60820,12 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
60801
60820
|
}
|
60802
60821
|
});
|
60803
60822
|
}
|
60823
|
+
function showSavedStatus(rowId) {
|
60824
|
+
setRowStatus(rowId, "saved");
|
60825
|
+
setTimeout(() => {
|
60826
|
+
setRowStatus(rowId, void 0);
|
60827
|
+
}, DELAY_BEFORE_REMOVING_SAVE_STATUS);
|
60828
|
+
}
|
60804
60829
|
function insertTemporaryRow(data, rowIndex) {
|
60805
60830
|
const newRowId = `${TEMPORARY_ROW_ID_PREFIX}${nanoid()}`;
|
60806
60831
|
const value = {
|
@@ -60927,7 +60952,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
60927
60952
|
newState.changes.originals[row.id] = row.original;
|
60928
60953
|
newState.changes.moveReasons[row.id] = { ...newState.changes.moveReasons[row.id] };
|
60929
60954
|
newState.changes.rows[row.id] = { ...newState.changes.rows[row.id] };
|
60930
|
-
newState.
|
60955
|
+
newState.statuses[row.id] = "errored";
|
60931
60956
|
newState.indexes[row.id] = index2;
|
60932
60957
|
newState.changes.errors[row.id] = {
|
60933
60958
|
cells: cellErrors,
|
@@ -60968,7 +60993,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
60968
60993
|
}));
|
60969
60994
|
}
|
60970
60995
|
function hasSaved() {
|
60971
|
-
return !!Object.values(state.
|
60996
|
+
return !!Object.values(state.statuses).filter((status) => status === "saved").length;
|
60972
60997
|
}
|
60973
60998
|
function hasChanges(rowId) {
|
60974
60999
|
return rowId ? !!state.changes.rows[rowId] : !!Object.keys(state.changes.rows).length;
|
@@ -61007,10 +61032,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
61007
61032
|
}
|
61008
61033
|
await handleSave(changeSet);
|
61009
61034
|
complete(rowId2, table, rowChanges);
|
61010
|
-
|
61011
|
-
setTimeout(() => {
|
61012
|
-
setRowStatus(rowId2, void 0);
|
61013
|
-
}, DELAY_BEFORE_REMOVING_SAVE_STATUS);
|
61035
|
+
showSavedStatus(rowId2);
|
61014
61036
|
} catch (error) {
|
61015
61037
|
if (error instanceof ReferenceError || error instanceof TypeError || ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.status) >= 500) {
|
61016
61038
|
console.error(error);
|
@@ -61193,7 +61215,8 @@ function RowMoveIndicator(props) {
|
|
61193
61215
|
const { cell, cellRef, isActiveRow } = props;
|
61194
61216
|
const { texts } = useLocalization();
|
61195
61217
|
const [show, setShow] = React__default.useState(false);
|
61196
|
-
const
|
61218
|
+
const table = cell.getContext().table;
|
61219
|
+
const tableMeta = table.options.meta;
|
61197
61220
|
const columnMeta = cell.column.columnDef.meta ?? {};
|
61198
61221
|
const moveReason = tableMeta.editing.getRowMoveReason(cell.row.id);
|
61199
61222
|
React__default.useEffect(() => {
|
@@ -61221,7 +61244,15 @@ function RowMoveIndicator(props) {
|
|
61221
61244
|
return null;
|
61222
61245
|
}
|
61223
61246
|
const { title, description } = getMessageFromReason(texts, moveReason);
|
61224
|
-
|
61247
|
+
let columnHeader = columnMeta.header;
|
61248
|
+
if (moveReason === "sorting") {
|
61249
|
+
const sortedColumns = table.getState().sorting;
|
61250
|
+
const sortedColumn = table.getColumn(sortedColumns[0].id);
|
61251
|
+
if (sortedColumn) {
|
61252
|
+
columnHeader = sortedColumn.columnDef.meta.header;
|
61253
|
+
}
|
61254
|
+
}
|
61255
|
+
return /* @__PURE__ */ React__default.createElement(Tooltip$3, { placement: "bottom", title: description.replace("[COLUMN]", columnHeader) }, /* @__PURE__ */ React__default.createElement("span", { "data-row-move-indicator": true }, /* @__PURE__ */ React__default.createElement(Icon$1, { name: "info", className: "-mt-0.5 mr-1 !h-4 !w-4 rounded-full bg-white !p-0 text-blue-500" }), title));
|
61225
61256
|
}
|
61226
61257
|
function getMessageFromReason(texts, reason) {
|
61227
61258
|
let title;
|
@@ -61390,10 +61421,17 @@ function EditingControlCell(props) {
|
|
61390
61421
|
const handleFocus = useEditingCellAutofocus(props);
|
61391
61422
|
const value = cell.getValue();
|
61392
61423
|
const rowChanges = tableMeta.editing.getRowValue(cell.row.id);
|
61424
|
+
const shouldRunUpdate = React__default.useRef(false);
|
61393
61425
|
const hasNonTextControl = React__default.useMemo(() => {
|
61394
61426
|
var _a;
|
61395
61427
|
return typeof type === "function" && !!((_a = cellRef.current) == null ? void 0 : _a.querySelector('[data-taco="Select2"],[data-taco="switch"],[data-taco="checkbox"]'));
|
61396
61428
|
}, [cellRef.current]);
|
61429
|
+
useLazyEffect(() => {
|
61430
|
+
if (hasNonTextControl && shouldRunUpdate.current) {
|
61431
|
+
tableMeta.editing.onCellChanged(cell, rowIndex, value, true, false);
|
61432
|
+
shouldRunUpdate.current = false;
|
61433
|
+
}
|
61434
|
+
}, [value]);
|
61397
61435
|
const handleChange = React__default.useCallback(
|
61398
61436
|
(nextValue) => {
|
61399
61437
|
let hasChanged = false;
|
@@ -61410,9 +61448,7 @@ function EditingControlCell(props) {
|
|
61410
61448
|
}
|
61411
61449
|
if (hasChanged) {
|
61412
61450
|
tableMeta.editing.setCellValue(cell, rowIndex, nextValue);
|
61413
|
-
|
61414
|
-
requestAnimationFrame(() => tableMeta.editing.onCellChanged(cell, rowIndex, nextValue, true, false));
|
61415
|
-
}
|
61451
|
+
shouldRunUpdate.current = hasNonTextControl;
|
61416
61452
|
}
|
61417
61453
|
},
|
61418
61454
|
[hasNonTextControl, cell.row.id, cell.column.id, cell.row.original, rowIndex, value, columnMeta.dataType]
|
@@ -61867,7 +61903,7 @@ function useTable3(props, ref) {
|
|
61867
61903
|
removeRowChanges: (rowId) => table.meta.editing.discardChanges(rowId, table.instance),
|
61868
61904
|
save: (rowId) => table.meta.editing.saveChanges(table.instance, rowId)
|
61869
61905
|
};
|
61870
|
-
if (props.onEditingCreate) {
|
61906
|
+
if (props.onEditingCreate && instance.editing) {
|
61871
61907
|
instance.editing.createRow = (row) => table.meta.editing.createRow(table.instance, row);
|
61872
61908
|
}
|
61873
61909
|
}
|
@@ -61876,7 +61912,7 @@ function useTable3(props, ref) {
|
|
61876
61912
|
React__default.useEffect(() => {
|
61877
61913
|
if (table.ref.current) {
|
61878
61914
|
const instance = table.ref.current.instance;
|
61879
|
-
if (table.meta.editing.isEnabled) {
|
61915
|
+
if (table.meta.editing.isEnabled && instance.editing) {
|
61880
61916
|
instance.editing.forceValidate = async () => await table.meta.editing.forceValidate(table.instance);
|
61881
61917
|
}
|
61882
61918
|
}
|