handsontable 0.0.0-next-7026906-20231107 → 0.0.0-next-7b93b7d-20231107
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/SheetClip/SheetClip.js +2 -2
- package/3rdparty/SheetClip/SheetClip.mjs +2 -2
- package/3rdparty/autoResize/autoResize.js +2 -2
- package/3rdparty/autoResize/autoResize.mjs +2 -2
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +108 -85
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +108 -85
- package/3rdparty/walkontable/src/calculator/viewportRows.js +60 -52
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +60 -52
- package/3rdparty/walkontable/src/core/clone.js +6 -0
- package/3rdparty/walkontable/src/core/clone.mjs +6 -0
- package/3rdparty/walkontable/src/event.js +125 -74
- package/3rdparty/walkontable/src/event.mjs +125 -74
- package/3rdparty/walkontable/src/filter/column.js +16 -0
- package/3rdparty/walkontable/src/filter/column.mjs +16 -0
- package/3rdparty/walkontable/src/filter/row.js +16 -0
- package/3rdparty/walkontable/src/filter/row.mjs +16 -0
- package/3rdparty/walkontable/src/overlay/bottom.js +1 -1
- package/3rdparty/walkontable/src/overlay/bottom.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/top.js +1 -1
- package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/_base.js +12 -5
- package/3rdparty/walkontable/src/renderer/_base.mjs +12 -5
- package/3rdparty/walkontable/src/renderer/cells.js +6 -2
- package/3rdparty/walkontable/src/renderer/cells.mjs +6 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +6 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +6 -2
- package/3rdparty/walkontable/src/renderer/rows.js +5 -0
- package/3rdparty/walkontable/src/renderer/rows.mjs +5 -0
- package/3rdparty/walkontable/src/renderer/table.js +24 -17
- package/3rdparty/walkontable/src/renderer/table.mjs +24 -17
- package/3rdparty/walkontable/src/scroll.js +2 -2
- package/3rdparty/walkontable/src/scroll.mjs +2 -2
- package/3rdparty/walkontable/src/selection/border/border.js +1 -1
- package/3rdparty/walkontable/src/selection/border/border.mjs +1 -1
- package/3rdparty/walkontable/src/settings.js +10 -10
- package/3rdparty/walkontable/src/settings.mjs +10 -10
- package/3rdparty/walkontable/src/table.js +3 -3
- package/3rdparty/walkontable/src/table.mjs +3 -3
- package/3rdparty/walkontable/src/utils/column.js +19 -4
- package/3rdparty/walkontable/src/utils/column.mjs +19 -4
- package/3rdparty/walkontable/src/utils/nodesPool.js +5 -0
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +5 -0
- package/3rdparty/walkontable/src/utils/orderView/view.js +13 -6
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +13 -6
- package/3rdparty/walkontable/src/utils/orderView/viewSize.js +9 -6
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +9 -6
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +7 -4
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +7 -4
- package/3rdparty/walkontable/src/utils/row.js +14 -2
- package/3rdparty/walkontable/src/utils/row.mjs +14 -2
- package/3rdparty/walkontable/src/viewport.js +9 -9
- package/3rdparty/walkontable/src/viewport.mjs +9 -9
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.js +25 -25
- package/core.mjs +25 -25
- package/dataMap/dataMap.js +99 -90
- package/dataMap/dataMap.mjs +99 -90
- package/dataMap/dataSource.js +14 -8
- package/dataMap/dataSource.mjs +14 -8
- package/dataMap/metaManager/lazyFactoryMap.js +19 -7
- package/dataMap/metaManager/lazyFactoryMap.mjs +19 -7
- package/dataMap/metaManager/metaLayers/cellMeta.js +8 -3
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +8 -3
- package/dataMap/metaManager/metaLayers/columnMeta.js +7 -1
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +7 -1
- package/dataMap/metaManager/metaLayers/globalMeta.js +6 -1
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +6 -1
- package/dataMap/metaManager/metaLayers/tableMeta.js +6 -2
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +6 -2
- package/dataMap/metaManager/metaSchema.js +55 -55
- package/dataMap/metaManager/metaSchema.mjs +55 -55
- package/dataMap/metaManager/mods/dynamicCellMeta.js +7 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +7 -2
- package/dataMap/metaManager/mods/extendMetaProperties.js +8 -4
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +8 -4
- package/dataMap/metaManager/utils.js +2 -2
- package/dataMap/metaManager/utils.mjs +2 -2
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +7244 -6347
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +120 -120
- package/dist/handsontable.js +7243 -6346
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +28 -28
- package/editorManager.js +105 -95
- package/editorManager.mjs +105 -95
- package/editors/autocompleteEditor/autocompleteEditor.js +47 -46
- package/editors/autocompleteEditor/autocompleteEditor.mjs +46 -45
- package/editors/baseEditor/baseEditor.js +23 -26
- package/editors/baseEditor/baseEditor.mjs +23 -26
- package/editors/dateEditor/dateEditor.js +24 -15
- package/editors/dateEditor/dateEditor.mjs +24 -15
- package/editors/dropdownEditor/dropdownEditor.js +1 -1
- package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
- package/editors/handsontableEditor/handsontableEditor.js +4 -4
- package/editors/handsontableEditor/handsontableEditor.mjs +4 -4
- package/editors/textEditor/textEditor.js +23 -17
- package/editors/textEditor/textEditor.mjs +24 -18
- package/eventManager.js +8 -0
- package/eventManager.mjs +8 -0
- package/helpers/array.js +2 -2
- package/helpers/array.mjs +2 -2
- package/helpers/dom/element.js +7 -7
- package/helpers/dom/element.mjs +7 -7
- package/helpers/function.js +1 -1
- package/helpers/function.mjs +1 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +4 -4
- package/helpers/object.mjs +4 -4
- package/helpers/string.js +1 -1
- package/helpers/string.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +0 -2
- package/pluginHooks.js +12 -3
- package/pluginHooks.mjs +12 -3
- package/plugins/autoColumnSize/autoColumnSize.js +141 -130
- package/plugins/autoColumnSize/autoColumnSize.mjs +140 -129
- package/plugins/autoRowSize/autoRowSize.js +112 -125
- package/plugins/autoRowSize/autoRowSize.mjs +110 -123
- package/plugins/autofill/autofill.js +97 -102
- package/plugins/autofill/autofill.mjs +96 -101
- package/plugins/base/base.js +57 -22
- package/plugins/base/base.mjs +56 -22
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +29 -24
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +28 -23
- package/plugins/collapsibleColumns/collapsibleColumns.js +104 -107
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +102 -104
- package/plugins/columnSorting/columnSorting.js +105 -98
- package/plugins/columnSorting/columnSorting.mjs +104 -97
- package/plugins/columnSorting/columnStatesManager.js +12 -6
- package/plugins/columnSorting/columnStatesManager.mjs +12 -6
- package/plugins/columnSummary/columnSummary.js +71 -58
- package/plugins/columnSummary/columnSummary.mjs +70 -57
- package/plugins/columnSummary/endpoints.js +20 -14
- package/plugins/columnSummary/endpoints.mjs +20 -14
- package/plugins/comments/commentEditor.js +30 -2
- package/plugins/comments/commentEditor.mjs +30 -2
- package/plugins/comments/comments.js +158 -169
- package/plugins/comments/comments.mjs +157 -168
- package/plugins/comments/displaySwitch.js +7 -3
- package/plugins/comments/displaySwitch.mjs +7 -3
- package/plugins/contextMenu/commandExecutor.js +15 -2
- package/plugins/contextMenu/commandExecutor.mjs +15 -2
- package/plugins/contextMenu/contextMenu.js +91 -101
- package/plugins/contextMenu/contextMenu.mjs +90 -100
- package/plugins/contextMenu/itemsFactory.js +19 -4
- package/plugins/contextMenu/itemsFactory.mjs +19 -4
- package/plugins/contextMenu/menu/cursor.js +36 -0
- package/plugins/contextMenu/menu/cursor.mjs +36 -0
- package/plugins/contextMenu/menu/menu.js +57 -5
- package/plugins/contextMenu/menu/menu.mjs +57 -5
- package/plugins/copyPaste/copyPaste.js +74 -75
- package/plugins/copyPaste/copyPaste.mjs +74 -75
- package/plugins/customBorders/customBorders.js +49 -48
- package/plugins/customBorders/customBorders.mjs +48 -47
- package/plugins/dragToScroll/dragToScroll.js +50 -54
- package/plugins/dragToScroll/dragToScroll.mjs +49 -52
- package/plugins/dropdownMenu/dropdownMenu.js +132 -129
- package/plugins/dropdownMenu/dropdownMenu.mjs +132 -129
- package/plugins/exportFile/dataProvider.js +7 -2
- package/plugins/exportFile/dataProvider.mjs +7 -2
- package/plugins/exportFile/exportFile.js +1 -1
- package/plugins/exportFile/exportFile.mjs +1 -1
- package/plugins/exportFile/types/_base.js +14 -6
- package/plugins/exportFile/types/_base.mjs +14 -6
- package/plugins/filters/component/actionBar.js +9 -0
- package/plugins/filters/component/actionBar.mjs +9 -0
- package/plugins/filters/component/condition.js +13 -0
- package/plugins/filters/component/condition.mjs +13 -0
- package/plugins/filters/component/operators.js +9 -0
- package/plugins/filters/component/operators.mjs +9 -0
- package/plugins/filters/component/value.js +9 -0
- package/plugins/filters/component/value.mjs +9 -0
- package/plugins/filters/conditionCollection.js +9 -4
- package/plugins/filters/conditionCollection.mjs +9 -4
- package/plugins/filters/conditionUpdateObserver.js +53 -42
- package/plugins/filters/conditionUpdateObserver.mjs +53 -42
- package/plugins/filters/dataFilter.js +9 -3
- package/plugins/filters/dataFilter.mjs +9 -3
- package/plugins/filters/filters.js +184 -189
- package/plugins/filters/filters.mjs +182 -187
- package/plugins/filters/ui/_base.js +1 -1
- package/plugins/filters/ui/_base.mjs +1 -1
- package/plugins/filters/utils.js +1 -1
- package/plugins/filters/utils.mjs +1 -1
- package/plugins/formulas/engine/settings.js +1 -1
- package/plugins/formulas/engine/settings.mjs +1 -1
- package/plugins/formulas/formulas.js +684 -602
- package/plugins/formulas/formulas.mjs +682 -600
- package/plugins/hiddenColumns/hiddenColumns.js +174 -169
- package/plugins/hiddenColumns/hiddenColumns.mjs +173 -168
- package/plugins/hiddenRows/hiddenRows.js +170 -165
- package/plugins/hiddenRows/hiddenRows.mjs +169 -164
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +67 -54
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +64 -51
- package/plugins/manualColumnMove/manualColumnMove.js +287 -232
- package/plugins/manualColumnMove/manualColumnMove.mjs +286 -231
- package/plugins/manualColumnMove/ui/_base.js +9 -3
- package/plugins/manualColumnMove/ui/_base.mjs +9 -3
- package/plugins/manualColumnResize/manualColumnResize.js +291 -246
- package/plugins/manualColumnResize/manualColumnResize.mjs +290 -244
- package/plugins/manualRowMove/manualRowMove.js +223 -208
- package/plugins/manualRowMove/manualRowMove.mjs +222 -207
- package/plugins/manualRowMove/ui/_base.js +10 -5
- package/plugins/manualRowMove/ui/_base.mjs +10 -5
- package/plugins/manualRowResize/manualRowResize.js +254 -209
- package/plugins/manualRowResize/manualRowResize.mjs +253 -207
- package/plugins/mergeCells/calculations/autofill.js +9 -3
- package/plugins/mergeCells/calculations/autofill.mjs +9 -3
- package/plugins/mergeCells/calculations/selection.js +10 -4
- package/plugins/mergeCells/calculations/selection.mjs +10 -4
- package/plugins/mergeCells/cellCoords.js +16 -6
- package/plugins/mergeCells/cellCoords.mjs +16 -6
- package/plugins/mergeCells/cellsCollection.js +10 -4
- package/plugins/mergeCells/cellsCollection.mjs +10 -4
- package/plugins/mergeCells/mergeCells.js +582 -502
- package/plugins/mergeCells/mergeCells.mjs +580 -500
- package/plugins/multiColumnSorting/multiColumnSorting.js +13 -10
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +13 -10
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +16 -28
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +16 -27
- package/plugins/nestedHeaders/nestedHeaders.js +542 -499
- package/plugins/nestedHeaders/nestedHeaders.mjs +554 -511
- package/plugins/nestedHeaders/stateManager/index.js +1 -1
- package/plugins/nestedHeaders/stateManager/index.mjs +1 -1
- package/plugins/nestedRows/data/dataManager.js +21 -15
- package/plugins/nestedRows/data/dataManager.mjs +21 -15
- package/plugins/nestedRows/nestedRows.js +326 -278
- package/plugins/nestedRows/nestedRows.mjs +325 -277
- package/plugins/nestedRows/ui/_base.js +7 -1
- package/plugins/nestedRows/ui/_base.mjs +7 -1
- package/plugins/nestedRows/ui/collapsing.js +2 -2
- package/plugins/nestedRows/ui/collapsing.mjs +2 -2
- package/plugins/nestedRows/ui/contextMenu.js +28 -18
- package/plugins/nestedRows/ui/contextMenu.mjs +28 -18
- package/plugins/nestedRows/utils/rowMoveController.js +12 -4
- package/plugins/nestedRows/utils/rowMoveController.mjs +12 -4
- package/plugins/persistentState/persistentState.js +14 -11
- package/plugins/persistentState/persistentState.mjs +14 -11
- package/plugins/persistentState/storage.js +11 -6
- package/plugins/persistentState/storage.mjs +11 -6
- package/plugins/registry.js +2 -2
- package/plugins/registry.mjs +2 -2
- package/plugins/search/search.js +57 -46
- package/plugins/search/search.mjs +56 -45
- package/plugins/touchScroll/touchScroll.js +102 -100
- package/plugins/touchScroll/touchScroll.mjs +100 -98
- package/plugins/trimRows/trimRows.js +33 -28
- package/plugins/trimRows/trimRows.mjs +32 -27
- package/plugins/undoRedo/undoRedo.js +2 -2
- package/plugins/undoRedo/undoRedo.mjs +2 -2
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +11 -11
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +11 -11
- package/renderers/baseRenderer/baseRenderer.js +2 -2
- package/renderers/baseRenderer/baseRenderer.mjs +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.js +23 -23
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +23 -23
- package/renderers/dateRenderer/dateRenderer.js +4 -4
- package/renderers/dateRenderer/dateRenderer.mjs +4 -4
- package/renderers/handsontableRenderer/handsontableRenderer.js +4 -4
- package/renderers/handsontableRenderer/handsontableRenderer.mjs +4 -4
- package/renderers/htmlRenderer/htmlRenderer.js +4 -4
- package/renderers/htmlRenderer/htmlRenderer.mjs +4 -4
- package/renderers/numericRenderer/numericRenderer.js +3 -3
- package/renderers/numericRenderer/numericRenderer.mjs +3 -3
- package/renderers/passwordRenderer/passwordRenderer.js +3 -3
- package/renderers/passwordRenderer/passwordRenderer.mjs +3 -3
- package/renderers/selectRenderer/selectRenderer.js +4 -4
- package/renderers/selectRenderer/selectRenderer.mjs +4 -4
- package/renderers/textRenderer/textRenderer.js +5 -5
- package/renderers/textRenderer/textRenderer.mjs +5 -5
- package/renderers/timeRenderer/timeRenderer.js +3 -3
- package/renderers/timeRenderer/timeRenderer.mjs +3 -3
- package/selection/range.js +12 -2
- package/selection/range.mjs +12 -2
- package/selection/selection.js +3 -3
- package/selection/selection.mjs +3 -3
- package/tableView.js +208 -200
- package/tableView.mjs +208 -200
- package/translations/changesObservable/utils.js +2 -2
- package/translations/changesObservable/utils.mjs +2 -2
- package/translations/indexMapper.js +25 -22
- package/translations/indexMapper.mjs +25 -22
- package/translations/mapCollections/aggregatedCollection.js +8 -2
- package/translations/mapCollections/aggregatedCollection.mjs +8 -2
- package/translations/mapCollections/mapCollection.js +5 -2
- package/translations/mapCollections/mapCollection.mjs +5 -2
- package/translations/maps/indexMap.js +6 -1
- package/translations/maps/indexMap.mjs +6 -1
- package/translations/maps/utils/physicallyIndexed.js +2 -2
- package/translations/maps/utils/physicallyIndexed.mjs +2 -2
- package/utils/dataStructures/linkedList.js +10 -6
- package/utils/dataStructures/linkedList.mjs +10 -6
- package/utils/dataStructures/queue.js +1 -1
- package/utils/dataStructures/queue.mjs +1 -1
- package/utils/dataStructures/stack.js +1 -1
- package/utils/dataStructures/stack.mjs +1 -1
- package/utils/ghostTable.js +2 -2
- package/utils/ghostTable.mjs +2 -2
- package/utils/interval.js +73 -36
- package/utils/interval.mjs +73 -36
- package/utils/parseTable.js +1 -1
- package/utils/parseTable.mjs +1 -1
- package/validators/autocompleteValidator/autocompleteValidator.js +1 -1
- package/validators/autocompleteValidator/autocompleteValidator.mjs +1 -1
- package/validators/dateValidator/dateValidator.js +1 -1
- package/validators/dateValidator/dateValidator.mjs +1 -1
- package/validators/numericValidator/numericValidator.js +1 -1
- package/validators/numericValidator/numericValidator.mjs +1 -1
package/tableView.js
CHANGED
@@ -21,26 +21,29 @@ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) {
|
|
21
21
|
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
22
22
|
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
23
23
|
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; } }
|
24
|
-
const privatePool = new WeakMap();
|
25
|
-
|
26
24
|
/**
|
27
25
|
* @class TableView
|
28
26
|
* @private
|
29
27
|
*/
|
30
28
|
var _columnHeadersCount = /*#__PURE__*/new WeakMap();
|
31
29
|
var _rowHeadersCount = /*#__PURE__*/new WeakMap();
|
30
|
+
var _selectionMouseDown = /*#__PURE__*/new WeakMap();
|
31
|
+
var _mouseDown = /*#__PURE__*/new WeakMap();
|
32
|
+
var _table = /*#__PURE__*/new WeakMap();
|
33
|
+
var _lastWidth = /*#__PURE__*/new WeakMap();
|
34
|
+
var _lastHeight = /*#__PURE__*/new WeakMap();
|
32
35
|
class TableView {
|
33
36
|
/**
|
34
|
-
* @param {Hanstontable}
|
37
|
+
* @param {Hanstontable} hotInstance Instance of {@link Handsontable}.
|
35
38
|
*/
|
36
|
-
constructor(
|
39
|
+
constructor(hotInstance) {
|
37
40
|
/**
|
38
41
|
* Instance of {@link Handsontable}.
|
39
42
|
*
|
40
43
|
* @private
|
41
44
|
* @type {Handsontable}
|
42
45
|
*/
|
43
|
-
_defineProperty(this, "
|
46
|
+
_defineProperty(this, "hot", void 0);
|
44
47
|
/**
|
45
48
|
* Instance of {@link EventManager}.
|
46
49
|
*
|
@@ -79,7 +82,6 @@ class TableView {
|
|
79
82
|
/**
|
80
83
|
* Main Walkontable instance.
|
81
84
|
*
|
82
|
-
* @private
|
83
85
|
* @type {Walkontable}
|
84
86
|
*/
|
85
87
|
_defineProperty(this, "activeWt", void 0);
|
@@ -112,42 +114,52 @@ class TableView {
|
|
112
114
|
* @type {boolean}
|
113
115
|
*/
|
114
116
|
_defineProperty(this, "postponedAdjustElementsSize", false);
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
117
|
+
/**
|
118
|
+
* Defines if the text should be selected during mousemove.
|
119
|
+
*
|
120
|
+
* @type {boolean}
|
121
|
+
*/
|
122
|
+
_classPrivateFieldInitSpec(this, _selectionMouseDown, {
|
123
|
+
writable: true,
|
124
|
+
value: false
|
125
|
+
});
|
126
|
+
/**
|
127
|
+
* @type {boolean}
|
128
|
+
*/
|
129
|
+
_classPrivateFieldInitSpec(this, _mouseDown, {
|
130
|
+
writable: true,
|
131
|
+
value: void 0
|
132
|
+
});
|
133
|
+
/**
|
134
|
+
* Main <TABLE> element.
|
135
|
+
*
|
136
|
+
* @type {HTMLTableElement}
|
137
|
+
*/
|
138
|
+
_classPrivateFieldInitSpec(this, _table, {
|
139
|
+
writable: true,
|
140
|
+
value: void 0
|
141
|
+
});
|
142
|
+
/**
|
143
|
+
* Cached width of the rootElement.
|
144
|
+
*
|
145
|
+
* @type {number}
|
146
|
+
*/
|
147
|
+
_classPrivateFieldInitSpec(this, _lastWidth, {
|
148
|
+
writable: true,
|
149
|
+
value: 0
|
150
|
+
});
|
151
|
+
/**
|
152
|
+
* Cached height of the rootElement.
|
153
|
+
*
|
154
|
+
* @type {number}
|
155
|
+
*/
|
156
|
+
_classPrivateFieldInitSpec(this, _lastHeight, {
|
157
|
+
writable: true,
|
158
|
+
value: 0
|
150
159
|
});
|
160
|
+
this.hot = hotInstance;
|
161
|
+
this.eventManager = new _eventManager.default(this.hot);
|
162
|
+
this.settings = this.hot.getSettings();
|
151
163
|
this.createElements();
|
152
164
|
this.registerEvents();
|
153
165
|
this.initializeWalkontable();
|
@@ -157,16 +169,16 @@ class TableView {
|
|
157
169
|
* Renders WalkontableUI.
|
158
170
|
*/
|
159
171
|
render() {
|
160
|
-
if (!this.
|
161
|
-
this.
|
172
|
+
if (!this.hot.isRenderSuspended()) {
|
173
|
+
this.hot.runHooks('beforeRender', this.hot.forceFullRender);
|
162
174
|
if (this.postponedAdjustElementsSize) {
|
163
175
|
this.postponedAdjustElementsSize = false;
|
164
176
|
this.adjustElementsSize(true);
|
165
177
|
}
|
166
|
-
this._wt.draw(!this.
|
167
|
-
this.
|
168
|
-
this.
|
169
|
-
this.
|
178
|
+
this._wt.draw(!this.hot.forceFullRender);
|
179
|
+
this.hot.runHooks('afterRender', this.hot.forceFullRender);
|
180
|
+
this.hot.forceFullRender = false;
|
181
|
+
this.hot.renderCall = false;
|
170
182
|
}
|
171
183
|
}
|
172
184
|
|
@@ -177,7 +189,7 @@ class TableView {
|
|
177
189
|
*/
|
178
190
|
adjustElementsSize() {
|
179
191
|
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
180
|
-
if (this.
|
192
|
+
if (this.hot.isRenderSuspended()) {
|
181
193
|
this.postponedAdjustElementsSize = true;
|
182
194
|
} else {
|
183
195
|
this._wt.wtOverlays.adjustElementsSize(force);
|
@@ -244,32 +256,31 @@ class TableView {
|
|
244
256
|
* @private
|
245
257
|
*/
|
246
258
|
createElements() {
|
247
|
-
const priv = privatePool.get(this);
|
248
259
|
const {
|
249
260
|
rootElement,
|
250
261
|
rootDocument
|
251
|
-
} = this.
|
262
|
+
} = this.hot;
|
252
263
|
const originalStyle = rootElement.getAttribute('style');
|
253
264
|
if (originalStyle) {
|
254
265
|
rootElement.setAttribute('data-originalstyle', originalStyle); // needed to retrieve original style in jsFiddle link generator in HT examples. may be removed in future versions
|
255
266
|
}
|
256
267
|
|
257
268
|
(0, _element.addClass)(rootElement, 'handsontable');
|
258
|
-
|
259
|
-
(0, _element.addClass)(
|
260
|
-
if (this.
|
261
|
-
(0, _element.addClass)(
|
269
|
+
_classPrivateFieldSet(this, _table, rootDocument.createElement('TABLE'));
|
270
|
+
(0, _element.addClass)(_classPrivateFieldGet(this, _table), 'htCore');
|
271
|
+
if (this.hot.getSettings().tableClassName) {
|
272
|
+
(0, _element.addClass)(_classPrivateFieldGet(this, _table), this.hot.getSettings().tableClassName);
|
262
273
|
}
|
263
274
|
if (this.settings.ariaTags) {
|
264
|
-
(0, _element.setAttribute)(
|
265
|
-
(0, _element.setAttribute)(rootElement, [(0, _a11y.A11Y_TREEGRID)(), (0, _a11y.A11Y_ROWCOUNT)(this.
|
275
|
+
(0, _element.setAttribute)(_classPrivateFieldGet(this, _table), [(0, _a11y.A11Y_PRESENTATION)()]);
|
276
|
+
(0, _element.setAttribute)(rootElement, [(0, _a11y.A11Y_TREEGRID)(), (0, _a11y.A11Y_ROWCOUNT)(this.hot.countRows()), (0, _a11y.A11Y_COLCOUNT)(this.hot.countCols()), (0, _a11y.A11Y_MULTISELECTABLE)()]);
|
266
277
|
}
|
267
278
|
this.THEAD = rootDocument.createElement('THEAD');
|
268
|
-
|
279
|
+
_classPrivateFieldGet(this, _table).appendChild(this.THEAD);
|
269
280
|
this.TBODY = rootDocument.createElement('TBODY');
|
270
|
-
|
271
|
-
this.
|
272
|
-
this.
|
281
|
+
_classPrivateFieldGet(this, _table).appendChild(this.TBODY);
|
282
|
+
this.hot.table = _classPrivateFieldGet(this, _table);
|
283
|
+
this.hot.container.insertBefore(_classPrivateFieldGet(this, _table), this.hot.container.firstChild);
|
273
284
|
}
|
274
285
|
|
275
286
|
/**
|
@@ -278,19 +289,18 @@ class TableView {
|
|
278
289
|
* @private
|
279
290
|
*/
|
280
291
|
registerEvents() {
|
281
|
-
const priv = privatePool.get(this);
|
282
292
|
const {
|
283
293
|
rootElement,
|
284
294
|
rootDocument,
|
285
295
|
selection
|
286
|
-
} = this.
|
296
|
+
} = this.hot;
|
287
297
|
const documentElement = rootDocument.documentElement;
|
288
298
|
this.eventManager.addEventListener(rootElement, 'mousedown', event => {
|
289
|
-
|
299
|
+
_classPrivateFieldSet(this, _selectionMouseDown, true);
|
290
300
|
if (!this.isTextSelectionAllowed(event.target)) {
|
291
301
|
const {
|
292
302
|
rootWindow
|
293
|
-
} = this.
|
303
|
+
} = this.hot;
|
294
304
|
(0, _element.clearTextSelection)(rootWindow);
|
295
305
|
event.preventDefault();
|
296
306
|
rootWindow.focus(); // make sure that window that contains HOT is active. Important when HOT is in iframe.
|
@@ -298,13 +308,13 @@ class TableView {
|
|
298
308
|
});
|
299
309
|
|
300
310
|
this.eventManager.addEventListener(rootElement, 'mouseup', () => {
|
301
|
-
|
311
|
+
_classPrivateFieldSet(this, _selectionMouseDown, false);
|
302
312
|
});
|
303
313
|
this.eventManager.addEventListener(rootElement, 'mousemove', event => {
|
304
|
-
if (
|
314
|
+
if (_classPrivateFieldGet(this, _selectionMouseDown) && !this.isTextSelectionAllowed(event.target)) {
|
305
315
|
// Clear selection only when fragmentSelection is enabled, otherwise clearing selection breaks the IME editor.
|
306
316
|
if (this.settings.fragmentSelection) {
|
307
|
-
(0, _element.clearTextSelection)(this.
|
317
|
+
(0, _element.clearTextSelection)(this.hot.rootWindow);
|
308
318
|
}
|
309
319
|
event.preventDefault();
|
310
320
|
}
|
@@ -319,40 +329,40 @@ class TableView {
|
|
319
329
|
if (selection.isInProgress() && (0, _event.isLeftClick)(event)) {
|
320
330
|
selection.finish();
|
321
331
|
}
|
322
|
-
|
332
|
+
_classPrivateFieldSet(this, _mouseDown, false);
|
323
333
|
const isOutsideInputElement = (0, _element.isOutsideInput)(rootDocument.activeElement);
|
324
334
|
if (!isOutsideInputElement) {
|
325
335
|
return;
|
326
336
|
}
|
327
337
|
if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !(0, _event.isRightClick)(event)) {
|
328
|
-
this.
|
338
|
+
this.hot.unlisten();
|
329
339
|
}
|
330
340
|
});
|
331
341
|
this.eventManager.addEventListener(documentElement, 'contextmenu', event => {
|
332
342
|
if (selection.isInProgress() && (0, _event.isRightClick)(event)) {
|
333
343
|
selection.finish();
|
334
|
-
|
344
|
+
_classPrivateFieldSet(this, _mouseDown, false);
|
335
345
|
}
|
336
346
|
});
|
337
347
|
this.eventManager.addEventListener(documentElement, 'touchend', () => {
|
338
348
|
if (selection.isInProgress()) {
|
339
349
|
selection.finish();
|
340
350
|
}
|
341
|
-
|
351
|
+
_classPrivateFieldSet(this, _mouseDown, false);
|
342
352
|
});
|
343
353
|
this.eventManager.addEventListener(documentElement, 'mousedown', event => {
|
344
354
|
const originalTarget = event.target;
|
345
355
|
const eventX = event.x || event.clientX;
|
346
356
|
const eventY = event.y || event.clientY;
|
347
357
|
let next = event.target;
|
348
|
-
if (
|
358
|
+
if (_classPrivateFieldGet(this, _mouseDown) || !rootElement || !this.hot.view) {
|
349
359
|
return; // it must have been started in a cell
|
350
360
|
}
|
351
361
|
|
352
362
|
// immediate click on "holder" means click on the right side of vertical scrollbar
|
353
363
|
const {
|
354
364
|
holder
|
355
|
-
} = this.
|
365
|
+
} = this.hot.view._wt.wtTable;
|
356
366
|
if (next === holder) {
|
357
367
|
const scrollbarWidth = (0, _element.getScrollbarWidth)(rootDocument);
|
358
368
|
if (rootDocument.elementFromPoint(eventX + scrollbarWidth, eventY) !== holder || rootDocument.elementFromPoint(eventX, eventY + scrollbarWidth) !== holder) {
|
@@ -379,12 +389,12 @@ class TableView {
|
|
379
389
|
// function did not return until here, we have an outside click!
|
380
390
|
const outsideClickDeselects = typeof this.settings.outsideClickDeselects === 'function' ? this.settings.outsideClickDeselects(originalTarget) : this.settings.outsideClickDeselects;
|
381
391
|
if (outsideClickDeselects) {
|
382
|
-
this.
|
392
|
+
this.hot.deselectCell();
|
383
393
|
} else {
|
384
|
-
this.
|
394
|
+
this.hot.destroyEditor(false, false);
|
385
395
|
}
|
386
396
|
});
|
387
|
-
this.eventManager.addEventListener(
|
397
|
+
this.eventManager.addEventListener(_classPrivateFieldGet(this, _table), 'selectstart', event => {
|
388
398
|
if (this.settings.fragmentSelection || (0, _element.isInput)(event.target)) {
|
389
399
|
return;
|
390
400
|
}
|
@@ -406,7 +416,7 @@ class TableView {
|
|
406
416
|
col
|
407
417
|
} = _ref;
|
408
418
|
// TODO: To consider an idea to reusing the CellCoords instance instead creating new one.
|
409
|
-
return this.
|
419
|
+
return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(row, col));
|
410
420
|
}
|
411
421
|
|
412
422
|
/**
|
@@ -419,8 +429,8 @@ class TableView {
|
|
419
429
|
translateFromRenderableToVisualIndex(renderableRow, renderableColumn) {
|
420
430
|
// TODO: Some helper may be needed.
|
421
431
|
// We perform translation for indexes (without headers).
|
422
|
-
let visualRow = renderableRow >= 0 ? this.
|
423
|
-
let visualColumn = renderableColumn >= 0 ? this.
|
432
|
+
let visualRow = renderableRow >= 0 ? this.hot.rowIndexMapper.getVisualFromRenderableIndex(renderableRow) : renderableRow;
|
433
|
+
let visualColumn = renderableColumn >= 0 ? this.hot.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn) : renderableColumn;
|
424
434
|
if (visualRow === null) {
|
425
435
|
visualRow = renderableRow;
|
426
436
|
}
|
@@ -457,7 +467,7 @@ class TableView {
|
|
457
467
|
* @returns {number}
|
458
468
|
*/
|
459
469
|
countRenderableColumns() {
|
460
|
-
return this.countRenderableIndexes(this.
|
470
|
+
return this.countRenderableIndexes(this.hot.columnIndexMapper, this.settings.maxCols);
|
461
471
|
}
|
462
472
|
|
463
473
|
/**
|
@@ -466,7 +476,7 @@ class TableView {
|
|
466
476
|
* @returns {number}
|
467
477
|
*/
|
468
478
|
countRenderableRows() {
|
469
|
-
return this.countRenderableIndexes(this.
|
479
|
+
return this.countRenderableIndexes(this.hot.rowIndexMapper, this.settings.maxRows);
|
470
480
|
}
|
471
481
|
|
472
482
|
/**
|
@@ -478,7 +488,7 @@ class TableView {
|
|
478
488
|
* @returns {number}
|
479
489
|
*/
|
480
490
|
countNotHiddenRowIndexes(visualIndex, incrementBy) {
|
481
|
-
return this.countNotHiddenIndexes(visualIndex, incrementBy, this.
|
491
|
+
return this.countNotHiddenIndexes(visualIndex, incrementBy, this.hot.rowIndexMapper, this.countRenderableRows());
|
482
492
|
}
|
483
493
|
|
484
494
|
/**
|
@@ -490,7 +500,7 @@ class TableView {
|
|
490
500
|
* @returns {number}
|
491
501
|
*/
|
492
502
|
countNotHiddenColumnIndexes(visualIndex, incrementBy) {
|
493
|
-
return this.countNotHiddenIndexes(visualIndex, incrementBy, this.
|
503
|
+
return this.countNotHiddenIndexes(visualIndex, incrementBy, this.hot.columnIndexMapper, this.countRenderableColumns());
|
494
504
|
}
|
495
505
|
|
496
506
|
/**
|
@@ -529,7 +539,7 @@ class TableView {
|
|
529
539
|
* @returns {number}
|
530
540
|
*/
|
531
541
|
countNotHiddenFixedColumnsStart() {
|
532
|
-
const countCols = this.
|
542
|
+
const countCols = this.hot.countCols();
|
533
543
|
const visualFixedColumnsStart = Math.min(parseInt(this.settings.fixedColumnsStart, 10), countCols) - 1;
|
534
544
|
return this.countNotHiddenColumnIndexes(visualFixedColumnsStart, -1);
|
535
545
|
}
|
@@ -541,7 +551,7 @@ class TableView {
|
|
541
551
|
* @returns {number}
|
542
552
|
*/
|
543
553
|
countNotHiddenFixedRowsTop() {
|
544
|
-
const countRows = this.
|
554
|
+
const countRows = this.hot.countRows();
|
545
555
|
const visualFixedRowsTop = Math.min(parseInt(this.settings.fixedRowsTop, 10), countRows) - 1;
|
546
556
|
return this.countNotHiddenRowIndexes(visualFixedRowsTop, -1);
|
547
557
|
}
|
@@ -553,7 +563,7 @@ class TableView {
|
|
553
563
|
* @returns {number}
|
554
564
|
*/
|
555
565
|
countNotHiddenFixedRowsBottom() {
|
556
|
-
const countRows = this.
|
566
|
+
const countRows = this.hot.countRows();
|
557
567
|
const visualFixedRowsBottom = Math.max(countRows - parseInt(this.settings.fixedRowsBottom, 10), 0);
|
558
568
|
return this.countNotHiddenRowIndexes(visualFixedRowsBottom, 1);
|
559
569
|
}
|
@@ -568,7 +578,7 @@ class TableView {
|
|
568
578
|
countRenderableColumnsInRange(columnStart, columnEnd) {
|
569
579
|
let count = 0;
|
570
580
|
for (let column = columnStart; column <= columnEnd; column++) {
|
571
|
-
if (this.
|
581
|
+
if (this.hot.columnIndexMapper.getRenderableFromVisualIndex(column) !== null) {
|
572
582
|
count += 1;
|
573
583
|
}
|
574
584
|
}
|
@@ -585,7 +595,7 @@ class TableView {
|
|
585
595
|
countRenderableRowsInRange(rowStart, rowEnd) {
|
586
596
|
let count = 0;
|
587
597
|
for (let row = rowStart; row <= rowEnd; row++) {
|
588
|
-
if (this.
|
598
|
+
if (this.hot.rowIndexMapper.getRenderableFromVisualIndex(row) !== null) {
|
589
599
|
count += 1;
|
590
600
|
}
|
591
601
|
}
|
@@ -601,7 +611,7 @@ class TableView {
|
|
601
611
|
isMainTableNotFullyCoveredByOverlays() {
|
602
612
|
const fixedAllRows = this.countNotHiddenFixedRowsTop() + this.countNotHiddenFixedRowsBottom();
|
603
613
|
const fixedAllColumns = this.countNotHiddenFixedColumnsStart();
|
604
|
-
return this.
|
614
|
+
return this.hot.countRenderedRows() > fixedAllRows && this.hot.countRenderedCols() > fixedAllColumns;
|
605
615
|
}
|
606
616
|
|
607
617
|
/**
|
@@ -610,18 +620,17 @@ class TableView {
|
|
610
620
|
* @private
|
611
621
|
*/
|
612
622
|
initializeWalkontable() {
|
613
|
-
const priv = privatePool.get(this);
|
614
623
|
const walkontableConfig = {
|
615
624
|
ariaTags: this.settings.ariaTags,
|
616
|
-
rtlMode: this.
|
617
|
-
externalRowCalculator: this.
|
618
|
-
table:
|
619
|
-
isDataViewInstance: () => (0, _rootInstance.isRootInstance)(this.
|
625
|
+
rtlMode: this.hot.isRtl(),
|
626
|
+
externalRowCalculator: this.hot.getPlugin('autoRowSize') && this.hot.getPlugin('autoRowSize').isEnabled(),
|
627
|
+
table: _classPrivateFieldGet(this, _table),
|
628
|
+
isDataViewInstance: () => (0, _rootInstance.isRootInstance)(this.hot),
|
620
629
|
preventOverflow: () => this.settings.preventOverflow,
|
621
630
|
preventWheel: () => this.settings.preventWheel,
|
622
631
|
stretchH: () => this.settings.stretchH,
|
623
632
|
data: (renderableRow, renderableColumn) => {
|
624
|
-
return this.
|
633
|
+
return this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(renderableRow, renderableColumn));
|
625
634
|
},
|
626
635
|
totalRows: () => this.countRenderableRows(),
|
627
636
|
totalColumns: () => this.countRenderableColumns(),
|
@@ -647,74 +656,74 @@ class TableView {
|
|
647
656
|
renderAllRows: this.settings.renderAllRows,
|
648
657
|
rowHeaders: () => {
|
649
658
|
const headerRenderers = [];
|
650
|
-
if (this.
|
659
|
+
if (this.hot.hasRowHeaders()) {
|
651
660
|
headerRenderers.push((renderableRowIndex, TH) => {
|
652
661
|
// TODO: Some helper may be needed.
|
653
662
|
// We perform translation for row indexes (without row headers).
|
654
|
-
const visualRowIndex = renderableRowIndex >= 0 ? this.
|
663
|
+
const visualRowIndex = renderableRowIndex >= 0 ? this.hot.rowIndexMapper.getVisualFromRenderableIndex(renderableRowIndex) : renderableRowIndex;
|
655
664
|
this.appendRowHeader(visualRowIndex, TH);
|
656
665
|
});
|
657
666
|
}
|
658
|
-
this.
|
667
|
+
this.hot.runHooks('afterGetRowHeaderRenderers', headerRenderers);
|
659
668
|
_classPrivateFieldSet(this, _rowHeadersCount, headerRenderers.length);
|
660
669
|
return headerRenderers;
|
661
670
|
},
|
662
671
|
columnHeaders: () => {
|
663
672
|
const headerRenderers = [];
|
664
|
-
if (this.
|
673
|
+
if (this.hot.hasColHeaders()) {
|
665
674
|
headerRenderers.push((renderedColumnIndex, TH) => {
|
666
675
|
// TODO: Some helper may be needed.
|
667
676
|
// We perform translation for columns indexes (without column headers).
|
668
|
-
const visualColumnsIndex = renderedColumnIndex >= 0 ? this.
|
677
|
+
const visualColumnsIndex = renderedColumnIndex >= 0 ? this.hot.columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex) : renderedColumnIndex;
|
669
678
|
this.appendColHeader(visualColumnsIndex, TH);
|
670
679
|
});
|
671
680
|
}
|
672
|
-
this.
|
681
|
+
this.hot.runHooks('afterGetColumnHeaderRenderers', headerRenderers);
|
673
682
|
_classPrivateFieldSet(this, _columnHeadersCount, headerRenderers.length);
|
674
683
|
return headerRenderers;
|
675
684
|
},
|
676
685
|
columnWidth: renderedColumnIndex => {
|
677
|
-
const visualIndex = this.
|
686
|
+
const visualIndex = this.hot.columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex);
|
678
687
|
|
679
688
|
// It's not a bug that we can't find visual index for some handled by method indexes. The function is called also
|
680
689
|
// for indexes that are not displayed (indexes that are beyond the grid's boundaries), i.e. when `fixedColumnsStart` > `startCols` (wrong config?) or
|
681
690
|
// scrolling and dataset is empty (scroll should handle that?).
|
682
|
-
return this.
|
691
|
+
return this.hot.getColWidth(visualIndex === null ? renderedColumnIndex : visualIndex);
|
683
692
|
},
|
684
693
|
rowHeight: renderedRowIndex => {
|
685
|
-
const visualIndex = this.
|
686
|
-
return this.
|
694
|
+
const visualIndex = this.hot.rowIndexMapper.getVisualFromRenderableIndex(renderedRowIndex);
|
695
|
+
return this.hot.getRowHeight(visualIndex === null ? renderedRowIndex : visualIndex);
|
687
696
|
},
|
688
697
|
cellRenderer: (renderedRowIndex, renderedColumnIndex, TD) => {
|
689
698
|
const [visualRowIndex, visualColumnIndex] = this.translateFromRenderableToVisualIndex(renderedRowIndex, renderedColumnIndex);
|
690
699
|
|
691
700
|
// Coords may be modified. For example, by the `MergeCells` plugin. It should affect cell value and cell meta.
|
692
|
-
const modifiedCellCoords = this.
|
701
|
+
const modifiedCellCoords = this.hot.runHooks('modifyGetCellCoords', visualRowIndex, visualColumnIndex);
|
693
702
|
let visualRowToCheck = visualRowIndex;
|
694
703
|
let visualColumnToCheck = visualColumnIndex;
|
695
704
|
if (Array.isArray(modifiedCellCoords)) {
|
696
705
|
[visualRowToCheck, visualColumnToCheck] = modifiedCellCoords;
|
697
706
|
}
|
698
|
-
const cellProperties = this.
|
699
|
-
const prop = this.
|
700
|
-
let value = this.
|
701
|
-
if (this.
|
702
|
-
value = this.
|
707
|
+
const cellProperties = this.hot.getCellMeta(visualRowToCheck, visualColumnToCheck);
|
708
|
+
const prop = this.hot.colToProp(visualColumnToCheck);
|
709
|
+
let value = this.hot.getDataAtRowProp(visualRowToCheck, prop);
|
710
|
+
if (this.hot.hasHook('beforeValueRender')) {
|
711
|
+
value = this.hot.runHooks('beforeValueRender', value, cellProperties);
|
703
712
|
}
|
704
|
-
this.
|
705
|
-
this.
|
706
|
-
this.
|
713
|
+
this.hot.runHooks('beforeRenderer', TD, visualRowIndex, visualColumnIndex, prop, value, cellProperties);
|
714
|
+
this.hot.getCellRenderer(cellProperties)(this.hot, TD, visualRowIndex, visualColumnIndex, prop, value, cellProperties);
|
715
|
+
this.hot.runHooks('afterRenderer', TD, visualRowIndex, visualColumnIndex, prop, value, cellProperties);
|
707
716
|
},
|
708
|
-
selections: this.
|
717
|
+
selections: this.hot.selection.highlight,
|
709
718
|
hideBorderOnMouseDownOver: () => this.settings.fragmentSelection,
|
710
719
|
onWindowResize: () => {
|
711
|
-
if (this.
|
712
|
-
this.
|
720
|
+
if (this.hot && !this.hot.isDestroyed) {
|
721
|
+
this.hot.refreshDimensions();
|
713
722
|
}
|
714
723
|
},
|
715
724
|
onContainerElementResize: () => {
|
716
|
-
if (this.
|
717
|
-
this.
|
725
|
+
if (this.hot && !this.hot.isDestroyed && (0, _element.isVisible)(this.hot.rootElement)) {
|
726
|
+
this.hot.refreshDimensions();
|
718
727
|
}
|
719
728
|
},
|
720
729
|
onCellMouseDown: (event, coords, TD, wt) => {
|
@@ -724,44 +733,44 @@ class TableView {
|
|
724
733
|
column: false,
|
725
734
|
cell: false
|
726
735
|
};
|
727
|
-
this.
|
736
|
+
this.hot.listen();
|
728
737
|
this.activeWt = wt;
|
729
|
-
|
730
|
-
this.
|
738
|
+
_classPrivateFieldSet(this, _mouseDown, true);
|
739
|
+
this.hot.runHooks('beforeOnCellMouseDown', event, visualCoords, TD, controller);
|
731
740
|
if ((0, _event.isImmediatePropagationStopped)(event)) {
|
732
741
|
return;
|
733
742
|
}
|
734
743
|
(0, _mouseEventHandler.handleMouseEvent)(event, {
|
735
744
|
coords: visualCoords,
|
736
|
-
selection: this.
|
745
|
+
selection: this.hot.selection,
|
737
746
|
controller,
|
738
|
-
cellCoordsFactory: (row, column) => this.
|
747
|
+
cellCoordsFactory: (row, column) => this.hot._createCellCoords(row, column)
|
739
748
|
});
|
740
|
-
this.
|
749
|
+
this.hot.runHooks('afterOnCellMouseDown', event, visualCoords, TD);
|
741
750
|
this.activeWt = this._wt;
|
742
751
|
},
|
743
752
|
onCellContextMenu: (event, coords, TD, wt) => {
|
744
753
|
const visualCoords = this.translateFromRenderableToVisualCoords(coords);
|
745
754
|
this.activeWt = wt;
|
746
|
-
|
747
|
-
if (this.
|
748
|
-
this.
|
755
|
+
_classPrivateFieldSet(this, _mouseDown, false);
|
756
|
+
if (this.hot.selection.isInProgress()) {
|
757
|
+
this.hot.selection.finish();
|
749
758
|
}
|
750
|
-
this.
|
759
|
+
this.hot.runHooks('beforeOnCellContextMenu', event, visualCoords, TD);
|
751
760
|
if ((0, _event.isImmediatePropagationStopped)(event)) {
|
752
761
|
return;
|
753
762
|
}
|
754
|
-
this.
|
763
|
+
this.hot.runHooks('afterOnCellContextMenu', event, visualCoords, TD);
|
755
764
|
this.activeWt = this._wt;
|
756
765
|
},
|
757
766
|
onCellMouseOut: (event, coords, TD, wt) => {
|
758
767
|
const visualCoords = this.translateFromRenderableToVisualCoords(coords);
|
759
768
|
this.activeWt = wt;
|
760
|
-
this.
|
769
|
+
this.hot.runHooks('beforeOnCellMouseOut', event, visualCoords, TD);
|
761
770
|
if ((0, _event.isImmediatePropagationStopped)(event)) {
|
762
771
|
return;
|
763
772
|
}
|
764
|
-
this.
|
773
|
+
this.hot.runHooks('afterOnCellMouseOut', event, visualCoords, TD);
|
765
774
|
this.activeWt = this._wt;
|
766
775
|
},
|
767
776
|
onCellMouseOver: (event, coords, TD, wt) => {
|
@@ -772,48 +781,48 @@ class TableView {
|
|
772
781
|
cell: false
|
773
782
|
};
|
774
783
|
this.activeWt = wt;
|
775
|
-
this.
|
784
|
+
this.hot.runHooks('beforeOnCellMouseOver', event, visualCoords, TD, controller);
|
776
785
|
if ((0, _event.isImmediatePropagationStopped)(event)) {
|
777
786
|
return;
|
778
787
|
}
|
779
|
-
if (
|
788
|
+
if (_classPrivateFieldGet(this, _mouseDown)) {
|
780
789
|
(0, _mouseEventHandler.handleMouseEvent)(event, {
|
781
790
|
coords: visualCoords,
|
782
|
-
selection: this.
|
791
|
+
selection: this.hot.selection,
|
783
792
|
controller,
|
784
|
-
cellCoordsFactory: (row, column) => this.
|
793
|
+
cellCoordsFactory: (row, column) => this.hot._createCellCoords(row, column)
|
785
794
|
});
|
786
795
|
}
|
787
|
-
this.
|
796
|
+
this.hot.runHooks('afterOnCellMouseOver', event, visualCoords, TD);
|
788
797
|
this.activeWt = this._wt;
|
789
798
|
},
|
790
799
|
onCellMouseUp: (event, coords, TD, wt) => {
|
791
800
|
const visualCoords = this.translateFromRenderableToVisualCoords(coords);
|
792
801
|
this.activeWt = wt;
|
793
|
-
this.
|
802
|
+
this.hot.runHooks('beforeOnCellMouseUp', event, visualCoords, TD);
|
794
803
|
|
795
804
|
// TODO: The second condition check is a workaround. Callback corresponding the method `updateSettings`
|
796
805
|
// disable plugin and enable it again. Disabling plugin closes the menu. Thus, calling the
|
797
806
|
// `updateSettings` in a body of any callback executed right after some context-menu action
|
798
807
|
// breaks the table (#7231).
|
799
|
-
if ((0, _event.isImmediatePropagationStopped)(event) || this.
|
808
|
+
if ((0, _event.isImmediatePropagationStopped)(event) || this.hot.isDestroyed) {
|
800
809
|
return;
|
801
810
|
}
|
802
|
-
this.
|
811
|
+
this.hot.runHooks('afterOnCellMouseUp', event, visualCoords, TD);
|
803
812
|
this.activeWt = this._wt;
|
804
813
|
},
|
805
814
|
onCellCornerMouseDown: event => {
|
806
815
|
event.preventDefault();
|
807
|
-
this.
|
816
|
+
this.hot.runHooks('afterOnCellCornerMouseDown', event);
|
808
817
|
},
|
809
818
|
onCellCornerDblClick: event => {
|
810
819
|
event.preventDefault();
|
811
|
-
this.
|
820
|
+
this.hot.runHooks('afterOnCellCornerDblClick', event);
|
812
821
|
},
|
813
822
|
beforeDraw: (force, skipRender) => this.beforeRender(force, skipRender),
|
814
823
|
onDraw: force => this.afterRender(force),
|
815
824
|
onBeforeViewportScrollVertically: renderableRow => {
|
816
|
-
const rowMapper = this.
|
825
|
+
const rowMapper = this.hot.rowIndexMapper;
|
817
826
|
const areColumnHeadersSelected = renderableRow < 0;
|
818
827
|
let visualRow = renderableRow;
|
819
828
|
if (!areColumnHeadersSelected) {
|
@@ -824,15 +833,15 @@ class TableView {
|
|
824
833
|
return renderableRow;
|
825
834
|
}
|
826
835
|
}
|
827
|
-
visualRow = this.
|
828
|
-
this.
|
836
|
+
visualRow = this.hot.runHooks('beforeViewportScrollVertically', visualRow);
|
837
|
+
this.hot.runHooks('beforeViewportScroll');
|
829
838
|
if (!areColumnHeadersSelected) {
|
830
839
|
return rowMapper.getRenderableFromVisualIndex(visualRow);
|
831
840
|
}
|
832
841
|
return visualRow;
|
833
842
|
},
|
834
843
|
onBeforeViewportScrollHorizontally: renderableColumn => {
|
835
|
-
const columnMapper = this.
|
844
|
+
const columnMapper = this.hot.columnIndexMapper;
|
836
845
|
const areRowHeadersSelected = renderableColumn < 0;
|
837
846
|
let visualColumn = renderableColumn;
|
838
847
|
if (!areRowHeadersSelected) {
|
@@ -843,43 +852,43 @@ class TableView {
|
|
843
852
|
return renderableColumn;
|
844
853
|
}
|
845
854
|
}
|
846
|
-
visualColumn = this.
|
847
|
-
this.
|
855
|
+
visualColumn = this.hot.runHooks('beforeViewportScrollHorizontally', visualColumn);
|
856
|
+
this.hot.runHooks('beforeViewportScroll');
|
848
857
|
if (!areRowHeadersSelected) {
|
849
858
|
return columnMapper.getRenderableFromVisualIndex(visualColumn);
|
850
859
|
}
|
851
860
|
return visualColumn;
|
852
861
|
},
|
853
862
|
onScrollVertically: () => {
|
854
|
-
this.
|
855
|
-
this.
|
863
|
+
this.hot.runHooks('afterScrollVertically');
|
864
|
+
this.hot.runHooks('afterScroll');
|
856
865
|
},
|
857
866
|
onScrollHorizontally: () => {
|
858
|
-
this.
|
859
|
-
this.
|
867
|
+
this.hot.runHooks('afterScrollHorizontally');
|
868
|
+
this.hot.runHooks('afterScroll');
|
860
869
|
},
|
861
|
-
onBeforeRemoveCellClassNames: () => this.
|
870
|
+
onBeforeRemoveCellClassNames: () => this.hot.runHooks('beforeRemoveCellClassNames'),
|
862
871
|
onBeforeHighlightingRowHeader: (renderableRow, headerLevel, highlightMeta) => {
|
863
|
-
const rowMapper = this.
|
872
|
+
const rowMapper = this.hot.rowIndexMapper;
|
864
873
|
const areColumnHeadersSelected = renderableRow < 0;
|
865
874
|
let visualRow = renderableRow;
|
866
875
|
if (!areColumnHeadersSelected) {
|
867
876
|
visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);
|
868
877
|
}
|
869
|
-
const newVisualRow = this.
|
878
|
+
const newVisualRow = this.hot.runHooks('beforeHighlightingRowHeader', visualRow, headerLevel, highlightMeta);
|
870
879
|
if (!areColumnHeadersSelected) {
|
871
880
|
return rowMapper.getRenderableFromVisualIndex(rowMapper.getNearestNotHiddenIndex(newVisualRow, 1));
|
872
881
|
}
|
873
882
|
return newVisualRow;
|
874
883
|
},
|
875
884
|
onBeforeHighlightingColumnHeader: (renderableColumn, headerLevel, highlightMeta) => {
|
876
|
-
const columnMapper = this.
|
885
|
+
const columnMapper = this.hot.columnIndexMapper;
|
877
886
|
const areRowHeadersSelected = renderableColumn < 0;
|
878
887
|
let visualColumn = renderableColumn;
|
879
888
|
if (!areRowHeadersSelected) {
|
880
889
|
visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);
|
881
890
|
}
|
882
|
-
const newVisualColumn = this.
|
891
|
+
const newVisualColumn = this.hot.runHooks('beforeHighlightingColumnHeader', visualColumn, headerLevel, highlightMeta);
|
883
892
|
if (!areRowHeadersSelected) {
|
884
893
|
return columnMapper.getRenderableFromVisualIndex(columnMapper.getNearestNotHiddenIndex(newVisualColumn, 1));
|
885
894
|
}
|
@@ -888,34 +897,34 @@ class TableView {
|
|
888
897
|
onAfterDrawSelection: (currentRow, currentColumn, layerLevel) => {
|
889
898
|
let cornersOfSelection;
|
890
899
|
const [visualRowIndex, visualColumnIndex] = this.translateFromRenderableToVisualIndex(currentRow, currentColumn);
|
891
|
-
const selectedRange = this.
|
900
|
+
const selectedRange = this.hot.selection.getSelectedRange();
|
892
901
|
const selectionRangeSize = selectedRange.size();
|
893
902
|
if (selectionRangeSize > 0) {
|
894
903
|
const selectionForLayer = selectedRange.peekByIndex(layerLevel !== null && layerLevel !== void 0 ? layerLevel : 0);
|
895
904
|
cornersOfSelection = [selectionForLayer.from.row, selectionForLayer.from.col, selectionForLayer.to.row, selectionForLayer.to.col];
|
896
905
|
}
|
897
|
-
return this.
|
906
|
+
return this.hot.runHooks('afterDrawSelection', visualRowIndex, visualColumnIndex, cornersOfSelection, layerLevel);
|
898
907
|
},
|
899
908
|
onBeforeDrawBorders: (corners, borderClassName) => {
|
900
909
|
const [startRenderableRow, startRenderableColumn, endRenderableRow, endRenderableColumn] = corners;
|
901
|
-
const visualCorners = [this.
|
902
|
-
return this.
|
910
|
+
const visualCorners = [this.hot.rowIndexMapper.getVisualFromRenderableIndex(startRenderableRow), this.hot.columnIndexMapper.getVisualFromRenderableIndex(startRenderableColumn), this.hot.rowIndexMapper.getVisualFromRenderableIndex(endRenderableRow), this.hot.columnIndexMapper.getVisualFromRenderableIndex(endRenderableColumn)];
|
911
|
+
return this.hot.runHooks('beforeDrawBorders', visualCorners, borderClassName);
|
903
912
|
},
|
904
|
-
onBeforeTouchScroll: () => this.
|
905
|
-
onAfterMomentumScroll: () => this.
|
913
|
+
onBeforeTouchScroll: () => this.hot.runHooks('beforeTouchScroll'),
|
914
|
+
onAfterMomentumScroll: () => this.hot.runHooks('afterMomentumScroll'),
|
906
915
|
onBeforeStretchingColumnWidth: (stretchedWidth, renderedColumnIndex) => {
|
907
|
-
const visualColumnIndex = this.
|
908
|
-
return this.
|
916
|
+
const visualColumnIndex = this.hot.columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex);
|
917
|
+
return this.hot.runHooks('beforeStretchingColumnWidth', stretchedWidth, visualColumnIndex);
|
909
918
|
},
|
910
|
-
onModifyRowHeaderWidth: rowHeaderWidth => this.
|
919
|
+
onModifyRowHeaderWidth: rowHeaderWidth => this.hot.runHooks('modifyRowHeaderWidth', rowHeaderWidth),
|
911
920
|
onModifyGetCellCoords: (renderableRowIndex, renderableColumnIndex, topmost) => {
|
912
|
-
const rowMapper = this.
|
913
|
-
const columnMapper = this.
|
921
|
+
const rowMapper = this.hot.rowIndexMapper;
|
922
|
+
const columnMapper = this.hot.columnIndexMapper;
|
914
923
|
|
915
924
|
// Callback handle also headers. We shouldn't translate them.
|
916
925
|
const visualColumnIndex = renderableColumnIndex >= 0 ? columnMapper.getVisualFromRenderableIndex(renderableColumnIndex) : renderableColumnIndex;
|
917
926
|
const visualRowIndex = renderableRowIndex >= 0 ? rowMapper.getVisualFromRenderableIndex(renderableRowIndex) : renderableRowIndex;
|
918
|
-
const visualIndexes = this.
|
927
|
+
const visualIndexes = this.hot.runHooks('modifyGetCellCoords', visualRowIndex, visualColumnIndex, topmost);
|
919
928
|
if (Array.isArray(visualIndexes)) {
|
920
929
|
const [visualRowFrom, visualColumnFrom, visualRowTo, visualColumnTo] = visualIndexes;
|
921
930
|
|
@@ -941,7 +950,7 @@ class TableView {
|
|
941
950
|
calc.endRow = Math.min(lastRenderedRow + offset, renderableRows - 1);
|
942
951
|
}
|
943
952
|
}
|
944
|
-
this.
|
953
|
+
this.hot.runHooks('afterViewportRowCalculatorOverride', calc);
|
945
954
|
},
|
946
955
|
viewportColumnCalculatorOverride: calc => {
|
947
956
|
let viewportOffset = this.settings.viewportColumnRenderingOffset;
|
@@ -962,15 +971,15 @@ class TableView {
|
|
962
971
|
calc.endColumn = Math.min(lastRenderedColumn + offset, renderableColumns - 1);
|
963
972
|
}
|
964
973
|
}
|
965
|
-
this.
|
974
|
+
this.hot.runHooks('afterViewportColumnCalculatorOverride', calc);
|
966
975
|
},
|
967
976
|
rowHeaderWidth: () => this.settings.rowHeaderWidth,
|
968
977
|
columnHeaderHeight: () => {
|
969
|
-
const columnHeaderHeight = this.
|
978
|
+
const columnHeaderHeight = this.hot.runHooks('modifyColumnHeaderHeight');
|
970
979
|
return this.settings.columnHeaderHeight || columnHeaderHeight;
|
971
980
|
}
|
972
981
|
};
|
973
|
-
this.
|
982
|
+
this.hot.runHooks('beforeInitWalkontable', walkontableConfig);
|
974
983
|
this._wt = new _src.default(walkontableConfig);
|
975
984
|
this.activeWt = this._wt;
|
976
985
|
const spreader = this._wt.wtTable.spreader;
|
@@ -978,7 +987,7 @@ class TableView {
|
|
978
987
|
const {
|
979
988
|
width,
|
980
989
|
height
|
981
|
-
} = this.
|
990
|
+
} = this.hot.rootElement.getBoundingClientRect();
|
982
991
|
this.setLastSize(width, height);
|
983
992
|
this.eventManager.addEventListener(spreader, 'mousedown', event => {
|
984
993
|
// right mouse button exactly on spreader means right click on the right hand side of vertical scrollbar
|
@@ -992,10 +1001,10 @@ class TableView {
|
|
992
1001
|
event.stopPropagation();
|
993
1002
|
}
|
994
1003
|
});
|
995
|
-
this.eventManager.addEventListener(this.
|
1004
|
+
this.eventManager.addEventListener(this.hot.rootDocument.documentElement, 'click', () => {
|
996
1005
|
if (this.settings.observeDOMVisibility) {
|
997
1006
|
if (this._wt.drawInterrupted) {
|
998
|
-
this.
|
1007
|
+
this.hot.forceFullRender = true;
|
999
1008
|
this.render();
|
1000
1009
|
}
|
1001
1010
|
}
|
@@ -1013,7 +1022,7 @@ class TableView {
|
|
1013
1022
|
if ((0, _element.isInput)(el)) {
|
1014
1023
|
return true;
|
1015
1024
|
}
|
1016
|
-
const isChildOfTableBody = (0, _element.isChildOf)(el, this.
|
1025
|
+
const isChildOfTableBody = (0, _element.isChildOf)(el, this.hot.view._wt.wtTable.spreader);
|
1017
1026
|
if (this.settings.fragmentSelection === true && isChildOfTableBody) {
|
1018
1027
|
return true;
|
1019
1028
|
}
|
@@ -1033,7 +1042,7 @@ class TableView {
|
|
1033
1042
|
* @returns {boolean}
|
1034
1043
|
*/
|
1035
1044
|
isMouseDown() {
|
1036
|
-
return
|
1045
|
+
return _classPrivateFieldGet(this, _mouseDown);
|
1037
1046
|
}
|
1038
1047
|
|
1039
1048
|
/**
|
@@ -1043,8 +1052,8 @@ class TableView {
|
|
1043
1052
|
* @returns {boolean}
|
1044
1053
|
*/
|
1045
1054
|
isSelectedOnlyCell() {
|
1046
|
-
var _this$
|
1047
|
-
return (_this$
|
1055
|
+
var _this$hot$getSelected, _this$hot$getSelected2;
|
1056
|
+
return (_this$hot$getSelected = (_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingleCell()) !== null && _this$hot$getSelected !== void 0 ? _this$hot$getSelected : false;
|
1048
1057
|
}
|
1049
1058
|
|
1050
1059
|
/**
|
@@ -1054,7 +1063,7 @@ class TableView {
|
|
1054
1063
|
* @returns {boolean}
|
1055
1064
|
*/
|
1056
1065
|
isCellEdited() {
|
1057
|
-
const activeEditor = this.
|
1066
|
+
const activeEditor = this.hot.getActiveEditor();
|
1058
1067
|
return activeEditor && activeEditor.isOpened();
|
1059
1068
|
}
|
1060
1069
|
|
@@ -1069,8 +1078,8 @@ class TableView {
|
|
1069
1078
|
*/
|
1070
1079
|
beforeRender(force, skipRender) {
|
1071
1080
|
if (force) {
|
1072
|
-
// this.
|
1073
|
-
this.
|
1081
|
+
// this.hot.forceFullRender = did Handsontable request full render?
|
1082
|
+
this.hot.runHooks('beforeViewRender', this.hot.forceFullRender, skipRender);
|
1074
1083
|
}
|
1075
1084
|
}
|
1076
1085
|
|
@@ -1083,8 +1092,8 @@ class TableView {
|
|
1083
1092
|
*/
|
1084
1093
|
afterRender(force) {
|
1085
1094
|
if (force) {
|
1086
|
-
// this.
|
1087
|
-
this.
|
1095
|
+
// this.hot.forceFullRender = did Handsontable request full render?
|
1096
|
+
this.hot.runHooks('afterViewRender', this.hot.forceFullRender);
|
1088
1097
|
}
|
1089
1098
|
}
|
1090
1099
|
|
@@ -1103,12 +1112,12 @@ class TableView {
|
|
1103
1112
|
this.appendRowHeader(visualRowIndex, TH);
|
1104
1113
|
return;
|
1105
1114
|
}
|
1106
|
-
this.updateCellHeader(container.querySelector('.rowHeader'), visualRowIndex, this.
|
1115
|
+
this.updateCellHeader(container.querySelector('.rowHeader'), visualRowIndex, this.hot.getRowHeader);
|
1107
1116
|
} else {
|
1108
1117
|
const {
|
1109
1118
|
rootDocument,
|
1110
1119
|
getRowHeader
|
1111
|
-
} = this.
|
1120
|
+
} = this.hot;
|
1112
1121
|
const div = rootDocument.createElement('div');
|
1113
1122
|
const span = rootDocument.createElement('span');
|
1114
1123
|
div.className = 'relative';
|
@@ -1117,7 +1126,7 @@ class TableView {
|
|
1117
1126
|
div.appendChild(span);
|
1118
1127
|
TH.appendChild(div);
|
1119
1128
|
}
|
1120
|
-
this.
|
1129
|
+
this.hot.runHooks('afterGetRowHeader', visualRowIndex, TH);
|
1121
1130
|
}
|
1122
1131
|
|
1123
1132
|
/**
|
@@ -1131,7 +1140,7 @@ class TableView {
|
|
1131
1140
|
* values counting from 0 to N).
|
1132
1141
|
*/
|
1133
1142
|
appendColHeader(visualColumnIndex, TH) {
|
1134
|
-
let label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.
|
1143
|
+
let label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.hot.getColHeader;
|
1135
1144
|
let headerLevel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
1136
1145
|
if (TH.firstChild) {
|
1137
1146
|
const container = TH.firstChild;
|
@@ -1144,7 +1153,7 @@ class TableView {
|
|
1144
1153
|
} else {
|
1145
1154
|
const {
|
1146
1155
|
rootDocument
|
1147
|
-
} = this.
|
1156
|
+
} = this.hot;
|
1148
1157
|
const div = rootDocument.createElement('div');
|
1149
1158
|
const span = rootDocument.createElement('span');
|
1150
1159
|
div.className = 'relative';
|
@@ -1153,7 +1162,7 @@ class TableView {
|
|
1153
1162
|
div.appendChild(span);
|
1154
1163
|
TH.appendChild(div);
|
1155
1164
|
}
|
1156
|
-
this.
|
1165
|
+
this.hot.runHooks('afterGetColHeader', visualColumnIndex, TH, headerLevel);
|
1157
1166
|
}
|
1158
1167
|
|
1159
1168
|
/**
|
@@ -1223,8 +1232,8 @@ class TableView {
|
|
1223
1232
|
* @param {number} height The table height.
|
1224
1233
|
*/
|
1225
1234
|
setLastSize(width, height) {
|
1226
|
-
|
1227
|
-
|
1235
|
+
_classPrivateFieldSet(this, _lastWidth, width);
|
1236
|
+
_classPrivateFieldSet(this, _lastHeight, height);
|
1228
1237
|
}
|
1229
1238
|
|
1230
1239
|
/**
|
@@ -1233,10 +1242,9 @@ class TableView {
|
|
1233
1242
|
* @returns {object}
|
1234
1243
|
*/
|
1235
1244
|
getLastSize() {
|
1236
|
-
const priv = privatePool.get(this);
|
1237
1245
|
return {
|
1238
|
-
width:
|
1239
|
-
height:
|
1246
|
+
width: _classPrivateFieldGet(this, _lastWidth),
|
1247
|
+
height: _classPrivateFieldGet(this, _lastHeight)
|
1240
1248
|
};
|
1241
1249
|
}
|
1242
1250
|
|
@@ -1246,7 +1254,7 @@ class TableView {
|
|
1246
1254
|
* @returns {number}
|
1247
1255
|
*/
|
1248
1256
|
getFirstFullyVisibleRow() {
|
1249
|
-
return this.
|
1257
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstVisibleRow());
|
1250
1258
|
}
|
1251
1259
|
|
1252
1260
|
/**
|
@@ -1255,7 +1263,7 @@ class TableView {
|
|
1255
1263
|
* @returns {number}
|
1256
1264
|
*/
|
1257
1265
|
getLastFullyVisibleRow() {
|
1258
|
-
return this.
|
1266
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleRow());
|
1259
1267
|
}
|
1260
1268
|
|
1261
1269
|
/**
|
@@ -1264,7 +1272,7 @@ class TableView {
|
|
1264
1272
|
* @returns {number}
|
1265
1273
|
*/
|
1266
1274
|
getFirstFullyVisibleColumn() {
|
1267
|
-
return this.
|
1275
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstVisibleColumn());
|
1268
1276
|
}
|
1269
1277
|
|
1270
1278
|
/**
|
@@ -1273,7 +1281,7 @@ class TableView {
|
|
1273
1281
|
* @returns {number}
|
1274
1282
|
*/
|
1275
1283
|
getLastFullyVisibleColumn() {
|
1276
|
-
return this.
|
1284
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleColumn());
|
1277
1285
|
}
|
1278
1286
|
|
1279
1287
|
/**
|