handsontable 0.0.0-next-ee5ee21-20241202 → 0.0.0-next-b3759c7-20241203

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

Potentially problematic release.


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

Files changed (116) hide show
  1. package/3rdparty/walkontable/src/calculator/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 +6 -5
  18. package/3rdparty/walkontable/src/overlay/bottom.mjs +6 -5
  19. package/3rdparty/walkontable/src/overlay/inlineStart.js +7 -6
  20. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +8 -7
  21. package/3rdparty/walkontable/src/overlay/top.js +9 -8
  22. package/3rdparty/walkontable/src/overlay/top.mjs +10 -9
  23. package/3rdparty/walkontable/src/overlays.js +20 -0
  24. package/3rdparty/walkontable/src/overlays.mjs +20 -0
  25. package/3rdparty/walkontable/src/renderer/index.js +4 -2
  26. package/3rdparty/walkontable/src/renderer/index.mjs +4 -2
  27. package/3rdparty/walkontable/src/renderer/table.js +12 -3
  28. package/3rdparty/walkontable/src/renderer/table.mjs +12 -3
  29. package/3rdparty/walkontable/src/selection/border/border.js +19 -13
  30. package/3rdparty/walkontable/src/selection/border/border.mjs +19 -13
  31. package/3rdparty/walkontable/src/selection/border/utils.js +26 -0
  32. package/3rdparty/walkontable/src/selection/border/utils.mjs +22 -0
  33. package/3rdparty/walkontable/src/selection/index.js +4 -4
  34. package/3rdparty/walkontable/src/selection/index.mjs +1 -1
  35. package/3rdparty/walkontable/src/settings.js +0 -2
  36. package/3rdparty/walkontable/src/settings.mjs +0 -2
  37. package/3rdparty/walkontable/src/table.js +17 -9
  38. package/3rdparty/walkontable/src/table.mjs +17 -9
  39. package/3rdparty/walkontable/src/types.js +1 -0
  40. package/3rdparty/walkontable/src/types.mjs +1 -0
  41. package/3rdparty/walkontable/src/utils/column.js +1 -1
  42. package/3rdparty/walkontable/src/utils/column.mjs +1 -1
  43. package/3rdparty/walkontable/src/utils/stylesHandler.js +295 -0
  44. package/3rdparty/walkontable/src/utils/stylesHandler.mjs +291 -0
  45. package/3rdparty/walkontable/src/viewport.js +1 -0
  46. package/3rdparty/walkontable/src/viewport.mjs +1 -0
  47. package/base.js +2 -2
  48. package/base.mjs +2 -2
  49. package/core/hooks/constants.js +9 -0
  50. package/core/hooks/constants.mjs +9 -0
  51. package/core/hooks/index.d.ts +1 -0
  52. package/core.d.ts +2 -0
  53. package/core.js +50 -1
  54. package/core.mjs +50 -1
  55. package/dataMap/metaManager/metaSchema.js +23 -3
  56. package/dataMap/metaManager/metaSchema.mjs +23 -3
  57. package/dist/handsontable.css +84 -72
  58. package/dist/handsontable.full.css +317 -304
  59. package/dist/handsontable.full.js +5923 -5741
  60. package/dist/handsontable.full.min.css +15 -10
  61. package/dist/handsontable.full.min.js +54 -53
  62. package/dist/handsontable.js +4372 -3958
  63. package/dist/handsontable.min.css +10 -6
  64. package/dist/handsontable.min.js +32 -32
  65. package/editors/autocompleteEditor/autocompleteEditor.js +1 -1
  66. package/editors/autocompleteEditor/autocompleteEditor.mjs +1 -1
  67. package/editors/baseEditor/baseEditor.js +1 -1
  68. package/editors/baseEditor/baseEditor.mjs +1 -1
  69. package/editors/dateEditor/dateEditor.js +9 -0
  70. package/editors/dateEditor/dateEditor.mjs +10 -1
  71. package/editors/handsontableEditor/handsontableEditor.js +7 -1
  72. package/editors/handsontableEditor/handsontableEditor.mjs +7 -1
  73. package/editors/selectEditor/selectEditor.js +20 -9
  74. package/editors/selectEditor/selectEditor.mjs +20 -9
  75. package/editors/textEditor/textEditor.js +4 -11
  76. package/editors/textEditor/textEditor.mjs +4 -11
  77. package/helpers/dom/element.js +32 -1
  78. package/helpers/dom/element.mjs +31 -1
  79. package/helpers/mixed.js +2 -2
  80. package/helpers/mixed.mjs +2 -2
  81. package/helpers/themes.js +17 -0
  82. package/helpers/themes.mjs +13 -0
  83. package/package.json +12 -3
  84. package/plugins/comments/commentEditor.js +9 -0
  85. package/plugins/comments/commentEditor.mjs +9 -0
  86. package/plugins/comments/comments.js +14 -0
  87. package/plugins/comments/comments.mjs +15 -1
  88. package/plugins/contextMenu/menu/menu.js +9 -4
  89. package/plugins/contextMenu/menu/menu.mjs +9 -4
  90. package/plugins/filters/ui/multipleSelect.js +6 -0
  91. package/plugins/filters/ui/multipleSelect.mjs +6 -0
  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 +7 -1
  99. package/plugins/nestedRows/ui/headers.mjs +7 -1
  100. package/plugins/stretchColumns/calculator.js +2 -1
  101. package/plugins/stretchColumns/calculator.mjs +3 -2
  102. package/settings.d.ts +1 -0
  103. package/styles/handsontable.css +2307 -0
  104. package/styles/handsontable.min.css +30 -0
  105. package/styles/ht-theme-horizon.css +607 -0
  106. package/styles/ht-theme-horizon.min.css +30 -0
  107. package/styles/ht-theme-main.css +613 -0
  108. package/styles/ht-theme-main.min.css +30 -0
  109. package/tableView.js +67 -0
  110. package/tableView.mjs +68 -1
  111. package/utils/autoResize.js +4 -1
  112. package/utils/autoResize.mjs +4 -1
  113. package/utils/ghostTable.js +5 -3
  114. package/utils/ghostTable.mjs +5 -3
  115. package/3rdparty/walkontable/src/selection/border/constants.js +0 -15
  116. package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -12
@@ -52,7 +52,8 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
52
52
  class TableRenderer {
53
53
  constructor(rootNode) {
54
54
  let {
55
- cellRenderer
55
+ cellRenderer,
56
+ stylesHandler
56
57
  } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
57
58
  /**
58
59
  * Table element which will be used to render the children element.
@@ -168,9 +169,14 @@ class TableRenderer {
168
169
  * @type {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'}
169
170
  */
170
171
  _defineProperty(this, "activeOverlayName", void 0);
172
+ /**
173
+ * Styles handler instance.
174
+ */
175
+ _defineProperty(this, "stylesHandler", void 0);
171
176
  this.rootNode = rootNode;
172
177
  this.rootDocument = this.rootNode.ownerDocument;
173
178
  this.cellRenderer = cellRenderer;
179
+ this.stylesHandler = stylesHandler;
174
180
  }
175
181
 
176
182
  /**
@@ -313,12 +319,15 @@ class TableRenderer {
313
319
  // Fix for multi-line content and for supporting `rowHeights` option.
314
320
  for (let visibleRowIndex = 0; visibleRowIndex < rowsToRender; visibleRowIndex++) {
315
321
  const TR = rows.getRenderedNode(visibleRowIndex);
322
+ const rowUtils = this.rowUtils;
316
323
  if (TR.firstChild) {
317
324
  const sourceRowIndex = this.renderedRowToSource(visibleRowIndex);
318
- const rowHeight = this.rowUtils.getHeightByOverlayName(sourceRowIndex, this.activeOverlayName);
325
+ const rowHeight = rowUtils.getHeightByOverlayName(sourceRowIndex, this.activeOverlayName);
326
+ const isBorderBoxSizing = this.stylesHandler.areCellsBorderBox();
327
+ const borderCompensation = isBorderBoxSizing ? 0 : 1;
319
328
  if (rowHeight) {
320
329
  // Decrease height. 1 pixel will be "replaced" by 1px border top
321
- TR.firstChild.style.height = `${rowHeight - 1}px`;
330
+ TR.firstChild.style.height = `${rowHeight - borderCompensation}px`;
322
331
  } else {
323
332
  TR.firstChild.style.height = '';
324
333
  }
@@ -49,7 +49,8 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
49
49
  export default class TableRenderer {
50
50
  constructor(rootNode) {
51
51
  let {
52
- cellRenderer
52
+ cellRenderer,
53
+ stylesHandler
53
54
  } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
54
55
  /**
55
56
  * Table element which will be used to render the children element.
@@ -165,9 +166,14 @@ export default class TableRenderer {
165
166
  * @type {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'}
166
167
  */
167
168
  _defineProperty(this, "activeOverlayName", void 0);
169
+ /**
170
+ * Styles handler instance.
171
+ */
172
+ _defineProperty(this, "stylesHandler", void 0);
168
173
  this.rootNode = rootNode;
169
174
  this.rootDocument = this.rootNode.ownerDocument;
170
175
  this.cellRenderer = cellRenderer;
176
+ this.stylesHandler = stylesHandler;
171
177
  }
172
178
 
173
179
  /**
@@ -310,12 +316,15 @@ export default class TableRenderer {
310
316
  // Fix for multi-line content and for supporting `rowHeights` option.
311
317
  for (let visibleRowIndex = 0; visibleRowIndex < rowsToRender; visibleRowIndex++) {
312
318
  const TR = rows.getRenderedNode(visibleRowIndex);
319
+ const rowUtils = this.rowUtils;
313
320
  if (TR.firstChild) {
314
321
  const sourceRowIndex = this.renderedRowToSource(visibleRowIndex);
315
- const rowHeight = this.rowUtils.getHeightByOverlayName(sourceRowIndex, this.activeOverlayName);
322
+ const rowHeight = rowUtils.getHeightByOverlayName(sourceRowIndex, this.activeOverlayName);
323
+ const isBorderBoxSizing = this.stylesHandler.areCellsBorderBox();
324
+ const borderCompensation = isBorderBoxSizing ? 0 : 1;
316
325
  if (rowHeight) {
317
326
  // Decrease height. 1 pixel will be "replaced" by 1px border top
318
- TR.firstChild.style.height = `${rowHeight - 1}px`;
327
+ TR.firstChild.style.height = `${rowHeight - borderCompensation}px`;
319
328
  } else {
320
329
  TR.firstChild.style.height = '';
321
330
  }
@@ -5,7 +5,7 @@ var _element = require("../../../../../helpers/dom/element");
5
5
  var _event = require("../../../../../helpers/dom/event");
6
6
  var _object = require("../../../../../helpers/object");
7
7
  var _browser = require("../../../../../helpers/browser");
8
- var _constants = require("./constants");
8
+ var _utils = require("./utils");
9
9
  /**
10
10
  *
11
11
  */
@@ -35,9 +35,9 @@ class Border {
35
35
  this.bottomStyle = null;
36
36
  this.startStyle = null;
37
37
  this.endStyle = null;
38
- this.cornerDefaultStyle = _constants.CORNER_DEFAULT_STYLE;
38
+ this.cornerDefaultStyle = (0, _utils.getCornerStyle)(this.instance);
39
39
  // Offset to moving the corner to be centered relative to the grid.
40
- this.cornerCenterPointOffset = -(parseInt(this.cornerDefaultStyle.width, 10) / 2);
40
+ this.cornerCenterPointOffset = -Math.ceil(parseInt(this.cornerDefaultStyle.width, 10) / 2);
41
41
  this.corner = null;
42
42
  this.cornerStyle = null;
43
43
  this.createBorders(settings);
@@ -166,9 +166,9 @@ class Border {
166
166
  this.corner = this.main.childNodes[4];
167
167
  this.corner.className += ' corner';
168
168
  this.cornerStyle = this.corner.style;
169
- this.cornerStyle.width = this.cornerDefaultStyle.width;
170
- this.cornerStyle.height = this.cornerDefaultStyle.height;
171
- this.cornerStyle.border = [this.cornerDefaultStyle.borderWidth, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' ');
169
+ this.cornerStyle.width = `${this.cornerDefaultStyle.width}px`;
170
+ this.cornerStyle.height = `${this.cornerDefaultStyle.height}px`;
171
+ this.cornerStyle.border = [`${this.cornerDefaultStyle.borderWidth}px`, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' ');
172
172
  if ((0, _browser.isMobileBrowser)() && this.instance.getSetting('isDataViewInstance')) {
173
173
  this.createMultipleSelectorHandles();
174
174
  }
@@ -437,9 +437,11 @@ class Border {
437
437
  if ((0, _browser.isMobileBrowser)() || !cornerVisibleSetting || this.isPartRange(checkRow, checkCol)) {
438
438
  this.cornerStyle.display = 'none';
439
439
  } else {
440
- this.cornerStyle.top = `${top + height + this.cornerCenterPointOffset - 1}px`;
441
- this.cornerStyle[inlinePosProperty] = `${inlineStartPos + width + this.cornerCenterPointOffset - 1}px`;
442
- this.cornerStyle.borderRightWidth = this.cornerDefaultStyle.borderWidth;
440
+ this.cornerStyle.top = `${top + height + this.cornerCenterPointOffset - this.cornerDefaultStyle.borderWidth}px`;
441
+ this.cornerStyle[inlinePosProperty] = `${inlineStartPos + width + this.cornerCenterPointOffset - this.cornerDefaultStyle.borderWidth}px`;
442
+ this.cornerStyle.borderRightWidth = `${this.cornerDefaultStyle.borderWidth}px`;
443
+ this.cornerStyle.borderLeftWidth = `${this.cornerDefaultStyle.borderWidth}px`;
444
+ this.cornerStyle.borderBottomWidth = `${this.cornerDefaultStyle.borderWidth}px`;
443
445
  this.cornerStyle.width = this.cornerDefaultStyle.width;
444
446
 
445
447
  // Hide the fill handle, so the possible further adjustments won't force unneeded scrollbars.
@@ -449,8 +451,12 @@ class Border {
449
451
  if (trimToWindow) {
450
452
  trimmingContainer = rootDocument.documentElement;
451
453
  }
452
- const cornerHalfWidth = parseInt(this.cornerDefaultStyle.width, 10) / 2;
453
- const cornerHalfHeight = parseInt(this.cornerDefaultStyle.height, 10) / 2;
454
+
455
+ // -1 was initially removed from the base position to compansate for the table border. We need to exclude it from
456
+ // the corner width.
457
+ const cornerBorderCompensation = parseInt(this.cornerDefaultStyle.borderWidth, 10) - 1;
458
+ const cornerHalfWidth = Math.ceil(parseInt(this.cornerDefaultStyle.width, 10) / 2);
459
+ const cornerHalfHeight = Math.ceil(parseInt(this.cornerDefaultStyle.height, 10) / 2);
454
460
  if (toColumn === this.wot.getSetting('totalColumns') - 1) {
455
461
  const toTdOffsetLeft = trimToWindow ? toTD.getBoundingClientRect().left : toTD.offsetLeft;
456
462
  let cornerOverlappingContainer = false;
@@ -463,7 +469,7 @@ class Border {
463
469
  cornerOverlappingContainer = cornerEdge >= (0, _element.innerWidth)(trimmingContainer);
464
470
  }
465
471
  if (cornerOverlappingContainer) {
466
- this.cornerStyle[inlinePosProperty] = `${Math.floor(inlineStartPos + width + this.cornerCenterPointOffset - cornerHalfWidth)}px`;
472
+ this.cornerStyle[inlinePosProperty] = `${Math.floor(inlineStartPos + width + this.cornerCenterPointOffset - cornerHalfWidth - cornerBorderCompensation)}px`;
467
473
  this.cornerStyle[isRtl ? 'borderLeftWidth' : 'borderRightWidth'] = 0;
468
474
  }
469
475
  }
@@ -472,7 +478,7 @@ class Border {
472
478
  const cornerBottomEdge = toTdOffsetTop + (0, _element.outerHeight)(toTD) + parseInt(this.cornerDefaultStyle.height, 10) / 2;
473
479
  const cornerOverlappingContainer = cornerBottomEdge >= (0, _element.innerHeight)(trimmingContainer);
474
480
  if (cornerOverlappingContainer) {
475
- this.cornerStyle.top = `${Math.floor(top + height + this.cornerCenterPointOffset - cornerHalfHeight)}px`;
481
+ this.cornerStyle.top = `${Math.floor(top + height + this.cornerCenterPointOffset - cornerHalfHeight - cornerBorderCompensation)}px`;
476
482
  this.cornerStyle.borderBottomWidth = 0;
477
483
  }
478
484
  }
@@ -2,7 +2,7 @@ import { addClass, hasClass, removeClass, getTrimmingContainer, innerWidth, inne
2
2
  import { stopImmediatePropagation } from "../../../../../helpers/dom/event.mjs";
3
3
  import { objectEach } from "../../../../../helpers/object.mjs";
4
4
  import { isMobileBrowser } from "../../../../../helpers/browser.mjs";
5
- import { CORNER_DEFAULT_STYLE } from "./constants.mjs";
5
+ import { getCornerStyle } from "./utils.mjs";
6
6
  /**
7
7
  *
8
8
  */
@@ -32,9 +32,9 @@ class Border {
32
32
  this.bottomStyle = null;
33
33
  this.startStyle = null;
34
34
  this.endStyle = null;
35
- this.cornerDefaultStyle = CORNER_DEFAULT_STYLE;
35
+ this.cornerDefaultStyle = getCornerStyle(this.instance);
36
36
  // Offset to moving the corner to be centered relative to the grid.
37
- this.cornerCenterPointOffset = -(parseInt(this.cornerDefaultStyle.width, 10) / 2);
37
+ this.cornerCenterPointOffset = -Math.ceil(parseInt(this.cornerDefaultStyle.width, 10) / 2);
38
38
  this.corner = null;
39
39
  this.cornerStyle = null;
40
40
  this.createBorders(settings);
@@ -163,9 +163,9 @@ class Border {
163
163
  this.corner = this.main.childNodes[4];
164
164
  this.corner.className += ' corner';
165
165
  this.cornerStyle = this.corner.style;
166
- this.cornerStyle.width = this.cornerDefaultStyle.width;
167
- this.cornerStyle.height = this.cornerDefaultStyle.height;
168
- this.cornerStyle.border = [this.cornerDefaultStyle.borderWidth, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' ');
166
+ this.cornerStyle.width = `${this.cornerDefaultStyle.width}px`;
167
+ this.cornerStyle.height = `${this.cornerDefaultStyle.height}px`;
168
+ this.cornerStyle.border = [`${this.cornerDefaultStyle.borderWidth}px`, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' ');
169
169
  if (isMobileBrowser() && this.instance.getSetting('isDataViewInstance')) {
170
170
  this.createMultipleSelectorHandles();
171
171
  }
@@ -434,9 +434,11 @@ class Border {
434
434
  if (isMobileBrowser() || !cornerVisibleSetting || this.isPartRange(checkRow, checkCol)) {
435
435
  this.cornerStyle.display = 'none';
436
436
  } else {
437
- this.cornerStyle.top = `${top + height + this.cornerCenterPointOffset - 1}px`;
438
- this.cornerStyle[inlinePosProperty] = `${inlineStartPos + width + this.cornerCenterPointOffset - 1}px`;
439
- this.cornerStyle.borderRightWidth = this.cornerDefaultStyle.borderWidth;
437
+ this.cornerStyle.top = `${top + height + this.cornerCenterPointOffset - this.cornerDefaultStyle.borderWidth}px`;
438
+ this.cornerStyle[inlinePosProperty] = `${inlineStartPos + width + this.cornerCenterPointOffset - this.cornerDefaultStyle.borderWidth}px`;
439
+ this.cornerStyle.borderRightWidth = `${this.cornerDefaultStyle.borderWidth}px`;
440
+ this.cornerStyle.borderLeftWidth = `${this.cornerDefaultStyle.borderWidth}px`;
441
+ this.cornerStyle.borderBottomWidth = `${this.cornerDefaultStyle.borderWidth}px`;
440
442
  this.cornerStyle.width = this.cornerDefaultStyle.width;
441
443
 
442
444
  // Hide the fill handle, so the possible further adjustments won't force unneeded scrollbars.
@@ -446,8 +448,12 @@ class Border {
446
448
  if (trimToWindow) {
447
449
  trimmingContainer = rootDocument.documentElement;
448
450
  }
449
- const cornerHalfWidth = parseInt(this.cornerDefaultStyle.width, 10) / 2;
450
- const cornerHalfHeight = parseInt(this.cornerDefaultStyle.height, 10) / 2;
451
+
452
+ // -1 was initially removed from the base position to compansate for the table border. We need to exclude it from
453
+ // the corner width.
454
+ const cornerBorderCompensation = parseInt(this.cornerDefaultStyle.borderWidth, 10) - 1;
455
+ const cornerHalfWidth = Math.ceil(parseInt(this.cornerDefaultStyle.width, 10) / 2);
456
+ const cornerHalfHeight = Math.ceil(parseInt(this.cornerDefaultStyle.height, 10) / 2);
451
457
  if (toColumn === this.wot.getSetting('totalColumns') - 1) {
452
458
  const toTdOffsetLeft = trimToWindow ? toTD.getBoundingClientRect().left : toTD.offsetLeft;
453
459
  let cornerOverlappingContainer = false;
@@ -460,7 +466,7 @@ class Border {
460
466
  cornerOverlappingContainer = cornerEdge >= innerWidth(trimmingContainer);
461
467
  }
462
468
  if (cornerOverlappingContainer) {
463
- this.cornerStyle[inlinePosProperty] = `${Math.floor(inlineStartPos + width + this.cornerCenterPointOffset - cornerHalfWidth)}px`;
469
+ this.cornerStyle[inlinePosProperty] = `${Math.floor(inlineStartPos + width + this.cornerCenterPointOffset - cornerHalfWidth - cornerBorderCompensation)}px`;
464
470
  this.cornerStyle[isRtl ? 'borderLeftWidth' : 'borderRightWidth'] = 0;
465
471
  }
466
472
  }
@@ -469,7 +475,7 @@ class Border {
469
475
  const cornerBottomEdge = toTdOffsetTop + outerHeight(toTD) + parseInt(this.cornerDefaultStyle.height, 10) / 2;
470
476
  const cornerOverlappingContainer = cornerBottomEdge >= innerHeight(trimmingContainer);
471
477
  if (cornerOverlappingContainer) {
472
- this.cornerStyle.top = `${Math.floor(top + height + this.cornerCenterPointOffset - cornerHalfHeight)}px`;
478
+ this.cornerStyle.top = `${Math.floor(top + height + this.cornerCenterPointOffset - cornerHalfHeight - cornerBorderCompensation)}px`;
473
479
  this.cornerStyle.borderBottomWidth = 0;
474
480
  }
475
481
  }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ const getCornerStyle = wot => {
5
+ const stylesHandler = wot.stylesHandler;
6
+ if (stylesHandler.isClassicTheme()) {
7
+ return Object.freeze({
8
+ width: 6,
9
+ height: 6,
10
+ borderWidth: 1,
11
+ borderStyle: 'solid',
12
+ borderColor: '#FFF'
13
+ });
14
+ }
15
+ const cornerSizeFromVar = stylesHandler.getCSSVariableValue('cell-autofill-size');
16
+ const cornerBorderWidthFromVar = stylesHandler.getCSSVariableValue('cell-autofill-border-width');
17
+ const cornerColorFromVar = stylesHandler.getCSSVariableValue('cell-autofill-border-color');
18
+ return Object.freeze({
19
+ width: cornerSizeFromVar,
20
+ height: cornerSizeFromVar,
21
+ borderWidth: cornerBorderWidthFromVar,
22
+ borderStyle: 'solid',
23
+ borderColor: cornerColorFromVar
24
+ });
25
+ };
26
+ exports.getCornerStyle = getCornerStyle;
@@ -0,0 +1,22 @@
1
+ export const getCornerStyle = wot => {
2
+ const stylesHandler = wot.stylesHandler;
3
+ if (stylesHandler.isClassicTheme()) {
4
+ return Object.freeze({
5
+ width: 6,
6
+ height: 6,
7
+ borderWidth: 1,
8
+ borderStyle: 'solid',
9
+ borderColor: '#FFF'
10
+ });
11
+ }
12
+ const cornerSizeFromVar = stylesHandler.getCSSVariableValue('cell-autofill-size');
13
+ const cornerBorderWidthFromVar = stylesHandler.getCSSVariableValue('cell-autofill-border-width');
14
+ const cornerColorFromVar = stylesHandler.getCSSVariableValue('cell-autofill-border-color');
15
+ return Object.freeze({
16
+ width: cornerSizeFromVar,
17
+ height: cornerSizeFromVar,
18
+ borderWidth: cornerBorderWidthFromVar,
19
+ borderStyle: 'solid',
20
+ borderColor: cornerColorFromVar
21
+ });
22
+ };
@@ -16,12 +16,12 @@ Object.keys(_constants).forEach(function (key) {
16
16
  if (key in exports && exports[key] === _constants[key]) return;
17
17
  exports[key] = _constants[key];
18
18
  });
19
- var _constants2 = require("./border/constants");
20
- Object.keys(_constants2).forEach(function (key) {
19
+ var _utils = require("./border/utils");
20
+ Object.keys(_utils).forEach(function (key) {
21
21
  if (key === "default" || key === "__esModule") return;
22
22
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
23
- if (key in exports && exports[key] === _constants2[key]) return;
24
- exports[key] = _constants2[key];
23
+ if (key in exports && exports[key] === _utils[key]) return;
24
+ exports[key] = _utils[key];
25
25
  });
26
26
  var _manager = require("./manager");
27
27
  exports.SelectionManager = _manager.SelectionManager;
@@ -1,5 +1,5 @@
1
1
  import Selection from "./selection.mjs";
2
2
  export * from "./constants.mjs";
3
- export * from "./border/constants.mjs";
3
+ export * from "./border/utils.mjs";
4
4
  export { SelectionManager } from "./manager.mjs";
5
5
  export { Selection };
@@ -19,7 +19,6 @@ 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`.
@@ -185,7 +184,6 @@ class Settings {
185
184
  rowHeightByOverlayName() {
186
185
  // return undefined means use default size for the rendered cell content
187
186
  },
188
- defaultRowHeight: 23,
189
187
  defaultColumnWidth: 50,
190
188
  selections: null,
191
189
  hideBorderOnMouseDownOver: false,
@@ -16,7 +16,6 @@ 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`.
@@ -180,7 +179,6 @@ export default class Settings {
180
179
  rowHeightByOverlayName() {
181
180
  // return undefined means use default size for the rendered cell content
182
181
  },
183
- defaultRowHeight: 23,
184
182
  defaultColumnWidth: 50,
185
183
  selections: null,
186
184
  hideBorderOnMouseDownOver: false,
@@ -117,7 +117,8 @@ class Table {
117
117
  TBODY: this.TBODY,
118
118
  rowUtils: this.rowUtils,
119
119
  columnUtils: this.columnUtils,
120
- cellRenderer: this.wtSettings.getSettingPure('cellRenderer')
120
+ cellRenderer: this.wtSettings.getSettingPure('cellRenderer'),
121
+ stylesHandler: this.dataAccessObject.stylesHandler
121
122
  });
122
123
  }
123
124
 
@@ -353,7 +354,7 @@ class Table {
353
354
  markIfOversizedColumnHeader(col) {
354
355
  const sourceColIndex = this.columnFilter.renderedToSource(col);
355
356
  let level = this.wtSettings.getSetting('columnHeaders').length;
356
- const defaultRowHeight = this.wtSettings.getSetting('defaultRowHeight');
357
+ const defaultRowHeight = this.dataAccessObject.stylesHandler.getDefaultRowHeight();
357
358
  let previousColHeaderHeight;
358
359
  let currentHeader;
359
360
  let currentHeaderHeight;
@@ -631,10 +632,14 @@ class Table {
631
632
  return;
632
633
  }
633
634
  let rowCount = this.TBODY.childNodes.length;
634
- const expectedTableHeight = rowCount * this.wtSettings.getSetting('defaultRowHeight');
635
+ const expectedTableHeight = rowCount * this.dataAccessObject.stylesHandler.getDefaultRowHeight();
635
636
  const actualTableHeight = (0, _element.innerHeight)(this.TBODY) - 1;
637
+ const borderBoxSizing = this.wot.stylesHandler.areCellsBorderBox();
638
+ const rowHeightFn = borderBoxSizing ? _element.outerHeight : _element.innerHeight;
639
+ const borderCompensation = borderBoxSizing ? 0 : 1;
640
+ const firstRowBorderCompensation = borderBoxSizing ? 1 : 0;
636
641
  let previousRowHeight;
637
- let rowInnerHeight;
642
+ let rowCurrentHeight;
638
643
  let sourceRowIndex;
639
644
  let currentTr;
640
645
  let rowHeader;
@@ -648,14 +653,17 @@ class Table {
648
653
  previousRowHeight = this.getRowHeight(sourceRowIndex);
649
654
  currentTr = this.getTrForRow(sourceRowIndex);
650
655
  rowHeader = currentTr.querySelector('th');
656
+ const topBorderCompensation = sourceRowIndex === 0 ? firstRowBorderCompensation : 0;
651
657
  if (rowHeader) {
652
- rowInnerHeight = (0, _element.innerHeight)(rowHeader);
658
+ rowCurrentHeight = rowHeightFn(rowHeader);
653
659
  } else {
654
- rowInnerHeight = (0, _element.innerHeight)(currentTr) - 1;
660
+ rowCurrentHeight = rowHeightFn(currentTr) - borderCompensation;
655
661
  }
656
- if (!previousRowHeight && this.wtSettings.getSetting('defaultRowHeight') < rowInnerHeight || previousRowHeight < rowInnerHeight) {
657
- rowInnerHeight += 1;
658
- this.dataAccessObject.wtViewport.oversizedRows[sourceRowIndex] = rowInnerHeight;
662
+ if (!previousRowHeight && this.dataAccessObject.stylesHandler.getDefaultRowHeight() < rowCurrentHeight - topBorderCompensation || previousRowHeight < rowCurrentHeight) {
663
+ if (!borderBoxSizing) {
664
+ rowCurrentHeight += 1;
665
+ }
666
+ this.dataAccessObject.wtViewport.oversizedRows[sourceRowIndex] = rowCurrentHeight;
659
667
  }
660
668
  }
661
669
  }
@@ -113,7 +113,8 @@ class Table {
113
113
  TBODY: this.TBODY,
114
114
  rowUtils: this.rowUtils,
115
115
  columnUtils: this.columnUtils,
116
- cellRenderer: this.wtSettings.getSettingPure('cellRenderer')
116
+ cellRenderer: this.wtSettings.getSettingPure('cellRenderer'),
117
+ stylesHandler: this.dataAccessObject.stylesHandler
117
118
  });
118
119
  }
119
120
 
@@ -349,7 +350,7 @@ class Table {
349
350
  markIfOversizedColumnHeader(col) {
350
351
  const sourceColIndex = this.columnFilter.renderedToSource(col);
351
352
  let level = this.wtSettings.getSetting('columnHeaders').length;
352
- const defaultRowHeight = this.wtSettings.getSetting('defaultRowHeight');
353
+ const defaultRowHeight = this.dataAccessObject.stylesHandler.getDefaultRowHeight();
353
354
  let previousColHeaderHeight;
354
355
  let currentHeader;
355
356
  let currentHeaderHeight;
@@ -627,10 +628,14 @@ class Table {
627
628
  return;
628
629
  }
629
630
  let rowCount = this.TBODY.childNodes.length;
630
- const expectedTableHeight = rowCount * this.wtSettings.getSetting('defaultRowHeight');
631
+ const expectedTableHeight = rowCount * this.dataAccessObject.stylesHandler.getDefaultRowHeight();
631
632
  const actualTableHeight = innerHeight(this.TBODY) - 1;
633
+ const borderBoxSizing = this.wot.stylesHandler.areCellsBorderBox();
634
+ const rowHeightFn = borderBoxSizing ? outerHeight : innerHeight;
635
+ const borderCompensation = borderBoxSizing ? 0 : 1;
636
+ const firstRowBorderCompensation = borderBoxSizing ? 1 : 0;
632
637
  let previousRowHeight;
633
- let rowInnerHeight;
638
+ let rowCurrentHeight;
634
639
  let sourceRowIndex;
635
640
  let currentTr;
636
641
  let rowHeader;
@@ -644,14 +649,17 @@ class Table {
644
649
  previousRowHeight = this.getRowHeight(sourceRowIndex);
645
650
  currentTr = this.getTrForRow(sourceRowIndex);
646
651
  rowHeader = currentTr.querySelector('th');
652
+ const topBorderCompensation = sourceRowIndex === 0 ? firstRowBorderCompensation : 0;
647
653
  if (rowHeader) {
648
- rowInnerHeight = innerHeight(rowHeader);
654
+ rowCurrentHeight = rowHeightFn(rowHeader);
649
655
  } else {
650
- rowInnerHeight = innerHeight(currentTr) - 1;
656
+ rowCurrentHeight = rowHeightFn(currentTr) - borderCompensation;
651
657
  }
652
- if (!previousRowHeight && this.wtSettings.getSetting('defaultRowHeight') < rowInnerHeight || previousRowHeight < rowInnerHeight) {
653
- rowInnerHeight += 1;
654
- this.dataAccessObject.wtViewport.oversizedRows[sourceRowIndex] = rowInnerHeight;
658
+ if (!previousRowHeight && this.dataAccessObject.stylesHandler.getDefaultRowHeight() < rowCurrentHeight - topBorderCompensation || previousRowHeight < rowCurrentHeight) {
659
+ if (!borderBoxSizing) {
660
+ rowCurrentHeight += 1;
661
+ }
662
+ this.dataAccessObject.wtViewport.oversizedRows[sourceRowIndex] = rowCurrentHeight;
655
663
  }
656
664
  }
657
665
  }
@@ -66,6 +66,7 @@
66
66
  * @property {Walkontable} cloneSource CloneSource.
67
67
  * @property {Walkontable} wot Wot.
68
68
  * @property {number} parentTableOffset ParentTableOffset.
69
+ * @property {StylesHandler} stylesHandler StylesHandler.
69
70
  * @property {number|null} startColumnRendered StartColumnRendered.
70
71
  * @property {number|null} startColumnVisible StartColumnVisible.
71
72
  * @property {number|null} endColumnRendered EndColumnRendered.
@@ -66,6 +66,7 @@
66
66
  * @property {Walkontable} cloneSource CloneSource.
67
67
  * @property {Walkontable} wot Wot.
68
68
  * @property {number} parentTableOffset ParentTableOffset.
69
+ * @property {StylesHandler} stylesHandler StylesHandler.
69
70
  * @property {number|null} startColumnRendered StartColumnRendered.
70
71
  * @property {number|null} startColumnVisible StartColumnVisible.
71
72
  * @property {number|null} endColumnRendered EndColumnRendered.
@@ -50,7 +50,7 @@ class ColumnUtils {
50
50
  * @returns {number}
51
51
  */
52
52
  getHeaderHeight(level) {
53
- let height = this.wtSettings.getSetting('defaultRowHeight');
53
+ let height = this.dataAccessObject.stylesHandler.getDefaultRowHeight();
54
54
  const oversizedHeight = this.dataAccessObject.wtViewport.oversizedColumnHeaders[level];
55
55
  if (oversizedHeight !== undefined) {
56
56
  height = height ? Math.max(height, oversizedHeight) : oversizedHeight;
@@ -47,7 +47,7 @@ export default class ColumnUtils {
47
47
  * @returns {number}
48
48
  */
49
49
  getHeaderHeight(level) {
50
- let height = this.wtSettings.getSetting('defaultRowHeight');
50
+ let height = this.dataAccessObject.stylesHandler.getDefaultRowHeight();
51
51
  const oversizedHeight = this.dataAccessObject.wtViewport.oversizedColumnHeaders[level];
52
52
  if (oversizedHeight !== undefined) {
53
53
  height = height ? Math.max(height, oversizedHeight) : oversizedHeight;