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
@@ -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
|
11
|
-
export {
|
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
|
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
|
89
|
+
return this.defaultHeight;
|
90
90
|
}
|
91
91
|
return rowHeight;
|
92
92
|
}
|
@@ -301,6 +301,9 @@ export default class CoreAbstract {
|
|
301
301
|
get selectionManager() {
|
302
302
|
return wot.selectionManager; // TODO refactoring: move outside dao, use IOC
|
303
303
|
},
|
304
|
+
get stylesHandler() {
|
305
|
+
return wot.stylesHandler;
|
306
|
+
},
|
304
307
|
get drawn() {
|
305
308
|
return wot.drawn;
|
306
309
|
},
|
@@ -30,6 +30,7 @@ class Clone extends _base.default {
|
|
30
30
|
const facadeGetter = this.wtSettings.getSetting('facade', this);
|
31
31
|
this.cloneSource = clone.source;
|
32
32
|
this.cloneOverlay = clone.overlay;
|
33
|
+
this.stylesHandler = clone.stylesHandler;
|
33
34
|
this.wtTable = this.cloneOverlay.createTable(this.getTableDao(), facadeGetter, this.domBindings, this.wtSettings);
|
34
35
|
this.wtViewport = clone.viewport;
|
35
36
|
this.selectionManager = clone.selectionManager;
|
@@ -26,6 +26,7 @@ export default class Clone extends CoreAbstract {
|
|
26
26
|
const facadeGetter = this.wtSettings.getSetting('facade', this);
|
27
27
|
this.cloneSource = clone.source;
|
28
28
|
this.cloneOverlay = clone.overlay;
|
29
|
+
this.stylesHandler = clone.stylesHandler;
|
29
30
|
this.wtTable = this.cloneOverlay.createTable(this.getTableDao(), facadeGetter, this.domBindings, this.wtSettings);
|
30
31
|
this.wtViewport = clone.viewport;
|
31
32
|
this.selectionManager = clone.selectionManager;
|
@@ -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(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(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,
|
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 {
|
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 };
|
@@ -304,7 +304,9 @@ class Overlay {
|
|
304
304
|
// todo ioc , or factor func if used only here
|
305
305
|
event: this.wot.wtEvent,
|
306
306
|
// todo ioc , or factory func if used only here
|
307
|
-
selectionManager: this.wot.selectionManager
|
307
|
+
selectionManager: this.wot.selectionManager,
|
308
|
+
// todo ioc , or factory func if used only here
|
309
|
+
stylesHandler: this.wot.stylesHandler
|
308
310
|
});
|
309
311
|
}
|
310
312
|
|
@@ -300,7 +300,9 @@ export class Overlay {
|
|
300
300
|
// todo ioc , or factor func if used only here
|
301
301
|
event: this.wot.wtEvent,
|
302
302
|
// todo ioc , or factory func if used only here
|
303
|
-
selectionManager: this.wot.selectionManager
|
303
|
+
selectionManager: this.wot.selectionManager,
|
304
|
+
// todo ioc , or factory func if used only here
|
305
|
+
stylesHandler: this.wot.stylesHandler
|
304
306
|
});
|
305
307
|
}
|
306
308
|
|
@@ -144,9 +144,9 @@ class BottomOverlay extends _base.Overlay {
|
|
144
144
|
sumCellSizes(from, to) {
|
145
145
|
const {
|
146
146
|
wtTable,
|
147
|
-
|
147
|
+
stylesHandler
|
148
148
|
} = this.wot;
|
149
|
-
const defaultRowHeight =
|
149
|
+
const defaultRowHeight = stylesHandler.getDefaultRowHeight();
|
150
150
|
let row = from;
|
151
151
|
let sum = 0;
|
152
152
|
while (row < to) {
|
@@ -180,13 +180,14 @@ class BottomOverlay extends _base.Overlay {
|
|
180
180
|
rootDocument,
|
181
181
|
rootWindow
|
182
182
|
} = this.domBindings;
|
183
|
+
const scrollbarWidth = (0, _element.getScrollbarWidth)(rootDocument);
|
183
184
|
const overlayRoot = this.clone.wtTable.holder.parentNode;
|
184
185
|
const overlayRootStyle = overlayRoot.style;
|
185
186
|
const preventOverflow = this.wtSettings.getSetting('preventOverflow');
|
186
187
|
if (this.trimmingContainer !== rootWindow || preventOverflow === 'horizontal') {
|
187
188
|
let width = wtViewport.getWorkspaceWidth();
|
188
|
-
if (
|
189
|
-
width -=
|
189
|
+
if (this.wot.wtOverlays.hasScrollbarRight) {
|
190
|
+
width -= scrollbarWidth;
|
190
191
|
}
|
191
192
|
width = Math.min(width, wtTable.wtRootElement.scrollWidth);
|
192
193
|
overlayRootStyle.width = `${width}px`;
|
@@ -195,7 +196,7 @@ class BottomOverlay extends _base.Overlay {
|
|
195
196
|
}
|
196
197
|
this.clone.wtTable.holder.style.width = overlayRootStyle.width;
|
197
198
|
let tableHeight = (0, _element.outerHeight)(this.clone.wtTable.TABLE);
|
198
|
-
if (!wtTable.hasDefinedSize()) {
|
199
|
+
if (!this.wot.wtTable.hasDefinedSize()) {
|
199
200
|
tableHeight = 0;
|
200
201
|
}
|
201
202
|
overlayRootStyle.height = `${tableHeight}px`;
|
@@ -140,9 +140,9 @@ export class BottomOverlay extends Overlay {
|
|
140
140
|
sumCellSizes(from, to) {
|
141
141
|
const {
|
142
142
|
wtTable,
|
143
|
-
|
143
|
+
stylesHandler
|
144
144
|
} = this.wot;
|
145
|
-
const defaultRowHeight =
|
145
|
+
const defaultRowHeight = stylesHandler.getDefaultRowHeight();
|
146
146
|
let row = from;
|
147
147
|
let sum = 0;
|
148
148
|
while (row < to) {
|
@@ -176,13 +176,14 @@ export class BottomOverlay extends Overlay {
|
|
176
176
|
rootDocument,
|
177
177
|
rootWindow
|
178
178
|
} = this.domBindings;
|
179
|
+
const scrollbarWidth = getScrollbarWidth(rootDocument);
|
179
180
|
const overlayRoot = this.clone.wtTable.holder.parentNode;
|
180
181
|
const overlayRootStyle = overlayRoot.style;
|
181
182
|
const preventOverflow = this.wtSettings.getSetting('preventOverflow');
|
182
183
|
if (this.trimmingContainer !== rootWindow || preventOverflow === 'horizontal') {
|
183
184
|
let width = wtViewport.getWorkspaceWidth();
|
184
|
-
if (
|
185
|
-
width -=
|
185
|
+
if (this.wot.wtOverlays.hasScrollbarRight) {
|
186
|
+
width -= scrollbarWidth;
|
186
187
|
}
|
187
188
|
width = Math.min(width, wtTable.wtRootElement.scrollWidth);
|
188
189
|
overlayRootStyle.width = `${width}px`;
|
@@ -191,7 +192,7 @@ export class BottomOverlay extends Overlay {
|
|
191
192
|
}
|
192
193
|
this.clone.wtTable.holder.style.width = overlayRootStyle.width;
|
193
194
|
let tableHeight = outerHeight(this.clone.wtTable.TABLE);
|
194
|
-
if (!wtTable.hasDefinedSize()) {
|
195
|
+
if (!this.wot.wtTable.hasDefinedSize()) {
|
195
196
|
tableHeight = 0;
|
196
197
|
}
|
197
198
|
overlayRootStyle.height = `${tableHeight}px`;
|
@@ -141,20 +141,20 @@ class InlineStartOverlay extends _base.Overlay {
|
|
141
141
|
*/
|
142
142
|
adjustRootElementSize() {
|
143
143
|
const {
|
144
|
-
wtTable
|
145
|
-
wtViewport
|
144
|
+
wtTable
|
146
145
|
} = this.wot;
|
147
146
|
const {
|
148
147
|
rootDocument,
|
149
148
|
rootWindow
|
150
149
|
} = this.domBindings;
|
150
|
+
const scrollbarHeight = (0, _element.getScrollbarWidth)(rootDocument);
|
151
151
|
const overlayRoot = this.clone.wtTable.holder.parentNode;
|
152
152
|
const overlayRootStyle = overlayRoot.style;
|
153
153
|
const preventOverflow = this.wtSettings.getSetting('preventOverflow');
|
154
154
|
if (this.trimmingContainer !== rootWindow || preventOverflow === 'vertical') {
|
155
|
-
let height = wtViewport.getWorkspaceHeight();
|
156
|
-
if (
|
157
|
-
height -=
|
155
|
+
let height = this.wot.wtViewport.getWorkspaceHeight();
|
156
|
+
if (this.wot.wtOverlays.hasScrollbarBottom) {
|
157
|
+
height -= scrollbarHeight;
|
158
158
|
}
|
159
159
|
height = Math.min(height, wtTable.wtRootElement.scrollHeight);
|
160
160
|
overlayRootStyle.height = `${height}px`;
|
@@ -173,7 +173,8 @@ class InlineStartOverlay extends _base.Overlay {
|
|
173
173
|
const {
|
174
174
|
holder
|
175
175
|
} = this.clone.wtTable;
|
176
|
-
const
|
176
|
+
const cornerStyle = (0, _selection.getCornerStyle)(this.wot);
|
177
|
+
const selectionCornerOffset = this.wot.selectionManager.getFocusSelection() ? parseInt(cornerStyle.width, 10) / 2 : 0;
|
177
178
|
this.clone.wtTable.hider.style.height = this.hider.style.height;
|
178
179
|
holder.style.height = holder.parentNode.style.height;
|
179
180
|
// Add selection corner protruding part to the holder total width to make sure that
|
@@ -2,7 +2,7 @@ import "core-js/modules/es.error.cause.js";
|
|
2
2
|
import { addClass, getScrollbarWidth, getScrollLeft, getMaximumScrollLeft, getWindowScrollTop, hasClass, outerWidth, removeClass, setOverlayPosition, resetCssTransform } from "../../../../helpers/dom/element.mjs";
|
3
3
|
import InlineStartOverlayTable from "../table/inlineStart.mjs";
|
4
4
|
import { Overlay } from "./_base.mjs";
|
5
|
-
import {
|
5
|
+
import { getCornerStyle } from "../selection/index.mjs";
|
6
6
|
import { CLONE_INLINE_START } from "./constants.mjs";
|
7
7
|
/**
|
8
8
|
* @class InlineStartOverlay
|
@@ -137,20 +137,20 @@ export class InlineStartOverlay extends Overlay {
|
|
137
137
|
*/
|
138
138
|
adjustRootElementSize() {
|
139
139
|
const {
|
140
|
-
wtTable
|
141
|
-
wtViewport
|
140
|
+
wtTable
|
142
141
|
} = this.wot;
|
143
142
|
const {
|
144
143
|
rootDocument,
|
145
144
|
rootWindow
|
146
145
|
} = this.domBindings;
|
146
|
+
const scrollbarHeight = getScrollbarWidth(rootDocument);
|
147
147
|
const overlayRoot = this.clone.wtTable.holder.parentNode;
|
148
148
|
const overlayRootStyle = overlayRoot.style;
|
149
149
|
const preventOverflow = this.wtSettings.getSetting('preventOverflow');
|
150
150
|
if (this.trimmingContainer !== rootWindow || preventOverflow === 'vertical') {
|
151
|
-
let height = wtViewport.getWorkspaceHeight();
|
152
|
-
if (
|
153
|
-
height -=
|
151
|
+
let height = this.wot.wtViewport.getWorkspaceHeight();
|
152
|
+
if (this.wot.wtOverlays.hasScrollbarBottom) {
|
153
|
+
height -= scrollbarHeight;
|
154
154
|
}
|
155
155
|
height = Math.min(height, wtTable.wtRootElement.scrollHeight);
|
156
156
|
overlayRootStyle.height = `${height}px`;
|
@@ -169,7 +169,8 @@ export class InlineStartOverlay extends Overlay {
|
|
169
169
|
const {
|
170
170
|
holder
|
171
171
|
} = this.clone.wtTable;
|
172
|
-
const
|
172
|
+
const cornerStyle = getCornerStyle(this.wot);
|
173
|
+
const selectionCornerOffset = this.wot.selectionManager.getFocusSelection() ? parseInt(cornerStyle.width, 10) / 2 : 0;
|
173
174
|
this.clone.wtTable.hider.style.height = this.hider.style.height;
|
174
175
|
holder.style.height = holder.parentNode.style.height;
|
175
176
|
// Add selection corner protruding part to the holder total width to make sure that
|
@@ -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.
|
141
|
+
const defaultRowHeight = this.wot.stylesHandler.getDefaultRowHeight();
|
142
142
|
let row = from;
|
143
143
|
let sum = 0;
|
144
144
|
while (row < to) {
|
@@ -165,20 +165,20 @@ class TopOverlay extends _base.Overlay {
|
|
165
165
|
*/
|
166
166
|
adjustRootElementSize() {
|
167
167
|
const {
|
168
|
-
wtTable
|
169
|
-
wtViewport
|
168
|
+
wtTable
|
170
169
|
} = this.wot;
|
171
170
|
const {
|
172
171
|
rootDocument,
|
173
172
|
rootWindow
|
174
173
|
} = this.domBindings;
|
174
|
+
const scrollbarWidth = (0, _element.getScrollbarWidth)(rootDocument);
|
175
175
|
const overlayRoot = this.clone.wtTable.holder.parentNode;
|
176
176
|
const overlayRootStyle = overlayRoot.style;
|
177
177
|
const preventOverflow = this.wtSettings.getSetting('preventOverflow');
|
178
178
|
if (this.trimmingContainer !== rootWindow || preventOverflow === 'horizontal') {
|
179
|
-
let width = wtViewport.getWorkspaceWidth();
|
180
|
-
if (
|
181
|
-
width -=
|
179
|
+
let width = this.wot.wtViewport.getWorkspaceWidth();
|
180
|
+
if (this.wot.wtOverlays.hasScrollbarRight) {
|
181
|
+
width -= scrollbarWidth;
|
182
182
|
}
|
183
183
|
width = Math.min(width, wtTable.wtRootElement.scrollWidth);
|
184
184
|
overlayRootStyle.width = `${width}px`;
|
@@ -187,7 +187,7 @@ class TopOverlay extends _base.Overlay {
|
|
187
187
|
}
|
188
188
|
this.clone.wtTable.holder.style.width = overlayRootStyle.width;
|
189
189
|
let tableHeight = (0, _element.outerHeight)(this.clone.wtTable.TABLE);
|
190
|
-
if (!wtTable.hasDefinedSize()) {
|
190
|
+
if (!this.wot.wtTable.hasDefinedSize()) {
|
191
191
|
tableHeight = 0;
|
192
192
|
}
|
193
193
|
overlayRootStyle.height = `${tableHeight}px`;
|
@@ -200,7 +200,8 @@ class TopOverlay extends _base.Overlay {
|
|
200
200
|
const {
|
201
201
|
holder
|
202
202
|
} = this.clone.wtTable;
|
203
|
-
const
|
203
|
+
const cornerStyle = (0, _selection.getCornerStyle)(this.wot);
|
204
|
+
const selectionCornerOffset = this.wot.selectionManager.getFocusSelection() ? parseInt(cornerStyle.height, 10) / 2 : 0;
|
204
205
|
this.clone.wtTable.hider.style.width = this.hider.style.width;
|
205
206
|
holder.style.width = holder.parentNode.style.width;
|
206
207
|
// Add selection corner protruding part to the holder total height to make sure that
|
@@ -5,7 +5,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
5
5
|
import { addClass, getMaximumScrollTop, getScrollbarWidth, getScrollTop, getWindowScrollLeft, hasClass, outerHeight, removeClass, setOverlayPosition, resetCssTransform } from "../../../../helpers/dom/element.mjs";
|
6
6
|
import TopOverlayTable from "./../table/top.mjs";
|
7
7
|
import { Overlay } from "./_base.mjs";
|
8
|
-
import {
|
8
|
+
import { getCornerStyle } from "../selection/index.mjs";
|
9
9
|
import { CLONE_TOP } from "./constants.mjs";
|
10
10
|
/**
|
11
11
|
* @class TopOverlay
|
@@ -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.
|
137
|
+
const defaultRowHeight = this.wot.stylesHandler.getDefaultRowHeight();
|
138
138
|
let row = from;
|
139
139
|
let sum = 0;
|
140
140
|
while (row < to) {
|
@@ -161,20 +161,20 @@ export class TopOverlay extends Overlay {
|
|
161
161
|
*/
|
162
162
|
adjustRootElementSize() {
|
163
163
|
const {
|
164
|
-
wtTable
|
165
|
-
wtViewport
|
164
|
+
wtTable
|
166
165
|
} = this.wot;
|
167
166
|
const {
|
168
167
|
rootDocument,
|
169
168
|
rootWindow
|
170
169
|
} = this.domBindings;
|
170
|
+
const scrollbarWidth = getScrollbarWidth(rootDocument);
|
171
171
|
const overlayRoot = this.clone.wtTable.holder.parentNode;
|
172
172
|
const overlayRootStyle = overlayRoot.style;
|
173
173
|
const preventOverflow = this.wtSettings.getSetting('preventOverflow');
|
174
174
|
if (this.trimmingContainer !== rootWindow || preventOverflow === 'horizontal') {
|
175
|
-
let width = wtViewport.getWorkspaceWidth();
|
176
|
-
if (
|
177
|
-
width -=
|
175
|
+
let width = this.wot.wtViewport.getWorkspaceWidth();
|
176
|
+
if (this.wot.wtOverlays.hasScrollbarRight) {
|
177
|
+
width -= scrollbarWidth;
|
178
178
|
}
|
179
179
|
width = Math.min(width, wtTable.wtRootElement.scrollWidth);
|
180
180
|
overlayRootStyle.width = `${width}px`;
|
@@ -183,7 +183,7 @@ export class TopOverlay extends Overlay {
|
|
183
183
|
}
|
184
184
|
this.clone.wtTable.holder.style.width = overlayRootStyle.width;
|
185
185
|
let tableHeight = outerHeight(this.clone.wtTable.TABLE);
|
186
|
-
if (!wtTable.hasDefinedSize()) {
|
186
|
+
if (!this.wot.wtTable.hasDefinedSize()) {
|
187
187
|
tableHeight = 0;
|
188
188
|
}
|
189
189
|
overlayRootStyle.height = `${tableHeight}px`;
|
@@ -196,7 +196,8 @@ export class TopOverlay extends Overlay {
|
|
196
196
|
const {
|
197
197
|
holder
|
198
198
|
} = this.clone.wtTable;
|
199
|
-
const
|
199
|
+
const cornerStyle = getCornerStyle(this.wot);
|
200
|
+
const selectionCornerOffset = this.wot.selectionManager.getFocusSelection() ? parseInt(cornerStyle.height, 10) / 2 : 0;
|
200
201
|
this.clone.wtTable.hider.style.width = this.hider.style.width;
|
201
202
|
holder.style.width = holder.parentNode.style.width;
|
202
203
|
// Add selection corner protruding part to the holder total height to make sure that
|
@@ -166,6 +166,8 @@ class Overlays {
|
|
166
166
|
const isOverflowHidden = rootWindow.getComputedStyle(wtTable.wtRootElement.parentNode).getPropertyValue('overflow') === 'hidden';
|
167
167
|
this.scrollableElement = isOverflowHidden ? wtTable.holder : (0, _element.getScrollableElement)(wtTable.TABLE);
|
168
168
|
this.initOverlays();
|
169
|
+
this.hasScrollbarBottom = false;
|
170
|
+
this.hasScrollbarRight = false;
|
169
171
|
this.destroyed = false;
|
170
172
|
this.keyPressed = false;
|
171
173
|
this.spreaderLastSize = {
|
@@ -643,6 +645,24 @@ class Overlays {
|
|
643
645
|
// we need to adjust the hider dimensions by the header border size. (https://github.com/handsontable/dev-handsontable/issues/1772)
|
644
646
|
hiderStyle.width = `${proposedHiderWidth + rowHeaderBorderCompensation}px`;
|
645
647
|
hiderStyle.height = `${proposedHiderHeight + columnHeaderBorderCompensation}px`;
|
648
|
+
if (this.scrollbarSize > 0) {
|
649
|
+
// todo refactoring, looking as a part of logic which should be moved outside the class
|
650
|
+
const {
|
651
|
+
scrollHeight: rootElemScrollHeight,
|
652
|
+
scrollWidth: rootElemScrollWidth
|
653
|
+
} = wtTable.wtRootElement;
|
654
|
+
const {
|
655
|
+
scrollHeight: holderScrollHeight,
|
656
|
+
scrollWidth: holderScrollWidth
|
657
|
+
} = wtTable.holder;
|
658
|
+
this.hasScrollbarRight = rootElemScrollHeight < holderScrollHeight;
|
659
|
+
this.hasScrollbarBottom = rootElemScrollWidth < holderScrollWidth;
|
660
|
+
if (this.hasScrollbarRight && wtTable.hider.scrollWidth + this.scrollbarSize > rootElemScrollWidth) {
|
661
|
+
this.hasScrollbarBottom = true;
|
662
|
+
} else if (this.hasScrollbarBottom && wtTable.hider.scrollHeight + this.scrollbarSize > rootElemScrollHeight) {
|
663
|
+
this.hasScrollbarRight = true;
|
664
|
+
}
|
665
|
+
}
|
646
666
|
this.topOverlay.adjustElementsSize();
|
647
667
|
this.inlineStartOverlay.adjustElementsSize();
|
648
668
|
this.bottomOverlay.adjustElementsSize();
|
@@ -163,6 +163,8 @@ class Overlays {
|
|
163
163
|
const isOverflowHidden = rootWindow.getComputedStyle(wtTable.wtRootElement.parentNode).getPropertyValue('overflow') === 'hidden';
|
164
164
|
this.scrollableElement = isOverflowHidden ? wtTable.holder : getScrollableElement(wtTable.TABLE);
|
165
165
|
this.initOverlays();
|
166
|
+
this.hasScrollbarBottom = false;
|
167
|
+
this.hasScrollbarRight = false;
|
166
168
|
this.destroyed = false;
|
167
169
|
this.keyPressed = false;
|
168
170
|
this.spreaderLastSize = {
|
@@ -640,6 +642,24 @@ class Overlays {
|
|
640
642
|
// we need to adjust the hider dimensions by the header border size. (https://github.com/handsontable/dev-handsontable/issues/1772)
|
641
643
|
hiderStyle.width = `${proposedHiderWidth + rowHeaderBorderCompensation}px`;
|
642
644
|
hiderStyle.height = `${proposedHiderHeight + columnHeaderBorderCompensation}px`;
|
645
|
+
if (this.scrollbarSize > 0) {
|
646
|
+
// todo refactoring, looking as a part of logic which should be moved outside the class
|
647
|
+
const {
|
648
|
+
scrollHeight: rootElemScrollHeight,
|
649
|
+
scrollWidth: rootElemScrollWidth
|
650
|
+
} = wtTable.wtRootElement;
|
651
|
+
const {
|
652
|
+
scrollHeight: holderScrollHeight,
|
653
|
+
scrollWidth: holderScrollWidth
|
654
|
+
} = wtTable.holder;
|
655
|
+
this.hasScrollbarRight = rootElemScrollHeight < holderScrollHeight;
|
656
|
+
this.hasScrollbarBottom = rootElemScrollWidth < holderScrollWidth;
|
657
|
+
if (this.hasScrollbarRight && wtTable.hider.scrollWidth + this.scrollbarSize > rootElemScrollWidth) {
|
658
|
+
this.hasScrollbarBottom = true;
|
659
|
+
} else if (this.hasScrollbarBottom && wtTable.hider.scrollHeight + this.scrollbarSize > rootElemScrollHeight) {
|
660
|
+
this.hasScrollbarRight = true;
|
661
|
+
}
|
662
|
+
}
|
643
663
|
this.topOverlay.adjustElementsSize();
|
644
664
|
this.inlineStartOverlay.adjustElementsSize();
|
645
665
|
this.bottomOverlay.adjustElementsSize();
|
@@ -28,7 +28,8 @@ class Renderer {
|
|
28
28
|
TBODY,
|
29
29
|
rowUtils,
|
30
30
|
columnUtils,
|
31
|
-
cellRenderer
|
31
|
+
cellRenderer,
|
32
|
+
stylesHandler
|
32
33
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33
34
|
/**
|
34
35
|
* General renderer class used to render Walkontable content on screen.
|
@@ -36,7 +37,8 @@ class Renderer {
|
|
36
37
|
* @type {TableRenderer}
|
37
38
|
*/
|
38
39
|
this.renderer = new _table.default(TABLE, {
|
39
|
-
cellRenderer
|
40
|
+
cellRenderer,
|
41
|
+
stylesHandler
|
40
42
|
});
|
41
43
|
this.renderer.setRenderers({
|
42
44
|
rowHeaders: new _rowHeaders.default(),
|
@@ -18,7 +18,8 @@ class Renderer {
|
|
18
18
|
TBODY,
|
19
19
|
rowUtils,
|
20
20
|
columnUtils,
|
21
|
-
cellRenderer
|
21
|
+
cellRenderer,
|
22
|
+
stylesHandler
|
22
23
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
23
24
|
/**
|
24
25
|
* General renderer class used to render Walkontable content on screen.
|
@@ -26,7 +27,8 @@ class Renderer {
|
|
26
27
|
* @type {TableRenderer}
|
27
28
|
*/
|
28
29
|
this.renderer = new TableRenderer(TABLE, {
|
29
|
-
cellRenderer
|
30
|
+
cellRenderer,
|
31
|
+
stylesHandler
|
30
32
|
});
|
31
33
|
this.renderer.setRenderers({
|
32
34
|
rowHeaders: new RowHeadersRenderer(),
|