handsontable 0.0.0-next-bfb0e3a-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/overlays.js +1 -1
- package/3rdparty/walkontable/src/overlays.mjs +1 -1
- 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 +9117 -8969
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +292 -292
- package/dist/handsontable.js +6569 -6874
- 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 -1
- package/helpers/dom/element.mjs +1 -1
- 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
@@ -1,11 +1,14 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
3
3
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
4
4
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
5
5
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
6
|
-
function
|
7
|
-
function
|
8
|
-
function
|
6
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
7
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
8
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
9
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
10
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
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; } }
|
9
12
|
import { BasePlugin } from "../base/index.mjs";
|
10
13
|
import { addClass } from "../../helpers/dom/element.mjs";
|
11
14
|
import { rangeEach } from "../../helpers/number.mjs";
|
@@ -132,10 +135,47 @@ export const PLUGIN_PRIORITY = 320;
|
|
132
135
|
*/
|
133
136
|
var _settings = /*#__PURE__*/new WeakMap();
|
134
137
|
var _hiddenRowsMap = /*#__PURE__*/new WeakMap();
|
135
|
-
var
|
138
|
+
var _onModifyRowHeight = /*#__PURE__*/new WeakSet();
|
139
|
+
var _onAfterGetCellMeta = /*#__PURE__*/new WeakSet();
|
140
|
+
var _onModifyCopyableRange = /*#__PURE__*/new WeakSet();
|
141
|
+
var _onAfterGetRowHeader = /*#__PURE__*/new WeakSet();
|
142
|
+
var _onAfterContextMenuDefaultOptions = /*#__PURE__*/new WeakSet();
|
143
|
+
var _onMapInit = /*#__PURE__*/new WeakSet();
|
136
144
|
export class HiddenRows extends BasePlugin {
|
137
145
|
constructor() {
|
138
146
|
super(...arguments);
|
147
|
+
/**
|
148
|
+
* On map initialized hook callback.
|
149
|
+
*/
|
150
|
+
_classPrivateMethodInitSpec(this, _onMapInit);
|
151
|
+
/**
|
152
|
+
* Add Show-hide rows to context menu.
|
153
|
+
*
|
154
|
+
* @param {object} options An array of objects containing information about the pre-defined Context Menu items.
|
155
|
+
*/
|
156
|
+
_classPrivateMethodInitSpec(this, _onAfterContextMenuDefaultOptions);
|
157
|
+
/**
|
158
|
+
* Adds the needed classes to the headers.
|
159
|
+
*
|
160
|
+
* @param {number} row Visual row index.
|
161
|
+
* @param {HTMLElement} TH Header's TH element.
|
162
|
+
*/
|
163
|
+
_classPrivateMethodInitSpec(this, _onAfterGetRowHeader);
|
164
|
+
/**
|
165
|
+
* Modifies the copyable range, accordingly to the provided config.
|
166
|
+
*
|
167
|
+
* @param {Array} ranges An array of objects defining copyable cells.
|
168
|
+
* @returns {Array}
|
169
|
+
*/
|
170
|
+
_classPrivateMethodInitSpec(this, _onModifyCopyableRange);
|
171
|
+
/**
|
172
|
+
* Sets the copy-related cell meta.
|
173
|
+
*
|
174
|
+
* @param {number} row Visual row index.
|
175
|
+
* @param {number} column Visual column index.
|
176
|
+
* @param {object} cellProperties Object containing the cell properties.
|
177
|
+
*/
|
178
|
+
_classPrivateMethodInitSpec(this, _onAfterGetCellMeta);
|
139
179
|
/**
|
140
180
|
* Adds the additional row height for the hidden row indicators.
|
141
181
|
*
|
@@ -143,21 +183,27 @@ export class HiddenRows extends BasePlugin {
|
|
143
183
|
* @param {number} row Visual row index.
|
144
184
|
* @returns {number}
|
145
185
|
*/
|
146
|
-
_classPrivateMethodInitSpec(this,
|
186
|
+
_classPrivateMethodInitSpec(this, _onModifyRowHeight);
|
147
187
|
/**
|
148
188
|
* Cached settings from Handsontable settings.
|
149
189
|
*
|
150
190
|
* @private
|
151
191
|
* @type {object}
|
152
192
|
*/
|
153
|
-
_classPrivateFieldInitSpec(this, _settings, {
|
193
|
+
_classPrivateFieldInitSpec(this, _settings, {
|
194
|
+
writable: true,
|
195
|
+
value: {}
|
196
|
+
});
|
154
197
|
/**
|
155
198
|
* Map of hidden rows by the plugin.
|
156
199
|
*
|
157
200
|
* @private
|
158
201
|
* @type {HidingMap|null}
|
159
202
|
*/
|
160
|
-
_classPrivateFieldInitSpec(this, _hiddenRowsMap,
|
203
|
+
_classPrivateFieldInitSpec(this, _hiddenRowsMap, {
|
204
|
+
writable: true,
|
205
|
+
value: null
|
206
|
+
});
|
161
207
|
}
|
162
208
|
static get PLUGIN_KEY() {
|
163
209
|
return PLUGIN_KEY;
|
@@ -185,29 +231,29 @@ export class HiddenRows extends BasePlugin {
|
|
185
231
|
}
|
186
232
|
const pluginSettings = this.hot.getSettings()[PLUGIN_KEY];
|
187
233
|
if (isObject(pluginSettings)) {
|
188
|
-
_classPrivateFieldSet(
|
234
|
+
_classPrivateFieldSet(this, _settings, pluginSettings);
|
189
235
|
if (isUndefined(pluginSettings.copyPasteEnabled)) {
|
190
236
|
pluginSettings.copyPasteEnabled = true;
|
191
237
|
}
|
192
238
|
}
|
193
|
-
_classPrivateFieldSet(
|
194
|
-
_classPrivateFieldGet(
|
195
|
-
this.hot.rowIndexMapper.registerMap(this.pluginName, _classPrivateFieldGet(
|
239
|
+
_classPrivateFieldSet(this, _hiddenRowsMap, new HidingMap());
|
240
|
+
_classPrivateFieldGet(this, _hiddenRowsMap).addLocalHook('init', () => _classPrivateMethodGet(this, _onMapInit, _onMapInit2).call(this));
|
241
|
+
this.hot.rowIndexMapper.registerMap(this.pluginName, _classPrivateFieldGet(this, _hiddenRowsMap));
|
196
242
|
this.addHook('afterContextMenuDefaultOptions', function () {
|
197
243
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
198
244
|
args[_key] = arguments[_key];
|
199
245
|
}
|
200
|
-
return
|
246
|
+
return _classPrivateMethodGet(_this, _onAfterContextMenuDefaultOptions, _onAfterContextMenuDefaultOptions2).call(_this, ...args);
|
201
247
|
});
|
202
|
-
this.addHook('afterGetCellMeta', (row, col, cellProperties) =>
|
203
|
-
this.addHook('modifyRowHeight', (height, row) =>
|
248
|
+
this.addHook('afterGetCellMeta', (row, col, cellProperties) => _classPrivateMethodGet(this, _onAfterGetCellMeta, _onAfterGetCellMeta2).call(this, row, col, cellProperties));
|
249
|
+
this.addHook('modifyRowHeight', (height, row) => _classPrivateMethodGet(this, _onModifyRowHeight, _onModifyRowHeight2).call(this, height, row));
|
204
250
|
this.addHook('afterGetRowHeader', function () {
|
205
251
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
206
252
|
args[_key2] = arguments[_key2];
|
207
253
|
}
|
208
|
-
return
|
254
|
+
return _classPrivateMethodGet(_this, _onAfterGetRowHeader, _onAfterGetRowHeader2).call(_this, ...args);
|
209
255
|
});
|
210
|
-
this.addHook('modifyCopyableRange', ranges =>
|
256
|
+
this.addHook('modifyCopyableRange', ranges => _classPrivateMethodGet(this, _onModifyCopyableRange, _onModifyCopyableRange2).call(this, ranges));
|
211
257
|
super.enablePlugin();
|
212
258
|
}
|
213
259
|
|
@@ -228,7 +274,7 @@ export class HiddenRows extends BasePlugin {
|
|
228
274
|
*/
|
229
275
|
disablePlugin() {
|
230
276
|
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
231
|
-
_classPrivateFieldSet(
|
277
|
+
_classPrivateFieldSet(this, _settings, {});
|
232
278
|
super.disablePlugin();
|
233
279
|
this.resetCellsMeta();
|
234
280
|
}
|
@@ -242,7 +288,7 @@ export class HiddenRows extends BasePlugin {
|
|
242
288
|
const currentHideConfig = this.getHiddenRows();
|
243
289
|
const isValidConfig = this.isValidConfig(rows);
|
244
290
|
let destinationHideConfig = currentHideConfig;
|
245
|
-
const hidingMapValues = _classPrivateFieldGet(
|
291
|
+
const hidingMapValues = _classPrivateFieldGet(this, _hiddenRowsMap).getValues().slice();
|
246
292
|
const isAnyRowShowed = rows.length > 0;
|
247
293
|
if (isValidConfig && isAnyRowShowed) {
|
248
294
|
const physicalRows = rows.map(visualRow => this.hot.toPhysicalRow(visualRow));
|
@@ -265,7 +311,7 @@ export class HiddenRows extends BasePlugin {
|
|
265
311
|
return;
|
266
312
|
}
|
267
313
|
if (isValidConfig && isAnyRowShowed) {
|
268
|
-
_classPrivateFieldGet(
|
314
|
+
_classPrivateFieldGet(this, _hiddenRowsMap).setValues(hidingMapValues);
|
269
315
|
}
|
270
316
|
this.hot.runHooks('afterUnhideRows', currentHideConfig, destinationHideConfig, isValidConfig && isAnyRowShowed, isValidConfig && destinationHideConfig.length < currentHideConfig.length);
|
271
317
|
}
|
@@ -301,7 +347,7 @@ export class HiddenRows extends BasePlugin {
|
|
301
347
|
if (isConfigValid) {
|
302
348
|
this.hot.batchExecution(() => {
|
303
349
|
arrayEach(rows, visualRow => {
|
304
|
-
_classPrivateFieldGet(
|
350
|
+
_classPrivateFieldGet(this, _hiddenRowsMap).setValueAtIndex(this.hot.toPhysicalRow(visualRow), true);
|
305
351
|
});
|
306
352
|
}, true);
|
307
353
|
}
|
@@ -326,7 +372,7 @@ export class HiddenRows extends BasePlugin {
|
|
326
372
|
* @returns {number[]}
|
327
373
|
*/
|
328
374
|
getHiddenRows() {
|
329
|
-
return arrayMap(_classPrivateFieldGet(
|
375
|
+
return arrayMap(_classPrivateFieldGet(this, _hiddenRowsMap).getHiddenIndexes(), physicalRowIndex => {
|
330
376
|
return this.hot.toVisualRow(physicalRowIndex);
|
331
377
|
});
|
332
378
|
}
|
@@ -338,7 +384,7 @@ export class HiddenRows extends BasePlugin {
|
|
338
384
|
* @returns {boolean}
|
339
385
|
*/
|
340
386
|
isHidden(row) {
|
341
|
-
return _classPrivateFieldGet(
|
387
|
+
return _classPrivateFieldGet(this, _hiddenRowsMap).getValueAtIndex(this.hot.toPhysicalRow(row)) || false;
|
342
388
|
}
|
343
389
|
|
344
390
|
/**
|
@@ -371,12 +417,12 @@ export class HiddenRows extends BasePlugin {
|
|
371
417
|
* Destroys the plugin instance.
|
372
418
|
*/
|
373
419
|
destroy() {
|
374
|
-
_classPrivateFieldSet(
|
375
|
-
_classPrivateFieldSet(
|
420
|
+
_classPrivateFieldSet(this, _settings, null);
|
421
|
+
_classPrivateFieldSet(this, _hiddenRowsMap, null);
|
376
422
|
super.destroy();
|
377
423
|
}
|
378
424
|
}
|
379
|
-
function
|
425
|
+
function _onModifyRowHeight2(height, row) {
|
380
426
|
// Hook is triggered internally only for the visible rows. Conditional will be handled for the API
|
381
427
|
// calls of the `getRowHeight` function on not visible indexes.
|
382
428
|
if (this.isHidden(row)) {
|
@@ -384,15 +430,8 @@ function _onModifyRowHeight(height, row) {
|
|
384
430
|
}
|
385
431
|
return height;
|
386
432
|
}
|
387
|
-
|
388
|
-
|
389
|
-
*
|
390
|
-
* @param {number} row Visual row index.
|
391
|
-
* @param {number} column Visual column index.
|
392
|
-
* @param {object} cellProperties Object containing the cell properties.
|
393
|
-
*/
|
394
|
-
function _onAfterGetCellMeta(row, column, cellProperties) {
|
395
|
-
if (_classPrivateFieldGet(_settings, this).copyPasteEnabled === false && this.isHidden(row)) {
|
433
|
+
function _onAfterGetCellMeta2(row, column, cellProperties) {
|
434
|
+
if (_classPrivateFieldGet(this, _settings).copyPasteEnabled === false && this.isHidden(row)) {
|
396
435
|
// Cell property handled by the `Autofill` and the `CopyPaste` plugins.
|
397
436
|
cellProperties.skipRowOnPaste = true;
|
398
437
|
}
|
@@ -412,15 +451,9 @@ function _onAfterGetCellMeta(row, column, cellProperties) {
|
|
412
451
|
}
|
413
452
|
}
|
414
453
|
}
|
415
|
-
|
416
|
-
* Modifies the copyable range, accordingly to the provided config.
|
417
|
-
*
|
418
|
-
* @param {Array} ranges An array of objects defining copyable cells.
|
419
|
-
* @returns {Array}
|
420
|
-
*/
|
421
|
-
function _onModifyCopyableRange(ranges) {
|
454
|
+
function _onModifyCopyableRange2(ranges) {
|
422
455
|
// Ranges shouldn't be modified when `copyPasteEnabled` option is set to `true` (by default).
|
423
|
-
if (_classPrivateFieldGet(
|
456
|
+
if (_classPrivateFieldGet(this, _settings).copyPasteEnabled) {
|
424
457
|
return ranges;
|
425
458
|
}
|
426
459
|
const newRanges = [];
|
@@ -454,14 +487,8 @@ function _onModifyCopyableRange(ranges) {
|
|
454
487
|
});
|
455
488
|
return newRanges;
|
456
489
|
}
|
457
|
-
|
458
|
-
|
459
|
-
*
|
460
|
-
* @param {number} row Visual row index.
|
461
|
-
* @param {HTMLElement} TH Header's TH element.
|
462
|
-
*/
|
463
|
-
function _onAfterGetRowHeader(row, TH) {
|
464
|
-
if (!_classPrivateFieldGet(_settings, this).indicators || row < 0) {
|
490
|
+
function _onAfterGetRowHeader2(row, TH) {
|
491
|
+
if (!_classPrivateFieldGet(this, _settings).indicators || row < 0) {
|
465
492
|
return;
|
466
493
|
}
|
467
494
|
const classList = [];
|
@@ -473,21 +500,13 @@ function _onAfterGetRowHeader(row, TH) {
|
|
473
500
|
}
|
474
501
|
addClass(TH, classList);
|
475
502
|
}
|
476
|
-
|
477
|
-
* Add Show-hide rows to context menu.
|
478
|
-
*
|
479
|
-
* @param {object} options An array of objects containing information about the pre-defined Context Menu items.
|
480
|
-
*/
|
481
|
-
function _onAfterContextMenuDefaultOptions(options) {
|
503
|
+
function _onAfterContextMenuDefaultOptions2(options) {
|
482
504
|
options.items.push({
|
483
505
|
name: SEPARATOR
|
484
506
|
}, hideRowItem(this), showRowItem(this));
|
485
507
|
}
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
function _onMapInit() {
|
490
|
-
if (Array.isArray(_classPrivateFieldGet(_settings, this).rows)) {
|
491
|
-
this.hideRows(_classPrivateFieldGet(_settings, this).rows);
|
508
|
+
function _onMapInit2() {
|
509
|
+
if (Array.isArray(_classPrivateFieldGet(this, _settings).rows)) {
|
510
|
+
this.hideRows(_classPrivateFieldGet(this, _settings).rows);
|
492
511
|
}
|
493
512
|
}
|
@@ -11,9 +11,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
11
11
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
12
12
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
13
13
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
14
|
-
function _classPrivateFieldGet(
|
15
|
-
function
|
16
|
-
function
|
14
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
15
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
16
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
17
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
18
|
+
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; } }
|
19
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
17
20
|
_pluginHooks.default.getSingleton().register('beforeColumnFreeze');
|
18
21
|
_pluginHooks.default.getSingleton().register('afterColumnFreeze');
|
19
22
|
_pluginHooks.default.getSingleton().register('beforeColumnUnfreeze');
|
@@ -38,23 +41,36 @@ const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 110;
|
|
38
41
|
* ```
|
39
42
|
*/
|
40
43
|
var _afterFirstUse = /*#__PURE__*/new WeakMap();
|
41
|
-
var
|
44
|
+
var _addContextMenuEntry = /*#__PURE__*/new WeakSet();
|
45
|
+
var _onBeforeColumnMove = /*#__PURE__*/new WeakSet();
|
42
46
|
class ManualColumnFreeze extends _base.BasePlugin {
|
43
47
|
constructor() {
|
44
48
|
super(...arguments);
|
49
|
+
/**
|
50
|
+
* Prevents moving the columns from/to fixed area.
|
51
|
+
*
|
52
|
+
* @private
|
53
|
+
* @param {Array} columns Array of visual column indexes to be moved.
|
54
|
+
* @param {number} finalIndex Visual column index, being a start index for the moved columns. Points to where the elements will be placed after the moving action.
|
55
|
+
* @returns {boolean|undefined}
|
56
|
+
*/
|
57
|
+
_classPrivateMethodInitSpec(this, _onBeforeColumnMove);
|
45
58
|
/**
|
46
59
|
* Adds the manualColumnFreeze context menu entries.
|
47
60
|
*
|
48
61
|
* @private
|
49
62
|
* @param {object} options Context menu options.
|
50
63
|
*/
|
51
|
-
_classPrivateMethodInitSpec(this,
|
64
|
+
_classPrivateMethodInitSpec(this, _addContextMenuEntry);
|
52
65
|
/**
|
53
66
|
* Determines when the moving operation is allowed.
|
54
67
|
*
|
55
68
|
* @type {boolean}
|
56
69
|
*/
|
57
|
-
_classPrivateFieldInitSpec(this, _afterFirstUse,
|
70
|
+
_classPrivateFieldInitSpec(this, _afterFirstUse, {
|
71
|
+
writable: true,
|
72
|
+
value: false
|
73
|
+
});
|
58
74
|
}
|
59
75
|
static get PLUGIN_KEY() {
|
60
76
|
return PLUGIN_KEY;
|
@@ -79,8 +95,8 @@ class ManualColumnFreeze extends _base.BasePlugin {
|
|
79
95
|
if (this.enabled) {
|
80
96
|
return;
|
81
97
|
}
|
82
|
-
this.addHook('afterContextMenuDefaultOptions', options =>
|
83
|
-
this.addHook('beforeColumnMove', (columns, finalIndex) =>
|
98
|
+
this.addHook('afterContextMenuDefaultOptions', options => _classPrivateMethodGet(this, _addContextMenuEntry, _addContextMenuEntry2).call(this, options));
|
99
|
+
this.addHook('beforeColumnMove', (columns, finalIndex) => _classPrivateMethodGet(this, _onBeforeColumnMove, _onBeforeColumnMove2).call(this, columns, finalIndex));
|
84
100
|
super.enablePlugin();
|
85
101
|
}
|
86
102
|
|
@@ -88,7 +104,7 @@ class ManualColumnFreeze extends _base.BasePlugin {
|
|
88
104
|
* Disables the plugin functionality for this Handsontable instance.
|
89
105
|
*/
|
90
106
|
disablePlugin() {
|
91
|
-
_classPrivateFieldSet(
|
107
|
+
_classPrivateFieldSet(this, _afterFirstUse, false);
|
92
108
|
super.disablePlugin();
|
93
109
|
}
|
94
110
|
|
@@ -116,8 +132,8 @@ class ManualColumnFreeze extends _base.BasePlugin {
|
|
116
132
|
const settings = this.hot.getSettings();
|
117
133
|
// columns are already fixed (frozen)
|
118
134
|
const freezePerformed = settings.fixedColumnsStart < this.hot.countCols() && column > settings.fixedColumnsStart - 1;
|
119
|
-
if (!_classPrivateFieldGet(
|
120
|
-
_classPrivateFieldSet(
|
135
|
+
if (!_classPrivateFieldGet(this, _afterFirstUse)) {
|
136
|
+
_classPrivateFieldSet(this, _afterFirstUse, true);
|
121
137
|
}
|
122
138
|
const beforeColumnFreezeHook = this.hot.runHooks('beforeColumnFreeze', column, freezePerformed);
|
123
139
|
if (beforeColumnFreezeHook === false) {
|
@@ -144,8 +160,8 @@ class ManualColumnFreeze extends _base.BasePlugin {
|
|
144
160
|
const settings = this.hot.getSettings();
|
145
161
|
// columns are not fixed (not frozen)
|
146
162
|
const unfreezePerformed = settings.fixedColumnsStart > 0 && column <= settings.fixedColumnsStart - 1;
|
147
|
-
if (!_classPrivateFieldGet(
|
148
|
-
_classPrivateFieldSet(
|
163
|
+
if (!_classPrivateFieldGet(this, _afterFirstUse)) {
|
164
|
+
_classPrivateFieldSet(this, _afterFirstUse, true);
|
149
165
|
}
|
150
166
|
const beforeColumnUnfreezeHook = this.hot.runHooks('beforeColumnUnfreeze', column, unfreezePerformed);
|
151
167
|
if (beforeColumnUnfreezeHook === false) {
|
@@ -163,21 +179,13 @@ class ManualColumnFreeze extends _base.BasePlugin {
|
|
163
179
|
}
|
164
180
|
}
|
165
181
|
exports.ManualColumnFreeze = ManualColumnFreeze;
|
166
|
-
function
|
182
|
+
function _addContextMenuEntry2(options) {
|
167
183
|
options.items.push({
|
168
184
|
name: '---------'
|
169
185
|
}, (0, _freezeColumn.default)(this), (0, _unfreezeColumn.default)(this));
|
170
186
|
}
|
171
|
-
|
172
|
-
|
173
|
-
*
|
174
|
-
* @private
|
175
|
-
* @param {Array} columns Array of visual column indexes to be moved.
|
176
|
-
* @param {number} finalIndex Visual column index, being a start index for the moved columns. Points to where the elements will be placed after the moving action.
|
177
|
-
* @returns {boolean|undefined}
|
178
|
-
*/
|
179
|
-
function _onBeforeColumnMove(columns, finalIndex) {
|
180
|
-
if (_classPrivateFieldGet(_afterFirstUse, this)) {
|
187
|
+
function _onBeforeColumnMove2(columns, finalIndex) {
|
188
|
+
if (_classPrivateFieldGet(this, _afterFirstUse)) {
|
181
189
|
const freezeLine = this.hot.getSettings().fixedColumnsStart;
|
182
190
|
|
183
191
|
// Moving any column before the "freeze line" isn't possible.
|
@@ -1,11 +1,14 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
3
3
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
4
4
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
5
5
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
6
|
-
function _classPrivateFieldGet(
|
7
|
-
function
|
8
|
-
function
|
6
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
7
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
8
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
9
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
10
|
+
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; } }
|
11
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
9
12
|
import { BasePlugin } from "../base/index.mjs";
|
10
13
|
import Hooks from "../../pluginHooks.mjs";
|
11
14
|
import freezeColumnItem from "./contextMenuItem/freezeColumn.mjs";
|
@@ -34,23 +37,36 @@ export const PLUGIN_PRIORITY = 110;
|
|
34
37
|
* ```
|
35
38
|
*/
|
36
39
|
var _afterFirstUse = /*#__PURE__*/new WeakMap();
|
37
|
-
var
|
40
|
+
var _addContextMenuEntry = /*#__PURE__*/new WeakSet();
|
41
|
+
var _onBeforeColumnMove = /*#__PURE__*/new WeakSet();
|
38
42
|
export class ManualColumnFreeze extends BasePlugin {
|
39
43
|
constructor() {
|
40
44
|
super(...arguments);
|
45
|
+
/**
|
46
|
+
* Prevents moving the columns from/to fixed area.
|
47
|
+
*
|
48
|
+
* @private
|
49
|
+
* @param {Array} columns Array of visual column indexes to be moved.
|
50
|
+
* @param {number} finalIndex Visual column index, being a start index for the moved columns. Points to where the elements will be placed after the moving action.
|
51
|
+
* @returns {boolean|undefined}
|
52
|
+
*/
|
53
|
+
_classPrivateMethodInitSpec(this, _onBeforeColumnMove);
|
41
54
|
/**
|
42
55
|
* Adds the manualColumnFreeze context menu entries.
|
43
56
|
*
|
44
57
|
* @private
|
45
58
|
* @param {object} options Context menu options.
|
46
59
|
*/
|
47
|
-
_classPrivateMethodInitSpec(this,
|
60
|
+
_classPrivateMethodInitSpec(this, _addContextMenuEntry);
|
48
61
|
/**
|
49
62
|
* Determines when the moving operation is allowed.
|
50
63
|
*
|
51
64
|
* @type {boolean}
|
52
65
|
*/
|
53
|
-
_classPrivateFieldInitSpec(this, _afterFirstUse,
|
66
|
+
_classPrivateFieldInitSpec(this, _afterFirstUse, {
|
67
|
+
writable: true,
|
68
|
+
value: false
|
69
|
+
});
|
54
70
|
}
|
55
71
|
static get PLUGIN_KEY() {
|
56
72
|
return PLUGIN_KEY;
|
@@ -75,8 +91,8 @@ export class ManualColumnFreeze extends BasePlugin {
|
|
75
91
|
if (this.enabled) {
|
76
92
|
return;
|
77
93
|
}
|
78
|
-
this.addHook('afterContextMenuDefaultOptions', options =>
|
79
|
-
this.addHook('beforeColumnMove', (columns, finalIndex) =>
|
94
|
+
this.addHook('afterContextMenuDefaultOptions', options => _classPrivateMethodGet(this, _addContextMenuEntry, _addContextMenuEntry2).call(this, options));
|
95
|
+
this.addHook('beforeColumnMove', (columns, finalIndex) => _classPrivateMethodGet(this, _onBeforeColumnMove, _onBeforeColumnMove2).call(this, columns, finalIndex));
|
80
96
|
super.enablePlugin();
|
81
97
|
}
|
82
98
|
|
@@ -84,7 +100,7 @@ export class ManualColumnFreeze extends BasePlugin {
|
|
84
100
|
* Disables the plugin functionality for this Handsontable instance.
|
85
101
|
*/
|
86
102
|
disablePlugin() {
|
87
|
-
_classPrivateFieldSet(
|
103
|
+
_classPrivateFieldSet(this, _afterFirstUse, false);
|
88
104
|
super.disablePlugin();
|
89
105
|
}
|
90
106
|
|
@@ -112,8 +128,8 @@ export class ManualColumnFreeze extends BasePlugin {
|
|
112
128
|
const settings = this.hot.getSettings();
|
113
129
|
// columns are already fixed (frozen)
|
114
130
|
const freezePerformed = settings.fixedColumnsStart < this.hot.countCols() && column > settings.fixedColumnsStart - 1;
|
115
|
-
if (!_classPrivateFieldGet(
|
116
|
-
_classPrivateFieldSet(
|
131
|
+
if (!_classPrivateFieldGet(this, _afterFirstUse)) {
|
132
|
+
_classPrivateFieldSet(this, _afterFirstUse, true);
|
117
133
|
}
|
118
134
|
const beforeColumnFreezeHook = this.hot.runHooks('beforeColumnFreeze', column, freezePerformed);
|
119
135
|
if (beforeColumnFreezeHook === false) {
|
@@ -140,8 +156,8 @@ export class ManualColumnFreeze extends BasePlugin {
|
|
140
156
|
const settings = this.hot.getSettings();
|
141
157
|
// columns are not fixed (not frozen)
|
142
158
|
const unfreezePerformed = settings.fixedColumnsStart > 0 && column <= settings.fixedColumnsStart - 1;
|
143
|
-
if (!_classPrivateFieldGet(
|
144
|
-
_classPrivateFieldSet(
|
159
|
+
if (!_classPrivateFieldGet(this, _afterFirstUse)) {
|
160
|
+
_classPrivateFieldSet(this, _afterFirstUse, true);
|
145
161
|
}
|
146
162
|
const beforeColumnUnfreezeHook = this.hot.runHooks('beforeColumnUnfreeze', column, unfreezePerformed);
|
147
163
|
if (beforeColumnUnfreezeHook === false) {
|
@@ -158,21 +174,13 @@ export class ManualColumnFreeze extends BasePlugin {
|
|
158
174
|
this.hot.runHooks('afterColumnUnfreeze', column, unfreezePerformed);
|
159
175
|
}
|
160
176
|
}
|
161
|
-
function
|
177
|
+
function _addContextMenuEntry2(options) {
|
162
178
|
options.items.push({
|
163
179
|
name: '---------'
|
164
180
|
}, freezeColumnItem(this), unfreezeColumnItem(this));
|
165
181
|
}
|
166
|
-
|
167
|
-
|
168
|
-
*
|
169
|
-
* @private
|
170
|
-
* @param {Array} columns Array of visual column indexes to be moved.
|
171
|
-
* @param {number} finalIndex Visual column index, being a start index for the moved columns. Points to where the elements will be placed after the moving action.
|
172
|
-
* @returns {boolean|undefined}
|
173
|
-
*/
|
174
|
-
function _onBeforeColumnMove(columns, finalIndex) {
|
175
|
-
if (_classPrivateFieldGet(_afterFirstUse, this)) {
|
182
|
+
function _onBeforeColumnMove2(columns, finalIndex) {
|
183
|
+
if (_classPrivateFieldGet(this, _afterFirstUse)) {
|
176
184
|
const freezeLine = this.hot.getSettings().fixedColumnsStart;
|
177
185
|
|
178
186
|
// Moving any column before the "freeze line" isn't possible.
|