handsontable 0.0.0-next-3d099da-20231208 → 0.0.0-next-51d3397-20231211
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/calculator/index.js +11 -6
- package/3rdparty/walkontable/src/calculator/index.mjs +5 -3
- package/3rdparty/walkontable/src/calculator/renderAllColumns.js +50 -0
- package/3rdparty/walkontable/src/calculator/renderAllColumns.mjs +46 -0
- package/3rdparty/walkontable/src/calculator/renderAllRows.js +50 -0
- package/3rdparty/walkontable/src/calculator/renderAllRows.mjs +46 -0
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +1 -122
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +2 -124
- package/3rdparty/walkontable/src/calculator/viewportRows.js +1 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +2 -3
- package/3rdparty/walkontable/src/core/_base.js +0 -12
- package/3rdparty/walkontable/src/core/_base.mjs +0 -12
- package/3rdparty/walkontable/src/core/core.js +0 -2
- package/3rdparty/walkontable/src/core/core.mjs +0 -2
- package/3rdparty/walkontable/src/facade/core.js +0 -9
- package/3rdparty/walkontable/src/facade/core.mjs +0 -9
- package/3rdparty/walkontable/src/index.js +3 -4
- package/3rdparty/walkontable/src/index.mjs +1 -2
- package/3rdparty/walkontable/src/overlays.js +0 -3
- package/3rdparty/walkontable/src/overlays.mjs +0 -4
- package/3rdparty/walkontable/src/renderer/colGroup.js +10 -0
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +10 -0
- package/3rdparty/walkontable/src/renderer/rows.js +4 -3
- package/3rdparty/walkontable/src/renderer/rows.mjs +4 -3
- package/3rdparty/walkontable/src/selection/manager.js +0 -1
- package/3rdparty/walkontable/src/selection/manager.mjs +0 -1
- package/3rdparty/walkontable/src/settings.js +3 -0
- package/3rdparty/walkontable/src/settings.mjs +2 -0
- package/3rdparty/walkontable/src/table.js +0 -1
- package/3rdparty/walkontable/src/table.mjs +0 -1
- package/3rdparty/walkontable/src/utils/column.js +27 -12
- package/3rdparty/walkontable/src/utils/column.mjs +27 -12
- package/3rdparty/walkontable/src/utils/columnStretching.js +219 -0
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +215 -0
- package/3rdparty/walkontable/src/viewport.js +22 -17
- package/3rdparty/walkontable/src/viewport.mjs +23 -18
- package/base.js +4 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/index.js +44 -6
- package/core/focusCatcher/index.mjs +44 -6
- package/core.js +0 -11
- package/core.mjs +0 -11
- package/dataMap/dataMap.js +1 -0
- package/dataMap/metaManager/metaSchema.js +28 -2
- package/dataMap/metaManager/metaSchema.mjs +28 -2
- package/dataMap/metaManager/mods/extendMetaProperties.js +12 -0
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +12 -0
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +3 -3
- package/dist/handsontable.full.js +3979 -5577
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +66 -71
- package/dist/handsontable.js +3058 -4305
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +35 -39
- package/editorManager.js +3 -4
- package/editorManager.mjs +3 -4
- package/editors/autocompleteEditor/autocompleteEditor.js +0 -2
- package/editors/autocompleteEditor/autocompleteEditor.mjs +0 -2
- package/editors/dateEditor/dateEditor.d.ts +1 -1
- package/editors/dateEditor/dateEditor.js +4 -1
- package/editors/dateEditor/dateEditor.mjs +4 -1
- package/editors/handsontableEditor/handsontableEditor.js +0 -1
- package/editors/handsontableEditor/handsontableEditor.mjs +0 -1
- package/editors/textEditor/textEditor.js +0 -4
- package/editors/textEditor/textEditor.mjs +0 -4
- package/helpers/browser.js +5 -2
- package/helpers/browser.mjs +5 -2
- package/helpers/feature.js +10 -0
- package/helpers/feature.mjs +9 -0
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +3 -4
- package/pluginHooks.d.ts +6 -29
- package/pluginHooks.js +65 -123
- package/pluginHooks.mjs +62 -122
- package/plugins/copyPaste/clipboardData.js +18 -0
- package/plugins/copyPaste/clipboardData.mjs +14 -0
- package/plugins/copyPaste/copyPaste.js +129 -51
- package/plugins/copyPaste/copyPaste.mjs +132 -54
- package/plugins/copyPaste/copyableRanges.js +43 -7
- package/plugins/copyPaste/copyableRanges.mjs +42 -7
- package/plugins/copyPaste/pasteEvent.mjs +1 -1
- package/plugins/customBorders/customBorders.js +0 -5
- package/plugins/customBorders/customBorders.mjs +0 -5
- package/plugins/customBorders/utils.js +0 -1
- package/plugins/customBorders/utils.mjs +0 -1
- package/plugins/filters/ui/radioInput.js +1 -1
- package/plugins/filters/ui/radioInput.mjs +1 -1
- package/plugins/formulas/formulas.js +0 -2
- package/plugins/formulas/formulas.mjs +0 -2
- package/plugins/formulas/indexSyncer/axisSyncer.js +0 -1
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +0 -1
- package/plugins/manualColumnResize/manualColumnResize.js +0 -1
- package/plugins/manualColumnResize/manualColumnResize.mjs +0 -1
- package/plugins/mergeCells/mergeCells.js +1 -127
- package/plugins/mergeCells/mergeCells.mjs +1 -127
- package/plugins/nestedHeaders/nestedHeaders.js +41 -87
- package/plugins/nestedHeaders/nestedHeaders.mjs +42 -88
- package/plugins/nestedHeaders/stateManager/headersTree.js +0 -1
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +0 -1
- package/plugins/undoRedo/undoRedo.js +0 -2
- package/plugins/undoRedo/undoRedo.mjs +0 -2
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +0 -1
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +0 -1
- package/renderers/checkboxRenderer/checkboxRenderer.js +0 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +0 -2
- package/selection/highlight/highlight.js +0 -1
- package/selection/highlight/highlight.mjs +0 -1
- package/selection/index.js +1 -3
- package/selection/index.mjs +2 -2
- package/selection/utils.js +0 -34
- package/selection/utils.mjs +0 -33
- package/settings.d.ts +2 -1
- package/tableView.js +1 -2
- package/tableView.mjs +1 -2
- package/translations/indexMapper.js +2 -1
- package/utils/parseTable.js +84 -538
- package/utils/parseTable.mjs +83 -534
- package/validators/timeValidator/timeValidator.js +0 -1
- package/validators/timeValidator/timeValidator.mjs +0 -1
- package/plugins/copyPaste/clipboardData/clipboardData.js +0 -588
- package/plugins/copyPaste/clipboardData/clipboardData.mjs +0 -584
- package/plugins/copyPaste/clipboardData/copyClipboardData.js +0 -69
- package/plugins/copyPaste/clipboardData/copyClipboardData.mjs +0 -65
- package/plugins/copyPaste/clipboardData/index.js +0 -9
- package/plugins/copyPaste/clipboardData/index.mjs +0 -4
- package/plugins/copyPaste/clipboardData/pasteClipboardData.js +0 -81
- package/plugins/copyPaste/clipboardData/pasteClipboardData.mjs +0 -77
@@ -17,11 +17,10 @@ import { isNumeric, clamp } from "../../helpers/number.mjs";
|
|
17
17
|
import { toSingleLine } from "../../helpers/templateLiteralTag.mjs";
|
18
18
|
import { isLeftClick, isRightClick } from "../../helpers/dom/event.mjs";
|
19
19
|
import { warn } from "../../helpers/console.mjs";
|
20
|
-
import { ACTIVE_HEADER_TYPE, HEADER_TYPE
|
20
|
+
import { ACTIVE_HEADER_TYPE, HEADER_TYPE } from "../../selection/index.mjs";
|
21
21
|
import { BasePlugin } from "../base/index.mjs";
|
22
22
|
import StateManager from "./stateManager/index.mjs";
|
23
23
|
import GhostTable from "./utils/ghostTable.mjs";
|
24
|
-
import { arrayEach } from "../../helpers/array.mjs";
|
25
24
|
export const PLUGIN_KEY = 'nestedHeaders';
|
26
25
|
export const PLUGIN_PRIORITY = 280;
|
27
26
|
|
@@ -98,7 +97,6 @@ export class NestedHeaders extends BasePlugin {
|
|
98
97
|
/**
|
99
98
|
* Updates the plugin state after new dataset load.
|
100
99
|
*
|
101
|
-
* @private
|
102
100
|
* @param {Array[]} sourceData Array of arrays or array of objects containing data.
|
103
101
|
* @param {boolean} initialLoad Flag that determines whether the data has been loaded
|
104
102
|
* during the initialization.
|
@@ -106,14 +104,11 @@ export class NestedHeaders extends BasePlugin {
|
|
106
104
|
_classPrivateMethodInitSpec(this, _onAfterLoadData);
|
107
105
|
/**
|
108
106
|
* Updates the plugin state after HoT initialization.
|
109
|
-
*
|
110
|
-
* @private
|
111
107
|
*/
|
112
108
|
_classPrivateMethodInitSpec(this, _onInit);
|
113
109
|
/**
|
114
110
|
* `modifyFocusedElement` hook callback.
|
115
111
|
*
|
116
|
-
* @private
|
117
112
|
* @param {number} row Row index.
|
118
113
|
* @param {number} column Column index.
|
119
114
|
* @returns {HTMLTableCellElement} The `TH` element to be focused.
|
@@ -123,7 +118,6 @@ export class NestedHeaders extends BasePlugin {
|
|
123
118
|
* Listens the `modifyColumnHeaderValue` hook that overwrites the column headers values based on
|
124
119
|
* the internal state and settings of the plugin.
|
125
120
|
*
|
126
|
-
* @private
|
127
121
|
* @param {string} value The column header value.
|
128
122
|
* @param {number} visualColumnIndex The visual column index.
|
129
123
|
* @param {number} headerLevel The index of header level. The header level accepts positive (0 to N)
|
@@ -136,7 +130,6 @@ export class NestedHeaders extends BasePlugin {
|
|
136
130
|
/**
|
137
131
|
* `modifyColWidth` hook callback - returns width from cache, when is greater than incoming from hook.
|
138
132
|
*
|
139
|
-
* @private
|
140
133
|
* @param {number} width Width from hook.
|
141
134
|
* @param {number} column Visual index of an column.
|
142
135
|
* @returns {number}
|
@@ -145,14 +138,12 @@ export class NestedHeaders extends BasePlugin {
|
|
145
138
|
/**
|
146
139
|
* Make the renderer render the first nested column in its entirety.
|
147
140
|
*
|
148
|
-
* @private
|
149
141
|
* @param {object} calc Viewport column calculator.
|
150
142
|
*/
|
151
143
|
_classPrivateMethodInitSpec(this, _onAfterViewportColumnCalculatorOverride);
|
152
144
|
/**
|
153
145
|
* `afterGetColumnHeader` hook callback - prepares the header structure.
|
154
146
|
*
|
155
|
-
* @private
|
156
147
|
* @param {Array} renderersArray Array of renderers.
|
157
148
|
*/
|
158
149
|
_classPrivateMethodInitSpec(this, _onAfterGetColumnHeaderRenderers);
|
@@ -160,7 +151,6 @@ export class NestedHeaders extends BasePlugin {
|
|
160
151
|
* The hook observes the column selection from the Selection API and modifies the column range to
|
161
152
|
* ensure that the whole nested column will be covered.
|
162
153
|
*
|
163
|
-
* @private
|
164
154
|
* @param {CellCoords} from The coords object where the selection starts.
|
165
155
|
* @param {CellCoords} to The coords object where the selection ends.
|
166
156
|
*/
|
@@ -168,27 +158,21 @@ export class NestedHeaders extends BasePlugin {
|
|
168
158
|
/**
|
169
159
|
* `modifyTransformStart` hook is called every time the keyboard navigation is used.
|
170
160
|
*
|
171
|
-
* @private
|
172
161
|
* @param {object} delta The transformation delta.
|
173
162
|
*/
|
174
163
|
_classPrivateMethodInitSpec(this, _onModifyTransformStart);
|
175
164
|
/**
|
176
165
|
* The hook checks and ensures that the focus position that depends on the selected columns
|
177
166
|
* range is always positioned within the range.
|
178
|
-
*
|
179
|
-
* @private
|
180
167
|
*/
|
181
168
|
_classPrivateMethodInitSpec(this, _onBeforeSelectionHighlightSet);
|
182
169
|
/**
|
183
170
|
* Switches internal flag about selection progress to `false`.
|
184
|
-
*
|
185
|
-
* @private
|
186
171
|
*/
|
187
172
|
_classPrivateMethodInitSpec(this, _onBeforeOnCellMouseUp);
|
188
173
|
/**
|
189
174
|
* Makes the header-selection properly select the nested headers.
|
190
175
|
*
|
191
|
-
* @private
|
192
176
|
* @param {MouseEvent} event Mouse event.
|
193
177
|
* @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell.
|
194
178
|
* @param {HTMLElement} TD The cell element.
|
@@ -199,7 +183,6 @@ export class NestedHeaders extends BasePlugin {
|
|
199
183
|
/**
|
200
184
|
* Allows to control how the column selection based on the coordinates and the nested headers is made.
|
201
185
|
*
|
202
|
-
* @private
|
203
186
|
* @param {MouseEvent} event Mouse event.
|
204
187
|
* @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell.
|
205
188
|
*/
|
@@ -207,7 +190,6 @@ export class NestedHeaders extends BasePlugin {
|
|
207
190
|
/**
|
208
191
|
* Allows blocking the column selection that is controlled by the core Selection module.
|
209
192
|
*
|
210
|
-
* @private
|
211
193
|
* @param {MouseEvent} event Mouse event.
|
212
194
|
* @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell.
|
213
195
|
* @param {CellCoords} TD The table cell or header element.
|
@@ -221,23 +203,16 @@ export class NestedHeaders extends BasePlugin {
|
|
221
203
|
* of the column.
|
222
204
|
*
|
223
205
|
* @private
|
224
|
-
* @param {
|
225
|
-
* @param {
|
226
|
-
*
|
227
|
-
* @param {
|
228
|
-
*
|
229
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the copied/pasted dataset.
|
230
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the copied/pasted dataset.
|
231
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
232
|
-
* @param {Function} clipboardData.getMetaInfo Gets grid settings for copied data.
|
233
|
-
* @param {Function} clipboardData.setMetaInfo Sets grid settings for copied data.
|
234
|
-
* @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
|
206
|
+
* @param {Array[]} data An array of arrays which contains data to copied.
|
207
|
+
* @param {object[]} copyableRanges An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
208
|
+
* which will copied.
|
209
|
+
* @param {{ columnHeadersCount: number }} copiedHeadersCount An object with keys that holds information with
|
210
|
+
* the number of copied headers.
|
235
211
|
*/
|
236
212
|
_classPrivateMethodInitSpec(this, _onBeforeCopy);
|
237
213
|
/**
|
238
214
|
* Allows to control which header DOM element will be used to highlight.
|
239
215
|
*
|
240
|
-
* @private
|
241
216
|
* @param {number} visualColumn A visual column index of the highlighted row header.
|
242
217
|
* @param {number} headerLevel A row header level that is currently highlighted.
|
243
218
|
* @param {object} highlightMeta An object with meta data that describes the highlight state.
|
@@ -249,7 +224,6 @@ export class NestedHeaders extends BasePlugin {
|
|
249
224
|
* is scrolled to the correct column for the nested header the most left and the most right visual column
|
250
225
|
* indexes are used.
|
251
226
|
*
|
252
|
-
* @private
|
253
227
|
* @param {number} visualColumn A visual column index to which the viewport will be scrolled.
|
254
228
|
* @returns {number}
|
255
229
|
*/
|
@@ -257,8 +231,6 @@ export class NestedHeaders extends BasePlugin {
|
|
257
231
|
/**
|
258
232
|
* Updates the selection focus highlight position to point to the nested header root element (TH)
|
259
233
|
* even when the logical coordinates point in-between the header.
|
260
|
-
*
|
261
|
-
* @private
|
262
234
|
*/
|
263
235
|
_classPrivateMethodInitSpec(this, _updateFocusHighlightPosition);
|
264
236
|
/**
|
@@ -749,60 +721,42 @@ function _onBeforeHighlightingColumnHeader2(visualColumn, headerLevel, highlight
|
|
749
721
|
}
|
750
722
|
return visualColumn;
|
751
723
|
}
|
752
|
-
function _onBeforeCopy2(
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
const
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
});
|
785
|
-
} else {
|
786
|
-
headersForLevel.push(label);
|
724
|
+
function _onBeforeCopy2(data, copyableRanges, _ref2) {
|
725
|
+
let {
|
726
|
+
columnHeadersCount
|
727
|
+
} = _ref2;
|
728
|
+
if (columnHeadersCount === 0) {
|
729
|
+
return;
|
730
|
+
}
|
731
|
+
for (let rangeIndex = 0; rangeIndex < copyableRanges.length; rangeIndex++) {
|
732
|
+
const {
|
733
|
+
startRow,
|
734
|
+
startCol,
|
735
|
+
endRow,
|
736
|
+
endCol
|
737
|
+
} = copyableRanges[rangeIndex];
|
738
|
+
const rowsCount = endRow - startRow + 1;
|
739
|
+
const columnsCount = startCol - endCol + 1;
|
740
|
+
|
741
|
+
// do not process dataset ranges and column headers where only one column is copied
|
742
|
+
if (startRow >= 0 || columnsCount === 1) {
|
743
|
+
break;
|
744
|
+
}
|
745
|
+
for (let column = startCol; column <= endCol; column++) {
|
746
|
+
for (let row = startRow; row <= endRow; row++) {
|
747
|
+
var _classPrivateFieldGet4;
|
748
|
+
const zeroBasedColumnHeaderLevel = rowsCount + row;
|
749
|
+
const zeroBasedColumnIndex = column - startCol;
|
750
|
+
if (zeroBasedColumnIndex === 0) {
|
751
|
+
continue; // eslint-disable-line no-continue
|
752
|
+
}
|
753
|
+
const isRoot = (_classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.isRoot;
|
754
|
+
if (isRoot === false) {
|
755
|
+
data[zeroBasedColumnHeaderLevel][zeroBasedColumnIndex] = '';
|
787
756
|
}
|
788
|
-
} else if (isPlaceholder === false) {
|
789
|
-
const {
|
790
|
-
label,
|
791
|
-
origColspan: colspan,
|
792
|
-
columnIndex
|
793
|
-
} = headerTreeNodeData;
|
794
|
-
const columnFromStart = column - columnIndex;
|
795
|
-
const reducedColspan = Math.min(colspan - columnFromStart, columnsToEnd);
|
796
|
-
headersForLevel.push(reducedColspan > 1 ? {
|
797
|
-
label,
|
798
|
-
colspan: reducedColspan
|
799
|
-
} : label);
|
800
757
|
}
|
801
|
-
}
|
802
|
-
|
803
|
-
});
|
804
|
-
clipboardData.setMetaInfo('colHeaders', null);
|
805
|
-
clipboardData.setMetaInfo('nestedHeaders', nestedHeaders);
|
758
|
+
}
|
759
|
+
}
|
806
760
|
}
|
807
761
|
function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
808
762
|
const headerNodeData = this._getHeaderTreeNodeDataByCoords(coords);
|
@@ -1005,10 +959,10 @@ function _onModifyColWidth2(width, column) {
|
|
1005
959
|
return width > cachedWidth ? width : cachedWidth;
|
1006
960
|
}
|
1007
961
|
function _onModifyColumnHeaderValue2(value, visualColumnIndex, headerLevel) {
|
1008
|
-
var
|
962
|
+
var _classPrivateFieldGet5;
|
1009
963
|
const {
|
1010
964
|
label
|
1011
|
-
} = (
|
965
|
+
} = (_classPrivateFieldGet5 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet5 !== void 0 ? _classPrivateFieldGet5 : {
|
1012
966
|
label: ''
|
1013
967
|
};
|
1014
968
|
return label;
|
@@ -396,7 +396,6 @@ UndoRedo.CreateRowAction.prototype.undo = function (instance, undoneCallback) {
|
|
396
396
|
if (this.index >= rowCount && this.index - minSpareRows < rowCount) {
|
397
397
|
this.index -= minSpareRows; // work around the situation where the needed row was removed due to an 'undo' of a made change
|
398
398
|
}
|
399
|
-
|
400
399
|
instance.addHookOnce('afterRemoveRow', undoneCallback);
|
401
400
|
instance.alter('remove_row', this.index, this.amount, 'UndoRedo.undo');
|
402
401
|
};
|
@@ -716,7 +715,6 @@ UndoRedo.prototype.registerShortcuts = function () {
|
|
716
715
|
const runOnlyIf = event => {
|
717
716
|
return !event.altKey; // right ALT in some systems triggers ALT+CTR
|
718
717
|
};
|
719
|
-
|
720
718
|
const config = {
|
721
719
|
runOnlyIf,
|
722
720
|
group: SHORTCUTS_GROUP
|
@@ -392,7 +392,6 @@ UndoRedo.CreateRowAction.prototype.undo = function (instance, undoneCallback) {
|
|
392
392
|
if (this.index >= rowCount && this.index - minSpareRows < rowCount) {
|
393
393
|
this.index -= minSpareRows; // work around the situation where the needed row was removed due to an 'undo' of a made change
|
394
394
|
}
|
395
|
-
|
396
395
|
instance.addHookOnce('afterRemoveRow', undoneCallback);
|
397
396
|
instance.alter('remove_row', this.index, this.amount, 'UndoRedo.undo');
|
398
397
|
};
|
@@ -712,7 +711,6 @@ UndoRedo.prototype.registerShortcuts = function () {
|
|
712
711
|
const runOnlyIf = event => {
|
713
712
|
return !event.altKey; // right ALT in some systems triggers ALT+CTR
|
714
713
|
};
|
715
|
-
|
716
714
|
const config = {
|
717
715
|
runOnlyIf,
|
718
716
|
group: SHORTCUTS_GROUP
|
@@ -41,7 +41,6 @@ function autocompleteRenderer(hotInstance, TD, row, col, prop, value, cellProper
|
|
41
41
|
TD.appendChild(rootDocument.createTextNode(String.fromCharCode(160))); // workaround for https://github.com/handsontable/handsontable/issues/1946
|
42
42
|
// this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips
|
43
43
|
}
|
44
|
-
|
45
44
|
TD.insertBefore(ARROW, TD.firstChild);
|
46
45
|
(0, _element.addClass)(TD, 'htAutocomplete');
|
47
46
|
if (!hotInstance.acArrowListener) {
|
@@ -36,7 +36,6 @@ export function autocompleteRenderer(hotInstance, TD, row, col, prop, value, cel
|
|
36
36
|
TD.appendChild(rootDocument.createTextNode(String.fromCharCode(160))); // workaround for https://github.com/handsontable/handsontable/issues/1946
|
37
37
|
// this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips
|
38
38
|
}
|
39
|
-
|
40
39
|
TD.insertBefore(ARROW, TD.firstChild);
|
41
40
|
addClass(TD, 'htAutocomplete');
|
42
41
|
if (!hotInstance.acArrowListener) {
|
@@ -153,7 +153,6 @@ function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellProperties
|
|
153
153
|
changeSelectedCheckboxesState();
|
154
154
|
return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
|
155
155
|
},
|
156
|
-
|
157
156
|
runOnlyIf: () => hotInstance.getSettings().enterBeginsEditing
|
158
157
|
}, {
|
159
158
|
keys: [['delete'], ['backspace']],
|
@@ -161,7 +160,6 @@ function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellProperties
|
|
161
160
|
changeSelectedCheckboxesState(true);
|
162
161
|
return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
|
163
162
|
},
|
164
|
-
|
165
163
|
relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
|
166
164
|
position: 'before'
|
167
165
|
}], config);
|
@@ -148,7 +148,6 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
|
|
148
148
|
changeSelectedCheckboxesState();
|
149
149
|
return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
|
150
150
|
},
|
151
|
-
|
152
151
|
runOnlyIf: () => hotInstance.getSettings().enterBeginsEditing
|
153
152
|
}, {
|
154
153
|
keys: [['delete'], ['backspace']],
|
@@ -156,7 +155,6 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
|
|
156
155
|
changeSelectedCheckboxesState(true);
|
157
156
|
return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
|
158
157
|
},
|
159
|
-
|
160
158
|
relativeToGroup: SHORTCUTS_GROUP_EDITOR,
|
161
159
|
position: 'before'
|
162
160
|
}], config);
|
@@ -178,7 +178,6 @@ class Highlight {
|
|
178
178
|
if (highlightType === _src.HIGHLIGHT_FOCUS_TYPE) {
|
179
179
|
type = 'current'; // One from settings for `disableVisualSelection` up to Handsontable 0.36/Handsontable Pro 1.16.0.
|
180
180
|
}
|
181
|
-
|
182
181
|
let disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);
|
183
182
|
if (typeof disableHighlight === 'string') {
|
184
183
|
disableHighlight = [disableHighlight];
|
@@ -169,7 +169,6 @@ class Highlight {
|
|
169
169
|
if (highlightType === HIGHLIGHT_FOCUS_TYPE) {
|
170
170
|
type = 'current'; // One from settings for `disableVisualSelection` up to Handsontable 0.36/Handsontable Pro 1.16.0.
|
171
171
|
}
|
172
|
-
|
173
172
|
let disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);
|
174
173
|
if (typeof disableHighlight === 'string') {
|
175
174
|
disableHighlight = [disableHighlight];
|
package/selection/index.js
CHANGED
@@ -5,8 +5,7 @@ var _exportNames = {
|
|
5
5
|
Selection: true,
|
6
6
|
handleMouseEvent: true,
|
7
7
|
detectSelectionType: true,
|
8
|
-
normalizeSelectionFactory: true
|
9
|
-
transformRangeLikeToIndexes: true
|
8
|
+
normalizeSelectionFactory: true
|
10
9
|
};
|
11
10
|
var _selection = _interopRequireDefault(require("./selection"));
|
12
11
|
exports.Selection = _selection.default;
|
@@ -15,7 +14,6 @@ exports.handleMouseEvent = _mouseEventHandler.handleMouseEvent;
|
|
15
14
|
var _utils = require("./utils");
|
16
15
|
exports.detectSelectionType = _utils.detectSelectionType;
|
17
16
|
exports.normalizeSelectionFactory = _utils.normalizeSelectionFactory;
|
18
|
-
exports.transformRangeLikeToIndexes = _utils.transformRangeLikeToIndexes;
|
19
17
|
var _highlight = require("./highlight/highlight");
|
20
18
|
Object.keys(_highlight).forEach(function (key) {
|
21
19
|
if (key === "default" || key === "__esModule") return;
|
package/selection/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import Selection from "./selection.mjs";
|
2
2
|
import { handleMouseEvent } from "./mouseEventHandler.mjs";
|
3
|
-
import { detectSelectionType, normalizeSelectionFactory
|
3
|
+
import { detectSelectionType, normalizeSelectionFactory } from "./utils.mjs";
|
4
4
|
export * from "./highlight/highlight.mjs";
|
5
|
-
export { handleMouseEvent, Selection, detectSelectionType, normalizeSelectionFactory
|
5
|
+
export { handleMouseEvent, Selection, detectSelectionType, normalizeSelectionFactory };
|
package/selection/utils.js
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.detectSelectionType = detectSelectionType;
|
5
5
|
exports.normalizeSelectionFactory = normalizeSelectionFactory;
|
6
|
-
exports.transformRangeLikeToIndexes = transformRangeLikeToIndexes;
|
7
6
|
exports.transformSelectionToColumnDistance = transformSelectionToColumnDistance;
|
8
7
|
exports.transformSelectionToRowDistance = transformSelectionToRowDistance;
|
9
8
|
require("core-js/modules/es.error.cause.js");
|
@@ -11,7 +10,6 @@ require("core-js/modules/es.array.push.js");
|
|
11
10
|
var _src = require("./../3rdparty/walkontable/src");
|
12
11
|
var _array = require("./../helpers/array");
|
13
12
|
var _mixed = require("./../helpers/mixed");
|
14
|
-
var _number = require("../helpers/number");
|
15
13
|
const SELECTION_TYPE_UNRECOGNIZED = exports.SELECTION_TYPE_UNRECOGNIZED = 0;
|
16
14
|
const SELECTION_TYPE_EMPTY = exports.SELECTION_TYPE_EMPTY = 1;
|
17
15
|
const SELECTION_TYPE_ARRAY = exports.SELECTION_TYPE_ARRAY = 2;
|
@@ -217,36 +215,4 @@ function transformSelectionToRowDistance(hotInstance) {
|
|
217
215
|
return acc;
|
218
216
|
}, []);
|
219
217
|
return normalizedRowRanges;
|
220
|
-
}
|
221
|
-
|
222
|
-
/**
|
223
|
-
* Returns an object with `rows` and `columns` keys. The arrays contains sorted indexes
|
224
|
-
* generated according to the given `ranges` array.
|
225
|
-
*
|
226
|
-
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges The range to process.
|
227
|
-
* @returns {{rows: number[], columns: number[]}}
|
228
|
-
*/
|
229
|
-
function transformRangeLikeToIndexes(ranges) {
|
230
|
-
const rows = [];
|
231
|
-
const columns = [];
|
232
|
-
(0, _array.arrayEach)(ranges, range => {
|
233
|
-
const minRow = Math.min(range.startRow, range.endRow);
|
234
|
-
const maxRow = Math.max(range.startRow, range.endRow);
|
235
|
-
(0, _number.rangeEach)(minRow, maxRow, row => {
|
236
|
-
if (rows.indexOf(row) === -1) {
|
237
|
-
rows.push(row);
|
238
|
-
}
|
239
|
-
});
|
240
|
-
const minColumn = Math.min(range.startCol, range.endCol);
|
241
|
-
const maxColumn = Math.max(range.startCol, range.endCol);
|
242
|
-
(0, _number.rangeEach)(minColumn, maxColumn, column => {
|
243
|
-
if (columns.indexOf(column) === -1) {
|
244
|
-
columns.push(column);
|
245
|
-
}
|
246
|
-
});
|
247
|
-
});
|
248
|
-
return {
|
249
|
-
rows,
|
250
|
-
columns
|
251
|
-
};
|
252
218
|
}
|
package/selection/utils.mjs
CHANGED
@@ -3,7 +3,6 @@ import "core-js/modules/es.array.push.js";
|
|
3
3
|
import { CellRange } from "./../3rdparty/walkontable/src/index.mjs";
|
4
4
|
import { arrayEach, arrayReduce } from "./../helpers/array.mjs";
|
5
5
|
import { isUndefined } from "./../helpers/mixed.mjs";
|
6
|
-
import { rangeEach } from "../helpers/number.mjs";
|
7
6
|
export const SELECTION_TYPE_UNRECOGNIZED = 0;
|
8
7
|
export const SELECTION_TYPE_EMPTY = 1;
|
9
8
|
export const SELECTION_TYPE_ARRAY = 2;
|
@@ -209,36 +208,4 @@ export function transformSelectionToRowDistance(hotInstance) {
|
|
209
208
|
return acc;
|
210
209
|
}, []);
|
211
210
|
return normalizedRowRanges;
|
212
|
-
}
|
213
|
-
|
214
|
-
/**
|
215
|
-
* Returns an object with `rows` and `columns` keys. The arrays contains sorted indexes
|
216
|
-
* generated according to the given `ranges` array.
|
217
|
-
*
|
218
|
-
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges The range to process.
|
219
|
-
* @returns {{rows: number[], columns: number[]}}
|
220
|
-
*/
|
221
|
-
export function transformRangeLikeToIndexes(ranges) {
|
222
|
-
const rows = [];
|
223
|
-
const columns = [];
|
224
|
-
arrayEach(ranges, range => {
|
225
|
-
const minRow = Math.min(range.startRow, range.endRow);
|
226
|
-
const maxRow = Math.max(range.startRow, range.endRow);
|
227
|
-
rangeEach(minRow, maxRow, row => {
|
228
|
-
if (rows.indexOf(row) === -1) {
|
229
|
-
rows.push(row);
|
230
|
-
}
|
231
|
-
});
|
232
|
-
const minColumn = Math.min(range.startCol, range.endCol);
|
233
|
-
const maxColumn = Math.max(range.startCol, range.endCol);
|
234
|
-
rangeEach(minColumn, maxColumn, column => {
|
235
|
-
if (columns.indexOf(column) === -1) {
|
236
|
-
columns.push(column);
|
237
|
-
}
|
238
|
-
});
|
239
|
-
});
|
240
|
-
return {
|
241
|
-
rows,
|
242
|
-
columns
|
243
|
-
};
|
244
211
|
}
|
package/settings.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { PikadayOptions } from 'pikaday';
|
1
|
+
import { PikadayOptions } from '@handsontable/pikaday';
|
2
2
|
import Core from './core';
|
3
3
|
import { Events } from './pluginHooks';
|
4
4
|
import {
|
@@ -181,6 +181,7 @@ export interface GridSettings extends Events {
|
|
181
181
|
preventWheel?: boolean;
|
182
182
|
readOnly?: boolean;
|
183
183
|
readOnlyCellClassName?: string;
|
184
|
+
renderAllColumns?: boolean;
|
184
185
|
renderAllRows?: boolean;
|
185
186
|
renderer?: RendererType | string | BaseRenderer;
|
186
187
|
rowHeaders?: boolean | string[] | ((index: number) => string);
|
package/tableView.js
CHANGED
@@ -280,7 +280,6 @@ class TableView {
|
|
280
280
|
if (originalStyle) {
|
281
281
|
rootElement.setAttribute('data-originalstyle', originalStyle); // needed to retrieve original style in jsFiddle link generator in HT examples. may be removed in future versions
|
282
282
|
}
|
283
|
-
|
284
283
|
(0, _element.addClass)(rootElement, 'handsontable');
|
285
284
|
_classPrivateFieldSet(this, _table, rootDocument.createElement('TABLE'));
|
286
285
|
(0, _element.addClass)(_classPrivateFieldGet(this, _table), 'htCore');
|
@@ -322,7 +321,6 @@ class TableView {
|
|
322
321
|
rootWindow.focus(); // make sure that window that contains HOT is active. Important when HOT is in iframe.
|
323
322
|
}
|
324
323
|
});
|
325
|
-
|
326
324
|
this.eventManager.addEventListener(rootElement, 'mouseup', () => {
|
327
325
|
_classPrivateFieldSet(this, _selectionMouseDown, false);
|
328
326
|
});
|
@@ -670,6 +668,7 @@ class TableView {
|
|
670
668
|
},
|
671
669
|
minSpareRows: () => this.settings.minSpareRows,
|
672
670
|
renderAllRows: this.settings.renderAllRows,
|
671
|
+
renderAllColumns: this.settings.renderAllColumns,
|
673
672
|
rowHeaders: () => {
|
674
673
|
const headerRenderers = [];
|
675
674
|
if (this.hot.hasRowHeaders()) {
|
package/tableView.mjs
CHANGED
@@ -276,7 +276,6 @@ class TableView {
|
|
276
276
|
if (originalStyle) {
|
277
277
|
rootElement.setAttribute('data-originalstyle', originalStyle); // needed to retrieve original style in jsFiddle link generator in HT examples. may be removed in future versions
|
278
278
|
}
|
279
|
-
|
280
279
|
addClass(rootElement, 'handsontable');
|
281
280
|
_classPrivateFieldSet(this, _table, rootDocument.createElement('TABLE'));
|
282
281
|
addClass(_classPrivateFieldGet(this, _table), 'htCore');
|
@@ -318,7 +317,6 @@ class TableView {
|
|
318
317
|
rootWindow.focus(); // make sure that window that contains HOT is active. Important when HOT is in iframe.
|
319
318
|
}
|
320
319
|
});
|
321
|
-
|
322
320
|
this.eventManager.addEventListener(rootElement, 'mouseup', () => {
|
323
321
|
_classPrivateFieldSet(this, _selectionMouseDown, false);
|
324
322
|
});
|
@@ -666,6 +664,7 @@ class TableView {
|
|
666
664
|
},
|
667
665
|
minSpareRows: () => this.settings.minSpareRows,
|
668
666
|
renderAllRows: this.settings.renderAllRows,
|
667
|
+
renderAllColumns: this.settings.renderAllColumns,
|
669
668
|
rowHeaders: () => {
|
670
669
|
const headerRenderers = [];
|
671
670
|
if (this.hot.hasRowHeaders()) {
|
@@ -17,7 +17,8 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
17
17
|
* A set of deprecated feature names.
|
18
18
|
*
|
19
19
|
* @type {Set<string>}
|
20
|
-
*/
|
20
|
+
*/
|
21
|
+
// eslint-disable-next-line no-unused-vars
|
21
22
|
const deprecationWarns = new Set();
|
22
23
|
|
23
24
|
/**
|