handsontable 0.0.0-next-48677e7-20230509 → 0.0.0-next-834f47e-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/{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.js +13 -40
- package/3rdparty/walkontable/src/cell/coords.mjs +13 -40
- package/3rdparty/walkontable/src/cell/range.js +25 -29
- package/3rdparty/walkontable/src/cell/range.mjs +24 -28
- 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 +10 -12
- package/3rdparty/walkontable/src/event.mjs +10 -12
- 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 +7 -8
- package/3rdparty/walkontable/src/overlay/_base.mjs +7 -8
- package/3rdparty/walkontable/src/overlay/bottom.js +6 -7
- package/3rdparty/walkontable/src/overlay/bottom.mjs +6 -7
- 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 +10 -9
- package/3rdparty/walkontable/src/overlay/top.mjs +10 -9
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +10 -12
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +10 -12
- package/3rdparty/walkontable/src/overlays.js +55 -64
- package/3rdparty/walkontable/src/overlays.mjs +55 -64
- package/3rdparty/walkontable/src/renderer/table.js +0 -2
- package/3rdparty/walkontable/src/renderer/table.mjs +0 -2
- package/3rdparty/walkontable/src/scroll.js +20 -23
- package/3rdparty/walkontable/src/scroll.mjs +20 -23
- package/3rdparty/walkontable/src/selection.js +354 -0
- package/3rdparty/walkontable/src/selection.mjs +348 -0
- package/3rdparty/walkontable/src/settings.js +13 -15
- package/3rdparty/walkontable/src/settings.mjs +13 -15
- 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 +101 -33
- package/3rdparty/walkontable/src/table.mjs +102 -34
- package/base.js +2 -4
- package/base.mjs +2 -2
- package/core.d.ts +0 -4
- package/core.js +19 -52
- package/core.mjs +19 -52
- package/dataMap/dataSource.js +5 -5
- package/dataMap/dataSource.mjs +5 -5
- package/dataMap/metaManager/metaSchema.js +1 -8
- package/dataMap/metaManager/metaSchema.mjs +1 -8
- package/dist/handsontable.css +2 -7
- package/dist/handsontable.full.css +2 -7
- package/dist/handsontable.full.js +9162 -9474
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +123 -115
- package/dist/handsontable.js +8763 -9076
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +11 -3
- package/dist/languages/all.js +133 -0
- package/dist/languages/ar-AR.js +7 -0
- package/dist/languages/cs-CZ.js +7 -0
- package/dist/languages/de-CH.js +7 -0
- package/dist/languages/de-DE.js +7 -0
- package/dist/languages/en-US.js +7 -0
- package/dist/languages/es-MX.js +7 -0
- package/dist/languages/fr-FR.js +7 -0
- package/dist/languages/it-IT.js +7 -0
- package/dist/languages/ja-JP.js +7 -0
- package/dist/languages/ko-KR.js +7 -0
- package/dist/languages/lv-LV.js +7 -0
- package/dist/languages/nb-NO.js +7 -0
- package/dist/languages/nl-NL.js +7 -0
- package/dist/languages/pl-PL.js +7 -0
- package/dist/languages/pt-BR.js +7 -0
- package/dist/languages/ru-RU.js +7 -0
- package/dist/languages/sr-SP.js +7 -0
- package/dist/languages/zh-CN.js +7 -0
- package/dist/languages/zh-TW.js +7 -0
- package/editorManager.js +3 -7
- package/editorManager.mjs +3 -7
- package/editors/textEditor/textEditor.js +16 -3
- package/editors/textEditor/textEditor.mjs +17 -4
- package/helpers/dom/element.js +0 -11
- package/helpers/dom/element.mjs +0 -10
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/i18n/languages/ar-AR.js +7 -1
- package/i18n/languages/cs-CZ.js +7 -1
- package/i18n/languages/de-CH.js +7 -1
- package/i18n/languages/de-DE.js +7 -1
- package/i18n/languages/en-US.js +7 -1
- package/i18n/languages/es-MX.js +7 -1
- package/i18n/languages/fr-FR.js +7 -1
- package/i18n/languages/it-IT.js +7 -1
- package/i18n/languages/ja-JP.js +7 -1
- package/i18n/languages/ko-KR.js +7 -1
- package/i18n/languages/lv-LV.js +7 -1
- package/i18n/languages/nb-NO.js +7 -1
- package/i18n/languages/nl-NL.js +7 -1
- package/i18n/languages/pl-PL.js +7 -1
- package/i18n/languages/pt-BR.js +7 -1
- package/i18n/languages/ru-RU.js +7 -1
- package/i18n/languages/sr-SP.js +7 -1
- package/i18n/languages/zh-CN.js +7 -1
- package/i18n/languages/zh-TW.js +7 -1
- package/languages/all.js +133 -0
- package/languages/ar-AR.js +7 -0
- package/languages/cs-CZ.js +7 -0
- package/languages/de-CH.js +7 -0
- package/languages/de-DE.js +7 -0
- package/languages/en-US.js +7 -0
- package/languages/es-MX.js +7 -0
- package/languages/fr-FR.js +7 -0
- package/languages/index.js +133 -0
- package/languages/it-IT.js +7 -0
- package/languages/ja-JP.js +7 -0
- package/languages/ko-KR.js +7 -0
- package/languages/lv-LV.js +7 -0
- package/languages/nb-NO.js +7 -0
- package/languages/nl-NL.js +7 -0
- package/languages/pl-PL.js +7 -0
- package/languages/pt-BR.js +7 -0
- package/languages/ru-RU.js +7 -0
- package/languages/sr-SP.js +7 -0
- package/languages/zh-CN.js +7 -0
- package/languages/zh-TW.js +7 -0
- package/package.json +3 -2
- package/pluginHooks.js +17 -7
- package/pluginHooks.mjs +16 -4
- package/plugins/autoRowSize/autoRowSize.js +2 -2
- package/plugins/autoRowSize/autoRowSize.mjs +2 -2
- package/plugins/copyPaste/copyPaste.js +93 -12
- package/plugins/copyPaste/copyPaste.mjs +93 -12
- package/plugins/copyPaste/copyableRanges.js +25 -31
- package/plugins/copyPaste/copyableRanges.mjs +18 -24
- package/plugins/copyPaste/focusableElement.js +219 -0
- package/plugins/copyPaste/focusableElement.mjs +213 -0
- package/plugins/customBorders/customBorders.js +2 -6
- package/plugins/customBorders/customBorders.mjs +3 -7
- package/plugins/filters/filters.js +5 -0
- package/plugins/filters/filters.mjs +5 -0
- package/plugins/formulas/formulas.js +190 -168
- package/plugins/formulas/formulas.mjs +190 -168
- package/plugins/formulas/indexSyncer/axisSyncer.js +379 -0
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +374 -0
- package/plugins/formulas/indexSyncer/index.js +225 -0
- package/plugins/formulas/indexSyncer/index.mjs +219 -0
- package/plugins/mergeCells/mergeCells.js +16 -0
- package/plugins/mergeCells/mergeCells.mjs +16 -0
- package/plugins/nestedHeaders/nestedHeaders.js +4 -3
- package/plugins/nestedHeaders/nestedHeaders.mjs +4 -3
- package/plugins/nestedHeaders/stateManager/headersTree.js +23 -26
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +20 -23
- package/plugins/nestedHeaders/stateManager/index.js +3 -3
- package/plugins/nestedHeaders/stateManager/matrixGenerator.js +1 -0
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +1 -1
- package/plugins/nestedHeaders/utils/ghostTable.js +30 -35
- package/plugins/nestedHeaders/utils/ghostTable.mjs +30 -35
- package/plugins/registry.js +3 -1
- package/plugins/undoRedo/undoRedo.js +0 -1
- package/plugins/undoRedo/undoRedo.mjs +0 -1
- package/renderers/baseRenderer/baseRenderer.js +0 -3
- package/renderers/baseRenderer/baseRenderer.mjs +0 -3
- package/selection/highlight/constants.js +16 -0
- package/selection/highlight/constants.mjs +6 -0
- package/selection/highlight/highlight.js +133 -335
- package/selection/highlight/highlight.mjs +129 -325
- 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 +21 -12
- package/selection/highlight/visualSelection.mjs +21 -12
- package/selection/index.js +7 -4
- package/selection/index.mjs +3 -2
- package/selection/selection.js +46 -88
- package/selection/selection.mjs +44 -82
- package/settings.d.ts +0 -1
- package/tableView.js +66 -94
- package/tableView.mjs +66 -94
- package/translations/changesObservable/observable.js +41 -46
- package/translations/changesObservable/observable.mjs +36 -41
- package/translations/changesObservable/observer.js +1 -1
- package/translations/indexMapper.js +21 -0
- package/translations/indexMapper.mjs +21 -0
- package/utils/dataStructures/tree.js +15 -18
- package/utils/dataStructures/tree.mjs +15 -18
- package/utils/parseTable.js +5 -1
- package/utils/parseTable.mjs +5 -1
- 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 -334
- package/3rdparty/walkontable/src/selection/manager.mjs +0 -328
- 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/focusManager.d.ts +0 -12
- package/focusManager.js +0 -249
- package/focusManager.mjs +0 -245
- 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/focusManager.js
DELETED
@@ -1,249 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
require("core-js/modules/es.symbol.to-primitive.js");
|
4
|
-
require("core-js/modules/es.date.to-primitive.js");
|
5
|
-
require("core-js/modules/es.symbol.js");
|
6
|
-
require("core-js/modules/es.symbol.description.js");
|
7
|
-
require("core-js/modules/es.number.constructor.js");
|
8
|
-
require("core-js/modules/es.symbol.iterator.js");
|
9
|
-
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); }
|
10
|
-
exports.__esModule = true;
|
11
|
-
exports.default = void 0;
|
12
|
-
require("core-js/modules/es.array.concat.js");
|
13
|
-
require("core-js/modules/es.array.includes.js");
|
14
|
-
require("core-js/modules/es.string.includes.js");
|
15
|
-
require("core-js/modules/es.object.values.js");
|
16
|
-
require("core-js/modules/es.array.iterator.js");
|
17
|
-
require("core-js/modules/es.object.to-string.js");
|
18
|
-
require("core-js/modules/es.string.iterator.js");
|
19
|
-
require("core-js/modules/es.weak-set.js");
|
20
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
21
|
-
var _console = require("./helpers/console");
|
22
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
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); } }
|
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; }
|
25
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
26
|
-
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); }
|
27
|
-
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
28
|
-
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
29
|
-
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
30
|
-
/**
|
31
|
-
* Possible focus modes.
|
32
|
-
* - CELL - The browser's focus stays on the lastly selected cell element.
|
33
|
-
* - MIXED - The browser's focus switches from the lastly selected cell element to the currently active editor's
|
34
|
-
* `TEXTAREA` element after a delay defined in the manager.
|
35
|
-
*
|
36
|
-
* @type {{CELL: string, MIXED: string}}
|
37
|
-
*/
|
38
|
-
var FOCUS_MODES = {
|
39
|
-
CELL: 'cell',
|
40
|
-
MIXED: 'mixed'
|
41
|
-
};
|
42
|
-
|
43
|
-
/**
|
44
|
-
* Manages the browser's focus in the table.
|
45
|
-
*/
|
46
|
-
var _manageFocus = /*#__PURE__*/new WeakSet();
|
47
|
-
var _onUpdateSettings = /*#__PURE__*/new WeakSet();
|
48
|
-
var FocusManager = /*#__PURE__*/function () {
|
49
|
-
function FocusManager(hotInstance) {
|
50
|
-
var _this = this;
|
51
|
-
_classCallCheck(this, FocusManager);
|
52
|
-
/**
|
53
|
-
* Update the manager configuration after calling `updateSettings`.
|
54
|
-
*
|
55
|
-
* @private
|
56
|
-
* @param {object} newSettings The new settings passed to the `updateSettings` method.
|
57
|
-
*/
|
58
|
-
_classPrivateMethodInitSpec(this, _onUpdateSettings);
|
59
|
-
/**
|
60
|
-
* Manage the browser's focus after cell selection.
|
61
|
-
*
|
62
|
-
* @private
|
63
|
-
*/
|
64
|
-
_classPrivateMethodInitSpec(this, _manageFocus);
|
65
|
-
var hotSettings = hotInstance.getSettings();
|
66
|
-
|
67
|
-
/**
|
68
|
-
* The Handsontable instance.
|
69
|
-
*
|
70
|
-
* @private
|
71
|
-
*/
|
72
|
-
this._hot = hotInstance;
|
73
|
-
|
74
|
-
/**
|
75
|
-
* The currently enabled focus mode.
|
76
|
-
* Can be either:
|
77
|
-
*
|
78
|
-
* - 'cell' - The browser's focus stays on the lastly selected cell element.
|
79
|
-
* - 'mixed' - The browser's focus switches from the lastly selected cell element to the currently active editor's
|
80
|
-
* `TEXTAREA` element after a delay defined in the manager.
|
81
|
-
*
|
82
|
-
* @type {string}
|
83
|
-
* @private
|
84
|
-
*/
|
85
|
-
this._focusMode = hotSettings.imeFastEdit ? FOCUS_MODES.MIXED : FOCUS_MODES.CELL;
|
86
|
-
|
87
|
-
/**
|
88
|
-
* The delay after which the focus switches from the lastly selected cell to the active editor's `TEXTAREA`
|
89
|
-
* element if the focus mode is set to 'mixed'.
|
90
|
-
*
|
91
|
-
* @type {number}
|
92
|
-
* @private
|
93
|
-
*/
|
94
|
-
this._refocusDelay = 50;
|
95
|
-
|
96
|
-
/**
|
97
|
-
* Getter function for the element to be used when refocusing the browser after a delay. If `null`, the active
|
98
|
-
* editor's `TEXTAREA` element will be used.
|
99
|
-
*
|
100
|
-
* @type {null|Function}
|
101
|
-
* @private
|
102
|
-
*/
|
103
|
-
this._refocusElementGetter = null;
|
104
|
-
this._hot.addHook('afterUpdateSettings', function () {
|
105
|
-
var _classPrivateMethodGe;
|
106
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
107
|
-
args[_key] = arguments[_key];
|
108
|
-
}
|
109
|
-
return (_classPrivateMethodGe = _classPrivateMethodGet(_this, _onUpdateSettings, _onUpdateSettings2)).call.apply(_classPrivateMethodGe, [_this].concat(args));
|
110
|
-
});
|
111
|
-
this._hot.addHook('afterSelectionEnd', function () {
|
112
|
-
var _classPrivateMethodGe2;
|
113
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
114
|
-
args[_key2] = arguments[_key2];
|
115
|
-
}
|
116
|
-
return (_classPrivateMethodGe2 = _classPrivateMethodGet(_this, _manageFocus, _manageFocus2)).call.apply(_classPrivateMethodGe2, [_this].concat(args));
|
117
|
-
});
|
118
|
-
}
|
119
|
-
|
120
|
-
/**
|
121
|
-
* Get the current focus mode.
|
122
|
-
*
|
123
|
-
* @returns {string}
|
124
|
-
*/
|
125
|
-
_createClass(FocusManager, [{
|
126
|
-
key: "getFocusMode",
|
127
|
-
value: function getFocusMode() {
|
128
|
-
return this._focusMode;
|
129
|
-
}
|
130
|
-
|
131
|
-
/**
|
132
|
-
* Set the focus mode.
|
133
|
-
*
|
134
|
-
* @param {string} focusMode The new focus mode.
|
135
|
-
*/
|
136
|
-
}, {
|
137
|
-
key: "setFocusMode",
|
138
|
-
value: function setFocusMode(focusMode) {
|
139
|
-
if (Object.values(FOCUS_MODES).includes(focusMode)) {
|
140
|
-
this._focusMode = focusMode;
|
141
|
-
} else {
|
142
|
-
(0, _console.warn)("\"".concat(focusMode, "\" is not a valid focus mode."));
|
143
|
-
}
|
144
|
-
}
|
145
|
-
|
146
|
-
/**
|
147
|
-
* Get the delay after which the focus will change from the cell elements to the active editor's `TEXTAREA`
|
148
|
-
* element if the focus mode is set to 'mixed'.
|
149
|
-
*
|
150
|
-
* @returns {number} Delay in milliseconds.
|
151
|
-
*/
|
152
|
-
}, {
|
153
|
-
key: "getRefocusDelay",
|
154
|
-
value: function getRefocusDelay() {
|
155
|
-
return this._refocusDelay;
|
156
|
-
}
|
157
|
-
|
158
|
-
/**
|
159
|
-
* Set the delay after which the focus will change from the cell elements to the active editor's `TEXTAREA`
|
160
|
-
* element if the focus mode is set to 'mixed'.
|
161
|
-
*
|
162
|
-
* @param {number} delay Delay in milliseconds.
|
163
|
-
*/
|
164
|
-
}, {
|
165
|
-
key: "setRefocusDelay",
|
166
|
-
value: function setRefocusDelay(delay) {
|
167
|
-
this._refocusDelay = delay;
|
168
|
-
}
|
169
|
-
|
170
|
-
/**
|
171
|
-
* Set the function to be used as the "refocus element" getter. It should return a focusable HTML element.
|
172
|
-
*
|
173
|
-
* @param {Function} getRefocusElementFunction The refocus element getter.
|
174
|
-
*/
|
175
|
-
}, {
|
176
|
-
key: "setRefocusElementGetter",
|
177
|
-
value: function setRefocusElementGetter(getRefocusElementFunction) {
|
178
|
-
this._refocusElementGetter = getRefocusElementFunction;
|
179
|
-
}
|
180
|
-
|
181
|
-
/**
|
182
|
-
* Get the element to be used when refocusing the browser after a delay in case of the focus mode being 'mixed'.
|
183
|
-
*
|
184
|
-
* @returns {HTMLTextAreaElement|HTMLElement|undefined}
|
185
|
-
*/
|
186
|
-
}, {
|
187
|
-
key: "getRefocusElement",
|
188
|
-
value: function getRefocusElement() {
|
189
|
-
if (this._refocusElementGetter !== null) {
|
190
|
-
return this._refocusElementGetter();
|
191
|
-
} else {
|
192
|
-
var _this$_hot$getActiveE;
|
193
|
-
return (_this$_hot$getActiveE = this._hot.getActiveEditor()) === null || _this$_hot$getActiveE === void 0 ? void 0 : _this$_hot$getActiveE.TEXTAREA;
|
194
|
-
}
|
195
|
-
}
|
196
|
-
|
197
|
-
/**
|
198
|
-
* Set the browser's focus to the highlighted cell of the last selection.
|
199
|
-
*/
|
200
|
-
}, {
|
201
|
-
key: "focusOnHighlightedCell",
|
202
|
-
value: function focusOnHighlightedCell() {
|
203
|
-
var _this$_hot$getActiveE2;
|
204
|
-
var lastSelectedRange = this._hot.getSelectedRangeLast();
|
205
|
-
var selectedCellCoords = lastSelectedRange.highlight;
|
206
|
-
var selectedCell = this._hot.getCell(selectedCellCoords.row, selectedCellCoords.col);
|
207
|
-
if (selectedCell && !((_this$_hot$getActiveE2 = this._hot.getActiveEditor()) !== null && _this$_hot$getActiveE2 !== void 0 && _this$_hot$getActiveE2.isOpened())) {
|
208
|
-
this._hot.getCell(selectedCellCoords.row, selectedCellCoords.col).focus({
|
209
|
-
preventScroll: true
|
210
|
-
});
|
211
|
-
}
|
212
|
-
}
|
213
|
-
|
214
|
-
/**
|
215
|
-
* Set the focus to the active editor's `TEXTAREA` element after the provided delay. If no delay is provided, it
|
216
|
-
* will be taken from the manager's configuration.
|
217
|
-
*
|
218
|
-
* @param {number} delay Delay in milliseconds.
|
219
|
-
*/
|
220
|
-
}, {
|
221
|
-
key: "refocusToEditorTextarea",
|
222
|
-
value: function refocusToEditorTextarea() {
|
223
|
-
var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._refocusDelay;
|
224
|
-
var refocusElement = this.getRefocusElement();
|
225
|
-
|
226
|
-
// Re-focus on the editor's `TEXTAREA` element (or a predefined element) if the `imeFastEdit` option is enabled.
|
227
|
-
if (this._hot.getSettings().imeFastEdit && !!refocusElement) {
|
228
|
-
this._hot._registerTimeout(function () {
|
229
|
-
refocusElement.select();
|
230
|
-
}, delay);
|
231
|
-
}
|
232
|
-
}
|
233
|
-
}]);
|
234
|
-
return FocusManager;
|
235
|
-
}();
|
236
|
-
exports.default = FocusManager;
|
237
|
-
function _manageFocus2() {
|
238
|
-
this.focusOnHighlightedCell();
|
239
|
-
if (this.getFocusMode() === FOCUS_MODES.MIXED) {
|
240
|
-
this.refocusToEditorTextarea();
|
241
|
-
}
|
242
|
-
}
|
243
|
-
function _onUpdateSettings2(newSettings) {
|
244
|
-
if (newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.MIXED) {
|
245
|
-
this.setFocusMode(FOCUS_MODES.MIXED);
|
246
|
-
} else if (!newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.CELL) {
|
247
|
-
this.setFocusMode(FOCUS_MODES.CELL);
|
248
|
-
}
|
249
|
-
}
|
package/focusManager.mjs
DELETED
@@ -1,245 +0,0 @@
|
|
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.array.concat.js";
|
3
|
-
import "core-js/modules/es.array.includes.js";
|
4
|
-
import "core-js/modules/es.string.includes.js";
|
5
|
-
import "core-js/modules/es.object.values.js";
|
6
|
-
import "core-js/modules/es.array.iterator.js";
|
7
|
-
import "core-js/modules/es.object.to-string.js";
|
8
|
-
import "core-js/modules/es.string.iterator.js";
|
9
|
-
import "core-js/modules/es.weak-set.js";
|
10
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
11
|
-
import "core-js/modules/es.symbol.to-primitive.js";
|
12
|
-
import "core-js/modules/es.date.to-primitive.js";
|
13
|
-
import "core-js/modules/es.symbol.js";
|
14
|
-
import "core-js/modules/es.symbol.description.js";
|
15
|
-
import "core-js/modules/es.number.constructor.js";
|
16
|
-
import "core-js/modules/es.symbol.iterator.js";
|
17
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
18
|
-
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); } }
|
19
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
20
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
21
|
-
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
|
-
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
23
|
-
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
24
|
-
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
25
|
-
import { warn } from "./helpers/console.mjs";
|
26
|
-
/**
|
27
|
-
* Possible focus modes.
|
28
|
-
* - CELL - The browser's focus stays on the lastly selected cell element.
|
29
|
-
* - MIXED - The browser's focus switches from the lastly selected cell element to the currently active editor's
|
30
|
-
* `TEXTAREA` element after a delay defined in the manager.
|
31
|
-
*
|
32
|
-
* @type {{CELL: string, MIXED: string}}
|
33
|
-
*/
|
34
|
-
var FOCUS_MODES = {
|
35
|
-
CELL: 'cell',
|
36
|
-
MIXED: 'mixed'
|
37
|
-
};
|
38
|
-
|
39
|
-
/**
|
40
|
-
* Manages the browser's focus in the table.
|
41
|
-
*/
|
42
|
-
var _manageFocus = /*#__PURE__*/new WeakSet();
|
43
|
-
var _onUpdateSettings = /*#__PURE__*/new WeakSet();
|
44
|
-
var FocusManager = /*#__PURE__*/function () {
|
45
|
-
function FocusManager(hotInstance) {
|
46
|
-
var _this = this;
|
47
|
-
_classCallCheck(this, FocusManager);
|
48
|
-
/**
|
49
|
-
* Update the manager configuration after calling `updateSettings`.
|
50
|
-
*
|
51
|
-
* @private
|
52
|
-
* @param {object} newSettings The new settings passed to the `updateSettings` method.
|
53
|
-
*/
|
54
|
-
_classPrivateMethodInitSpec(this, _onUpdateSettings);
|
55
|
-
/**
|
56
|
-
* Manage the browser's focus after cell selection.
|
57
|
-
*
|
58
|
-
* @private
|
59
|
-
*/
|
60
|
-
_classPrivateMethodInitSpec(this, _manageFocus);
|
61
|
-
var hotSettings = hotInstance.getSettings();
|
62
|
-
|
63
|
-
/**
|
64
|
-
* The Handsontable instance.
|
65
|
-
*
|
66
|
-
* @private
|
67
|
-
*/
|
68
|
-
this._hot = hotInstance;
|
69
|
-
|
70
|
-
/**
|
71
|
-
* The currently enabled focus mode.
|
72
|
-
* Can be either:
|
73
|
-
*
|
74
|
-
* - 'cell' - The browser's focus stays on the lastly selected cell element.
|
75
|
-
* - 'mixed' - The browser's focus switches from the lastly selected cell element to the currently active editor's
|
76
|
-
* `TEXTAREA` element after a delay defined in the manager.
|
77
|
-
*
|
78
|
-
* @type {string}
|
79
|
-
* @private
|
80
|
-
*/
|
81
|
-
this._focusMode = hotSettings.imeFastEdit ? FOCUS_MODES.MIXED : FOCUS_MODES.CELL;
|
82
|
-
|
83
|
-
/**
|
84
|
-
* The delay after which the focus switches from the lastly selected cell to the active editor's `TEXTAREA`
|
85
|
-
* element if the focus mode is set to 'mixed'.
|
86
|
-
*
|
87
|
-
* @type {number}
|
88
|
-
* @private
|
89
|
-
*/
|
90
|
-
this._refocusDelay = 50;
|
91
|
-
|
92
|
-
/**
|
93
|
-
* Getter function for the element to be used when refocusing the browser after a delay. If `null`, the active
|
94
|
-
* editor's `TEXTAREA` element will be used.
|
95
|
-
*
|
96
|
-
* @type {null|Function}
|
97
|
-
* @private
|
98
|
-
*/
|
99
|
-
this._refocusElementGetter = null;
|
100
|
-
this._hot.addHook('afterUpdateSettings', function () {
|
101
|
-
var _classPrivateMethodGe;
|
102
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
103
|
-
args[_key] = arguments[_key];
|
104
|
-
}
|
105
|
-
return (_classPrivateMethodGe = _classPrivateMethodGet(_this, _onUpdateSettings, _onUpdateSettings2)).call.apply(_classPrivateMethodGe, [_this].concat(args));
|
106
|
-
});
|
107
|
-
this._hot.addHook('afterSelectionEnd', function () {
|
108
|
-
var _classPrivateMethodGe2;
|
109
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
110
|
-
args[_key2] = arguments[_key2];
|
111
|
-
}
|
112
|
-
return (_classPrivateMethodGe2 = _classPrivateMethodGet(_this, _manageFocus, _manageFocus2)).call.apply(_classPrivateMethodGe2, [_this].concat(args));
|
113
|
-
});
|
114
|
-
}
|
115
|
-
|
116
|
-
/**
|
117
|
-
* Get the current focus mode.
|
118
|
-
*
|
119
|
-
* @returns {string}
|
120
|
-
*/
|
121
|
-
_createClass(FocusManager, [{
|
122
|
-
key: "getFocusMode",
|
123
|
-
value: function getFocusMode() {
|
124
|
-
return this._focusMode;
|
125
|
-
}
|
126
|
-
|
127
|
-
/**
|
128
|
-
* Set the focus mode.
|
129
|
-
*
|
130
|
-
* @param {string} focusMode The new focus mode.
|
131
|
-
*/
|
132
|
-
}, {
|
133
|
-
key: "setFocusMode",
|
134
|
-
value: function setFocusMode(focusMode) {
|
135
|
-
if (Object.values(FOCUS_MODES).includes(focusMode)) {
|
136
|
-
this._focusMode = focusMode;
|
137
|
-
} else {
|
138
|
-
warn("\"".concat(focusMode, "\" is not a valid focus mode."));
|
139
|
-
}
|
140
|
-
}
|
141
|
-
|
142
|
-
/**
|
143
|
-
* Get the delay after which the focus will change from the cell elements to the active editor's `TEXTAREA`
|
144
|
-
* element if the focus mode is set to 'mixed'.
|
145
|
-
*
|
146
|
-
* @returns {number} Delay in milliseconds.
|
147
|
-
*/
|
148
|
-
}, {
|
149
|
-
key: "getRefocusDelay",
|
150
|
-
value: function getRefocusDelay() {
|
151
|
-
return this._refocusDelay;
|
152
|
-
}
|
153
|
-
|
154
|
-
/**
|
155
|
-
* Set the delay after which the focus will change from the cell elements to the active editor's `TEXTAREA`
|
156
|
-
* element if the focus mode is set to 'mixed'.
|
157
|
-
*
|
158
|
-
* @param {number} delay Delay in milliseconds.
|
159
|
-
*/
|
160
|
-
}, {
|
161
|
-
key: "setRefocusDelay",
|
162
|
-
value: function setRefocusDelay(delay) {
|
163
|
-
this._refocusDelay = delay;
|
164
|
-
}
|
165
|
-
|
166
|
-
/**
|
167
|
-
* Set the function to be used as the "refocus element" getter. It should return a focusable HTML element.
|
168
|
-
*
|
169
|
-
* @param {Function} getRefocusElementFunction The refocus element getter.
|
170
|
-
*/
|
171
|
-
}, {
|
172
|
-
key: "setRefocusElementGetter",
|
173
|
-
value: function setRefocusElementGetter(getRefocusElementFunction) {
|
174
|
-
this._refocusElementGetter = getRefocusElementFunction;
|
175
|
-
}
|
176
|
-
|
177
|
-
/**
|
178
|
-
* Get the element to be used when refocusing the browser after a delay in case of the focus mode being 'mixed'.
|
179
|
-
*
|
180
|
-
* @returns {HTMLTextAreaElement|HTMLElement|undefined}
|
181
|
-
*/
|
182
|
-
}, {
|
183
|
-
key: "getRefocusElement",
|
184
|
-
value: function getRefocusElement() {
|
185
|
-
if (this._refocusElementGetter !== null) {
|
186
|
-
return this._refocusElementGetter();
|
187
|
-
} else {
|
188
|
-
var _this$_hot$getActiveE;
|
189
|
-
return (_this$_hot$getActiveE = this._hot.getActiveEditor()) === null || _this$_hot$getActiveE === void 0 ? void 0 : _this$_hot$getActiveE.TEXTAREA;
|
190
|
-
}
|
191
|
-
}
|
192
|
-
|
193
|
-
/**
|
194
|
-
* Set the browser's focus to the highlighted cell of the last selection.
|
195
|
-
*/
|
196
|
-
}, {
|
197
|
-
key: "focusOnHighlightedCell",
|
198
|
-
value: function focusOnHighlightedCell() {
|
199
|
-
var _this$_hot$getActiveE2;
|
200
|
-
var lastSelectedRange = this._hot.getSelectedRangeLast();
|
201
|
-
var selectedCellCoords = lastSelectedRange.highlight;
|
202
|
-
var selectedCell = this._hot.getCell(selectedCellCoords.row, selectedCellCoords.col);
|
203
|
-
if (selectedCell && !((_this$_hot$getActiveE2 = this._hot.getActiveEditor()) !== null && _this$_hot$getActiveE2 !== void 0 && _this$_hot$getActiveE2.isOpened())) {
|
204
|
-
this._hot.getCell(selectedCellCoords.row, selectedCellCoords.col).focus({
|
205
|
-
preventScroll: true
|
206
|
-
});
|
207
|
-
}
|
208
|
-
}
|
209
|
-
|
210
|
-
/**
|
211
|
-
* Set the focus to the active editor's `TEXTAREA` element after the provided delay. If no delay is provided, it
|
212
|
-
* will be taken from the manager's configuration.
|
213
|
-
*
|
214
|
-
* @param {number} delay Delay in milliseconds.
|
215
|
-
*/
|
216
|
-
}, {
|
217
|
-
key: "refocusToEditorTextarea",
|
218
|
-
value: function refocusToEditorTextarea() {
|
219
|
-
var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._refocusDelay;
|
220
|
-
var refocusElement = this.getRefocusElement();
|
221
|
-
|
222
|
-
// Re-focus on the editor's `TEXTAREA` element (or a predefined element) if the `imeFastEdit` option is enabled.
|
223
|
-
if (this._hot.getSettings().imeFastEdit && !!refocusElement) {
|
224
|
-
this._hot._registerTimeout(function () {
|
225
|
-
refocusElement.select();
|
226
|
-
}, delay);
|
227
|
-
}
|
228
|
-
}
|
229
|
-
}]);
|
230
|
-
return FocusManager;
|
231
|
-
}();
|
232
|
-
function _manageFocus2() {
|
233
|
-
this.focusOnHighlightedCell();
|
234
|
-
if (this.getFocusMode() === FOCUS_MODES.MIXED) {
|
235
|
-
this.refocusToEditorTextarea();
|
236
|
-
}
|
237
|
-
}
|
238
|
-
function _onUpdateSettings2(newSettings) {
|
239
|
-
if (newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.MIXED) {
|
240
|
-
this.setFocusMode(FOCUS_MODES.MIXED);
|
241
|
-
} else if (!newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.CELL) {
|
242
|
-
this.setFocusMode(FOCUS_MODES.CELL);
|
243
|
-
}
|
244
|
-
}
|
245
|
-
export { FocusManager as default };
|
@@ -1,54 +0,0 @@
|
|
1
|
-
"use strict";
|
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); }
|
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");
|
12
|
-
require("core-js/modules/es.array.filter.js");
|
13
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
14
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
15
|
-
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
16
|
-
require("core-js/modules/es.symbol.iterator.js");
|
17
|
-
require("core-js/modules/es.array.iterator.js");
|
18
|
-
require("core-js/modules/es.string.iterator.js");
|
19
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
20
|
-
exports.__esModule = true;
|
21
|
-
exports.createHighlight = createHighlight;
|
22
|
-
var _src = require("../../../3rdparty/walkontable/src");
|
23
|
-
var _visualSelection = _interopRequireDefault(require("../visualSelection"));
|
24
|
-
var _excluded = ["areaCornerVisible"];
|
25
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
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; }
|
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; }
|
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; }
|
29
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
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); }
|
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; }
|
33
|
-
/**
|
34
|
-
* Creates the new instance of Selection responsible for highlighting area of the selected multiple cells.
|
35
|
-
*
|
36
|
-
* @param {object} highlightParams A configuration object to create a highlight.
|
37
|
-
* @param {object} highlightParams.areaCornerVisible Function to determine if area's corner should be visible.
|
38
|
-
* @returns {Selection}
|
39
|
-
*/
|
40
|
-
function createHighlight(_ref) {
|
41
|
-
var areaCornerVisible = _ref.areaCornerVisible,
|
42
|
-
restOptions = _objectWithoutProperties(_ref, _excluded);
|
43
|
-
return new _visualSelection.default(_objectSpread(_objectSpread({
|
44
|
-
className: 'area',
|
45
|
-
createLayers: true,
|
46
|
-
border: {
|
47
|
-
width: 1,
|
48
|
-
color: '#4b89ff',
|
49
|
-
cornerVisible: areaCornerVisible
|
50
|
-
}
|
51
|
-
}, restOptions), {}, {
|
52
|
-
selectionType: _src.HIGHLIGHT_AREA_TYPE
|
53
|
-
}));
|
54
|
-
}
|
@@ -1,49 +0,0 @@
|
|
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";
|
5
|
-
import "core-js/modules/es.symbol.to-primitive.js";
|
6
|
-
import "core-js/modules/es.date.to-primitive.js";
|
7
|
-
import "core-js/modules/es.symbol.description.js";
|
8
|
-
import "core-js/modules/es.object.to-string.js";
|
9
|
-
import "core-js/modules/es.number.constructor.js";
|
10
|
-
import "core-js/modules/es.array.filter.js";
|
11
|
-
import "core-js/modules/es.object.get-own-property-descriptor.js";
|
12
|
-
import "core-js/modules/web.dom-collections.for-each.js";
|
13
|
-
import "core-js/modules/es.object.get-own-property-descriptors.js";
|
14
|
-
import "core-js/modules/es.symbol.iterator.js";
|
15
|
-
import "core-js/modules/es.array.iterator.js";
|
16
|
-
import "core-js/modules/es.string.iterator.js";
|
17
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
18
|
-
var _excluded = ["areaCornerVisible"];
|
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
|
-
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
|
-
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; }
|
22
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
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
|
-
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_AREA_TYPE } from "../../../3rdparty/walkontable/src/index.mjs";
|
27
|
-
import VisualSelection from "../visualSelection.mjs";
|
28
|
-
/**
|
29
|
-
* Creates the new instance of Selection responsible for highlighting area of the selected multiple cells.
|
30
|
-
*
|
31
|
-
* @param {object} highlightParams A configuration object to create a highlight.
|
32
|
-
* @param {object} highlightParams.areaCornerVisible Function to determine if area's corner should be visible.
|
33
|
-
* @returns {Selection}
|
34
|
-
*/
|
35
|
-
export function createHighlight(_ref) {
|
36
|
-
var areaCornerVisible = _ref.areaCornerVisible,
|
37
|
-
restOptions = _objectWithoutProperties(_ref, _excluded);
|
38
|
-
return new VisualSelection(_objectSpread(_objectSpread({
|
39
|
-
className: 'area',
|
40
|
-
createLayers: true,
|
41
|
-
border: {
|
42
|
-
width: 1,
|
43
|
-
color: '#4b89ff',
|
44
|
-
cornerVisible: areaCornerVisible
|
45
|
-
}
|
46
|
-
}, restOptions), {}, {
|
47
|
-
selectionType: HIGHLIGHT_AREA_TYPE
|
48
|
-
}));
|
49
|
-
}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
"use strict";
|
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); }
|
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");
|
12
|
-
require("core-js/modules/es.array.filter.js");
|
13
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
14
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
15
|
-
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
16
|
-
require("core-js/modules/es.symbol.iterator.js");
|
17
|
-
require("core-js/modules/es.array.iterator.js");
|
18
|
-
require("core-js/modules/es.string.iterator.js");
|
19
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
20
|
-
exports.__esModule = true;
|
21
|
-
exports.createHighlight = createHighlight;
|
22
|
-
var _src = require("../../../3rdparty/walkontable/src");
|
23
|
-
var _visualSelection = _interopRequireDefault(require("../visualSelection"));
|
24
|
-
var _excluded = ["columnClassName"];
|
25
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
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; }
|
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; }
|
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; }
|
29
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
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); }
|
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; }
|
33
|
-
/**
|
34
|
-
* Creates the new instance of Selection, responsible for highlighting cells in a columns and
|
35
|
-
* column 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.columnClassName Highlighted column' class name.
|
40
|
-
* @returns {Selection}
|
41
|
-
*/
|
42
|
-
function createHighlight(_ref) {
|
43
|
-
var columnClassName = _ref.columnClassName,
|
44
|
-
restOptions = _objectWithoutProperties(_ref, _excluded);
|
45
|
-
return new _visualSelection.default(_objectSpread(_objectSpread({
|
46
|
-
className: columnClassName
|
47
|
-
}, restOptions), {}, {
|
48
|
-
selectionType: _src.HIGHLIGHT_COLUMN_TYPE
|
49
|
-
}));
|
50
|
-
}
|