handsontable 0.0.0-next-3e0b40d-20241017 → 0.0.0-next-802f59c-20241024

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (116) hide show
  1. package/3rdparty/walkontable/src/calculator/viewportRows.js +1 -5
  2. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +2 -5
  3. package/3rdparty/walkontable/src/core/clone.js +0 -1
  4. package/3rdparty/walkontable/src/core/clone.mjs +0 -1
  5. package/3rdparty/walkontable/src/core/core.js +0 -2
  6. package/3rdparty/walkontable/src/core/core.mjs +0 -2
  7. package/3rdparty/walkontable/src/overlay/_base.js +1 -3
  8. package/3rdparty/walkontable/src/overlay/_base.mjs +1 -3
  9. package/3rdparty/walkontable/src/overlay/bottom.js +2 -2
  10. package/3rdparty/walkontable/src/overlay/bottom.mjs +2 -2
  11. package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -1
  12. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +1 -1
  13. package/3rdparty/walkontable/src/overlay/top.js +1 -1
  14. package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
  15. package/3rdparty/walkontable/src/overlays.js +7 -6
  16. package/3rdparty/walkontable/src/overlays.mjs +7 -6
  17. package/3rdparty/walkontable/src/renderer/colGroup.js +1 -1
  18. package/3rdparty/walkontable/src/renderer/colGroup.mjs +1 -1
  19. package/3rdparty/walkontable/src/renderer/table.js +1 -1
  20. package/3rdparty/walkontable/src/renderer/table.mjs +1 -1
  21. package/3rdparty/walkontable/src/settings.js +2 -7
  22. package/3rdparty/walkontable/src/settings.mjs +2 -7
  23. package/3rdparty/walkontable/src/table.js +8 -35
  24. package/3rdparty/walkontable/src/table.mjs +8 -35
  25. package/3rdparty/walkontable/src/utils/column.js +1 -43
  26. package/3rdparty/walkontable/src/utils/column.mjs +1 -43
  27. package/3rdparty/walkontable/src/viewport.js +66 -88
  28. package/3rdparty/walkontable/src/viewport.mjs +67 -89
  29. package/CHANGELOG.md +5 -0
  30. package/base.js +2 -2
  31. package/base.mjs +2 -2
  32. package/core/hooks/constants.js +2 -0
  33. package/core/hooks/constants.mjs +2 -0
  34. package/core/hooks/index.d.ts +2 -2
  35. package/core.d.ts +2 -2
  36. package/core.js +6 -15
  37. package/core.mjs +6 -15
  38. package/dataMap/metaManager/metaSchema.js +0 -17
  39. package/dataMap/metaManager/metaSchema.mjs +0 -17
  40. package/dist/handsontable.css +5 -236
  41. package/dist/handsontable.full.css +3 -3
  42. package/dist/handsontable.full.js +4539 -4231
  43. package/dist/handsontable.full.min.css +3 -4
  44. package/dist/handsontable.full.min.js +26 -26
  45. package/dist/handsontable.js +4230 -3928
  46. package/dist/handsontable.min.css +4 -9
  47. package/dist/handsontable.min.js +24 -24
  48. package/editors/autocompleteEditor/autocompleteEditor.js +1 -1
  49. package/editors/autocompleteEditor/autocompleteEditor.mjs +1 -1
  50. package/editors/baseEditor/baseEditor.js +1 -1
  51. package/editors/baseEditor/baseEditor.mjs +1 -1
  52. package/editors/dateEditor/dateEditor.js +0 -2
  53. package/editors/dateEditor/dateEditor.mjs +0 -2
  54. package/editors/handsontableEditor/handsontableEditor.js +1 -1
  55. package/editors/handsontableEditor/handsontableEditor.mjs +1 -1
  56. package/editors/passwordEditor/passwordEditor.js +0 -4
  57. package/editors/passwordEditor/passwordEditor.mjs +1 -5
  58. package/editors/selectEditor/selectEditor.js +9 -20
  59. package/editors/selectEditor/selectEditor.mjs +9 -20
  60. package/editors/textEditor/textEditor.js +11 -7
  61. package/editors/textEditor/textEditor.mjs +12 -8
  62. package/helpers/mixed.js +3 -3
  63. package/helpers/mixed.mjs +3 -3
  64. package/index.d.ts +7 -0
  65. package/package.json +8 -10
  66. package/plugins/comments/commentEditor.js +1 -8
  67. package/plugins/comments/commentEditor.mjs +1 -8
  68. package/plugins/comments/comments.js +2 -2
  69. package/plugins/comments/comments.mjs +2 -2
  70. package/plugins/contextMenu/menu/menu.js +4 -4
  71. package/plugins/contextMenu/menu/menu.mjs +4 -4
  72. package/plugins/index.d.ts +3 -0
  73. package/plugins/index.js +3 -0
  74. package/plugins/index.mjs +3 -1
  75. package/plugins/manualColumnMove/manualColumnMove.js +1 -3
  76. package/plugins/manualColumnMove/manualColumnMove.mjs +1 -3
  77. package/plugins/manualColumnResize/manualColumnResize.js +24 -12
  78. package/plugins/manualColumnResize/manualColumnResize.mjs +24 -12
  79. package/plugins/manualRowMove/manualRowMove.js +1 -1
  80. package/plugins/manualRowMove/manualRowMove.mjs +1 -1
  81. package/plugins/mergeCells/mergeCells.js +1 -1
  82. package/plugins/mergeCells/mergeCells.mjs +1 -1
  83. package/plugins/nestedRows/ui/headers.js +1 -3
  84. package/plugins/nestedRows/ui/headers.mjs +1 -3
  85. package/plugins/stretchColumns/calculator.js +159 -0
  86. package/plugins/stretchColumns/calculator.mjs +155 -0
  87. package/plugins/stretchColumns/index.d.ts +1 -0
  88. package/plugins/stretchColumns/index.js +7 -0
  89. package/plugins/stretchColumns/index.mjs +1 -0
  90. package/plugins/stretchColumns/strategies/_base.js +85 -0
  91. package/plugins/stretchColumns/strategies/_base.mjs +81 -0
  92. package/plugins/stretchColumns/strategies/all.js +68 -0
  93. package/plugins/stretchColumns/strategies/all.mjs +64 -0
  94. package/plugins/stretchColumns/strategies/last.js +77 -0
  95. package/plugins/stretchColumns/strategies/last.mjs +73 -0
  96. package/plugins/stretchColumns/stretchColumns.d.ts +11 -0
  97. package/plugins/stretchColumns/stretchColumns.js +211 -0
  98. package/plugins/stretchColumns/stretchColumns.mjs +207 -0
  99. package/tableView.js +39 -39
  100. package/tableView.mjs +39 -39
  101. package/utils/autoResize.js +1 -4
  102. package/utils/autoResize.mjs +1 -4
  103. package/utils/ghostTable.js +1 -1
  104. package/utils/ghostTable.mjs +1 -1
  105. package/3rdparty/walkontable/src/utils/columnStretching.js +0 -197
  106. package/3rdparty/walkontable/src/utils/columnStretching.mjs +0 -193
  107. package/3rdparty/walkontable/src/utils/stylesHandler.js +0 -185
  108. package/3rdparty/walkontable/src/utils/stylesHandler.mjs +0 -181
  109. package/helpers/themes.js +0 -17
  110. package/helpers/themes.mjs +0 -13
  111. package/styles/handsontable.css +0 -1920
  112. package/styles/handsontable.min.css +0 -30
  113. package/styles/ht-theme-gemini.css +0 -690
  114. package/styles/ht-theme-gemini.min.css +0 -30
  115. package/styles/ht-theme-main.css +0 -712
  116. package/styles/ht-theme-main.min.css +0 -30
@@ -7,8 +7,7 @@ var _viewportBase = require("./viewportBase");
7
7
  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; }
8
8
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
9
9
  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); }
10
- // eslint-disable-next-line import/no-mutable-exports
11
- let DEFAULT_HEIGHT = exports.DEFAULT_HEIGHT = 23;
10
+ const DEFAULT_HEIGHT = exports.DEFAULT_HEIGHT = 23;
12
11
 
13
12
  /**
14
13
  * @typedef {object} ViewportRowsCalculatorOptions
@@ -35,13 +34,10 @@ class ViewportRowsCalculator extends _viewportBase.ViewportBaseCalculator {
35
34
  viewportHeight,
36
35
  scrollOffset,
37
36
  totalRows,
38
- defaultRowHeight,
39
37
  rowHeightFn,
40
38
  overrideFn,
41
39
  horizontalScrollbarHeight
42
40
  } = _ref;
43
- // Replace the default height of `23px` with a value from the current theme.
44
- exports.DEFAULT_HEIGHT = DEFAULT_HEIGHT = defaultRowHeight;
45
41
  super(calculationTypes);
46
42
  _defineProperty(this, "viewportHeight", 0);
47
43
  _defineProperty(this, "scrollOffset", 0);
@@ -3,8 +3,8 @@ import "core-js/modules/es.array.push.js";
3
3
  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; }
4
4
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
5
  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); }
6
- import { ViewportBaseCalculator } from "./viewportBase.mjs"; // eslint-disable-next-line import/no-mutable-exports
7
- export let DEFAULT_HEIGHT = 23;
6
+ import { ViewportBaseCalculator } from "./viewportBase.mjs";
7
+ export const DEFAULT_HEIGHT = 23;
8
8
 
9
9
  /**
10
10
  * @typedef {object} ViewportRowsCalculatorOptions
@@ -31,13 +31,10 @@ export class ViewportRowsCalculator extends ViewportBaseCalculator {
31
31
  viewportHeight,
32
32
  scrollOffset,
33
33
  totalRows,
34
- defaultRowHeight,
35
34
  rowHeightFn,
36
35
  overrideFn,
37
36
  horizontalScrollbarHeight
38
37
  } = _ref;
39
- // Replace the default height of `23px` with a value from the current theme.
40
- DEFAULT_HEIGHT = defaultRowHeight;
41
38
  super(calculationTypes);
42
39
  _defineProperty(this, "viewportHeight", 0);
43
40
  _defineProperty(this, "scrollOffset", 0);
@@ -33,7 +33,6 @@ class Clone extends _base.default {
33
33
  this.wtTable = this.cloneOverlay.createTable(this.getTableDao(), facadeGetter, this.domBindings, this.wtSettings);
34
34
  this.wtViewport = clone.viewport;
35
35
  this.selectionManager = clone.selectionManager;
36
- this.stylesHandler = clone.stylesHandler;
37
36
  this.wtEvent = new _event.default(facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable, this.selectionManager, clone.event);
38
37
  this.findOriginalHeaders();
39
38
  }
@@ -29,7 +29,6 @@ export default class Clone extends CoreAbstract {
29
29
  this.wtTable = this.cloneOverlay.createTable(this.getTableDao(), facadeGetter, this.domBindings, this.wtSettings);
30
30
  this.wtViewport = clone.viewport;
31
31
  this.selectionManager = clone.selectionManager;
32
- this.stylesHandler = clone.stylesHandler;
33
32
  this.wtEvent = new Event(facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable, this.selectionManager, clone.event);
34
33
  this.findOriginalHeaders();
35
34
  }
@@ -12,7 +12,6 @@ var _base = _interopRequireDefault(require("./_base"));
12
12
  var _manager = require("../selection/manager");
13
13
  var _object = require("../../../../helpers/object");
14
14
  var _element = require("../../../../helpers/dom/element");
15
- var _stylesHandler = require("../utils/stylesHandler");
16
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
16
  /**
18
17
  * @class Walkontable
@@ -24,7 +23,6 @@ class Walkontable extends _base.default {
24
23
  */
25
24
  constructor(table, settings) {
26
25
  super(table, new _settings.default(settings));
27
- this.stylesHandler = new _stylesHandler.StylesHandler(this.domBindings);
28
26
  const facadeGetter = this.wtSettings.getSetting('facade', this); // todo rethink. I would like to have no access to facade from the internal scope.
29
27
 
30
28
  this.wtTable = new _master.default(this.getTableDao(), facadeGetter, this.domBindings, this.wtSettings);
@@ -9,7 +9,6 @@ import CoreAbstract from "./_base.mjs";
9
9
  import { SelectionManager } from "../selection/manager.mjs";
10
10
  import { objectEach } from "../../../../helpers/object.mjs";
11
11
  import { addClass, removeClass } from "../../../../helpers/dom/element.mjs";
12
- import { StylesHandler } from "../utils/stylesHandler.mjs";
13
12
  /**
14
13
  * @class Walkontable
15
14
  */
@@ -20,7 +19,6 @@ export default class Walkontable extends CoreAbstract {
20
19
  */
21
20
  constructor(table, settings) {
22
21
  super(table, new Settings(settings));
23
- this.stylesHandler = new StylesHandler(this.domBindings);
24
22
  const facadeGetter = this.wtSettings.getSetting('facade', this); // todo rethink. I would like to have no access to facade from the internal scope.
25
23
 
26
24
  this.wtTable = new MasterTable(this.getTableDao(), facadeGetter, this.domBindings, this.wtSettings);
@@ -302,9 +302,7 @@ class Overlay {
302
302
  // todo ioc , or factor func if used only here
303
303
  event: this.wot.wtEvent,
304
304
  // todo ioc , or factory func if used only here
305
- selectionManager: this.wot.selectionManager,
306
- // todo ioc , or factory func if used only here
307
- stylesHandler: this.wot.stylesHandler
305
+ selectionManager: this.wot.selectionManager // todo ioc , or factory func if used only here
308
306
  });
309
307
  }
310
308
 
@@ -298,9 +298,7 @@ export class Overlay {
298
298
  // todo ioc , or factor func if used only here
299
299
  event: this.wot.wtEvent,
300
300
  // todo ioc , or factory func if used only here
301
- selectionManager: this.wot.selectionManager,
302
- // todo ioc , or factory func if used only here
303
- stylesHandler: this.wot.stylesHandler
301
+ selectionManager: this.wot.selectionManager // todo ioc , or factory func if used only here
304
302
  });
305
303
  }
306
304
 
@@ -144,9 +144,9 @@ class BottomOverlay extends _base.Overlay {
144
144
  sumCellSizes(from, to) {
145
145
  const {
146
146
  wtTable,
147
- stylesHandler
147
+ wtSettings
148
148
  } = this.wot;
149
- const defaultRowHeight = stylesHandler.getDefaultRowHeight();
149
+ const defaultRowHeight = wtSettings.getSetting('defaultRowHeight');
150
150
  let row = from;
151
151
  let sum = 0;
152
152
  while (row < to) {
@@ -140,9 +140,9 @@ export class BottomOverlay extends Overlay {
140
140
  sumCellSizes(from, to) {
141
141
  const {
142
142
  wtTable,
143
- stylesHandler
143
+ wtSettings
144
144
  } = this.wot;
145
- const defaultRowHeight = stylesHandler.getDefaultRowHeight();
145
+ const defaultRowHeight = wtSettings.getSetting('defaultRowHeight');
146
146
  let row = from;
147
147
  let sum = 0;
148
148
  while (row < to) {
@@ -119,7 +119,7 @@ class InlineStartOverlay extends _base.Overlay {
119
119
  let column = from;
120
120
  let sum = 0;
121
121
  while (column < to) {
122
- sum += this.wot.wtTable.getStretchedColumnWidth(column) || defaultColumnWidth;
122
+ sum += this.wot.wtTable.getColumnWidth(column) || defaultColumnWidth;
123
123
  column += 1;
124
124
  }
125
125
  return sum;
@@ -115,7 +115,7 @@ export class InlineStartOverlay extends Overlay {
115
115
  let column = from;
116
116
  let sum = 0;
117
117
  while (column < to) {
118
- sum += this.wot.wtTable.getStretchedColumnWidth(column) || defaultColumnWidth;
118
+ sum += this.wot.wtTable.getColumnWidth(column) || defaultColumnWidth;
119
119
  column += 1;
120
120
  }
121
121
  return sum;
@@ -138,7 +138,7 @@ class TopOverlay extends _base.Overlay {
138
138
  * @returns {number} Height sum.
139
139
  */
140
140
  sumCellSizes(from, to) {
141
- const defaultRowHeight = this.wot.stylesHandler.getDefaultRowHeight();
141
+ const defaultRowHeight = this.wtSettings.getSetting('defaultRowHeight');
142
142
  let row = from;
143
143
  let sum = 0;
144
144
  while (row < to) {
@@ -134,7 +134,7 @@ export class TopOverlay extends Overlay {
134
134
  * @returns {number} Height sum.
135
135
  */
136
136
  sumCellSizes(from, to) {
137
- const defaultRowHeight = this.wot.stylesHandler.getDefaultRowHeight();
137
+ const defaultRowHeight = this.wtSettings.getSetting('defaultRowHeight');
138
138
  let row = from;
139
139
  let sum = 0;
140
140
  while (row < to) {
@@ -329,13 +329,14 @@ class Overlays {
329
329
  });
330
330
  let resizeTimeout;
331
331
  this.eventManager.addEventListener(rootWindow, 'resize', () => {
332
- clearTimeout(resizeTimeout);
333
- resizeTimeout = setTimeout(() => {
332
+ (0, _feature.requestAnimationFrame)(() => {
333
+ clearTimeout(resizeTimeout);
334
334
  this.wtSettings.getSetting('onWindowResize');
335
-
336
- // Remove resizing the window from the ResizeObserver's endless-loop-blocking logic.
337
- _classPrivateFieldSet(_containerDomResizeCount, this, 0);
338
- }, 200);
335
+ resizeTimeout = setTimeout(() => {
336
+ // Remove resizing the window from the ResizeObserver's endless-loop-blocking logic.
337
+ _classPrivateFieldSet(_containerDomResizeCount, this, 0);
338
+ }, 200);
339
+ });
339
340
  });
340
341
  if (!isScrollOnWindow) {
341
342
  this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement);
@@ -326,13 +326,14 @@ class Overlays {
326
326
  });
327
327
  let resizeTimeout;
328
328
  this.eventManager.addEventListener(rootWindow, 'resize', () => {
329
- clearTimeout(resizeTimeout);
330
- resizeTimeout = setTimeout(() => {
329
+ requestAnimationFrame(() => {
330
+ clearTimeout(resizeTimeout);
331
331
  this.wtSettings.getSetting('onWindowResize');
332
-
333
- // Remove resizing the window from the ResizeObserver's endless-loop-blocking logic.
334
- _classPrivateFieldSet(_containerDomResizeCount, this, 0);
335
- }, 200);
332
+ resizeTimeout = setTimeout(() => {
333
+ // Remove resizing the window from the ResizeObserver's endless-loop-blocking logic.
334
+ _classPrivateFieldSet(_containerDomResizeCount, this, 0);
335
+ }, 200);
336
+ });
336
337
  });
337
338
  if (!isScrollOnWindow) {
338
339
  this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement);
@@ -70,7 +70,7 @@ class ColGroupRenderer extends _base.default {
70
70
  // Render column nodes for cells
71
71
  for (let visibleColumnIndex = 0; visibleColumnIndex < columnsToRender; visibleColumnIndex++) {
72
72
  const sourceColumnIndex = this.table.renderedColumnToSource(visibleColumnIndex);
73
- const width = this.table.columnUtils.getStretchedColumnWidth(sourceColumnIndex);
73
+ const width = this.table.columnUtils.getWidth(sourceColumnIndex);
74
74
  this.rootNode.childNodes[visibleColumnIndex + rowHeadersCount].style.width = `${width}px`;
75
75
  }
76
76
  const firstChild = this.rootNode.firstChild;
@@ -66,7 +66,7 @@ export default class ColGroupRenderer extends BaseRenderer {
66
66
  // Render column nodes for cells
67
67
  for (let visibleColumnIndex = 0; visibleColumnIndex < columnsToRender; visibleColumnIndex++) {
68
68
  const sourceColumnIndex = this.table.renderedColumnToSource(visibleColumnIndex);
69
- const width = this.table.columnUtils.getStretchedColumnWidth(sourceColumnIndex);
69
+ const width = this.table.columnUtils.getWidth(sourceColumnIndex);
70
70
  this.rootNode.childNodes[visibleColumnIndex + rowHeadersCount].style.width = `${width}px`;
71
71
  }
72
72
  const firstChild = this.rootNode.firstChild;
@@ -301,7 +301,7 @@ class TableRenderer {
301
301
  this.rowHeaders.render();
302
302
  this.cells.render();
303
303
 
304
- // After the cells are rendered calculate columns width (or columns stretch width) to prepare proper values
304
+ // After the cells are rendered calculate columns width to prepare proper values
305
305
  // for colGroup renderer (which renders COL elements).
306
306
  this.columnUtils.calculateWidths();
307
307
  this.colGroup.render();
@@ -298,7 +298,7 @@ export default class TableRenderer {
298
298
  this.rowHeaders.render();
299
299
  this.cells.render();
300
300
 
301
- // After the cells are rendered calculate columns width (or columns stretch width) to prepare proper values
301
+ // After the cells are rendered calculate columns width to prepare proper values
302
302
  // for colGroup renderer (which renders COL elements).
303
303
  this.columnUtils.calculateWidths();
304
304
  this.colGroup.render();
@@ -19,11 +19,11 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
19
19
  * @property {Option} currentRowClassName Option `currentRowClassName`.
20
20
  * @property {Option} data Option `data`.
21
21
  * @property {Option} defaultColumnWidth Option `defaultColumnWidth`.
22
+ * @property {Option} defaultRowHeight Option `defaultRowHeight`.
22
23
  * @property {Option} externalRowCalculator Option `externalRowCalculator`.
23
24
  * @property {Option} fixedColumnsStart Option `fixedColumnsStart`.
24
25
  * @property {Option} fixedRowsBottom Option `fixedRowsBottom`.
25
26
  * @property {Option} fixedRowsTop Option `fixedRowsTop`.
26
- * @property {Option} freezeOverlays Option `freezeOverlays`.
27
27
  * @property {Option} groups Option `groups`.
28
28
  * @property {Option} hideBorderOnMouseDownOver Option `hideBorderOnMouseDownOver`.
29
29
  * @property {Option} isRtl Option `isRtl`.
@@ -32,7 +32,6 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
32
32
  * @property {Option} onBeforeHighlightingColumnHeader Option `onBeforeHighlightingColumnHeader`.
33
33
  * @property {Option} onBeforeHighlightingRowHeader Option `onBeforeHighlightingRowHeader`.
34
34
  * @property {Option} onBeforeRemoveCellClassNames Option `onBeforeRemoveCellClassNames`.
35
- * @property {Option} onBeforeStretchingColumnWidth Option `onBeforeStretchingColumnWidth`.
36
35
  * @property {Option} preventOverflow Option `preventOverflow`.
37
36
  * @property {Option} preventWheel Option `preventWheel`.
38
37
  * @property {Option} renderAllColumns Option `renderAllColumns`.
@@ -43,7 +42,6 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
43
42
  * @property {Option} shouldRenderBottomOverlay Option `shouldRenderBottomOverlay`.
44
43
  * @property {Option} shouldRenderInlineStartOverlay Option `shouldRenderInlineStartOverlay`.
45
44
  * @property {Option} shouldRenderTopOverlay Option `shouldRenderTopOverlay`.
46
- * @property {Option} stretchH Option `stretchH`.
47
45
  * @property {Option} table Option `table`.
48
46
  * @property {Option} totalColumns Option `totalColumns`.
49
47
  * @property {Option} totalRows Option `totalRows`.
@@ -136,8 +134,6 @@ class Settings {
136
134
  isDataViewInstance: true,
137
135
  // presentation mode
138
136
  externalRowCalculator: false,
139
- stretchH: 'none',
140
- // values: all, last, none
141
137
  currentRowClassName: null,
142
138
  currentColumnClassName: null,
143
139
  preventOverflow() {
@@ -146,7 +142,6 @@ class Settings {
146
142
  preventWheel: false,
147
143
  // data source
148
144
  data: undefined,
149
- freezeOverlays: false,
150
145
  // Number of renderable columns for the left overlay.
151
146
  fixedColumnsStart: 0,
152
147
  // Number of renderable rows for the top overlay.
@@ -190,6 +185,7 @@ class Settings {
190
185
  rowHeightByOverlayName() {
191
186
  // return undefined means use default size for the rendered cell content
192
187
  },
188
+ defaultRowHeight: 23,
193
189
  defaultColumnWidth: 50,
194
190
  selections: null,
195
191
  hideBorderOnMouseDownOver: false,
@@ -221,7 +217,6 @@ class Settings {
221
217
  //
222
218
  onBeforeTouchScroll: null,
223
219
  onAfterMomentumScroll: null,
224
- onBeforeStretchingColumnWidth: width => width,
225
220
  onModifyRowHeaderWidth: null,
226
221
  onModifyGetCellCoords: null,
227
222
  onModifyGetCoordsElement: null,
@@ -16,11 +16,11 @@ import { objectEach } from "../../../helpers/object.mjs";
16
16
  * @property {Option} currentRowClassName Option `currentRowClassName`.
17
17
  * @property {Option} data Option `data`.
18
18
  * @property {Option} defaultColumnWidth Option `defaultColumnWidth`.
19
+ * @property {Option} defaultRowHeight Option `defaultRowHeight`.
19
20
  * @property {Option} externalRowCalculator Option `externalRowCalculator`.
20
21
  * @property {Option} fixedColumnsStart Option `fixedColumnsStart`.
21
22
  * @property {Option} fixedRowsBottom Option `fixedRowsBottom`.
22
23
  * @property {Option} fixedRowsTop Option `fixedRowsTop`.
23
- * @property {Option} freezeOverlays Option `freezeOverlays`.
24
24
  * @property {Option} groups Option `groups`.
25
25
  * @property {Option} hideBorderOnMouseDownOver Option `hideBorderOnMouseDownOver`.
26
26
  * @property {Option} isRtl Option `isRtl`.
@@ -29,7 +29,6 @@ import { objectEach } from "../../../helpers/object.mjs";
29
29
  * @property {Option} onBeforeHighlightingColumnHeader Option `onBeforeHighlightingColumnHeader`.
30
30
  * @property {Option} onBeforeHighlightingRowHeader Option `onBeforeHighlightingRowHeader`.
31
31
  * @property {Option} onBeforeRemoveCellClassNames Option `onBeforeRemoveCellClassNames`.
32
- * @property {Option} onBeforeStretchingColumnWidth Option `onBeforeStretchingColumnWidth`.
33
32
  * @property {Option} preventOverflow Option `preventOverflow`.
34
33
  * @property {Option} preventWheel Option `preventWheel`.
35
34
  * @property {Option} renderAllColumns Option `renderAllColumns`.
@@ -40,7 +39,6 @@ import { objectEach } from "../../../helpers/object.mjs";
40
39
  * @property {Option} shouldRenderBottomOverlay Option `shouldRenderBottomOverlay`.
41
40
  * @property {Option} shouldRenderInlineStartOverlay Option `shouldRenderInlineStartOverlay`.
42
41
  * @property {Option} shouldRenderTopOverlay Option `shouldRenderTopOverlay`.
43
- * @property {Option} stretchH Option `stretchH`.
44
42
  * @property {Option} table Option `table`.
45
43
  * @property {Option} totalColumns Option `totalColumns`.
46
44
  * @property {Option} totalRows Option `totalRows`.
@@ -131,8 +129,6 @@ export default class Settings {
131
129
  isDataViewInstance: true,
132
130
  // presentation mode
133
131
  externalRowCalculator: false,
134
- stretchH: 'none',
135
- // values: all, last, none
136
132
  currentRowClassName: null,
137
133
  currentColumnClassName: null,
138
134
  preventOverflow() {
@@ -141,7 +137,6 @@ export default class Settings {
141
137
  preventWheel: false,
142
138
  // data source
143
139
  data: undefined,
144
- freezeOverlays: false,
145
140
  // Number of renderable columns for the left overlay.
146
141
  fixedColumnsStart: 0,
147
142
  // Number of renderable rows for the top overlay.
@@ -185,6 +180,7 @@ export default class Settings {
185
180
  rowHeightByOverlayName() {
186
181
  // return undefined means use default size for the rendered cell content
187
182
  },
183
+ defaultRowHeight: 23,
188
184
  defaultColumnWidth: 50,
189
185
  selections: null,
190
186
  hideBorderOnMouseDownOver: false,
@@ -216,7 +212,6 @@ export default class Settings {
216
212
  //
217
213
  onBeforeTouchScroll: null,
218
214
  onAfterMomentumScroll: null,
219
- onBeforeStretchingColumnWidth: width => width,
220
215
  onModifyRowHeaderWidth: null,
221
216
  onModifyGetCellCoords: null,
222
217
  onModifyGetCoordsElement: null,
@@ -296,10 +296,7 @@ class Table {
296
296
  }
297
297
  this.resetOversizedRows();
298
298
  this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
299
- let workspaceWidth;
300
299
  if (this.isMaster) {
301
- workspaceWidth = this.dataAccessObject.workspaceWidth;
302
- wtViewport.containerWidth = null;
303
300
  this.markOversizedColumnHeaders();
304
301
  }
305
302
  this.adjustColumnHeaderHeights();
@@ -312,19 +309,6 @@ class Table {
312
309
  }
313
310
  wtOverlays.refresh(false);
314
311
  wtOverlays.applyToDOM();
315
- const hiderWidth = (0, _element.outerWidth)(this.hider);
316
- const tableWidth = (0, _element.outerWidth)(this.TABLE);
317
- if (hiderWidth !== 0 && tableWidth !== hiderWidth) {
318
- // Recalculate the column widths, if width changes made in the overlays removed the scrollbar, thus changing the viewport width.
319
- this.columnUtils.calculateWidths();
320
- this.tableRenderer.renderer.colGroup.render();
321
- }
322
- if (workspaceWidth !== wtViewport.getWorkspaceWidth()) {
323
- // workspace width changed though to shown/hidden vertical scrollbar. Let's reapply stretching
324
- wtViewport.containerWidth = null;
325
- this.columnUtils.calculateWidths();
326
- this.tableRenderer.renderer.colGroup.render();
327
- }
328
312
  this.wtSettings.getSetting('onDraw', true);
329
313
  } else if (this.is(_overlay.CLONE_BOTTOM)) {
330
314
  this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize();
@@ -367,7 +351,7 @@ class Table {
367
351
  markIfOversizedColumnHeader(col) {
368
352
  const sourceColIndex = this.columnFilter.renderedToSource(col);
369
353
  let level = this.wtSettings.getSetting('columnHeaders').length;
370
- const defaultRowHeight = this.wot.stylesHandler.getDefaultRowHeight();
354
+ const defaultRowHeight = this.wtSettings.getSetting('defaultRowHeight');
371
355
  let previousColHeaderHeight;
372
356
  let currentHeader;
373
357
  let currentHeaderHeight;
@@ -645,13 +629,10 @@ class Table {
645
629
  return;
646
630
  }
647
631
  let rowCount = this.TBODY.childNodes.length;
648
- const expectedTableHeight = rowCount * this.wot.stylesHandler.getDefaultRowHeight();
632
+ const expectedTableHeight = rowCount * this.wtSettings.getSetting('defaultRowHeight');
649
633
  const actualTableHeight = (0, _element.innerHeight)(this.TBODY) - 1;
650
- const borderBoxSizing = this.wot.stylesHandler.getStyleForTD('box-sizing') === 'border-box';
651
- const rowHeightFn = borderBoxSizing ? _element.outerHeight : _element.innerHeight;
652
- const borderCompensation = borderBoxSizing ? 0 : 1;
653
634
  let previousRowHeight;
654
- let rowCurrentHeight;
635
+ let rowInnerHeight;
655
636
  let sourceRowIndex;
656
637
  let currentTr;
657
638
  let rowHeader;
@@ -666,13 +647,13 @@ class Table {
666
647
  currentTr = this.getTrForRow(sourceRowIndex);
667
648
  rowHeader = currentTr.querySelector('th');
668
649
  if (rowHeader) {
669
- rowCurrentHeight = rowHeightFn(rowHeader);
650
+ rowInnerHeight = (0, _element.innerHeight)(rowHeader);
670
651
  } else {
671
- rowCurrentHeight = rowHeightFn(currentTr) - borderCompensation;
652
+ rowInnerHeight = (0, _element.innerHeight)(currentTr) - 1;
672
653
  }
673
- if (!previousRowHeight && this.wot.stylesHandler.getDefaultRowHeight() < rowCurrentHeight || previousRowHeight < rowCurrentHeight) {
674
- rowCurrentHeight += 1;
675
- this.dataAccessObject.wtViewport.oversizedRows[sourceRowIndex] = rowCurrentHeight;
654
+ if (!previousRowHeight && this.wtSettings.getSetting('defaultRowHeight') < rowInnerHeight || previousRowHeight < rowInnerHeight) {
655
+ rowInnerHeight += 1;
656
+ this.dataAccessObject.wtViewport.oversizedRows[sourceRowIndex] = rowInnerHeight;
676
657
  }
677
658
  }
678
659
  }
@@ -916,14 +897,6 @@ class Table {
916
897
  return this.columnUtils.getWidth(sourceColumn);
917
898
  }
918
899
 
919
- /**
920
- * @param {number} sourceColumn The physical column index.
921
- * @returns {number}
922
- */
923
- getStretchedColumnWidth(sourceColumn) {
924
- return this.columnUtils.getStretchedColumnWidth(sourceColumn);
925
- }
926
-
927
900
  /**
928
901
  * Checks if the table has defined size. It returns `true` when the table has width and height
929
902
  * set bigger than `0px`.
@@ -292,10 +292,7 @@ class Table {
292
292
  }
293
293
  this.resetOversizedRows();
294
294
  this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
295
- let workspaceWidth;
296
295
  if (this.isMaster) {
297
- workspaceWidth = this.dataAccessObject.workspaceWidth;
298
- wtViewport.containerWidth = null;
299
296
  this.markOversizedColumnHeaders();
300
297
  }
301
298
  this.adjustColumnHeaderHeights();
@@ -308,19 +305,6 @@ class Table {
308
305
  }
309
306
  wtOverlays.refresh(false);
310
307
  wtOverlays.applyToDOM();
311
- const hiderWidth = outerWidth(this.hider);
312
- const tableWidth = outerWidth(this.TABLE);
313
- if (hiderWidth !== 0 && tableWidth !== hiderWidth) {
314
- // Recalculate the column widths, if width changes made in the overlays removed the scrollbar, thus changing the viewport width.
315
- this.columnUtils.calculateWidths();
316
- this.tableRenderer.renderer.colGroup.render();
317
- }
318
- if (workspaceWidth !== wtViewport.getWorkspaceWidth()) {
319
- // workspace width changed though to shown/hidden vertical scrollbar. Let's reapply stretching
320
- wtViewport.containerWidth = null;
321
- this.columnUtils.calculateWidths();
322
- this.tableRenderer.renderer.colGroup.render();
323
- }
324
308
  this.wtSettings.getSetting('onDraw', true);
325
309
  } else if (this.is(CLONE_BOTTOM)) {
326
310
  this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize();
@@ -363,7 +347,7 @@ class Table {
363
347
  markIfOversizedColumnHeader(col) {
364
348
  const sourceColIndex = this.columnFilter.renderedToSource(col);
365
349
  let level = this.wtSettings.getSetting('columnHeaders').length;
366
- const defaultRowHeight = this.wot.stylesHandler.getDefaultRowHeight();
350
+ const defaultRowHeight = this.wtSettings.getSetting('defaultRowHeight');
367
351
  let previousColHeaderHeight;
368
352
  let currentHeader;
369
353
  let currentHeaderHeight;
@@ -641,13 +625,10 @@ class Table {
641
625
  return;
642
626
  }
643
627
  let rowCount = this.TBODY.childNodes.length;
644
- const expectedTableHeight = rowCount * this.wot.stylesHandler.getDefaultRowHeight();
628
+ const expectedTableHeight = rowCount * this.wtSettings.getSetting('defaultRowHeight');
645
629
  const actualTableHeight = innerHeight(this.TBODY) - 1;
646
- const borderBoxSizing = this.wot.stylesHandler.getStyleForTD('box-sizing') === 'border-box';
647
- const rowHeightFn = borderBoxSizing ? outerHeight : innerHeight;
648
- const borderCompensation = borderBoxSizing ? 0 : 1;
649
630
  let previousRowHeight;
650
- let rowCurrentHeight;
631
+ let rowInnerHeight;
651
632
  let sourceRowIndex;
652
633
  let currentTr;
653
634
  let rowHeader;
@@ -662,13 +643,13 @@ class Table {
662
643
  currentTr = this.getTrForRow(sourceRowIndex);
663
644
  rowHeader = currentTr.querySelector('th');
664
645
  if (rowHeader) {
665
- rowCurrentHeight = rowHeightFn(rowHeader);
646
+ rowInnerHeight = innerHeight(rowHeader);
666
647
  } else {
667
- rowCurrentHeight = rowHeightFn(currentTr) - borderCompensation;
648
+ rowInnerHeight = innerHeight(currentTr) - 1;
668
649
  }
669
- if (!previousRowHeight && this.wot.stylesHandler.getDefaultRowHeight() < rowCurrentHeight || previousRowHeight < rowCurrentHeight) {
670
- rowCurrentHeight += 1;
671
- this.dataAccessObject.wtViewport.oversizedRows[sourceRowIndex] = rowCurrentHeight;
650
+ if (!previousRowHeight && this.wtSettings.getSetting('defaultRowHeight') < rowInnerHeight || previousRowHeight < rowInnerHeight) {
651
+ rowInnerHeight += 1;
652
+ this.dataAccessObject.wtViewport.oversizedRows[sourceRowIndex] = rowInnerHeight;
672
653
  }
673
654
  }
674
655
  }
@@ -912,14 +893,6 @@ class Table {
912
893
  return this.columnUtils.getWidth(sourceColumn);
913
894
  }
914
895
 
915
- /**
916
- * @param {number} sourceColumn The physical column index.
917
- * @returns {number}
918
- */
919
- getStretchedColumnWidth(sourceColumn) {
920
- return this.columnUtils.getStretchedColumnWidth(sourceColumn);
921
- }
922
-
923
896
  /**
924
897
  * Checks if the table has defined size. It returns `true` when the table has width and height
925
898
  * set bigger than `0px`.