handsontable 0.0.0-next-53a190b-20240403 → 0.0.0-next-5a535ed-20240403
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +17 -12
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
- package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
- package/3rdparty/walkontable/src/cell/coords.js +17 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
- package/3rdparty/walkontable/src/cell/range.js +28 -40
- package/3rdparty/walkontable/src/cell/range.mjs +28 -40
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +104 -72
- package/3rdparty/walkontable/src/event.mjs +104 -72
- package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -15
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -16
- package/3rdparty/walkontable/src/overlay/top.js +0 -11
- package/3rdparty/walkontable/src/overlay/top.mjs +1 -12
- package/3rdparty/walkontable/src/overlays.js +4 -46
- package/3rdparty/walkontable/src/overlays.mjs +4 -46
- package/3rdparty/walkontable/src/scroll.js +17 -15
- package/3rdparty/walkontable/src/scroll.mjs +17 -15
- package/3rdparty/walkontable/src/selection/manager.js +69 -48
- package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
- package/3rdparty/walkontable/src/selection/scanner.js +42 -33
- package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
- package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
- package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +1 -4
- package/core/viewportScroll/index.mjs +1 -4
- package/core.d.ts +3 -4
- package/core.js +22 -77
- package/core.mjs +22 -77
- package/dataMap/dataSource.js +1 -1
- package/dataMap/dataSource.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
- package/dataMap/metaManager/metaSchema.js +1 -1
- package/dataMap/metaManager/metaSchema.mjs +1 -1
- package/dataMap/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +4 -4
- package/dist/handsontable.full.css +4 -4
- package/dist/handsontable.full.js +9121 -9062
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +292 -292
- package/dist/handsontable.js +6573 -6967
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +25 -25
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +23 -25
- package/editorManager.mjs +23 -25
- package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
- package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
- package/editors/selectEditor/selectEditor.js +19 -20
- package/editors/selectEditor/selectEditor.mjs +19 -20
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +82 -64
- package/focusManager.mjs +82 -64
- package/helpers/dom/element.js +1 -23
- package/helpers/dom/element.mjs +1 -21
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +2 -2
- package/helpers/object.mjs +2 -2
- package/index.d.ts +0 -10
- package/package.json +2 -7
- package/pluginHooks.d.ts +3 -4
- package/pluginHooks.js +38 -99
- package/pluginHooks.mjs +38 -99
- package/plugins/autoColumnSize/autoColumnSize.js +65 -49
- package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
- package/plugins/autoRowSize/autoRowSize.js +34 -28
- package/plugins/autoRowSize/autoRowSize.mjs +34 -28
- package/plugins/autofill/autofill.js +38 -30
- package/plugins/autofill/autofill.mjs +38 -30
- package/plugins/base/base.js +17 -12
- package/plugins/base/base.mjs +17 -12
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
- package/plugins/columnSorting/columnSorting.js +45 -49
- package/plugins/columnSorting/columnSorting.mjs +45 -49
- package/plugins/columnSummary/columnSummary.js +26 -22
- package/plugins/columnSummary/columnSummary.mjs +26 -22
- package/plugins/comments/comments.js +158 -116
- package/plugins/comments/comments.mjs +158 -116
- package/plugins/contextMenu/contextMenu.js +26 -20
- package/plugins/contextMenu/contextMenu.mjs +26 -20
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
- package/plugins/contextMenu/menu/menu.js +21 -13
- package/plugins/contextMenu/menu/menu.mjs +21 -13
- package/plugins/contextMenu/menu/positioner.js +58 -41
- package/plugins/contextMenu/menu/positioner.mjs +58 -41
- package/plugins/copyPaste/copyPaste.js +157 -116
- package/plugins/copyPaste/copyPaste.mjs +157 -116
- package/plugins/copyPaste/copyableRanges.js +66 -43
- package/plugins/copyPaste/copyableRanges.mjs +66 -43
- package/plugins/customBorders/customBorders.js +13 -11
- package/plugins/customBorders/customBorders.mjs +13 -11
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +106 -80
- package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
- package/plugins/exportFile/dataProvider.js +1 -1
- package/plugins/exportFile/dataProvider.mjs +1 -1
- package/plugins/filters/component/actionBar.js +9 -9
- package/plugins/filters/component/actionBar.mjs +8 -8
- package/plugins/filters/component/condition.js +15 -13
- package/plugins/filters/component/condition.mjs +15 -13
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +28 -24
- package/plugins/filters/component/value.mjs +28 -24
- package/plugins/filters/conditionUpdateObserver.js +24 -22
- package/plugins/filters/conditionUpdateObserver.mjs +24 -22
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +95 -81
- package/plugins/filters/filters.mjs +95 -81
- package/plugins/filters/ui/input.js +19 -13
- package/plugins/filters/ui/input.mjs +19 -13
- package/plugins/filters/ui/link.js +13 -8
- package/plugins/filters/ui/link.mjs +13 -8
- package/plugins/filters/ui/multipleSelect.js +112 -85
- package/plugins/filters/ui/multipleSelect.mjs +112 -85
- package/plugins/filters/ui/radioInput.js +20 -12
- package/plugins/filters/ui/radioInput.mjs +20 -12
- package/plugins/filters/ui/select.js +72 -50
- package/plugins/filters/ui/select.mjs +71 -49
- package/plugins/formulas/formulas.js +326 -268
- package/plugins/formulas/formulas.mjs +327 -269
- package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
- package/plugins/formulas/indexSyncer/index.js +48 -25
- package/plugins/formulas/indexSyncer/index.mjs +48 -25
- package/plugins/hiddenColumns/hiddenColumns.js +83 -64
- package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
- package/plugins/hiddenRows/hiddenRows.js +82 -63
- package/plugins/hiddenRows/hiddenRows.mjs +82 -63
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
- package/plugins/manualColumnMove/manualColumnMove.js +170 -126
- package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
- package/plugins/manualColumnResize/manualColumnResize.js +230 -169
- package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
- package/plugins/manualRowMove/manualRowMove.js +128 -99
- package/plugins/manualRowMove/manualRowMove.mjs +128 -99
- package/plugins/manualRowResize/manualRowResize.js +209 -150
- package/plugins/manualRowResize/manualRowResize.mjs +209 -150
- package/plugins/mergeCells/calculations/selection.js +71 -2
- package/plugins/mergeCells/calculations/selection.mjs +71 -2
- package/plugins/mergeCells/cellsCollection.js +1 -117
- package/plugins/mergeCells/cellsCollection.mjs +1 -117
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
- package/plugins/mergeCells/mergeCells.js +397 -499
- package/plugins/mergeCells/mergeCells.mjs +397 -499
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +253 -205
- package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
- package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
- package/plugins/nestedHeaders/stateManager/index.js +41 -30
- package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +182 -151
- package/plugins/nestedRows/nestedRows.mjs +183 -152
- package/plugins/nestedRows/ui/contextMenu.js +15 -11
- package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
- package/plugins/nestedRows/utils/rowMoveController.js +1 -1
- package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
- package/plugins/persistentState/storage.js +2 -2
- package/plugins/persistentState/storage.mjs +2 -2
- package/plugins/search/search.js +7 -7
- package/plugins/search/search.mjs +7 -7
- package/plugins/touchScroll/touchScroll.js +19 -15
- package/plugins/touchScroll/touchScroll.mjs +20 -16
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +0 -2
- package/selection/highlight/visualSelection.mjs +0 -2
- package/selection/selection.js +67 -225
- package/selection/selection.mjs +66 -224
- package/selection/transformation.js +118 -149
- package/selection/transformation.mjs +118 -149
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +3 -18
- package/shortcutContexts/commands/editor/open.mjs +3 -18
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
- package/shortcutContexts/grid.js +3 -9
- package/shortcutContexts/grid.mjs +3 -9
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +78 -52
- package/tableView.mjs +78 -52
- package/translations/changesObservable/observable.js +38 -21
- package/translations/changesObservable/observable.mjs +38 -21
- package/translations/changesObservable/observer.js +12 -7
- package/translations/changesObservable/observer.mjs +11 -6
- package/translations/mapCollections/aggregatedCollection.js +1 -1
- package/translations/mapCollections/aggregatedCollection.mjs +1 -1
- package/translations/maps/indexMap.js +1 -1
- package/translations/maps/indexMap.mjs +1 -1
- package/utils/dataStructures/linkedList.js +1 -6
- package/utils/dataStructures/linkedList.mjs +1 -6
- package/utils/dataStructures/tree.js +1 -1
- package/utils/dataStructures/tree.mjs +1 -1
- package/utils/interval.js +44 -26
- package/utils/interval.mjs +44 -26
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/i18n/languages/ar-AR.d.ts +0 -5
- package/i18n/languages/cs-CZ.d.ts +0 -5
- package/i18n/languages/hr-HR.d.ts +0 -5
- package/i18n/languages/sr-SP.d.ts +0 -5
- package/plugins/mergeCells/focusOrder.js +0 -305
- package/plugins/mergeCells/focusOrder.mjs +0 -300
@@ -6,9 +6,12 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
6
6
|
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; }
|
7
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
8
8
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
9
|
-
function
|
10
|
-
function
|
11
|
-
function
|
9
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
10
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
11
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
12
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
13
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
14
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
12
15
|
import { addClass, closest, isChildOf, hasClass, outerWidth, outerHeight } from "../../helpers/dom/element.mjs";
|
13
16
|
import { stopImmediatePropagation } from "../../helpers/dom/event.mjs";
|
14
17
|
import { deepClone, deepExtend, isObject } from "../../helpers/object.mjs";
|
@@ -125,16 +128,75 @@ var _preventEditorHiding = /*#__PURE__*/new WeakMap();
|
|
125
128
|
var _tempEditorDimensions = /*#__PURE__*/new WeakMap();
|
126
129
|
var _cellBelowCursor = /*#__PURE__*/new WeakMap();
|
127
130
|
var _commentValueBeforeSave = /*#__PURE__*/new WeakMap();
|
128
|
-
var
|
131
|
+
var _onMouseDown = /*#__PURE__*/new WeakSet();
|
132
|
+
var _onMouseOver = /*#__PURE__*/new WeakSet();
|
133
|
+
var _onMouseUp = /*#__PURE__*/new WeakSet();
|
134
|
+
var _onAfterRenderer = /*#__PURE__*/new WeakSet();
|
135
|
+
var _onEditorBlur = /*#__PURE__*/new WeakSet();
|
136
|
+
var _onEditorFocus = /*#__PURE__*/new WeakSet();
|
137
|
+
var _onEditorMouseDown = /*#__PURE__*/new WeakSet();
|
138
|
+
var _onEditorMouseUp = /*#__PURE__*/new WeakSet();
|
139
|
+
var _onAfterDocumentKeyDown = /*#__PURE__*/new WeakSet();
|
140
|
+
var _onAfterScroll = /*#__PURE__*/new WeakSet();
|
129
141
|
export class Comments extends BasePlugin {
|
130
142
|
constructor() {
|
131
143
|
super(...arguments);
|
144
|
+
/**
|
145
|
+
* Observes the changes in the scroll position if triggered it hides the comment editor.
|
146
|
+
*/
|
147
|
+
_classPrivateMethodInitSpec(this, _onAfterScroll);
|
148
|
+
/**
|
149
|
+
* Observes the pressed keys and if there is already opened the comment editor prevents open
|
150
|
+
* the table editor into the fast edit mode.
|
151
|
+
*
|
152
|
+
* @param {Event} event The keydown event.
|
153
|
+
*/
|
154
|
+
_classPrivateMethodInitSpec(this, _onAfterDocumentKeyDown);
|
155
|
+
/**
|
156
|
+
* `mouseup` hook. Along with `onEditorMouseDown` used to simulate the textarea resizing event.
|
157
|
+
*
|
158
|
+
* @param {MouseEvent} event The `mouseup` event.
|
159
|
+
*/
|
160
|
+
_classPrivateMethodInitSpec(this, _onEditorMouseUp);
|
161
|
+
/**
|
162
|
+
* `mousedown` hook. Along with `onEditorMouseUp` used to simulate the textarea resizing event.
|
163
|
+
*
|
164
|
+
* @param {MouseEvent} event The `mousedown` event.
|
165
|
+
*/
|
166
|
+
_classPrivateMethodInitSpec(this, _onEditorMouseDown);
|
167
|
+
/**
|
168
|
+
* Hook observer the "focus" event from the comments editor element. The hook takes the control of
|
169
|
+
* the keyboard shortcuts by switching the context to plugins one.
|
170
|
+
*/
|
171
|
+
_classPrivateMethodInitSpec(this, _onEditorFocus);
|
172
|
+
/**
|
173
|
+
* Hook observer the "blur" event from the comments editor element. The hook clears the
|
174
|
+
* editor content and gives back the keyboard shortcuts control by switching to the "grid" context.
|
175
|
+
*/
|
176
|
+
_classPrivateMethodInitSpec(this, _onEditorBlur);
|
177
|
+
/**
|
178
|
+
* The `afterRenderer` hook callback.
|
179
|
+
*
|
180
|
+
* @param {HTMLTableCellElement} TD The rendered `TD` element.
|
181
|
+
* @param {object} cellProperties The rendered cell's property object.
|
182
|
+
*/
|
183
|
+
_classPrivateMethodInitSpec(this, _onAfterRenderer);
|
184
|
+
/**
|
185
|
+
* `mouseup` event callback.
|
186
|
+
*/
|
187
|
+
_classPrivateMethodInitSpec(this, _onMouseUp);
|
188
|
+
/**
|
189
|
+
* `mouseover` event callback.
|
190
|
+
*
|
191
|
+
* @param {MouseEvent} event The `mouseover` event.
|
192
|
+
*/
|
193
|
+
_classPrivateMethodInitSpec(this, _onMouseOver);
|
132
194
|
/**
|
133
195
|
* `mousedown` event callback.
|
134
196
|
*
|
135
197
|
* @param {MouseEvent} event The `mousedown` event.
|
136
198
|
*/
|
137
|
-
_classPrivateMethodInitSpec(this,
|
199
|
+
_classPrivateMethodInitSpec(this, _onMouseDown);
|
138
200
|
/**
|
139
201
|
* Current cell range, an object with `from` property, with `row` and `col` properties (e.q. `{from: {row: 1, col: 6}}`).
|
140
202
|
*
|
@@ -147,21 +209,30 @@ export class Comments extends BasePlugin {
|
|
147
209
|
* @private
|
148
210
|
* @type {CommentEditor}
|
149
211
|
*/
|
150
|
-
_classPrivateFieldInitSpec(this, _editor,
|
212
|
+
_classPrivateFieldInitSpec(this, _editor, {
|
213
|
+
writable: true,
|
214
|
+
value: null
|
215
|
+
});
|
151
216
|
/**
|
152
217
|
* Instance of {@link DisplaySwitch}.
|
153
218
|
*
|
154
219
|
* @private
|
155
220
|
* @type {DisplaySwitch}
|
156
221
|
*/
|
157
|
-
_classPrivateFieldInitSpec(this, _displaySwitch,
|
222
|
+
_classPrivateFieldInitSpec(this, _displaySwitch, {
|
223
|
+
writable: true,
|
224
|
+
value: null
|
225
|
+
});
|
158
226
|
/**
|
159
227
|
* Prevents showing/hiding editor that reacts on the logic triggered by the "mouseover" events.
|
160
228
|
*
|
161
229
|
* @private
|
162
230
|
* @type {boolean}
|
163
231
|
*/
|
164
|
-
_classPrivateFieldInitSpec(this, _preventEditorAutoSwitch,
|
232
|
+
_classPrivateFieldInitSpec(this, _preventEditorAutoSwitch, {
|
233
|
+
writable: true,
|
234
|
+
value: false
|
235
|
+
});
|
165
236
|
/**
|
166
237
|
* Prevents hiding editor when the table viewport is scrolled and that scroll is triggered by the
|
167
238
|
* keyboard shortcut that insert or edits the comment.
|
@@ -169,28 +240,40 @@ export class Comments extends BasePlugin {
|
|
169
240
|
* @private
|
170
241
|
* @type {boolean}
|
171
242
|
*/
|
172
|
-
_classPrivateFieldInitSpec(this, _preventEditorHiding,
|
243
|
+
_classPrivateFieldInitSpec(this, _preventEditorHiding, {
|
244
|
+
writable: true,
|
245
|
+
value: false
|
246
|
+
});
|
173
247
|
/**
|
174
248
|
* The property for holding editor dimensions for further processing.
|
175
249
|
*
|
176
250
|
* @private
|
177
251
|
* @type {object}
|
178
252
|
*/
|
179
|
-
_classPrivateFieldInitSpec(this, _tempEditorDimensions, {
|
253
|
+
_classPrivateFieldInitSpec(this, _tempEditorDimensions, {
|
254
|
+
writable: true,
|
255
|
+
value: {}
|
256
|
+
});
|
180
257
|
/**
|
181
258
|
* The flag that allows processing mousedown event correctly when comments editor is triggered.
|
182
259
|
*
|
183
260
|
* @private
|
184
261
|
* @type {boolean}
|
185
262
|
*/
|
186
|
-
_classPrivateFieldInitSpec(this, _cellBelowCursor,
|
263
|
+
_classPrivateFieldInitSpec(this, _cellBelowCursor, {
|
264
|
+
writable: true,
|
265
|
+
value: null
|
266
|
+
});
|
187
267
|
/**
|
188
268
|
* Holds the comment value before it's actually saved to the cell meta.
|
189
269
|
*
|
190
270
|
* @private
|
191
271
|
* @type {string}
|
192
272
|
*/
|
193
|
-
_classPrivateFieldInitSpec(this, _commentValueBeforeSave,
|
273
|
+
_classPrivateFieldInitSpec(this, _commentValueBeforeSave, {
|
274
|
+
writable: true,
|
275
|
+
value: ''
|
276
|
+
});
|
194
277
|
}
|
195
278
|
static get PLUGIN_KEY() {
|
196
279
|
return PLUGIN_KEY;
|
@@ -215,19 +298,19 @@ export class Comments extends BasePlugin {
|
|
215
298
|
if (this.enabled) {
|
216
299
|
return;
|
217
300
|
}
|
218
|
-
if (!_classPrivateFieldGet(
|
219
|
-
_classPrivateFieldSet(
|
301
|
+
if (!_classPrivateFieldGet(this, _editor)) {
|
302
|
+
_classPrivateFieldSet(this, _editor, new CommentEditor(this.hot.rootDocument, this.hot.isRtl()));
|
220
303
|
}
|
221
|
-
if (!_classPrivateFieldGet(
|
222
|
-
_classPrivateFieldSet(
|
304
|
+
if (!_classPrivateFieldGet(this, _displaySwitch)) {
|
305
|
+
_classPrivateFieldSet(this, _displaySwitch, new DisplaySwitch(this.getDisplayDelaySetting()));
|
223
306
|
}
|
224
307
|
this.addHook('afterContextMenuDefaultOptions', options => this.addToContextMenu(options));
|
225
|
-
this.addHook('afterRenderer', (TD, row, col, prop, value, cellProperties) =>
|
226
|
-
this.addHook('afterScroll', () =>
|
308
|
+
this.addHook('afterRenderer', (TD, row, col, prop, value, cellProperties) => _classPrivateMethodGet(this, _onAfterRenderer, _onAfterRenderer2).call(this, TD, cellProperties));
|
309
|
+
this.addHook('afterScroll', () => _classPrivateMethodGet(this, _onAfterScroll, _onAfterScroll2).call(this));
|
227
310
|
this.addHook('afterBeginEditing', () => this.hide());
|
228
|
-
this.addHook('afterDocumentKeyDown', event =>
|
229
|
-
_classPrivateFieldGet(
|
230
|
-
_classPrivateFieldGet(
|
311
|
+
this.addHook('afterDocumentKeyDown', event => _classPrivateMethodGet(this, _onAfterDocumentKeyDown, _onAfterDocumentKeyDown2).call(this, event));
|
312
|
+
_classPrivateFieldGet(this, _displaySwitch).addLocalHook('hide', () => this.hide());
|
313
|
+
_classPrivateFieldGet(this, _displaySwitch).addLocalHook('show', (row, col) => this.showAtCell(row, col));
|
231
314
|
this.registerShortcuts();
|
232
315
|
this.registerListeners();
|
233
316
|
super.enablePlugin();
|
@@ -240,7 +323,7 @@ export class Comments extends BasePlugin {
|
|
240
323
|
* - [`comments`](@/api/options.md#comments)
|
241
324
|
*/
|
242
325
|
updatePlugin() {
|
243
|
-
_classPrivateFieldGet(
|
326
|
+
_classPrivateFieldGet(this, _displaySwitch).updateDelay(this.getDisplayDelaySetting());
|
244
327
|
super.updatePlugin();
|
245
328
|
}
|
246
329
|
|
@@ -265,34 +348,34 @@ export class Comments extends BasePlugin {
|
|
265
348
|
keys: [['Control', 'Alt', 'M']],
|
266
349
|
callback: () => {
|
267
350
|
const range = this.hot.getSelectedRangeLast();
|
268
|
-
_classPrivateFieldSet(
|
351
|
+
_classPrivateFieldSet(this, _preventEditorHiding, true);
|
269
352
|
this.hot.scrollToFocusedCell(() => {
|
270
353
|
this.setRange(range);
|
271
354
|
this.show();
|
272
355
|
this.focusEditor();
|
273
356
|
manager.setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
274
357
|
this.hot._registerTimeout(() => {
|
275
|
-
_classPrivateFieldSet(
|
358
|
+
_classPrivateFieldSet(this, _preventEditorHiding, false);
|
276
359
|
});
|
277
360
|
});
|
278
361
|
},
|
279
362
|
stopPropagation: true,
|
280
363
|
runOnlyIf: () => {
|
281
364
|
var _this$hot$getSelected;
|
282
|
-
return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isCell()) && !_classPrivateFieldGet(
|
365
|
+
return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isCell()) && !_classPrivateFieldGet(this, _editor).isVisible();
|
283
366
|
},
|
284
367
|
group: SHORTCUTS_GROUP
|
285
368
|
});
|
286
369
|
pluginContext.addShortcut({
|
287
370
|
keys: [['Escape']],
|
288
371
|
callback: () => {
|
289
|
-
_classPrivateFieldGet(
|
372
|
+
_classPrivateFieldGet(this, _editor).setValue(_classPrivateFieldGet(this, _commentValueBeforeSave));
|
290
373
|
this.hide();
|
291
374
|
manager.setActiveContextName('grid');
|
292
375
|
},
|
293
376
|
runOnlyIf: () => {
|
294
377
|
var _this$hot$getSelected2;
|
295
|
-
return ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isCell()) && _classPrivateFieldGet(
|
378
|
+
return ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isCell()) && _classPrivateFieldGet(this, _editor).isVisible();
|
296
379
|
},
|
297
380
|
group: SHORTCUTS_GROUP
|
298
381
|
});
|
@@ -304,7 +387,7 @@ export class Comments extends BasePlugin {
|
|
304
387
|
},
|
305
388
|
runOnlyIf: () => {
|
306
389
|
var _this$hot$getSelected3;
|
307
|
-
return ((_this$hot$getSelected3 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected3 === void 0 ? void 0 : _this$hot$getSelected3.highlight.isCell()) && _classPrivateFieldGet(
|
390
|
+
return ((_this$hot$getSelected3 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected3 === void 0 ? void 0 : _this$hot$getSelected3.highlight.isCell()) && _classPrivateFieldGet(this, _editor).isVisible();
|
308
391
|
},
|
309
392
|
group: SHORTCUTS_GROUP
|
310
393
|
});
|
@@ -329,13 +412,13 @@ export class Comments extends BasePlugin {
|
|
329
412
|
rootDocument
|
330
413
|
} = this.hot;
|
331
414
|
const editorElement = this.getEditorInputElement();
|
332
|
-
this.eventManager.addEventListener(rootDocument, 'mouseover', event =>
|
333
|
-
this.eventManager.addEventListener(rootDocument, 'mousedown', event =>
|
334
|
-
this.eventManager.addEventListener(rootDocument, 'mouseup', () =>
|
335
|
-
this.eventManager.addEventListener(editorElement, 'focus', () =>
|
336
|
-
this.eventManager.addEventListener(editorElement, 'blur', () =>
|
337
|
-
this.eventManager.addEventListener(editorElement, 'mousedown', event =>
|
338
|
-
this.eventManager.addEventListener(editorElement, 'mouseup', event =>
|
415
|
+
this.eventManager.addEventListener(rootDocument, 'mouseover', event => _classPrivateMethodGet(this, _onMouseOver, _onMouseOver2).call(this, event));
|
416
|
+
this.eventManager.addEventListener(rootDocument, 'mousedown', event => _classPrivateMethodGet(this, _onMouseDown, _onMouseDown2).call(this, event));
|
417
|
+
this.eventManager.addEventListener(rootDocument, 'mouseup', () => _classPrivateMethodGet(this, _onMouseUp, _onMouseUp2).call(this));
|
418
|
+
this.eventManager.addEventListener(editorElement, 'focus', () => _classPrivateMethodGet(this, _onEditorFocus, _onEditorFocus2).call(this));
|
419
|
+
this.eventManager.addEventListener(editorElement, 'blur', () => _classPrivateMethodGet(this, _onEditorBlur, _onEditorBlur2).call(this));
|
420
|
+
this.eventManager.addEventListener(editorElement, 'mousedown', event => _classPrivateMethodGet(this, _onEditorMouseDown, _onEditorMouseDown2).call(this, event));
|
421
|
+
this.eventManager.addEventListener(editorElement, 'mouseup', event => _classPrivateMethodGet(this, _onEditorMouseUp, _onEditorMouseUp2).call(this, event));
|
339
422
|
}
|
340
423
|
|
341
424
|
/**
|
@@ -386,7 +469,7 @@ export class Comments extends BasePlugin {
|
|
386
469
|
if (!this.range.from) {
|
387
470
|
throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');
|
388
471
|
}
|
389
|
-
const editorValue = _classPrivateFieldGet(
|
472
|
+
const editorValue = _classPrivateFieldGet(this, _editor).getValue();
|
390
473
|
let comment = '';
|
391
474
|
if (value !== null && value !== undefined) {
|
392
475
|
comment = value;
|
@@ -489,9 +572,9 @@ export class Comments extends BasePlugin {
|
|
489
572
|
return false;
|
490
573
|
}
|
491
574
|
const meta = this.hot.getCellMeta(this.range.from.row, this.range.from.col);
|
492
|
-
_classPrivateFieldGet(
|
493
|
-
_classPrivateFieldGet(
|
494
|
-
_classPrivateFieldGet(
|
575
|
+
_classPrivateFieldGet(this, _displaySwitch).cancelHiding();
|
576
|
+
_classPrivateFieldGet(this, _editor).setValue((_ref = meta[META_COMMENT] ? meta[META_COMMENT][META_COMMENT_VALUE] : null) !== null && _ref !== void 0 ? _ref : '');
|
577
|
+
_classPrivateFieldGet(this, _editor).show();
|
495
578
|
this.refreshEditor(true);
|
496
579
|
return true;
|
497
580
|
}
|
@@ -514,7 +597,7 @@ export class Comments extends BasePlugin {
|
|
514
597
|
* Hides the comment editor.
|
515
598
|
*/
|
516
599
|
hide() {
|
517
|
-
_classPrivateFieldGet(
|
600
|
+
_classPrivateFieldGet(this, _editor).hide();
|
518
601
|
}
|
519
602
|
|
520
603
|
/**
|
@@ -525,7 +608,7 @@ export class Comments extends BasePlugin {
|
|
525
608
|
refreshEditor() {
|
526
609
|
var _renderableRow, _renderableColumn;
|
527
610
|
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
528
|
-
if (!force && (!this.range.from || !_classPrivateFieldGet(
|
611
|
+
if (!force && (!this.range.from || !_classPrivateFieldGet(this, _editor).isVisible())) {
|
529
612
|
return;
|
530
613
|
}
|
531
614
|
const {
|
@@ -543,7 +626,7 @@ export class Comments extends BasePlugin {
|
|
543
626
|
|
544
627
|
// Reset the editor position to (0, 0) so the opening direction calculation wouldn't be influenced by its
|
545
628
|
// previous position
|
546
|
-
_classPrivateFieldGet(
|
629
|
+
_classPrivateFieldGet(this, _editor).setPosition(0, 0);
|
547
630
|
if (renderableRow === null) {
|
548
631
|
renderableRow = rowIndexMapper.getRenderableFromVisualIndex(rowIndexMapper.getNearestNotHiddenIndex(visualRow, -1));
|
549
632
|
}
|
@@ -571,9 +654,9 @@ export class Comments extends BasePlugin {
|
|
571
654
|
}, true);
|
572
655
|
const commentStyle = this.getCommentMeta(visualRow, visualColumn, META_STYLE);
|
573
656
|
if (commentStyle) {
|
574
|
-
_classPrivateFieldGet(
|
657
|
+
_classPrivateFieldGet(this, _editor).setSize(commentStyle.width, commentStyle.height);
|
575
658
|
} else {
|
576
|
-
_classPrivateFieldGet(
|
659
|
+
_classPrivateFieldGet(this, _editor).resetSize();
|
577
660
|
}
|
578
661
|
const lastColWidth = isBeforeRenderedColumns ? 0 : wtTable.getStretchedColumnWidth(renderableColumn);
|
579
662
|
const lastRowHeight = targetingPreviousRow && !isBeforeRenderedRows ? outerHeight(TD) : 0;
|
@@ -586,7 +669,7 @@ export class Comments extends BasePlugin {
|
|
586
669
|
const {
|
587
670
|
width: editorWidth,
|
588
671
|
height: editorHeight
|
589
|
-
} = _classPrivateFieldGet(
|
672
|
+
} = _classPrivateFieldGet(this, _editor).getSize();
|
590
673
|
const {
|
591
674
|
innerWidth,
|
592
675
|
innerHeight
|
@@ -607,15 +690,15 @@ export class Comments extends BasePlugin {
|
|
607
690
|
if (top + editorHeight > innerHeight) {
|
608
691
|
y -= editorHeight - cellHeight + 1;
|
609
692
|
}
|
610
|
-
_classPrivateFieldGet(
|
611
|
-
_classPrivateFieldGet(
|
693
|
+
_classPrivateFieldGet(this, _editor).setPosition(x, y);
|
694
|
+
_classPrivateFieldGet(this, _editor).setReadOnlyState(this.getCommentMeta(visualRow, visualColumn, META_READONLY));
|
612
695
|
}
|
613
696
|
|
614
697
|
/**
|
615
698
|
* Focuses the comments editor element.
|
616
699
|
*/
|
617
700
|
focusEditor() {
|
618
|
-
_classPrivateFieldGet(
|
701
|
+
_classPrivateFieldGet(this, _editor).focus();
|
619
702
|
}
|
620
703
|
|
621
704
|
/**
|
@@ -684,27 +767,27 @@ export class Comments extends BasePlugin {
|
|
684
767
|
* @returns {HTMLTextAreaElement}
|
685
768
|
*/
|
686
769
|
getEditorInputElement() {
|
687
|
-
return _classPrivateFieldGet(
|
770
|
+
return _classPrivateFieldGet(this, _editor).getInputElement();
|
688
771
|
}
|
689
772
|
|
690
773
|
/**
|
691
774
|
* Destroys the plugin instance.
|
692
775
|
*/
|
693
776
|
destroy() {
|
694
|
-
if (_classPrivateFieldGet(
|
695
|
-
_classPrivateFieldGet(
|
777
|
+
if (_classPrivateFieldGet(this, _editor)) {
|
778
|
+
_classPrivateFieldGet(this, _editor).destroy();
|
696
779
|
}
|
697
|
-
if (_classPrivateFieldGet(
|
698
|
-
_classPrivateFieldGet(
|
780
|
+
if (_classPrivateFieldGet(this, _displaySwitch)) {
|
781
|
+
_classPrivateFieldGet(this, _displaySwitch).destroy();
|
699
782
|
}
|
700
783
|
super.destroy();
|
701
784
|
}
|
702
785
|
}
|
703
|
-
function
|
786
|
+
function _onMouseDown2(event) {
|
704
787
|
if (!this.hot.view || !this.hot.view._wt) {
|
705
788
|
return;
|
706
789
|
}
|
707
|
-
if (!_classPrivateFieldGet(
|
790
|
+
if (!_classPrivateFieldGet(this, _preventEditorAutoSwitch) && !this.targetIsCommentTextArea(event)) {
|
708
791
|
const eventCell = closest(event.target, 'TD', 'TBODY');
|
709
792
|
let coordinates = null;
|
710
793
|
if (eventCell) {
|
@@ -715,81 +798,49 @@ function _onMouseDown(event) {
|
|
715
798
|
}
|
716
799
|
}
|
717
800
|
}
|
718
|
-
|
719
|
-
* `mouseover` event callback.
|
720
|
-
*
|
721
|
-
* @param {MouseEvent} event The `mouseover` event.
|
722
|
-
*/
|
723
|
-
function _onMouseOver(event) {
|
801
|
+
function _onMouseOver2(event) {
|
724
802
|
const {
|
725
803
|
rootDocument
|
726
804
|
} = this.hot;
|
727
|
-
if (_classPrivateFieldGet(
|
805
|
+
if (_classPrivateFieldGet(this, _preventEditorAutoSwitch) || _classPrivateFieldGet(this, _editor).isFocused() || hasClass(event.target, 'wtBorder') || _classPrivateFieldGet(this, _cellBelowCursor) === event.target || !_classPrivateFieldGet(this, _editor)) {
|
728
806
|
return;
|
729
807
|
}
|
730
|
-
_classPrivateFieldSet(
|
808
|
+
_classPrivateFieldSet(this, _cellBelowCursor, rootDocument.elementFromPoint(event.clientX, event.clientY));
|
731
809
|
if (this.targetIsCellWithComment(event)) {
|
732
810
|
const range = this.hot._createCellRange(this.hot.getCoords(event.target));
|
733
|
-
_classPrivateFieldGet(
|
811
|
+
_classPrivateFieldGet(this, _displaySwitch).show(range);
|
734
812
|
} else if (isChildOf(event.target, rootDocument) && !this.targetIsCommentTextArea(event)) {
|
735
|
-
_classPrivateFieldGet(
|
813
|
+
_classPrivateFieldGet(this, _displaySwitch).hide();
|
736
814
|
}
|
737
815
|
}
|
738
|
-
|
739
|
-
|
740
|
-
*/
|
741
|
-
function _onMouseUp() {
|
742
|
-
_classPrivateFieldSet(_preventEditorAutoSwitch, this, false);
|
816
|
+
function _onMouseUp2() {
|
817
|
+
_classPrivateFieldSet(this, _preventEditorAutoSwitch, false);
|
743
818
|
}
|
744
|
-
|
745
|
-
* The `afterRenderer` hook callback.
|
746
|
-
*
|
747
|
-
* @param {HTMLTableCellElement} TD The rendered `TD` element.
|
748
|
-
* @param {object} cellProperties The rendered cell's property object.
|
749
|
-
*/
|
750
|
-
function _onAfterRenderer(TD, cellProperties) {
|
819
|
+
function _onAfterRenderer2(TD, cellProperties) {
|
751
820
|
if (cellProperties[META_COMMENT] && cellProperties[META_COMMENT][META_COMMENT_VALUE]) {
|
752
821
|
addClass(TD, cellProperties.commentedCellClassName);
|
753
822
|
}
|
754
823
|
}
|
755
|
-
|
756
|
-
|
757
|
-
* editor content and gives back the keyboard shortcuts control by switching to the "grid" context.
|
758
|
-
*/
|
759
|
-
function _onEditorBlur() {
|
760
|
-
_classPrivateFieldSet(_commentValueBeforeSave, this, '');
|
824
|
+
function _onEditorBlur2() {
|
825
|
+
_classPrivateFieldSet(this, _commentValueBeforeSave, '');
|
761
826
|
this.hot.getShortcutManager().setActiveContextName('grid');
|
762
827
|
this.setComment();
|
763
828
|
}
|
764
|
-
|
765
|
-
|
766
|
-
* the keyboard shortcuts by switching the context to plugins one.
|
767
|
-
*/
|
768
|
-
function _onEditorFocus() {
|
769
|
-
_classPrivateFieldSet(_commentValueBeforeSave, this, this.getComment());
|
829
|
+
function _onEditorFocus2() {
|
830
|
+
_classPrivateFieldSet(this, _commentValueBeforeSave, this.getComment());
|
770
831
|
this.hot.listen();
|
771
832
|
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
772
833
|
}
|
773
|
-
|
774
|
-
|
775
|
-
*
|
776
|
-
* @param {MouseEvent} event The `mousedown` event.
|
777
|
-
*/
|
778
|
-
function _onEditorMouseDown(event) {
|
779
|
-
_classPrivateFieldSet(_tempEditorDimensions, this, {
|
834
|
+
function _onEditorMouseDown2(event) {
|
835
|
+
_classPrivateFieldSet(this, _tempEditorDimensions, {
|
780
836
|
width: outerWidth(event.target),
|
781
837
|
height: outerHeight(event.target)
|
782
838
|
});
|
783
839
|
}
|
784
|
-
|
785
|
-
* `mouseup` hook. Along with `onEditorMouseDown` used to simulate the textarea resizing event.
|
786
|
-
*
|
787
|
-
* @param {MouseEvent} event The `mouseup` event.
|
788
|
-
*/
|
789
|
-
function _onEditorMouseUp(event) {
|
840
|
+
function _onEditorMouseUp2(event) {
|
790
841
|
const currentWidth = outerWidth(event.target);
|
791
842
|
const currentHeight = outerHeight(event.target);
|
792
|
-
if (currentWidth !== _classPrivateFieldGet(
|
843
|
+
if (currentWidth !== _classPrivateFieldGet(this, _tempEditorDimensions).width + 1 || currentHeight !== _classPrivateFieldGet(this, _tempEditorDimensions).height + 2) {
|
793
844
|
this.updateCommentMeta(this.range.from.row, this.range.from.col, {
|
794
845
|
[META_STYLE]: {
|
795
846
|
width: currentWidth,
|
@@ -798,22 +849,13 @@ function _onEditorMouseUp(event) {
|
|
798
849
|
});
|
799
850
|
}
|
800
851
|
}
|
801
|
-
|
802
|
-
|
803
|
-
* the table editor into the fast edit mode.
|
804
|
-
*
|
805
|
-
* @param {Event} event The keydown event.
|
806
|
-
*/
|
807
|
-
function _onAfterDocumentKeyDown(event) {
|
808
|
-
if (_classPrivateFieldGet(_editor, this).isVisible()) {
|
852
|
+
function _onAfterDocumentKeyDown2(event) {
|
853
|
+
if (_classPrivateFieldGet(this, _editor).isVisible()) {
|
809
854
|
stopImmediatePropagation(event);
|
810
855
|
}
|
811
856
|
}
|
812
|
-
|
813
|
-
|
814
|
-
*/
|
815
|
-
function _onAfterScroll() {
|
816
|
-
if (!_classPrivateFieldGet(_preventEditorHiding, this)) {
|
857
|
+
function _onAfterScroll2() {
|
858
|
+
if (!_classPrivateFieldGet(this, _preventEditorHiding)) {
|
817
859
|
this.hide();
|
818
860
|
}
|
819
861
|
}
|
@@ -18,7 +18,7 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
18
18
|
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; }
|
19
19
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
20
20
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
21
|
-
function
|
21
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
22
22
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'contextMenu';
|
23
23
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 70;
|
24
24
|
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
@@ -52,16 +52,31 @@ _pluginHooks.default.getSingleton().register('afterContextMenuExecute');
|
|
52
52
|
*
|
53
53
|
* @plugin ContextMenu
|
54
54
|
*/
|
55
|
-
var
|
55
|
+
var _onAfterOnCellContextMenu = /*#__PURE__*/new WeakSet();
|
56
|
+
var _onMenuBeforeOpen = /*#__PURE__*/new WeakSet();
|
57
|
+
var _onMenuAfterOpen = /*#__PURE__*/new WeakSet();
|
58
|
+
var _onMenuAfterClose = /*#__PURE__*/new WeakSet();
|
56
59
|
class ContextMenu extends _base.BasePlugin {
|
57
60
|
constructor() {
|
58
61
|
super(...arguments);
|
62
|
+
/**
|
63
|
+
* On menu after close listener.
|
64
|
+
*/
|
65
|
+
_classPrivateMethodInitSpec(this, _onMenuAfterClose);
|
66
|
+
/**
|
67
|
+
* On menu after open listener.
|
68
|
+
*/
|
69
|
+
_classPrivateMethodInitSpec(this, _onMenuAfterOpen);
|
70
|
+
/**
|
71
|
+
* On menu before open listener.
|
72
|
+
*/
|
73
|
+
_classPrivateMethodInitSpec(this, _onMenuBeforeOpen);
|
59
74
|
/**
|
60
75
|
* On contextmenu listener.
|
61
76
|
*
|
62
77
|
* @param {Event} event The mouse event object.
|
63
78
|
*/
|
64
|
-
_classPrivateMethodInitSpec(this,
|
79
|
+
_classPrivateMethodInitSpec(this, _onAfterOnCellContextMenu);
|
65
80
|
/**
|
66
81
|
* Instance of {@link CommandExecutor}.
|
67
82
|
*
|
@@ -129,16 +144,16 @@ class ContextMenu extends _base.BasePlugin {
|
|
129
144
|
keepInViewport: true,
|
130
145
|
container: settings.uiContainer || this.hot.rootDocument.body
|
131
146
|
});
|
132
|
-
this.menu.addLocalHook('beforeOpen', () =>
|
133
|
-
this.menu.addLocalHook('afterOpen', () =>
|
134
|
-
this.menu.addLocalHook('afterClose', () =>
|
147
|
+
this.menu.addLocalHook('beforeOpen', () => _classPrivateMethodGet(this, _onMenuBeforeOpen, _onMenuBeforeOpen2).call(this));
|
148
|
+
this.menu.addLocalHook('afterOpen', () => _classPrivateMethodGet(this, _onMenuAfterOpen, _onMenuAfterOpen2).call(this));
|
149
|
+
this.menu.addLocalHook('afterClose', () => _classPrivateMethodGet(this, _onMenuAfterClose, _onMenuAfterClose2).call(this));
|
135
150
|
this.menu.addLocalHook('executeCommand', function () {
|
136
151
|
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
137
152
|
params[_key] = arguments[_key];
|
138
153
|
}
|
139
154
|
return _this.executeCommand.call(_this, ...params);
|
140
155
|
});
|
141
|
-
this.addHook('afterOnCellContextMenu', event =>
|
156
|
+
this.addHook('afterOnCellContextMenu', event => _classPrivateMethodGet(this, _onAfterOnCellContextMenu, _onAfterOnCellContextMenu2).call(this, event));
|
142
157
|
this.registerShortcuts();
|
143
158
|
super.enablePlugin();
|
144
159
|
}
|
@@ -326,7 +341,7 @@ class ContextMenu extends _base.BasePlugin {
|
|
326
341
|
}
|
327
342
|
}
|
328
343
|
exports.ContextMenu = ContextMenu;
|
329
|
-
function
|
344
|
+
function _onAfterOnCellContextMenu2(event) {
|
330
345
|
const settings = this.hot.getSettings();
|
331
346
|
const showRowHeaders = settings.rowHeaders;
|
332
347
|
const showColHeaders = settings.colHeaders;
|
@@ -357,22 +372,13 @@ function _onAfterOnCellContextMenu(event) {
|
|
357
372
|
left: event.clientX + offset.left
|
358
373
|
});
|
359
374
|
}
|
360
|
-
|
361
|
-
* On menu before open listener.
|
362
|
-
*/
|
363
|
-
function _onMenuBeforeOpen() {
|
375
|
+
function _onMenuBeforeOpen2() {
|
364
376
|
this.hot.runHooks('beforeContextMenuShow', this);
|
365
377
|
}
|
366
|
-
|
367
|
-
* On menu after open listener.
|
368
|
-
*/
|
369
|
-
function _onMenuAfterOpen() {
|
378
|
+
function _onMenuAfterOpen2() {
|
370
379
|
this.hot.runHooks('afterContextMenuShow', this);
|
371
380
|
}
|
372
|
-
|
373
|
-
* On menu after close listener.
|
374
|
-
*/
|
375
|
-
function _onMenuAfterClose() {
|
381
|
+
function _onMenuAfterClose2() {
|
376
382
|
this.hot.listen();
|
377
383
|
this.hot.runHooks('afterContextMenuHide', this);
|
378
384
|
}
|