handsontable 0.0.0-next-5a535ed-20240403 → 0.0.0-next-c2810a1-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 +12 -17
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +12 -17
- package/3rdparty/walkontable/src/calculator/viewportRows.js +10 -15
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +10 -15
- package/3rdparty/walkontable/src/cell/coords.js +12 -17
- package/3rdparty/walkontable/src/cell/coords.mjs +12 -17
- package/3rdparty/walkontable/src/cell/range.d.ts +2 -1
- package/3rdparty/walkontable/src/cell/range.js +40 -28
- package/3rdparty/walkontable/src/cell/range.mjs +40 -28
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +72 -104
- package/3rdparty/walkontable/src/event.mjs +72 -104
- package/3rdparty/walkontable/src/overlay/inlineStart.js +15 -1
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +16 -2
- package/3rdparty/walkontable/src/overlay/top.js +11 -0
- package/3rdparty/walkontable/src/overlay/top.mjs +12 -1
- package/3rdparty/walkontable/src/overlays.js +46 -4
- package/3rdparty/walkontable/src/overlays.mjs +46 -4
- package/3rdparty/walkontable/src/scroll.js +15 -17
- package/3rdparty/walkontable/src/scroll.mjs +15 -17
- package/3rdparty/walkontable/src/selection/manager.js +48 -69
- package/3rdparty/walkontable/src/selection/manager.mjs +48 -69
- package/3rdparty/walkontable/src/selection/scanner.js +33 -42
- package/3rdparty/walkontable/src/selection/scanner.mjs +33 -42
- package/3rdparty/walkontable/src/utils/columnStretching.js +27 -44
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +27 -44
- 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 +4 -1
- package/core/viewportScroll/index.mjs +4 -1
- package/core/viewportScroll/scrollStrategies/focusScroll.js +15 -0
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +11 -0
- package/core.d.ts +4 -3
- package/core.js +77 -22
- package/core.mjs +77 -22
- 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 +9063 -9122
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +292 -292
- package/dist/handsontable.js +6968 -6574
- 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 +25 -23
- package/editorManager.mjs +25 -23
- package/editors/autocompleteEditor/autocompleteEditor.js +6 -10
- package/editors/autocompleteEditor/autocompleteEditor.mjs +6 -10
- package/editors/selectEditor/selectEditor.js +20 -19
- package/editors/selectEditor/selectEditor.mjs +20 -19
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +64 -82
- package/focusManager.mjs +64 -82
- package/helpers/dom/element.js +23 -1
- package/helpers/dom/element.mjs +21 -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/i18n/languages/ar-AR.d.ts +5 -0
- package/i18n/languages/cs-CZ.d.ts +5 -0
- package/i18n/languages/hr-HR.d.ts +5 -0
- package/i18n/languages/sr-SP.d.ts +5 -0
- package/index.d.ts +10 -0
- package/package.json +7 -2
- package/pluginHooks.d.ts +4 -3
- package/pluginHooks.js +99 -38
- package/pluginHooks.mjs +99 -38
- package/plugins/autoColumnSize/autoColumnSize.js +49 -65
- package/plugins/autoColumnSize/autoColumnSize.mjs +49 -65
- package/plugins/autoRowSize/autoRowSize.js +28 -34
- package/plugins/autoRowSize/autoRowSize.mjs +28 -34
- package/plugins/autofill/autofill.js +30 -38
- package/plugins/autofill/autofill.mjs +30 -38
- package/plugins/base/base.js +12 -17
- package/plugins/base/base.mjs +12 -17
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +59 -50
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +59 -50
- package/plugins/columnSorting/columnSorting.js +49 -45
- package/plugins/columnSorting/columnSorting.mjs +49 -45
- package/plugins/columnSummary/columnSummary.js +22 -26
- package/plugins/columnSummary/columnSummary.mjs +22 -26
- package/plugins/comments/comments.js +116 -158
- package/plugins/comments/comments.mjs +116 -158
- package/plugins/contextMenu/contextMenu.js +20 -26
- package/plugins/contextMenu/contextMenu.mjs +20 -26
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +26 -10
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +26 -10
- package/plugins/contextMenu/menu/menu.js +13 -21
- package/plugins/contextMenu/menu/menu.mjs +13 -21
- package/plugins/contextMenu/menu/positioner.js +41 -58
- package/plugins/contextMenu/menu/positioner.mjs +41 -58
- package/plugins/copyPaste/copyPaste.js +116 -157
- package/plugins/copyPaste/copyPaste.mjs +116 -157
- package/plugins/copyPaste/copyableRanges.js +43 -66
- package/plugins/copyPaste/copyableRanges.mjs +43 -66
- package/plugins/customBorders/customBorders.js +11 -13
- package/plugins/customBorders/customBorders.mjs +11 -13
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +81 -107
- package/plugins/dropdownMenu/dropdownMenu.mjs +81 -107
- 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 +13 -15
- package/plugins/filters/component/condition.mjs +13 -15
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +24 -28
- package/plugins/filters/component/value.mjs +24 -28
- package/plugins/filters/conditionUpdateObserver.js +22 -24
- package/plugins/filters/conditionUpdateObserver.mjs +22 -24
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +81 -95
- package/plugins/filters/filters.mjs +81 -95
- package/plugins/filters/ui/input.js +13 -19
- package/plugins/filters/ui/input.mjs +13 -19
- package/plugins/filters/ui/link.js +8 -13
- package/plugins/filters/ui/link.mjs +8 -13
- package/plugins/filters/ui/multipleSelect.js +85 -112
- package/plugins/filters/ui/multipleSelect.mjs +85 -112
- package/plugins/filters/ui/radioInput.js +12 -20
- package/plugins/filters/ui/radioInput.mjs +12 -20
- package/plugins/filters/ui/select.js +50 -72
- package/plugins/filters/ui/select.mjs +49 -71
- package/plugins/formulas/formulas.js +268 -326
- package/plugins/formulas/formulas.mjs +269 -327
- package/plugins/formulas/indexSyncer/axisSyncer.js +38 -61
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +38 -61
- package/plugins/formulas/indexSyncer/index.js +25 -48
- package/plugins/formulas/indexSyncer/index.mjs +25 -48
- package/plugins/hiddenColumns/hiddenColumns.js +64 -83
- package/plugins/hiddenColumns/hiddenColumns.mjs +64 -83
- package/plugins/hiddenRows/hiddenRows.js +63 -82
- package/plugins/hiddenRows/hiddenRows.mjs +63 -82
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +24 -32
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +25 -33
- package/plugins/manualColumnMove/manualColumnMove.js +126 -170
- package/plugins/manualColumnMove/manualColumnMove.mjs +126 -170
- package/plugins/manualColumnResize/manualColumnResize.js +169 -230
- package/plugins/manualColumnResize/manualColumnResize.mjs +169 -230
- package/plugins/manualRowMove/manualRowMove.js +99 -128
- package/plugins/manualRowMove/manualRowMove.mjs +99 -128
- package/plugins/manualRowResize/manualRowResize.js +150 -209
- package/plugins/manualRowResize/manualRowResize.mjs +150 -209
- package/plugins/mergeCells/calculations/selection.js +2 -71
- package/plugins/mergeCells/calculations/selection.mjs +2 -71
- package/plugins/mergeCells/cellsCollection.js +117 -1
- package/plugins/mergeCells/cellsCollection.mjs +117 -1
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +11 -1
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +11 -1
- package/plugins/mergeCells/focusOrder.js +305 -0
- package/plugins/mergeCells/focusOrder.mjs +300 -0
- package/plugins/mergeCells/mergeCells.js +499 -397
- package/plugins/mergeCells/mergeCells.mjs +499 -397
- package/plugins/multiColumnSorting/multiColumnSorting.js +8 -2
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +8 -2
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +205 -253
- package/plugins/nestedHeaders/nestedHeaders.mjs +206 -254
- package/plugins/nestedHeaders/stateManager/headersTree.js +21 -32
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +21 -32
- package/plugins/nestedHeaders/stateManager/index.js +30 -41
- package/plugins/nestedHeaders/stateManager/index.mjs +30 -41
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +19 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +19 -30
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +151 -182
- package/plugins/nestedRows/nestedRows.mjs +152 -183
- package/plugins/nestedRows/ui/contextMenu.js +11 -15
- package/plugins/nestedRows/ui/contextMenu.mjs +10 -14
- 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 +15 -19
- package/plugins/touchScroll/touchScroll.mjs +16 -20
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +8 -5
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +8 -5
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +2 -0
- package/selection/highlight/visualSelection.mjs +2 -0
- package/selection/selection.js +225 -67
- package/selection/selection.mjs +224 -66
- package/selection/transformation.js +149 -118
- package/selection/transformation.mjs +149 -118
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +18 -3
- package/shortcutContexts/commands/editor/open.mjs +18 -3
- 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 +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +9 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +9 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +10 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +10 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +3 -1
- 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 +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +6 -1
- package/shortcutContexts/grid.js +9 -3
- package/shortcutContexts/grid.mjs +9 -3
- package/shortcuts/context.js +2 -1
- package/shortcuts/context.mjs +2 -1
- package/tableView.js +52 -78
- package/tableView.mjs +52 -78
- package/translations/changesObservable/observable.js +21 -38
- package/translations/changesObservable/observable.mjs +21 -38
- package/translations/changesObservable/observer.js +7 -12
- package/translations/changesObservable/observer.mjs +6 -11
- 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 +6 -1
- package/utils/dataStructures/linkedList.mjs +6 -1
- package/utils/dataStructures/tree.js +1 -1
- package/utils/dataStructures/tree.mjs +1 -1
- package/utils/interval.js +26 -44
- package/utils/interval.mjs +26 -44
package/pluginHooks.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import "core-js/modules/es.array.push.js";
|
2
1
|
import "core-js/modules/es.error.cause.js";
|
2
|
+
import "core-js/modules/es.array.push.js";
|
3
3
|
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; }
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
5
5
|
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); }
|
@@ -130,7 +130,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
130
130
|
'afterCellMetaReset',
|
131
131
|
/**
|
132
132
|
* Fired after one or more cells has been changed. The changes are triggered in any situation when the
|
133
|
-
* value is entered using an editor or changed using API (e.q setDataAtCell).
|
133
|
+
* value is entered using an editor or changed using API (e.q [`setDataAtCell`](@/api/core.md#setdataatcell) method).
|
134
134
|
*
|
135
135
|
* __Note:__ For performance reasons, the `changes` array is null for `"loadData"` source.
|
136
136
|
*
|
@@ -173,7 +173,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
173
173
|
'afterContextMenuDefaultOptions',
|
174
174
|
/**
|
175
175
|
* Fired each time user opens {@link ContextMenu} plugin before setting up the Context Menu's items but after filtering these options by
|
176
|
-
* user (`contextMenu` option). This hook can by helpful to determine if user use specified menu item or to set up
|
176
|
+
* user ([`contextMenu`](@/api/options.md#contextmenu) option). This hook can by helpful to determine if user use specified menu item or to set up
|
177
177
|
* one of the menu item to by always visible.
|
178
178
|
*
|
179
179
|
* @event Hooks#beforeContextMenuSetItems
|
@@ -191,7 +191,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
191
191
|
'afterDropdownMenuDefaultOptions',
|
192
192
|
/**
|
193
193
|
* Fired by {@link DropdownMenu} plugin before setting up the Dropdown Menu's items but after filtering these options
|
194
|
-
* by user (`dropdownMenu` option). This hook can by helpful to determine if user use specified menu item or to set
|
194
|
+
* by user ([`dropdownMenu`](@/api/options.md#dropdownmenu) option). This hook can by helpful to determine if user use specified menu item or to set
|
195
195
|
* up one of the menu item to by always visible.
|
196
196
|
*
|
197
197
|
* @event Hooks#beforeDropdownMenuSetItems
|
@@ -318,7 +318,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
318
318
|
*/
|
319
319
|
'afterDestroy',
|
320
320
|
/**
|
321
|
-
* Hook fired after keydown event is handled.
|
321
|
+
* Hook fired after `keydown` event is handled.
|
322
322
|
*
|
323
323
|
* @event Hooks#afterDocumentKeyDown
|
324
324
|
* @param {Event} event A native `keydown` event object.
|
@@ -410,7 +410,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
410
410
|
*/
|
411
411
|
'afterUpdateData',
|
412
412
|
/**
|
413
|
-
* Fired after a scroll event, which is identified as a momentum scroll (e.g.
|
413
|
+
* Fired after a scroll event, which is identified as a momentum scroll (e.g. on an iPad).
|
414
414
|
*
|
415
415
|
* @event Hooks#afterMomentumScroll
|
416
416
|
*/
|
@@ -594,7 +594,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
594
594
|
*/
|
595
595
|
'afterScroll',
|
596
596
|
/**
|
597
|
-
* Fired after one or more cells are selected (e.g.
|
597
|
+
* Fired after one or more cells are selected (e.g. during mouse move).
|
598
598
|
*
|
599
599
|
* @event Hooks#afterSelection
|
600
600
|
* @param {number} row Selection start visual row index.
|
@@ -646,7 +646,9 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
646
646
|
* @param {string} prop Selection start data source object property name.
|
647
647
|
* @param {number} row2 Selection end visual row index.
|
648
648
|
* @param {string} prop2 Selection end data source object property name.
|
649
|
-
* @param {object} preventScrolling
|
649
|
+
* @param {object} preventScrolling A reference to the observable object with the `value` property.
|
650
|
+
* Property `preventScrolling.value` expects a boolean value that
|
651
|
+
* Handsontable uses to control scroll behavior after selection.
|
650
652
|
* @param {number} selectionLayerLevel The number which indicates what selection layer is currently modified.
|
651
653
|
* @example
|
652
654
|
* ```js
|
@@ -673,7 +675,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
673
675
|
*/
|
674
676
|
'afterSelectionByProp',
|
675
677
|
/**
|
676
|
-
* Fired after one or more cells are selected (e.g.
|
678
|
+
* Fired after one or more cells are selected (e.g. on mouse up).
|
677
679
|
*
|
678
680
|
* @event Hooks#afterSelectionEnd
|
679
681
|
* @param {number} row Selection start visual row index.
|
@@ -684,7 +686,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
684
686
|
*/
|
685
687
|
'afterSelectionEnd',
|
686
688
|
/**
|
687
|
-
* Fired after one or more cells are selected (e.g.
|
689
|
+
* Fired after one or more cells are selected (e.g. on mouse up).
|
688
690
|
*
|
689
691
|
* The `prop` and `prop2` arguments represent the source object property name instead of the column number.
|
690
692
|
*
|
@@ -696,6 +698,46 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
696
698
|
* @param {number} selectionLayerLevel The number which indicates what selection layer is currently modified.
|
697
699
|
*/
|
698
700
|
'afterSelectionEndByProp',
|
701
|
+
/**
|
702
|
+
* Fired after the focus position within a selected range is changed.
|
703
|
+
*
|
704
|
+
* @since 14.3.0
|
705
|
+
* @event Hooks#afterSelectionFocusSet
|
706
|
+
* @param {number} row The focus visual row index position.
|
707
|
+
* @param {number} column The focus visual column index position.
|
708
|
+
* @param {object} preventScrolling A reference to the observable object with the `value` property.
|
709
|
+
* Property `preventScrolling.value` expects a boolean value that
|
710
|
+
* Handsontable uses to control scroll behavior after selection.
|
711
|
+
* @example
|
712
|
+
* ```js
|
713
|
+
* ::: only-for javascript
|
714
|
+
* new Handsontable(element, {
|
715
|
+
* afterSelectionFocusSet: (row, column, preventScrolling) => {
|
716
|
+
* // If set to `false` (default): when focused cell selection is outside the viewport,
|
717
|
+
* // Handsontable scrolls the viewport to that cell.
|
718
|
+
* // If set to `true`: when focused cell selection is outside the viewport,
|
719
|
+
* // Handsontable doesn't scroll the viewport.
|
720
|
+
* preventScrolling.value = true;
|
721
|
+
* }
|
722
|
+
* })
|
723
|
+
* ```
|
724
|
+
* :::
|
725
|
+
*
|
726
|
+
* ::: only-for react
|
727
|
+
* ```jsx
|
728
|
+
* <HotTable
|
729
|
+
* afterSelectionFocusSet={(row, column, preventScrolling) => {
|
730
|
+
* // If set to `false` (default): when focused cell selection is outside the viewport,
|
731
|
+
* // Handsontable scrolls the viewport to that cell.
|
732
|
+
* // If set to `true`: when focused cell selection is outside the viewport,
|
733
|
+
* // Handsontable doesn't scroll the viewport.
|
734
|
+
* preventScrolling.value = true;
|
735
|
+
* }}
|
736
|
+
* />
|
737
|
+
* ```
|
738
|
+
* :::
|
739
|
+
*/
|
740
|
+
'afterSelectionFocusSet',
|
699
741
|
/**
|
700
742
|
* Fired before one or more columns are selected (e.g. During mouse header click or {@link Core#selectColumns} API call).
|
701
743
|
*
|
@@ -731,7 +773,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
731
773
|
*/
|
732
774
|
'beforeSelectColumns',
|
733
775
|
/**
|
734
|
-
* Fired after one or more columns are selected (e.g.
|
776
|
+
* Fired after one or more columns are selected (e.g. during mouse header click or {@link Core#selectColumns} API call).
|
735
777
|
*
|
736
778
|
* @since 14.0.0
|
737
779
|
* @event Hooks#afterSelectColumns
|
@@ -741,7 +783,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
741
783
|
*/
|
742
784
|
'afterSelectColumns',
|
743
785
|
/**
|
744
|
-
* Fired before one or more rows are selected (e.g.
|
786
|
+
* Fired before one or more rows are selected (e.g. during mouse header click or {@link Core#selectRows} API call).
|
745
787
|
*
|
746
788
|
* @since 14.0.0
|
747
789
|
* @event Hooks#beforeSelectRows
|
@@ -775,7 +817,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
775
817
|
*/
|
776
818
|
'beforeSelectRows',
|
777
819
|
/**
|
778
|
-
* Fired after one or more rows are selected (e.g.
|
820
|
+
* Fired after one or more rows are selected (e.g. during mouse header click or {@link Core#selectRows} API call).
|
779
821
|
*
|
780
822
|
* @since 14.0.0
|
781
823
|
* @event Hooks#afterSelectRows
|
@@ -815,7 +857,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
815
857
|
'afterSetDataAtCell',
|
816
858
|
/**
|
817
859
|
* Fired after cell data was changed.
|
818
|
-
* Called only when `setDataAtRowProp` was executed.
|
860
|
+
* Called only when [`setDataAtRowProp`](@/api/core.md#setdataatrowprop) was executed.
|
819
861
|
*
|
820
862
|
* @event Hooks#afterSetDataAtRowProp
|
821
863
|
* @param {Array} changes An array of changes in format `[[row, prop, oldValue, value], ...]`.
|
@@ -833,7 +875,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
833
875
|
*/
|
834
876
|
'afterSetSourceDataAtCell',
|
835
877
|
/**
|
836
|
-
* Fired after calling the `updateSettings` method.
|
878
|
+
* Fired after calling the [`updateSettings`](@/api/core.md#updatesettings) method.
|
837
879
|
*
|
838
880
|
* @event Hooks#afterUpdateSettings
|
839
881
|
* @param {object} newSettings New settings object.
|
@@ -883,7 +925,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
883
925
|
* @param {string} direction Declares the direction of the autofill. Possible values: `up`, `down`, `left`, `right`.
|
884
926
|
*
|
885
927
|
* @returns {boolean|Array[]} If false, the operation is cancelled. If array of arrays, the returned data
|
886
|
-
* will be passed into `populateFromArray` instead of the default autofill
|
928
|
+
* will be passed into [`populateFromArray`](@/api/core.md#populatefromarray) instead of the default autofill
|
887
929
|
* algorithm's result.
|
888
930
|
*/
|
889
931
|
'beforeAutofill',
|
@@ -905,17 +947,10 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
905
947
|
*
|
906
948
|
* @event Hooks#beforeCellAlignment
|
907
949
|
* @param {object} stateBefore An object with class names defining the cell alignment.
|
908
|
-
* @param {CellRange[]} range An array of CellRange coordinates where the alignment will be applied.
|
950
|
+
* @param {CellRange[]} range An array of `CellRange` coordinates where the alignment will be applied.
|
909
951
|
* @param {string} type Type of the alignment - either `horizontal` or `vertical`.
|
910
952
|
* @param {string} alignmentClass String defining the alignment class added to the cell.
|
911
|
-
* Possible values:
|
912
|
-
* * `htLeft`
|
913
|
-
* * `htCenter`
|
914
|
-
* * `htRight`
|
915
|
-
* * `htJustify`
|
916
|
-
* * `htTop`
|
917
|
-
* * `htMiddle`
|
918
|
-
* * `htBottom`.
|
953
|
+
* Possible values: `htLeft` , `htCenter`, `htRight`, `htJustify`, `htTop`, `htMiddle`, `htBottom`.
|
919
954
|
*/
|
920
955
|
'beforeCellAlignment',
|
921
956
|
/**
|
@@ -1076,7 +1111,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1076
1111
|
*/
|
1077
1112
|
'beforeUpdateData',
|
1078
1113
|
/**
|
1079
|
-
* Hook fired before keydown event is handled. It can be used to stop default key bindings.
|
1114
|
+
* Hook fired before `keydown` event is handled. It can be used to stop default key bindings.
|
1080
1115
|
*
|
1081
1116
|
* __Note__: To prevent default behavior you need to call `false` in your `beforeKeyDown` handler.
|
1082
1117
|
*
|
@@ -1250,25 +1285,33 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1250
1285
|
* @returns {boolean|undefined} If false is returned the action is canceled.
|
1251
1286
|
*/
|
1252
1287
|
'beforeSetCellMeta',
|
1288
|
+
/**
|
1289
|
+
* Fired before setting focus selection.
|
1290
|
+
*
|
1291
|
+
* @since 14.3.0
|
1292
|
+
* @event Hooks#beforeSelectionFocusSet
|
1293
|
+
* @param {CellCoords} coords CellCoords instance.
|
1294
|
+
*/
|
1295
|
+
'beforeSelectionFocusSet',
|
1253
1296
|
/**
|
1254
1297
|
* Fired before setting range is started but not finished yet.
|
1255
1298
|
*
|
1256
1299
|
* @event Hooks#beforeSetRangeStartOnly
|
1257
|
-
* @param {CellCoords} coords CellCoords instance.
|
1300
|
+
* @param {CellCoords} coords `CellCoords` instance.
|
1258
1301
|
*/
|
1259
1302
|
'beforeSetRangeStartOnly',
|
1260
1303
|
/**
|
1261
1304
|
* Fired before setting range is started.
|
1262
1305
|
*
|
1263
1306
|
* @event Hooks#beforeSetRangeStart
|
1264
|
-
* @param {CellCoords} coords CellCoords instance.
|
1307
|
+
* @param {CellCoords} coords `CellCoords` instance.
|
1265
1308
|
*/
|
1266
1309
|
'beforeSetRangeStart',
|
1267
1310
|
/**
|
1268
1311
|
* Fired before setting range is ended.
|
1269
1312
|
*
|
1270
1313
|
* @event Hooks#beforeSetRangeEnd
|
1271
|
-
* @param {CellCoords} coords CellCoords instance.
|
1314
|
+
* @param {CellCoords} coords `CellCoords` instance.
|
1272
1315
|
*/
|
1273
1316
|
'beforeSetRangeEnd',
|
1274
1317
|
/**
|
@@ -1401,7 +1444,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1401
1444
|
*/
|
1402
1445
|
'modifyRowData',
|
1403
1446
|
/**
|
1404
|
-
* Used to modify the cell coordinates when using the `getCell` method, opening editor, getting value from the editor
|
1447
|
+
* Used to modify the cell coordinates when using the [`getCell`](@/api/core.md#getcell) method, opening editor, getting value from the editor
|
1405
1448
|
* and saving values from the closed editor.
|
1406
1449
|
*
|
1407
1450
|
* @event Hooks#modifyGetCellCoords
|
@@ -2070,9 +2113,9 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2070
2113
|
* @event Hooks#modifyColumnHeaderValue
|
2071
2114
|
* @param {string} value A column header value.
|
2072
2115
|
* @param {number} visualColumnIndex A visual column index.
|
2073
|
-
* @param {number} [headerLevel=0] Header level index. Accepts positive (0 to n)
|
2074
|
-
* and negative (
|
2075
|
-
* topmost header. For negative values,
|
2116
|
+
* @param {number} [headerLevel=0] Header level index. Accepts positive (`0` to `n`)
|
2117
|
+
* and negative (`-1` to `-n`) values. For positive values, `0` points to the
|
2118
|
+
* topmost header. For negative values, `-1` points to the bottom-most
|
2076
2119
|
* header (the header closest to the cells).
|
2077
2120
|
* @returns {string} The column header value to be updated.
|
2078
2121
|
*/
|
@@ -2159,6 +2202,14 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2159
2202
|
* @param {number} rowHeaderWidth Row header width.
|
2160
2203
|
*/
|
2161
2204
|
'modifyRowHeaderWidth',
|
2205
|
+
/**
|
2206
|
+
* Fired when the focus of the selection is being modified (e.g. Moving the focus with the enter/tab keys).
|
2207
|
+
*
|
2208
|
+
* @since 14.3.0
|
2209
|
+
* @event Hooks#modifyTransformFocus
|
2210
|
+
* @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.
|
2211
|
+
*/
|
2212
|
+
'modifyTransformFocus',
|
2162
2213
|
/**
|
2163
2214
|
* Fired when the start of the selection is being modified (e.g. Moving the selection with the arrow keys).
|
2164
2215
|
*
|
@@ -2173,6 +2224,16 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2173
2224
|
* @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.
|
2174
2225
|
*/
|
2175
2226
|
'modifyTransformEnd',
|
2227
|
+
/**
|
2228
|
+
* Fired after the focus of the selection is being modified (e.g. Moving the focus with the enter/tab keys).
|
2229
|
+
*
|
2230
|
+
* @since 14.3.0
|
2231
|
+
* @event Hooks#afterModifyTransformFocus
|
2232
|
+
* @param {CellCoords} coords Coords of the freshly focused cell.
|
2233
|
+
* @param {number} rowTransformDir `-1` if trying to focus a cell with a negative row index. `0` otherwise.
|
2234
|
+
* @param {number} colTransformDir `-1` if trying to focus a cell with a negative column index. `0` otherwise.
|
2235
|
+
*/
|
2236
|
+
'afterModifyTransformFocus',
|
2176
2237
|
/**
|
2177
2238
|
* Fired after the start of the selection is being modified (e.g. Moving the selection with the arrow keys).
|
2178
2239
|
*
|
@@ -2348,7 +2409,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2348
2409
|
* option is enabled.
|
2349
2410
|
*
|
2350
2411
|
* @event Hooks#beforeDropdownMenuShow
|
2351
|
-
* @param {DropdownMenu} dropdownMenu The DropdownMenu instance.
|
2412
|
+
* @param {DropdownMenu} dropdownMenu The `DropdownMenu` instance.
|
2352
2413
|
*/
|
2353
2414
|
'beforeDropdownMenuShow',
|
2354
2415
|
/**
|
@@ -2356,7 +2417,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2356
2417
|
* option is enabled.
|
2357
2418
|
*
|
2358
2419
|
* @event Hooks#afterDropdownMenuShow
|
2359
|
-
* @param {DropdownMenu} dropdownMenu The DropdownMenu instance.
|
2420
|
+
* @param {DropdownMenu} dropdownMenu The `DropdownMenu` instance.
|
2360
2421
|
*/
|
2361
2422
|
'afterDropdownMenuShow',
|
2362
2423
|
/**
|
@@ -2364,11 +2425,11 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2364
2425
|
* option is enabled.
|
2365
2426
|
*
|
2366
2427
|
* @event Hooks#afterDropdownMenuHide
|
2367
|
-
* @param {DropdownMenu} instance The DropdownMenu instance.
|
2428
|
+
* @param {DropdownMenu} instance The `DropdownMenu` instance.
|
2368
2429
|
*/
|
2369
2430
|
'afterDropdownMenuHide',
|
2370
2431
|
/**
|
2371
|
-
* Fired by {@link NestedRows} plugin before adding a children to the NestedRows structure. This hook is fired when
|
2432
|
+
* Fired by {@link NestedRows} plugin before adding a children to the `NestedRows` structure. This hook is fired when
|
2372
2433
|
* {@link Options#nestedRows} option is enabled.
|
2373
2434
|
*
|
2374
2435
|
* @event Hooks#beforeAddChild
|
@@ -2378,7 +2439,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
2378
2439
|
*/
|
2379
2440
|
'beforeAddChild',
|
2380
2441
|
/**
|
2381
|
-
* Fired by {@link NestedRows} plugin after adding a children to the NestedRows structure. This hook is fired when
|
2442
|
+
* Fired by {@link NestedRows} plugin after adding a children to the `NestedRows` structure. This hook is fired when
|
2382
2443
|
* {@link Options#nestedRows} option is enabled.
|
2383
2444
|
*
|
2384
2445
|
* @event Hooks#afterAddChild
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.array.push.js");
|
5
4
|
require("core-js/modules/es.error.cause.js");
|
5
|
+
require("core-js/modules/es.array.push.js");
|
6
6
|
var _base = require("../base");
|
7
7
|
var _array = require("../../helpers/array");
|
8
8
|
var _feature = require("../../helpers/feature");
|
@@ -22,12 +22,9 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
22
22
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
23
23
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
24
24
|
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); }
|
25
|
-
function _classPrivateFieldSet(
|
26
|
-
function
|
27
|
-
function
|
28
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
29
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
30
|
-
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
25
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
26
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
27
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
31
28
|
_pluginHooks.default.getSingleton().register('modifyAutoColumnSizeSeed');
|
32
29
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'autoColumnSize';
|
33
30
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 10;
|
@@ -131,12 +128,7 @@ const COLUMN_SIZE_MAP_NAME = 'autoColumnSize';
|
|
131
128
|
*/
|
132
129
|
/* eslint-enable jsdoc/require-description-complete-sentence */
|
133
130
|
var _cachedColumnHeaders = /*#__PURE__*/new WeakMap();
|
134
|
-
var
|
135
|
-
var _onAfterLoadData = /*#__PURE__*/new WeakSet();
|
136
|
-
var _onBeforeChange = /*#__PURE__*/new WeakSet();
|
137
|
-
var _onBeforeColumnResize = /*#__PURE__*/new WeakSet();
|
138
|
-
var _onAfterInit = /*#__PURE__*/new WeakSet();
|
139
|
-
var _onAfterFormulasValuesUpdate = /*#__PURE__*/new WeakSet();
|
131
|
+
var _AutoColumnSize_brand = /*#__PURE__*/new WeakSet();
|
140
132
|
class AutoColumnSize extends _base.BasePlugin {
|
141
133
|
static get PLUGIN_KEY() {
|
142
134
|
return PLUGIN_KEY;
|
@@ -163,39 +155,10 @@ class AutoColumnSize extends _base.BasePlugin {
|
|
163
155
|
|
164
156
|
constructor(hotInstance) {
|
165
157
|
super(hotInstance);
|
166
|
-
/**
|
167
|
-
* After formulas values updated listener.
|
168
|
-
*
|
169
|
-
* @param {Array} changes An array of modified data.
|
170
|
-
*/
|
171
|
-
_classPrivateMethodInitSpec(this, _onAfterFormulasValuesUpdate);
|
172
|
-
/**
|
173
|
-
* On after Handsontable init fill plugin with all necessary values.
|
174
|
-
*/
|
175
|
-
_classPrivateMethodInitSpec(this, _onAfterInit);
|
176
|
-
/**
|
177
|
-
* On before column resize listener.
|
178
|
-
*
|
179
|
-
* @param {number} size Calculated new column width.
|
180
|
-
* @param {number} column Visual index of the resized column.
|
181
|
-
* @param {boolean} isDblClick Flag that determines whether there was a double-click.
|
182
|
-
* @returns {number}
|
183
|
-
*/
|
184
|
-
_classPrivateMethodInitSpec(this, _onBeforeColumnResize);
|
185
|
-
/**
|
186
|
-
* On before change listener.
|
187
|
-
*
|
188
|
-
* @param {Array} changes An array of modified data.
|
189
|
-
*/
|
190
|
-
_classPrivateMethodInitSpec(this, _onBeforeChange);
|
191
|
-
/**
|
192
|
-
* On after load data listener.
|
193
|
-
*/
|
194
|
-
_classPrivateMethodInitSpec(this, _onAfterLoadData);
|
195
158
|
/**
|
196
159
|
* On before view render listener.
|
197
160
|
*/
|
198
|
-
_classPrivateMethodInitSpec(this,
|
161
|
+
_classPrivateMethodInitSpec(this, _AutoColumnSize_brand);
|
199
162
|
_defineProperty(this, "ghostTable", new _ghostTable.default(this.hot));
|
200
163
|
/**
|
201
164
|
* Instance of {@link SamplesGenerator} for generating samples necessary for columns width calculations.
|
@@ -256,15 +219,12 @@ class AutoColumnSize extends _base.BasePlugin {
|
|
256
219
|
*
|
257
220
|
* @type {Array}
|
258
221
|
*/
|
259
|
-
_classPrivateFieldInitSpec(this, _cachedColumnHeaders,
|
260
|
-
writable: true,
|
261
|
-
value: []
|
262
|
-
});
|
222
|
+
_classPrivateFieldInitSpec(this, _cachedColumnHeaders, []);
|
263
223
|
this.hot.columnIndexMapper.registerMap(COLUMN_SIZE_MAP_NAME, this.columnWidthsMap);
|
264
224
|
|
265
225
|
// Leave the listener active to allow auto-sizing the columns when the plugin is disabled.
|
266
226
|
// This is necessary for width recalculation for resize handler doubleclick (ManualColumnResize).
|
267
|
-
this.addHook('beforeColumnResize', (size, column, isDblClick) =>
|
227
|
+
this.addHook('beforeColumnResize', (size, column, isDblClick) => _assertClassBrand(_AutoColumnSize_brand, this, _onBeforeColumnResize).call(this, size, column, isDblClick));
|
268
228
|
}
|
269
229
|
|
270
230
|
/**
|
@@ -294,13 +254,13 @@ class AutoColumnSize extends _base.BasePlugin {
|
|
294
254
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
295
255
|
args[_key] = arguments[_key];
|
296
256
|
}
|
297
|
-
return
|
257
|
+
return _assertClassBrand(_AutoColumnSize_brand, _this, _onAfterLoadData).call(_this, ...args);
|
298
258
|
});
|
299
|
-
this.addHook('beforeChangeRender', changes =>
|
300
|
-
this.addHook('afterFormulasValuesUpdate', changes =>
|
301
|
-
this.addHook('beforeViewRender', force =>
|
259
|
+
this.addHook('beforeChangeRender', changes => _assertClassBrand(_AutoColumnSize_brand, this, _onBeforeChange).call(this, changes));
|
260
|
+
this.addHook('afterFormulasValuesUpdate', changes => _assertClassBrand(_AutoColumnSize_brand, this, _onAfterFormulasValuesUpdate).call(this, changes));
|
261
|
+
this.addHook('beforeViewRender', force => _assertClassBrand(_AutoColumnSize_brand, this, _onBeforeViewRender).call(this, force));
|
302
262
|
this.addHook('modifyColWidth', (width, col) => this.getColumnWidth(col, width));
|
303
|
-
this.addHook('afterInit', () =>
|
263
|
+
this.addHook('afterInit', () => _assertClassBrand(_AutoColumnSize_brand, this, _onAfterInit).call(this));
|
304
264
|
super.enablePlugin();
|
305
265
|
}
|
306
266
|
|
@@ -324,7 +284,7 @@ class AutoColumnSize extends _base.BasePlugin {
|
|
324
284
|
|
325
285
|
// Leave the listener active to allow auto-sizing the columns when the plugin is disabled.
|
326
286
|
// This is necessary for width recalculation for resize handler doubleclick (ManualColumnResize).
|
327
|
-
this.addHook('beforeColumnResize', (size, column, isDblClick) =>
|
287
|
+
this.addHook('beforeColumnResize', (size, column, isDblClick) => _assertClassBrand(_AutoColumnSize_brand, this, _onBeforeColumnResize).call(this, size, column, isDblClick));
|
328
288
|
}
|
329
289
|
|
330
290
|
/**
|
@@ -587,14 +547,14 @@ class AutoColumnSize extends _base.BasePlugin {
|
|
587
547
|
findColumnsWhereHeaderWasChanged() {
|
588
548
|
const columnHeaders = this.hot.getColHeader();
|
589
549
|
const changedColumns = (0, _array.arrayReduce)(columnHeaders, (acc, columnTitle, physicalColumn) => {
|
590
|
-
const cachedColumnsLength = _classPrivateFieldGet(
|
591
|
-
if (cachedColumnsLength - 1 < physicalColumn || _classPrivateFieldGet(
|
550
|
+
const cachedColumnsLength = _classPrivateFieldGet(_cachedColumnHeaders, this).length;
|
551
|
+
if (cachedColumnsLength - 1 < physicalColumn || _classPrivateFieldGet(_cachedColumnHeaders, this)[physicalColumn] !== columnTitle) {
|
592
552
|
acc.push(physicalColumn);
|
593
553
|
}
|
594
554
|
if (cachedColumnsLength - 1 < physicalColumn) {
|
595
|
-
_classPrivateFieldGet(
|
555
|
+
_classPrivateFieldGet(_cachedColumnHeaders, this).push(columnTitle);
|
596
556
|
} else {
|
597
|
-
_classPrivateFieldGet(
|
557
|
+
_classPrivateFieldGet(_cachedColumnHeaders, this)[physicalColumn] = columnTitle;
|
598
558
|
}
|
599
559
|
return acc;
|
600
560
|
}, []);
|
@@ -637,13 +597,16 @@ class AutoColumnSize extends _base.BasePlugin {
|
|
637
597
|
}
|
638
598
|
}
|
639
599
|
exports.AutoColumnSize = AutoColumnSize;
|
640
|
-
function
|
600
|
+
function _onBeforeViewRender() {
|
641
601
|
this.calculateVisibleColumnsWidth();
|
642
602
|
if (this.isNeedRecalculate() && !this.inProgress) {
|
643
603
|
this.calculateAllColumnsWidth();
|
644
604
|
}
|
645
605
|
}
|
646
|
-
|
606
|
+
/**
|
607
|
+
* On after load data listener.
|
608
|
+
*/
|
609
|
+
function _onAfterLoadData() {
|
647
610
|
if (this.hot.view) {
|
648
611
|
this.recalculateAllColumnsWidth();
|
649
612
|
} else {
|
@@ -655,14 +618,27 @@ function _onAfterLoadData2() {
|
|
655
618
|
}, 0);
|
656
619
|
}
|
657
620
|
}
|
658
|
-
|
621
|
+
/**
|
622
|
+
* On before change listener.
|
623
|
+
*
|
624
|
+
* @param {Array} changes An array of modified data.
|
625
|
+
*/
|
626
|
+
function _onBeforeChange(changes) {
|
659
627
|
const changedColumns = (0, _array.arrayMap)(changes, _ref2 => {
|
660
628
|
let [, columnProperty] = _ref2;
|
661
629
|
return this.hot.toPhysicalColumn(this.hot.propToCol(columnProperty));
|
662
630
|
});
|
663
631
|
this.clearCache(Array.from(new Set(changedColumns)));
|
664
632
|
}
|
665
|
-
|
633
|
+
/**
|
634
|
+
* On before column resize listener.
|
635
|
+
*
|
636
|
+
* @param {number} size Calculated new column width.
|
637
|
+
* @param {number} column Visual index of the resized column.
|
638
|
+
* @param {boolean} isDblClick Flag that determines whether there was a double-click.
|
639
|
+
* @returns {number}
|
640
|
+
*/
|
641
|
+
function _onBeforeColumnResize(size, column, isDblClick) {
|
666
642
|
let newSize = size;
|
667
643
|
if (isDblClick) {
|
668
644
|
this.calculateColumnsWidth(column, undefined, true);
|
@@ -670,10 +646,18 @@ function _onBeforeColumnResize2(size, column, isDblClick) {
|
|
670
646
|
}
|
671
647
|
return newSize;
|
672
648
|
}
|
673
|
-
|
674
|
-
|
649
|
+
/**
|
650
|
+
* On after Handsontable init fill plugin with all necessary values.
|
651
|
+
*/
|
652
|
+
function _onAfterInit() {
|
653
|
+
_classPrivateFieldSet(_cachedColumnHeaders, this, this.hot.getColHeader());
|
675
654
|
}
|
676
|
-
|
655
|
+
/**
|
656
|
+
* After formulas values updated listener.
|
657
|
+
*
|
658
|
+
* @param {Array} changes An array of modified data.
|
659
|
+
*/
|
660
|
+
function _onAfterFormulasValuesUpdate(changes) {
|
677
661
|
const filteredChanges = (0, _array.arrayFilter)(changes, change => {
|
678
662
|
var _change$address;
|
679
663
|
return (0, _mixed.isDefined)((_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.col);
|