handsontable 0.0.0-next-fad35d5-20240924 → 0.0.0-next-ffdf116-20240926
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/calculationType/renderedColumns.js +0 -23
- package/3rdparty/walkontable/src/calculator/calculationType/renderedColumns.mjs +0 -23
- package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.js +0 -23
- package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.mjs +0 -23
- package/3rdparty/walkontable/src/core/_base.js +0 -7
- package/3rdparty/walkontable/src/core/_base.mjs +0 -7
- package/3rdparty/walkontable/src/facade/core.js +0 -3
- package/3rdparty/walkontable/src/facade/core.mjs +0 -3
- package/3rdparty/walkontable/src/overlay/_base.js +0 -3
- package/3rdparty/walkontable/src/overlay/_base.mjs +0 -3
- package/3rdparty/walkontable/src/selection/border/border.js +45 -33
- package/3rdparty/walkontable/src/selection/border/border.mjs +46 -34
- package/3rdparty/walkontable/src/selection/scanner.js +11 -46
- package/3rdparty/walkontable/src/selection/scanner.mjs +11 -46
- package/3rdparty/walkontable/src/settings.js +0 -8
- package/3rdparty/walkontable/src/settings.mjs +0 -8
- package/3rdparty/walkontable/src/table/master.js +1 -1
- package/3rdparty/walkontable/src/table/master.mjs +2 -2
- package/3rdparty/walkontable/src/table.js +3 -6
- package/3rdparty/walkontable/src/table.mjs +3 -6
- package/3rdparty/walkontable/src/viewport.js +4 -26
- package/3rdparty/walkontable/src/viewport.mjs +4 -26
- package/base.js +4 -4
- package/base.mjs +3 -3
- package/core.d.ts +1 -1
- package/core.js +12 -13
- package/core.mjs +4 -5
- package/dataMap/metaManager/metaSchema.js +2 -68
- package/dataMap/metaManager/metaSchema.mjs +2 -68
- package/dataMap/metaManager/mods/dynamicCellMeta.js +3 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +1 -1
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +2685 -3046
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +60 -60
- package/dist/handsontable.js +2687 -3048
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +18 -18
- package/editorManager.js +2 -2
- package/editorManager.mjs +2 -2
- package/editors/autocompleteEditor/autocompleteEditor.js +31 -14
- package/editors/autocompleteEditor/autocompleteEditor.mjs +31 -14
- package/editors/baseEditor/baseEditor.js +17 -24
- package/editors/baseEditor/baseEditor.mjs +18 -25
- package/editors/dropdownEditor/dropdownEditor.js +3 -2
- package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
- package/editors/handsontableEditor/handsontableEditor.js +24 -0
- package/editors/handsontableEditor/handsontableEditor.mjs +24 -0
- package/editors/registry.js +2 -2
- package/editors/registry.mjs +1 -1
- package/editors/textEditor/textEditor.js +2 -2
- package/editors/textEditor/textEditor.mjs +3 -3
- package/helpers/dom/element.js +4 -17
- package/helpers/dom/element.mjs +4 -16
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/index.d.ts +1 -2
- package/package.json +1 -1
- package/{core/hooks/index.d.ts → pluginHooks.d.ts} +21 -17
- package/{core/hooks/constants.mjs → pluginHooks.js} +489 -16
- package/{core/hooks/constants.js → pluginHooks.mjs} +486 -20
- package/plugins/autoColumnSize/autoColumnSize.js +27 -18
- package/plugins/autoColumnSize/autoColumnSize.mjs +27 -18
- package/plugins/autoRowSize/autoRowSize.js +22 -16
- package/plugins/autoRowSize/autoRowSize.mjs +23 -17
- package/plugins/autofill/autofill.js +5 -4
- package/plugins/autofill/autofill.mjs +1 -1
- package/plugins/base/base.d.ts +1 -1
- package/plugins/base/base.js +0 -39
- package/plugins/base/base.mjs +1 -40
- package/plugins/base/index.js +1 -2
- package/plugins/base/index.mjs +1 -1
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -2
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -2
- package/plugins/columnSorting/columnSorting.js +4 -3
- package/plugins/columnSorting/columnSorting.mjs +1 -1
- package/plugins/comments/comments.js +15 -7
- package/plugins/comments/comments.mjs +16 -8
- package/plugins/contextMenu/contextMenu.js +7 -6
- package/plugins/contextMenu/contextMenu.mjs +1 -1
- package/plugins/contextMenu/menu/menu.js +1 -1
- package/plugins/contextMenu/menu/menu.mjs +2 -2
- package/plugins/contextMenu/menu/positioner.js +4 -2
- package/plugins/contextMenu/menu/positioner.mjs +4 -2
- package/plugins/copyPaste/copyPaste.js +23 -29
- package/plugins/copyPaste/copyPaste.mjs +15 -21
- package/plugins/dropdownMenu/dropdownMenu.js +7 -6
- package/plugins/dropdownMenu/dropdownMenu.mjs +1 -1
- package/plugins/formulas/formulas.js +7 -7
- package/plugins/formulas/formulas.mjs +1 -1
- package/plugins/hiddenColumns/hiddenColumns.js +30 -19
- package/plugins/hiddenColumns/hiddenColumns.mjs +26 -15
- package/plugins/hiddenRows/hiddenRows.js +29 -18
- package/plugins/hiddenRows/hiddenRows.mjs +25 -14
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +5 -5
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +3 -3
- package/plugins/manualColumnMove/manualColumnMove.mjs +1 -1
- package/plugins/manualRowMove/manualRowMove.js +5 -5
- package/plugins/manualRowMove/manualRowMove.mjs +3 -3
- package/plugins/mergeCells/cellsCollection.js +3 -15
- package/plugins/mergeCells/cellsCollection.mjs +4 -16
- package/plugins/mergeCells/mergeCells.d.ts +2 -6
- package/plugins/mergeCells/mergeCells.js +55 -78
- package/plugins/mergeCells/mergeCells.mjs +53 -76
- package/plugins/mergeCells/renderer.js +3 -13
- package/plugins/mergeCells/renderer.mjs +3 -13
- package/plugins/persistentState/persistentState.js +4 -4
- package/plugins/persistentState/persistentState.mjs +1 -1
- package/plugins/undoRedo/undoRedo.js +5 -4
- package/plugins/undoRedo/undoRedo.mjs +3 -3
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/settings.d.ts +1 -3
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +1 -1
- package/shortcutContexts/commands/scrollToFocusedCell.js +4 -4
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +4 -4
- package/tableView.js +43 -38
- package/tableView.mjs +43 -38
- package/core/hooks/bucket.js +0 -180
- package/core/hooks/bucket.mjs +0 -176
- package/core/hooks/index.js +0 -385
- package/core/hooks/index.mjs +0 -381
@@ -1,30 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
5
4
|
var _partiallyVisibleColumns = require("./partiallyVisibleColumns");
|
6
|
-
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; }
|
7
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
8
|
-
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); }
|
9
5
|
/**
|
10
6
|
* @class RenderedColumnsCalculationType
|
11
7
|
*/
|
12
8
|
class RenderedColumnsCalculationType extends _partiallyVisibleColumns.PartiallyVisibleColumnsCalculationType {
|
13
|
-
constructor() {
|
14
|
-
super(...arguments);
|
15
|
-
/**
|
16
|
-
* The property holds the offset applied in the `overrideFn` function to the `startColumn` value.
|
17
|
-
*
|
18
|
-
* @type {number}
|
19
|
-
*/
|
20
|
-
_defineProperty(this, "columnStartOffset", 0);
|
21
|
-
/**
|
22
|
-
* The property holds the offset applied in the `overrideFn` function to the `endColumn` value.
|
23
|
-
*
|
24
|
-
* @type {number}
|
25
|
-
*/
|
26
|
-
_defineProperty(this, "columnEndOffset", 0);
|
27
|
-
}
|
28
9
|
/**
|
29
10
|
* Finalizes the calculation.
|
30
11
|
*
|
@@ -39,11 +20,7 @@ class RenderedColumnsCalculationType extends _partiallyVisibleColumns.PartiallyV
|
|
39
20
|
startPositions
|
40
21
|
} = viewportCalculator;
|
41
22
|
if (this.startColumn !== null && typeof overrideFn === 'function') {
|
42
|
-
const startColumn = this.startColumn;
|
43
|
-
const endColumn = this.endColumn;
|
44
23
|
overrideFn(this);
|
45
|
-
this.columnStartOffset = startColumn - this.startColumn;
|
46
|
-
this.columnEndOffset = this.endColumn - endColumn;
|
47
24
|
}
|
48
25
|
if (this.startColumn < 0) {
|
49
26
|
this.startColumn = 0;
|
@@ -1,27 +1,8 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
|
-
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; }
|
3
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
4
|
-
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); }
|
5
1
|
import { PartiallyVisibleColumnsCalculationType } from "./partiallyVisibleColumns.mjs";
|
6
2
|
/**
|
7
3
|
* @class RenderedColumnsCalculationType
|
8
4
|
*/
|
9
5
|
export class RenderedColumnsCalculationType extends PartiallyVisibleColumnsCalculationType {
|
10
|
-
constructor() {
|
11
|
-
super(...arguments);
|
12
|
-
/**
|
13
|
-
* The property holds the offset applied in the `overrideFn` function to the `startColumn` value.
|
14
|
-
*
|
15
|
-
* @type {number}
|
16
|
-
*/
|
17
|
-
_defineProperty(this, "columnStartOffset", 0);
|
18
|
-
/**
|
19
|
-
* The property holds the offset applied in the `overrideFn` function to the `endColumn` value.
|
20
|
-
*
|
21
|
-
* @type {number}
|
22
|
-
*/
|
23
|
-
_defineProperty(this, "columnEndOffset", 0);
|
24
|
-
}
|
25
6
|
/**
|
26
7
|
* Finalizes the calculation.
|
27
8
|
*
|
@@ -36,11 +17,7 @@ export class RenderedColumnsCalculationType extends PartiallyVisibleColumnsCalcu
|
|
36
17
|
startPositions
|
37
18
|
} = viewportCalculator;
|
38
19
|
if (this.startColumn !== null && typeof overrideFn === 'function') {
|
39
|
-
const startColumn = this.startColumn;
|
40
|
-
const endColumn = this.endColumn;
|
41
20
|
overrideFn(this);
|
42
|
-
this.columnStartOffset = startColumn - this.startColumn;
|
43
|
-
this.columnEndOffset = this.endColumn - endColumn;
|
44
21
|
}
|
45
22
|
if (this.startColumn < 0) {
|
46
23
|
this.startColumn = 0;
|
@@ -1,30 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
5
4
|
var _partiallyVisibleRows = require("./partiallyVisibleRows");
|
6
|
-
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; }
|
7
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
8
|
-
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); }
|
9
5
|
/**
|
10
6
|
* @class RenderedRowsCalculationType
|
11
7
|
*/
|
12
8
|
class RenderedRowsCalculationType extends _partiallyVisibleRows.PartiallyVisibleRowsCalculationType {
|
13
|
-
constructor() {
|
14
|
-
super(...arguments);
|
15
|
-
/**
|
16
|
-
* The property holds the offset applied in the `overrideFn` function to the `startColumn` value.
|
17
|
-
*
|
18
|
-
* @type {number}
|
19
|
-
*/
|
20
|
-
_defineProperty(this, "rowStartOffset", 0);
|
21
|
-
/**
|
22
|
-
* The property holds the offset applied in the `overrideFn` function to the `endColumn` value.
|
23
|
-
*
|
24
|
-
* @type {number}
|
25
|
-
*/
|
26
|
-
_defineProperty(this, "rowEndOffset", 0);
|
27
|
-
}
|
28
9
|
/**
|
29
10
|
* Finalizes the calculation.
|
30
11
|
*
|
@@ -39,11 +20,7 @@ class RenderedRowsCalculationType extends _partiallyVisibleRows.PartiallyVisible
|
|
39
20
|
startPositions
|
40
21
|
} = viewportCalculator;
|
41
22
|
if (this.startRow !== null && typeof overrideFn === 'function') {
|
42
|
-
const startRow = this.startRow;
|
43
|
-
const endRow = this.endRow;
|
44
23
|
overrideFn(this);
|
45
|
-
this.rowStartOffset = startRow - this.startRow;
|
46
|
-
this.rowEndOffset = this.endRow - endRow;
|
47
24
|
}
|
48
25
|
if (this.startRow < 0) {
|
49
26
|
this.startRow = 0;
|
@@ -1,27 +1,8 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
|
-
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; }
|
3
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
4
|
-
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); }
|
5
1
|
import { PartiallyVisibleRowsCalculationType } from "./partiallyVisibleRows.mjs";
|
6
2
|
/**
|
7
3
|
* @class RenderedRowsCalculationType
|
8
4
|
*/
|
9
5
|
export class RenderedRowsCalculationType extends PartiallyVisibleRowsCalculationType {
|
10
|
-
constructor() {
|
11
|
-
super(...arguments);
|
12
|
-
/**
|
13
|
-
* The property holds the offset applied in the `overrideFn` function to the `startColumn` value.
|
14
|
-
*
|
15
|
-
* @type {number}
|
16
|
-
*/
|
17
|
-
_defineProperty(this, "rowStartOffset", 0);
|
18
|
-
/**
|
19
|
-
* The property holds the offset applied in the `overrideFn` function to the `endColumn` value.
|
20
|
-
*
|
21
|
-
* @type {number}
|
22
|
-
*/
|
23
|
-
_defineProperty(this, "rowEndOffset", 0);
|
24
|
-
}
|
25
6
|
/**
|
26
7
|
* Finalizes the calculation.
|
27
8
|
*
|
@@ -36,11 +17,7 @@ export class RenderedRowsCalculationType extends PartiallyVisibleRowsCalculation
|
|
36
17
|
startPositions
|
37
18
|
} = viewportCalculator;
|
38
19
|
if (this.startRow !== null && typeof overrideFn === 'function') {
|
39
|
-
const startRow = this.startRow;
|
40
|
-
const endRow = this.endRow;
|
41
20
|
overrideFn(this);
|
42
|
-
this.rowStartOffset = startRow - this.startRow;
|
43
|
-
this.rowEndOffset = this.endRow - endRow;
|
44
21
|
}
|
45
22
|
if (this.startRow < 0) {
|
46
23
|
this.startRow = 0;
|
@@ -42,13 +42,6 @@ class CoreAbstract {
|
|
42
42
|
_defineProperty(this, "guid", `wt_${(0, _string.randomString)()}`);
|
43
43
|
_defineProperty(this, "drawInterrupted", false);
|
44
44
|
_defineProperty(this, "drawn", false);
|
45
|
-
/**
|
46
|
-
* The name of the overlay that currently renders the table.
|
47
|
-
*
|
48
|
-
* @public
|
49
|
-
* @type {string}
|
50
|
-
*/
|
51
|
-
_defineProperty(this, "activeOverlayName", 'master');
|
52
45
|
/**
|
53
46
|
* The DOM bindings.
|
54
47
|
*
|
@@ -38,13 +38,6 @@ export default class CoreAbstract {
|
|
38
38
|
_defineProperty(this, "guid", `wt_${randomString()}`);
|
39
39
|
_defineProperty(this, "drawInterrupted", false);
|
40
40
|
_defineProperty(this, "drawn", false);
|
41
|
-
/**
|
42
|
-
* The name of the overlay that currently renders the table.
|
43
|
-
*
|
44
|
-
* @public
|
45
|
-
* @type {string}
|
46
|
-
*/
|
47
|
-
_defineProperty(this, "activeOverlayName", 'master');
|
48
41
|
/**
|
49
42
|
* The DOM bindings.
|
50
43
|
*
|
@@ -316,10 +316,7 @@ class Overlay {
|
|
316
316
|
refresh() {
|
317
317
|
let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
318
318
|
if (this.needFullRender) {
|
319
|
-
const cloneSource = this.clone.cloneSource;
|
320
|
-
cloneSource.activeOverlayName = this.clone.wtTable.name;
|
321
319
|
this.clone.draw(fastDraw);
|
322
|
-
cloneSource.activeOverlayName = 'master';
|
323
320
|
}
|
324
321
|
}
|
325
322
|
|
@@ -312,10 +312,7 @@ export class Overlay {
|
|
312
312
|
refresh() {
|
313
313
|
let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
314
314
|
if (this.needFullRender) {
|
315
|
-
const cloneSource = this.clone.cloneSource;
|
316
|
-
cloneSource.activeOverlayName = this.clone.wtTable.name;
|
317
315
|
this.clone.draw(fastDraw);
|
318
|
-
cloneSource.activeOverlayName = 'master';
|
319
316
|
}
|
320
317
|
}
|
321
318
|
|
@@ -322,52 +322,66 @@ class Border {
|
|
322
322
|
if (this.disabled) {
|
323
323
|
return;
|
324
324
|
}
|
325
|
-
let [fromRow, fromColumn, toRow, toColumn] = corners;
|
326
|
-
|
327
|
-
// borders can not be rendered on headers so hide them
|
328
|
-
if (fromRow < 0 && toRow < 0 || fromColumn < 0 && toColumn < 0) {
|
329
|
-
this.disappear();
|
330
|
-
return;
|
331
|
-
}
|
332
325
|
const {
|
333
326
|
wtTable,
|
334
327
|
rootDocument,
|
335
328
|
rootWindow
|
336
|
-
} = this.wot;
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
let
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
return;
|
329
|
+
} = this.wot; // todo refactoring: consider about using internal facade (it is given by external code)
|
330
|
+
let fromRow;
|
331
|
+
let toRow;
|
332
|
+
let fromColumn;
|
333
|
+
let toColumn;
|
334
|
+
let rowHeader;
|
335
|
+
let columnHeader;
|
336
|
+
const rowsCount = wtTable.getRenderedRowsCount();
|
337
|
+
for (let i = 0; i < rowsCount; i += 1) {
|
338
|
+
const s = wtTable.rowFilter.renderedToSource(i);
|
339
|
+
if (s >= corners[0] && s <= corners[2]) {
|
340
|
+
fromRow = s;
|
341
|
+
rowHeader = corners[0];
|
342
|
+
break;
|
351
343
|
}
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
if (
|
356
|
-
|
357
|
-
|
344
|
+
}
|
345
|
+
for (let i = rowsCount - 1; i >= 0; i -= 1) {
|
346
|
+
const s = wtTable.rowFilter.renderedToSource(i);
|
347
|
+
if (s >= corners[0] && s <= corners[2]) {
|
348
|
+
toRow = s;
|
349
|
+
break;
|
358
350
|
}
|
359
351
|
}
|
352
|
+
const columnsCount = wtTable.getRenderedColumnsCount();
|
353
|
+
for (let i = 0; i < columnsCount; i += 1) {
|
354
|
+
const s = wtTable.columnFilter.renderedToSource(i);
|
355
|
+
if (s >= corners[1] && s <= corners[3]) {
|
356
|
+
fromColumn = s;
|
357
|
+
columnHeader = corners[1];
|
358
|
+
break;
|
359
|
+
}
|
360
|
+
}
|
361
|
+
for (let i = columnsCount - 1; i >= 0; i -= 1) {
|
362
|
+
const s = wtTable.columnFilter.renderedToSource(i);
|
363
|
+
if (s >= corners[1] && s <= corners[3]) {
|
364
|
+
toColumn = s;
|
365
|
+
break;
|
366
|
+
}
|
367
|
+
}
|
368
|
+
if (fromRow === undefined || fromColumn === undefined) {
|
369
|
+
this.disappear();
|
370
|
+
return;
|
371
|
+
}
|
372
|
+
let fromTD = wtTable.getCell(this.wot.createCellCoords(fromRow, fromColumn));
|
373
|
+
const isMultiple = fromRow !== toRow || fromColumn !== toColumn;
|
360
374
|
const toTD = isMultiple ? wtTable.getCell(this.wot.createCellCoords(toRow, toColumn)) : fromTD;
|
361
375
|
const fromOffset = (0, _element.offset)(fromTD);
|
362
376
|
const toOffset = isMultiple ? (0, _element.offset)(toTD) : fromOffset;
|
363
377
|
const containerOffset = (0, _element.offset)(wtTable.TABLE);
|
378
|
+
const containerWidth = (0, _element.outerWidth)(wtTable.TABLE);
|
364
379
|
const minTop = fromOffset.top;
|
365
380
|
const minLeft = fromOffset.left;
|
366
381
|
const isRtl = this.wot.wtSettings.getSetting('rtlMode');
|
367
382
|
let inlineStartPos = 0;
|
368
383
|
let width = 0;
|
369
384
|
if (isRtl) {
|
370
|
-
const containerWidth = (0, _element.outerWidth)(wtTable.TABLE);
|
371
385
|
const fromWidth = (0, _element.outerWidth)(fromTD);
|
372
386
|
const gridRightPos = rootWindow.innerWidth - containerOffset.left - containerWidth;
|
373
387
|
width = minLeft + fromWidth - toOffset.left;
|
@@ -377,7 +391,6 @@ class Border {
|
|
377
391
|
inlineStartPos = minLeft - containerOffset.left - 1;
|
378
392
|
}
|
379
393
|
if (this.isEntireColumnSelected(fromRow, toRow)) {
|
380
|
-
const rowHeader = fromRow;
|
381
394
|
const modifiedValues = this.getDimensionsFromHeader('columns', fromColumn, toColumn, rowHeader, containerOffset);
|
382
395
|
let fromTH = null;
|
383
396
|
if (modifiedValues) {
|
@@ -390,7 +403,6 @@ class Border {
|
|
390
403
|
let top = minTop - containerOffset.top - 1;
|
391
404
|
let height = toOffset.top + (0, _element.outerHeight)(toTD) - minTop;
|
392
405
|
if (this.isEntireRowSelected(fromColumn, toColumn)) {
|
393
|
-
const columnHeader = fromColumn;
|
394
406
|
const modifiedValues = this.getDimensionsFromHeader('rows', fromRow, toRow, columnHeader, containerOffset);
|
395
407
|
let fromTH = null;
|
396
408
|
if (modifiedValues) {
|
@@ -400,7 +412,7 @@ class Border {
|
|
400
412
|
fromTD = fromTH;
|
401
413
|
}
|
402
414
|
}
|
403
|
-
const style =
|
415
|
+
const style = rootWindow.getComputedStyle(fromTD);
|
404
416
|
if (parseInt(style.borderTopWidth, 10) > 0) {
|
405
417
|
top += 1;
|
406
418
|
height = height > 0 ? height - 1 : 0;
|
@@ -429,7 +441,7 @@ class Border {
|
|
429
441
|
this.endStyle.display = 'block';
|
430
442
|
let cornerVisibleSetting = this.settings.border.cornerVisible;
|
431
443
|
cornerVisibleSetting = typeof cornerVisibleSetting === 'function' ? cornerVisibleSetting(this.settings.layerLevel) : cornerVisibleSetting;
|
432
|
-
const hookResult = this.wot.getSetting('onModifyGetCellCoords', toRow, toColumn
|
444
|
+
const hookResult = this.wot.getSetting('onModifyGetCellCoords', toRow, toColumn);
|
433
445
|
let [checkRow, checkCol] = [toRow, toColumn];
|
434
446
|
if (hookResult && Array.isArray(hookResult)) {
|
435
447
|
[,, checkRow, checkCol] = hookResult;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { addClass, hasClass, removeClass,
|
1
|
+
import { addClass, hasClass, removeClass, getTrimmingContainer, innerWidth, innerHeight, offset, outerHeight, outerWidth } from "../../../../../helpers/dom/element.mjs";
|
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";
|
@@ -319,52 +319,66 @@ class Border {
|
|
319
319
|
if (this.disabled) {
|
320
320
|
return;
|
321
321
|
}
|
322
|
-
let [fromRow, fromColumn, toRow, toColumn] = corners;
|
323
|
-
|
324
|
-
// borders can not be rendered on headers so hide them
|
325
|
-
if (fromRow < 0 && toRow < 0 || fromColumn < 0 && toColumn < 0) {
|
326
|
-
this.disappear();
|
327
|
-
return;
|
328
|
-
}
|
329
322
|
const {
|
330
323
|
wtTable,
|
331
324
|
rootDocument,
|
332
325
|
rootWindow
|
333
|
-
} = this.wot;
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
let
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
return;
|
326
|
+
} = this.wot; // todo refactoring: consider about using internal facade (it is given by external code)
|
327
|
+
let fromRow;
|
328
|
+
let toRow;
|
329
|
+
let fromColumn;
|
330
|
+
let toColumn;
|
331
|
+
let rowHeader;
|
332
|
+
let columnHeader;
|
333
|
+
const rowsCount = wtTable.getRenderedRowsCount();
|
334
|
+
for (let i = 0; i < rowsCount; i += 1) {
|
335
|
+
const s = wtTable.rowFilter.renderedToSource(i);
|
336
|
+
if (s >= corners[0] && s <= corners[2]) {
|
337
|
+
fromRow = s;
|
338
|
+
rowHeader = corners[0];
|
339
|
+
break;
|
348
340
|
}
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
if (
|
353
|
-
|
354
|
-
|
341
|
+
}
|
342
|
+
for (let i = rowsCount - 1; i >= 0; i -= 1) {
|
343
|
+
const s = wtTable.rowFilter.renderedToSource(i);
|
344
|
+
if (s >= corners[0] && s <= corners[2]) {
|
345
|
+
toRow = s;
|
346
|
+
break;
|
355
347
|
}
|
356
348
|
}
|
349
|
+
const columnsCount = wtTable.getRenderedColumnsCount();
|
350
|
+
for (let i = 0; i < columnsCount; i += 1) {
|
351
|
+
const s = wtTable.columnFilter.renderedToSource(i);
|
352
|
+
if (s >= corners[1] && s <= corners[3]) {
|
353
|
+
fromColumn = s;
|
354
|
+
columnHeader = corners[1];
|
355
|
+
break;
|
356
|
+
}
|
357
|
+
}
|
358
|
+
for (let i = columnsCount - 1; i >= 0; i -= 1) {
|
359
|
+
const s = wtTable.columnFilter.renderedToSource(i);
|
360
|
+
if (s >= corners[1] && s <= corners[3]) {
|
361
|
+
toColumn = s;
|
362
|
+
break;
|
363
|
+
}
|
364
|
+
}
|
365
|
+
if (fromRow === undefined || fromColumn === undefined) {
|
366
|
+
this.disappear();
|
367
|
+
return;
|
368
|
+
}
|
369
|
+
let fromTD = wtTable.getCell(this.wot.createCellCoords(fromRow, fromColumn));
|
370
|
+
const isMultiple = fromRow !== toRow || fromColumn !== toColumn;
|
357
371
|
const toTD = isMultiple ? wtTable.getCell(this.wot.createCellCoords(toRow, toColumn)) : fromTD;
|
358
372
|
const fromOffset = offset(fromTD);
|
359
373
|
const toOffset = isMultiple ? offset(toTD) : fromOffset;
|
360
374
|
const containerOffset = offset(wtTable.TABLE);
|
375
|
+
const containerWidth = outerWidth(wtTable.TABLE);
|
361
376
|
const minTop = fromOffset.top;
|
362
377
|
const minLeft = fromOffset.left;
|
363
378
|
const isRtl = this.wot.wtSettings.getSetting('rtlMode');
|
364
379
|
let inlineStartPos = 0;
|
365
380
|
let width = 0;
|
366
381
|
if (isRtl) {
|
367
|
-
const containerWidth = outerWidth(wtTable.TABLE);
|
368
382
|
const fromWidth = outerWidth(fromTD);
|
369
383
|
const gridRightPos = rootWindow.innerWidth - containerOffset.left - containerWidth;
|
370
384
|
width = minLeft + fromWidth - toOffset.left;
|
@@ -374,7 +388,6 @@ class Border {
|
|
374
388
|
inlineStartPos = minLeft - containerOffset.left - 1;
|
375
389
|
}
|
376
390
|
if (this.isEntireColumnSelected(fromRow, toRow)) {
|
377
|
-
const rowHeader = fromRow;
|
378
391
|
const modifiedValues = this.getDimensionsFromHeader('columns', fromColumn, toColumn, rowHeader, containerOffset);
|
379
392
|
let fromTH = null;
|
380
393
|
if (modifiedValues) {
|
@@ -387,7 +400,6 @@ class Border {
|
|
387
400
|
let top = minTop - containerOffset.top - 1;
|
388
401
|
let height = toOffset.top + outerHeight(toTD) - minTop;
|
389
402
|
if (this.isEntireRowSelected(fromColumn, toColumn)) {
|
390
|
-
const columnHeader = fromColumn;
|
391
403
|
const modifiedValues = this.getDimensionsFromHeader('rows', fromRow, toRow, columnHeader, containerOffset);
|
392
404
|
let fromTH = null;
|
393
405
|
if (modifiedValues) {
|
@@ -397,7 +409,7 @@ class Border {
|
|
397
409
|
fromTD = fromTH;
|
398
410
|
}
|
399
411
|
}
|
400
|
-
const style = getComputedStyle(fromTD
|
412
|
+
const style = rootWindow.getComputedStyle(fromTD);
|
401
413
|
if (parseInt(style.borderTopWidth, 10) > 0) {
|
402
414
|
top += 1;
|
403
415
|
height = height > 0 ? height - 1 : 0;
|
@@ -426,7 +438,7 @@ class Border {
|
|
426
438
|
this.endStyle.display = 'block';
|
427
439
|
let cornerVisibleSetting = this.settings.border.cornerVisible;
|
428
440
|
cornerVisibleSetting = typeof cornerVisibleSetting === 'function' ? cornerVisibleSetting(this.settings.layerLevel) : cornerVisibleSetting;
|
429
|
-
const hookResult = this.wot.getSetting('onModifyGetCellCoords', toRow, toColumn
|
441
|
+
const hookResult = this.wot.getSetting('onModifyGetCellCoords', toRow, toColumn);
|
430
442
|
let [checkRow, checkCol] = [toRow, toColumn];
|
431
443
|
if (hookResult && Array.isArray(hookResult)) {
|
432
444
|
[,, checkRow, checkCol] = hookResult;
|
@@ -195,18 +195,21 @@ class SelectionScanner {
|
|
195
195
|
* @param {function(HTMLTableElement): void} callback The callback function to trigger.
|
196
196
|
*/
|
197
197
|
scanCellsRange(callback) {
|
198
|
+
const [topRow, topColumn, bottomRow, bottomColumn] = _classPrivateFieldGet(_selection, this).getCorners();
|
198
199
|
const {
|
199
200
|
wtTable
|
200
201
|
} = _classPrivateFieldGet(_activeOverlaysWot, this);
|
201
202
|
_assertClassBrand(_SelectionScanner_brand, this, _scanCellsRange).call(this, (sourceRow, sourceColumn) => {
|
202
|
-
|
203
|
+
if (sourceRow >= topRow && sourceRow <= bottomRow && sourceColumn >= topColumn && sourceColumn <= bottomColumn) {
|
204
|
+
const cell = wtTable.getCell(_classPrivateFieldGet(_activeOverlaysWot, this).createCellCoords(sourceRow, sourceColumn));
|
203
205
|
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
206
|
+
// support for old API
|
207
|
+
const additionalSelectionClass = _classPrivateFieldGet(_activeOverlaysWot, this).getSetting('onAfterDrawSelection', sourceRow, sourceColumn, _classPrivateFieldGet(_selection, this).settings.layerLevel);
|
208
|
+
if (typeof additionalSelectionClass === 'string') {
|
209
|
+
(0, _element.addClass)(cell, additionalSelectionClass);
|
210
|
+
}
|
211
|
+
callback(cell);
|
208
212
|
}
|
209
|
-
callback(cell);
|
210
213
|
});
|
211
214
|
}
|
212
215
|
|
@@ -222,7 +225,7 @@ class SelectionScanner {
|
|
222
225
|
const {
|
223
226
|
wtTable
|
224
227
|
} = _classPrivateFieldGet(_activeOverlaysWot, this);
|
225
|
-
_assertClassBrand(_SelectionScanner_brand, this,
|
228
|
+
_assertClassBrand(_SelectionScanner_brand, this, _scanCellsRange).call(this, (sourceRow, sourceColumn) => {
|
226
229
|
if (sourceRow >= topRow && sourceRow <= bottomRow) {
|
227
230
|
const cell = wtTable.getCell(_classPrivateFieldGet(_activeOverlaysWot, this).createCellCoords(sourceRow, sourceColumn));
|
228
231
|
callback(cell);
|
@@ -241,7 +244,7 @@ class SelectionScanner {
|
|
241
244
|
const {
|
242
245
|
wtTable
|
243
246
|
} = _classPrivateFieldGet(_activeOverlaysWot, this);
|
244
|
-
_assertClassBrand(_SelectionScanner_brand, this,
|
247
|
+
_assertClassBrand(_SelectionScanner_brand, this, _scanCellsRange).call(this, (sourceRow, sourceColumn) => {
|
245
248
|
if (sourceColumn >= topColumn && sourceColumn <= bottomColumn) {
|
246
249
|
const cell = wtTable.getCell(_classPrivateFieldGet(_activeOverlaysWot, this).createCellCoords(sourceRow, sourceColumn));
|
247
250
|
callback(cell);
|
@@ -251,44 +254,6 @@ class SelectionScanner {
|
|
251
254
|
}
|
252
255
|
exports.SelectionScanner = SelectionScanner;
|
253
256
|
function _scanCellsRange(callback) {
|
254
|
-
let [topRow, startColumn, bottomRow, endColumn] = _classPrivateFieldGet(_selection, this).getCorners();
|
255
|
-
if (topRow < 0 && bottomRow < 0 || startColumn < 0 && endColumn < 0) {
|
256
|
-
return;
|
257
|
-
}
|
258
|
-
const {
|
259
|
-
wtTable
|
260
|
-
} = _classPrivateFieldGet(_activeOverlaysWot, this);
|
261
|
-
const isMultiple = topRow !== bottomRow || startColumn !== endColumn;
|
262
|
-
startColumn = Math.max(startColumn, 0);
|
263
|
-
endColumn = Math.max(endColumn, 0);
|
264
|
-
topRow = Math.max(topRow, 0);
|
265
|
-
bottomRow = Math.max(bottomRow, 0);
|
266
|
-
if (isMultiple) {
|
267
|
-
startColumn = Math.max(startColumn, wtTable.getFirstRenderedColumn());
|
268
|
-
endColumn = Math.min(endColumn, wtTable.getLastRenderedColumn());
|
269
|
-
topRow = Math.max(topRow, wtTable.getFirstRenderedRow());
|
270
|
-
bottomRow = Math.min(bottomRow, wtTable.getLastRenderedRow());
|
271
|
-
if (endColumn < startColumn || bottomRow < topRow) {
|
272
|
-
return;
|
273
|
-
}
|
274
|
-
} else {
|
275
|
-
const cell = wtTable.getCell(_classPrivateFieldGet(_activeOverlaysWot, this).createCellCoords(topRow, startColumn));
|
276
|
-
if (!(cell instanceof HTMLElement)) {
|
277
|
-
return;
|
278
|
-
}
|
279
|
-
}
|
280
|
-
for (let row = topRow; row <= bottomRow; row += 1) {
|
281
|
-
for (let column = startColumn; column <= endColumn; column += 1) {
|
282
|
-
callback(row, column);
|
283
|
-
}
|
284
|
-
}
|
285
|
-
}
|
286
|
-
/**
|
287
|
-
* The method triggers a callback for each rendered cell including headers.
|
288
|
-
*
|
289
|
-
* @param {function(number, number): void} callback The callback function to trigger.
|
290
|
-
*/
|
291
|
-
function _scanViewportRange(callback) {
|
292
257
|
const {
|
293
258
|
wtTable
|
294
259
|
} = _classPrivateFieldGet(_activeOverlaysWot, this);
|