@economic/taco 2.64.1-alpha.0 → 2.64.1-stale-validator.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.css CHANGED
@@ -1623,10 +1623,6 @@ table[data-taco^='table'] tbody tr[data-row-create] td {
1623
1623
  table[data-taco^='table'] tbody tr[data-row-create] td button {
1624
1624
  @apply -mt-[3px];
1625
1625
  }
1626
-
1627
- table[data-taco='table3'] td [data-taco='combobox'] {
1628
- display: inline;
1629
- }
1630
1626
  [data-taco='card-content'] > [data-taco='chart-wrapper']:not(:has([data-taco='chart-donut'], [data-taco='chart-pie'])) {
1631
1627
  @apply w-full;
1632
1628
  }
package/dist/taco.js CHANGED
@@ -37818,9 +37818,6 @@ function useTableRenderer(renderers, table, tableRef, length, defaultRowActiveIn
37818
37818
  virtualiser.measure();
37819
37819
  }
37820
37820
  }, [expandedState]);
37821
- React__default.useEffect(() => {
37822
- virtualiser.measure();
37823
- }, [tableMeta.fontSize.size, tableMeta.rowHeight.height, JSON.stringify(table.getState().sorting), rows.length]);
37824
37821
  const totalSize = virtualiser.getTotalSize();
37825
37822
  const virtualItems = virtualiser.getVirtualItems();
37826
37823
  const scrollToIndex = React__default.useCallback(
@@ -53923,14 +53920,6 @@ function isTableScrolled(ref) {
53923
53920
  function useTableEditingListener(table, tableRef, scrollToIndex) {
53924
53921
  const tableMeta = table.options.meta;
53925
53922
  const localization = useLocalization();
53926
- useLazyEffect(() => {
53927
- return () => {
53928
- var _a;
53929
- if (tableMeta.editing.isEditing && tableMeta.rowActive.rowActiveIndex !== void 0) {
53930
- tableMeta.editing.saveChanges(table, (_a = table.getRowModel().rows[tableMeta.rowActive.rowActiveIndex]) == null ? void 0 : _a.id);
53931
- }
53932
- };
53933
- }, [tableMeta.rowActive.rowActiveIndex, tableMeta.editing.isEditing]);
53934
53923
  const hasChanges = tableMeta.editing.hasChanges();
53935
53924
  React__default.useEffect(() => {
53936
53925
  function showUnsavedChangesWarning(event) {
@@ -55275,7 +55264,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
55275
55264
  var _a, _b, _c;
55276
55265
  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];
55277
55266
  }
55278
- async function onCellChanged(cell, rowIndex, nextValue, shouldRunUpdaters = true) {
55267
+ async function onCellChanged(cell, rowIndex, nextValue, shouldRunUpdaters = true, shouldRunValidation = true) {
55279
55268
  var _a;
55280
55269
  const tableMeta = cell.getContext().table.options.meta;
55281
55270
  const state2 = tableMeta.editing.getState();
@@ -55305,7 +55294,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
55305
55294
  const nextMoveReasons = { ...state2.changes.moveReasons[cell.row.id] };
55306
55295
  const nextCellErrors = { ...(_a = state2.changes.errors[cell.row.id]) == null ? void 0 : _a.cells };
55307
55296
  let validationErrors = {};
55308
- if (validator && Object.keys(nextChanges).length && original) {
55297
+ if (validator && Object.keys(nextChanges).length && original && shouldRunValidation) {
55309
55298
  const nextRowValue = { ...original, ...changes, ...updatesForOtherCells };
55310
55299
  validationErrors = await validator(nextRowValue) ?? {};
55311
55300
  }
@@ -55787,7 +55776,7 @@ function EditingControlCell(props) {
55787
55776
  if (hasChanged) {
55788
55777
  tableMeta.editing.setCellValue(cell, rowIndex, nextValue);
55789
55778
  if (hasNonTextControl) {
55790
- requestAnimationFrame(() => tableMeta.editing.onCellChanged(cell, rowIndex, nextValue));
55779
+ requestAnimationFrame(() => tableMeta.editing.onCellChanged(cell, rowIndex, nextValue, true, false));
55791
55780
  }
55792
55781
  }
55793
55782
  },
@@ -55800,7 +55789,7 @@ function EditingControlCell(props) {
55800
55789
  }
55801
55790
  requestAnimationFrame(() => {
55802
55791
  tableMeta.editing.toggleDetailedMode(false);
55803
- tableMeta.editing.onCellChanged(cell, rowIndex, void 0, !hasNonTextControl);
55792
+ tableMeta.editing.onCellChanged(cell, rowIndex, void 0, !hasNonTextControl, true);
55804
55793
  });
55805
55794
  },
55806
55795
  [hasNonTextControl, cell.row.id, JSON.stringify(rowChanges), rowIndex, cell.column.id, cell.row.original]
@@ -56096,6 +56085,11 @@ function Row(props) {
56096
56085
  }
56097
56086
  }
56098
56087
  }, [tableMeta.editing.isEditing, tableMeta.rowActive.rowActiveIndex, tableMeta.editing.lastFocusedCellIndex]);
56088
+ useLazyEffect(() => {
56089
+ if (tableMeta.editing.isEditing && !isActiveRow) {
56090
+ tableMeta.editing.saveChanges(table, row.id);
56091
+ }
56092
+ }, [isActiveRow]);
56099
56093
  const handleFocus = React__default.useCallback(
56100
56094
  (event) => {
56101
56095
  var _a;