handsontable 0.0.0-next-b96fb9f-20231207 → 0.0.0-next-3d099da-20231208

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 (122) hide show
  1. package/3rdparty/walkontable/src/calculator/index.js +6 -11
  2. package/3rdparty/walkontable/src/calculator/index.mjs +3 -5
  3. package/3rdparty/walkontable/src/calculator/viewportColumns.js +122 -1
  4. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +124 -2
  5. package/3rdparty/walkontable/src/calculator/viewportRows.js +1 -1
  6. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +3 -2
  7. package/3rdparty/walkontable/src/core/_base.js +12 -0
  8. package/3rdparty/walkontable/src/core/_base.mjs +12 -0
  9. package/3rdparty/walkontable/src/core/core.js +2 -0
  10. package/3rdparty/walkontable/src/core/core.mjs +2 -0
  11. package/3rdparty/walkontable/src/facade/core.js +9 -0
  12. package/3rdparty/walkontable/src/facade/core.mjs +9 -0
  13. package/3rdparty/walkontable/src/index.js +4 -3
  14. package/3rdparty/walkontable/src/index.mjs +2 -1
  15. package/3rdparty/walkontable/src/overlays.js +3 -0
  16. package/3rdparty/walkontable/src/overlays.mjs +4 -0
  17. package/3rdparty/walkontable/src/renderer/colGroup.js +0 -10
  18. package/3rdparty/walkontable/src/renderer/colGroup.mjs +0 -10
  19. package/3rdparty/walkontable/src/renderer/rows.js +3 -4
  20. package/3rdparty/walkontable/src/renderer/rows.mjs +3 -4
  21. package/3rdparty/walkontable/src/selection/manager.js +1 -0
  22. package/3rdparty/walkontable/src/selection/manager.mjs +1 -0
  23. package/3rdparty/walkontable/src/settings.js +0 -3
  24. package/3rdparty/walkontable/src/settings.mjs +0 -2
  25. package/3rdparty/walkontable/src/table.js +1 -0
  26. package/3rdparty/walkontable/src/table.mjs +1 -0
  27. package/3rdparty/walkontable/src/utils/column.js +12 -27
  28. package/3rdparty/walkontable/src/utils/column.mjs +12 -27
  29. package/3rdparty/walkontable/src/viewport.js +17 -22
  30. package/3rdparty/walkontable/src/viewport.mjs +18 -23
  31. package/base.js +2 -4
  32. package/base.mjs +2 -2
  33. package/core/focusCatcher/index.js +6 -44
  34. package/core/focusCatcher/index.mjs +6 -44
  35. package/core.js +11 -0
  36. package/core.mjs +11 -0
  37. package/dataMap/dataMap.js +0 -1
  38. package/dataMap/metaManager/metaSchema.js +2 -28
  39. package/dataMap/metaManager/metaSchema.mjs +2 -28
  40. package/dataMap/metaManager/mods/extendMetaProperties.js +0 -12
  41. package/dataMap/metaManager/mods/extendMetaProperties.mjs +0 -12
  42. package/dist/handsontable.css +2 -2
  43. package/dist/handsontable.full.css +2 -2
  44. package/dist/handsontable.full.js +3903 -2640
  45. package/dist/handsontable.full.min.css +2 -2
  46. package/dist/handsontable.full.min.js +70 -66
  47. package/dist/handsontable.js +3906 -2643
  48. package/dist/handsontable.min.css +2 -2
  49. package/dist/handsontable.min.js +39 -35
  50. package/editorManager.js +4 -3
  51. package/editorManager.mjs +4 -3
  52. package/editors/autocompleteEditor/autocompleteEditor.js +2 -0
  53. package/editors/autocompleteEditor/autocompleteEditor.mjs +2 -0
  54. package/editors/handsontableEditor/handsontableEditor.js +1 -0
  55. package/editors/handsontableEditor/handsontableEditor.mjs +1 -0
  56. package/editors/textEditor/textEditor.js +4 -0
  57. package/editors/textEditor/textEditor.mjs +4 -0
  58. package/helpers/mixed.js +1 -1
  59. package/helpers/mixed.mjs +1 -1
  60. package/package.json +1 -1
  61. package/pluginHooks.d.ts +29 -6
  62. package/pluginHooks.js +123 -65
  63. package/pluginHooks.mjs +122 -62
  64. package/plugins/copyPaste/clipboardData/clipboardData.js +588 -0
  65. package/plugins/copyPaste/clipboardData/clipboardData.mjs +584 -0
  66. package/plugins/copyPaste/clipboardData/copyClipboardData.js +69 -0
  67. package/plugins/copyPaste/clipboardData/copyClipboardData.mjs +65 -0
  68. package/plugins/copyPaste/clipboardData/index.js +9 -0
  69. package/plugins/copyPaste/clipboardData/index.mjs +4 -0
  70. package/plugins/copyPaste/clipboardData/pasteClipboardData.js +81 -0
  71. package/plugins/copyPaste/clipboardData/pasteClipboardData.mjs +77 -0
  72. package/plugins/copyPaste/copyPaste.js +51 -129
  73. package/plugins/copyPaste/copyPaste.mjs +54 -132
  74. package/plugins/copyPaste/copyableRanges.js +7 -43
  75. package/plugins/copyPaste/copyableRanges.mjs +7 -42
  76. package/plugins/copyPaste/pasteEvent.mjs +1 -1
  77. package/plugins/customBorders/customBorders.js +5 -0
  78. package/plugins/customBorders/customBorders.mjs +5 -0
  79. package/plugins/customBorders/utils.js +1 -0
  80. package/plugins/customBorders/utils.mjs +1 -0
  81. package/plugins/filters/ui/radioInput.js +1 -1
  82. package/plugins/filters/ui/radioInput.mjs +1 -1
  83. package/plugins/formulas/formulas.js +2 -0
  84. package/plugins/formulas/formulas.mjs +2 -0
  85. package/plugins/formulas/indexSyncer/axisSyncer.js +1 -0
  86. package/plugins/formulas/indexSyncer/axisSyncer.mjs +1 -0
  87. package/plugins/manualColumnResize/manualColumnResize.js +1 -0
  88. package/plugins/manualColumnResize/manualColumnResize.mjs +1 -0
  89. package/plugins/mergeCells/mergeCells.js +127 -1
  90. package/plugins/mergeCells/mergeCells.mjs +127 -1
  91. package/plugins/nestedHeaders/nestedHeaders.js +87 -41
  92. package/plugins/nestedHeaders/nestedHeaders.mjs +88 -42
  93. package/plugins/nestedHeaders/stateManager/headersTree.js +1 -0
  94. package/plugins/nestedHeaders/stateManager/headersTree.mjs +1 -0
  95. package/plugins/undoRedo/undoRedo.js +2 -0
  96. package/plugins/undoRedo/undoRedo.mjs +2 -0
  97. package/renderers/autocompleteRenderer/autocompleteRenderer.js +1 -0
  98. package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +1 -0
  99. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -0
  100. package/renderers/checkboxRenderer/checkboxRenderer.mjs +2 -0
  101. package/selection/highlight/highlight.js +1 -0
  102. package/selection/highlight/highlight.mjs +1 -0
  103. package/selection/index.js +3 -1
  104. package/selection/index.mjs +2 -2
  105. package/selection/utils.js +34 -0
  106. package/selection/utils.mjs +33 -0
  107. package/settings.d.ts +0 -1
  108. package/tableView.js +2 -1
  109. package/tableView.mjs +2 -1
  110. package/translations/indexMapper.js +1 -2
  111. package/utils/parseTable.js +538 -84
  112. package/utils/parseTable.mjs +534 -83
  113. package/validators/timeValidator/timeValidator.js +1 -0
  114. package/validators/timeValidator/timeValidator.mjs +1 -0
  115. package/3rdparty/walkontable/src/calculator/renderAllColumns.js +0 -50
  116. package/3rdparty/walkontable/src/calculator/renderAllColumns.mjs +0 -46
  117. package/3rdparty/walkontable/src/calculator/renderAllRows.js +0 -50
  118. package/3rdparty/walkontable/src/calculator/renderAllRows.mjs +0 -46
  119. package/3rdparty/walkontable/src/utils/columnStretching.js +0 -219
  120. package/3rdparty/walkontable/src/utils/columnStretching.mjs +0 -215
  121. package/plugins/copyPaste/clipboardData.js +0 -18
  122. package/plugins/copyPaste/clipboardData.mjs +0 -14
@@ -2,23 +2,18 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  var _exportNames = {
5
- RenderAllColumnsCalculator: true,
6
- RenderAllRowsCalculator: true,
7
5
  ViewportColumnsCalculator: true,
8
6
  ViewportRowsCalculator: true
9
7
  };
10
- var _renderAllColumns = require("./renderAllColumns");
11
- exports.RenderAllColumnsCalculator = _renderAllColumns.RenderAllColumnsCalculator;
12
- var _renderAllRows = require("./renderAllRows");
13
- exports.RenderAllRowsCalculator = _renderAllRows.RenderAllRowsCalculator;
14
- var _viewportColumns = require("./viewportColumns");
15
- exports.ViewportColumnsCalculator = _viewportColumns.ViewportColumnsCalculator;
16
- var _viewportRows = require("./viewportRows");
17
- exports.ViewportRowsCalculator = _viewportRows.ViewportRowsCalculator;
8
+ var _viewportColumns = _interopRequireDefault(require("./viewportColumns"));
9
+ exports.ViewportColumnsCalculator = _viewportColumns.default;
10
+ var _viewportRows = _interopRequireDefault(require("./viewportRows"));
11
+ exports.ViewportRowsCalculator = _viewportRows.default;
18
12
  var _constants = require("./constants");
19
13
  Object.keys(_constants).forEach(function (key) {
20
14
  if (key === "default" || key === "__esModule") return;
21
15
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
22
16
  if (key in exports && exports[key] === _constants[key]) return;
23
17
  exports[key] = _constants[key];
24
- });
18
+ });
19
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,6 +1,4 @@
1
- import { RenderAllColumnsCalculator } from "./renderAllColumns.mjs";
2
- import { RenderAllRowsCalculator } from "./renderAllRows.mjs";
3
- import { ViewportColumnsCalculator } from "./viewportColumns.mjs";
4
- import { ViewportRowsCalculator } from "./viewportRows.mjs";
1
+ import ViewportColumnsCalculator from "./viewportColumns.mjs";
2
+ import ViewportRowsCalculator from "./viewportRows.mjs";
5
3
  export * from "./constants.mjs";
6
- export { RenderAllColumnsCalculator, RenderAllRowsCalculator, ViewportColumnsCalculator, ViewportRowsCalculator };
4
+ export { ViewportColumnsCalculator, ViewportRowsCalculator };
@@ -34,6 +34,7 @@ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.
34
34
  *
35
35
  * @class ViewportColumnsCalculator
36
36
  */
37
+ var _totalTargetWidth = /*#__PURE__*/new WeakMap();
37
38
  var _options = /*#__PURE__*/new WeakMap();
38
39
  class ViewportColumnsCalculator {
39
40
  /**
@@ -80,6 +81,29 @@ class ViewportColumnsCalculator {
80
81
  * @type {boolean}
81
82
  */
82
83
  _defineProperty(this, "isVisibleInTrimmingContainer", false);
84
+ /**
85
+ * @type {number}
86
+ */
87
+ _defineProperty(this, "stretchAllRatio", 0);
88
+ /**
89
+ * @type {number}
90
+ */
91
+ _defineProperty(this, "stretchLastWidth", 0);
92
+ /**
93
+ * @type {number}
94
+ */
95
+ _classPrivateFieldInitSpec(this, _totalTargetWidth, {
96
+ writable: true,
97
+ value: 0
98
+ });
99
+ /**
100
+ * @type {boolean}
101
+ */
102
+ _defineProperty(this, "needVerifyLastColumnWidth", true);
103
+ /**
104
+ * @type {number[]}
105
+ */
106
+ _defineProperty(this, "stretchAllColumnsWidth", []);
83
107
  /**
84
108
  * The calculator options.
85
109
  *
@@ -90,6 +114,9 @@ class ViewportColumnsCalculator {
90
114
  value: void 0
91
115
  });
92
116
  _classPrivateFieldSet(this, _options, options);
117
+ if (typeof _classPrivateFieldGet(this, _options).stretchingColumnWidthFn !== 'function') {
118
+ _classPrivateFieldGet(this, _options).stretchingColumnWidthFn = width => width;
119
+ }
93
120
  this.calculate();
94
121
  }
95
122
 
@@ -178,6 +205,100 @@ class ViewportColumnsCalculator {
178
205
  }
179
206
  }
180
207
 
208
+ /**
209
+ * Recalculate columns stretching.
210
+ *
211
+ * @param {number} totalWidth The total width of the table.
212
+ */
213
+ refreshStretching(totalWidth) {
214
+ if (_classPrivateFieldGet(this, _options).stretchMode === 'none') {
215
+ return;
216
+ }
217
+ let totalColumnsWidth = totalWidth;
218
+ _classPrivateFieldSet(this, _totalTargetWidth, totalColumnsWidth);
219
+ const totalColumns = _classPrivateFieldGet(this, _options).totalColumns;
220
+ let sumAll = 0;
221
+ for (let i = 0; i < totalColumns; i++) {
222
+ const columnWidth = this._getColumnWidth(i);
223
+ const permanentColumnWidth = _classPrivateFieldGet(this, _options).stretchingColumnWidthFn(undefined, i);
224
+ if (typeof permanentColumnWidth === 'number') {
225
+ totalColumnsWidth -= permanentColumnWidth;
226
+ } else {
227
+ sumAll += columnWidth;
228
+ }
229
+ }
230
+ const remainingSize = totalColumnsWidth - sumAll;
231
+ if (_classPrivateFieldGet(this, _options).stretchMode === 'all' && remainingSize > 0) {
232
+ this.stretchAllRatio = totalColumnsWidth / sumAll;
233
+ this.stretchAllColumnsWidth = [];
234
+ this.needVerifyLastColumnWidth = true;
235
+ } else if (_classPrivateFieldGet(this, _options).stretchMode === 'last' && totalColumnsWidth !== Infinity) {
236
+ const columnWidth = this._getColumnWidth(totalColumns - 1);
237
+ const lastColumnWidth = remainingSize + columnWidth;
238
+ this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth;
239
+ }
240
+ }
241
+
242
+ /**
243
+ * Get stretched column width based on stretchH (all or last) setting passed in handsontable instance.
244
+ *
245
+ * @param {number} column The visual column index.
246
+ * @param {number} baseWidth The default column width.
247
+ * @returns {number|null}
248
+ */
249
+ getStretchedColumnWidth(column, baseWidth) {
250
+ let result = null;
251
+ if (_classPrivateFieldGet(this, _options).stretchMode === 'all' && this.stretchAllRatio !== 0) {
252
+ result = this._getStretchedAllColumnWidth(column, baseWidth);
253
+ } else if (_classPrivateFieldGet(this, _options).stretchMode === 'last' && this.stretchLastWidth !== 0) {
254
+ result = this._getStretchedLastColumnWidth(column);
255
+ }
256
+ return result;
257
+ }
258
+
259
+ /**
260
+ * @param {number} column The visual column index.
261
+ * @param {number} baseWidth The default column width.
262
+ * @returns {number}
263
+ * @private
264
+ */
265
+ _getStretchedAllColumnWidth(column, baseWidth) {
266
+ let sumRatioWidth = 0;
267
+ const totalColumns = _classPrivateFieldGet(this, _options).totalColumns;
268
+ if (!this.stretchAllColumnsWidth[column]) {
269
+ const stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);
270
+ const newStretchedWidth = _classPrivateFieldGet(this, _options).stretchingColumnWidthFn(stretchedWidth, column);
271
+ if (newStretchedWidth === undefined) {
272
+ this.stretchAllColumnsWidth[column] = stretchedWidth;
273
+ } else {
274
+ this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;
275
+ }
276
+ }
277
+ if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) {
278
+ this.needVerifyLastColumnWidth = false;
279
+ for (let i = 0; i < this.stretchAllColumnsWidth.length; i++) {
280
+ sumRatioWidth += this.stretchAllColumnsWidth[i];
281
+ }
282
+ if (sumRatioWidth !== _classPrivateFieldGet(this, _totalTargetWidth)) {
283
+ this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += _classPrivateFieldGet(this, _totalTargetWidth) - sumRatioWidth;
284
+ }
285
+ }
286
+ return this.stretchAllColumnsWidth[column];
287
+ }
288
+
289
+ /**
290
+ * @param {number} column The visual column index.
291
+ * @returns {number|null}
292
+ * @private
293
+ */
294
+ _getStretchedLastColumnWidth(column) {
295
+ const totalColumns = _classPrivateFieldGet(this, _options).totalColumns;
296
+ if (column === totalColumns - 1) {
297
+ return this.stretchLastWidth;
298
+ }
299
+ return null;
300
+ }
301
+
181
302
  /**
182
303
  * @param {number} column The visual column index.
183
304
  * @returns {number}
@@ -191,4 +312,4 @@ class ViewportColumnsCalculator {
191
312
  return width;
192
313
  }
193
314
  }
194
- exports.ViewportColumnsCalculator = ViewportColumnsCalculator;
315
+ var _default = exports.default = ViewportColumnsCalculator;
@@ -31,8 +31,9 @@ import { RENDER_TYPE, FULLY_VISIBLE_TYPE } from "./constants.mjs";
31
31
  *
32
32
  * @class ViewportColumnsCalculator
33
33
  */
34
+ var _totalTargetWidth = /*#__PURE__*/new WeakMap();
34
35
  var _options = /*#__PURE__*/new WeakMap();
35
- export class ViewportColumnsCalculator {
36
+ class ViewportColumnsCalculator {
36
37
  /**
37
38
  * Default column width.
38
39
  *
@@ -77,6 +78,29 @@ export class ViewportColumnsCalculator {
77
78
  * @type {boolean}
78
79
  */
79
80
  _defineProperty(this, "isVisibleInTrimmingContainer", false);
81
+ /**
82
+ * @type {number}
83
+ */
84
+ _defineProperty(this, "stretchAllRatio", 0);
85
+ /**
86
+ * @type {number}
87
+ */
88
+ _defineProperty(this, "stretchLastWidth", 0);
89
+ /**
90
+ * @type {number}
91
+ */
92
+ _classPrivateFieldInitSpec(this, _totalTargetWidth, {
93
+ writable: true,
94
+ value: 0
95
+ });
96
+ /**
97
+ * @type {boolean}
98
+ */
99
+ _defineProperty(this, "needVerifyLastColumnWidth", true);
100
+ /**
101
+ * @type {number[]}
102
+ */
103
+ _defineProperty(this, "stretchAllColumnsWidth", []);
80
104
  /**
81
105
  * The calculator options.
82
106
  *
@@ -87,6 +111,9 @@ export class ViewportColumnsCalculator {
87
111
  value: void 0
88
112
  });
89
113
  _classPrivateFieldSet(this, _options, options);
114
+ if (typeof _classPrivateFieldGet(this, _options).stretchingColumnWidthFn !== 'function') {
115
+ _classPrivateFieldGet(this, _options).stretchingColumnWidthFn = width => width;
116
+ }
90
117
  this.calculate();
91
118
  }
92
119
 
@@ -175,6 +202,100 @@ export class ViewportColumnsCalculator {
175
202
  }
176
203
  }
177
204
 
205
+ /**
206
+ * Recalculate columns stretching.
207
+ *
208
+ * @param {number} totalWidth The total width of the table.
209
+ */
210
+ refreshStretching(totalWidth) {
211
+ if (_classPrivateFieldGet(this, _options).stretchMode === 'none') {
212
+ return;
213
+ }
214
+ let totalColumnsWidth = totalWidth;
215
+ _classPrivateFieldSet(this, _totalTargetWidth, totalColumnsWidth);
216
+ const totalColumns = _classPrivateFieldGet(this, _options).totalColumns;
217
+ let sumAll = 0;
218
+ for (let i = 0; i < totalColumns; i++) {
219
+ const columnWidth = this._getColumnWidth(i);
220
+ const permanentColumnWidth = _classPrivateFieldGet(this, _options).stretchingColumnWidthFn(undefined, i);
221
+ if (typeof permanentColumnWidth === 'number') {
222
+ totalColumnsWidth -= permanentColumnWidth;
223
+ } else {
224
+ sumAll += columnWidth;
225
+ }
226
+ }
227
+ const remainingSize = totalColumnsWidth - sumAll;
228
+ if (_classPrivateFieldGet(this, _options).stretchMode === 'all' && remainingSize > 0) {
229
+ this.stretchAllRatio = totalColumnsWidth / sumAll;
230
+ this.stretchAllColumnsWidth = [];
231
+ this.needVerifyLastColumnWidth = true;
232
+ } else if (_classPrivateFieldGet(this, _options).stretchMode === 'last' && totalColumnsWidth !== Infinity) {
233
+ const columnWidth = this._getColumnWidth(totalColumns - 1);
234
+ const lastColumnWidth = remainingSize + columnWidth;
235
+ this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth;
236
+ }
237
+ }
238
+
239
+ /**
240
+ * Get stretched column width based on stretchH (all or last) setting passed in handsontable instance.
241
+ *
242
+ * @param {number} column The visual column index.
243
+ * @param {number} baseWidth The default column width.
244
+ * @returns {number|null}
245
+ */
246
+ getStretchedColumnWidth(column, baseWidth) {
247
+ let result = null;
248
+ if (_classPrivateFieldGet(this, _options).stretchMode === 'all' && this.stretchAllRatio !== 0) {
249
+ result = this._getStretchedAllColumnWidth(column, baseWidth);
250
+ } else if (_classPrivateFieldGet(this, _options).stretchMode === 'last' && this.stretchLastWidth !== 0) {
251
+ result = this._getStretchedLastColumnWidth(column);
252
+ }
253
+ return result;
254
+ }
255
+
256
+ /**
257
+ * @param {number} column The visual column index.
258
+ * @param {number} baseWidth The default column width.
259
+ * @returns {number}
260
+ * @private
261
+ */
262
+ _getStretchedAllColumnWidth(column, baseWidth) {
263
+ let sumRatioWidth = 0;
264
+ const totalColumns = _classPrivateFieldGet(this, _options).totalColumns;
265
+ if (!this.stretchAllColumnsWidth[column]) {
266
+ const stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);
267
+ const newStretchedWidth = _classPrivateFieldGet(this, _options).stretchingColumnWidthFn(stretchedWidth, column);
268
+ if (newStretchedWidth === undefined) {
269
+ this.stretchAllColumnsWidth[column] = stretchedWidth;
270
+ } else {
271
+ this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;
272
+ }
273
+ }
274
+ if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) {
275
+ this.needVerifyLastColumnWidth = false;
276
+ for (let i = 0; i < this.stretchAllColumnsWidth.length; i++) {
277
+ sumRatioWidth += this.stretchAllColumnsWidth[i];
278
+ }
279
+ if (sumRatioWidth !== _classPrivateFieldGet(this, _totalTargetWidth)) {
280
+ this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += _classPrivateFieldGet(this, _totalTargetWidth) - sumRatioWidth;
281
+ }
282
+ }
283
+ return this.stretchAllColumnsWidth[column];
284
+ }
285
+
286
+ /**
287
+ * @param {number} column The visual column index.
288
+ * @returns {number|null}
289
+ * @private
290
+ */
291
+ _getStretchedLastColumnWidth(column) {
292
+ const totalColumns = _classPrivateFieldGet(this, _options).totalColumns;
293
+ if (column === totalColumns - 1) {
294
+ return this.stretchLastWidth;
295
+ }
296
+ return null;
297
+ }
298
+
178
299
  /**
179
300
  * @param {number} column The visual column index.
180
301
  * @returns {number}
@@ -187,4 +308,5 @@ export class ViewportColumnsCalculator {
187
308
  }
188
309
  return width;
189
310
  }
190
- }
311
+ }
312
+ export default ViewportColumnsCalculator;
@@ -181,4 +181,4 @@ class ViewportRowsCalculator {
181
181
  }
182
182
  }
183
183
  }
184
- exports.ViewportRowsCalculator = ViewportRowsCalculator;
184
+ var _default = exports.default = ViewportRowsCalculator;
@@ -29,7 +29,7 @@ import { RENDER_TYPE, FULLY_VISIBLE_TYPE } from "./constants.mjs";
29
29
  * @class ViewportRowsCalculator
30
30
  */
31
31
  var _options = /*#__PURE__*/new WeakMap();
32
- export class ViewportRowsCalculator {
32
+ class ViewportRowsCalculator {
33
33
  /**
34
34
  * Default row height.
35
35
  *
@@ -177,4 +177,5 @@ export class ViewportRowsCalculator {
177
177
  this.count = this.endRow - this.startRow + 1;
178
178
  }
179
179
  }
180
- }
180
+ }
181
+ export default ViewportRowsCalculator;
@@ -234,24 +234,30 @@ class CoreAbstract {
234
234
  get drawn() {
235
235
  return wot.drawn; // TODO refactoring: consider about injecting `isDrawn` function : ()=>return wot.drawn. (it'll enables remove dao layer)
236
236
  },
237
+
237
238
  get topOverlay() {
238
239
  return wot.wtOverlays.topOverlay; // TODO refactoring: move outside dao, use IOC
239
240
  },
241
+
240
242
  get inlineStartOverlay() {
241
243
  return wot.wtOverlays.inlineStartOverlay; // TODO refactoring: move outside dao, use IOC
242
244
  },
245
+
243
246
  get wtTable() {
244
247
  return wot.wtTable; // TODO refactoring: move outside dao, use IOC
245
248
  },
249
+
246
250
  get wtViewport() {
247
251
  return wot.wtViewport; // TODO refactoring: move outside dao, use IOC
248
252
  },
253
+
249
254
  get wtSettings() {
250
255
  return wot.wtSettings;
251
256
  },
252
257
  get rootWindow() {
253
258
  return wot.domBindings.rootWindow; // TODO refactoring: move outside dao
254
259
  },
260
+
255
261
  // TODO refactoring, consider about using injecting wtSettings into scroll (it'll enables remove dao layer)
256
262
  get totalRows() {
257
263
  return wot.wtSettings.getSetting('totalRows');
@@ -287,21 +293,26 @@ class CoreAbstract {
287
293
  get parentTableOffset() {
288
294
  return wot.cloneSource.wtTable.tableOffset; // TODO rethink: cloneSource exists only in Clone type.
289
295
  },
296
+
290
297
  get cloneSource() {
291
298
  return wot.cloneSource; // TODO rethink: cloneSource exists only in Clone type.
292
299
  },
300
+
293
301
  get workspaceWidth() {
294
302
  return wot.wtViewport.getWorkspaceWidth();
295
303
  },
296
304
  get wtViewport() {
297
305
  return wot.wtViewport; // TODO refactoring: move outside dao, use IOC
298
306
  },
307
+
299
308
  get wtOverlays() {
300
309
  return wot.wtOverlays; // TODO refactoring: move outside dao, use IOC
301
310
  },
311
+
302
312
  get selectionManager() {
303
313
  return wot.selectionManager; // TODO refactoring: move outside dao, use IOC
304
314
  },
315
+
305
316
  get drawn() {
306
317
  return wot.drawn;
307
318
  },
@@ -312,6 +323,7 @@ class CoreAbstract {
312
323
  get wtTable() {
313
324
  return wot.wtTable; // TODO refactoring: it provides itself
314
325
  },
326
+
315
327
  get startColumnRendered() {
316
328
  return wot.wtViewport.columnsRenderCalculator.startColumn;
317
329
  },
@@ -230,24 +230,30 @@ export default class CoreAbstract {
230
230
  get drawn() {
231
231
  return wot.drawn; // TODO refactoring: consider about injecting `isDrawn` function : ()=>return wot.drawn. (it'll enables remove dao layer)
232
232
  },
233
+
233
234
  get topOverlay() {
234
235
  return wot.wtOverlays.topOverlay; // TODO refactoring: move outside dao, use IOC
235
236
  },
237
+
236
238
  get inlineStartOverlay() {
237
239
  return wot.wtOverlays.inlineStartOverlay; // TODO refactoring: move outside dao, use IOC
238
240
  },
241
+
239
242
  get wtTable() {
240
243
  return wot.wtTable; // TODO refactoring: move outside dao, use IOC
241
244
  },
245
+
242
246
  get wtViewport() {
243
247
  return wot.wtViewport; // TODO refactoring: move outside dao, use IOC
244
248
  },
249
+
245
250
  get wtSettings() {
246
251
  return wot.wtSettings;
247
252
  },
248
253
  get rootWindow() {
249
254
  return wot.domBindings.rootWindow; // TODO refactoring: move outside dao
250
255
  },
256
+
251
257
  // TODO refactoring, consider about using injecting wtSettings into scroll (it'll enables remove dao layer)
252
258
  get totalRows() {
253
259
  return wot.wtSettings.getSetting('totalRows');
@@ -283,21 +289,26 @@ export default class CoreAbstract {
283
289
  get parentTableOffset() {
284
290
  return wot.cloneSource.wtTable.tableOffset; // TODO rethink: cloneSource exists only in Clone type.
285
291
  },
292
+
286
293
  get cloneSource() {
287
294
  return wot.cloneSource; // TODO rethink: cloneSource exists only in Clone type.
288
295
  },
296
+
289
297
  get workspaceWidth() {
290
298
  return wot.wtViewport.getWorkspaceWidth();
291
299
  },
292
300
  get wtViewport() {
293
301
  return wot.wtViewport; // TODO refactoring: move outside dao, use IOC
294
302
  },
303
+
295
304
  get wtOverlays() {
296
305
  return wot.wtOverlays; // TODO refactoring: move outside dao, use IOC
297
306
  },
307
+
298
308
  get selectionManager() {
299
309
  return wot.selectionManager; // TODO refactoring: move outside dao, use IOC
300
310
  },
311
+
301
312
  get drawn() {
302
313
  return wot.drawn;
303
314
  },
@@ -308,6 +319,7 @@ export default class CoreAbstract {
308
319
  get wtTable() {
309
320
  return wot.wtTable; // TODO refactoring: it provides itself
310
321
  },
322
+
311
323
  get startColumnRendered() {
312
324
  return wot.wtViewport.columnsRenderCalculator.startColumn;
313
325
  },
@@ -85,9 +85,11 @@ class Walkontable extends _base.default {
85
85
  get topOverlay() {
86
86
  return wot.wtOverlays.topOverlay; // TODO refactoring: move outside dao, use IOC
87
87
  },
88
+
88
89
  get inlineStartOverlay() {
89
90
  return wot.wtOverlays.inlineStartOverlay; // TODO refactoring: move outside dao, use IOC
90
91
  },
92
+
91
93
  get bottomOverlay() {
92
94
  return wot.wtOverlays.bottomOverlay; // TODO refactoring: move outside dao, use IOC
93
95
  }
@@ -81,9 +81,11 @@ export default class Walkontable extends CoreAbstract {
81
81
  get topOverlay() {
82
82
  return wot.wtOverlays.topOverlay; // TODO refactoring: move outside dao, use IOC
83
83
  },
84
+
84
85
  get inlineStartOverlay() {
85
86
  return wot.wtOverlays.inlineStartOverlay; // TODO refactoring: move outside dao, use IOC
86
87
  },
88
+
87
89
  get bottomOverlay() {
88
90
  return wot.wtOverlays.bottomOverlay; // TODO refactoring: move outside dao, use IOC
89
91
  }
@@ -41,30 +41,39 @@ class WalkontableFacade {
41
41
  get wtSettings() {
42
42
  return this._wot.wtSettings; // todo create facade
43
43
  }
44
+
44
45
  get cloneSource() {
45
46
  return this._wot.cloneSource; // todo create facade
46
47
  }
48
+
47
49
  get cloneOverlay() {
48
50
  return this._wot.cloneOverlay; // todo create facade
49
51
  }
52
+
50
53
  get selectionManager() {
51
54
  return this._wot.selectionManager; // todo create facade
52
55
  }
56
+
53
57
  get wtViewport() {
54
58
  return this._wot.wtViewport; // todo create facade
55
59
  }
60
+
56
61
  get wtOverlays() {
57
62
  return this._wot.wtOverlays; // todo create facade
58
63
  }
64
+
59
65
  get wtTable() {
60
66
  return this._wot.wtTable; // todo create facade
61
67
  }
68
+
62
69
  get wtEvent() {
63
70
  return this._wot.wtEvent; // todo create facade
64
71
  }
72
+
65
73
  get wtScroll() {
66
74
  return this._wot.wtScroll; // todo create facade
67
75
  }
76
+
68
77
  get drawn() {
69
78
  return this._wot.drawn;
70
79
  }
@@ -37,30 +37,39 @@ export default class WalkontableFacade {
37
37
  get wtSettings() {
38
38
  return this._wot.wtSettings; // todo create facade
39
39
  }
40
+
40
41
  get cloneSource() {
41
42
  return this._wot.cloneSource; // todo create facade
42
43
  }
44
+
43
45
  get cloneOverlay() {
44
46
  return this._wot.cloneOverlay; // todo create facade
45
47
  }
48
+
46
49
  get selectionManager() {
47
50
  return this._wot.selectionManager; // todo create facade
48
51
  }
52
+
49
53
  get wtViewport() {
50
54
  return this._wot.wtViewport; // todo create facade
51
55
  }
56
+
52
57
  get wtOverlays() {
53
58
  return this._wot.wtOverlays; // todo create facade
54
59
  }
60
+
55
61
  get wtTable() {
56
62
  return this._wot.wtTable; // todo create facade
57
63
  }
64
+
58
65
  get wtEvent() {
59
66
  return this._wot.wtEvent; // todo create facade
60
67
  }
68
+
61
69
  get wtScroll() {
62
70
  return this._wot.wtScroll; // todo create facade
63
71
  }
72
+
64
73
  get drawn() {
65
74
  return this._wot.drawn;
66
75
  }
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- var _calculator = require("./calculator");
5
- exports.ViewportColumnsCalculator = _calculator.ViewportColumnsCalculator;
6
- exports.ViewportRowsCalculator = _calculator.ViewportRowsCalculator;
4
+ var _viewportColumns = _interopRequireDefault(require("./calculator/viewportColumns"));
5
+ exports.ViewportColumnsCalculator = _viewportColumns.default;
6
+ var _viewportRows = _interopRequireDefault(require("./calculator/viewportRows"));
7
+ exports.ViewportRowsCalculator = _viewportRows.default;
7
8
  var _coords = _interopRequireDefault(require("./cell/coords"));
8
9
  exports.CellCoords = _coords.default;
9
10
  var _range = _interopRequireDefault(require("./cell/range"));
@@ -1,4 +1,5 @@
1
- import { ViewportColumnsCalculator, ViewportRowsCalculator } from "./calculator/index.mjs";
1
+ import ViewportColumnsCalculator from "./calculator/viewportColumns.mjs";
2
+ import ViewportRowsCalculator from "./calculator/viewportRows.mjs";
2
3
  import CellCoords from "./cell/coords.mjs";
3
4
  import CellRange from "./cell/range.mjs";
4
5
  import Walkontable from "./facade/core.mjs";
@@ -226,6 +226,7 @@ class Overlays {
226
226
  if (this.verticalScrolling) {
227
227
  this.inlineStartOverlay.onScroll(); // todo the inlineStartOverlay.onScroll() fires hook. Why is it needed there, not in any another place?
228
228
  }
229
+
229
230
  if (this.horizontalScrolling) {
230
231
  this.topOverlay.onScroll();
231
232
  }
@@ -455,9 +456,11 @@ class Overlays {
455
456
  if (this.topOverlay.needFullRender) {
456
457
  this.topOverlay.clone.wtTable.holder.scrollLeft = scrollLeft; // todo rethink, *overlay.setScroll*()
457
458
  }
459
+
458
460
  if (this.bottomOverlay.needFullRender) {
459
461
  this.bottomOverlay.clone.wtTable.holder.scrollLeft = scrollLeft; // todo rethink, *overlay.setScroll*()
460
462
  }
463
+
461
464
  if (this.inlineStartOverlay.needFullRender) {
462
465
  this.inlineStartOverlay.clone.wtTable.holder.scrollTop = scrollTop; // todo rethink, *overlay.setScroll*()
463
466
  }
@@ -223,6 +223,7 @@ class Overlays {
223
223
  if (this.verticalScrolling) {
224
224
  this.inlineStartOverlay.onScroll(); // todo the inlineStartOverlay.onScroll() fires hook. Why is it needed there, not in any another place?
225
225
  }
226
+
226
227
  if (this.horizontalScrolling) {
227
228
  this.topOverlay.onScroll();
228
229
  }
@@ -452,9 +453,11 @@ class Overlays {
452
453
  if (this.topOverlay.needFullRender) {
453
454
  this.topOverlay.clone.wtTable.holder.scrollLeft = scrollLeft; // todo rethink, *overlay.setScroll*()
454
455
  }
456
+
455
457
  if (this.bottomOverlay.needFullRender) {
456
458
  this.bottomOverlay.clone.wtTable.holder.scrollLeft = scrollLeft; // todo rethink, *overlay.setScroll*()
457
459
  }
460
+
458
461
  if (this.inlineStartOverlay.needFullRender) {
459
462
  this.inlineStartOverlay.clone.wtTable.holder.scrollTop = scrollTop; // todo rethink, *overlay.setScroll*()
460
463
  }
@@ -642,4 +645,5 @@ class Overlays {
642
645
  });
643
646
  }
644
647
  }
648
+
645
649
  export default Overlays;