handsontable 0.0.0-next-f52ab71-20250121 → 0.0.0-next-8d1d868-20250121

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.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (43) hide show
  1. package/3rdparty/walkontable/src/core/_base.js +19 -0
  2. package/3rdparty/walkontable/src/core/_base.mjs +19 -0
  3. package/3rdparty/walkontable/src/overlay/_base.js +44 -8
  4. package/3rdparty/walkontable/src/overlay/_base.mjs +44 -8
  5. package/3rdparty/walkontable/src/overlay/bottom.js +0 -1
  6. package/3rdparty/walkontable/src/overlay/bottom.mjs +0 -1
  7. package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.js +0 -1
  8. package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.mjs +0 -1
  9. package/3rdparty/walkontable/src/overlay/inlineStart.js +0 -1
  10. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +0 -1
  11. package/3rdparty/walkontable/src/overlay/top.js +0 -1
  12. package/3rdparty/walkontable/src/overlay/top.mjs +0 -1
  13. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +0 -1
  14. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +0 -1
  15. package/3rdparty/walkontable/src/overlays.js +355 -45
  16. package/3rdparty/walkontable/src/overlays.mjs +355 -45
  17. package/3rdparty/walkontable/src/table.js +94 -99
  18. package/3rdparty/walkontable/src/table.mjs +94 -99
  19. package/base.js +2 -2
  20. package/base.mjs +2 -2
  21. package/dist/handsontable.css +20 -4
  22. package/dist/handsontable.full.css +20 -4
  23. package/dist/handsontable.full.js +522 -166
  24. package/dist/handsontable.full.min.css +3 -3
  25. package/dist/handsontable.full.min.js +108 -108
  26. package/dist/handsontable.js +522 -166
  27. package/dist/handsontable.min.css +3 -3
  28. package/dist/handsontable.min.js +15 -15
  29. package/editors/baseEditor/baseEditor.js +2 -1
  30. package/editors/baseEditor/baseEditor.mjs +2 -1
  31. package/helpers/mixed.js +1 -1
  32. package/helpers/mixed.mjs +1 -1
  33. package/package.json +1 -1
  34. package/plugins/dragToScroll/dragToScroll.js +1 -1
  35. package/plugins/dragToScroll/dragToScroll.mjs +1 -1
  36. package/styles/handsontable.css +7 -2
  37. package/styles/handsontable.min.css +3 -3
  38. package/styles/ht-theme-horizon.css +2 -2
  39. package/styles/ht-theme-horizon.min.css +2 -2
  40. package/styles/ht-theme-main.css +2 -2
  41. package/styles/ht-theme-main.min.css +2 -2
  42. package/tableView.js +2 -2
  43. package/tableView.mjs +2 -2
@@ -5,7 +5,6 @@ require("core-js/modules/es.error.cause.js");
5
5
  require("core-js/modules/es.array.push.js");
6
6
  require("core-js/modules/esnext.iterator.constructor.js");
7
7
  require("core-js/modules/esnext.iterator.for-each.js");
8
- require("core-js/modules/esnext.iterator.map.js");
9
8
  var _element = require("../../../helpers/dom/element");
10
9
  var _function = require("../../../helpers/function");
11
10
  var _column = _interopRequireDefault(require("./filter/column"));
@@ -22,6 +21,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
22
21
  /**
23
22
  * @todo These mixes are never added to the class Table, however their members are used here.
24
23
  * @todo Continue: Potentially it works only, because some of these mixes are added to every inherited class.
24
+ * @todo Refactoring, move code from `if(this.isMaster)` into MasterTable, and others like that.
25
25
  * @mixes stickyColumnsStart
26
26
  * @mixes stickyRowsBottom
27
27
  * @mixes stickyRowsTop
@@ -78,6 +78,7 @@ class Table {
78
78
  *
79
79
  * @type {boolean}
80
80
  */
81
+ this.isMaster = name === 'master';
81
82
  this.name = name;
82
83
  this.dataAccessObject = dataAccessObject;
83
84
  this.facadeGetter = facadeGetter;
@@ -94,7 +95,9 @@ class Table {
94
95
  this.hider = this.createHider(this.spreader);
95
96
  this.holder = this.createHolder(this.hider);
96
97
  this.wtRootElement = this.holder.parentNode;
97
- this.alignOverlaysWithTrimmingContainer(); // todo wow, It calls method from child class (MasterTable).
98
+ if (this.isMaster) {
99
+ this.alignOverlaysWithTrimmingContainer(); // todo wow, It calls method from child class (MasterTable).
100
+ }
98
101
  this.fixTableDomTree();
99
102
  this.rowFilter = null; // TODO refactoring, eliminate all (re)creations of this object, then updates state when needed.
100
103
  this.columnFilter = null; // TODO refactoring, eliminate all (re)creations of this object, then updates state when needed.
@@ -114,31 +117,7 @@ class Table {
114
117
  TBODY: this.TBODY,
115
118
  rowUtils: this.rowUtils,
116
119
  columnUtils: this.columnUtils,
117
- cellRenderer: (row, column, TD) => {
118
- const fixedColumnsStart = this.wtSettings.getSetting('fixedColumnsStart');
119
- const fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
120
- this.wtSettings.getSettingPure('cellRenderer')(row, column, TD);
121
- if (column < fixedColumnsStart) {
122
- const left = this.dataAccessObject.wtViewport.getRowHeaderWidth() + this.dataAccessObject.wtOverlays.inlineStartOverlay.sumCellSizes(0, column);
123
- TD.style.position = 'sticky';
124
- TD.style.left = `${left}px`;
125
- if (row < fixedRowsTop) {
126
- TD.style.zIndex = '9';
127
- } else {
128
- TD.style.zIndex = '5';
129
- }
130
- }
131
- if (row < fixedRowsTop) {
132
- const top = this.dataAccessObject.wtViewport.getColumnHeaderHeight() + this.dataAccessObject.wtOverlays.topOverlay.sumCellSizes(0, row);
133
- TD.style.position = 'sticky';
134
- TD.style.top = `${top}px`;
135
- if (column < fixedColumnsStart) {
136
- TD.style.zIndex = '10';
137
- } else {
138
- TD.style.zIndex = '6';
139
- }
140
- }
141
- },
120
+ cellRenderer: this.wtSettings.getSettingPure('cellRenderer'),
142
121
  stylesHandler: this.dataAccessObject.stylesHandler
143
122
  });
144
123
  }
@@ -238,10 +217,12 @@ class Table {
238
217
  // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it
239
218
  parent.insertBefore(holder, hider);
240
219
  }
241
- holder.parentNode.className += 'ht_master handsontable';
242
- holder.parentNode.setAttribute('dir', this.wtSettings.getSettingPure('rtlMode') ? 'rtl' : 'ltr');
243
- if (this.wtSettings.getSetting('ariaTags')) {
244
- (0, _element.setAttribute)(holder.parentNode, [(0, _a11y.A11Y_PRESENTATION)()]);
220
+ if (this.isMaster) {
221
+ holder.parentNode.className += 'ht_master handsontable';
222
+ holder.parentNode.setAttribute('dir', this.wtSettings.getSettingPure('rtlMode') ? 'rtl' : 'ltr');
223
+ if (this.wtSettings.getSetting('ariaTags')) {
224
+ (0, _element.setAttribute)(holder.parentNode, [(0, _a11y.A11Y_PRESENTATION)()]);
225
+ }
245
226
  }
246
227
  holder.appendChild(hider);
247
228
  }
@@ -269,89 +250,100 @@ class Table {
269
250
  } = this.dataAccessObject;
270
251
  const totalRows = wtSettings.getSetting('totalRows');
271
252
  const totalColumns = wtSettings.getSetting('totalColumns');
272
- const rowHeaders = wtSettings.getSetting('rowHeaders').map(origRowRenderer => {
273
- return (row, TH, column) => {
274
- const fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
275
- const fixedColumnsStart = this.wtSettings.getSetting('fixedColumnsStart');
276
- if (row < fixedRowsTop) {
277
- let top = 0;
278
- if (row >= 0) {
279
- top = this.dataAccessObject.wtViewport.getColumnHeaderHeight() + this.dataAccessObject.wtOverlays.topOverlay.sumCellSizes(0, row);
280
- }
281
- TH.style.top = `${top}px`;
282
- if (column < fixedColumnsStart) {
283
- TH.style.zIndex = '20';
284
- } else {
285
- TH.style.zIndex = '10';
286
- }
287
- } else {
288
- TH.style.top = '0px';
289
- TH.style.zIndex = '3';
290
- }
291
- origRowRenderer(row, TH, column);
292
- TH.style.position = 'sticky';
293
- TH.style.left = '0px';
294
- };
295
- });
253
+ const rowHeaders = wtSettings.getSetting('rowHeaders');
296
254
  const rowHeadersCount = rowHeaders.length;
297
- const columnHeaders = wtSettings.getSetting('columnHeaders').map(origColumnRenderer => {
298
- return (column, TH, row) => {
299
- const fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
300
- const fixedColumnsStart = this.wtSettings.getSetting('fixedColumnsStart');
301
- if (column < fixedColumnsStart) {
302
- let left = 0;
303
- if (column >= 0) {
304
- left = this.dataAccessObject.wtViewport.getRowHeaderWidth() + this.dataAccessObject.wtOverlays.inlineStartOverlay.sumCellSizes(0, column);
305
- }
306
- TH.style.left = `${left}px`;
307
- if (row < fixedRowsTop) {
308
- TH.style.zIndex = '20';
309
- } else {
310
- TH.style.zIndex = '10';
311
- }
312
- } else {
313
- TH.style.zIndex = '3';
314
- TH.style.left = '0px';
315
- }
316
- origColumnRenderer(column, TH, row);
317
- TH.style.position = 'sticky';
318
- TH.style.top = '0px';
319
- };
320
- });
255
+ const columnHeaders = wtSettings.getSetting('columnHeaders');
321
256
  const columnHeadersCount = columnHeaders.length;
322
257
  let runFastDraw = fastDraw;
323
- wtOverlays.beforeDraw();
324
- this.holderOffset = (0, _element.offset)(this.holder);
325
- runFastDraw = wtViewport.createCalculators(runFastDraw);
326
- if (!runFastDraw) {
327
- this.tableOffset = (0, _element.offset)(this.TABLE);
258
+ if (this.isMaster) {
259
+ wtOverlays.beforeDraw();
260
+ this.holderOffset = (0, _element.offset)(this.holder);
261
+ runFastDraw = wtViewport.createCalculators(runFastDraw);
262
+ if (rowHeadersCount && !wtSettings.getSetting('fixedColumnsStart')) {
263
+ const leftScrollPos = wtOverlays.inlineStartOverlay.getScrollPosition();
264
+ const previousState = this.correctHeaderWidth;
265
+ this.correctHeaderWidth = leftScrollPos !== 0;
266
+ if (previousState !== this.correctHeaderWidth) {
267
+ runFastDraw = false;
268
+ }
269
+ }
270
+ }
271
+ if (runFastDraw) {
272
+ if (this.isMaster) {
273
+ wtOverlays.refresh(true);
274
+ }
275
+ } else {
276
+ if (this.isMaster) {
277
+ this.tableOffset = (0, _element.offset)(this.TABLE);
278
+ } else {
279
+ this.tableOffset = this.dataAccessObject.parentTableOffset;
280
+ }
328
281
  const startRow = totalRows > 0 ? this.getFirstRenderedRow() : 0;
329
282
  const startColumn = totalColumns > 0 ? this.getFirstRenderedColumn() : 0;
330
283
  this.rowFilter = new _row.default(startRow, totalRows, columnHeadersCount);
331
284
  this.columnFilter = new _column.default(startColumn, totalColumns, rowHeadersCount);
332
285
  let performRedraw = true;
333
- this.alignOverlaysWithTrimmingContainer(); // todo It calls method from child class (MasterTable).
334
- const skipRender = {};
335
- this.wtSettings.getSetting('beforeDraw', true, skipRender);
336
- performRedraw = skipRender.skipRender !== true;
286
+
287
+ // Only master table rendering can be skipped
288
+ if (this.isMaster) {
289
+ this.alignOverlaysWithTrimmingContainer(); // todo It calls method from child class (MasterTable).
290
+ const skipRender = {};
291
+ this.wtSettings.getSetting('beforeDraw', true, skipRender);
292
+ performRedraw = skipRender.skipRender !== true;
293
+ }
337
294
  if (performRedraw) {
338
295
  this.tableRenderer.setHeaderContentRenderers(rowHeaders, columnHeaders);
296
+ if (this.is(_overlay.CLONE_BOTTOM) || this.is(_overlay.CLONE_BOTTOM_INLINE_START_CORNER)) {
297
+ // do NOT render headers on the bottom or bottom-left corner overlay
298
+ this.tableRenderer.setHeaderContentRenderers(rowHeaders, []);
299
+ }
339
300
  this.resetOversizedRows();
340
301
  this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
341
- this.markOversizedColumnHeaders();
302
+ if (this.isMaster) {
303
+ this.markOversizedColumnHeaders();
304
+ }
342
305
  this.adjustColumnHeaderHeights();
343
- this.markOversizedRows();
344
- if (!this.wtSettings.getSetting('externalRowCalculator')) {
345
- wtViewport.createVisibleCalculators();
306
+ if (this.isMaster || this.is(_overlay.CLONE_BOTTOM)) {
307
+ this.markOversizedRows();
308
+ }
309
+ if (this.isMaster) {
310
+ if (!this.wtSettings.getSetting('externalRowCalculator')) {
311
+ wtViewport.createVisibleCalculators();
312
+ }
313
+ wtOverlays.refresh(false);
314
+ wtOverlays.applyToDOM();
315
+ this.wtSettings.getSetting('onDraw', true);
316
+ } else if (this.is(_overlay.CLONE_BOTTOM)) {
317
+ this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize();
346
318
  }
347
- wtOverlays.adjustElementsSize();
348
- // wtOverlays.draw(fastDraw);
349
-
350
- this.wtSettings.getSetting('onDraw', true);
351
319
  }
352
320
  }
353
- this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(runFastDraw);
354
- wtOverlays.afterDraw();
321
+ let positionChanged = false;
322
+ if (this.isMaster) {
323
+ positionChanged = wtOverlays.topOverlay.resetFixedPosition();
324
+ if (wtOverlays.bottomOverlay.clone) {
325
+ positionChanged = wtOverlays.bottomOverlay.resetFixedPosition() || positionChanged;
326
+ }
327
+ positionChanged = wtOverlays.inlineStartOverlay.resetFixedPosition() || positionChanged;
328
+ if (wtOverlays.topInlineStartCornerOverlay) {
329
+ wtOverlays.topInlineStartCornerOverlay.resetFixedPosition();
330
+ }
331
+ if (wtOverlays.bottomInlineStartCornerOverlay && wtOverlays.bottomInlineStartCornerOverlay.clone) {
332
+ wtOverlays.bottomInlineStartCornerOverlay.resetFixedPosition();
333
+ }
334
+ }
335
+ if (positionChanged) {
336
+ // It refreshes the cells borders caused by a 1px shift (introduced by overlays which add or
337
+ // remove `innerBorderTop` and `innerBorderInlineStart` CSS classes to the DOM element. This happens
338
+ // when there is a switch between rendering from 0 to N rows/columns and vice versa).
339
+ wtOverlays.refreshAll(); // `refreshAll()` internally already calls `refreshSelections()` method
340
+ wtOverlays.adjustElementsSize();
341
+ } else {
342
+ this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(runFastDraw);
343
+ }
344
+ if (this.isMaster) {
345
+ wtOverlays.afterDraw();
346
+ }
355
347
  this.dataAccessObject.drawn = true;
356
348
  return this;
357
349
  }
@@ -423,6 +415,9 @@ class Table {
423
415
  const {
424
416
  wtViewport
425
417
  } = this.dataAccessObject;
418
+ if (!this.isMaster && !this.is(_overlay.CLONE_BOTTOM)) {
419
+ return;
420
+ }
426
421
  if (!wtSettings.getSetting('externalRowCalculator')) {
427
422
  const rowsToRender = this.getRenderedRowsCount();
428
423
 
@@ -458,7 +453,7 @@ class Table {
458
453
  getCell(coords) {
459
454
  let row = coords.row;
460
455
  let column = coords.col;
461
- const hookResult = this.wtSettings.getSetting('onModifyGetCellCoords', row, column, false, 'render');
456
+ const hookResult = this.wtSettings.getSetting('onModifyGetCellCoords', row, column, !this.isMaster, 'render');
462
457
  if (hookResult && Array.isArray(hookResult)) {
463
458
  [row, column] = hookResult;
464
459
  }
@@ -2,7 +2,6 @@ import "core-js/modules/es.error.cause.js";
2
2
  import "core-js/modules/es.array.push.js";
3
3
  import "core-js/modules/esnext.iterator.constructor.js";
4
4
  import "core-js/modules/esnext.iterator.for-each.js";
5
- import "core-js/modules/esnext.iterator.map.js";
6
5
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
7
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
8
7
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -18,6 +17,7 @@ import { A11Y_PRESENTATION } from "../../../helpers/a11y.mjs";
18
17
  /**
19
18
  * @todo These mixes are never added to the class Table, however their members are used here.
20
19
  * @todo Continue: Potentially it works only, because some of these mixes are added to every inherited class.
20
+ * @todo Refactoring, move code from `if(this.isMaster)` into MasterTable, and others like that.
21
21
  * @mixes stickyColumnsStart
22
22
  * @mixes stickyRowsBottom
23
23
  * @mixes stickyRowsTop
@@ -74,6 +74,7 @@ class Table {
74
74
  *
75
75
  * @type {boolean}
76
76
  */
77
+ this.isMaster = name === 'master';
77
78
  this.name = name;
78
79
  this.dataAccessObject = dataAccessObject;
79
80
  this.facadeGetter = facadeGetter;
@@ -90,7 +91,9 @@ class Table {
90
91
  this.hider = this.createHider(this.spreader);
91
92
  this.holder = this.createHolder(this.hider);
92
93
  this.wtRootElement = this.holder.parentNode;
93
- this.alignOverlaysWithTrimmingContainer(); // todo wow, It calls method from child class (MasterTable).
94
+ if (this.isMaster) {
95
+ this.alignOverlaysWithTrimmingContainer(); // todo wow, It calls method from child class (MasterTable).
96
+ }
94
97
  this.fixTableDomTree();
95
98
  this.rowFilter = null; // TODO refactoring, eliminate all (re)creations of this object, then updates state when needed.
96
99
  this.columnFilter = null; // TODO refactoring, eliminate all (re)creations of this object, then updates state when needed.
@@ -110,31 +113,7 @@ class Table {
110
113
  TBODY: this.TBODY,
111
114
  rowUtils: this.rowUtils,
112
115
  columnUtils: this.columnUtils,
113
- cellRenderer: (row, column, TD) => {
114
- const fixedColumnsStart = this.wtSettings.getSetting('fixedColumnsStart');
115
- const fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
116
- this.wtSettings.getSettingPure('cellRenderer')(row, column, TD);
117
- if (column < fixedColumnsStart) {
118
- const left = this.dataAccessObject.wtViewport.getRowHeaderWidth() + this.dataAccessObject.wtOverlays.inlineStartOverlay.sumCellSizes(0, column);
119
- TD.style.position = 'sticky';
120
- TD.style.left = `${left}px`;
121
- if (row < fixedRowsTop) {
122
- TD.style.zIndex = '9';
123
- } else {
124
- TD.style.zIndex = '5';
125
- }
126
- }
127
- if (row < fixedRowsTop) {
128
- const top = this.dataAccessObject.wtViewport.getColumnHeaderHeight() + this.dataAccessObject.wtOverlays.topOverlay.sumCellSizes(0, row);
129
- TD.style.position = 'sticky';
130
- TD.style.top = `${top}px`;
131
- if (column < fixedColumnsStart) {
132
- TD.style.zIndex = '10';
133
- } else {
134
- TD.style.zIndex = '6';
135
- }
136
- }
137
- },
116
+ cellRenderer: this.wtSettings.getSettingPure('cellRenderer'),
138
117
  stylesHandler: this.dataAccessObject.stylesHandler
139
118
  });
140
119
  }
@@ -234,10 +213,12 @@ class Table {
234
213
  // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it
235
214
  parent.insertBefore(holder, hider);
236
215
  }
237
- holder.parentNode.className += 'ht_master handsontable';
238
- holder.parentNode.setAttribute('dir', this.wtSettings.getSettingPure('rtlMode') ? 'rtl' : 'ltr');
239
- if (this.wtSettings.getSetting('ariaTags')) {
240
- setAttribute(holder.parentNode, [A11Y_PRESENTATION()]);
216
+ if (this.isMaster) {
217
+ holder.parentNode.className += 'ht_master handsontable';
218
+ holder.parentNode.setAttribute('dir', this.wtSettings.getSettingPure('rtlMode') ? 'rtl' : 'ltr');
219
+ if (this.wtSettings.getSetting('ariaTags')) {
220
+ setAttribute(holder.parentNode, [A11Y_PRESENTATION()]);
221
+ }
241
222
  }
242
223
  holder.appendChild(hider);
243
224
  }
@@ -265,89 +246,100 @@ class Table {
265
246
  } = this.dataAccessObject;
266
247
  const totalRows = wtSettings.getSetting('totalRows');
267
248
  const totalColumns = wtSettings.getSetting('totalColumns');
268
- const rowHeaders = wtSettings.getSetting('rowHeaders').map(origRowRenderer => {
269
- return (row, TH, column) => {
270
- const fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
271
- const fixedColumnsStart = this.wtSettings.getSetting('fixedColumnsStart');
272
- if (row < fixedRowsTop) {
273
- let top = 0;
274
- if (row >= 0) {
275
- top = this.dataAccessObject.wtViewport.getColumnHeaderHeight() + this.dataAccessObject.wtOverlays.topOverlay.sumCellSizes(0, row);
276
- }
277
- TH.style.top = `${top}px`;
278
- if (column < fixedColumnsStart) {
279
- TH.style.zIndex = '20';
280
- } else {
281
- TH.style.zIndex = '10';
282
- }
283
- } else {
284
- TH.style.top = '0px';
285
- TH.style.zIndex = '3';
286
- }
287
- origRowRenderer(row, TH, column);
288
- TH.style.position = 'sticky';
289
- TH.style.left = '0px';
290
- };
291
- });
249
+ const rowHeaders = wtSettings.getSetting('rowHeaders');
292
250
  const rowHeadersCount = rowHeaders.length;
293
- const columnHeaders = wtSettings.getSetting('columnHeaders').map(origColumnRenderer => {
294
- return (column, TH, row) => {
295
- const fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
296
- const fixedColumnsStart = this.wtSettings.getSetting('fixedColumnsStart');
297
- if (column < fixedColumnsStart) {
298
- let left = 0;
299
- if (column >= 0) {
300
- left = this.dataAccessObject.wtViewport.getRowHeaderWidth() + this.dataAccessObject.wtOverlays.inlineStartOverlay.sumCellSizes(0, column);
301
- }
302
- TH.style.left = `${left}px`;
303
- if (row < fixedRowsTop) {
304
- TH.style.zIndex = '20';
305
- } else {
306
- TH.style.zIndex = '10';
307
- }
308
- } else {
309
- TH.style.zIndex = '3';
310
- TH.style.left = '0px';
311
- }
312
- origColumnRenderer(column, TH, row);
313
- TH.style.position = 'sticky';
314
- TH.style.top = '0px';
315
- };
316
- });
251
+ const columnHeaders = wtSettings.getSetting('columnHeaders');
317
252
  const columnHeadersCount = columnHeaders.length;
318
253
  let runFastDraw = fastDraw;
319
- wtOverlays.beforeDraw();
320
- this.holderOffset = offset(this.holder);
321
- runFastDraw = wtViewport.createCalculators(runFastDraw);
322
- if (!runFastDraw) {
323
- this.tableOffset = offset(this.TABLE);
254
+ if (this.isMaster) {
255
+ wtOverlays.beforeDraw();
256
+ this.holderOffset = offset(this.holder);
257
+ runFastDraw = wtViewport.createCalculators(runFastDraw);
258
+ if (rowHeadersCount && !wtSettings.getSetting('fixedColumnsStart')) {
259
+ const leftScrollPos = wtOverlays.inlineStartOverlay.getScrollPosition();
260
+ const previousState = this.correctHeaderWidth;
261
+ this.correctHeaderWidth = leftScrollPos !== 0;
262
+ if (previousState !== this.correctHeaderWidth) {
263
+ runFastDraw = false;
264
+ }
265
+ }
266
+ }
267
+ if (runFastDraw) {
268
+ if (this.isMaster) {
269
+ wtOverlays.refresh(true);
270
+ }
271
+ } else {
272
+ if (this.isMaster) {
273
+ this.tableOffset = offset(this.TABLE);
274
+ } else {
275
+ this.tableOffset = this.dataAccessObject.parentTableOffset;
276
+ }
324
277
  const startRow = totalRows > 0 ? this.getFirstRenderedRow() : 0;
325
278
  const startColumn = totalColumns > 0 ? this.getFirstRenderedColumn() : 0;
326
279
  this.rowFilter = new RowFilter(startRow, totalRows, columnHeadersCount);
327
280
  this.columnFilter = new ColumnFilter(startColumn, totalColumns, rowHeadersCount);
328
281
  let performRedraw = true;
329
- this.alignOverlaysWithTrimmingContainer(); // todo It calls method from child class (MasterTable).
330
- const skipRender = {};
331
- this.wtSettings.getSetting('beforeDraw', true, skipRender);
332
- performRedraw = skipRender.skipRender !== true;
282
+
283
+ // Only master table rendering can be skipped
284
+ if (this.isMaster) {
285
+ this.alignOverlaysWithTrimmingContainer(); // todo It calls method from child class (MasterTable).
286
+ const skipRender = {};
287
+ this.wtSettings.getSetting('beforeDraw', true, skipRender);
288
+ performRedraw = skipRender.skipRender !== true;
289
+ }
333
290
  if (performRedraw) {
334
291
  this.tableRenderer.setHeaderContentRenderers(rowHeaders, columnHeaders);
292
+ if (this.is(CLONE_BOTTOM) || this.is(CLONE_BOTTOM_INLINE_START_CORNER)) {
293
+ // do NOT render headers on the bottom or bottom-left corner overlay
294
+ this.tableRenderer.setHeaderContentRenderers(rowHeaders, []);
295
+ }
335
296
  this.resetOversizedRows();
336
297
  this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
337
- this.markOversizedColumnHeaders();
298
+ if (this.isMaster) {
299
+ this.markOversizedColumnHeaders();
300
+ }
338
301
  this.adjustColumnHeaderHeights();
339
- this.markOversizedRows();
340
- if (!this.wtSettings.getSetting('externalRowCalculator')) {
341
- wtViewport.createVisibleCalculators();
302
+ if (this.isMaster || this.is(CLONE_BOTTOM)) {
303
+ this.markOversizedRows();
304
+ }
305
+ if (this.isMaster) {
306
+ if (!this.wtSettings.getSetting('externalRowCalculator')) {
307
+ wtViewport.createVisibleCalculators();
308
+ }
309
+ wtOverlays.refresh(false);
310
+ wtOverlays.applyToDOM();
311
+ this.wtSettings.getSetting('onDraw', true);
312
+ } else if (this.is(CLONE_BOTTOM)) {
313
+ this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize();
342
314
  }
343
- wtOverlays.adjustElementsSize();
344
- // wtOverlays.draw(fastDraw);
345
-
346
- this.wtSettings.getSetting('onDraw', true);
347
315
  }
348
316
  }
349
- this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(runFastDraw);
350
- wtOverlays.afterDraw();
317
+ let positionChanged = false;
318
+ if (this.isMaster) {
319
+ positionChanged = wtOverlays.topOverlay.resetFixedPosition();
320
+ if (wtOverlays.bottomOverlay.clone) {
321
+ positionChanged = wtOverlays.bottomOverlay.resetFixedPosition() || positionChanged;
322
+ }
323
+ positionChanged = wtOverlays.inlineStartOverlay.resetFixedPosition() || positionChanged;
324
+ if (wtOverlays.topInlineStartCornerOverlay) {
325
+ wtOverlays.topInlineStartCornerOverlay.resetFixedPosition();
326
+ }
327
+ if (wtOverlays.bottomInlineStartCornerOverlay && wtOverlays.bottomInlineStartCornerOverlay.clone) {
328
+ wtOverlays.bottomInlineStartCornerOverlay.resetFixedPosition();
329
+ }
330
+ }
331
+ if (positionChanged) {
332
+ // It refreshes the cells borders caused by a 1px shift (introduced by overlays which add or
333
+ // remove `innerBorderTop` and `innerBorderInlineStart` CSS classes to the DOM element. This happens
334
+ // when there is a switch between rendering from 0 to N rows/columns and vice versa).
335
+ wtOverlays.refreshAll(); // `refreshAll()` internally already calls `refreshSelections()` method
336
+ wtOverlays.adjustElementsSize();
337
+ } else {
338
+ this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(runFastDraw);
339
+ }
340
+ if (this.isMaster) {
341
+ wtOverlays.afterDraw();
342
+ }
351
343
  this.dataAccessObject.drawn = true;
352
344
  return this;
353
345
  }
@@ -419,6 +411,9 @@ class Table {
419
411
  const {
420
412
  wtViewport
421
413
  } = this.dataAccessObject;
414
+ if (!this.isMaster && !this.is(CLONE_BOTTOM)) {
415
+ return;
416
+ }
422
417
  if (!wtSettings.getSetting('externalRowCalculator')) {
423
418
  const rowsToRender = this.getRenderedRowsCount();
424
419
 
@@ -454,7 +449,7 @@ class Table {
454
449
  getCell(coords) {
455
450
  let row = coords.row;
456
451
  let column = coords.col;
457
- const hookResult = this.wtSettings.getSetting('onModifyGetCellCoords', row, column, false, 'render');
452
+ const hookResult = this.wtSettings.getSetting('onModifyGetCellCoords', row, column, !this.isMaster, 'render');
458
453
  if (hookResult && Array.isArray(hookResult)) {
459
454
  [row, column] = hookResult;
460
455
  }
package/base.js CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _hooks.Hooks.getSingleton();
45
45
  Handsontable.CellCoords = _src.CellCoords;
46
46
  Handsontable.CellRange = _src.CellRange;
47
47
  Handsontable.packageName = 'handsontable';
48
- Handsontable.buildDate = "21/01/2025 09:22:44";
49
- Handsontable.version = "0.0.0-next-f52ab71-20250121";
48
+ Handsontable.buildDate = "21/01/2025 11:19:43";
49
+ Handsontable.version = "0.0.0-next-8d1d868-20250121";
50
50
  Handsontable.languages = {
51
51
  dictionaryKeys: _registry.dictionaryKeys,
52
52
  getLanguageDictionary: _registry.getLanguageDictionary,
package/base.mjs CHANGED
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
35
35
  Handsontable.CellCoords = CellCoords;
36
36
  Handsontable.CellRange = CellRange;
37
37
  Handsontable.packageName = 'handsontable';
38
- Handsontable.buildDate = "21/01/2025 09:22:49";
39
- Handsontable.version = "0.0.0-next-f52ab71-20250121";
38
+ Handsontable.buildDate = "21/01/2025 11:19:49";
39
+ Handsontable.version = "0.0.0-next-8d1d868-20250121";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
@@ -25,11 +25,9 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-f52ab71-20250121
29
- * Release date: 16/12/2024 (built at 21/01/2025 09:23:12)
28
+ * Version: 0.0.0-next-8d1d868-20250121
29
+ * Release date: 16/12/2024 (built at 21/01/2025 11:20:13)
30
30
  */
31
- @charset "UTF-8";
32
-
33
31
  /**
34
32
  * Fix for bootstrap styles
35
33
  */
@@ -358,12 +356,20 @@ innerBorderBottom - Property controlled by bottom overlay
358
356
  overflow: auto;
359
357
  }
360
358
 
359
+ .handsontable .ht_master table.htCore > thead,
360
+ .handsontable .ht_master table.htCore > tbody > tr > th,
361
+ .handsontable .ht_clone_inline_start table.htCore > thead {
362
+ visibility: hidden;
363
+ }
364
+
361
365
  .ht_clone_top .wtHolder,
362
366
  .ht_clone_inline_start .wtHolder,
363
367
  .ht_clone_bottom .wtHolder {
364
368
  overflow: hidden;
365
369
  }
366
370
 
371
+ @charset "UTF-8";
372
+
367
373
  .handsontable {
368
374
  position: relative;
369
375
  touch-action: manipulation;
@@ -1159,6 +1165,8 @@ textarea.HandsontableCopyPaste {
1159
1165
  outline: 0 none !important;
1160
1166
  }
1161
1167
 
1168
+ @charset "UTF-8";
1169
+
1162
1170
  /*!
1163
1171
  * Handsontable DropdownMenu
1164
1172
  */
@@ -1307,6 +1315,8 @@ textarea.HandsontableCopyPaste {
1307
1315
  overflow: hidden;
1308
1316
  }
1309
1317
 
1318
+ @charset "UTF-8";
1319
+
1310
1320
  /*!
1311
1321
  * Handsontable Filters
1312
1322
  */
@@ -1652,6 +1662,8 @@ textarea.HandsontableCopyPaste {
1652
1662
  padding-bottom: 5px;
1653
1663
  }
1654
1664
 
1665
+ @charset "UTF-8";
1666
+
1655
1667
  /*
1656
1668
  * Handsontable HiddenColumns
1657
1669
  */
@@ -1710,6 +1722,8 @@ textarea.HandsontableCopyPaste {
1710
1722
  content: "◀"; /* left arrow */
1711
1723
  }
1712
1724
 
1725
+ @charset "UTF-8";
1726
+
1713
1727
  /*!
1714
1728
  * Handsontable HiddenRows
1715
1729
  */
@@ -1976,6 +1990,8 @@ textarea.HandsontableCopyPaste {
1976
1990
  display: none;
1977
1991
  }
1978
1992
 
1993
+ @charset "UTF-8";
1994
+
1979
1995
  .handsontable th.ht_nestingLevels {
1980
1996
  text-align: left;
1981
1997
  padding-left: 7px;