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.
- package/3rdparty/walkontable/src/calculator/index.js +1 -2
- package/3rdparty/walkontable/src/calculator/index.mjs +2 -2
- package/3rdparty/walkontable/src/calculator/viewportRows.js +3 -3
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +3 -3
- package/3rdparty/walkontable/src/core/_base.js +3 -0
- package/3rdparty/walkontable/src/core/_base.mjs +3 -0
- package/3rdparty/walkontable/src/core/clone.js +1 -0
- package/3rdparty/walkontable/src/core/clone.mjs +1 -0
- package/3rdparty/walkontable/src/core/core.js +2 -0
- package/3rdparty/walkontable/src/core/core.mjs +2 -0
- package/3rdparty/walkontable/src/facade/core.js +3 -0
- package/3rdparty/walkontable/src/facade/core.mjs +3 -0
- package/3rdparty/walkontable/src/index.js +0 -1
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/_base.js +3 -1
- package/3rdparty/walkontable/src/overlay/_base.mjs +3 -1
- package/3rdparty/walkontable/src/overlay/bottom.js +6 -5
- package/3rdparty/walkontable/src/overlay/bottom.mjs +6 -5
- package/3rdparty/walkontable/src/overlay/inlineStart.js +7 -6
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +8 -7
- package/3rdparty/walkontable/src/overlay/top.js +9 -8
- package/3rdparty/walkontable/src/overlay/top.mjs +10 -9
- package/3rdparty/walkontable/src/overlays.js +20 -0
- package/3rdparty/walkontable/src/overlays.mjs +20 -0
- package/3rdparty/walkontable/src/renderer/index.js +4 -2
- package/3rdparty/walkontable/src/renderer/index.mjs +4 -2
- package/3rdparty/walkontable/src/renderer/table.js +12 -3
- package/3rdparty/walkontable/src/renderer/table.mjs +12 -3
- package/3rdparty/walkontable/src/selection/border/border.js +19 -13
- package/3rdparty/walkontable/src/selection/border/border.mjs +19 -13
- package/3rdparty/walkontable/src/selection/border/utils.js +26 -0
- package/3rdparty/walkontable/src/selection/border/utils.mjs +22 -0
- package/3rdparty/walkontable/src/selection/index.js +4 -4
- package/3rdparty/walkontable/src/selection/index.mjs +1 -1
- package/3rdparty/walkontable/src/settings.js +0 -2
- package/3rdparty/walkontable/src/settings.mjs +0 -2
- package/3rdparty/walkontable/src/table.js +17 -9
- package/3rdparty/walkontable/src/table.mjs +17 -9
- package/3rdparty/walkontable/src/types.js +1 -0
- package/3rdparty/walkontable/src/types.mjs +1 -0
- package/3rdparty/walkontable/src/utils/column.js +1 -1
- package/3rdparty/walkontable/src/utils/column.mjs +1 -1
- package/3rdparty/walkontable/src/utils/stylesHandler.js +295 -0
- package/3rdparty/walkontable/src/utils/stylesHandler.mjs +291 -0
- package/3rdparty/walkontable/src/viewport.js +1 -0
- package/3rdparty/walkontable/src/viewport.mjs +1 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/hooks/constants.js +9 -0
- package/core/hooks/constants.mjs +9 -0
- package/core/hooks/index.d.ts +1 -0
- package/core.d.ts +2 -0
- package/core.js +50 -1
- package/core.mjs +50 -1
- package/dataMap/metaManager/metaSchema.js +23 -3
- package/dataMap/metaManager/metaSchema.mjs +23 -3
- package/dist/handsontable.css +84 -72
- package/dist/handsontable.full.css +317 -304
- package/dist/handsontable.full.js +5923 -5741
- package/dist/handsontable.full.min.css +15 -10
- package/dist/handsontable.full.min.js +54 -53
- package/dist/handsontable.js +4372 -3958
- package/dist/handsontable.min.css +10 -6
- package/dist/handsontable.min.js +32 -32
- package/editors/autocompleteEditor/autocompleteEditor.js +1 -1
- package/editors/autocompleteEditor/autocompleteEditor.mjs +1 -1
- package/editors/baseEditor/baseEditor.js +1 -1
- package/editors/baseEditor/baseEditor.mjs +1 -1
- package/editors/dateEditor/dateEditor.js +9 -0
- package/editors/dateEditor/dateEditor.mjs +10 -1
- package/editors/handsontableEditor/handsontableEditor.js +7 -1
- package/editors/handsontableEditor/handsontableEditor.mjs +7 -1
- package/editors/selectEditor/selectEditor.js +20 -9
- package/editors/selectEditor/selectEditor.mjs +20 -9
- package/editors/textEditor/textEditor.js +4 -11
- package/editors/textEditor/textEditor.mjs +4 -11
- package/helpers/dom/element.js +32 -1
- package/helpers/dom/element.mjs +31 -1
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/themes.js +17 -0
- package/helpers/themes.mjs +13 -0
- package/package.json +12 -3
- package/plugins/comments/commentEditor.js +9 -0
- package/plugins/comments/commentEditor.mjs +9 -0
- package/plugins/comments/comments.js +14 -0
- package/plugins/comments/comments.mjs +15 -1
- package/plugins/contextMenu/menu/menu.js +9 -4
- package/plugins/contextMenu/menu/menu.mjs +9 -4
- package/plugins/filters/ui/multipleSelect.js +6 -0
- package/plugins/filters/ui/multipleSelect.mjs +6 -0
- package/plugins/manualRowMove/manualRowMove.js +1 -1
- package/plugins/manualRowMove/manualRowMove.mjs +1 -1
- package/plugins/manualRowResize/manualRowResize.js +1 -2
- package/plugins/manualRowResize/manualRowResize.mjs +2 -3
- package/plugins/mergeCells/mergeCells.js +1 -1
- package/plugins/mergeCells/mergeCells.mjs +1 -1
- package/plugins/nestedRows/ui/headers.js +7 -1
- package/plugins/nestedRows/ui/headers.mjs +7 -1
- package/plugins/stretchColumns/calculator.js +2 -1
- package/plugins/stretchColumns/calculator.mjs +3 -2
- package/settings.d.ts +1 -0
- package/styles/handsontable.css +2307 -0
- package/styles/handsontable.min.css +30 -0
- package/styles/ht-theme-horizon.css +607 -0
- package/styles/ht-theme-horizon.min.css +30 -0
- package/styles/ht-theme-main.css +613 -0
- package/styles/ht-theme-main.min.css +30 -0
- package/tableView.js +67 -0
- package/tableView.mjs +68 -1
- package/utils/autoResize.js +4 -1
- package/utils/autoResize.mjs +4 -1
- package/utils/ghostTable.js +5 -3
- package/utils/ghostTable.mjs +5 -3
- package/3rdparty/walkontable/src/selection/border/constants.js +0 -15
- 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 =
|
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 -
|
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 =
|
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 -
|
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
|
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 =
|
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
|
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 -
|
441
|
-
this.cornerStyle[inlinePosProperty] = `${inlineStartPos + width + this.cornerCenterPointOffset -
|
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
|
-
|
453
|
-
|
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 {
|
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 =
|
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
|
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 -
|
438
|
-
this.cornerStyle[inlinePosProperty] = `${inlineStartPos + width + this.cornerCenterPointOffset -
|
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
|
-
|
450
|
-
|
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
|
20
|
-
Object.keys(
|
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] ===
|
24
|
-
exports[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;
|
@@ -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.
|
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.
|
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
|
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
|
-
|
658
|
+
rowCurrentHeight = rowHeightFn(rowHeader);
|
653
659
|
} else {
|
654
|
-
|
660
|
+
rowCurrentHeight = rowHeightFn(currentTr) - borderCompensation;
|
655
661
|
}
|
656
|
-
if (!previousRowHeight && this.
|
657
|
-
|
658
|
-
|
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.
|
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.
|
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
|
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
|
-
|
654
|
+
rowCurrentHeight = rowHeightFn(rowHeader);
|
649
655
|
} else {
|
650
|
-
|
656
|
+
rowCurrentHeight = rowHeightFn(currentTr) - borderCompensation;
|
651
657
|
}
|
652
|
-
if (!previousRowHeight && this.
|
653
|
-
|
654
|
-
|
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.
|
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.
|
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;
|