handsontable 0.0.0-next-7cc7ef7-20241028 → 0.0.0-next-4c8e3b1-20241029

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 (66) hide show
  1. package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -1
  2. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +1 -1
  3. package/3rdparty/walkontable/src/overlays.js +7 -6
  4. package/3rdparty/walkontable/src/overlays.mjs +7 -6
  5. package/3rdparty/walkontable/src/renderer/colGroup.js +1 -1
  6. package/3rdparty/walkontable/src/renderer/colGroup.mjs +1 -1
  7. package/3rdparty/walkontable/src/renderer/table.js +1 -1
  8. package/3rdparty/walkontable/src/renderer/table.mjs +1 -1
  9. package/3rdparty/walkontable/src/settings.js +0 -7
  10. package/3rdparty/walkontable/src/settings.mjs +0 -7
  11. package/3rdparty/walkontable/src/table.js +0 -24
  12. package/3rdparty/walkontable/src/table.mjs +0 -24
  13. package/3rdparty/walkontable/src/utils/column.js +0 -42
  14. package/3rdparty/walkontable/src/utils/column.mjs +0 -42
  15. package/3rdparty/walkontable/src/viewport.js +66 -87
  16. package/3rdparty/walkontable/src/viewport.mjs +67 -88
  17. package/README.md +1 -1
  18. package/base.js +2 -2
  19. package/base.mjs +2 -2
  20. package/core/hooks/constants.js +2 -0
  21. package/core/hooks/constants.mjs +2 -0
  22. package/core/hooks/index.d.ts +2 -2
  23. package/core.d.ts +2 -2
  24. package/core.js +6 -4
  25. package/core.mjs +6 -4
  26. package/dist/handsontable.css +2 -2
  27. package/dist/handsontable.full.css +2 -2
  28. package/dist/handsontable.full.js +2226 -1821
  29. package/dist/handsontable.full.min.css +2 -2
  30. package/dist/handsontable.full.min.js +10 -10
  31. package/dist/handsontable.js +2228 -1823
  32. package/dist/handsontable.min.css +2 -2
  33. package/dist/handsontable.min.js +10 -10
  34. package/helpers/mixed.js +1 -1
  35. package/helpers/mixed.mjs +1 -1
  36. package/i18n/languages/index.d.ts +8 -0
  37. package/i18n/languages/ja-JP.d.ts +1 -1
  38. package/index.d.ts +7 -0
  39. package/package.json +6 -1
  40. package/plugins/comments/comments.js +1 -1
  41. package/plugins/comments/comments.mjs +1 -1
  42. package/plugins/index.d.ts +3 -0
  43. package/plugins/index.js +3 -0
  44. package/plugins/index.mjs +3 -1
  45. package/plugins/manualColumnMove/manualColumnMove.js +1 -3
  46. package/plugins/manualColumnMove/manualColumnMove.mjs +1 -3
  47. package/plugins/manualColumnResize/manualColumnResize.js +24 -12
  48. package/plugins/manualColumnResize/manualColumnResize.mjs +24 -12
  49. package/plugins/stretchColumns/calculator.js +159 -0
  50. package/plugins/stretchColumns/calculator.mjs +155 -0
  51. package/plugins/stretchColumns/index.d.ts +1 -0
  52. package/plugins/stretchColumns/index.js +7 -0
  53. package/plugins/stretchColumns/index.mjs +1 -0
  54. package/plugins/stretchColumns/strategies/_base.js +85 -0
  55. package/plugins/stretchColumns/strategies/_base.mjs +81 -0
  56. package/plugins/stretchColumns/strategies/all.js +68 -0
  57. package/plugins/stretchColumns/strategies/all.mjs +64 -0
  58. package/plugins/stretchColumns/strategies/last.js +77 -0
  59. package/plugins/stretchColumns/strategies/last.mjs +73 -0
  60. package/plugins/stretchColumns/stretchColumns.d.ts +11 -0
  61. package/plugins/stretchColumns/stretchColumns.js +220 -0
  62. package/plugins/stretchColumns/stretchColumns.mjs +216 -0
  63. package/tableView.js +39 -6
  64. package/tableView.mjs +39 -6
  65. package/3rdparty/walkontable/src/utils/columnStretching.js +0 -197
  66. package/3rdparty/walkontable/src/utils/columnStretching.mjs +0 -193
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ require("core-js/modules/es.error.cause.js");
5
+ var _base = require("../base");
6
+ var _calculator = require("./calculator");
7
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
8
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
9
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
10
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
11
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
12
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
13
+ const PLUGIN_KEY = exports.PLUGIN_KEY = 'stretchColumns';
14
+ const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 155;
15
+
16
+ /* eslint-disable jsdoc/require-description-complete-sentence */
17
+ /**
18
+ * @plugin StretchColumns
19
+ * @class StretchColumns
20
+ *
21
+ * @description
22
+ * This plugin allows to set column widths based on their widest cells.
23
+ *
24
+ * By default, the plugin is declared as `'none'`, which makes it disabled (same as if it was declared as `false`).
25
+ *
26
+ * The plugin determines what happens when the declared grid width is different from the calculated sum of all column widths.
27
+ *
28
+ * ```js
29
+ * // fit the grid to the container, by stretching only the last column
30
+ * stretchH: 'last',
31
+ *
32
+ * // fit the grid to the container, by stretching all columns evenly
33
+ * stretchH: 'all',
34
+ * ```
35
+ *
36
+ * To configure this plugin see {@link Options#stretchH}.
37
+ *
38
+ * @example
39
+ *
40
+ * ::: only-for javascript
41
+ * ```js
42
+ * const hot = new Handsontable(document.getElementById('example'), {
43
+ * data: getData(),
44
+ * stretchH: 'all',
45
+ * });
46
+ * ```
47
+ * :::
48
+ *
49
+ * ::: only-for react
50
+ * ```jsx
51
+ * const hotRef = useRef(null);
52
+ *
53
+ * ...
54
+ *
55
+ * // First, let's construct Handsontable
56
+ * <HotTable
57
+ * ref={hotRef}
58
+ * data={getData()}
59
+ * stretchH={'all'}
60
+ * />
61
+ * ```
62
+ * :::
63
+ */
64
+ /* eslint-enable jsdoc/require-description-complete-sentence */
65
+ var _stretchCalculator = /*#__PURE__*/new WeakMap();
66
+ var _previousTableWidth = /*#__PURE__*/new WeakMap();
67
+ var _resizeObserver = /*#__PURE__*/new WeakMap();
68
+ var _StretchColumns_brand = /*#__PURE__*/new WeakSet();
69
+ class StretchColumns extends _base.BasePlugin {
70
+ constructor() {
71
+ super(...arguments);
72
+ /**
73
+ * Hook that modifies the column width - applies by the stretching logic.
74
+ *
75
+ * @param {number} width The column width.
76
+ * @param {number} column The visual column index.
77
+ * @param {string} source The source of the modification.
78
+ * @returns {number}
79
+ */
80
+ _classPrivateMethodInitSpec(this, _StretchColumns_brand);
81
+ /**
82
+ * The stretch calculator.
83
+ *
84
+ * @type {StretchCalculator}
85
+ */
86
+ _classPrivateFieldInitSpec(this, _stretchCalculator, new _calculator.StretchCalculator(this.hot));
87
+ /**
88
+ * The previous width of the root element. Helps to determine if the width has changed.
89
+ *
90
+ * @type {number | null}
91
+ */
92
+ _classPrivateFieldInitSpec(this, _previousTableWidth, null);
93
+ /**
94
+ * It observes the root element to detect changes in its width, and if detected, then it triggers
95
+ * the table dimension calculations. In a situation where the browser's vertical scrollbar
96
+ * appears - caused by some external UI element, the observer triggers the render.
97
+ *
98
+ * @type {ResizeObserver}
99
+ */
100
+ _classPrivateFieldInitSpec(this, _resizeObserver, new ResizeObserver(entries => {
101
+ requestAnimationFrame(() => {
102
+ var _this$hot;
103
+ if (!((_this$hot = this.hot) !== null && _this$hot !== void 0 && _this$hot.view.isHorizontallyScrollableByWindow())) {
104
+ return;
105
+ }
106
+ entries.forEach(_ref => {
107
+ let {
108
+ contentRect
109
+ } = _ref;
110
+ if (_classPrivateFieldGet(_previousTableWidth, this) !== null && _classPrivateFieldGet(_previousTableWidth, this) !== contentRect.width) {
111
+ this.hot.refreshDimensions();
112
+ this.hot.view.adjustElementsSize();
113
+ }
114
+ _classPrivateFieldSet(_previousTableWidth, this, contentRect.width);
115
+ });
116
+ });
117
+ }));
118
+ }
119
+ static get PLUGIN_KEY() {
120
+ return PLUGIN_KEY;
121
+ }
122
+ static get PLUGIN_PRIORITY() {
123
+ return PLUGIN_PRIORITY;
124
+ }
125
+ static get SETTING_KEYS() {
126
+ return true;
127
+ }
128
+ /**
129
+ * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
130
+ * hook and if it returns `true` then the {@link #enablePlugin} method is called.
131
+ *
132
+ * @returns {boolean}
133
+ */
134
+ isEnabled() {
135
+ return ['all', 'last'].includes(this.hot.getSettings().stretchH);
136
+ }
137
+
138
+ /**
139
+ * Enables the plugin functionality for this Handsontable instance.
140
+ */
141
+ enablePlugin() {
142
+ var _this = this;
143
+ if (this.enabled) {
144
+ return;
145
+ }
146
+ _classPrivateFieldGet(_stretchCalculator, this).useStrategy(this.hot.getSettings().stretchH);
147
+ _classPrivateFieldGet(_resizeObserver, this).observe(this.hot.rootElement);
148
+ this.addHook('beforeRender', function () {
149
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
150
+ args[_key] = arguments[_key];
151
+ }
152
+ return _assertClassBrand(_StretchColumns_brand, _this, _onBeforeRender).call(_this, ...args);
153
+ });
154
+ this.addHook('modifyColWidth', function () {
155
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
156
+ args[_key2] = arguments[_key2];
157
+ }
158
+ return _assertClassBrand(_StretchColumns_brand, _this, _onModifyColWidth).call(_this, ...args);
159
+ }, 10);
160
+ super.enablePlugin();
161
+ }
162
+
163
+ /**
164
+ * Updates the plugin's state. This method is executed when {@link Core#updateSettings} is invoked.
165
+ */
166
+ updatePlugin() {
167
+ _classPrivateFieldGet(_stretchCalculator, this).useStrategy(this.hot.getSettings().stretchH);
168
+ super.updatePlugin();
169
+ }
170
+
171
+ /**
172
+ * Disables the plugin functionality for this Handsontable instance.
173
+ */
174
+ disablePlugin() {
175
+ super.disablePlugin();
176
+ _classPrivateFieldGet(_resizeObserver, this).unobserve(this.hot.rootElement);
177
+ }
178
+
179
+ /**
180
+ * Gets the calculated column width based on the stretching
181
+ * strategy defined by {@link Options#stretchH} option.
182
+ *
183
+ * @param {number} columnVisualIndex The visual index of the column.
184
+ * @returns {number | null}
185
+ */
186
+ getColumnWidth(columnVisualIndex) {
187
+ return _classPrivateFieldGet(_stretchCalculator, this).getStretchedWidth(columnVisualIndex);
188
+ }
189
+ /**
190
+ * Destroys the plugin instance.
191
+ */
192
+ destroy() {
193
+ _classPrivateFieldGet(_resizeObserver, this).disconnect();
194
+ _classPrivateFieldSet(_resizeObserver, this, null);
195
+ _classPrivateFieldSet(_stretchCalculator, this, null);
196
+ super.destroy();
197
+ }
198
+ }
199
+ exports.StretchColumns = StretchColumns;
200
+ function _onModifyColWidth(width, column, source) {
201
+ if (source === this.pluginName) {
202
+ return;
203
+ }
204
+ const newWidth = this.getColumnWidth(column);
205
+ if (typeof newWidth === 'number') {
206
+ return newWidth;
207
+ }
208
+ return width;
209
+ }
210
+ /**
211
+ * On each before render the plugin recalculates the column widths
212
+ * based on the chosen stretching strategy.
213
+ *
214
+ * @param {boolean} fullRender If `true` then the full render is in progress.
215
+ */
216
+ function _onBeforeRender(fullRender) {
217
+ if (fullRender) {
218
+ _classPrivateFieldGet(_stretchCalculator, this).refreshStretching();
219
+ }
220
+ }
@@ -0,0 +1,216 @@
1
+ import "core-js/modules/es.error.cause.js";
2
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
3
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
4
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
5
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
6
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
7
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
8
+ import { BasePlugin } from "../base/index.mjs";
9
+ import { StretchCalculator } from "./calculator.mjs";
10
+ export const PLUGIN_KEY = 'stretchColumns';
11
+ export const PLUGIN_PRIORITY = 155;
12
+
13
+ /* eslint-disable jsdoc/require-description-complete-sentence */
14
+ /**
15
+ * @plugin StretchColumns
16
+ * @class StretchColumns
17
+ *
18
+ * @description
19
+ * This plugin allows to set column widths based on their widest cells.
20
+ *
21
+ * By default, the plugin is declared as `'none'`, which makes it disabled (same as if it was declared as `false`).
22
+ *
23
+ * The plugin determines what happens when the declared grid width is different from the calculated sum of all column widths.
24
+ *
25
+ * ```js
26
+ * // fit the grid to the container, by stretching only the last column
27
+ * stretchH: 'last',
28
+ *
29
+ * // fit the grid to the container, by stretching all columns evenly
30
+ * stretchH: 'all',
31
+ * ```
32
+ *
33
+ * To configure this plugin see {@link Options#stretchH}.
34
+ *
35
+ * @example
36
+ *
37
+ * ::: only-for javascript
38
+ * ```js
39
+ * const hot = new Handsontable(document.getElementById('example'), {
40
+ * data: getData(),
41
+ * stretchH: 'all',
42
+ * });
43
+ * ```
44
+ * :::
45
+ *
46
+ * ::: only-for react
47
+ * ```jsx
48
+ * const hotRef = useRef(null);
49
+ *
50
+ * ...
51
+ *
52
+ * // First, let's construct Handsontable
53
+ * <HotTable
54
+ * ref={hotRef}
55
+ * data={getData()}
56
+ * stretchH={'all'}
57
+ * />
58
+ * ```
59
+ * :::
60
+ */
61
+ /* eslint-enable jsdoc/require-description-complete-sentence */
62
+ var _stretchCalculator = /*#__PURE__*/new WeakMap();
63
+ var _previousTableWidth = /*#__PURE__*/new WeakMap();
64
+ var _resizeObserver = /*#__PURE__*/new WeakMap();
65
+ var _StretchColumns_brand = /*#__PURE__*/new WeakSet();
66
+ export class StretchColumns extends BasePlugin {
67
+ constructor() {
68
+ super(...arguments);
69
+ /**
70
+ * Hook that modifies the column width - applies by the stretching logic.
71
+ *
72
+ * @param {number} width The column width.
73
+ * @param {number} column The visual column index.
74
+ * @param {string} source The source of the modification.
75
+ * @returns {number}
76
+ */
77
+ _classPrivateMethodInitSpec(this, _StretchColumns_brand);
78
+ /**
79
+ * The stretch calculator.
80
+ *
81
+ * @type {StretchCalculator}
82
+ */
83
+ _classPrivateFieldInitSpec(this, _stretchCalculator, new StretchCalculator(this.hot));
84
+ /**
85
+ * The previous width of the root element. Helps to determine if the width has changed.
86
+ *
87
+ * @type {number | null}
88
+ */
89
+ _classPrivateFieldInitSpec(this, _previousTableWidth, null);
90
+ /**
91
+ * It observes the root element to detect changes in its width, and if detected, then it triggers
92
+ * the table dimension calculations. In a situation where the browser's vertical scrollbar
93
+ * appears - caused by some external UI element, the observer triggers the render.
94
+ *
95
+ * @type {ResizeObserver}
96
+ */
97
+ _classPrivateFieldInitSpec(this, _resizeObserver, new ResizeObserver(entries => {
98
+ requestAnimationFrame(() => {
99
+ var _this$hot;
100
+ if (!((_this$hot = this.hot) !== null && _this$hot !== void 0 && _this$hot.view.isHorizontallyScrollableByWindow())) {
101
+ return;
102
+ }
103
+ entries.forEach(_ref => {
104
+ let {
105
+ contentRect
106
+ } = _ref;
107
+ if (_classPrivateFieldGet(_previousTableWidth, this) !== null && _classPrivateFieldGet(_previousTableWidth, this) !== contentRect.width) {
108
+ this.hot.refreshDimensions();
109
+ this.hot.view.adjustElementsSize();
110
+ }
111
+ _classPrivateFieldSet(_previousTableWidth, this, contentRect.width);
112
+ });
113
+ });
114
+ }));
115
+ }
116
+ static get PLUGIN_KEY() {
117
+ return PLUGIN_KEY;
118
+ }
119
+ static get PLUGIN_PRIORITY() {
120
+ return PLUGIN_PRIORITY;
121
+ }
122
+ static get SETTING_KEYS() {
123
+ return true;
124
+ }
125
+ /**
126
+ * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
127
+ * hook and if it returns `true` then the {@link #enablePlugin} method is called.
128
+ *
129
+ * @returns {boolean}
130
+ */
131
+ isEnabled() {
132
+ return ['all', 'last'].includes(this.hot.getSettings().stretchH);
133
+ }
134
+
135
+ /**
136
+ * Enables the plugin functionality for this Handsontable instance.
137
+ */
138
+ enablePlugin() {
139
+ var _this = this;
140
+ if (this.enabled) {
141
+ return;
142
+ }
143
+ _classPrivateFieldGet(_stretchCalculator, this).useStrategy(this.hot.getSettings().stretchH);
144
+ _classPrivateFieldGet(_resizeObserver, this).observe(this.hot.rootElement);
145
+ this.addHook('beforeRender', function () {
146
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
147
+ args[_key] = arguments[_key];
148
+ }
149
+ return _assertClassBrand(_StretchColumns_brand, _this, _onBeforeRender).call(_this, ...args);
150
+ });
151
+ this.addHook('modifyColWidth', function () {
152
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
153
+ args[_key2] = arguments[_key2];
154
+ }
155
+ return _assertClassBrand(_StretchColumns_brand, _this, _onModifyColWidth).call(_this, ...args);
156
+ }, 10);
157
+ super.enablePlugin();
158
+ }
159
+
160
+ /**
161
+ * Updates the plugin's state. This method is executed when {@link Core#updateSettings} is invoked.
162
+ */
163
+ updatePlugin() {
164
+ _classPrivateFieldGet(_stretchCalculator, this).useStrategy(this.hot.getSettings().stretchH);
165
+ super.updatePlugin();
166
+ }
167
+
168
+ /**
169
+ * Disables the plugin functionality for this Handsontable instance.
170
+ */
171
+ disablePlugin() {
172
+ super.disablePlugin();
173
+ _classPrivateFieldGet(_resizeObserver, this).unobserve(this.hot.rootElement);
174
+ }
175
+
176
+ /**
177
+ * Gets the calculated column width based on the stretching
178
+ * strategy defined by {@link Options#stretchH} option.
179
+ *
180
+ * @param {number} columnVisualIndex The visual index of the column.
181
+ * @returns {number | null}
182
+ */
183
+ getColumnWidth(columnVisualIndex) {
184
+ return _classPrivateFieldGet(_stretchCalculator, this).getStretchedWidth(columnVisualIndex);
185
+ }
186
+ /**
187
+ * Destroys the plugin instance.
188
+ */
189
+ destroy() {
190
+ _classPrivateFieldGet(_resizeObserver, this).disconnect();
191
+ _classPrivateFieldSet(_resizeObserver, this, null);
192
+ _classPrivateFieldSet(_stretchCalculator, this, null);
193
+ super.destroy();
194
+ }
195
+ }
196
+ function _onModifyColWidth(width, column, source) {
197
+ if (source === this.pluginName) {
198
+ return;
199
+ }
200
+ const newWidth = this.getColumnWidth(column);
201
+ if (typeof newWidth === 'number') {
202
+ return newWidth;
203
+ }
204
+ return width;
205
+ }
206
+ /**
207
+ * On each before render the plugin recalculates the column widths
208
+ * based on the chosen stretching strategy.
209
+ *
210
+ * @param {boolean} fullRender If `true` then the full render is in progress.
211
+ */
212
+ function _onBeforeRender(fullRender) {
213
+ if (fullRender) {
214
+ _classPrivateFieldGet(_stretchCalculator, this).refreshStretching();
215
+ }
216
+ }
package/tableView.js CHANGED
@@ -158,7 +158,7 @@ class TableView {
158
158
  this.hot.runHooks('beforeRender', this.hot.forceFullRender);
159
159
  if (this.postponedAdjustElementsSize) {
160
160
  this.postponedAdjustElementsSize = false;
161
- this.adjustElementsSize(true);
161
+ this.adjustElementsSize();
162
162
  }
163
163
  this._wt.draw(!this.hot.forceFullRender);
164
164
  this.hot.runHooks('afterRender', this.hot.forceFullRender);
@@ -613,7 +613,6 @@ class TableView {
613
613
  isDataViewInstance: () => (0, _rootInstance.isRootInstance)(this.hot),
614
614
  preventOverflow: () => this.settings.preventOverflow,
615
615
  preventWheel: () => this.settings.preventWheel,
616
- stretchH: () => this.settings.stretchH,
617
616
  viewportColumnRenderingThreshold: () => this.settings.viewportColumnRenderingThreshold,
618
617
  viewportRowRenderingThreshold: () => this.settings.viewportRowRenderingThreshold,
619
618
  data: (renderableRow, renderableColumn) => {
@@ -912,10 +911,6 @@ class TableView {
912
911
  },
913
912
  onBeforeTouchScroll: () => this.hot.runHooks('beforeTouchScroll'),
914
913
  onAfterMomentumScroll: () => this.hot.runHooks('afterMomentumScroll'),
915
- onBeforeStretchingColumnWidth: (stretchedWidth, renderedColumnIndex) => {
916
- const visualColumnIndex = this.hot.columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex);
917
- return this.hot.runHooks('beforeStretchingColumnWidth', stretchedWidth, visualColumnIndex);
918
- },
919
914
  onModifyRowHeaderWidth: rowHeaderWidth => this.hot.runHooks('modifyRowHeaderWidth', rowHeaderWidth),
920
915
  onModifyGetCellCoords: (renderableRowIndex, renderableColumnIndex, topmost, source) => {
921
916
  const rowMapper = this.hot.rowIndexMapper;
@@ -1539,6 +1534,44 @@ class TableView {
1539
1534
  getTableHeight() {
1540
1535
  return this._wt.wtTable.getHeight();
1541
1536
  }
1537
+
1538
+ /**
1539
+ * Gets the row header width. If there are multiple row headers, the width of
1540
+ * the sum of all of them is returned.
1541
+ *
1542
+ * @returns {number}
1543
+ */
1544
+ getRowHeaderWidth() {
1545
+ return this._wt.wtViewport.getRowHeaderWidth();
1546
+ }
1547
+
1548
+ /**
1549
+ * Gets the column header height. If there are multiple column headers, the height
1550
+ * of the sum of all of them is returned.
1551
+ *
1552
+ * @returns {number}
1553
+ */
1554
+ getColumnHeaderHeight() {
1555
+ return this._wt.wtViewport.getColumnHeaderHeight();
1556
+ }
1557
+
1558
+ /**
1559
+ * Checks if the table uses the window as a viewport and if there is a vertical scrollbar.
1560
+ *
1561
+ * @returns {boolean}
1562
+ */
1563
+ isVerticallyScrollableByWindow() {
1564
+ return this._wt.wtViewport.isVerticallyScrollableByWindow();
1565
+ }
1566
+
1567
+ /**
1568
+ * Checks if the table uses the window as a viewport and if there is a horizontal scrollbar.
1569
+ *
1570
+ * @returns {boolean}
1571
+ */
1572
+ isHorizontallyScrollableByWindow() {
1573
+ return this._wt.wtViewport.isHorizontallyScrollableByWindow();
1574
+ }
1542
1575
  /**
1543
1576
  * Destroys internal WalkOnTable's instance. Detaches all of the bonded listeners.
1544
1577
  *
package/tableView.mjs CHANGED
@@ -154,7 +154,7 @@ class TableView {
154
154
  this.hot.runHooks('beforeRender', this.hot.forceFullRender);
155
155
  if (this.postponedAdjustElementsSize) {
156
156
  this.postponedAdjustElementsSize = false;
157
- this.adjustElementsSize(true);
157
+ this.adjustElementsSize();
158
158
  }
159
159
  this._wt.draw(!this.hot.forceFullRender);
160
160
  this.hot.runHooks('afterRender', this.hot.forceFullRender);
@@ -609,7 +609,6 @@ class TableView {
609
609
  isDataViewInstance: () => isRootInstance(this.hot),
610
610
  preventOverflow: () => this.settings.preventOverflow,
611
611
  preventWheel: () => this.settings.preventWheel,
612
- stretchH: () => this.settings.stretchH,
613
612
  viewportColumnRenderingThreshold: () => this.settings.viewportColumnRenderingThreshold,
614
613
  viewportRowRenderingThreshold: () => this.settings.viewportRowRenderingThreshold,
615
614
  data: (renderableRow, renderableColumn) => {
@@ -908,10 +907,6 @@ class TableView {
908
907
  },
909
908
  onBeforeTouchScroll: () => this.hot.runHooks('beforeTouchScroll'),
910
909
  onAfterMomentumScroll: () => this.hot.runHooks('afterMomentumScroll'),
911
- onBeforeStretchingColumnWidth: (stretchedWidth, renderedColumnIndex) => {
912
- const visualColumnIndex = this.hot.columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex);
913
- return this.hot.runHooks('beforeStretchingColumnWidth', stretchedWidth, visualColumnIndex);
914
- },
915
910
  onModifyRowHeaderWidth: rowHeaderWidth => this.hot.runHooks('modifyRowHeaderWidth', rowHeaderWidth),
916
911
  onModifyGetCellCoords: (renderableRowIndex, renderableColumnIndex, topmost, source) => {
917
912
  const rowMapper = this.hot.rowIndexMapper;
@@ -1535,6 +1530,44 @@ class TableView {
1535
1530
  getTableHeight() {
1536
1531
  return this._wt.wtTable.getHeight();
1537
1532
  }
1533
+
1534
+ /**
1535
+ * Gets the row header width. If there are multiple row headers, the width of
1536
+ * the sum of all of them is returned.
1537
+ *
1538
+ * @returns {number}
1539
+ */
1540
+ getRowHeaderWidth() {
1541
+ return this._wt.wtViewport.getRowHeaderWidth();
1542
+ }
1543
+
1544
+ /**
1545
+ * Gets the column header height. If there are multiple column headers, the height
1546
+ * of the sum of all of them is returned.
1547
+ *
1548
+ * @returns {number}
1549
+ */
1550
+ getColumnHeaderHeight() {
1551
+ return this._wt.wtViewport.getColumnHeaderHeight();
1552
+ }
1553
+
1554
+ /**
1555
+ * Checks if the table uses the window as a viewport and if there is a vertical scrollbar.
1556
+ *
1557
+ * @returns {boolean}
1558
+ */
1559
+ isVerticallyScrollableByWindow() {
1560
+ return this._wt.wtViewport.isVerticallyScrollableByWindow();
1561
+ }
1562
+
1563
+ /**
1564
+ * Checks if the table uses the window as a viewport and if there is a horizontal scrollbar.
1565
+ *
1566
+ * @returns {boolean}
1567
+ */
1568
+ isHorizontallyScrollableByWindow() {
1569
+ return this._wt.wtViewport.isHorizontallyScrollableByWindow();
1570
+ }
1538
1571
  /**
1539
1572
  * Destroys internal WalkOnTable's instance. Detaches all of the bonded listeners.
1540
1573
  *