handsontable 0.0.0-next-5e7f0fe-20230504 → 0.0.0-next-48677e7-20230509
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/cell/coords.js +40 -13
- package/3rdparty/walkontable/src/cell/coords.mjs +40 -13
- package/3rdparty/walkontable/src/cell/range.js +29 -25
- package/3rdparty/walkontable/src/cell/range.mjs +28 -24
- package/3rdparty/walkontable/src/core/_base.js +9 -3
- package/3rdparty/walkontable/src/core/_base.mjs +9 -3
- package/3rdparty/walkontable/src/core/clone.js +2 -2
- package/3rdparty/walkontable/src/core/clone.mjs +2 -2
- package/3rdparty/walkontable/src/core/core.js +3 -2
- package/3rdparty/walkontable/src/core/core.mjs +3 -2
- package/3rdparty/walkontable/src/event.js +12 -10
- package/3rdparty/walkontable/src/event.mjs +12 -10
- package/3rdparty/walkontable/src/facade/core.js +2 -2
- package/3rdparty/walkontable/src/facade/core.mjs +2 -2
- package/3rdparty/walkontable/src/index.js +10 -2
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/_base.js +8 -7
- package/3rdparty/walkontable/src/overlay/_base.mjs +8 -7
- package/3rdparty/walkontable/src/overlay/bottom.js +7 -6
- package/3rdparty/walkontable/src/overlay/bottom.mjs +7 -6
- package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -4
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -4
- package/3rdparty/walkontable/src/overlay/top.js +9 -10
- package/3rdparty/walkontable/src/overlay/top.mjs +9 -10
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +12 -10
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +12 -10
- package/3rdparty/walkontable/src/overlays.js +64 -55
- package/3rdparty/walkontable/src/overlays.mjs +64 -55
- package/3rdparty/walkontable/src/renderer/table.js +2 -0
- package/3rdparty/walkontable/src/renderer/table.mjs +2 -0
- package/3rdparty/walkontable/src/scroll.js +23 -20
- package/3rdparty/walkontable/src/scroll.mjs +23 -20
- package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
- package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
- package/3rdparty/walkontable/src/selection/border/constants.js +18 -0
- package/3rdparty/walkontable/src/selection/border/constants.mjs +13 -0
- package/3rdparty/walkontable/src/selection/constants.js +63 -0
- package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
- package/3rdparty/walkontable/src/selection/index.js +30 -0
- package/3rdparty/walkontable/src/selection/index.mjs +5 -0
- package/3rdparty/walkontable/src/selection/manager.js +334 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +328 -0
- package/3rdparty/walkontable/src/selection/scanner.js +363 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +359 -0
- package/3rdparty/walkontable/src/selection/selection.js +133 -0
- package/3rdparty/walkontable/src/selection/selection.mjs +127 -0
- package/3rdparty/walkontable/src/settings.js +15 -13
- package/3rdparty/walkontable/src/settings.mjs +15 -13
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
- package/3rdparty/walkontable/src/table.js +33 -101
- package/3rdparty/walkontable/src/table.mjs +34 -102
- package/base.js +4 -2
- package/base.mjs +2 -2
- package/core.d.ts +4 -0
- package/core.js +49 -8
- package/core.mjs +49 -8
- package/dataMap/dataSource.js +5 -5
- package/dataMap/dataSource.mjs +5 -5
- package/dataMap/metaManager/metaSchema.js +7 -0
- package/dataMap/metaManager/metaSchema.mjs +7 -0
- package/dist/handsontable.css +7 -2
- package/dist/handsontable.full.css +7 -2
- package/dist/handsontable.full.js +9409 -9084
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +115 -123
- package/dist/handsontable.js +9497 -9171
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +3 -11
- package/dist/languages/all.js +0 -133
- package/dist/languages/ar-AR.js +0 -7
- package/dist/languages/cs-CZ.js +0 -7
- package/dist/languages/de-CH.js +0 -7
- package/dist/languages/de-DE.js +0 -7
- package/dist/languages/en-US.js +0 -7
- package/dist/languages/es-MX.js +0 -7
- package/dist/languages/fr-FR.js +0 -7
- package/dist/languages/it-IT.js +0 -7
- package/dist/languages/ja-JP.js +0 -7
- package/dist/languages/ko-KR.js +0 -7
- package/dist/languages/lv-LV.js +0 -7
- package/dist/languages/nb-NO.js +0 -7
- package/dist/languages/nl-NL.js +0 -7
- package/dist/languages/pl-PL.js +0 -7
- package/dist/languages/pt-BR.js +0 -7
- package/dist/languages/ru-RU.js +0 -7
- package/dist/languages/sr-SP.js +0 -7
- package/dist/languages/zh-CN.js +0 -7
- package/dist/languages/zh-TW.js +0 -7
- package/editorManager.js +7 -3
- package/editorManager.mjs +7 -3
- package/editors/textEditor/textEditor.js +3 -16
- package/editors/textEditor/textEditor.mjs +4 -17
- package/focusManager.d.ts +12 -0
- package/focusManager.js +249 -0
- package/focusManager.mjs +245 -0
- package/helpers/dom/element.js +11 -0
- package/helpers/dom/element.mjs +10 -0
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/i18n/languages/ar-AR.js +1 -7
- package/i18n/languages/cs-CZ.js +1 -7
- package/i18n/languages/de-CH.js +1 -7
- package/i18n/languages/de-DE.js +1 -7
- package/i18n/languages/en-US.js +1 -7
- package/i18n/languages/es-MX.js +1 -7
- package/i18n/languages/fr-FR.js +1 -7
- package/i18n/languages/it-IT.js +1 -7
- package/i18n/languages/ja-JP.js +1 -7
- package/i18n/languages/ko-KR.js +1 -7
- package/i18n/languages/lv-LV.js +1 -7
- package/i18n/languages/nb-NO.js +1 -7
- package/i18n/languages/nl-NL.js +1 -7
- package/i18n/languages/pl-PL.js +1 -7
- package/i18n/languages/pt-BR.js +1 -7
- package/i18n/languages/ru-RU.js +1 -7
- package/i18n/languages/sr-SP.js +1 -7
- package/i18n/languages/zh-CN.js +1 -7
- package/i18n/languages/zh-TW.js +1 -7
- package/languages/all.js +0 -133
- package/languages/ar-AR.js +0 -7
- package/languages/cs-CZ.js +0 -7
- package/languages/de-CH.js +0 -7
- package/languages/de-DE.js +0 -7
- package/languages/en-US.js +0 -7
- package/languages/es-MX.js +0 -7
- package/languages/fr-FR.js +0 -7
- package/languages/index.js +0 -133
- package/languages/it-IT.js +0 -7
- package/languages/ja-JP.js +0 -7
- package/languages/ko-KR.js +0 -7
- package/languages/lv-LV.js +0 -7
- package/languages/nb-NO.js +0 -7
- package/languages/nl-NL.js +0 -7
- package/languages/pl-PL.js +0 -7
- package/languages/pt-BR.js +0 -7
- package/languages/ru-RU.js +0 -7
- package/languages/sr-SP.js +0 -7
- package/languages/zh-CN.js +0 -7
- package/languages/zh-TW.js +0 -7
- package/package.json +2 -3
- package/pluginHooks.js +7 -17
- package/pluginHooks.mjs +4 -16
- package/plugins/autoRowSize/autoRowSize.js +2 -2
- package/plugins/autoRowSize/autoRowSize.mjs +2 -2
- package/plugins/copyPaste/copyPaste.js +12 -93
- package/plugins/copyPaste/copyPaste.mjs +12 -93
- package/plugins/copyPaste/copyableRanges.js +31 -25
- package/plugins/copyPaste/copyableRanges.mjs +24 -18
- package/plugins/customBorders/customBorders.js +6 -2
- package/plugins/customBorders/customBorders.mjs +7 -3
- package/plugins/filters/filters.js +0 -5
- package/plugins/filters/filters.mjs +0 -5
- package/plugins/formulas/formulas.js +168 -190
- package/plugins/formulas/formulas.mjs +168 -190
- package/plugins/mergeCells/mergeCells.js +0 -16
- package/plugins/mergeCells/mergeCells.mjs +0 -16
- package/plugins/nestedHeaders/nestedHeaders.js +3 -4
- package/plugins/nestedHeaders/nestedHeaders.mjs +3 -4
- package/plugins/nestedHeaders/stateManager/headersTree.js +26 -23
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +23 -20
- package/plugins/nestedHeaders/stateManager/index.js +3 -3
- package/plugins/nestedHeaders/stateManager/matrixGenerator.js +0 -1
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +1 -1
- package/plugins/nestedHeaders/utils/ghostTable.js +35 -30
- package/plugins/nestedHeaders/utils/ghostTable.mjs +35 -30
- package/plugins/registry.js +1 -3
- package/plugins/undoRedo/undoRedo.js +1 -0
- package/plugins/undoRedo/undoRedo.mjs +1 -0
- package/renderers/baseRenderer/baseRenderer.js +3 -0
- package/renderers/baseRenderer/baseRenderer.mjs +3 -0
- package/selection/highlight/highlight.js +335 -133
- package/selection/highlight/highlight.mjs +325 -129
- package/selection/highlight/types/activeHeader.js +10 -9
- package/selection/highlight/types/activeHeader.mjs +10 -8
- package/selection/highlight/types/area.js +12 -27
- package/selection/highlight/types/area.mjs +16 -30
- package/selection/highlight/types/areaLayered.js +54 -0
- package/selection/highlight/types/areaLayered.mjs +49 -0
- package/selection/highlight/types/column.js +50 -0
- package/selection/highlight/types/column.mjs +45 -0
- package/selection/highlight/types/customSelection.js +7 -10
- package/selection/highlight/types/customSelection.mjs +7 -9
- package/selection/highlight/types/fill.js +5 -8
- package/selection/highlight/types/fill.mjs +5 -7
- package/selection/highlight/types/{cell.js → focus.js} +5 -8
- package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
- package/selection/highlight/types/header.js +10 -20
- package/selection/highlight/types/header.mjs +10 -19
- package/selection/highlight/types/{index.js → row.js} +27 -31
- package/selection/highlight/types/{index.mjs → row.mjs} +24 -29
- package/selection/highlight/visualSelection.js +12 -21
- package/selection/highlight/visualSelection.mjs +12 -21
- package/selection/index.js +4 -7
- package/selection/index.mjs +2 -3
- package/selection/selection.js +88 -46
- package/selection/selection.mjs +82 -44
- package/settings.d.ts +1 -0
- package/tableView.js +94 -66
- package/tableView.mjs +94 -66
- package/translations/changesObservable/observable.js +46 -41
- package/translations/changesObservable/observable.mjs +41 -36
- package/translations/changesObservable/observer.js +1 -1
- package/translations/indexMapper.js +0 -21
- package/translations/indexMapper.mjs +0 -21
- package/utils/dataStructures/tree.js +18 -15
- package/utils/dataStructures/tree.mjs +18 -15
- package/utils/parseTable.js +1 -5
- package/utils/parseTable.mjs +1 -5
- package/3rdparty/walkontable/src/selection.js +0 -354
- package/3rdparty/walkontable/src/selection.mjs +0 -348
- package/plugins/copyPaste/focusableElement.js +0 -219
- package/plugins/copyPaste/focusableElement.mjs +0 -213
- package/plugins/formulas/indexSyncer/axisSyncer.js +0 -379
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +0 -374
- package/plugins/formulas/indexSyncer/index.js +0 -225
- package/plugins/formulas/indexSyncer/index.mjs +0 -219
- package/selection/highlight/constants.js +0 -16
- package/selection/highlight/constants.mjs +0 -6
package/selection/selection.js
CHANGED
@@ -5,6 +5,8 @@ require("core-js/modules/es.object.freeze.js");
|
|
5
5
|
require("core-js/modules/es.symbol.iterator.js");
|
6
6
|
require("core-js/modules/es.function.name.js");
|
7
7
|
require("core-js/modules/es.regexp.exec.js");
|
8
|
+
require("core-js/modules/es.weak-map.js");
|
9
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
8
10
|
exports.__esModule = true;
|
9
11
|
exports.default = void 0;
|
10
12
|
require("core-js/modules/es.array.iterator.js");
|
@@ -23,8 +25,7 @@ require("core-js/modules/es.symbol.to-primitive.js");
|
|
23
25
|
require("core-js/modules/es.date.to-primitive.js");
|
24
26
|
require("core-js/modules/es.symbol.js");
|
25
27
|
require("core-js/modules/es.symbol.description.js");
|
26
|
-
var _highlight =
|
27
|
-
var _constants = require("./highlight/constants");
|
28
|
+
var _highlight = _interopRequireWildcard(require("./highlight/highlight"));
|
28
29
|
var _range = _interopRequireDefault(require("./range"));
|
29
30
|
var _object = require("./../helpers/object");
|
30
31
|
var _mixed = require("./../helpers/mixed");
|
@@ -35,6 +36,8 @@ var _utils = require("./utils");
|
|
35
36
|
var _templateLiteralTag = require("./../helpers/templateLiteralTag");
|
36
37
|
var _templateObject;
|
37
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
39
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
40
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
38
41
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
39
42
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
40
43
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -152,6 +155,12 @@ var Selection = /*#__PURE__*/function () {
|
|
152
155
|
countCols: function countCols() {
|
153
156
|
return _this.tableProps.countColsTranslated();
|
154
157
|
},
|
158
|
+
countRowHeaders: function countRowHeaders() {
|
159
|
+
return _this.tableProps.countRowHeaders();
|
160
|
+
},
|
161
|
+
countColHeaders: function countColHeaders() {
|
162
|
+
return _this.tableProps.countColHeaders();
|
163
|
+
},
|
155
164
|
visualToRenderableCoords: function visualToRenderableCoords(coords) {
|
156
165
|
return _this.tableProps.visualToRenderableCoords(coords);
|
157
166
|
},
|
@@ -336,9 +345,9 @@ var Selection = /*#__PURE__*/function () {
|
|
336
345
|
}
|
337
346
|
|
338
347
|
// Set up current selection.
|
339
|
-
this.highlight.
|
340
|
-
if (this.highlight.isEnabledFor(
|
341
|
-
this.highlight.
|
348
|
+
this.highlight.getFocus().clear();
|
349
|
+
if (this.highlight.isEnabledFor(_highlight.FOCUS_TYPE, cellRange.highlight)) {
|
350
|
+
this.highlight.getFocus().add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
|
342
351
|
}
|
343
352
|
var layerLevel = this.getLayerLevel();
|
344
353
|
|
@@ -348,64 +357,85 @@ var Selection = /*#__PURE__*/function () {
|
|
348
357
|
(0, _array.arrayEach)(this.highlight.getAreas(), function (highlight) {
|
349
358
|
return void highlight.clear();
|
350
359
|
});
|
351
|
-
(0, _array.arrayEach)(this.highlight.
|
360
|
+
(0, _array.arrayEach)(this.highlight.getLayeredAreas(), function (highlight) {
|
361
|
+
return void highlight.clear();
|
362
|
+
});
|
363
|
+
(0, _array.arrayEach)(this.highlight.getRowHeaders(), function (highlight) {
|
364
|
+
return void highlight.clear();
|
365
|
+
});
|
366
|
+
(0, _array.arrayEach)(this.highlight.getColumnHeaders(), function (highlight) {
|
367
|
+
return void highlight.clear();
|
368
|
+
});
|
369
|
+
(0, _array.arrayEach)(this.highlight.getActiveRowHeaders(), function (highlight) {
|
370
|
+
return void highlight.clear();
|
371
|
+
});
|
372
|
+
(0, _array.arrayEach)(this.highlight.getActiveColumnHeaders(), function (highlight) {
|
373
|
+
return void highlight.clear();
|
374
|
+
});
|
375
|
+
(0, _array.arrayEach)(this.highlight.getRowHighlights(), function (highlight) {
|
352
376
|
return void highlight.clear();
|
353
377
|
});
|
354
|
-
(0, _array.arrayEach)(this.highlight.
|
378
|
+
(0, _array.arrayEach)(this.highlight.getColumnHighlights(), function (highlight) {
|
355
379
|
return void highlight.clear();
|
356
380
|
});
|
357
381
|
}
|
358
382
|
this.highlight.useLayerLevel(layerLevel);
|
359
|
-
var areaHighlight = this.highlight.
|
360
|
-
var
|
361
|
-
var
|
383
|
+
var areaHighlight = this.highlight.createArea();
|
384
|
+
var layeredAreaHighlight = this.highlight.createLayeredArea();
|
385
|
+
var rowHeaderHighlight = this.highlight.createRowHeader();
|
386
|
+
var columnHeaderHighlight = this.highlight.createColumnHeader();
|
387
|
+
var activeRowHeaderHighlight = this.highlight.createActiveRowHeader();
|
388
|
+
var activeColumnHeaderHighlight = this.highlight.createActiveColumnHeader();
|
389
|
+
var rowHighlight = this.highlight.createRowHighlight();
|
390
|
+
var columnHighlight = this.highlight.createColumnHighlight();
|
362
391
|
areaHighlight.clear();
|
363
|
-
|
364
|
-
|
365
|
-
|
392
|
+
layeredAreaHighlight.clear();
|
393
|
+
rowHeaderHighlight.clear();
|
394
|
+
columnHeaderHighlight.clear();
|
395
|
+
activeRowHeaderHighlight.clear();
|
396
|
+
activeColumnHeaderHighlight.clear();
|
397
|
+
rowHighlight.clear();
|
398
|
+
columnHighlight.clear();
|
399
|
+
if (this.highlight.isEnabledFor(_highlight.AREA_TYPE, cellRange.highlight) && (this.isMultiple() || layerLevel >= 1)) {
|
366
400
|
areaHighlight.add(cellRange.from).add(cellRange.to).commit();
|
401
|
+
layeredAreaHighlight.add(cellRange.from).add(cellRange.to).commit();
|
367
402
|
if (layerLevel === 1) {
|
368
403
|
// For single cell selection in the same layer, we do not create area selection to prevent blue background.
|
369
404
|
// When non-consecutive selection is performed we have to add that missing area selection to the previous layer
|
370
405
|
// based on previous coordinates. It only occurs when the previous selection wasn't select multiple cells.
|
371
406
|
var previousRange = this.selectedRange.previous();
|
372
|
-
this.highlight.useLayerLevel(layerLevel - 1)
|
407
|
+
this.highlight.useLayerLevel(layerLevel - 1);
|
408
|
+
this.highlight.createArea().add(previousRange.from).commit()
|
409
|
+
// Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
|
410
|
+
.syncWith(previousRange);
|
411
|
+
this.highlight.createLayeredArea().add(previousRange.from).commit()
|
373
412
|
// Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
|
374
413
|
.syncWith(previousRange);
|
375
414
|
this.highlight.useLayerLevel(layerLevel);
|
376
415
|
}
|
377
416
|
}
|
378
|
-
if (this.highlight.isEnabledFor(
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
var areAnyRowsRendered = this.tableProps.countRowsTranslated() === 0;
|
384
|
-
var areAnyColumnsRendered = this.tableProps.countColsTranslated() === 0;
|
385
|
-
var headerCellRange = cellRange;
|
386
|
-
if (areAnyRowsRendered || areAnyColumnsRendered) {
|
387
|
-
headerCellRange = cellRange.clone();
|
388
|
-
}
|
389
|
-
if (areAnyRowsRendered) {
|
390
|
-
headerCellRange.from.row = -1;
|
391
|
-
}
|
392
|
-
if (areAnyColumnsRendered) {
|
393
|
-
headerCellRange.from.col = -1;
|
394
|
-
}
|
417
|
+
if (this.highlight.isEnabledFor(_highlight.HEADER_TYPE, cellRange.highlight)) {
|
418
|
+
var rowCoordsFrom = this.tableProps.createCellCoords(Math.max(cellRange.from.row, 0), -1);
|
419
|
+
var rowCoordsTo = this.tableProps.createCellCoords(cellRange.to.row, -1);
|
420
|
+
var columnCoordsFrom = this.tableProps.createCellCoords(-1, Math.max(cellRange.from.col, 0));
|
421
|
+
var columnCoordsTo = this.tableProps.createCellCoords(-1, cellRange.to.col);
|
395
422
|
if (this.settings.selectionMode === 'single') {
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
423
|
+
rowHeaderHighlight.add(rowCoordsFrom).commit();
|
424
|
+
columnHeaderHighlight.add(columnCoordsFrom).commit();
|
425
|
+
rowHighlight.add(rowCoordsFrom).commit();
|
426
|
+
columnHighlight.add(columnCoordsFrom).commit();
|
400
427
|
} else {
|
401
|
-
|
428
|
+
rowHeaderHighlight.add(rowCoordsFrom).add(rowCoordsTo).commit();
|
429
|
+
columnHeaderHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
|
430
|
+
rowHighlight.add(rowCoordsFrom).add(rowCoordsTo).commit();
|
431
|
+
columnHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
|
402
432
|
}
|
403
433
|
if (this.isEntireRowSelected()) {
|
404
434
|
var isRowSelected = this.tableProps.countCols() === cellRange.getWidth();
|
405
435
|
|
406
436
|
// Make sure that the whole row is selected (in case where selectionMode is set to 'single')
|
407
437
|
if (isRowSelected) {
|
408
|
-
|
438
|
+
activeRowHeaderHighlight.add(this.tableProps.createCellCoords(cellRange.from.row, Math.min(-this.tableProps.countRowHeaders(), -1))).add(this.tableProps.createCellCoords(cellRange.to.row, -1)).commit();
|
409
439
|
}
|
410
440
|
}
|
411
441
|
if (this.isEntireColumnSelected()) {
|
@@ -413,7 +443,7 @@ var Selection = /*#__PURE__*/function () {
|
|
413
443
|
|
414
444
|
// Make sure that the whole column is selected (in case where selectionMode is set to 'single')
|
415
445
|
if (isColumnSelected) {
|
416
|
-
|
446
|
+
activeColumnHeaderHighlight.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(), -1), cellRange.from.col)).add(this.tableProps.createCellCoords(-1, cellRange.to.col)).commit();
|
417
447
|
}
|
418
448
|
}
|
419
449
|
}
|
@@ -648,7 +678,9 @@ var Selection = /*#__PURE__*/function () {
|
|
648
678
|
if (!includeRowHeaders && !includeColumnHeaders && (nrOfRows === 0 || nrOfColumns === 0)) {
|
649
679
|
return;
|
650
680
|
}
|
651
|
-
var
|
681
|
+
var rowFrom = includeColumnHeaders ? -this.tableProps.countColHeaders() : 0;
|
682
|
+
var columnFrom = includeRowHeaders ? -this.tableProps.countRowHeaders() : 0;
|
683
|
+
var startCoords = this.tableProps.createCellCoords(rowFrom, columnFrom);
|
652
684
|
var endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
|
653
685
|
this.clear();
|
654
686
|
this.setRangeStartOnly(startCoords);
|
@@ -782,19 +814,29 @@ var Selection = /*#__PURE__*/function () {
|
|
782
814
|
if (!this.isSelected()) {
|
783
815
|
return;
|
784
816
|
}
|
785
|
-
var
|
817
|
+
var focusHighlight = this.highlight.getFocus();
|
786
818
|
var currentLayer = this.getLayerLevel();
|
787
|
-
|
819
|
+
focusHighlight.commit().syncWith(this.selectedRange.current());
|
788
820
|
|
789
821
|
// Rewriting rendered ranges going through all layers.
|
790
822
|
for (var layerLevel = 0; layerLevel < this.selectedRange.size(); layerLevel += 1) {
|
791
823
|
this.highlight.useLayerLevel(layerLevel);
|
792
|
-
var areaHighlight = this.highlight.
|
793
|
-
var
|
794
|
-
var
|
824
|
+
var areaHighlight = this.highlight.createArea();
|
825
|
+
var areaLayeredHighlight = this.highlight.createLayeredArea();
|
826
|
+
var rowHeaderHighlight = this.highlight.createRowHeader();
|
827
|
+
var columnHeaderHighlight = this.highlight.createColumnHeader();
|
828
|
+
var activeRowHeaderHighlight = this.highlight.createActiveRowHeader();
|
829
|
+
var activeColumnHeaderHighlight = this.highlight.createActiveColumnHeader();
|
830
|
+
var rowHighlight = this.highlight.createRowHighlight();
|
831
|
+
var columnHighlight = this.highlight.createColumnHighlight();
|
795
832
|
areaHighlight.commit();
|
796
|
-
|
797
|
-
|
833
|
+
areaLayeredHighlight.commit();
|
834
|
+
rowHeaderHighlight.commit();
|
835
|
+
columnHeaderHighlight.commit();
|
836
|
+
activeRowHeaderHighlight.commit();
|
837
|
+
activeColumnHeaderHighlight.commit();
|
838
|
+
rowHighlight.commit();
|
839
|
+
columnHighlight.commit();
|
798
840
|
}
|
799
841
|
|
800
842
|
// Reverting starting layer for the Highlight.
|
package/selection/selection.mjs
CHANGED
@@ -33,8 +33,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
33
33
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
34
34
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
35
35
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
36
|
-
import Highlight from "./highlight/highlight.mjs";
|
37
|
-
import { AREA_TYPE, HEADER_TYPE, CELL_TYPE } from "./highlight/constants.mjs";
|
36
|
+
import Highlight, { AREA_TYPE, HEADER_TYPE, FOCUS_TYPE } from "./highlight/highlight.mjs";
|
38
37
|
import SelectionRange from "./range.mjs";
|
39
38
|
import { createObjectPropListener, mixin } from "./../helpers/object.mjs";
|
40
39
|
import { isUndefined } from "./../helpers/mixed.mjs";
|
@@ -147,6 +146,12 @@ var Selection = /*#__PURE__*/function () {
|
|
147
146
|
countCols: function countCols() {
|
148
147
|
return _this.tableProps.countColsTranslated();
|
149
148
|
},
|
149
|
+
countRowHeaders: function countRowHeaders() {
|
150
|
+
return _this.tableProps.countRowHeaders();
|
151
|
+
},
|
152
|
+
countColHeaders: function countColHeaders() {
|
153
|
+
return _this.tableProps.countColHeaders();
|
154
|
+
},
|
150
155
|
visualToRenderableCoords: function visualToRenderableCoords(coords) {
|
151
156
|
return _this.tableProps.visualToRenderableCoords(coords);
|
152
157
|
},
|
@@ -331,9 +336,9 @@ var Selection = /*#__PURE__*/function () {
|
|
331
336
|
}
|
332
337
|
|
333
338
|
// Set up current selection.
|
334
|
-
this.highlight.
|
335
|
-
if (this.highlight.isEnabledFor(
|
336
|
-
this.highlight.
|
339
|
+
this.highlight.getFocus().clear();
|
340
|
+
if (this.highlight.isEnabledFor(FOCUS_TYPE, cellRange.highlight)) {
|
341
|
+
this.highlight.getFocus().add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
|
337
342
|
}
|
338
343
|
var layerLevel = this.getLayerLevel();
|
339
344
|
|
@@ -343,64 +348,85 @@ var Selection = /*#__PURE__*/function () {
|
|
343
348
|
arrayEach(this.highlight.getAreas(), function (highlight) {
|
344
349
|
return void highlight.clear();
|
345
350
|
});
|
346
|
-
arrayEach(this.highlight.
|
351
|
+
arrayEach(this.highlight.getLayeredAreas(), function (highlight) {
|
352
|
+
return void highlight.clear();
|
353
|
+
});
|
354
|
+
arrayEach(this.highlight.getRowHeaders(), function (highlight) {
|
355
|
+
return void highlight.clear();
|
356
|
+
});
|
357
|
+
arrayEach(this.highlight.getColumnHeaders(), function (highlight) {
|
358
|
+
return void highlight.clear();
|
359
|
+
});
|
360
|
+
arrayEach(this.highlight.getActiveRowHeaders(), function (highlight) {
|
361
|
+
return void highlight.clear();
|
362
|
+
});
|
363
|
+
arrayEach(this.highlight.getActiveColumnHeaders(), function (highlight) {
|
364
|
+
return void highlight.clear();
|
365
|
+
});
|
366
|
+
arrayEach(this.highlight.getRowHighlights(), function (highlight) {
|
347
367
|
return void highlight.clear();
|
348
368
|
});
|
349
|
-
arrayEach(this.highlight.
|
369
|
+
arrayEach(this.highlight.getColumnHighlights(), function (highlight) {
|
350
370
|
return void highlight.clear();
|
351
371
|
});
|
352
372
|
}
|
353
373
|
this.highlight.useLayerLevel(layerLevel);
|
354
|
-
var areaHighlight = this.highlight.
|
355
|
-
var
|
356
|
-
var
|
374
|
+
var areaHighlight = this.highlight.createArea();
|
375
|
+
var layeredAreaHighlight = this.highlight.createLayeredArea();
|
376
|
+
var rowHeaderHighlight = this.highlight.createRowHeader();
|
377
|
+
var columnHeaderHighlight = this.highlight.createColumnHeader();
|
378
|
+
var activeRowHeaderHighlight = this.highlight.createActiveRowHeader();
|
379
|
+
var activeColumnHeaderHighlight = this.highlight.createActiveColumnHeader();
|
380
|
+
var rowHighlight = this.highlight.createRowHighlight();
|
381
|
+
var columnHighlight = this.highlight.createColumnHighlight();
|
357
382
|
areaHighlight.clear();
|
358
|
-
|
359
|
-
|
383
|
+
layeredAreaHighlight.clear();
|
384
|
+
rowHeaderHighlight.clear();
|
385
|
+
columnHeaderHighlight.clear();
|
386
|
+
activeRowHeaderHighlight.clear();
|
387
|
+
activeColumnHeaderHighlight.clear();
|
388
|
+
rowHighlight.clear();
|
389
|
+
columnHighlight.clear();
|
360
390
|
if (this.highlight.isEnabledFor(AREA_TYPE, cellRange.highlight) && (this.isMultiple() || layerLevel >= 1)) {
|
361
391
|
areaHighlight.add(cellRange.from).add(cellRange.to).commit();
|
392
|
+
layeredAreaHighlight.add(cellRange.from).add(cellRange.to).commit();
|
362
393
|
if (layerLevel === 1) {
|
363
394
|
// For single cell selection in the same layer, we do not create area selection to prevent blue background.
|
364
395
|
// When non-consecutive selection is performed we have to add that missing area selection to the previous layer
|
365
396
|
// based on previous coordinates. It only occurs when the previous selection wasn't select multiple cells.
|
366
397
|
var previousRange = this.selectedRange.previous();
|
367
|
-
this.highlight.useLayerLevel(layerLevel - 1)
|
398
|
+
this.highlight.useLayerLevel(layerLevel - 1);
|
399
|
+
this.highlight.createArea().add(previousRange.from).commit()
|
400
|
+
// Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
|
401
|
+
.syncWith(previousRange);
|
402
|
+
this.highlight.createLayeredArea().add(previousRange.from).commit()
|
368
403
|
// Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
|
369
404
|
.syncWith(previousRange);
|
370
405
|
this.highlight.useLayerLevel(layerLevel);
|
371
406
|
}
|
372
407
|
}
|
373
408
|
if (this.highlight.isEnabledFor(HEADER_TYPE, cellRange.highlight)) {
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
var areAnyRowsRendered = this.tableProps.countRowsTranslated() === 0;
|
379
|
-
var areAnyColumnsRendered = this.tableProps.countColsTranslated() === 0;
|
380
|
-
var headerCellRange = cellRange;
|
381
|
-
if (areAnyRowsRendered || areAnyColumnsRendered) {
|
382
|
-
headerCellRange = cellRange.clone();
|
383
|
-
}
|
384
|
-
if (areAnyRowsRendered) {
|
385
|
-
headerCellRange.from.row = -1;
|
386
|
-
}
|
387
|
-
if (areAnyColumnsRendered) {
|
388
|
-
headerCellRange.from.col = -1;
|
389
|
-
}
|
409
|
+
var rowCoordsFrom = this.tableProps.createCellCoords(Math.max(cellRange.from.row, 0), -1);
|
410
|
+
var rowCoordsTo = this.tableProps.createCellCoords(cellRange.to.row, -1);
|
411
|
+
var columnCoordsFrom = this.tableProps.createCellCoords(-1, Math.max(cellRange.from.col, 0));
|
412
|
+
var columnCoordsTo = this.tableProps.createCellCoords(-1, cellRange.to.col);
|
390
413
|
if (this.settings.selectionMode === 'single') {
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
414
|
+
rowHeaderHighlight.add(rowCoordsFrom).commit();
|
415
|
+
columnHeaderHighlight.add(columnCoordsFrom).commit();
|
416
|
+
rowHighlight.add(rowCoordsFrom).commit();
|
417
|
+
columnHighlight.add(columnCoordsFrom).commit();
|
395
418
|
} else {
|
396
|
-
|
419
|
+
rowHeaderHighlight.add(rowCoordsFrom).add(rowCoordsTo).commit();
|
420
|
+
columnHeaderHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
|
421
|
+
rowHighlight.add(rowCoordsFrom).add(rowCoordsTo).commit();
|
422
|
+
columnHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
|
397
423
|
}
|
398
424
|
if (this.isEntireRowSelected()) {
|
399
425
|
var isRowSelected = this.tableProps.countCols() === cellRange.getWidth();
|
400
426
|
|
401
427
|
// Make sure that the whole row is selected (in case where selectionMode is set to 'single')
|
402
428
|
if (isRowSelected) {
|
403
|
-
|
429
|
+
activeRowHeaderHighlight.add(this.tableProps.createCellCoords(cellRange.from.row, Math.min(-this.tableProps.countRowHeaders(), -1))).add(this.tableProps.createCellCoords(cellRange.to.row, -1)).commit();
|
404
430
|
}
|
405
431
|
}
|
406
432
|
if (this.isEntireColumnSelected()) {
|
@@ -408,7 +434,7 @@ var Selection = /*#__PURE__*/function () {
|
|
408
434
|
|
409
435
|
// Make sure that the whole column is selected (in case where selectionMode is set to 'single')
|
410
436
|
if (isColumnSelected) {
|
411
|
-
|
437
|
+
activeColumnHeaderHighlight.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(), -1), cellRange.from.col)).add(this.tableProps.createCellCoords(-1, cellRange.to.col)).commit();
|
412
438
|
}
|
413
439
|
}
|
414
440
|
}
|
@@ -643,7 +669,9 @@ var Selection = /*#__PURE__*/function () {
|
|
643
669
|
if (!includeRowHeaders && !includeColumnHeaders && (nrOfRows === 0 || nrOfColumns === 0)) {
|
644
670
|
return;
|
645
671
|
}
|
646
|
-
var
|
672
|
+
var rowFrom = includeColumnHeaders ? -this.tableProps.countColHeaders() : 0;
|
673
|
+
var columnFrom = includeRowHeaders ? -this.tableProps.countRowHeaders() : 0;
|
674
|
+
var startCoords = this.tableProps.createCellCoords(rowFrom, columnFrom);
|
647
675
|
var endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
|
648
676
|
this.clear();
|
649
677
|
this.setRangeStartOnly(startCoords);
|
@@ -777,19 +805,29 @@ var Selection = /*#__PURE__*/function () {
|
|
777
805
|
if (!this.isSelected()) {
|
778
806
|
return;
|
779
807
|
}
|
780
|
-
var
|
808
|
+
var focusHighlight = this.highlight.getFocus();
|
781
809
|
var currentLayer = this.getLayerLevel();
|
782
|
-
|
810
|
+
focusHighlight.commit().syncWith(this.selectedRange.current());
|
783
811
|
|
784
812
|
// Rewriting rendered ranges going through all layers.
|
785
813
|
for (var layerLevel = 0; layerLevel < this.selectedRange.size(); layerLevel += 1) {
|
786
814
|
this.highlight.useLayerLevel(layerLevel);
|
787
|
-
var areaHighlight = this.highlight.
|
788
|
-
var
|
789
|
-
var
|
815
|
+
var areaHighlight = this.highlight.createArea();
|
816
|
+
var areaLayeredHighlight = this.highlight.createLayeredArea();
|
817
|
+
var rowHeaderHighlight = this.highlight.createRowHeader();
|
818
|
+
var columnHeaderHighlight = this.highlight.createColumnHeader();
|
819
|
+
var activeRowHeaderHighlight = this.highlight.createActiveRowHeader();
|
820
|
+
var activeColumnHeaderHighlight = this.highlight.createActiveColumnHeader();
|
821
|
+
var rowHighlight = this.highlight.createRowHighlight();
|
822
|
+
var columnHighlight = this.highlight.createColumnHighlight();
|
790
823
|
areaHighlight.commit();
|
791
|
-
|
792
|
-
|
824
|
+
areaLayeredHighlight.commit();
|
825
|
+
rowHeaderHighlight.commit();
|
826
|
+
columnHeaderHighlight.commit();
|
827
|
+
activeRowHeaderHighlight.commit();
|
828
|
+
activeColumnHeaderHighlight.commit();
|
829
|
+
rowHighlight.commit();
|
830
|
+
columnHighlight.commit();
|
793
831
|
}
|
794
832
|
|
795
833
|
// Reverting starting layer for the Highlight.
|
package/settings.d.ts
CHANGED
@@ -144,6 +144,7 @@ export interface GridSettings extends Events {
|
|
144
144
|
hiddenColumns?: HiddenColumnsSettings;
|
145
145
|
hiddenRows?: HiddenRowsSettings;
|
146
146
|
invalidCellClassName?: string;
|
147
|
+
imeFastEdit?: boolean;
|
147
148
|
isEmptyCol?: (this: Core, col: number) => boolean;
|
148
149
|
isEmptyRow?: (this: Core, row: number) => boolean;
|
149
150
|
label?: LabelOptions;
|
package/tableView.js
CHANGED
@@ -58,88 +58,98 @@ var privatePool = new WeakMap();
|
|
58
58
|
var _columnHeadersCount = /*#__PURE__*/new WeakMap();
|
59
59
|
var _rowHeadersCount = /*#__PURE__*/new WeakMap();
|
60
60
|
var TableView = /*#__PURE__*/function () {
|
61
|
+
/**
|
62
|
+
* Instance of {@link Handsontable}.
|
63
|
+
*
|
64
|
+
* @private
|
65
|
+
* @type {Handsontable}
|
66
|
+
*/
|
67
|
+
|
68
|
+
/**
|
69
|
+
* Instance of {@link EventManager}.
|
70
|
+
*
|
71
|
+
* @private
|
72
|
+
* @type {EventManager}
|
73
|
+
*/
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Current Handsontable's GridSettings object.
|
77
|
+
*
|
78
|
+
* @private
|
79
|
+
* @type {GridSettings}
|
80
|
+
*/
|
81
|
+
|
82
|
+
/**
|
83
|
+
* Main <THEAD> element.
|
84
|
+
*
|
85
|
+
* @private
|
86
|
+
* @type {HTMLTableSectionElement}
|
87
|
+
*/
|
88
|
+
|
89
|
+
/**
|
90
|
+
* Main <TBODY> element.
|
91
|
+
*
|
92
|
+
* @private
|
93
|
+
* @type {HTMLTableSectionElement}
|
94
|
+
*/
|
95
|
+
|
96
|
+
/**
|
97
|
+
* Main Walkontable instance.
|
98
|
+
*
|
99
|
+
* @private
|
100
|
+
* @type {Walkontable}
|
101
|
+
*/
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Main Walkontable instance.
|
105
|
+
*
|
106
|
+
* @private
|
107
|
+
* @type {Walkontable}
|
108
|
+
*/
|
109
|
+
|
110
|
+
/**
|
111
|
+
* The total number of the column header renderers applied to the table through the
|
112
|
+
* `afterGetColumnHeaderRenderers` hook.
|
113
|
+
*
|
114
|
+
* @type {number}
|
115
|
+
*/
|
116
|
+
|
117
|
+
/**
|
118
|
+
* The total number of the row header renderers applied to the table through the
|
119
|
+
* `afterGetRowHeaderRenderers` hook.
|
120
|
+
*
|
121
|
+
* @type {number}
|
122
|
+
*/
|
123
|
+
|
124
|
+
/**
|
125
|
+
* The flag determines if the `adjustElementsSize` method call was made during
|
126
|
+
* the render suspending. If true, the method has to be triggered once after render
|
127
|
+
* resuming.
|
128
|
+
*
|
129
|
+
* @private
|
130
|
+
* @type {boolean}
|
131
|
+
*/
|
132
|
+
|
61
133
|
/**
|
62
134
|
* @param {Hanstontable} instance Instance of {@link Handsontable}.
|
63
135
|
*/
|
64
136
|
function TableView(instance) {
|
65
137
|
_classCallCheck(this, TableView);
|
66
|
-
/**
|
67
|
-
* Instance of {@link Handsontable}.
|
68
|
-
*
|
69
|
-
* @private
|
70
|
-
* @type {Handsontable}
|
71
|
-
*/
|
72
138
|
_defineProperty(this, "instance", void 0);
|
73
|
-
/**
|
74
|
-
* Instance of {@link EventManager}.
|
75
|
-
*
|
76
|
-
* @private
|
77
|
-
* @type {EventManager}
|
78
|
-
*/
|
79
139
|
_defineProperty(this, "eventManager", void 0);
|
80
|
-
/**
|
81
|
-
* Current Handsontable's GridSettings object.
|
82
|
-
*
|
83
|
-
* @private
|
84
|
-
* @type {GridSettings}
|
85
|
-
*/
|
86
140
|
_defineProperty(this, "settings", void 0);
|
87
|
-
/**
|
88
|
-
* Main <THEAD> element.
|
89
|
-
*
|
90
|
-
* @private
|
91
|
-
* @type {HTMLTableSectionElement}
|
92
|
-
*/
|
93
141
|
_defineProperty(this, "THEAD", void 0);
|
94
|
-
/**
|
95
|
-
* Main <TBODY> element.
|
96
|
-
*
|
97
|
-
* @private
|
98
|
-
* @type {HTMLTableSectionElement}
|
99
|
-
*/
|
100
142
|
_defineProperty(this, "TBODY", void 0);
|
101
|
-
/**
|
102
|
-
* Main Walkontable instance.
|
103
|
-
*
|
104
|
-
* @private
|
105
|
-
* @type {Walkontable}
|
106
|
-
*/
|
107
143
|
_defineProperty(this, "_wt", void 0);
|
108
|
-
/**
|
109
|
-
* Main Walkontable instance.
|
110
|
-
*
|
111
|
-
* @private
|
112
|
-
* @type {Walkontable}
|
113
|
-
*/
|
114
144
|
_defineProperty(this, "activeWt", void 0);
|
115
|
-
/**
|
116
|
-
* The total number of the column header renderers applied to the table through the
|
117
|
-
* `afterGetColumnHeaderRenderers` hook.
|
118
|
-
*
|
119
|
-
* @type {number}
|
120
|
-
*/
|
121
145
|
_classPrivateFieldInitSpec(this, _columnHeadersCount, {
|
122
146
|
writable: true,
|
123
147
|
value: 0
|
124
148
|
});
|
125
|
-
/**
|
126
|
-
* The total number of the row header renderers applied to the table through the
|
127
|
-
* `afterGetRowHeaderRenderers` hook.
|
128
|
-
*
|
129
|
-
* @type {number}
|
130
|
-
*/
|
131
149
|
_classPrivateFieldInitSpec(this, _rowHeadersCount, {
|
132
150
|
writable: true,
|
133
151
|
value: 0
|
134
152
|
});
|
135
|
-
/**
|
136
|
-
* The flag determines if the `adjustElementsSize` method call was made during
|
137
|
-
* the render suspending. If true, the method has to be triggered once after render
|
138
|
-
* resuming.
|
139
|
-
*
|
140
|
-
* @private
|
141
|
-
* @type {boolean}
|
142
|
-
*/
|
143
153
|
_defineProperty(this, "postponedAdjustElementsSize", false);
|
144
154
|
this.instance = instance;
|
145
155
|
this.eventManager = new _eventManager.default(this.instance);
|
@@ -287,6 +297,7 @@ var TableView = /*#__PURE__*/function () {
|
|
287
297
|
}, {
|
288
298
|
key: "createElements",
|
289
299
|
value: function createElements() {
|
300
|
+
var _this$settings, _this$settings$data, _this$settings2, _this$settings2$data$;
|
290
301
|
var priv = privatePool.get(this);
|
291
302
|
var _this$instance = this.instance,
|
292
303
|
rootElement = _this$instance.rootElement,
|
@@ -299,6 +310,9 @@ var TableView = /*#__PURE__*/function () {
|
|
299
310
|
(0, _element.addClass)(rootElement, 'handsontable');
|
300
311
|
priv.table = rootDocument.createElement('TABLE');
|
301
312
|
(0, _element.addClass)(priv.table, 'htCore');
|
313
|
+
priv.table.ariaRowCount = (_this$settings = this.settings) === null || _this$settings === void 0 ? void 0 : (_this$settings$data = _this$settings.data) === null || _this$settings$data === void 0 ? void 0 : _this$settings$data.length;
|
314
|
+
priv.table.ariaColCount = (_this$settings2 = this.settings) === null || _this$settings2 === void 0 ? void 0 : (_this$settings2$data$ = _this$settings2.data[0]) === null || _this$settings2$data$ === void 0 ? void 0 : _this$settings2$data$.length;
|
315
|
+
priv.table.setAttribute('role', 'treegrid');
|
302
316
|
if (this.instance.getSettings().tableClassName) {
|
303
317
|
(0, _element.addClass)(priv.table, this.instance.getSettings().tableClassName);
|
304
318
|
}
|
@@ -883,15 +897,29 @@ var TableView = /*#__PURE__*/function () {
|
|
883
897
|
},
|
884
898
|
onBeforeHighlightingRowHeader: function onBeforeHighlightingRowHeader(renderableRow, headerLevel, highlightMeta) {
|
885
899
|
var rowMapper = _this2.instance.rowIndexMapper;
|
886
|
-
var
|
900
|
+
var areColumnHeadersSelected = renderableRow < 0;
|
901
|
+
var visualRow = renderableRow;
|
902
|
+
if (!areColumnHeadersSelected) {
|
903
|
+
visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);
|
904
|
+
}
|
887
905
|
var newVisualRow = _this2.instance.runHooks('beforeHighlightingRowHeader', visualRow, headerLevel, highlightMeta);
|
888
|
-
|
906
|
+
if (!areColumnHeadersSelected) {
|
907
|
+
return rowMapper.getRenderableFromVisualIndex(rowMapper.getNearestNotHiddenIndex(newVisualRow, 1));
|
908
|
+
}
|
909
|
+
return newVisualRow;
|
889
910
|
},
|
890
911
|
onBeforeHighlightingColumnHeader: function onBeforeHighlightingColumnHeader(renderableColumn, headerLevel, highlightMeta) {
|
891
912
|
var columnMapper = _this2.instance.columnIndexMapper;
|
892
|
-
var
|
913
|
+
var areRowHeadersSelected = renderableColumn < 0;
|
914
|
+
var visualColumn = renderableColumn;
|
915
|
+
if (!areRowHeadersSelected) {
|
916
|
+
visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);
|
917
|
+
}
|
893
918
|
var newVisualColumn = _this2.instance.runHooks('beforeHighlightingColumnHeader', visualColumn, headerLevel, highlightMeta);
|
894
|
-
|
919
|
+
if (!areRowHeadersSelected) {
|
920
|
+
return columnMapper.getRenderableFromVisualIndex(columnMapper.getNearestNotHiddenIndex(newVisualColumn, 1));
|
921
|
+
}
|
922
|
+
return newVisualColumn;
|
895
923
|
},
|
896
924
|
onAfterDrawSelection: function onAfterDrawSelection(currentRow, currentColumn, layerLevel) {
|
897
925
|
var cornersOfSelection;
|