handsontable 0.0.0-next-59715d3-20230523 → 0.0.0-next-93e34dc-20230601
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.d.ts +6 -1
- package/3rdparty/walkontable/src/cell/coords.js +61 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +61 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +9 -2
- package/3rdparty/walkontable/src/cell/range.js +44 -7
- package/3rdparty/walkontable/src/cell/range.mjs +44 -7
- 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 +7 -7
- package/3rdparty/walkontable/src/event.mjs +7 -7
- 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 +1 -1
- package/3rdparty/walkontable/src/overlay/_base.mjs +1 -1
- 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 +2 -4
- package/3rdparty/walkontable/src/overlay/top.mjs +2 -4
- 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 +328 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +322 -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/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 +7 -79
- package/3rdparty/walkontable/src/table.mjs +8 -80
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +5 -3
- package/core.js +82 -300
- package/core.mjs +82 -300
- package/dataMap/metaManager/metaSchema.js +15 -0
- package/dataMap/metaManager/metaSchema.mjs +15 -0
- package/dist/handsontable.css +8 -3
- package/dist/handsontable.full.css +8 -3
- package/dist/handsontable.full.js +12245 -9953
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +120 -120
- package/dist/handsontable.js +15898 -13606
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +4 -4
- package/editorManager.js +20 -82
- package/editorManager.mjs +25 -86
- package/editors/textEditor/textEditor.js +3 -11
- package/editors/textEditor/textEditor.mjs +4 -12
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/number.d.ts +1 -0
- package/helpers/number.js +18 -0
- package/helpers/number.mjs +17 -0
- package/package.json +1 -1
- package/pluginHooks.js +1 -1
- package/pluginHooks.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +5 -1
- package/plugins/copyPaste/copyPaste.mjs +5 -1
- package/plugins/customBorders/customBorders.js +18 -52
- package/plugins/customBorders/customBorders.mjs +19 -53
- package/plugins/mergeCells/mergeCells.js +5 -18
- package/plugins/mergeCells/mergeCells.mjs +5 -18
- package/plugins/nestedHeaders/nestedHeaders.js +89 -9
- package/plugins/nestedHeaders/nestedHeaders.mjs +89 -9
- package/plugins/nestedHeaders/stateManager/index.js +37 -0
- package/plugins/nestedHeaders/stateManager/index.mjs +37 -0
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/highlight.js +311 -88
- package/selection/highlight/highlight.mjs +301 -84
- 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 +23 -28
- package/selection/highlight/visualSelection.mjs +23 -28
- package/selection/index.js +4 -7
- package/selection/index.mjs +2 -3
- package/selection/mouseEventHandler.js +1 -1
- package/selection/mouseEventHandler.mjs +1 -1
- package/selection/range.js +8 -8
- package/selection/range.mjs +8 -8
- package/selection/selection.js +296 -180
- package/selection/selection.mjs +291 -179
- package/selection/transformation.js +233 -96
- package/selection/transformation.mjs +230 -93
- package/selection/utils.js +12 -35
- package/selection/utils.mjs +13 -35
- package/settings.d.ts +1 -0
- package/shortcutContexts/commands/editor/closeAndSave.js +15 -0
- package/shortcutContexts/commands/editor/closeAndSave.mjs +10 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +13 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +8 -0
- package/shortcutContexts/commands/editor/fastOpen.js +16 -0
- package/shortcutContexts/commands/editor/fastOpen.mjs +11 -0
- package/shortcutContexts/commands/editor/index.js +16 -0
- package/shortcutContexts/commands/editor/index.mjs +12 -0
- package/shortcutContexts/commands/editor/open.js +29 -0
- package/shortcutContexts/commands/editor/open.mjs +24 -0
- package/shortcutContexts/commands/emptySelectedCells.js +12 -0
- package/shortcutContexts/commands/emptySelectedCells.mjs +7 -0
- package/shortcutContexts/commands/extendCellsSelection/down.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +16 -0
- package/shortcutContexts/commands/extendCellsSelection/index.js +24 -0
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +20 -0
- package/shortcutContexts/commands/extendCellsSelection/left.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/right.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +22 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +12 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +12 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +39 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +34 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +39 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +34 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +22 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +17 -0
- package/shortcutContexts/commands/extendCellsSelection/up.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +16 -0
- package/shortcutContexts/commands/index.js +51 -0
- package/shortcutContexts/commands/index.mjs +47 -0
- package/shortcutContexts/commands/moveCellSelection/down.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/down.mjs +7 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +11 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/index.js +28 -0
- package/shortcutContexts/commands/moveCellSelection/index.mjs +24 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/left.js +11 -0
- package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/right.js +11 -0
- package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +16 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +11 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +12 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +16 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +11 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +35 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +30 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +35 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +30 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +16 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +11 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +18 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/up.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/up.mjs +7 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +11 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +6 -0
- package/shortcutContexts/commands/populateSelectedCellsData.js +35 -0
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +30 -0
- package/shortcutContexts/commands/selectAll.js +11 -0
- package/shortcutContexts/commands/selectAll.mjs +6 -0
- package/shortcutContexts/constants.js +19 -0
- package/shortcutContexts/constants.mjs +12 -0
- package/shortcutContexts/editor.js +29 -0
- package/shortcutContexts/editor.mjs +25 -0
- package/shortcutContexts/grid.js +232 -0
- package/shortcutContexts/grid.mjs +228 -0
- package/shortcutContexts/index.js +29 -0
- package/shortcutContexts/index.mjs +15 -0
- package/tableView.js +58 -9
- package/tableView.mjs +58 -9
- package/3rdparty/walkontable/src/selection.js +0 -354
- package/3rdparty/walkontable/src/selection.mjs +0 -348
- package/selection/highlight/constants.js +0 -16
- package/selection/highlight/constants.mjs +0 -6
@@ -9,10 +9,6 @@ require("core-js/modules/es.symbol.iterator.js");
|
|
9
9
|
require("core-js/modules/es.array.iterator.js");
|
10
10
|
require("core-js/modules/es.string.iterator.js");
|
11
11
|
require("core-js/modules/web.dom-collections.iterator.js");
|
12
|
-
require("core-js/modules/es.array.slice.js");
|
13
|
-
require("core-js/modules/es.function.name.js");
|
14
|
-
require("core-js/modules/es.array.from.js");
|
15
|
-
require("core-js/modules/es.regexp.exec.js");
|
16
12
|
require("core-js/modules/es.weak-map.js");
|
17
13
|
exports.__esModule = true;
|
18
14
|
exports.PLUGIN_PRIORITY = exports.PLUGIN_KEY = exports.CustomBorders = void 0;
|
@@ -38,12 +34,6 @@ var _selection = require("../../selection");
|
|
38
34
|
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); }
|
39
35
|
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; }
|
40
36
|
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); }
|
41
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
42
|
-
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."); }
|
43
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
44
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
45
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
46
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
47
37
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
48
38
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
49
39
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
@@ -229,25 +219,11 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
229
219
|
var selectionType = (0, _selection.detectSelectionType)(selectionRanges);
|
230
220
|
var selectionSchemaNormalizer = (0, _selection.normalizeSelectionFactory)(selectionType);
|
231
221
|
(0, _array.arrayEach)(selectionRanges, function (selection) {
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
columnEnd = _selectionSchemaNorma2[3];
|
238
|
-
var _loop = function _loop(row) {
|
239
|
-
var _loop2 = function _loop2(col) {
|
240
|
-
(0, _array.arrayEach)(borderKeys, function (borderKey) {
|
241
|
-
_this3.prepareBorderFromCustomAdded(row, col, normBorder, (0, _utils.toInlinePropName)(borderKey));
|
242
|
-
});
|
243
|
-
};
|
244
|
-
for (var col = columnStart; col <= columnEnd; col += 1) {
|
245
|
-
_loop2(col);
|
246
|
-
}
|
247
|
-
};
|
248
|
-
for (var row = rowStart; row <= rowEnd; row += 1) {
|
249
|
-
_loop(row);
|
250
|
-
}
|
222
|
+
selectionSchemaNormalizer(selection).forAll(function (row, col) {
|
223
|
+
(0, _array.arrayEach)(borderKeys, function (borderKey) {
|
224
|
+
_this3.prepareBorderFromCustomAdded(row, col, normBorder, (0, _utils.toInlinePropName)(borderKey));
|
225
|
+
});
|
226
|
+
});
|
251
227
|
});
|
252
228
|
|
253
229
|
/*
|
@@ -290,27 +266,13 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
290
266
|
var selectionSchemaNormalizer = (0, _selection.normalizeSelectionFactory)(selectionType);
|
291
267
|
var selectedBorders = [];
|
292
268
|
(0, _array.arrayEach)(selectionRanges, function (selection) {
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
var _loop4 = function _loop4(col) {
|
301
|
-
(0, _array.arrayEach)(_this4.savedBorders, function (border) {
|
302
|
-
if (border.row === row && border.col === col) {
|
303
|
-
selectedBorders.push((0, _utils.denormalizeBorder)(border));
|
304
|
-
}
|
305
|
-
});
|
306
|
-
};
|
307
|
-
for (var col = columnStart; col <= columnEnd; col += 1) {
|
308
|
-
_loop4(col);
|
309
|
-
}
|
310
|
-
};
|
311
|
-
for (var row = rowStart; row <= rowEnd; row += 1) {
|
312
|
-
_loop3(row);
|
313
|
-
}
|
269
|
+
selectionSchemaNormalizer(selection).forAll(function (row, col) {
|
270
|
+
(0, _array.arrayEach)(_this4.savedBorders, function (border) {
|
271
|
+
if (border.row === row && border.col === col) {
|
272
|
+
selectedBorders.push((0, _utils.denormalizeBorder)(border));
|
273
|
+
}
|
274
|
+
});
|
275
|
+
});
|
314
276
|
});
|
315
277
|
return selectedBorders;
|
316
278
|
}
|
@@ -735,10 +697,12 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
735
697
|
}, {
|
736
698
|
key: "checkCustomSelectionsFromContextMenu",
|
737
699
|
value: function checkCustomSelectionsFromContextMenu(border, place, remove) {
|
700
|
+
var _this12 = this;
|
738
701
|
var check = false;
|
739
702
|
(0, _array.arrayEach)(this.hot.selection.highlight.customSelections, function (customSelection) {
|
740
703
|
if (border.id === customSelection.settings.id) {
|
741
|
-
|
704
|
+
var borders = _this12.hot.view._wt.selectionManager.getBorderInstances(customSelection);
|
705
|
+
(0, _array.arrayEach)(borders, function (borderObject) {
|
742
706
|
borderObject.toggleHiddenClass(place, remove); // TODO this also bad?
|
743
707
|
});
|
744
708
|
|
@@ -763,6 +727,7 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
763
727
|
}, {
|
764
728
|
key: "checkCustomSelections",
|
765
729
|
value: function checkCustomSelections(border, cellRange, place) {
|
730
|
+
var _this13 = this;
|
766
731
|
var hideCount = this.countHide(border);
|
767
732
|
var check = false;
|
768
733
|
if (hideCount === 4) {
|
@@ -774,7 +739,8 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
774
739
|
customSelection.visualCellRange = cellRange;
|
775
740
|
customSelection.commit();
|
776
741
|
if (place) {
|
777
|
-
|
742
|
+
var borders = _this13.hot.view._wt.selectionManager.getBorderInstances(customSelection);
|
743
|
+
(0, _array.arrayEach)(borders, function (borderObject) {
|
778
744
|
borderObject.changeBorderStyle(place, border);
|
779
745
|
});
|
780
746
|
}
|
@@ -1,10 +1,4 @@
|
|
1
1
|
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); }
|
2
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
3
|
-
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."); }
|
4
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
5
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
6
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
7
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
8
2
|
import "core-js/modules/es.array.concat.js";
|
9
3
|
import "core-js/modules/es.object.keys.js";
|
10
4
|
import "core-js/modules/es.object.assign.js";
|
@@ -25,10 +19,6 @@ import "core-js/modules/es.symbol.iterator.js";
|
|
25
19
|
import "core-js/modules/es.array.iterator.js";
|
26
20
|
import "core-js/modules/es.string.iterator.js";
|
27
21
|
import "core-js/modules/web.dom-collections.iterator.js";
|
28
|
-
import "core-js/modules/es.array.slice.js";
|
29
|
-
import "core-js/modules/es.function.name.js";
|
30
|
-
import "core-js/modules/es.array.from.js";
|
31
|
-
import "core-js/modules/es.regexp.exec.js";
|
32
22
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
33
23
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
34
24
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
@@ -45,7 +35,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
45
35
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
46
36
|
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); }
|
47
37
|
import { BasePlugin } from "../base/index.mjs";
|
48
|
-
import { hasOwnProperty,
|
38
|
+
import { hasOwnProperty, deepClone } from "../../helpers/object.mjs";
|
49
39
|
import { rangeEach } from "../../helpers/number.mjs";
|
50
40
|
import { arrayEach, arrayReduce, arrayMap } from "../../helpers/array.mjs";
|
51
41
|
import * as C from "../../i18n/constants.mjs";
|
@@ -220,25 +210,11 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
220
210
|
var selectionType = detectSelectionType(selectionRanges);
|
221
211
|
var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
|
222
212
|
arrayEach(selectionRanges, function (selection) {
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
columnEnd = _selectionSchemaNorma2[3];
|
229
|
-
var _loop = function _loop(row) {
|
230
|
-
var _loop2 = function _loop2(col) {
|
231
|
-
arrayEach(borderKeys, function (borderKey) {
|
232
|
-
_this3.prepareBorderFromCustomAdded(row, col, normBorder, toInlinePropName(borderKey));
|
233
|
-
});
|
234
|
-
};
|
235
|
-
for (var col = columnStart; col <= columnEnd; col += 1) {
|
236
|
-
_loop2(col);
|
237
|
-
}
|
238
|
-
};
|
239
|
-
for (var row = rowStart; row <= rowEnd; row += 1) {
|
240
|
-
_loop(row);
|
241
|
-
}
|
213
|
+
selectionSchemaNormalizer(selection).forAll(function (row, col) {
|
214
|
+
arrayEach(borderKeys, function (borderKey) {
|
215
|
+
_this3.prepareBorderFromCustomAdded(row, col, normBorder, toInlinePropName(borderKey));
|
216
|
+
});
|
217
|
+
});
|
242
218
|
});
|
243
219
|
|
244
220
|
/*
|
@@ -281,27 +257,13 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
281
257
|
var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
|
282
258
|
var selectedBorders = [];
|
283
259
|
arrayEach(selectionRanges, function (selection) {
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
var _loop4 = function _loop4(col) {
|
292
|
-
arrayEach(_this4.savedBorders, function (border) {
|
293
|
-
if (border.row === row && border.col === col) {
|
294
|
-
selectedBorders.push(denormalizeBorder(border));
|
295
|
-
}
|
296
|
-
});
|
297
|
-
};
|
298
|
-
for (var col = columnStart; col <= columnEnd; col += 1) {
|
299
|
-
_loop4(col);
|
300
|
-
}
|
301
|
-
};
|
302
|
-
for (var row = rowStart; row <= rowEnd; row += 1) {
|
303
|
-
_loop3(row);
|
304
|
-
}
|
260
|
+
selectionSchemaNormalizer(selection).forAll(function (row, col) {
|
261
|
+
arrayEach(_this4.savedBorders, function (border) {
|
262
|
+
if (border.row === row && border.col === col) {
|
263
|
+
selectedBorders.push(denormalizeBorder(border));
|
264
|
+
}
|
265
|
+
});
|
266
|
+
});
|
305
267
|
});
|
306
268
|
return selectedBorders;
|
307
269
|
}
|
@@ -726,10 +688,12 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
726
688
|
}, {
|
727
689
|
key: "checkCustomSelectionsFromContextMenu",
|
728
690
|
value: function checkCustomSelectionsFromContextMenu(border, place, remove) {
|
691
|
+
var _this12 = this;
|
729
692
|
var check = false;
|
730
693
|
arrayEach(this.hot.selection.highlight.customSelections, function (customSelection) {
|
731
694
|
if (border.id === customSelection.settings.id) {
|
732
|
-
|
695
|
+
var borders = _this12.hot.view._wt.selectionManager.getBorderInstances(customSelection);
|
696
|
+
arrayEach(borders, function (borderObject) {
|
733
697
|
borderObject.toggleHiddenClass(place, remove); // TODO this also bad?
|
734
698
|
});
|
735
699
|
|
@@ -754,6 +718,7 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
754
718
|
}, {
|
755
719
|
key: "checkCustomSelections",
|
756
720
|
value: function checkCustomSelections(border, cellRange, place) {
|
721
|
+
var _this13 = this;
|
757
722
|
var hideCount = this.countHide(border);
|
758
723
|
var check = false;
|
759
724
|
if (hideCount === 4) {
|
@@ -765,7 +730,8 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
765
730
|
customSelection.visualCellRange = cellRange;
|
766
731
|
customSelection.commit();
|
767
732
|
if (place) {
|
768
|
-
|
733
|
+
var borders = _this13.hot.view._wt.selectionManager.getBorderInstances(customSelection);
|
734
|
+
arrayEach(borders, function (borderObject) {
|
769
735
|
borderObject.changeBorderStyle(place, border);
|
770
736
|
});
|
771
737
|
}
|
@@ -242,9 +242,6 @@ var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
242
242
|
this.addHook('afterDrawSelection', function () {
|
243
243
|
return _this2.onAfterDrawSelection.apply(_this2, arguments);
|
244
244
|
});
|
245
|
-
this.addHook('beforeRemoveCellClassNames', function () {
|
246
|
-
return _this2.onBeforeRemoveCellClassNames.apply(_this2, arguments);
|
247
|
-
});
|
248
245
|
this.addHook('beforeUndoStackChange', function (action, source) {
|
249
246
|
if (source === 'MergeCells') {
|
250
247
|
return false;
|
@@ -661,8 +658,11 @@ var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
661
658
|
gridContext.addShortcut({
|
662
659
|
keys: [['Control', 'm']],
|
663
660
|
callback: function callback() {
|
664
|
-
_this7.
|
665
|
-
|
661
|
+
var range = _this7.hot.getSelectedRangeLast();
|
662
|
+
if (range && !range.isSingleHeader()) {
|
663
|
+
_this7.toggleMerge(range);
|
664
|
+
_this7.hot.render();
|
665
|
+
}
|
666
666
|
},
|
667
667
|
runOnlyIf: function runOnlyIf(event) {
|
668
668
|
return !event.altKey;
|
@@ -1339,19 +1339,6 @@ var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
1339
1339
|
}
|
1340
1340
|
return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);
|
1341
1341
|
}
|
1342
|
-
|
1343
|
-
/**
|
1344
|
-
* `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.
|
1345
|
-
*
|
1346
|
-
* @private
|
1347
|
-
* @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from
|
1348
|
-
* all the cells in the table.
|
1349
|
-
*/
|
1350
|
-
}, {
|
1351
|
-
key: "onBeforeRemoveCellClassNames",
|
1352
|
-
value: function onBeforeRemoveCellClassNames() {
|
1353
|
-
return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();
|
1354
|
-
}
|
1355
1342
|
}], [{
|
1356
1343
|
key: "PLUGIN_KEY",
|
1357
1344
|
get: function get() {
|
@@ -235,9 +235,6 @@ export var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
235
235
|
this.addHook('afterDrawSelection', function () {
|
236
236
|
return _this2.onAfterDrawSelection.apply(_this2, arguments);
|
237
237
|
});
|
238
|
-
this.addHook('beforeRemoveCellClassNames', function () {
|
239
|
-
return _this2.onBeforeRemoveCellClassNames.apply(_this2, arguments);
|
240
|
-
});
|
241
238
|
this.addHook('beforeUndoStackChange', function (action, source) {
|
242
239
|
if (source === 'MergeCells') {
|
243
240
|
return false;
|
@@ -654,8 +651,11 @@ export var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
654
651
|
gridContext.addShortcut({
|
655
652
|
keys: [['Control', 'm']],
|
656
653
|
callback: function callback() {
|
657
|
-
_this7.
|
658
|
-
|
654
|
+
var range = _this7.hot.getSelectedRangeLast();
|
655
|
+
if (range && !range.isSingleHeader()) {
|
656
|
+
_this7.toggleMerge(range);
|
657
|
+
_this7.hot.render();
|
658
|
+
}
|
659
659
|
},
|
660
660
|
runOnlyIf: function runOnlyIf(event) {
|
661
661
|
return !event.altKey;
|
@@ -1332,19 +1332,6 @@ export var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
1332
1332
|
}
|
1333
1333
|
return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);
|
1334
1334
|
}
|
1335
|
-
|
1336
|
-
/**
|
1337
|
-
* `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.
|
1338
|
-
*
|
1339
|
-
* @private
|
1340
|
-
* @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from
|
1341
|
-
* all the cells in the table.
|
1342
|
-
*/
|
1343
|
-
}, {
|
1344
|
-
key: "onBeforeRemoveCellClassNames",
|
1345
|
-
value: function onBeforeRemoveCellClassNames() {
|
1346
|
-
return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();
|
1347
|
-
}
|
1348
1335
|
}], [{
|
1349
1336
|
key: "PLUGIN_KEY",
|
1350
1337
|
get: function get() {
|
@@ -201,6 +201,12 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
201
201
|
this.addHook('beforeOnCellMouseOver', function () {
|
202
202
|
return _this2.onBeforeOnCellMouseOver.apply(_this2, arguments);
|
203
203
|
});
|
204
|
+
this.addHook('modifyTransformStart', function () {
|
205
|
+
return _this2.onModifyTransformStart.apply(_this2, arguments);
|
206
|
+
});
|
207
|
+
this.addHook('afterSelection', function () {
|
208
|
+
return _this2.updateFocusHighlightPosition();
|
209
|
+
});
|
204
210
|
this.addHook('afterGetColumnHeaderRenderers', function (array) {
|
205
211
|
return _this2.onAfterGetColumnHeaderRenderers(array);
|
206
212
|
});
|
@@ -219,6 +225,12 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
219
225
|
this.addHook('afterViewportColumnCalculatorOverride', function () {
|
220
226
|
return _this2.onAfterViewportColumnCalculatorOverride.apply(_this2, arguments);
|
221
227
|
});
|
228
|
+
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', function () {
|
229
|
+
return _this2.updateFocusHighlightPosition();
|
230
|
+
});
|
231
|
+
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', function () {
|
232
|
+
return _this2.updateFocusHighlightPosition();
|
233
|
+
});
|
222
234
|
_get(_getPrototypeOf(NestedHeaders.prototype), "enablePlugin", this).call(this);
|
223
235
|
this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
|
224
236
|
}
|
@@ -440,6 +452,34 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
440
452
|
return this.hot.getColHeader(visualColumnIndex, headerLevel);
|
441
453
|
}
|
442
454
|
|
455
|
+
/**
|
456
|
+
* Updates the selection focus highlight position to point to the nested header root element (TH)
|
457
|
+
* even when the logical coordinates point in-between the header.
|
458
|
+
*
|
459
|
+
* @private
|
460
|
+
*/
|
461
|
+
}, {
|
462
|
+
key: "updateFocusHighlightPosition",
|
463
|
+
value: function updateFocusHighlightPosition() {
|
464
|
+
var _this$hot;
|
465
|
+
var selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeLast();
|
466
|
+
if (!selection) {
|
467
|
+
return;
|
468
|
+
}
|
469
|
+
var highlight = selection.highlight;
|
470
|
+
var isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
|
471
|
+
if (isNestedHeadersRange) {
|
472
|
+
var columnIndex = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(highlight.row, highlight.col);
|
473
|
+
var focusHighlight = this.hot.selection.highlight.getFocus();
|
474
|
+
|
475
|
+
// Correct the highlight/focus selection to highlight the correct TH element
|
476
|
+
focusHighlight.visualCellRange.highlight.col = columnIndex;
|
477
|
+
focusHighlight.visualCellRange.from.col = columnIndex;
|
478
|
+
focusHighlight.visualCellRange.to.col = columnIndex;
|
479
|
+
focusHighlight.commit();
|
480
|
+
}
|
481
|
+
}
|
482
|
+
|
443
483
|
/**
|
444
484
|
* Allows to control which header DOM element will be used to highlight.
|
445
485
|
*
|
@@ -456,8 +496,7 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
456
496
|
if (!headerNodeData) {
|
457
497
|
return visualColumn;
|
458
498
|
}
|
459
|
-
var
|
460
|
-
columnCursor = highlightMeta.columnCursor,
|
499
|
+
var columnCursor = highlightMeta.columnCursor,
|
461
500
|
selectionType = highlightMeta.selectionType,
|
462
501
|
selectionWidth = highlightMeta.selectionWidth;
|
463
502
|
var _classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn),
|
@@ -469,8 +508,8 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
469
508
|
}
|
470
509
|
} else if (selectionType === _selection.ACTIVE_HEADER_TYPE) {
|
471
510
|
if (colspan > selectionWidth - columnCursor || !isRoot) {
|
472
|
-
//
|
473
|
-
|
511
|
+
// Prevents adding any CSS class names to the TH element
|
512
|
+
return null;
|
474
513
|
}
|
475
514
|
}
|
476
515
|
return visualColumn;
|
@@ -601,7 +640,7 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
601
640
|
}, {
|
602
641
|
key: "onBeforeOnCellMouseOver",
|
603
642
|
value: function onBeforeOnCellMouseOver(event, coords, TD, controller) {
|
604
|
-
var _this$hot;
|
643
|
+
var _this$hot$selection;
|
605
644
|
if (!this.hot.view.isMouseDown()) {
|
606
645
|
return;
|
607
646
|
}
|
@@ -622,13 +661,54 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
622
661
|
controller.cell = true;
|
623
662
|
var columnsToSelect = [];
|
624
663
|
if (coords.col < from.col) {
|
625
|
-
columnsToSelect.push(bottomEndCoords.col, columnIndex);
|
664
|
+
columnsToSelect.push(bottomEndCoords.col, columnIndex, coords.row);
|
626
665
|
} else if (coords.col > from.col) {
|
627
|
-
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1);
|
666
|
+
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1, coords.row);
|
628
667
|
} else {
|
629
|
-
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1);
|
668
|
+
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1, coords.row);
|
669
|
+
}
|
670
|
+
(_this$hot$selection = this.hot.selection).selectColumns.apply(_this$hot$selection, columnsToSelect);
|
671
|
+
}
|
672
|
+
|
673
|
+
/**
|
674
|
+
* `modifyTransformStart` hook is called every time the keyboard navigation is used.
|
675
|
+
*
|
676
|
+
* @private
|
677
|
+
* @param {object} delta The transformation delta.
|
678
|
+
*/
|
679
|
+
}, {
|
680
|
+
key: "onModifyTransformStart",
|
681
|
+
value: function onModifyTransformStart(delta) {
|
682
|
+
var _this$hot$getSelected = this.hot.getSelectedRangeLast(),
|
683
|
+
highlight = _this$hot$getSelected.highlight;
|
684
|
+
var nextCoords = this.hot._createCellCoords(highlight.row + delta.row, highlight.col + delta.col);
|
685
|
+
var isNestedHeadersRange = nextCoords.isHeader() && nextCoords.col >= 0;
|
686
|
+
if (!isNestedHeadersRange) {
|
687
|
+
return;
|
688
|
+
}
|
689
|
+
var visualColumnIndexStart = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(nextCoords.row, nextCoords.col);
|
690
|
+
var visualColumnIndexEnd = _classPrivateFieldGet(this, _stateManager).findRightMostColumnIndex(nextCoords.row, nextCoords.col);
|
691
|
+
if (delta.col < 0) {
|
692
|
+
var nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexStart - 1 : visualColumnIndexEnd;
|
693
|
+
var notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, -1);
|
694
|
+
if (notHiddenColumnIndex === null) {
|
695
|
+
// There are no visible columns anymore, so move the selection out of the table edge. This will
|
696
|
+
// be processed by the selection Transformer class as a move selection to the previous row (if autoWrapRow is enabled).
|
697
|
+
delta.col = -this.hot.view.countRenderableColumnsInRange(0, highlight.col);
|
698
|
+
} else {
|
699
|
+
delta.col = -Math.max(this.hot.view.countRenderableColumnsInRange(notHiddenColumnIndex, highlight.col) - 1, 1);
|
700
|
+
}
|
701
|
+
} else if (delta.col > 0) {
|
702
|
+
var _nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexEnd + 1 : visualColumnIndexStart;
|
703
|
+
var _notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(_nextColumn, 1);
|
704
|
+
if (_notHiddenColumnIndex === null) {
|
705
|
+
// There are no visible columns anymore, so move the selection out of the table edge. This will
|
706
|
+
// be processed by the selection Transformer class as a move selection to the next row (if autoWrapRow is enabled).
|
707
|
+
delta.col = this.hot.view.countRenderableColumnsInRange(highlight.col, this.hot.countCols());
|
708
|
+
} else {
|
709
|
+
delta.col = Math.max(this.hot.view.countRenderableColumnsInRange(highlight.col, _notHiddenColumnIndex) - 1, 1);
|
710
|
+
}
|
630
711
|
}
|
631
|
-
(_this$hot = this.hot).selectColumns.apply(_this$hot, columnsToSelect);
|
632
712
|
}
|
633
713
|
|
634
714
|
/**
|
@@ -194,6 +194,12 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
194
194
|
this.addHook('beforeOnCellMouseOver', function () {
|
195
195
|
return _this2.onBeforeOnCellMouseOver.apply(_this2, arguments);
|
196
196
|
});
|
197
|
+
this.addHook('modifyTransformStart', function () {
|
198
|
+
return _this2.onModifyTransformStart.apply(_this2, arguments);
|
199
|
+
});
|
200
|
+
this.addHook('afterSelection', function () {
|
201
|
+
return _this2.updateFocusHighlightPosition();
|
202
|
+
});
|
197
203
|
this.addHook('afterGetColumnHeaderRenderers', function (array) {
|
198
204
|
return _this2.onAfterGetColumnHeaderRenderers(array);
|
199
205
|
});
|
@@ -212,6 +218,12 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
212
218
|
this.addHook('afterViewportColumnCalculatorOverride', function () {
|
213
219
|
return _this2.onAfterViewportColumnCalculatorOverride.apply(_this2, arguments);
|
214
220
|
});
|
221
|
+
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', function () {
|
222
|
+
return _this2.updateFocusHighlightPosition();
|
223
|
+
});
|
224
|
+
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', function () {
|
225
|
+
return _this2.updateFocusHighlightPosition();
|
226
|
+
});
|
215
227
|
_get(_getPrototypeOf(NestedHeaders.prototype), "enablePlugin", this).call(this);
|
216
228
|
this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
|
217
229
|
}
|
@@ -433,6 +445,34 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
433
445
|
return this.hot.getColHeader(visualColumnIndex, headerLevel);
|
434
446
|
}
|
435
447
|
|
448
|
+
/**
|
449
|
+
* Updates the selection focus highlight position to point to the nested header root element (TH)
|
450
|
+
* even when the logical coordinates point in-between the header.
|
451
|
+
*
|
452
|
+
* @private
|
453
|
+
*/
|
454
|
+
}, {
|
455
|
+
key: "updateFocusHighlightPosition",
|
456
|
+
value: function updateFocusHighlightPosition() {
|
457
|
+
var _this$hot;
|
458
|
+
var selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeLast();
|
459
|
+
if (!selection) {
|
460
|
+
return;
|
461
|
+
}
|
462
|
+
var highlight = selection.highlight;
|
463
|
+
var isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
|
464
|
+
if (isNestedHeadersRange) {
|
465
|
+
var columnIndex = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(highlight.row, highlight.col);
|
466
|
+
var focusHighlight = this.hot.selection.highlight.getFocus();
|
467
|
+
|
468
|
+
// Correct the highlight/focus selection to highlight the correct TH element
|
469
|
+
focusHighlight.visualCellRange.highlight.col = columnIndex;
|
470
|
+
focusHighlight.visualCellRange.from.col = columnIndex;
|
471
|
+
focusHighlight.visualCellRange.to.col = columnIndex;
|
472
|
+
focusHighlight.commit();
|
473
|
+
}
|
474
|
+
}
|
475
|
+
|
436
476
|
/**
|
437
477
|
* Allows to control which header DOM element will be used to highlight.
|
438
478
|
*
|
@@ -449,8 +489,7 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
449
489
|
if (!headerNodeData) {
|
450
490
|
return visualColumn;
|
451
491
|
}
|
452
|
-
var
|
453
|
-
columnCursor = highlightMeta.columnCursor,
|
492
|
+
var columnCursor = highlightMeta.columnCursor,
|
454
493
|
selectionType = highlightMeta.selectionType,
|
455
494
|
selectionWidth = highlightMeta.selectionWidth;
|
456
495
|
var _classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn),
|
@@ -462,8 +501,8 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
462
501
|
}
|
463
502
|
} else if (selectionType === ACTIVE_HEADER_TYPE) {
|
464
503
|
if (colspan > selectionWidth - columnCursor || !isRoot) {
|
465
|
-
//
|
466
|
-
|
504
|
+
// Prevents adding any CSS class names to the TH element
|
505
|
+
return null;
|
467
506
|
}
|
468
507
|
}
|
469
508
|
return visualColumn;
|
@@ -594,7 +633,7 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
594
633
|
}, {
|
595
634
|
key: "onBeforeOnCellMouseOver",
|
596
635
|
value: function onBeforeOnCellMouseOver(event, coords, TD, controller) {
|
597
|
-
var _this$hot;
|
636
|
+
var _this$hot$selection;
|
598
637
|
if (!this.hot.view.isMouseDown()) {
|
599
638
|
return;
|
600
639
|
}
|
@@ -615,13 +654,54 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
615
654
|
controller.cell = true;
|
616
655
|
var columnsToSelect = [];
|
617
656
|
if (coords.col < from.col) {
|
618
|
-
columnsToSelect.push(bottomEndCoords.col, columnIndex);
|
657
|
+
columnsToSelect.push(bottomEndCoords.col, columnIndex, coords.row);
|
619
658
|
} else if (coords.col > from.col) {
|
620
|
-
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1);
|
659
|
+
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1, coords.row);
|
621
660
|
} else {
|
622
|
-
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1);
|
661
|
+
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1, coords.row);
|
662
|
+
}
|
663
|
+
(_this$hot$selection = this.hot.selection).selectColumns.apply(_this$hot$selection, columnsToSelect);
|
664
|
+
}
|
665
|
+
|
666
|
+
/**
|
667
|
+
* `modifyTransformStart` hook is called every time the keyboard navigation is used.
|
668
|
+
*
|
669
|
+
* @private
|
670
|
+
* @param {object} delta The transformation delta.
|
671
|
+
*/
|
672
|
+
}, {
|
673
|
+
key: "onModifyTransformStart",
|
674
|
+
value: function onModifyTransformStart(delta) {
|
675
|
+
var _this$hot$getSelected = this.hot.getSelectedRangeLast(),
|
676
|
+
highlight = _this$hot$getSelected.highlight;
|
677
|
+
var nextCoords = this.hot._createCellCoords(highlight.row + delta.row, highlight.col + delta.col);
|
678
|
+
var isNestedHeadersRange = nextCoords.isHeader() && nextCoords.col >= 0;
|
679
|
+
if (!isNestedHeadersRange) {
|
680
|
+
return;
|
681
|
+
}
|
682
|
+
var visualColumnIndexStart = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(nextCoords.row, nextCoords.col);
|
683
|
+
var visualColumnIndexEnd = _classPrivateFieldGet(this, _stateManager).findRightMostColumnIndex(nextCoords.row, nextCoords.col);
|
684
|
+
if (delta.col < 0) {
|
685
|
+
var nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexStart - 1 : visualColumnIndexEnd;
|
686
|
+
var notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, -1);
|
687
|
+
if (notHiddenColumnIndex === null) {
|
688
|
+
// There are no visible columns anymore, so move the selection out of the table edge. This will
|
689
|
+
// be processed by the selection Transformer class as a move selection to the previous row (if autoWrapRow is enabled).
|
690
|
+
delta.col = -this.hot.view.countRenderableColumnsInRange(0, highlight.col);
|
691
|
+
} else {
|
692
|
+
delta.col = -Math.max(this.hot.view.countRenderableColumnsInRange(notHiddenColumnIndex, highlight.col) - 1, 1);
|
693
|
+
}
|
694
|
+
} else if (delta.col > 0) {
|
695
|
+
var _nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexEnd + 1 : visualColumnIndexStart;
|
696
|
+
var _notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(_nextColumn, 1);
|
697
|
+
if (_notHiddenColumnIndex === null) {
|
698
|
+
// There are no visible columns anymore, so move the selection out of the table edge. This will
|
699
|
+
// be processed by the selection Transformer class as a move selection to the next row (if autoWrapRow is enabled).
|
700
|
+
delta.col = this.hot.view.countRenderableColumnsInRange(highlight.col, this.hot.countCols());
|
701
|
+
} else {
|
702
|
+
delta.col = Math.max(this.hot.view.countRenderableColumnsInRange(highlight.col, _notHiddenColumnIndex) - 1, 1);
|
703
|
+
}
|
623
704
|
}
|
624
|
-
(_this$hot = this.hot).selectColumns.apply(_this$hot, columnsToSelect);
|
625
705
|
}
|
626
706
|
|
627
707
|
/**
|