handsontable 0.0.0-next-93e34dc-20230601 → 0.0.0-next-b7cca45-20230605
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/{selection/border/border.js → border.js} +12 -7
- package/3rdparty/walkontable/src/{selection/border/border.mjs → border.mjs} +12 -7
- package/3rdparty/walkontable/src/cell/coords.d.ts +1 -6
- package/3rdparty/walkontable/src/cell/coords.js +12 -61
- package/3rdparty/walkontable/src/cell/coords.mjs +12 -61
- package/3rdparty/walkontable/src/cell/range.d.ts +2 -9
- package/3rdparty/walkontable/src/cell/range.js +7 -44
- package/3rdparty/walkontable/src/cell/range.mjs +7 -44
- package/3rdparty/walkontable/src/core/_base.js +3 -9
- package/3rdparty/walkontable/src/core/_base.mjs +3 -9
- 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 +2 -3
- package/3rdparty/walkontable/src/core/core.mjs +2 -3
- 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 +2 -10
- 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 +4 -2
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +4 -2
- package/3rdparty/walkontable/src/overlay/top.js +4 -2
- package/3rdparty/walkontable/src/overlay/top.mjs +4 -2
- package/3rdparty/walkontable/src/selection.js +354 -0
- package/3rdparty/walkontable/src/selection.mjs +348 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +0 -9
- package/3rdparty/walkontable/src/table.js +79 -7
- package/3rdparty/walkontable/src/table.mjs +80 -8
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +3 -5
- package/core.js +300 -82
- package/core.mjs +300 -82
- package/dataMap/metaManager/metaSchema.js +0 -15
- package/dataMap/metaManager/metaSchema.mjs +0 -15
- package/dist/handsontable.css +3 -8
- package/dist/handsontable.full.css +3 -8
- package/dist/handsontable.full.js +9926 -12218
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +120 -120
- package/dist/handsontable.js +14628 -16920
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +4 -4
- package/editorManager.js +82 -20
- package/editorManager.mjs +86 -25
- package/editors/textEditor/textEditor.js +11 -3
- package/editors/textEditor/textEditor.mjs +12 -4
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/number.d.ts +0 -1
- package/helpers/number.js +0 -18
- package/helpers/number.mjs +0 -17
- package/package.json +1 -1
- package/pluginHooks.js +1 -1
- package/pluginHooks.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +1 -5
- package/plugins/copyPaste/copyPaste.mjs +1 -5
- package/plugins/customBorders/customBorders.js +52 -18
- package/plugins/customBorders/customBorders.mjs +53 -19
- package/plugins/mergeCells/mergeCells.js +18 -5
- package/plugins/mergeCells/mergeCells.mjs +18 -5
- package/plugins/nestedHeaders/nestedHeaders.js +9 -89
- package/plugins/nestedHeaders/nestedHeaders.mjs +9 -89
- package/plugins/nestedHeaders/stateManager/index.js +0 -37
- package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/constants.js +16 -0
- package/selection/highlight/constants.mjs +6 -0
- package/selection/highlight/highlight.js +88 -311
- package/selection/highlight/highlight.mjs +84 -301
- package/selection/highlight/types/activeHeader.js +9 -10
- package/selection/highlight/types/activeHeader.mjs +8 -10
- package/selection/highlight/types/area.js +27 -12
- package/selection/highlight/types/area.mjs +30 -16
- package/selection/highlight/types/{focus.js → cell.js} +8 -5
- package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
- package/selection/highlight/types/customSelection.js +10 -7
- package/selection/highlight/types/customSelection.mjs +9 -7
- package/selection/highlight/types/fill.js +8 -5
- package/selection/highlight/types/fill.mjs +7 -5
- package/selection/highlight/types/header.js +20 -10
- package/selection/highlight/types/header.mjs +19 -10
- package/selection/highlight/types/{row.js → index.js} +31 -27
- package/selection/highlight/types/{row.mjs → index.mjs} +29 -24
- package/selection/highlight/visualSelection.js +28 -23
- package/selection/highlight/visualSelection.mjs +28 -23
- package/selection/index.js +7 -4
- package/selection/index.mjs +3 -2
- 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 +180 -296
- package/selection/selection.mjs +179 -291
- package/selection/transformation.js +96 -233
- package/selection/transformation.mjs +93 -230
- package/selection/utils.js +35 -12
- package/selection/utils.mjs +35 -13
- package/settings.d.ts +0 -1
- package/tableView.js +9 -58
- package/tableView.mjs +9 -58
- package/3rdparty/walkontable/src/selection/border/constants.js +0 -18
- package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -13
- package/3rdparty/walkontable/src/selection/constants.js +0 -63
- package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
- package/3rdparty/walkontable/src/selection/index.js +0 -30
- package/3rdparty/walkontable/src/selection/index.mjs +0 -5
- package/3rdparty/walkontable/src/selection/manager.js +0 -328
- package/3rdparty/walkontable/src/selection/manager.mjs +0 -322
- package/3rdparty/walkontable/src/selection/scanner.js +0 -363
- package/3rdparty/walkontable/src/selection/scanner.mjs +0 -359
- package/3rdparty/walkontable/src/selection/selection.js +0 -133
- package/3rdparty/walkontable/src/selection/selection.mjs +0 -127
- package/selection/highlight/types/areaLayered.js +0 -54
- package/selection/highlight/types/areaLayered.mjs +0 -49
- package/selection/highlight/types/column.js +0 -50
- package/selection/highlight/types/column.mjs +0 -45
- package/shortcutContexts/commands/editor/closeAndSave.js +0 -15
- package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -10
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -13
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
- package/shortcutContexts/commands/editor/fastOpen.js +0 -16
- package/shortcutContexts/commands/editor/fastOpen.mjs +0 -11
- package/shortcutContexts/commands/editor/index.js +0 -16
- package/shortcutContexts/commands/editor/index.mjs +0 -12
- package/shortcutContexts/commands/editor/open.js +0 -29
- package/shortcutContexts/commands/editor/open.mjs +0 -24
- package/shortcutContexts/commands/emptySelectedCells.js +0 -12
- package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
- package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -10
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -16
- package/shortcutContexts/commands/extendCellsSelection/index.js +0 -24
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -20
- package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -10
- package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -22
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -17
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -17
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -12
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -17
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -12
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -39
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -34
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -39
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -34
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -22
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -17
- package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -10
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -16
- package/shortcutContexts/commands/index.js +0 -51
- package/shortcutContexts/commands/index.mjs +0 -47
- package/shortcutContexts/commands/moveCellSelection/down.js +0 -12
- package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -7
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -11
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -6
- package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
- package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/left.js +0 -11
- package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
- package/shortcutContexts/commands/moveCellSelection/right.js +0 -11
- package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -16
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -11
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -17
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -12
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -16
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -11
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -35
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -30
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -35
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -30
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -16
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -11
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -18
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -13
- package/shortcutContexts/commands/moveCellSelection/up.js +0 -12
- package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -7
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -11
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -6
- package/shortcutContexts/commands/populateSelectedCellsData.js +0 -35
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -30
- package/shortcutContexts/commands/selectAll.js +0 -11
- package/shortcutContexts/commands/selectAll.mjs +0 -6
- package/shortcutContexts/constants.js +0 -19
- package/shortcutContexts/constants.mjs +0 -12
- package/shortcutContexts/editor.js +0 -29
- package/shortcutContexts/editor.mjs +0 -25
- package/shortcutContexts/grid.js +0 -232
- package/shortcutContexts/grid.mjs +0 -228
- package/shortcutContexts/index.js +0 -29
- package/shortcutContexts/index.mjs +0 -15
@@ -9,6 +9,10 @@ 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");
|
12
16
|
require("core-js/modules/es.weak-map.js");
|
13
17
|
exports.__esModule = true;
|
14
18
|
exports.PLUGIN_PRIORITY = exports.PLUGIN_KEY = exports.CustomBorders = void 0;
|
@@ -34,6 +38,12 @@ var _selection = require("../../selection");
|
|
34
38
|
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); }
|
35
39
|
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; }
|
36
40
|
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; }
|
37
47
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
38
48
|
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); } }
|
39
49
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
@@ -219,11 +229,25 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
219
229
|
var selectionType = (0, _selection.detectSelectionType)(selectionRanges);
|
220
230
|
var selectionSchemaNormalizer = (0, _selection.normalizeSelectionFactory)(selectionType);
|
221
231
|
(0, _array.arrayEach)(selectionRanges, function (selection) {
|
222
|
-
selectionSchemaNormalizer(selection)
|
223
|
-
(
|
224
|
-
|
225
|
-
|
226
|
-
|
232
|
+
var _selectionSchemaNorma = selectionSchemaNormalizer(selection),
|
233
|
+
_selectionSchemaNorma2 = _slicedToArray(_selectionSchemaNorma, 4),
|
234
|
+
rowStart = _selectionSchemaNorma2[0],
|
235
|
+
columnStart = _selectionSchemaNorma2[1],
|
236
|
+
rowEnd = _selectionSchemaNorma2[2],
|
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
|
+
}
|
227
251
|
});
|
228
252
|
|
229
253
|
/*
|
@@ -266,13 +290,27 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
266
290
|
var selectionSchemaNormalizer = (0, _selection.normalizeSelectionFactory)(selectionType);
|
267
291
|
var selectedBorders = [];
|
268
292
|
(0, _array.arrayEach)(selectionRanges, function (selection) {
|
269
|
-
selectionSchemaNormalizer(selection)
|
270
|
-
(
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
293
|
+
var _selectionSchemaNorma3 = selectionSchemaNormalizer(selection),
|
294
|
+
_selectionSchemaNorma4 = _slicedToArray(_selectionSchemaNorma3, 4),
|
295
|
+
rowStart = _selectionSchemaNorma4[0],
|
296
|
+
columnStart = _selectionSchemaNorma4[1],
|
297
|
+
rowEnd = _selectionSchemaNorma4[2],
|
298
|
+
columnEnd = _selectionSchemaNorma4[3];
|
299
|
+
var _loop3 = function _loop3(row) {
|
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
|
+
}
|
276
314
|
});
|
277
315
|
return selectedBorders;
|
278
316
|
}
|
@@ -697,12 +735,10 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
697
735
|
}, {
|
698
736
|
key: "checkCustomSelectionsFromContextMenu",
|
699
737
|
value: function checkCustomSelectionsFromContextMenu(border, place, remove) {
|
700
|
-
var _this12 = this;
|
701
738
|
var check = false;
|
702
739
|
(0, _array.arrayEach)(this.hot.selection.highlight.customSelections, function (customSelection) {
|
703
740
|
if (border.id === customSelection.settings.id) {
|
704
|
-
|
705
|
-
(0, _array.arrayEach)(borders, function (borderObject) {
|
741
|
+
(0, _object.objectEach)(customSelection.instanceBorders, function (borderObject) {
|
706
742
|
borderObject.toggleHiddenClass(place, remove); // TODO this also bad?
|
707
743
|
});
|
708
744
|
|
@@ -727,7 +763,6 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
727
763
|
}, {
|
728
764
|
key: "checkCustomSelections",
|
729
765
|
value: function checkCustomSelections(border, cellRange, place) {
|
730
|
-
var _this13 = this;
|
731
766
|
var hideCount = this.countHide(border);
|
732
767
|
var check = false;
|
733
768
|
if (hideCount === 4) {
|
@@ -739,8 +774,7 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
739
774
|
customSelection.visualCellRange = cellRange;
|
740
775
|
customSelection.commit();
|
741
776
|
if (place) {
|
742
|
-
|
743
|
-
(0, _array.arrayEach)(borders, function (borderObject) {
|
777
|
+
(0, _object.objectEach)(customSelection.instanceBorders, function (borderObject) {
|
744
778
|
borderObject.changeBorderStyle(place, border);
|
745
779
|
});
|
746
780
|
}
|
@@ -1,4 +1,10 @@
|
|
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; }
|
2
8
|
import "core-js/modules/es.array.concat.js";
|
3
9
|
import "core-js/modules/es.object.keys.js";
|
4
10
|
import "core-js/modules/es.object.assign.js";
|
@@ -19,6 +25,10 @@ import "core-js/modules/es.symbol.iterator.js";
|
|
19
25
|
import "core-js/modules/es.array.iterator.js";
|
20
26
|
import "core-js/modules/es.string.iterator.js";
|
21
27
|
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";
|
22
32
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
23
33
|
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); } }
|
24
34
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
@@ -35,7 +45,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
35
45
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
36
46
|
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); }
|
37
47
|
import { BasePlugin } from "../base/index.mjs";
|
38
|
-
import { hasOwnProperty, deepClone } from "../../helpers/object.mjs";
|
48
|
+
import { hasOwnProperty, objectEach, deepClone } from "../../helpers/object.mjs";
|
39
49
|
import { rangeEach } from "../../helpers/number.mjs";
|
40
50
|
import { arrayEach, arrayReduce, arrayMap } from "../../helpers/array.mjs";
|
41
51
|
import * as C from "../../i18n/constants.mjs";
|
@@ -210,11 +220,25 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
210
220
|
var selectionType = detectSelectionType(selectionRanges);
|
211
221
|
var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
|
212
222
|
arrayEach(selectionRanges, function (selection) {
|
213
|
-
selectionSchemaNormalizer(selection)
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
223
|
+
var _selectionSchemaNorma = selectionSchemaNormalizer(selection),
|
224
|
+
_selectionSchemaNorma2 = _slicedToArray(_selectionSchemaNorma, 4),
|
225
|
+
rowStart = _selectionSchemaNorma2[0],
|
226
|
+
columnStart = _selectionSchemaNorma2[1],
|
227
|
+
rowEnd = _selectionSchemaNorma2[2],
|
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
|
+
}
|
218
242
|
});
|
219
243
|
|
220
244
|
/*
|
@@ -257,13 +281,27 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
257
281
|
var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
|
258
282
|
var selectedBorders = [];
|
259
283
|
arrayEach(selectionRanges, function (selection) {
|
260
|
-
selectionSchemaNormalizer(selection)
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
284
|
+
var _selectionSchemaNorma3 = selectionSchemaNormalizer(selection),
|
285
|
+
_selectionSchemaNorma4 = _slicedToArray(_selectionSchemaNorma3, 4),
|
286
|
+
rowStart = _selectionSchemaNorma4[0],
|
287
|
+
columnStart = _selectionSchemaNorma4[1],
|
288
|
+
rowEnd = _selectionSchemaNorma4[2],
|
289
|
+
columnEnd = _selectionSchemaNorma4[3];
|
290
|
+
var _loop3 = function _loop3(row) {
|
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
|
+
}
|
267
305
|
});
|
268
306
|
return selectedBorders;
|
269
307
|
}
|
@@ -688,12 +726,10 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
688
726
|
}, {
|
689
727
|
key: "checkCustomSelectionsFromContextMenu",
|
690
728
|
value: function checkCustomSelectionsFromContextMenu(border, place, remove) {
|
691
|
-
var _this12 = this;
|
692
729
|
var check = false;
|
693
730
|
arrayEach(this.hot.selection.highlight.customSelections, function (customSelection) {
|
694
731
|
if (border.id === customSelection.settings.id) {
|
695
|
-
|
696
|
-
arrayEach(borders, function (borderObject) {
|
732
|
+
objectEach(customSelection.instanceBorders, function (borderObject) {
|
697
733
|
borderObject.toggleHiddenClass(place, remove); // TODO this also bad?
|
698
734
|
});
|
699
735
|
|
@@ -718,7 +754,6 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
718
754
|
}, {
|
719
755
|
key: "checkCustomSelections",
|
720
756
|
value: function checkCustomSelections(border, cellRange, place) {
|
721
|
-
var _this13 = this;
|
722
757
|
var hideCount = this.countHide(border);
|
723
758
|
var check = false;
|
724
759
|
if (hideCount === 4) {
|
@@ -730,8 +765,7 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
|
|
730
765
|
customSelection.visualCellRange = cellRange;
|
731
766
|
customSelection.commit();
|
732
767
|
if (place) {
|
733
|
-
|
734
|
-
arrayEach(borders, function (borderObject) {
|
768
|
+
objectEach(customSelection.instanceBorders, function (borderObject) {
|
735
769
|
borderObject.changeBorderStyle(place, border);
|
736
770
|
});
|
737
771
|
}
|
@@ -242,6 +242,9 @@ 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
|
+
});
|
245
248
|
this.addHook('beforeUndoStackChange', function (action, source) {
|
246
249
|
if (source === 'MergeCells') {
|
247
250
|
return false;
|
@@ -658,11 +661,8 @@ var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
658
661
|
gridContext.addShortcut({
|
659
662
|
keys: [['Control', 'm']],
|
660
663
|
callback: function callback() {
|
661
|
-
|
662
|
-
|
663
|
-
_this7.toggleMerge(range);
|
664
|
-
_this7.hot.render();
|
665
|
-
}
|
664
|
+
_this7.toggleMerge(_this7.hot.getSelectedRangeLast());
|
665
|
+
_this7.hot.render();
|
666
666
|
},
|
667
667
|
runOnlyIf: function runOnlyIf(event) {
|
668
668
|
return !event.altKey;
|
@@ -1339,6 +1339,19 @@ 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
|
+
}
|
1342
1355
|
}], [{
|
1343
1356
|
key: "PLUGIN_KEY",
|
1344
1357
|
get: function get() {
|
@@ -235,6 +235,9 @@ 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
|
+
});
|
238
241
|
this.addHook('beforeUndoStackChange', function (action, source) {
|
239
242
|
if (source === 'MergeCells') {
|
240
243
|
return false;
|
@@ -651,11 +654,8 @@ export var MergeCells = /*#__PURE__*/function (_BasePlugin) {
|
|
651
654
|
gridContext.addShortcut({
|
652
655
|
keys: [['Control', 'm']],
|
653
656
|
callback: function callback() {
|
654
|
-
|
655
|
-
|
656
|
-
_this7.toggleMerge(range);
|
657
|
-
_this7.hot.render();
|
658
|
-
}
|
657
|
+
_this7.toggleMerge(_this7.hot.getSelectedRangeLast());
|
658
|
+
_this7.hot.render();
|
659
659
|
},
|
660
660
|
runOnlyIf: function runOnlyIf(event) {
|
661
661
|
return !event.altKey;
|
@@ -1332,6 +1332,19 @@ 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
|
+
}
|
1335
1348
|
}], [{
|
1336
1349
|
key: "PLUGIN_KEY",
|
1337
1350
|
get: function get() {
|
@@ -201,12 +201,6 @@ 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
|
-
});
|
210
204
|
this.addHook('afterGetColumnHeaderRenderers', function (array) {
|
211
205
|
return _this2.onAfterGetColumnHeaderRenderers(array);
|
212
206
|
});
|
@@ -225,12 +219,6 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
225
219
|
this.addHook('afterViewportColumnCalculatorOverride', function () {
|
226
220
|
return _this2.onAfterViewportColumnCalculatorOverride.apply(_this2, arguments);
|
227
221
|
});
|
228
|
-
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', function () {
|
229
|
-
return _this2.updateFocusHighlightPosition();
|
230
|
-
});
|
231
|
-
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', function () {
|
232
|
-
return _this2.updateFocusHighlightPosition();
|
233
|
-
});
|
234
222
|
_get(_getPrototypeOf(NestedHeaders.prototype), "enablePlugin", this).call(this);
|
235
223
|
this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
|
236
224
|
}
|
@@ -452,34 +440,6 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
452
440
|
return this.hot.getColHeader(visualColumnIndex, headerLevel);
|
453
441
|
}
|
454
442
|
|
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
|
-
|
483
443
|
/**
|
484
444
|
* Allows to control which header DOM element will be used to highlight.
|
485
445
|
*
|
@@ -496,7 +456,8 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
496
456
|
if (!headerNodeData) {
|
497
457
|
return visualColumn;
|
498
458
|
}
|
499
|
-
var
|
459
|
+
var classNames = highlightMeta.classNames,
|
460
|
+
columnCursor = highlightMeta.columnCursor,
|
500
461
|
selectionType = highlightMeta.selectionType,
|
501
462
|
selectionWidth = highlightMeta.selectionWidth;
|
502
463
|
var _classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn),
|
@@ -508,8 +469,8 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
508
469
|
}
|
509
470
|
} else if (selectionType === _selection.ACTIVE_HEADER_TYPE) {
|
510
471
|
if (colspan > selectionWidth - columnCursor || !isRoot) {
|
511
|
-
//
|
512
|
-
|
472
|
+
// Reset the class names array so the generated TH element won't be modified.
|
473
|
+
classNames.length = 0;
|
513
474
|
}
|
514
475
|
}
|
515
476
|
return visualColumn;
|
@@ -640,7 +601,7 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
640
601
|
}, {
|
641
602
|
key: "onBeforeOnCellMouseOver",
|
642
603
|
value: function onBeforeOnCellMouseOver(event, coords, TD, controller) {
|
643
|
-
var _this$hot
|
604
|
+
var _this$hot;
|
644
605
|
if (!this.hot.view.isMouseDown()) {
|
645
606
|
return;
|
646
607
|
}
|
@@ -661,54 +622,13 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
661
622
|
controller.cell = true;
|
662
623
|
var columnsToSelect = [];
|
663
624
|
if (coords.col < from.col) {
|
664
|
-
columnsToSelect.push(bottomEndCoords.col, columnIndex
|
625
|
+
columnsToSelect.push(bottomEndCoords.col, columnIndex);
|
665
626
|
} else if (coords.col > from.col) {
|
666
|
-
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1
|
627
|
+
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1);
|
667
628
|
} else {
|
668
|
-
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1
|
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
|
-
}
|
629
|
+
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1);
|
711
630
|
}
|
631
|
+
(_this$hot = this.hot).selectColumns.apply(_this$hot, columnsToSelect);
|
712
632
|
}
|
713
633
|
|
714
634
|
/**
|
@@ -194,12 +194,6 @@ 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
|
-
});
|
203
197
|
this.addHook('afterGetColumnHeaderRenderers', function (array) {
|
204
198
|
return _this2.onAfterGetColumnHeaderRenderers(array);
|
205
199
|
});
|
@@ -218,12 +212,6 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
218
212
|
this.addHook('afterViewportColumnCalculatorOverride', function () {
|
219
213
|
return _this2.onAfterViewportColumnCalculatorOverride.apply(_this2, arguments);
|
220
214
|
});
|
221
|
-
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', function () {
|
222
|
-
return _this2.updateFocusHighlightPosition();
|
223
|
-
});
|
224
|
-
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', function () {
|
225
|
-
return _this2.updateFocusHighlightPosition();
|
226
|
-
});
|
227
215
|
_get(_getPrototypeOf(NestedHeaders.prototype), "enablePlugin", this).call(this);
|
228
216
|
this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
|
229
217
|
}
|
@@ -445,34 +433,6 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
445
433
|
return this.hot.getColHeader(visualColumnIndex, headerLevel);
|
446
434
|
}
|
447
435
|
|
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
|
-
|
476
436
|
/**
|
477
437
|
* Allows to control which header DOM element will be used to highlight.
|
478
438
|
*
|
@@ -489,7 +449,8 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
489
449
|
if (!headerNodeData) {
|
490
450
|
return visualColumn;
|
491
451
|
}
|
492
|
-
var
|
452
|
+
var classNames = highlightMeta.classNames,
|
453
|
+
columnCursor = highlightMeta.columnCursor,
|
493
454
|
selectionType = highlightMeta.selectionType,
|
494
455
|
selectionWidth = highlightMeta.selectionWidth;
|
495
456
|
var _classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn),
|
@@ -501,8 +462,8 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
501
462
|
}
|
502
463
|
} else if (selectionType === ACTIVE_HEADER_TYPE) {
|
503
464
|
if (colspan > selectionWidth - columnCursor || !isRoot) {
|
504
|
-
//
|
505
|
-
|
465
|
+
// Reset the class names array so the generated TH element won't be modified.
|
466
|
+
classNames.length = 0;
|
506
467
|
}
|
507
468
|
}
|
508
469
|
return visualColumn;
|
@@ -633,7 +594,7 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
633
594
|
}, {
|
634
595
|
key: "onBeforeOnCellMouseOver",
|
635
596
|
value: function onBeforeOnCellMouseOver(event, coords, TD, controller) {
|
636
|
-
var _this$hot
|
597
|
+
var _this$hot;
|
637
598
|
if (!this.hot.view.isMouseDown()) {
|
638
599
|
return;
|
639
600
|
}
|
@@ -654,54 +615,13 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
654
615
|
controller.cell = true;
|
655
616
|
var columnsToSelect = [];
|
656
617
|
if (coords.col < from.col) {
|
657
|
-
columnsToSelect.push(bottomEndCoords.col, columnIndex
|
618
|
+
columnsToSelect.push(bottomEndCoords.col, columnIndex);
|
658
619
|
} else if (coords.col > from.col) {
|
659
|
-
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1
|
620
|
+
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1);
|
660
621
|
} else {
|
661
|
-
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1
|
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
|
-
}
|
622
|
+
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1);
|
704
623
|
}
|
624
|
+
(_this$hot = this.hot).selectColumns.apply(_this$hot, columnsToSelect);
|
705
625
|
}
|
706
626
|
|
707
627
|
/**
|