@odoo/o-spreadsheet 16.3.11 → 16.3.12

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.
@@ -4990,6 +4990,9 @@ class FilterMenu extends owl.Component {
4990
4990
  });
4991
4991
  this.state.values = this.getFilterValues(this.props.filterPosition);
4992
4992
  }
4993
+ get isReadonly() {
4994
+ return this.env.model.getters.isReadonly();
4995
+ }
4993
4996
  getFilterValues(position) {
4994
4997
  const sheetId = this.env.model.getters.getActiveSheetId();
4995
4998
  const filter = this.env.model.getters.getFilter({ sheetId, ...position });
@@ -19678,7 +19681,6 @@ class FindAndReplacePanel extends owl.Component {
19678
19681
  state = owl.useState(this.initialState());
19679
19682
  debounceTimeoutId;
19680
19683
  showFormulaState = false;
19681
- debouncedUpdateSearch;
19682
19684
  findAndReplaceRef = owl.useRef("findAndReplace");
19683
19685
  get hasSearchResult() {
19684
19686
  return this.env.model.getters.getCurrentSelectedMatchIndex() !== null;
@@ -19688,9 +19690,9 @@ class FindAndReplacePanel extends owl.Component {
19688
19690
  }
19689
19691
  setup() {
19690
19692
  this.showFormulaState = this.env.model.getters.shouldShowFormulas();
19691
- this.debouncedUpdateSearch = debounce(this.updateSearch.bind(this), 200);
19692
19693
  owl.onMounted(() => this.focusInput());
19693
19694
  owl.onWillUnmount(() => {
19695
+ clearTimeout(this.debounceTimeoutId);
19694
19696
  this.env.model.dispatch("CLEAR_SEARCH");
19695
19697
  this.env.model.dispatch("SET_FORMULA_VISIBILITY", { show: this.showFormulaState });
19696
19698
  });
@@ -19735,6 +19737,13 @@ class FindAndReplacePanel extends owl.Component {
19735
19737
  searchOptions: this.state.searchOptions,
19736
19738
  });
19737
19739
  }
19740
+ debouncedUpdateSearch() {
19741
+ clearTimeout(this.debounceTimeoutId);
19742
+ this.debounceTimeoutId = setTimeout(() => {
19743
+ this.updateSearch();
19744
+ this.debounceTimeoutId = undefined;
19745
+ }, 200);
19746
+ }
19738
19747
  replace() {
19739
19748
  this.env.model.dispatch("REPLACE_SEARCH", {
19740
19749
  replaceWith: this.state.replaceWith,
@@ -30941,7 +30950,11 @@ class HeaderSizePlugin extends CorePlugin {
30941
30950
  let sizes = [...this.sizes[cmd.sheetId][cmd.dimension]];
30942
30951
  const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
30943
30952
  const baseSize = sizes[cmd.base];
30944
- sizes.splice(addIndex, 0, ...Array(cmd.quantity).fill(baseSize));
30953
+ const sizesToInsert = range(0, cmd.quantity).map(() => ({
30954
+ manualSize: baseSize.manualSize,
30955
+ computedSize: lazy(baseSize.computedSize()),
30956
+ }));
30957
+ sizes.splice(addIndex, 0, ...sizesToInsert);
30945
30958
  sizes = sizes.map((size, row) => {
30946
30959
  if (cmd.dimension === "ROW" && row > cmd.base + cmd.quantity) {
30947
30960
  // invalidate sizes
@@ -34450,30 +34463,26 @@ class InternalViewport {
34450
34463
  const { end } = this.getters.getColDimensions(sheetId, targetCol);
34451
34464
  const maxCol = this.getters.getNumberCols(sheetId);
34452
34465
  if (this.offsetX + this.offsetCorrectionX + this.viewportWidth < end) {
34453
- for (let col = this.left; this.offsetX + this.offsetCorrectionX + this.viewportWidth < end; col++) {
34454
- if (col > maxCol) {
34455
- break;
34456
- }
34457
- if (this.getters.isColHidden(sheetId, col)) {
34458
- continue;
34459
- }
34460
- this.offsetX = this.getters.getColDimensions(sheetId, col).end - this.offsetCorrectionX;
34461
- this.offsetScrollbarX = this.offsetX;
34462
- this.adjustViewportZoneX();
34466
+ let finalTarget = targetCol;
34467
+ while (this.getters.isColHidden(sheetId, finalTarget) && targetCol < maxCol) {
34468
+ finalTarget++;
34463
34469
  }
34470
+ const finalTargetEnd = this.getters.getColDimensions(sheetId, finalTarget).end;
34471
+ const startIndex = this.searchHeaderIndex("COL", finalTargetEnd - this.viewportWidth - this.offsetCorrectionX, this.boundaries.left, true);
34472
+ this.offsetX =
34473
+ this.getters.getColDimensions(sheetId, startIndex).end - this.offsetCorrectionX;
34474
+ this.offsetScrollbarX = this.offsetX;
34475
+ this.adjustViewportZoneX();
34464
34476
  }
34465
34477
  else if (this.left > targetCol) {
34466
- for (let col = this.left; col >= targetCol; col--) {
34467
- if (col < 0) {
34468
- break;
34469
- }
34470
- if (this.getters.isColHidden(sheetId, col)) {
34471
- continue;
34472
- }
34473
- this.offsetX = this.getters.getColDimensions(sheetId, col).start - this.offsetCorrectionX;
34474
- this.offsetScrollbarX = this.offsetX;
34475
- this.adjustViewportZoneX();
34478
+ let finalTarget = targetCol;
34479
+ while (this.getters.isColHidden(sheetId, finalTarget) && targetCol > 0) {
34480
+ finalTarget--;
34476
34481
  }
34482
+ this.offsetX =
34483
+ this.getters.getColDimensions(sheetId, finalTarget).start - this.offsetCorrectionX;
34484
+ this.offsetScrollbarX = this.offsetX;
34485
+ this.adjustViewportZoneX();
34477
34486
  }
34478
34487
  }
34479
34488
  adjustPositionY(targetRow) {
@@ -34481,30 +34490,26 @@ class InternalViewport {
34481
34490
  const { end } = this.getters.getRowDimensions(sheetId, targetRow);
34482
34491
  const maxRow = this.getters.getNumberRows(sheetId);
34483
34492
  if (this.offsetY + this.viewportHeight + this.offsetCorrectionY < end) {
34484
- for (let row = this.top; this.offsetY + this.viewportHeight + this.offsetCorrectionY < end; row++) {
34485
- if (row > maxRow) {
34486
- break;
34487
- }
34488
- if (this.getters.isRowHidden(sheetId, row)) {
34489
- continue;
34490
- }
34491
- this.offsetY = this.getters.getRowDimensions(sheetId, row).end - this.offsetCorrectionY;
34492
- this.offsetScrollbarY = this.offsetY;
34493
- this.adjustViewportZoneY();
34493
+ let finalTarget = targetRow;
34494
+ while (this.getters.isRowHidden(sheetId, finalTarget) && targetRow < maxRow) {
34495
+ finalTarget++;
34494
34496
  }
34497
+ const finalTargetEnd = this.getters.getRowDimensions(sheetId, finalTarget).end;
34498
+ const startIndex = this.searchHeaderIndex("ROW", finalTargetEnd - this.viewportHeight - this.offsetCorrectionY, this.boundaries.top, true);
34499
+ this.offsetY =
34500
+ this.getters.getRowDimensions(sheetId, startIndex).end - this.offsetCorrectionY;
34501
+ this.offsetScrollbarY = this.offsetY;
34502
+ this.adjustViewportZoneY();
34495
34503
  }
34496
34504
  else if (this.top > targetRow) {
34497
- for (let row = this.top; row >= targetRow; row--) {
34498
- if (row < 0) {
34499
- break;
34500
- }
34501
- if (this.getters.isRowHidden(sheetId, row)) {
34502
- continue;
34503
- }
34504
- this.offsetY = this.getters.getRowDimensions(sheetId, row).start - this.offsetCorrectionY;
34505
- this.offsetScrollbarY = this.offsetY;
34506
- this.adjustViewportZoneY();
34505
+ let finalTarget = targetRow;
34506
+ while (this.getters.isRowHidden(sheetId, finalTarget) && targetRow > 0) {
34507
+ finalTarget--;
34507
34508
  }
34509
+ this.offsetY =
34510
+ this.getters.getRowDimensions(sheetId, finalTarget).start - this.offsetCorrectionY;
34511
+ this.offsetScrollbarY = this.offsetY;
34512
+ this.adjustViewportZoneY();
34508
34513
  }
34509
34514
  }
34510
34515
  setViewportOffset(offsetX, offsetY) {
@@ -36980,14 +36985,10 @@ class FindAndReplacePlugin extends UIPlugin {
36980
36985
  case "REPLACE_ALL_SEARCH":
36981
36986
  this.replaceAll(cmd.replaceWith);
36982
36987
  break;
36983
- case "EVALUATE_CELLS":
36984
- case "UPDATE_CELL":
36985
- case "REMOVE_FILTER_TABLE":
36986
- case "UPDATE_FILTER":
36987
- this.isSearchDirty = true;
36988
- break;
36989
36988
  case "UNDO":
36990
36989
  case "REDO":
36990
+ case "REMOVE_FILTER_TABLE":
36991
+ case "UPDATE_FILTER":
36991
36992
  case "REMOVE_COLUMNS_ROWS":
36992
36993
  case "HIDE_COLUMNS_ROWS":
36993
36994
  case "UNHIDE_COLUMNS_ROWS":
@@ -39706,7 +39707,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
39706
39707
  });
39707
39708
  for (const filterTable of this.copiedTables) {
39708
39709
  this.dispatch("REMOVE_FILTER_TABLE", {
39709
- sheetId: this.getters.getActiveSheetId(),
39710
+ sheetId: this.sheetId,
39710
39711
  target: [filterTable.zone],
39711
39712
  });
39712
39713
  }
@@ -47720,6 +47721,6 @@ exports.setTranslationMethod = setTranslationMethod;
47720
47721
  exports.tokenize = tokenize;
47721
47722
 
47722
47723
 
47723
- __info__.version = '16.3.11';
47724
- __info__.date = '2023-09-21T15:56:40.754Z';
47725
- __info__.hash = '245df8c';
47724
+ __info__.version = '16.3.12';
47725
+ __info__.date = '2023-10-03T12:43:02.230Z';
47726
+ __info__.hash = '70a91d9';
@@ -4986,6 +4986,9 @@ class FilterMenu extends Component {
4986
4986
  });
4987
4987
  this.state.values = this.getFilterValues(this.props.filterPosition);
4988
4988
  }
4989
+ get isReadonly() {
4990
+ return this.env.model.getters.isReadonly();
4991
+ }
4989
4992
  getFilterValues(position) {
4990
4993
  const sheetId = this.env.model.getters.getActiveSheetId();
4991
4994
  const filter = this.env.model.getters.getFilter({ sheetId, ...position });
@@ -19674,7 +19677,6 @@ class FindAndReplacePanel extends Component {
19674
19677
  state = useState(this.initialState());
19675
19678
  debounceTimeoutId;
19676
19679
  showFormulaState = false;
19677
- debouncedUpdateSearch;
19678
19680
  findAndReplaceRef = useRef("findAndReplace");
19679
19681
  get hasSearchResult() {
19680
19682
  return this.env.model.getters.getCurrentSelectedMatchIndex() !== null;
@@ -19684,9 +19686,9 @@ class FindAndReplacePanel extends Component {
19684
19686
  }
19685
19687
  setup() {
19686
19688
  this.showFormulaState = this.env.model.getters.shouldShowFormulas();
19687
- this.debouncedUpdateSearch = debounce(this.updateSearch.bind(this), 200);
19688
19689
  onMounted(() => this.focusInput());
19689
19690
  onWillUnmount(() => {
19691
+ clearTimeout(this.debounceTimeoutId);
19690
19692
  this.env.model.dispatch("CLEAR_SEARCH");
19691
19693
  this.env.model.dispatch("SET_FORMULA_VISIBILITY", { show: this.showFormulaState });
19692
19694
  });
@@ -19731,6 +19733,13 @@ class FindAndReplacePanel extends Component {
19731
19733
  searchOptions: this.state.searchOptions,
19732
19734
  });
19733
19735
  }
19736
+ debouncedUpdateSearch() {
19737
+ clearTimeout(this.debounceTimeoutId);
19738
+ this.debounceTimeoutId = setTimeout(() => {
19739
+ this.updateSearch();
19740
+ this.debounceTimeoutId = undefined;
19741
+ }, 200);
19742
+ }
19734
19743
  replace() {
19735
19744
  this.env.model.dispatch("REPLACE_SEARCH", {
19736
19745
  replaceWith: this.state.replaceWith,
@@ -30937,7 +30946,11 @@ class HeaderSizePlugin extends CorePlugin {
30937
30946
  let sizes = [...this.sizes[cmd.sheetId][cmd.dimension]];
30938
30947
  const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
30939
30948
  const baseSize = sizes[cmd.base];
30940
- sizes.splice(addIndex, 0, ...Array(cmd.quantity).fill(baseSize));
30949
+ const sizesToInsert = range(0, cmd.quantity).map(() => ({
30950
+ manualSize: baseSize.manualSize,
30951
+ computedSize: lazy(baseSize.computedSize()),
30952
+ }));
30953
+ sizes.splice(addIndex, 0, ...sizesToInsert);
30941
30954
  sizes = sizes.map((size, row) => {
30942
30955
  if (cmd.dimension === "ROW" && row > cmd.base + cmd.quantity) {
30943
30956
  // invalidate sizes
@@ -34446,30 +34459,26 @@ class InternalViewport {
34446
34459
  const { end } = this.getters.getColDimensions(sheetId, targetCol);
34447
34460
  const maxCol = this.getters.getNumberCols(sheetId);
34448
34461
  if (this.offsetX + this.offsetCorrectionX + this.viewportWidth < end) {
34449
- for (let col = this.left; this.offsetX + this.offsetCorrectionX + this.viewportWidth < end; col++) {
34450
- if (col > maxCol) {
34451
- break;
34452
- }
34453
- if (this.getters.isColHidden(sheetId, col)) {
34454
- continue;
34455
- }
34456
- this.offsetX = this.getters.getColDimensions(sheetId, col).end - this.offsetCorrectionX;
34457
- this.offsetScrollbarX = this.offsetX;
34458
- this.adjustViewportZoneX();
34462
+ let finalTarget = targetCol;
34463
+ while (this.getters.isColHidden(sheetId, finalTarget) && targetCol < maxCol) {
34464
+ finalTarget++;
34459
34465
  }
34466
+ const finalTargetEnd = this.getters.getColDimensions(sheetId, finalTarget).end;
34467
+ const startIndex = this.searchHeaderIndex("COL", finalTargetEnd - this.viewportWidth - this.offsetCorrectionX, this.boundaries.left, true);
34468
+ this.offsetX =
34469
+ this.getters.getColDimensions(sheetId, startIndex).end - this.offsetCorrectionX;
34470
+ this.offsetScrollbarX = this.offsetX;
34471
+ this.adjustViewportZoneX();
34460
34472
  }
34461
34473
  else if (this.left > targetCol) {
34462
- for (let col = this.left; col >= targetCol; col--) {
34463
- if (col < 0) {
34464
- break;
34465
- }
34466
- if (this.getters.isColHidden(sheetId, col)) {
34467
- continue;
34468
- }
34469
- this.offsetX = this.getters.getColDimensions(sheetId, col).start - this.offsetCorrectionX;
34470
- this.offsetScrollbarX = this.offsetX;
34471
- this.adjustViewportZoneX();
34474
+ let finalTarget = targetCol;
34475
+ while (this.getters.isColHidden(sheetId, finalTarget) && targetCol > 0) {
34476
+ finalTarget--;
34472
34477
  }
34478
+ this.offsetX =
34479
+ this.getters.getColDimensions(sheetId, finalTarget).start - this.offsetCorrectionX;
34480
+ this.offsetScrollbarX = this.offsetX;
34481
+ this.adjustViewportZoneX();
34473
34482
  }
34474
34483
  }
34475
34484
  adjustPositionY(targetRow) {
@@ -34477,30 +34486,26 @@ class InternalViewport {
34477
34486
  const { end } = this.getters.getRowDimensions(sheetId, targetRow);
34478
34487
  const maxRow = this.getters.getNumberRows(sheetId);
34479
34488
  if (this.offsetY + this.viewportHeight + this.offsetCorrectionY < end) {
34480
- for (let row = this.top; this.offsetY + this.viewportHeight + this.offsetCorrectionY < end; row++) {
34481
- if (row > maxRow) {
34482
- break;
34483
- }
34484
- if (this.getters.isRowHidden(sheetId, row)) {
34485
- continue;
34486
- }
34487
- this.offsetY = this.getters.getRowDimensions(sheetId, row).end - this.offsetCorrectionY;
34488
- this.offsetScrollbarY = this.offsetY;
34489
- this.adjustViewportZoneY();
34489
+ let finalTarget = targetRow;
34490
+ while (this.getters.isRowHidden(sheetId, finalTarget) && targetRow < maxRow) {
34491
+ finalTarget++;
34490
34492
  }
34493
+ const finalTargetEnd = this.getters.getRowDimensions(sheetId, finalTarget).end;
34494
+ const startIndex = this.searchHeaderIndex("ROW", finalTargetEnd - this.viewportHeight - this.offsetCorrectionY, this.boundaries.top, true);
34495
+ this.offsetY =
34496
+ this.getters.getRowDimensions(sheetId, startIndex).end - this.offsetCorrectionY;
34497
+ this.offsetScrollbarY = this.offsetY;
34498
+ this.adjustViewportZoneY();
34491
34499
  }
34492
34500
  else if (this.top > targetRow) {
34493
- for (let row = this.top; row >= targetRow; row--) {
34494
- if (row < 0) {
34495
- break;
34496
- }
34497
- if (this.getters.isRowHidden(sheetId, row)) {
34498
- continue;
34499
- }
34500
- this.offsetY = this.getters.getRowDimensions(sheetId, row).start - this.offsetCorrectionY;
34501
- this.offsetScrollbarY = this.offsetY;
34502
- this.adjustViewportZoneY();
34501
+ let finalTarget = targetRow;
34502
+ while (this.getters.isRowHidden(sheetId, finalTarget) && targetRow > 0) {
34503
+ finalTarget--;
34503
34504
  }
34505
+ this.offsetY =
34506
+ this.getters.getRowDimensions(sheetId, finalTarget).start - this.offsetCorrectionY;
34507
+ this.offsetScrollbarY = this.offsetY;
34508
+ this.adjustViewportZoneY();
34504
34509
  }
34505
34510
  }
34506
34511
  setViewportOffset(offsetX, offsetY) {
@@ -36976,14 +36981,10 @@ class FindAndReplacePlugin extends UIPlugin {
36976
36981
  case "REPLACE_ALL_SEARCH":
36977
36982
  this.replaceAll(cmd.replaceWith);
36978
36983
  break;
36979
- case "EVALUATE_CELLS":
36980
- case "UPDATE_CELL":
36981
- case "REMOVE_FILTER_TABLE":
36982
- case "UPDATE_FILTER":
36983
- this.isSearchDirty = true;
36984
- break;
36985
36984
  case "UNDO":
36986
36985
  case "REDO":
36986
+ case "REMOVE_FILTER_TABLE":
36987
+ case "UPDATE_FILTER":
36987
36988
  case "REMOVE_COLUMNS_ROWS":
36988
36989
  case "HIDE_COLUMNS_ROWS":
36989
36990
  case "UNHIDE_COLUMNS_ROWS":
@@ -39702,7 +39703,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
39702
39703
  });
39703
39704
  for (const filterTable of this.copiedTables) {
39704
39705
  this.dispatch("REMOVE_FILTER_TABLE", {
39705
- sheetId: this.getters.getActiveSheetId(),
39706
+ sheetId: this.sheetId,
39706
39707
  target: [filterTable.zone],
39707
39708
  });
39708
39709
  }
@@ -47688,6 +47689,6 @@ function addFunction(functionName, functionDescription) {
47688
47689
  export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
47689
47690
 
47690
47691
 
47691
- __info__.version = '16.3.11';
47692
- __info__.date = '2023-09-21T15:56:40.754Z';
47693
- __info__.hash = '245df8c';
47692
+ __info__.version = '16.3.12';
47693
+ __info__.date = '2023-10-03T12:43:02.230Z';
47694
+ __info__.hash = '70a91d9';
@@ -4987,6 +4987,9 @@
4987
4987
  });
4988
4988
  this.state.values = this.getFilterValues(this.props.filterPosition);
4989
4989
  }
4990
+ get isReadonly() {
4991
+ return this.env.model.getters.isReadonly();
4992
+ }
4990
4993
  getFilterValues(position) {
4991
4994
  const sheetId = this.env.model.getters.getActiveSheetId();
4992
4995
  const filter = this.env.model.getters.getFilter({ sheetId, ...position });
@@ -19675,7 +19678,6 @@
19675
19678
  state = owl.useState(this.initialState());
19676
19679
  debounceTimeoutId;
19677
19680
  showFormulaState = false;
19678
- debouncedUpdateSearch;
19679
19681
  findAndReplaceRef = owl.useRef("findAndReplace");
19680
19682
  get hasSearchResult() {
19681
19683
  return this.env.model.getters.getCurrentSelectedMatchIndex() !== null;
@@ -19685,9 +19687,9 @@
19685
19687
  }
19686
19688
  setup() {
19687
19689
  this.showFormulaState = this.env.model.getters.shouldShowFormulas();
19688
- this.debouncedUpdateSearch = debounce(this.updateSearch.bind(this), 200);
19689
19690
  owl.onMounted(() => this.focusInput());
19690
19691
  owl.onWillUnmount(() => {
19692
+ clearTimeout(this.debounceTimeoutId);
19691
19693
  this.env.model.dispatch("CLEAR_SEARCH");
19692
19694
  this.env.model.dispatch("SET_FORMULA_VISIBILITY", { show: this.showFormulaState });
19693
19695
  });
@@ -19732,6 +19734,13 @@
19732
19734
  searchOptions: this.state.searchOptions,
19733
19735
  });
19734
19736
  }
19737
+ debouncedUpdateSearch() {
19738
+ clearTimeout(this.debounceTimeoutId);
19739
+ this.debounceTimeoutId = setTimeout(() => {
19740
+ this.updateSearch();
19741
+ this.debounceTimeoutId = undefined;
19742
+ }, 200);
19743
+ }
19735
19744
  replace() {
19736
19745
  this.env.model.dispatch("REPLACE_SEARCH", {
19737
19746
  replaceWith: this.state.replaceWith,
@@ -30938,7 +30947,11 @@
30938
30947
  let sizes = [...this.sizes[cmd.sheetId][cmd.dimension]];
30939
30948
  const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
30940
30949
  const baseSize = sizes[cmd.base];
30941
- sizes.splice(addIndex, 0, ...Array(cmd.quantity).fill(baseSize));
30950
+ const sizesToInsert = range(0, cmd.quantity).map(() => ({
30951
+ manualSize: baseSize.manualSize,
30952
+ computedSize: lazy(baseSize.computedSize()),
30953
+ }));
30954
+ sizes.splice(addIndex, 0, ...sizesToInsert);
30942
30955
  sizes = sizes.map((size, row) => {
30943
30956
  if (cmd.dimension === "ROW" && row > cmd.base + cmd.quantity) {
30944
30957
  // invalidate sizes
@@ -34447,30 +34460,26 @@
34447
34460
  const { end } = this.getters.getColDimensions(sheetId, targetCol);
34448
34461
  const maxCol = this.getters.getNumberCols(sheetId);
34449
34462
  if (this.offsetX + this.offsetCorrectionX + this.viewportWidth < end) {
34450
- for (let col = this.left; this.offsetX + this.offsetCorrectionX + this.viewportWidth < end; col++) {
34451
- if (col > maxCol) {
34452
- break;
34453
- }
34454
- if (this.getters.isColHidden(sheetId, col)) {
34455
- continue;
34456
- }
34457
- this.offsetX = this.getters.getColDimensions(sheetId, col).end - this.offsetCorrectionX;
34458
- this.offsetScrollbarX = this.offsetX;
34459
- this.adjustViewportZoneX();
34463
+ let finalTarget = targetCol;
34464
+ while (this.getters.isColHidden(sheetId, finalTarget) && targetCol < maxCol) {
34465
+ finalTarget++;
34460
34466
  }
34467
+ const finalTargetEnd = this.getters.getColDimensions(sheetId, finalTarget).end;
34468
+ const startIndex = this.searchHeaderIndex("COL", finalTargetEnd - this.viewportWidth - this.offsetCorrectionX, this.boundaries.left, true);
34469
+ this.offsetX =
34470
+ this.getters.getColDimensions(sheetId, startIndex).end - this.offsetCorrectionX;
34471
+ this.offsetScrollbarX = this.offsetX;
34472
+ this.adjustViewportZoneX();
34461
34473
  }
34462
34474
  else if (this.left > targetCol) {
34463
- for (let col = this.left; col >= targetCol; col--) {
34464
- if (col < 0) {
34465
- break;
34466
- }
34467
- if (this.getters.isColHidden(sheetId, col)) {
34468
- continue;
34469
- }
34470
- this.offsetX = this.getters.getColDimensions(sheetId, col).start - this.offsetCorrectionX;
34471
- this.offsetScrollbarX = this.offsetX;
34472
- this.adjustViewportZoneX();
34475
+ let finalTarget = targetCol;
34476
+ while (this.getters.isColHidden(sheetId, finalTarget) && targetCol > 0) {
34477
+ finalTarget--;
34473
34478
  }
34479
+ this.offsetX =
34480
+ this.getters.getColDimensions(sheetId, finalTarget).start - this.offsetCorrectionX;
34481
+ this.offsetScrollbarX = this.offsetX;
34482
+ this.adjustViewportZoneX();
34474
34483
  }
34475
34484
  }
34476
34485
  adjustPositionY(targetRow) {
@@ -34478,30 +34487,26 @@
34478
34487
  const { end } = this.getters.getRowDimensions(sheetId, targetRow);
34479
34488
  const maxRow = this.getters.getNumberRows(sheetId);
34480
34489
  if (this.offsetY + this.viewportHeight + this.offsetCorrectionY < end) {
34481
- for (let row = this.top; this.offsetY + this.viewportHeight + this.offsetCorrectionY < end; row++) {
34482
- if (row > maxRow) {
34483
- break;
34484
- }
34485
- if (this.getters.isRowHidden(sheetId, row)) {
34486
- continue;
34487
- }
34488
- this.offsetY = this.getters.getRowDimensions(sheetId, row).end - this.offsetCorrectionY;
34489
- this.offsetScrollbarY = this.offsetY;
34490
- this.adjustViewportZoneY();
34490
+ let finalTarget = targetRow;
34491
+ while (this.getters.isRowHidden(sheetId, finalTarget) && targetRow < maxRow) {
34492
+ finalTarget++;
34491
34493
  }
34494
+ const finalTargetEnd = this.getters.getRowDimensions(sheetId, finalTarget).end;
34495
+ const startIndex = this.searchHeaderIndex("ROW", finalTargetEnd - this.viewportHeight - this.offsetCorrectionY, this.boundaries.top, true);
34496
+ this.offsetY =
34497
+ this.getters.getRowDimensions(sheetId, startIndex).end - this.offsetCorrectionY;
34498
+ this.offsetScrollbarY = this.offsetY;
34499
+ this.adjustViewportZoneY();
34492
34500
  }
34493
34501
  else if (this.top > targetRow) {
34494
- for (let row = this.top; row >= targetRow; row--) {
34495
- if (row < 0) {
34496
- break;
34497
- }
34498
- if (this.getters.isRowHidden(sheetId, row)) {
34499
- continue;
34500
- }
34501
- this.offsetY = this.getters.getRowDimensions(sheetId, row).start - this.offsetCorrectionY;
34502
- this.offsetScrollbarY = this.offsetY;
34503
- this.adjustViewportZoneY();
34502
+ let finalTarget = targetRow;
34503
+ while (this.getters.isRowHidden(sheetId, finalTarget) && targetRow > 0) {
34504
+ finalTarget--;
34504
34505
  }
34506
+ this.offsetY =
34507
+ this.getters.getRowDimensions(sheetId, finalTarget).start - this.offsetCorrectionY;
34508
+ this.offsetScrollbarY = this.offsetY;
34509
+ this.adjustViewportZoneY();
34505
34510
  }
34506
34511
  }
34507
34512
  setViewportOffset(offsetX, offsetY) {
@@ -36977,14 +36982,10 @@
36977
36982
  case "REPLACE_ALL_SEARCH":
36978
36983
  this.replaceAll(cmd.replaceWith);
36979
36984
  break;
36980
- case "EVALUATE_CELLS":
36981
- case "UPDATE_CELL":
36982
- case "REMOVE_FILTER_TABLE":
36983
- case "UPDATE_FILTER":
36984
- this.isSearchDirty = true;
36985
- break;
36986
36985
  case "UNDO":
36987
36986
  case "REDO":
36987
+ case "REMOVE_FILTER_TABLE":
36988
+ case "UPDATE_FILTER":
36988
36989
  case "REMOVE_COLUMNS_ROWS":
36989
36990
  case "HIDE_COLUMNS_ROWS":
36990
36991
  case "UNHIDE_COLUMNS_ROWS":
@@ -39703,7 +39704,7 @@
39703
39704
  });
39704
39705
  for (const filterTable of this.copiedTables) {
39705
39706
  this.dispatch("REMOVE_FILTER_TABLE", {
39706
- sheetId: this.getters.getActiveSheetId(),
39707
+ sheetId: this.sheetId,
39707
39708
  target: [filterTable.zone],
39708
39709
  });
39709
39710
  }
@@ -47719,9 +47720,9 @@
47719
47720
  Object.defineProperty(exports, '__esModule', { value: true });
47720
47721
 
47721
47722
 
47722
- __info__.version = '16.3.11';
47723
- __info__.date = '2023-09-21T15:56:40.754Z';
47724
- __info__.hash = '245df8c';
47723
+ __info__.version = '16.3.12';
47724
+ __info__.date = '2023-10-03T12:43:02.230Z';
47725
+ __info__.hash = '70a91d9';
47725
47726
 
47726
47727
 
47727
47728
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);