@economic/taco 2.64.1-stale-validator.0 → 2.64.1-test-1.0
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 +23 -10
- package/dist/taco.cjs.map +1 -1
- package/dist/taco.css +4 -0
- package/dist/taco.js +23 -10
- package/dist/taco.js.map +1 -1
- package/package.json +2 -2
package/dist/taco.cjs
CHANGED
@@ -37836,6 +37836,15 @@ function useTableRenderer(renderers, table, tableRef, length, defaultRowActiveIn
|
|
37836
37836
|
virtualiser.measure();
|
37837
37837
|
}
|
37838
37838
|
}, [expandedState]);
|
37839
|
+
React.useEffect(() => {
|
37840
|
+
const totalSize2 = virtualiser.getTotalSize();
|
37841
|
+
console.log("before measuring totalSize", totalSize2);
|
37842
|
+
virtualiser.measure();
|
37843
|
+
setTimeout(() => {
|
37844
|
+
const totalSize3 = virtualiser.getTotalSize();
|
37845
|
+
console.log("after measuring totalSize", totalSize3);
|
37846
|
+
}, 1e3);
|
37847
|
+
}, [tableMeta.fontSize.size, tableMeta.rowHeight.height, JSON.stringify(table.getState().sorting), rows.length]);
|
37839
37848
|
const totalSize = virtualiser.getTotalSize();
|
37840
37849
|
const virtualItems = virtualiser.getVirtualItems();
|
37841
37850
|
const scrollToIndex = React.useCallback(
|
@@ -38555,13 +38564,14 @@ const DisplayRow = React.memo(function DisplayRow2(props) {
|
|
38555
38564
|
}
|
38556
38565
|
const ref = React.useRef(null);
|
38557
38566
|
const expansionRef = React.useRef(null);
|
38567
|
+
const rowSize = useResizeObserver$1(ref, true);
|
38558
38568
|
const expandedRowSize = useResizeObserver$1(expansionRef, !!expandedRow);
|
38559
38569
|
React.useEffect(() => {
|
38560
38570
|
var _a2, _b2;
|
38561
38571
|
const rowHeight = ((_a2 = ref.current) == null ? void 0 : _a2.getBoundingClientRect().height) ?? 0;
|
38562
38572
|
const expansionHeight = ((_b2 = expansionRef.current) == null ? void 0 : _b2.getBoundingClientRect().height) ?? 0;
|
38563
38573
|
measureRow(rowHeight + expansionHeight);
|
38564
|
-
}, [
|
38574
|
+
}, [rowSize, expandedRowSize, measureRow]);
|
38565
38575
|
const className = clsx("group/row", otherAttributes.className, {
|
38566
38576
|
"hover:cursor-grab": tableMeta.rowDrag.isEnabled && typeof attributes.onClick !== "function",
|
38567
38577
|
"hover:cursor-pointer": typeof attributes.onClick === "function"
|
@@ -53938,6 +53948,14 @@ function isTableScrolled(ref) {
|
|
53938
53948
|
function useTableEditingListener(table, tableRef, scrollToIndex) {
|
53939
53949
|
const tableMeta = table.options.meta;
|
53940
53950
|
const localization = useLocalization();
|
53951
|
+
useLazyEffect(() => {
|
53952
|
+
return () => {
|
53953
|
+
var _a;
|
53954
|
+
if (tableMeta.editing.isEditing && tableMeta.rowActive.rowActiveIndex !== void 0) {
|
53955
|
+
tableMeta.editing.saveChanges(table, (_a = table.getRowModel().rows[tableMeta.rowActive.rowActiveIndex]) == null ? void 0 : _a.id);
|
53956
|
+
}
|
53957
|
+
};
|
53958
|
+
}, [tableMeta.rowActive.rowActiveIndex, tableMeta.editing.isEditing]);
|
53941
53959
|
const hasChanges = tableMeta.editing.hasChanges();
|
53942
53960
|
React.useEffect(() => {
|
53943
53961
|
function showUnsavedChangesWarning(event) {
|
@@ -55282,7 +55300,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55282
55300
|
var _a, _b, _c;
|
55283
55301
|
return (_c = (_b = (_a = state.changes.errors) == null ? void 0 : _a[cell.row.id]) == null ? void 0 : _b.cells) == null ? void 0 : _c[cell.column.id];
|
55284
55302
|
}
|
55285
|
-
async function onCellChanged(cell, rowIndex, nextValue, shouldRunUpdaters = true
|
55303
|
+
async function onCellChanged(cell, rowIndex, nextValue, shouldRunUpdaters = true) {
|
55286
55304
|
var _a;
|
55287
55305
|
const tableMeta = cell.getContext().table.options.meta;
|
55288
55306
|
const state2 = tableMeta.editing.getState();
|
@@ -55312,7 +55330,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55312
55330
|
const nextMoveReasons = { ...state2.changes.moveReasons[cell.row.id] };
|
55313
55331
|
const nextCellErrors = { ...(_a = state2.changes.errors[cell.row.id]) == null ? void 0 : _a.cells };
|
55314
55332
|
let validationErrors = {};
|
55315
|
-
if (validator && Object.keys(nextChanges).length && original
|
55333
|
+
if (validator && Object.keys(nextChanges).length && original) {
|
55316
55334
|
const nextRowValue = { ...original, ...changes, ...updatesForOtherCells };
|
55317
55335
|
validationErrors = await validator(nextRowValue) ?? {};
|
55318
55336
|
}
|
@@ -55794,7 +55812,7 @@ function EditingControlCell(props) {
|
|
55794
55812
|
if (hasChanged) {
|
55795
55813
|
tableMeta.editing.setCellValue(cell, rowIndex, nextValue);
|
55796
55814
|
if (hasNonTextControl) {
|
55797
|
-
requestAnimationFrame(() => tableMeta.editing.onCellChanged(cell, rowIndex, nextValue
|
55815
|
+
requestAnimationFrame(() => tableMeta.editing.onCellChanged(cell, rowIndex, nextValue));
|
55798
55816
|
}
|
55799
55817
|
}
|
55800
55818
|
},
|
@@ -55807,7 +55825,7 @@ function EditingControlCell(props) {
|
|
55807
55825
|
}
|
55808
55826
|
requestAnimationFrame(() => {
|
55809
55827
|
tableMeta.editing.toggleDetailedMode(false);
|
55810
|
-
tableMeta.editing.onCellChanged(cell, rowIndex, void 0, !hasNonTextControl
|
55828
|
+
tableMeta.editing.onCellChanged(cell, rowIndex, void 0, !hasNonTextControl);
|
55811
55829
|
});
|
55812
55830
|
},
|
55813
55831
|
[hasNonTextControl, cell.row.id, JSON.stringify(rowChanges), rowIndex, cell.column.id, cell.row.original]
|
@@ -56103,11 +56121,6 @@ function Row(props) {
|
|
56103
56121
|
}
|
56104
56122
|
}
|
56105
56123
|
}, [tableMeta.editing.isEditing, tableMeta.rowActive.rowActiveIndex, tableMeta.editing.lastFocusedCellIndex]);
|
56106
|
-
useLazyEffect(() => {
|
56107
|
-
if (tableMeta.editing.isEditing && !isActiveRow) {
|
56108
|
-
tableMeta.editing.saveChanges(table, row.id);
|
56109
|
-
}
|
56110
|
-
}, [isActiveRow]);
|
56111
56124
|
const handleFocus = React.useCallback(
|
56112
56125
|
(event) => {
|
56113
56126
|
var _a;
|