handsontable 0.0.0-next-a01036f-20230508 → 0.0.0-next-48677e7-20230509
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/cell/coords.js +40 -13
- package/3rdparty/walkontable/src/cell/coords.mjs +40 -13
- package/3rdparty/walkontable/src/cell/range.js +29 -25
- package/3rdparty/walkontable/src/cell/range.mjs +28 -24
- package/3rdparty/walkontable/src/core/_base.js +9 -3
- package/3rdparty/walkontable/src/core/_base.mjs +9 -3
- package/3rdparty/walkontable/src/core/clone.js +2 -2
- package/3rdparty/walkontable/src/core/clone.mjs +2 -2
- package/3rdparty/walkontable/src/core/core.js +3 -2
- package/3rdparty/walkontable/src/core/core.mjs +3 -2
- package/3rdparty/walkontable/src/event.js +12 -10
- package/3rdparty/walkontable/src/event.mjs +12 -10
- package/3rdparty/walkontable/src/facade/core.js +2 -2
- package/3rdparty/walkontable/src/facade/core.mjs +2 -2
- package/3rdparty/walkontable/src/index.js +10 -2
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/_base.js +8 -7
- package/3rdparty/walkontable/src/overlay/_base.mjs +8 -7
- package/3rdparty/walkontable/src/overlay/bottom.js +7 -6
- package/3rdparty/walkontable/src/overlay/bottom.mjs +7 -6
- package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -4
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -4
- package/3rdparty/walkontable/src/overlay/top.js +9 -10
- package/3rdparty/walkontable/src/overlay/top.mjs +9 -10
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +12 -10
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +12 -10
- package/3rdparty/walkontable/src/overlays.js +64 -55
- package/3rdparty/walkontable/src/overlays.mjs +64 -55
- package/3rdparty/walkontable/src/renderer/table.js +2 -0
- package/3rdparty/walkontable/src/renderer/table.mjs +2 -0
- package/3rdparty/walkontable/src/scroll.js +23 -20
- package/3rdparty/walkontable/src/scroll.mjs +23 -20
- package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
- package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
- package/3rdparty/walkontable/src/selection/border/constants.js +18 -0
- package/3rdparty/walkontable/src/selection/border/constants.mjs +13 -0
- package/3rdparty/walkontable/src/selection/constants.js +63 -0
- package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
- package/3rdparty/walkontable/src/selection/index.js +30 -0
- package/3rdparty/walkontable/src/selection/index.mjs +5 -0
- package/3rdparty/walkontable/src/selection/manager.js +334 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +328 -0
- package/3rdparty/walkontable/src/selection/scanner.js +363 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +359 -0
- package/3rdparty/walkontable/src/selection/selection.js +133 -0
- package/3rdparty/walkontable/src/selection/selection.mjs +127 -0
- package/3rdparty/walkontable/src/settings.js +15 -13
- package/3rdparty/walkontable/src/settings.mjs +15 -13
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
- package/3rdparty/walkontable/src/table.js +33 -101
- package/3rdparty/walkontable/src/table.mjs +34 -102
- package/base.js +4 -2
- package/base.mjs +2 -2
- package/core.d.ts +4 -0
- package/core.js +52 -19
- package/core.mjs +52 -19
- package/dataMap/dataSource.js +5 -5
- package/dataMap/dataSource.mjs +5 -5
- package/dataMap/metaManager/metaSchema.js +8 -1
- package/dataMap/metaManager/metaSchema.mjs +8 -1
- package/dist/handsontable.css +7 -2
- package/dist/handsontable.full.css +7 -2
- package/dist/handsontable.full.js +9413 -9096
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +115 -123
- package/dist/handsontable.js +9501 -9183
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +3 -11
- package/dist/languages/all.js +0 -133
- package/dist/languages/ar-AR.js +0 -7
- package/dist/languages/cs-CZ.js +0 -7
- package/dist/languages/de-CH.js +0 -7
- package/dist/languages/de-DE.js +0 -7
- package/dist/languages/en-US.js +0 -7
- package/dist/languages/es-MX.js +0 -7
- package/dist/languages/fr-FR.js +0 -7
- package/dist/languages/it-IT.js +0 -7
- package/dist/languages/ja-JP.js +0 -7
- package/dist/languages/ko-KR.js +0 -7
- package/dist/languages/lv-LV.js +0 -7
- package/dist/languages/nb-NO.js +0 -7
- package/dist/languages/nl-NL.js +0 -7
- package/dist/languages/pl-PL.js +0 -7
- package/dist/languages/pt-BR.js +0 -7
- package/dist/languages/ru-RU.js +0 -7
- package/dist/languages/sr-SP.js +0 -7
- package/dist/languages/zh-CN.js +0 -7
- package/dist/languages/zh-TW.js +0 -7
- package/editorManager.js +7 -3
- package/editorManager.mjs +7 -3
- package/editors/textEditor/textEditor.js +3 -16
- package/editors/textEditor/textEditor.mjs +4 -17
- package/focusManager.d.ts +12 -0
- package/focusManager.js +249 -0
- package/focusManager.mjs +245 -0
- package/helpers/dom/element.js +11 -0
- package/helpers/dom/element.mjs +10 -0
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/i18n/languages/ar-AR.js +1 -7
- package/i18n/languages/cs-CZ.js +1 -7
- package/i18n/languages/de-CH.js +1 -7
- package/i18n/languages/de-DE.js +1 -7
- package/i18n/languages/en-US.js +1 -7
- package/i18n/languages/es-MX.js +1 -7
- package/i18n/languages/fr-FR.js +1 -7
- package/i18n/languages/it-IT.js +1 -7
- package/i18n/languages/ja-JP.js +1 -7
- package/i18n/languages/ko-KR.js +1 -7
- package/i18n/languages/lv-LV.js +1 -7
- package/i18n/languages/nb-NO.js +1 -7
- package/i18n/languages/nl-NL.js +1 -7
- package/i18n/languages/pl-PL.js +1 -7
- package/i18n/languages/pt-BR.js +1 -7
- package/i18n/languages/ru-RU.js +1 -7
- package/i18n/languages/sr-SP.js +1 -7
- package/i18n/languages/zh-CN.js +1 -7
- package/i18n/languages/zh-TW.js +1 -7
- package/languages/all.js +0 -133
- package/languages/ar-AR.js +0 -7
- package/languages/cs-CZ.js +0 -7
- package/languages/de-CH.js +0 -7
- package/languages/de-DE.js +0 -7
- package/languages/en-US.js +0 -7
- package/languages/es-MX.js +0 -7
- package/languages/fr-FR.js +0 -7
- package/languages/index.js +0 -133
- package/languages/it-IT.js +0 -7
- package/languages/ja-JP.js +0 -7
- package/languages/ko-KR.js +0 -7
- package/languages/lv-LV.js +0 -7
- package/languages/nb-NO.js +0 -7
- package/languages/nl-NL.js +0 -7
- package/languages/pl-PL.js +0 -7
- package/languages/pt-BR.js +0 -7
- package/languages/ru-RU.js +0 -7
- package/languages/sr-SP.js +0 -7
- package/languages/zh-CN.js +0 -7
- package/languages/zh-TW.js +0 -7
- package/package.json +2 -3
- package/pluginHooks.js +7 -17
- package/pluginHooks.mjs +4 -16
- package/plugins/autoRowSize/autoRowSize.js +2 -2
- package/plugins/autoRowSize/autoRowSize.mjs +2 -2
- package/plugins/copyPaste/copyPaste.js +12 -93
- package/plugins/copyPaste/copyPaste.mjs +12 -93
- package/plugins/copyPaste/copyableRanges.js +31 -25
- package/plugins/copyPaste/copyableRanges.mjs +24 -18
- package/plugins/customBorders/customBorders.js +6 -2
- package/plugins/customBorders/customBorders.mjs +7 -3
- package/plugins/filters/filters.js +0 -5
- package/plugins/filters/filters.mjs +0 -5
- package/plugins/formulas/formulas.js +168 -190
- package/plugins/formulas/formulas.mjs +168 -190
- package/plugins/mergeCells/mergeCells.js +0 -16
- package/plugins/mergeCells/mergeCells.mjs +0 -16
- package/plugins/nestedHeaders/nestedHeaders.js +3 -4
- package/plugins/nestedHeaders/nestedHeaders.mjs +3 -4
- package/plugins/nestedHeaders/stateManager/headersTree.js +26 -23
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +23 -20
- package/plugins/nestedHeaders/stateManager/index.js +3 -3
- package/plugins/nestedHeaders/stateManager/matrixGenerator.js +0 -1
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +1 -1
- package/plugins/nestedHeaders/utils/ghostTable.js +35 -30
- package/plugins/nestedHeaders/utils/ghostTable.mjs +35 -30
- package/plugins/registry.js +1 -3
- package/plugins/undoRedo/undoRedo.js +1 -0
- package/plugins/undoRedo/undoRedo.mjs +1 -0
- package/renderers/baseRenderer/baseRenderer.js +3 -0
- package/renderers/baseRenderer/baseRenderer.mjs +3 -0
- package/selection/highlight/highlight.js +335 -133
- package/selection/highlight/highlight.mjs +325 -129
- package/selection/highlight/types/activeHeader.js +10 -9
- package/selection/highlight/types/activeHeader.mjs +10 -8
- package/selection/highlight/types/area.js +12 -27
- package/selection/highlight/types/area.mjs +16 -30
- package/selection/highlight/types/areaLayered.js +54 -0
- package/selection/highlight/types/areaLayered.mjs +49 -0
- package/selection/highlight/types/column.js +50 -0
- package/selection/highlight/types/column.mjs +45 -0
- package/selection/highlight/types/customSelection.js +7 -10
- package/selection/highlight/types/customSelection.mjs +7 -9
- package/selection/highlight/types/fill.js +5 -8
- package/selection/highlight/types/fill.mjs +5 -7
- package/selection/highlight/types/{cell.js → focus.js} +5 -8
- package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
- package/selection/highlight/types/header.js +10 -20
- package/selection/highlight/types/header.mjs +10 -19
- package/selection/highlight/types/{index.js → row.js} +27 -31
- package/selection/highlight/types/{index.mjs → row.mjs} +24 -29
- package/selection/highlight/visualSelection.js +12 -21
- package/selection/highlight/visualSelection.mjs +12 -21
- package/selection/index.js +4 -7
- package/selection/index.mjs +2 -3
- package/selection/selection.js +88 -46
- package/selection/selection.mjs +82 -44
- package/settings.d.ts +1 -0
- package/tableView.js +94 -66
- package/tableView.mjs +94 -66
- package/translations/changesObservable/observable.js +46 -41
- package/translations/changesObservable/observable.mjs +41 -36
- package/translations/changesObservable/observer.js +1 -1
- package/translations/indexMapper.js +0 -21
- package/translations/indexMapper.mjs +0 -21
- package/utils/dataStructures/tree.js +18 -15
- package/utils/dataStructures/tree.mjs +18 -15
- package/utils/parseTable.js +1 -5
- package/utils/parseTable.mjs +1 -5
- package/3rdparty/walkontable/src/selection.js +0 -354
- package/3rdparty/walkontable/src/selection.mjs +0 -348
- package/plugins/copyPaste/focusableElement.js +0 -219
- package/plugins/copyPaste/focusableElement.mjs +0 -213
- package/plugins/formulas/indexSyncer/axisSyncer.js +0 -379
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +0 -374
- package/plugins/formulas/indexSyncer/index.js +0 -225
- package/plugins/formulas/indexSyncer/index.mjs +0 -219
- package/selection/highlight/constants.js +0 -16
- package/selection/highlight/constants.mjs +0 -6
@@ -15,7 +15,7 @@ import "core-js/modules/es.symbol.iterator.js";
|
|
15
15
|
import "core-js/modules/es.array.iterator.js";
|
16
16
|
import "core-js/modules/es.string.iterator.js";
|
17
17
|
import "core-js/modules/web.dom-collections.iterator.js";
|
18
|
-
var _excluded = ["headerClassName"
|
18
|
+
var _excluded = ["headerClassName"];
|
19
19
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
20
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
21
21
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
@@ -23,32 +23,23 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
23
23
|
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); }
|
24
24
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
25
25
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
26
|
-
import {
|
26
|
+
import { HIGHLIGHT_HEADER_TYPE } from "../../../3rdparty/walkontable/src/index.mjs";
|
27
27
|
import VisualSelection from "../visualSelection.mjs";
|
28
28
|
/**
|
29
|
-
* Creates the new instance of Selection, responsible for highlighting
|
30
|
-
*
|
29
|
+
* Creates the new instance of Selection, responsible for highlighting column or row headers when
|
30
|
+
* any cell is selected.
|
31
|
+
* This type of selection can occur multiple times.
|
31
32
|
*
|
32
33
|
* @param {object} highlightParams A configuration object to create a highlight.
|
33
34
|
* @param {string} highlightParams.headerClassName Highlighted headers' class name.
|
34
|
-
* @param {string} highlightParams.rowClassName Highlighted row' class name.
|
35
|
-
* @param {string} highlightParams.columnClassName Highlighted column' class name.
|
36
35
|
* @returns {Selection}
|
37
36
|
*/
|
38
|
-
function createHighlight(_ref) {
|
37
|
+
export function createHighlight(_ref) {
|
39
38
|
var headerClassName = _ref.headerClassName,
|
40
|
-
rowClassName = _ref.rowClassName,
|
41
|
-
columnClassName = _ref.columnClassName,
|
42
39
|
restOptions = _objectWithoutProperties(_ref, _excluded);
|
43
|
-
|
44
|
-
className:
|
45
|
-
highlightHeaderClassName: headerClassName,
|
46
|
-
highlightRowClassName: rowClassName,
|
47
|
-
highlightColumnClassName: columnClassName
|
40
|
+
return new VisualSelection(_objectSpread(_objectSpread({
|
41
|
+
className: headerClassName
|
48
42
|
}, restOptions), {}, {
|
49
|
-
|
50
|
-
selectionType: HEADER_TYPE
|
43
|
+
selectionType: HIGHLIGHT_HEADER_TYPE
|
51
44
|
}));
|
52
|
-
|
53
|
-
}
|
54
|
-
export default createHighlight;
|
45
|
+
}
|
@@ -1,6 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
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); }
|
3
4
|
require("core-js/modules/es.object.keys.js");
|
5
|
+
require("core-js/modules/es.array.index-of.js");
|
6
|
+
require("core-js/modules/es.symbol.js");
|
7
|
+
require("core-js/modules/es.symbol.to-primitive.js");
|
8
|
+
require("core-js/modules/es.date.to-primitive.js");
|
9
|
+
require("core-js/modules/es.symbol.description.js");
|
10
|
+
require("core-js/modules/es.object.to-string.js");
|
11
|
+
require("core-js/modules/es.number.constructor.js");
|
4
12
|
require("core-js/modules/es.array.filter.js");
|
5
13
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
6
14
|
require("core-js/modules/web.dom-collections.for-each.js");
|
@@ -11,44 +19,32 @@ require("core-js/modules/es.string.iterator.js");
|
|
11
19
|
require("core-js/modules/web.dom-collections.iterator.js");
|
12
20
|
exports.__esModule = true;
|
13
21
|
exports.createHighlight = createHighlight;
|
14
|
-
require("
|
15
|
-
require("
|
16
|
-
|
17
|
-
require("core-js/modules/es.symbol.description.js");
|
18
|
-
require("core-js/modules/es.object.to-string.js");
|
19
|
-
require("core-js/modules/es.number.constructor.js");
|
20
|
-
var _staticRegister2 = _interopRequireDefault(require("./../../../utils/staticRegister"));
|
21
|
-
var _constants = require("../constants");
|
22
|
-
var _activeHeader = _interopRequireDefault(require("./activeHeader"));
|
23
|
-
var _area = _interopRequireDefault(require("./area"));
|
24
|
-
var _cell = _interopRequireDefault(require("./cell"));
|
25
|
-
var _customSelection = _interopRequireDefault(require("./customSelection"));
|
26
|
-
var _fill = _interopRequireDefault(require("./fill"));
|
27
|
-
var _header = _interopRequireDefault(require("./header"));
|
22
|
+
var _src = require("../../../3rdparty/walkontable/src");
|
23
|
+
var _visualSelection = _interopRequireDefault(require("../visualSelection"));
|
24
|
+
var _excluded = ["rowClassName"];
|
28
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
|
-
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); }
|
30
26
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
31
27
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
32
28
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
33
29
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
34
30
|
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); }
|
35
|
-
var
|
36
|
-
|
37
|
-
getItem = _staticRegister.getItem;
|
38
|
-
register(_constants.ACTIVE_HEADER_TYPE, _activeHeader.default);
|
39
|
-
register(_constants.AREA_TYPE, _area.default);
|
40
|
-
register(_constants.CELL_TYPE, _cell.default);
|
41
|
-
register(_constants.CUSTOM_SELECTION_TYPE, _customSelection.default);
|
42
|
-
register(_constants.FILL_TYPE, _fill.default);
|
43
|
-
register(_constants.HEADER_TYPE, _header.default);
|
44
|
-
|
31
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
32
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
45
33
|
/**
|
46
|
-
*
|
47
|
-
*
|
34
|
+
* Creates the new instance of Selection, responsible for highlighting cells in a rows and
|
35
|
+
* row headers.
|
36
|
+
* This type of selection can occur multiple times.
|
37
|
+
*
|
38
|
+
* @param {object} highlightParams A configuration object to create a highlight.
|
39
|
+
* @param {string} highlightParams.rowClassName Highlighted row' class name.
|
48
40
|
* @returns {Selection}
|
49
41
|
*/
|
50
|
-
function createHighlight(
|
51
|
-
|
52
|
-
|
53
|
-
|
42
|
+
function createHighlight(_ref) {
|
43
|
+
var rowClassName = _ref.rowClassName,
|
44
|
+
restOptions = _objectWithoutProperties(_ref, _excluded);
|
45
|
+
return new _visualSelection.default(_objectSpread(_objectSpread({
|
46
|
+
className: rowClassName
|
47
|
+
}, restOptions), {}, {
|
48
|
+
selectionType: _src.HIGHLIGHT_ROW_TYPE
|
49
|
+
}));
|
54
50
|
}
|
@@ -1,10 +1,12 @@
|
|
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
|
+
import "core-js/modules/es.object.keys.js";
|
3
|
+
import "core-js/modules/es.array.index-of.js";
|
4
|
+
import "core-js/modules/es.symbol.js";
|
1
5
|
import "core-js/modules/es.symbol.to-primitive.js";
|
2
6
|
import "core-js/modules/es.date.to-primitive.js";
|
3
|
-
import "core-js/modules/es.symbol.js";
|
4
7
|
import "core-js/modules/es.symbol.description.js";
|
5
8
|
import "core-js/modules/es.object.to-string.js";
|
6
9
|
import "core-js/modules/es.number.constructor.js";
|
7
|
-
import "core-js/modules/es.object.keys.js";
|
8
10
|
import "core-js/modules/es.array.filter.js";
|
9
11
|
import "core-js/modules/es.object.get-own-property-descriptor.js";
|
10
12
|
import "core-js/modules/web.dom-collections.for-each.js";
|
@@ -13,38 +15,31 @@ import "core-js/modules/es.symbol.iterator.js";
|
|
13
15
|
import "core-js/modules/es.array.iterator.js";
|
14
16
|
import "core-js/modules/es.string.iterator.js";
|
15
17
|
import "core-js/modules/web.dom-collections.iterator.js";
|
16
|
-
|
18
|
+
var _excluded = ["rowClassName"];
|
17
19
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
18
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
19
21
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
20
22
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
21
23
|
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); }
|
22
|
-
|
23
|
-
|
24
|
-
import
|
25
|
-
import
|
26
|
-
import cellHighlight from "./cell.mjs";
|
27
|
-
import customSelection from "./customSelection.mjs";
|
28
|
-
import fillHighlight from "./fill.mjs";
|
29
|
-
import headerHighlight from "./header.mjs";
|
30
|
-
var _staticRegister = staticRegister('highlight/types'),
|
31
|
-
register = _staticRegister.register,
|
32
|
-
getItem = _staticRegister.getItem;
|
33
|
-
register(ACTIVE_HEADER_TYPE, activeHeaderHighlight);
|
34
|
-
register(AREA_TYPE, areaHighlight);
|
35
|
-
register(CELL_TYPE, cellHighlight);
|
36
|
-
register(CUSTOM_SELECTION_TYPE, customSelection);
|
37
|
-
register(FILL_TYPE, fillHighlight);
|
38
|
-
register(HEADER_TYPE, headerHighlight);
|
39
|
-
|
24
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
25
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
26
|
+
import { HIGHLIGHT_ROW_TYPE } from "../../../3rdparty/walkontable/src/index.mjs";
|
27
|
+
import VisualSelection from "../visualSelection.mjs";
|
40
28
|
/**
|
41
|
-
*
|
42
|
-
*
|
29
|
+
* Creates the new instance of Selection, responsible for highlighting cells in a rows and
|
30
|
+
* row headers.
|
31
|
+
* This type of selection can occur multiple times.
|
32
|
+
*
|
33
|
+
* @param {object} highlightParams A configuration object to create a highlight.
|
34
|
+
* @param {string} highlightParams.rowClassName Highlighted row' class name.
|
43
35
|
* @returns {Selection}
|
44
36
|
*/
|
45
|
-
function createHighlight(
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
37
|
+
export function createHighlight(_ref) {
|
38
|
+
var rowClassName = _ref.rowClassName,
|
39
|
+
restOptions = _objectWithoutProperties(_ref, _excluded);
|
40
|
+
return new VisualSelection(_objectSpread(_objectSpread({
|
41
|
+
className: rowClassName
|
42
|
+
}, restOptions), {}, {
|
43
|
+
selectionType: HIGHLIGHT_ROW_TYPE
|
44
|
+
}));
|
45
|
+
}
|
@@ -37,15 +37,16 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
37
37
|
var VisualSelection = /*#__PURE__*/function (_Selection) {
|
38
38
|
_inherits(VisualSelection, _Selection);
|
39
39
|
var _super = _createSuper(VisualSelection);
|
40
|
+
/**
|
41
|
+
* Range of selection visually. Visual representation may have representation in a rendered selection.
|
42
|
+
*
|
43
|
+
* @type {null|CellRange}
|
44
|
+
*/
|
45
|
+
|
40
46
|
function VisualSelection(settings, visualCellRange) {
|
41
47
|
var _this;
|
42
48
|
_classCallCheck(this, VisualSelection);
|
43
49
|
_this = _super.call(this, settings, null);
|
44
|
-
/**
|
45
|
-
* Range of selection visually. Visual representation may have representation in a rendered selection.
|
46
|
-
*
|
47
|
-
* @type {null|CellRange}
|
48
|
-
*/
|
49
50
|
_defineProperty(_assertThisInitialized(_this), "visualCellRange", null);
|
50
51
|
_this.visualCellRange = visualCellRange || null;
|
51
52
|
_this.commit();
|
@@ -99,10 +100,6 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
|
|
99
100
|
return null;
|
100
101
|
}
|
101
102
|
if (visibleFromCoords.row > visibleToCoords.row || visibleFromCoords.col > visibleToCoords.col) {
|
102
|
-
var isHeaderTypeSelection = this.settings.type === 'header' || this.settings.type === 'active-header';
|
103
|
-
if (!isHeaderTypeSelection) {
|
104
|
-
return null;
|
105
|
-
}
|
106
103
|
visibleFromCoords = from;
|
107
104
|
visibleToCoords = to;
|
108
105
|
}
|
@@ -155,12 +152,7 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
|
|
155
152
|
if (visualIndex < 0) {
|
156
153
|
return visualIndex;
|
157
154
|
}
|
158
|
-
|
159
|
-
var isHeaderSelectionType = this.settings.type === 'header' || this.settings.type === 'active-header';
|
160
|
-
if (isHeaderSelectionType && nearestVisualIndex === null) {
|
161
|
-
return -1;
|
162
|
-
}
|
163
|
-
return nearestVisualIndex;
|
155
|
+
return indexMapper.getNearestNotHiddenIndex(visualIndex, searchDirection);
|
164
156
|
}
|
165
157
|
|
166
158
|
/**
|
@@ -236,11 +228,7 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
|
|
236
228
|
var _this$cellRange = this.cellRange,
|
237
229
|
from = _this$cellRange.from,
|
238
230
|
to = _this$cellRange.to;
|
239
|
-
|
240
|
-
var isColumnUndefined = from.col === null || to.col === null;
|
241
|
-
var topLeftCorner = this.settings.createCellCoords(isRowUndefined ? null : Math.min(from.row, to.row), isColumnUndefined ? null : Math.min(from.col, to.col));
|
242
|
-
var bottomRightCorner = this.settings.createCellCoords(isRowUndefined ? null : Math.max(from.row, to.row), isColumnUndefined ? null : Math.max(from.col, to.col));
|
243
|
-
return [topLeftCorner.row, topLeftCorner.col, bottomRightCorner.row, bottomRightCorner.col];
|
231
|
+
return [Math.min(from.row, to.row), Math.min(from.col, to.col), Math.max(from.row, to.row), Math.max(from.col, to.col)];
|
244
232
|
}
|
245
233
|
|
246
234
|
/**
|
@@ -265,13 +253,16 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
|
|
265
253
|
* points to the beginning of the selection.
|
266
254
|
* @param {CellCoords} visualToCoords The CellCoords object which contains coordinates that
|
267
255
|
* points to the end of the selection.
|
268
|
-
* @returns {CellRange}
|
256
|
+
* @returns {CellRange|null}
|
269
257
|
*/
|
270
258
|
}, {
|
271
259
|
key: "createRenderableCellRange",
|
272
260
|
value: function createRenderableCellRange(visualFromCoords, visualToCoords) {
|
273
261
|
var renderableFromCoords = this.settings.visualToRenderableCoords(visualFromCoords);
|
274
262
|
var renderableToCoords = this.settings.visualToRenderableCoords(visualToCoords);
|
263
|
+
if (renderableFromCoords.row === null || renderableFromCoords.col === null || renderableToCoords.row === null || renderableToCoords.col === null) {
|
264
|
+
return null;
|
265
|
+
}
|
275
266
|
return this.settings.createCellRange(renderableFromCoords, renderableFromCoords, renderableToCoords);
|
276
267
|
}
|
277
268
|
}]);
|
@@ -33,15 +33,16 @@ import { Selection } from "./../../3rdparty/walkontable/src/index.mjs";
|
|
33
33
|
var VisualSelection = /*#__PURE__*/function (_Selection) {
|
34
34
|
_inherits(VisualSelection, _Selection);
|
35
35
|
var _super = _createSuper(VisualSelection);
|
36
|
+
/**
|
37
|
+
* Range of selection visually. Visual representation may have representation in a rendered selection.
|
38
|
+
*
|
39
|
+
* @type {null|CellRange}
|
40
|
+
*/
|
41
|
+
|
36
42
|
function VisualSelection(settings, visualCellRange) {
|
37
43
|
var _this;
|
38
44
|
_classCallCheck(this, VisualSelection);
|
39
45
|
_this = _super.call(this, settings, null);
|
40
|
-
/**
|
41
|
-
* Range of selection visually. Visual representation may have representation in a rendered selection.
|
42
|
-
*
|
43
|
-
* @type {null|CellRange}
|
44
|
-
*/
|
45
46
|
_defineProperty(_assertThisInitialized(_this), "visualCellRange", null);
|
46
47
|
_this.visualCellRange = visualCellRange || null;
|
47
48
|
_this.commit();
|
@@ -95,10 +96,6 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
|
|
95
96
|
return null;
|
96
97
|
}
|
97
98
|
if (visibleFromCoords.row > visibleToCoords.row || visibleFromCoords.col > visibleToCoords.col) {
|
98
|
-
var isHeaderTypeSelection = this.settings.type === 'header' || this.settings.type === 'active-header';
|
99
|
-
if (!isHeaderTypeSelection) {
|
100
|
-
return null;
|
101
|
-
}
|
102
99
|
visibleFromCoords = from;
|
103
100
|
visibleToCoords = to;
|
104
101
|
}
|
@@ -151,12 +148,7 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
|
|
151
148
|
if (visualIndex < 0) {
|
152
149
|
return visualIndex;
|
153
150
|
}
|
154
|
-
|
155
|
-
var isHeaderSelectionType = this.settings.type === 'header' || this.settings.type === 'active-header';
|
156
|
-
if (isHeaderSelectionType && nearestVisualIndex === null) {
|
157
|
-
return -1;
|
158
|
-
}
|
159
|
-
return nearestVisualIndex;
|
151
|
+
return indexMapper.getNearestNotHiddenIndex(visualIndex, searchDirection);
|
160
152
|
}
|
161
153
|
|
162
154
|
/**
|
@@ -232,11 +224,7 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
|
|
232
224
|
var _this$cellRange = this.cellRange,
|
233
225
|
from = _this$cellRange.from,
|
234
226
|
to = _this$cellRange.to;
|
235
|
-
|
236
|
-
var isColumnUndefined = from.col === null || to.col === null;
|
237
|
-
var topLeftCorner = this.settings.createCellCoords(isRowUndefined ? null : Math.min(from.row, to.row), isColumnUndefined ? null : Math.min(from.col, to.col));
|
238
|
-
var bottomRightCorner = this.settings.createCellCoords(isRowUndefined ? null : Math.max(from.row, to.row), isColumnUndefined ? null : Math.max(from.col, to.col));
|
239
|
-
return [topLeftCorner.row, topLeftCorner.col, bottomRightCorner.row, bottomRightCorner.col];
|
227
|
+
return [Math.min(from.row, to.row), Math.min(from.col, to.col), Math.max(from.row, to.row), Math.max(from.col, to.col)];
|
240
228
|
}
|
241
229
|
|
242
230
|
/**
|
@@ -261,13 +249,16 @@ var VisualSelection = /*#__PURE__*/function (_Selection) {
|
|
261
249
|
* points to the beginning of the selection.
|
262
250
|
* @param {CellCoords} visualToCoords The CellCoords object which contains coordinates that
|
263
251
|
* points to the end of the selection.
|
264
|
-
* @returns {CellRange}
|
252
|
+
* @returns {CellRange|null}
|
265
253
|
*/
|
266
254
|
}, {
|
267
255
|
key: "createRenderableCellRange",
|
268
256
|
value: function createRenderableCellRange(visualFromCoords, visualToCoords) {
|
269
257
|
var renderableFromCoords = this.settings.visualToRenderableCoords(visualFromCoords);
|
270
258
|
var renderableToCoords = this.settings.visualToRenderableCoords(visualToCoords);
|
259
|
+
if (renderableFromCoords.row === null || renderableFromCoords.col === null || renderableToCoords.row === null || renderableToCoords.col === null) {
|
260
|
+
return null;
|
261
|
+
}
|
271
262
|
return this.settings.createCellRange(renderableFromCoords, renderableFromCoords, renderableToCoords);
|
272
263
|
}
|
273
264
|
}]);
|
package/selection/index.js
CHANGED
@@ -5,14 +5,11 @@ require("core-js/modules/web.dom-collections.for-each.js");
|
|
5
5
|
require("core-js/modules/es.object.keys.js");
|
6
6
|
exports.__esModule = true;
|
7
7
|
var _exportNames = {
|
8
|
-
Highlight: true,
|
9
8
|
Selection: true,
|
10
9
|
handleMouseEvent: true,
|
11
10
|
detectSelectionType: true,
|
12
11
|
normalizeSelectionFactory: true
|
13
12
|
};
|
14
|
-
var _highlight = _interopRequireDefault(require("./highlight/highlight"));
|
15
|
-
exports.Highlight = _highlight.default;
|
16
13
|
var _selection = _interopRequireDefault(require("./selection"));
|
17
14
|
exports.Selection = _selection.default;
|
18
15
|
var _mouseEventHandler = require("./mouseEventHandler");
|
@@ -20,11 +17,11 @@ exports.handleMouseEvent = _mouseEventHandler.handleMouseEvent;
|
|
20
17
|
var _utils = require("./utils");
|
21
18
|
exports.detectSelectionType = _utils.detectSelectionType;
|
22
19
|
exports.normalizeSelectionFactory = _utils.normalizeSelectionFactory;
|
23
|
-
var
|
24
|
-
Object.keys(
|
20
|
+
var _highlight = require("./highlight/highlight");
|
21
|
+
Object.keys(_highlight).forEach(function (key) {
|
25
22
|
if (key === "default" || key === "__esModule") return;
|
26
23
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
27
|
-
if (key in exports && exports[key] ===
|
28
|
-
exports[key] =
|
24
|
+
if (key in exports && exports[key] === _highlight[key]) return;
|
25
|
+
exports[key] = _highlight[key];
|
29
26
|
});
|
30
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/selection/index.mjs
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import Highlight from "./highlight/highlight.mjs";
|
2
1
|
import Selection from "./selection.mjs";
|
3
2
|
import { handleMouseEvent } from "./mouseEventHandler.mjs";
|
4
3
|
import { detectSelectionType, normalizeSelectionFactory } from "./utils.mjs";
|
5
|
-
export * from "./highlight/
|
6
|
-
export { handleMouseEvent,
|
4
|
+
export * from "./highlight/highlight.mjs";
|
5
|
+
export { handleMouseEvent, Selection, detectSelectionType, normalizeSelectionFactory };
|