handsontable 0.0.0-next-802f59c-20241024 → 0.0.0-next-627918e-20241025

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 (128) hide show
  1. package/3rdparty/walkontable/src/calculator/index.js +1 -2
  2. package/3rdparty/walkontable/src/calculator/index.mjs +2 -2
  3. package/3rdparty/walkontable/src/calculator/viewportRows.js +3 -3
  4. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +3 -3
  5. package/3rdparty/walkontable/src/core/_base.js +3 -0
  6. package/3rdparty/walkontable/src/core/_base.mjs +3 -0
  7. package/3rdparty/walkontable/src/core/clone.js +1 -0
  8. package/3rdparty/walkontable/src/core/clone.mjs +1 -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 +3 -0
  12. package/3rdparty/walkontable/src/facade/core.mjs +3 -0
  13. package/3rdparty/walkontable/src/index.js +0 -1
  14. package/3rdparty/walkontable/src/index.mjs +2 -2
  15. package/3rdparty/walkontable/src/overlay/_base.js +3 -1
  16. package/3rdparty/walkontable/src/overlay/_base.mjs +3 -1
  17. package/3rdparty/walkontable/src/overlay/bottom.js +2 -2
  18. package/3rdparty/walkontable/src/overlay/bottom.mjs +2 -2
  19. package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -1
  20. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +1 -1
  21. package/3rdparty/walkontable/src/overlay/top.js +1 -1
  22. package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
  23. package/3rdparty/walkontable/src/overlays.js +6 -7
  24. package/3rdparty/walkontable/src/overlays.mjs +6 -7
  25. package/3rdparty/walkontable/src/renderer/colGroup.js +1 -1
  26. package/3rdparty/walkontable/src/renderer/colGroup.mjs +1 -1
  27. package/3rdparty/walkontable/src/renderer/table.js +1 -1
  28. package/3rdparty/walkontable/src/renderer/table.mjs +1 -1
  29. package/3rdparty/walkontable/src/settings.js +8 -2
  30. package/3rdparty/walkontable/src/settings.mjs +8 -2
  31. package/3rdparty/walkontable/src/table.js +35 -8
  32. package/3rdparty/walkontable/src/table.mjs +35 -8
  33. package/3rdparty/walkontable/src/types.js +1 -0
  34. package/3rdparty/walkontable/src/types.mjs +1 -0
  35. package/3rdparty/walkontable/src/utils/column.js +43 -1
  36. package/3rdparty/walkontable/src/utils/column.mjs +43 -1
  37. package/3rdparty/walkontable/src/utils/columnStretching.js +197 -0
  38. package/3rdparty/walkontable/src/utils/columnStretching.mjs +193 -0
  39. package/3rdparty/walkontable/src/utils/stylesHandler.js +179 -0
  40. package/3rdparty/walkontable/src/utils/stylesHandler.mjs +175 -0
  41. package/3rdparty/walkontable/src/viewport.js +88 -66
  42. package/3rdparty/walkontable/src/viewport.mjs +89 -67
  43. package/base.js +2 -2
  44. package/base.mjs +2 -2
  45. package/core/hooks/constants.js +0 -2
  46. package/core/hooks/constants.mjs +0 -2
  47. package/core/hooks/index.d.ts +2 -2
  48. package/core.d.ts +2 -2
  49. package/core.js +18 -6
  50. package/core.mjs +18 -6
  51. package/dataMap/metaManager/metaSchema.js +17 -0
  52. package/dataMap/metaManager/metaSchema.mjs +17 -0
  53. package/dist/handsontable.css +17 -9
  54. package/dist/handsontable.full.css +17 -7
  55. package/dist/handsontable.full.js +4217 -4534
  56. package/dist/handsontable.full.min.css +5 -4
  57. package/dist/handsontable.full.min.js +26 -26
  58. package/dist/handsontable.js +3923 -4234
  59. package/dist/handsontable.min.css +5 -4
  60. package/dist/handsontable.min.js +24 -24
  61. package/editors/autocompleteEditor/autocompleteEditor.js +1 -1
  62. package/editors/autocompleteEditor/autocompleteEditor.mjs +1 -1
  63. package/editors/baseEditor/baseEditor.js +1 -1
  64. package/editors/baseEditor/baseEditor.mjs +1 -1
  65. package/editors/dateEditor/dateEditor.js +2 -0
  66. package/editors/dateEditor/dateEditor.mjs +2 -0
  67. package/editors/handsontableEditor/handsontableEditor.js +1 -1
  68. package/editors/handsontableEditor/handsontableEditor.mjs +1 -1
  69. package/editors/selectEditor/selectEditor.js +20 -9
  70. package/editors/selectEditor/selectEditor.mjs +20 -9
  71. package/editors/textEditor/textEditor.js +4 -11
  72. package/editors/textEditor/textEditor.mjs +4 -11
  73. package/helpers/mixed.js +2 -2
  74. package/helpers/mixed.mjs +2 -2
  75. package/helpers/themes.js +17 -0
  76. package/helpers/themes.mjs +13 -0
  77. package/index.d.ts +0 -7
  78. package/package.json +10 -8
  79. package/plugins/comments/commentEditor.js +8 -1
  80. package/plugins/comments/commentEditor.mjs +8 -1
  81. package/plugins/comments/comments.js +2 -2
  82. package/plugins/comments/comments.mjs +2 -2
  83. package/plugins/contextMenu/menu/menu.js +4 -4
  84. package/plugins/contextMenu/menu/menu.mjs +4 -4
  85. package/plugins/index.d.ts +0 -3
  86. package/plugins/index.js +0 -3
  87. package/plugins/index.mjs +1 -3
  88. package/plugins/manualColumnMove/manualColumnMove.js +3 -1
  89. package/plugins/manualColumnMove/manualColumnMove.mjs +3 -1
  90. package/plugins/manualColumnResize/manualColumnResize.js +12 -24
  91. package/plugins/manualColumnResize/manualColumnResize.mjs +12 -24
  92. package/plugins/manualRowMove/manualRowMove.js +1 -1
  93. package/plugins/manualRowMove/manualRowMove.mjs +1 -1
  94. package/plugins/manualRowResize/manualRowResize.js +1 -2
  95. package/plugins/manualRowResize/manualRowResize.mjs +2 -3
  96. package/plugins/mergeCells/mergeCells.js +1 -1
  97. package/plugins/mergeCells/mergeCells.mjs +1 -1
  98. package/plugins/nestedRows/ui/headers.js +3 -1
  99. package/plugins/nestedRows/ui/headers.mjs +3 -1
  100. package/settings.d.ts +1 -0
  101. package/styles/handsontable.css +1983 -0
  102. package/styles/handsontable.min.css +30 -0
  103. package/styles/ht-theme-gemini.css +706 -0
  104. package/styles/ht-theme-gemini.min.css +30 -0
  105. package/styles/ht-theme-main.css +714 -0
  106. package/styles/ht-theme-main.min.css +30 -0
  107. package/stylesManager.js +1 -0
  108. package/stylesManager.mjs +0 -0
  109. package/tableView.js +40 -39
  110. package/tableView.mjs +40 -39
  111. package/utils/autoResize.js +4 -1
  112. package/utils/autoResize.mjs +4 -1
  113. package/utils/ghostTable.js +1 -1
  114. package/utils/ghostTable.mjs +1 -1
  115. package/plugins/stretchColumns/calculator.js +0 -159
  116. package/plugins/stretchColumns/calculator.mjs +0 -155
  117. package/plugins/stretchColumns/index.d.ts +0 -1
  118. package/plugins/stretchColumns/index.js +0 -7
  119. package/plugins/stretchColumns/index.mjs +0 -1
  120. package/plugins/stretchColumns/strategies/_base.js +0 -85
  121. package/plugins/stretchColumns/strategies/_base.mjs +0 -81
  122. package/plugins/stretchColumns/strategies/all.js +0 -68
  123. package/plugins/stretchColumns/strategies/all.mjs +0 -64
  124. package/plugins/stretchColumns/strategies/last.js +0 -77
  125. package/plugins/stretchColumns/strategies/last.mjs +0 -73
  126. package/plugins/stretchColumns/stretchColumns.d.ts +0 -11
  127. package/plugins/stretchColumns/stretchColumns.js +0 -211
  128. package/plugins/stretchColumns/stretchColumns.mjs +0 -207
@@ -21,5 +21,4 @@ var _viewportColumns = require("./viewportColumns");
21
21
  exports.ViewportColumnsCalculator = _viewportColumns.ViewportColumnsCalculator;
22
22
  exports.DEFAULT_COLUMN_WIDTH = _viewportColumns.DEFAULT_WIDTH;
23
23
  var _viewportRows = require("./viewportRows");
24
- exports.ViewportRowsCalculator = _viewportRows.ViewportRowsCalculator;
25
- exports.DEFAULT_ROW_HEIGHT = _viewportRows.DEFAULT_HEIGHT;
24
+ exports.ViewportRowsCalculator = _viewportRows.ViewportRowsCalculator;
@@ -7,5 +7,5 @@ import { RenderedAllRowsCalculationType } from "./calculationType/renderedAllRow
7
7
  import { RenderedColumnsCalculationType } from "./calculationType/renderedColumns.mjs";
8
8
  import { RenderedRowsCalculationType } from "./calculationType/renderedRows.mjs";
9
9
  import { ViewportColumnsCalculator, DEFAULT_WIDTH } from "./viewportColumns.mjs";
10
- import { ViewportRowsCalculator, DEFAULT_HEIGHT } from "./viewportRows.mjs";
11
- export { DEFAULT_HEIGHT as DEFAULT_ROW_HEIGHT, DEFAULT_WIDTH as DEFAULT_COLUMN_WIDTH, FullyVisibleColumnsCalculationType, FullyVisibleRowsCalculationType, PartiallyVisibleColumnsCalculationType, PartiallyVisibleRowsCalculationType, RenderedAllColumnsCalculationType, RenderedAllRowsCalculationType, RenderedColumnsCalculationType, RenderedRowsCalculationType, ViewportColumnsCalculator, ViewportRowsCalculator };
10
+ import { ViewportRowsCalculator } from "./viewportRows.mjs";
11
+ export { DEFAULT_WIDTH as DEFAULT_COLUMN_WIDTH, FullyVisibleColumnsCalculationType, FullyVisibleRowsCalculationType, PartiallyVisibleColumnsCalculationType, PartiallyVisibleRowsCalculationType, RenderedAllColumnsCalculationType, RenderedAllRowsCalculationType, RenderedColumnsCalculationType, RenderedRowsCalculationType, ViewportColumnsCalculator, ViewportRowsCalculator };
@@ -7,8 +7,6 @@ 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
- const DEFAULT_HEIGHT = exports.DEFAULT_HEIGHT = 23;
11
-
12
10
  /**
13
11
  * @typedef {object} ViewportRowsCalculatorOptions
14
12
  * @property {Map<string, ViewportBaseCalculator>} calculationTypes The calculation types to be performed.
@@ -34,6 +32,7 @@ class ViewportRowsCalculator extends _viewportBase.ViewportBaseCalculator {
34
32
  viewportHeight,
35
33
  scrollOffset,
36
34
  totalRows,
35
+ defaultRowHeight,
37
36
  rowHeightFn,
38
37
  overrideFn,
39
38
  horizontalScrollbarHeight
@@ -51,6 +50,7 @@ class ViewportRowsCalculator extends _viewportBase.ViewportBaseCalculator {
51
50
  _defineProperty(this, "totalCalculatedHeight", 0);
52
51
  _defineProperty(this, "startPositions", []);
53
52
  _defineProperty(this, "needReverse", true);
53
+ this.defaultHeight = defaultRowHeight;
54
54
  this.viewportHeight = viewportHeight;
55
55
  this.scrollOffset = scrollOffset;
56
56
  this.zeroBasedScrollOffset = Math.max(scrollOffset, 0);
@@ -89,7 +89,7 @@ class ViewportRowsCalculator extends _viewportBase.ViewportBaseCalculator {
89
89
  getRowHeight(row) {
90
90
  const rowHeight = this.rowHeightFn(row);
91
91
  if (isNaN(rowHeight)) {
92
- return DEFAULT_HEIGHT;
92
+ return this.defaultHeight;
93
93
  }
94
94
  return rowHeight;
95
95
  }
@@ -4,8 +4,6 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
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
6
  import { ViewportBaseCalculator } from "./viewportBase.mjs";
7
- export const DEFAULT_HEIGHT = 23;
8
-
9
7
  /**
10
8
  * @typedef {object} ViewportRowsCalculatorOptions
11
9
  * @property {Map<string, ViewportBaseCalculator>} calculationTypes The calculation types to be performed.
@@ -31,6 +29,7 @@ export class ViewportRowsCalculator extends ViewportBaseCalculator {
31
29
  viewportHeight,
32
30
  scrollOffset,
33
31
  totalRows,
32
+ defaultRowHeight,
34
33
  rowHeightFn,
35
34
  overrideFn,
36
35
  horizontalScrollbarHeight
@@ -48,6 +47,7 @@ export class ViewportRowsCalculator extends ViewportBaseCalculator {
48
47
  _defineProperty(this, "totalCalculatedHeight", 0);
49
48
  _defineProperty(this, "startPositions", []);
50
49
  _defineProperty(this, "needReverse", true);
50
+ this.defaultHeight = defaultRowHeight;
51
51
  this.viewportHeight = viewportHeight;
52
52
  this.scrollOffset = scrollOffset;
53
53
  this.zeroBasedScrollOffset = Math.max(scrollOffset, 0);
@@ -86,7 +86,7 @@ export class ViewportRowsCalculator extends ViewportBaseCalculator {
86
86
  getRowHeight(row) {
87
87
  const rowHeight = this.rowHeightFn(row);
88
88
  if (isNaN(rowHeight)) {
89
- return DEFAULT_HEIGHT;
89
+ return this.defaultHeight;
90
90
  }
91
91
  return rowHeight;
92
92
  }
@@ -309,6 +309,9 @@ class CoreAbstract {
309
309
  get selectionManager() {
310
310
  return wot.selectionManager; // TODO refactoring: move outside dao, use IOC
311
311
  },
312
+ get stylesHandler() {
313
+ return wot.stylesHandler;
314
+ },
312
315
  get drawn() {
313
316
  return wot.drawn;
314
317
  },
@@ -305,6 +305,9 @@ export default class CoreAbstract {
305
305
  get selectionManager() {
306
306
  return wot.selectionManager; // TODO refactoring: move outside dao, use IOC
307
307
  },
308
+ get stylesHandler() {
309
+ return wot.stylesHandler;
310
+ },
308
311
  get drawn() {
309
312
  return wot.drawn;
310
313
  },
@@ -33,6 +33,7 @@ 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;
36
37
  this.wtEvent = new _event.default(facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable, this.selectionManager, clone.event);
37
38
  this.findOriginalHeaders();
38
39
  }
@@ -29,6 +29,7 @@ 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;
32
33
  this.wtEvent = new Event(facadeGetter, this.domBindings, this.wtSettings, this.eventManager, this.wtTable, this.selectionManager, clone.event);
33
34
  this.findOriginalHeaders();
34
35
  }
@@ -12,6 +12,7 @@ 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");
15
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
17
  /**
17
18
  * @class Walkontable
@@ -23,6 +24,7 @@ class Walkontable extends _base.default {
23
24
  */
24
25
  constructor(table, settings) {
25
26
  super(table, new _settings.default(settings));
27
+ this.stylesHandler = new _stylesHandler.StylesHandler(settings.themeName, this.domBindings);
26
28
  const facadeGetter = this.wtSettings.getSetting('facade', this); // todo rethink. I would like to have no access to facade from the internal scope.
27
29
 
28
30
  this.wtTable = new _master.default(this.getTableDao(), facadeGetter, this.domBindings, this.wtSettings);
@@ -9,6 +9,7 @@ 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";
12
13
  /**
13
14
  * @class Walkontable
14
15
  */
@@ -19,6 +20,7 @@ export default class Walkontable extends CoreAbstract {
19
20
  */
20
21
  constructor(table, settings) {
21
22
  super(table, new Settings(settings));
23
+ this.stylesHandler = new StylesHandler(settings.themeName, this.domBindings);
22
24
  const facadeGetter = this.wtSettings.getSetting('facade', this); // todo rethink. I would like to have no access to facade from the internal scope.
23
25
 
24
26
  this.wtTable = new MasterTable(this.getTableDao(), facadeGetter, this.domBindings, this.wtSettings);
@@ -110,6 +110,9 @@ class WalkontableFacade {
110
110
  get eventManager() {
111
111
  return this._wot.eventManager;
112
112
  }
113
+ get stylesHandler() {
114
+ return this._wot.stylesHandler;
115
+ }
113
116
  createCellCoords(row, column) {
114
117
  return this._wot.createCellCoords(row, column);
115
118
  }
@@ -106,6 +106,9 @@ export default class WalkontableFacade {
106
106
  get eventManager() {
107
107
  return this._wot.eventManager;
108
108
  }
109
+ get stylesHandler() {
110
+ return this._wot.stylesHandler;
111
+ }
109
112
  createCellCoords(row, column) {
110
113
  return this._wot.createCellCoords(row, column);
111
114
  }
@@ -4,7 +4,6 @@ exports.__esModule = true;
4
4
  var _calculator = require("./calculator");
5
5
  exports.ViewportColumnsCalculator = _calculator.ViewportColumnsCalculator;
6
6
  exports.ViewportRowsCalculator = _calculator.ViewportRowsCalculator;
7
- exports.DEFAULT_ROW_HEIGHT = _calculator.DEFAULT_ROW_HEIGHT;
8
7
  exports.DEFAULT_COLUMN_WIDTH = _calculator.DEFAULT_COLUMN_WIDTH;
9
8
  var _coords = _interopRequireDefault(require("./cell/coords"));
10
9
  exports.CellCoords = _coords.default;
@@ -1,4 +1,4 @@
1
- import { ViewportColumnsCalculator, ViewportRowsCalculator, DEFAULT_ROW_HEIGHT, DEFAULT_COLUMN_WIDTH } from "./calculator/index.mjs";
1
+ import { ViewportColumnsCalculator, ViewportRowsCalculator, DEFAULT_COLUMN_WIDTH } from "./calculator/index.mjs";
2
2
  import CellCoords from "./cell/coords.mjs";
3
3
  import CellRange from "./cell/range.mjs";
4
4
  import Walkontable from "./facade/core.mjs";
@@ -6,4 +6,4 @@ import { Selection, ACTIVE_HEADER_TYPE, AREA_TYPE, FOCUS_TYPE, FILL_TYPE, HEADER
6
6
  import * as Renderer from "./renderer/index.mjs";
7
7
  import { OrderView, SharedOrderView } from "./utils/orderView/index.mjs";
8
8
  import { getListenersCounter } from "../../../eventManager.mjs";
9
- export { DEFAULT_ROW_HEIGHT, DEFAULT_COLUMN_WIDTH, ViewportColumnsCalculator, ViewportRowsCalculator, CellCoords, CellRange, Walkontable as default, Walkontable as Core, Selection, ACTIVE_HEADER_TYPE as HIGHLIGHT_ACTIVE_HEADER_TYPE, AREA_TYPE as HIGHLIGHT_AREA_TYPE, FOCUS_TYPE as HIGHLIGHT_FOCUS_TYPE, FILL_TYPE as HIGHLIGHT_FILL_TYPE, HEADER_TYPE as HIGHLIGHT_HEADER_TYPE, ROW_TYPE as HIGHLIGHT_ROW_TYPE, COLUMN_TYPE as HIGHLIGHT_COLUMN_TYPE, CUSTOM_SELECTION_TYPE as HIGHLIGHT_CUSTOM_SELECTION_TYPE, Renderer, OrderView, SharedOrderView, getListenersCounter };
9
+ export { DEFAULT_COLUMN_WIDTH, ViewportColumnsCalculator, ViewportRowsCalculator, CellCoords, CellRange, Walkontable as default, Walkontable as Core, Selection, ACTIVE_HEADER_TYPE as HIGHLIGHT_ACTIVE_HEADER_TYPE, AREA_TYPE as HIGHLIGHT_AREA_TYPE, FOCUS_TYPE as HIGHLIGHT_FOCUS_TYPE, FILL_TYPE as HIGHLIGHT_FILL_TYPE, HEADER_TYPE as HIGHLIGHT_HEADER_TYPE, ROW_TYPE as HIGHLIGHT_ROW_TYPE, COLUMN_TYPE as HIGHLIGHT_COLUMN_TYPE, CUSTOM_SELECTION_TYPE as HIGHLIGHT_CUSTOM_SELECTION_TYPE, Renderer, OrderView, SharedOrderView, getListenersCounter };
@@ -302,7 +302,9 @@ 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 // 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
306
308
  });
307
309
  }
308
310
 
@@ -298,7 +298,9 @@ 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 // 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
302
304
  });
303
305
  }
304
306
 
@@ -144,9 +144,9 @@ class BottomOverlay extends _base.Overlay {
144
144
  sumCellSizes(from, to) {
145
145
  const {
146
146
  wtTable,
147
- wtSettings
147
+ stylesHandler
148
148
  } = this.wot;
149
- const defaultRowHeight = wtSettings.getSetting('defaultRowHeight');
149
+ const defaultRowHeight = stylesHandler.getDefaultRowHeight();
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
- wtSettings
143
+ stylesHandler
144
144
  } = this.wot;
145
- const defaultRowHeight = wtSettings.getSetting('defaultRowHeight');
145
+ const defaultRowHeight = stylesHandler.getDefaultRowHeight();
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.getColumnWidth(column) || defaultColumnWidth;
122
+ sum += this.wot.wtTable.getStretchedColumnWidth(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.getColumnWidth(column) || defaultColumnWidth;
118
+ sum += this.wot.wtTable.getStretchedColumnWidth(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.wtSettings.getSetting('defaultRowHeight');
141
+ const defaultRowHeight = this.wot.stylesHandler.getDefaultRowHeight();
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.wtSettings.getSetting('defaultRowHeight');
137
+ const defaultRowHeight = this.wot.stylesHandler.getDefaultRowHeight();
138
138
  let row = from;
139
139
  let sum = 0;
140
140
  while (row < to) {
@@ -329,14 +329,13 @@ class Overlays {
329
329
  });
330
330
  let resizeTimeout;
331
331
  this.eventManager.addEventListener(rootWindow, 'resize', () => {
332
- (0, _feature.requestAnimationFrame)(() => {
333
- clearTimeout(resizeTimeout);
332
+ clearTimeout(resizeTimeout);
333
+ resizeTimeout = setTimeout(() => {
334
334
  this.wtSettings.getSetting('onWindowResize');
335
- resizeTimeout = setTimeout(() => {
336
- // Remove resizing the window from the ResizeObserver's endless-loop-blocking logic.
337
- _classPrivateFieldSet(_containerDomResizeCount, this, 0);
338
- }, 200);
339
- });
335
+
336
+ // Remove resizing the window from the ResizeObserver's endless-loop-blocking logic.
337
+ _classPrivateFieldSet(_containerDomResizeCount, this, 0);
338
+ }, 200);
340
339
  });
341
340
  if (!isScrollOnWindow) {
342
341
  this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement);
@@ -326,14 +326,13 @@ class Overlays {
326
326
  });
327
327
  let resizeTimeout;
328
328
  this.eventManager.addEventListener(rootWindow, 'resize', () => {
329
- requestAnimationFrame(() => {
330
- clearTimeout(resizeTimeout);
329
+ clearTimeout(resizeTimeout);
330
+ resizeTimeout = setTimeout(() => {
331
331
  this.wtSettings.getSetting('onWindowResize');
332
- resizeTimeout = setTimeout(() => {
333
- // Remove resizing the window from the ResizeObserver's endless-loop-blocking logic.
334
- _classPrivateFieldSet(_containerDomResizeCount, this, 0);
335
- }, 200);
336
- });
332
+
333
+ // Remove resizing the window from the ResizeObserver's endless-loop-blocking logic.
334
+ _classPrivateFieldSet(_containerDomResizeCount, this, 0);
335
+ }, 200);
337
336
  });
338
337
  if (!isScrollOnWindow) {
339
338
  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.getWidth(sourceColumnIndex);
73
+ const width = this.table.columnUtils.getStretchedColumnWidth(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.getWidth(sourceColumnIndex);
69
+ const width = this.table.columnUtils.getStretchedColumnWidth(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 to prepare proper values
304
+ // After the cells are rendered calculate columns width (or columns stretch 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 to prepare proper values
301
+ // After the cells are rendered calculate columns width (or columns stretch 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`.
23
22
  * @property {Option} externalRowCalculator Option `externalRowCalculator`.
24
23
  * @property {Option} fixedColumnsStart Option `fixedColumnsStart`.
25
24
  * @property {Option} fixedRowsBottom Option `fixedRowsBottom`.
26
25
  * @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,6 +32,7 @@ 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`.
35
36
  * @property {Option} preventOverflow Option `preventOverflow`.
36
37
  * @property {Option} preventWheel Option `preventWheel`.
37
38
  * @property {Option} renderAllColumns Option `renderAllColumns`.
@@ -42,7 +43,9 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
42
43
  * @property {Option} shouldRenderBottomOverlay Option `shouldRenderBottomOverlay`.
43
44
  * @property {Option} shouldRenderInlineStartOverlay Option `shouldRenderInlineStartOverlay`.
44
45
  * @property {Option} shouldRenderTopOverlay Option `shouldRenderTopOverlay`.
46
+ * @property {Option} stretchH Option `stretchH`.
45
47
  * @property {Option} table Option `table`.
48
+ * @property {Option} themeName Option `themeName`.
46
49
  * @property {Option} totalColumns Option `totalColumns`.
47
50
  * @property {Option} totalRows Option `totalRows`.
48
51
  * @property {?Option} beforeDraw Option `beforeDraw`.
@@ -134,6 +137,8 @@ class Settings {
134
137
  isDataViewInstance: true,
135
138
  // presentation mode
136
139
  externalRowCalculator: false,
140
+ stretchH: 'none',
141
+ // values: all, last, none
137
142
  currentRowClassName: null,
138
143
  currentColumnClassName: null,
139
144
  preventOverflow() {
@@ -142,6 +147,7 @@ class Settings {
142
147
  preventWheel: false,
143
148
  // data source
144
149
  data: undefined,
150
+ freezeOverlays: false,
145
151
  // Number of renderable columns for the left overlay.
146
152
  fixedColumnsStart: 0,
147
153
  // Number of renderable rows for the top overlay.
@@ -185,7 +191,6 @@ class Settings {
185
191
  rowHeightByOverlayName() {
186
192
  // return undefined means use default size for the rendered cell content
187
193
  },
188
- defaultRowHeight: 23,
189
194
  defaultColumnWidth: 50,
190
195
  selections: null,
191
196
  hideBorderOnMouseDownOver: false,
@@ -217,6 +222,7 @@ class Settings {
217
222
  //
218
223
  onBeforeTouchScroll: null,
219
224
  onAfterMomentumScroll: null,
225
+ onBeforeStretchingColumnWidth: width => width,
220
226
  onModifyRowHeaderWidth: null,
221
227
  onModifyGetCellCoords: null,
222
228
  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`.
20
19
  * @property {Option} externalRowCalculator Option `externalRowCalculator`.
21
20
  * @property {Option} fixedColumnsStart Option `fixedColumnsStart`.
22
21
  * @property {Option} fixedRowsBottom Option `fixedRowsBottom`.
23
22
  * @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,6 +29,7 @@ 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`.
32
33
  * @property {Option} preventOverflow Option `preventOverflow`.
33
34
  * @property {Option} preventWheel Option `preventWheel`.
34
35
  * @property {Option} renderAllColumns Option `renderAllColumns`.
@@ -39,7 +40,9 @@ import { objectEach } from "../../../helpers/object.mjs";
39
40
  * @property {Option} shouldRenderBottomOverlay Option `shouldRenderBottomOverlay`.
40
41
  * @property {Option} shouldRenderInlineStartOverlay Option `shouldRenderInlineStartOverlay`.
41
42
  * @property {Option} shouldRenderTopOverlay Option `shouldRenderTopOverlay`.
43
+ * @property {Option} stretchH Option `stretchH`.
42
44
  * @property {Option} table Option `table`.
45
+ * @property {Option} themeName Option `themeName`.
43
46
  * @property {Option} totalColumns Option `totalColumns`.
44
47
  * @property {Option} totalRows Option `totalRows`.
45
48
  * @property {?Option} beforeDraw Option `beforeDraw`.
@@ -129,6 +132,8 @@ export default class Settings {
129
132
  isDataViewInstance: true,
130
133
  // presentation mode
131
134
  externalRowCalculator: false,
135
+ stretchH: 'none',
136
+ // values: all, last, none
132
137
  currentRowClassName: null,
133
138
  currentColumnClassName: null,
134
139
  preventOverflow() {
@@ -137,6 +142,7 @@ export default class Settings {
137
142
  preventWheel: false,
138
143
  // data source
139
144
  data: undefined,
145
+ freezeOverlays: false,
140
146
  // Number of renderable columns for the left overlay.
141
147
  fixedColumnsStart: 0,
142
148
  // Number of renderable rows for the top overlay.
@@ -180,7 +186,6 @@ export default class Settings {
180
186
  rowHeightByOverlayName() {
181
187
  // return undefined means use default size for the rendered cell content
182
188
  },
183
- defaultRowHeight: 23,
184
189
  defaultColumnWidth: 50,
185
190
  selections: null,
186
191
  hideBorderOnMouseDownOver: false,
@@ -212,6 +217,7 @@ export default class Settings {
212
217
  //
213
218
  onBeforeTouchScroll: null,
214
219
  onAfterMomentumScroll: null,
220
+ onBeforeStretchingColumnWidth: width => width,
215
221
  onModifyRowHeaderWidth: null,
216
222
  onModifyGetCellCoords: null,
217
223
  onModifyGetCoordsElement: null,
@@ -296,7 +296,10 @@ 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;
299
300
  if (this.isMaster) {
301
+ workspaceWidth = this.dataAccessObject.workspaceWidth;
302
+ wtViewport.containerWidth = null;
300
303
  this.markOversizedColumnHeaders();
301
304
  }
302
305
  this.adjustColumnHeaderHeights();
@@ -309,6 +312,19 @@ class Table {
309
312
  }
310
313
  wtOverlays.refresh(false);
311
314
  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
+ }
312
328
  this.wtSettings.getSetting('onDraw', true);
313
329
  } else if (this.is(_overlay.CLONE_BOTTOM)) {
314
330
  this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize();
@@ -351,7 +367,7 @@ class Table {
351
367
  markIfOversizedColumnHeader(col) {
352
368
  const sourceColIndex = this.columnFilter.renderedToSource(col);
353
369
  let level = this.wtSettings.getSetting('columnHeaders').length;
354
- const defaultRowHeight = this.wtSettings.getSetting('defaultRowHeight');
370
+ const defaultRowHeight = this.dataAccessObject.stylesHandler.getDefaultRowHeight();
355
371
  let previousColHeaderHeight;
356
372
  let currentHeader;
357
373
  let currentHeaderHeight;
@@ -629,10 +645,13 @@ class Table {
629
645
  return;
630
646
  }
631
647
  let rowCount = this.TBODY.childNodes.length;
632
- const expectedTableHeight = rowCount * this.wtSettings.getSetting('defaultRowHeight');
648
+ const expectedTableHeight = rowCount * this.dataAccessObject.stylesHandler.getDefaultRowHeight();
633
649
  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;
634
653
  let previousRowHeight;
635
- let rowInnerHeight;
654
+ let rowCurrentHeight;
636
655
  let sourceRowIndex;
637
656
  let currentTr;
638
657
  let rowHeader;
@@ -647,13 +666,13 @@ class Table {
647
666
  currentTr = this.getTrForRow(sourceRowIndex);
648
667
  rowHeader = currentTr.querySelector('th');
649
668
  if (rowHeader) {
650
- rowInnerHeight = (0, _element.innerHeight)(rowHeader);
669
+ rowCurrentHeight = rowHeightFn(rowHeader);
651
670
  } else {
652
- rowInnerHeight = (0, _element.innerHeight)(currentTr) - 1;
671
+ rowCurrentHeight = rowHeightFn(currentTr) - borderCompensation;
653
672
  }
654
- if (!previousRowHeight && this.wtSettings.getSetting('defaultRowHeight') < rowInnerHeight || previousRowHeight < rowInnerHeight) {
655
- rowInnerHeight += 1;
656
- this.dataAccessObject.wtViewport.oversizedRows[sourceRowIndex] = rowInnerHeight;
673
+ if (!previousRowHeight && this.dataAccessObject.stylesHandler.getDefaultRowHeight() < rowCurrentHeight || previousRowHeight < rowCurrentHeight) {
674
+ rowCurrentHeight += 1;
675
+ this.dataAccessObject.wtViewport.oversizedRows[sourceRowIndex] = rowCurrentHeight;
657
676
  }
658
677
  }
659
678
  }
@@ -897,6 +916,14 @@ class Table {
897
916
  return this.columnUtils.getWidth(sourceColumn);
898
917
  }
899
918
 
919
+ /**
920
+ * @param {number} sourceColumn The physical column index.
921
+ * @returns {number}
922
+ */
923
+ getStretchedColumnWidth(sourceColumn) {
924
+ return this.columnUtils.getStretchedColumnWidth(sourceColumn);
925
+ }
926
+
900
927
  /**
901
928
  * Checks if the table has defined size. It returns `true` when the table has width and height
902
929
  * set bigger than `0px`.