handsontable 15.3.0-next-175012b-20250429 → 16.0.0-next-f486b48-20250702
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/core/_base.js +0 -3
- package/3rdparty/walkontable/src/core/_base.mjs +0 -3
- package/3rdparty/walkontable/src/core/clone.js +0 -1
- package/3rdparty/walkontable/src/core/clone.mjs +0 -1
- 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 -3
- package/3rdparty/walkontable/src/facade/core.mjs +0 -3
- package/3rdparty/walkontable/src/index.js +1 -2
- package/3rdparty/walkontable/src/overlay/_base.js +1 -3
- package/3rdparty/walkontable/src/overlay/_base.mjs +1 -3
- package/3rdparty/walkontable/src/overlay/bottom.js +2 -2
- package/3rdparty/walkontable/src/overlay/bottom.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/top.js +1 -1
- package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +1 -1
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +2 -2
- package/3rdparty/walkontable/src/selection/border/border.js +17 -11
- package/3rdparty/walkontable/src/selection/border/border.mjs +17 -11
- package/3rdparty/walkontable/src/selection/border/utils.js +1 -1
- package/3rdparty/walkontable/src/selection/border/utils.mjs +1 -1
- package/3rdparty/walkontable/src/settings.js +3 -1
- package/3rdparty/walkontable/src/settings.mjs +3 -1
- package/3rdparty/walkontable/src/table.js +9 -6
- package/3rdparty/walkontable/src/table.mjs +9 -6
- package/3rdparty/walkontable/src/types.js +0 -1
- package/3rdparty/walkontable/src/types.mjs +0 -1
- package/3rdparty/walkontable/src/utils/column.js +1 -1
- package/3rdparty/walkontable/src/utils/column.mjs +1 -1
- package/3rdparty/walkontable/src/viewport.js +1 -1
- package/3rdparty/walkontable/src/viewport.mjs +1 -1
- package/CHANGELOG.md +23 -0
- package/README.md +10 -4
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/registry.js +2 -3
- package/cellTypes/registry.mjs +1 -1
- package/core/coordsMapper/rangeToRenderableMapper.js +124 -0
- package/core/coordsMapper/rangeToRenderableMapper.mjs +120 -0
- package/core/focusCatcher/focusDetector.js +2 -2
- package/core/focusCatcher/focusDetector.mjs +2 -2
- package/core/hooks/constants.js +259 -1
- package/core/hooks/constants.mjs +259 -1
- package/core.d.ts +2 -0
- package/core.js +202 -58
- package/core.mjs +202 -58
- package/dataMap/dataMap.js +16 -30
- package/dataMap/dataMap.mjs +16 -30
- package/dataMap/metaManager/metaSchema.js +58 -0
- package/dataMap/metaManager/metaSchema.mjs +58 -0
- package/dist/handsontable.css +30 -4
- package/dist/handsontable.full.css +30 -4
- package/dist/handsontable.full.js +6073 -4352
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +206 -206
- package/dist/handsontable.js +5751 -4037
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +41 -41
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fa-IR.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +5 -1
- package/editorManager.mjs +5 -1
- package/editors/autocompleteEditor/autocompleteEditor.d.ts +0 -12
- package/editors/autocompleteEditor/autocompleteEditor.js +42 -69
- package/editors/autocompleteEditor/autocompleteEditor.mjs +43 -70
- package/editors/baseEditor/baseEditor.js +1 -1
- package/editors/baseEditor/baseEditor.mjs +1 -1
- package/editors/dateEditor/dateEditor.js +2 -8
- package/editors/dateEditor/dateEditor.mjs +3 -9
- package/editors/handsontableEditor/handsontableEditor.d.ts +8 -0
- package/editors/handsontableEditor/handsontableEditor.js +173 -17
- package/editors/handsontableEditor/handsontableEditor.mjs +173 -17
- package/editors/passwordEditor/passwordEditor.js +2 -0
- package/editors/passwordEditor/passwordEditor.mjs +2 -0
- package/editors/registry.js +2 -3
- package/editors/registry.mjs +1 -1
- package/editors/textEditor/textEditor.js +2 -0
- package/editors/textEditor/textEditor.mjs +2 -0
- package/helpers/a11y.js +2 -0
- package/helpers/a11y.mjs +1 -0
- package/helpers/dom/element.d.ts +1 -0
- package/helpers/dom/element.js +26 -1
- package/helpers/dom/element.mjs +25 -1
- package/helpers/mixed.js +4 -4
- package/helpers/mixed.mjs +4 -4
- package/i18n/languages/ar-AR.js +1 -2
- package/i18n/languages/cs-CZ.js +1 -2
- package/i18n/languages/de-CH.js +1 -2
- package/i18n/languages/de-DE.js +1 -2
- package/i18n/languages/en-US.js +1 -2
- package/i18n/languages/es-MX.js +1 -2
- package/i18n/languages/fa-IR.js +1 -2
- package/i18n/languages/fr-FR.js +1 -2
- package/i18n/languages/hr-HR.js +1 -2
- package/i18n/languages/it-IT.js +1 -2
- package/i18n/languages/ja-JP.js +1 -2
- package/i18n/languages/ko-KR.js +1 -2
- package/i18n/languages/lv-LV.js +1 -2
- package/i18n/languages/nb-NO.js +1 -2
- package/i18n/languages/nl-NL.js +1 -2
- package/i18n/languages/pl-PL.js +1 -2
- package/i18n/languages/pt-BR.js +1 -2
- package/i18n/languages/ru-RU.js +1 -2
- package/i18n/languages/sr-SP.js +1 -2
- package/i18n/languages/zh-CN.js +1 -2
- package/i18n/languages/zh-TW.js +1 -2
- package/i18n/phraseFormatters/index.js +2 -2
- package/i18n/phraseFormatters/index.mjs +1 -1
- package/i18n/registry.js +3 -4
- package/i18n/registry.mjs +1 -1
- package/index.js +1 -2
- package/package.json +10 -4
- package/plugins/autoColumnSize/autoColumnSize.js +47 -0
- package/plugins/autoColumnSize/autoColumnSize.mjs +47 -0
- package/plugins/autoRowSize/autoRowSize.js +45 -0
- package/plugins/autoRowSize/autoRowSize.mjs +45 -0
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +13 -0
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +13 -0
- package/plugins/collapsibleColumns/collapsibleColumns.js +31 -0
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +31 -0
- package/plugins/columnSorting/sortService/registry.js +3 -4
- package/plugins/columnSorting/sortService/registry.mjs +1 -1
- package/plugins/columnSummary/columnSummary.js +33 -0
- package/plugins/columnSummary/columnSummary.mjs +33 -0
- package/plugins/comments/commentEditor.js +8 -2
- package/plugins/comments/commentEditor.mjs +8 -2
- package/plugins/comments/comments.js +59 -15
- package/plugins/comments/comments.mjs +60 -16
- package/plugins/comments/contextMenuItem/addEditComment.js +1 -2
- package/plugins/comments/contextMenuItem/readOnlyComment.js +1 -2
- package/plugins/comments/contextMenuItem/removeComment.js +1 -2
- package/plugins/contextMenu/contextMenu.js +1 -1
- package/plugins/contextMenu/contextMenu.mjs +1 -1
- package/plugins/contextMenu/menu/menu.js +12 -6
- package/plugins/contextMenu/menu/menu.mjs +13 -7
- package/plugins/contextMenu/predefinedItems/alignment.js +1 -2
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -2
- package/plugins/contextMenu/predefinedItems/columnLeft.js +1 -2
- package/plugins/contextMenu/predefinedItems/columnRight.js +1 -2
- package/plugins/contextMenu/predefinedItems/index.js +1 -2
- package/plugins/contextMenu/predefinedItems/readOnly.js +1 -2
- package/plugins/contextMenu/predefinedItems/redo.js +1 -2
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -2
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -2
- package/plugins/contextMenu/predefinedItems/rowAbove.js +1 -2
- package/plugins/contextMenu/predefinedItems/rowBelow.js +1 -2
- package/plugins/contextMenu/predefinedItems/undo.js +1 -2
- package/plugins/copyPaste/contextMenuItem/cut.js +1 -2
- package/plugins/customBorders/contextMenuItem/bottom.js +1 -2
- package/plugins/customBorders/contextMenuItem/left.js +1 -2
- package/plugins/customBorders/contextMenuItem/noBorders.js +1 -2
- package/plugins/customBorders/contextMenuItem/right.js +1 -2
- package/plugins/customBorders/contextMenuItem/top.js +1 -2
- package/plugins/customBorders/customBorders.js +1 -2
- package/plugins/dropdownMenu/dropdownMenu.js +16 -1
- package/plugins/dropdownMenu/dropdownMenu.mjs +16 -1
- package/plugins/exportFile/exportFile.js +59 -2
- package/plugins/exportFile/exportFile.mjs +58 -0
- package/plugins/filters/component/actionBar.js +1 -2
- package/plugins/filters/component/condition.js +1 -2
- package/plugins/filters/component/value.js +1 -2
- package/plugins/filters/condition/beginsWith.js +1 -2
- package/plugins/filters/condition/between.js +1 -2
- package/plugins/filters/condition/contains.js +1 -2
- package/plugins/filters/condition/date/after.js +1 -2
- package/plugins/filters/condition/date/before.js +1 -2
- package/plugins/filters/condition/date/today.js +1 -2
- package/plugins/filters/condition/date/tomorrow.js +1 -2
- package/plugins/filters/condition/date/yesterday.js +1 -2
- package/plugins/filters/condition/empty.js +1 -2
- package/plugins/filters/condition/endsWith.js +1 -2
- package/plugins/filters/condition/equal.js +1 -2
- package/plugins/filters/condition/greaterThan.js +1 -2
- package/plugins/filters/condition/greaterThanOrEqual.js +1 -2
- package/plugins/filters/condition/lessThan.js +1 -2
- package/plugins/filters/condition/lessThanOrEqual.js +1 -2
- package/plugins/filters/condition/none.js +1 -2
- package/plugins/filters/condition/notBetween.js +1 -2
- package/plugins/filters/condition/notContains.js +1 -2
- package/plugins/filters/condition/notEmpty.js +1 -2
- package/plugins/filters/condition/notEqual.js +1 -2
- package/plugins/filters/filters.js +76 -3
- package/plugins/filters/filters.mjs +75 -1
- package/plugins/filters/logicalOperations/conjunction.js +1 -2
- package/plugins/filters/logicalOperations/disjunction.js +1 -2
- package/plugins/filters/logicalOperations/disjunctionWithExtraCondition.js +1 -2
- package/plugins/filters/ui/_base.js +1 -2
- package/plugins/filters/ui/multipleSelect.js +1 -7
- package/plugins/filters/ui/multipleSelect.mjs +0 -5
- package/plugins/filters/ui/select.js +1 -2
- package/plugins/formulas/engine/register.js +3 -4
- package/plugins/formulas/engine/register.mjs +1 -1
- package/plugins/formulas/formulas.js +40 -41
- package/plugins/formulas/formulas.mjs +39 -40
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -2
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +1 -2
- package/plugins/hiddenColumns/hiddenColumns.js +64 -0
- package/plugins/hiddenColumns/hiddenColumns.mjs +64 -0
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -2
- package/plugins/hiddenRows/contextMenuItem/showRow.js +1 -2
- package/plugins/hiddenRows/hiddenRows.js +64 -0
- package/plugins/hiddenRows/hiddenRows.mjs +64 -0
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -2
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -2
- package/plugins/manualRowMove/manualRowMove.js +1 -1
- package/plugins/manualRowMove/manualRowMove.mjs +1 -1
- package/plugins/manualRowResize/manualRowResize.js +1 -1
- package/plugins/manualRowResize/manualRowResize.mjs +1 -1
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -2
- package/plugins/mergeCells/mergeCells.js +56 -38
- package/plugins/mergeCells/mergeCells.mjs +56 -38
- package/plugins/mergeCells/utils.js +3 -4
- package/plugins/mergeCells/utils.mjs +3 -4
- package/plugins/nestedHeaders/nestedHeaders.js +37 -12
- package/plugins/nestedHeaders/nestedHeaders.mjs +37 -12
- package/plugins/nestedRows/nestedRows.js +12 -12
- package/plugins/nestedRows/nestedRows.mjs +12 -12
- package/plugins/nestedRows/ui/contextMenu.js +1 -2
- package/plugins/nestedRows/ui/headers.js +2 -3
- package/plugins/nestedRows/ui/headers.mjs +2 -3
- package/plugins/persistentState/persistentState.js +1 -1
- package/plugins/persistentState/persistentState.mjs +1 -1
- package/plugins/stretchColumns/calculator.js +3 -2
- package/plugins/stretchColumns/calculator.mjs +3 -2
- package/plugins/stretchColumns/stretchColumns.js +13 -0
- package/plugins/stretchColumns/stretchColumns.mjs +13 -0
- package/plugins/trimRows/trimRows.js +61 -0
- package/plugins/trimRows/trimRows.mjs +61 -0
- package/renderers/baseRenderer/baseRenderer.js +4 -0
- package/renderers/baseRenderer/baseRenderer.mjs +4 -0
- package/renderers/registry.js +2 -3
- package/renderers/registry.mjs +1 -1
- package/selection/mouseEventHandler.js +48 -13
- package/selection/mouseEventHandler.mjs +47 -13
- package/selection/range.js +73 -6
- package/selection/range.mjs +73 -6
- package/selection/selection.js +46 -32
- package/selection/selection.mjs +45 -30
- package/settings.d.ts +1 -0
- package/styles/handsontable.css +131 -55
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-horizon.css +296 -181
- package/styles/ht-theme-horizon.min.css +3 -3
- package/styles/ht-theme-main.css +314 -205
- package/styles/ht-theme-main.min.css +3 -3
- package/tableView.js +9 -20
- package/tableView.mjs +9 -20
- package/translations/indexMapper.js +9 -5
- package/translations/indexMapper.mjs +9 -5
- package/utils/paginator.js +13 -0
- package/utils/paginator.mjs +13 -0
- package/utils/staticRegister.js +24 -2
- package/utils/staticRegister.mjs +23 -2
- package/{3rdparty/walkontable/src/utils → utils}/stylesHandler.js +16 -30
- package/{3rdparty/walkontable/src/utils → utils}/stylesHandler.mjs +16 -30
- package/validators/registry.js +2 -3
- package/validators/registry.mjs +1 -1
package/core.mjs
CHANGED
@@ -23,6 +23,7 @@ import { deepClone, duckSchema, isObjectEqual, isObject, deepObjectSize, hasOwnP
|
|
23
23
|
import { FocusManager } from "./focusManager.mjs";
|
24
24
|
import { arrayMap, arrayEach, arrayReduce, getDifferenceOfArrays, stringToArray, pivot } from "./helpers/array.mjs";
|
25
25
|
import { instanceToHTML } from "./utils/parseTable.mjs";
|
26
|
+
import { staticRegister } from "./utils/staticRegister.mjs";
|
26
27
|
import { getPlugin, getPluginsNames } from "./plugins/registry.mjs";
|
27
28
|
import { getRenderer } from "./renderers/registry.mjs";
|
28
29
|
import { getEditor } from "./editors/registry.mjs";
|
@@ -45,6 +46,9 @@ import { createUniqueMap } from "./utils/dataStructures/uniqueMap.mjs";
|
|
45
46
|
import { createShortcutManager } from "./shortcuts/index.mjs";
|
46
47
|
import { registerAllShortcutContexts } from "./shortcutContexts/index.mjs";
|
47
48
|
import { getThemeClassName } from "./helpers/themes.mjs";
|
49
|
+
import { StylesHandler } from "./utils/stylesHandler.mjs";
|
50
|
+
import { warn } from "./helpers/console.mjs";
|
51
|
+
import { CellRangeToRenderableMapper } from "./core/coordsMapper/rangeToRenderableMapper.mjs";
|
48
52
|
let activeGuid = null;
|
49
53
|
|
50
54
|
/**
|
@@ -80,6 +84,12 @@ const deprecationWarns = new Set();
|
|
80
84
|
* by using React's `ref` feature (read more on the [Instance methods](@/guides/getting-started/react-methods/react-methods.md) page).
|
81
85
|
* :::
|
82
86
|
*
|
87
|
+
* ::: only-for angular
|
88
|
+
* To use these methods, associate a Handsontable instance with your instance
|
89
|
+
* of the [`HotTable` component](@/guides/getting-started/installation/installation.md#5-use-the-hottable-component),
|
90
|
+
* by using `@ViewChild` decorator (read more on the [Instance access](@/guides/getting-started/angular-hot-instance/angular-hot-instance.md) page).
|
91
|
+
* :::
|
92
|
+
*
|
83
93
|
* ## How to call a method
|
84
94
|
*
|
85
95
|
* ::: only-for javascript
|
@@ -110,11 +120,44 @@ const deprecationWarns = new Set();
|
|
110
120
|
* ```
|
111
121
|
* :::
|
112
122
|
*
|
113
|
-
*
|
123
|
+
* ::: only-for angular
|
124
|
+
* ```ts
|
125
|
+
* import { Component, ViewChild, AfterViewInit } from "@angular/core";
|
126
|
+
* import {
|
127
|
+
* GridSettings,
|
128
|
+
* HotTableComponent,
|
129
|
+
* HotTableModule,
|
130
|
+
* } from "@handsontable/angular-wrapper";
|
131
|
+
*
|
132
|
+
* `@Component`({
|
133
|
+
* standalone: true,
|
134
|
+
* imports: [HotTableModule],
|
135
|
+
* template: ` <div>
|
136
|
+
* <hot-table themeName="ht-theme-main" [settings]="gridSettings" />
|
137
|
+
* </div>`,
|
138
|
+
* })
|
139
|
+
* export class ExampleComponent implements AfterViewInit {
|
140
|
+
* `@ViewChild`(HotTableComponent, { static: false })
|
141
|
+
* readonly hotTable!: HotTableComponent;
|
142
|
+
*
|
143
|
+
* readonly gridSettings = <GridSettings>{
|
144
|
+
* columns: [{}],
|
145
|
+
* };
|
146
|
+
*
|
147
|
+
* ngAfterViewInit(): void {
|
148
|
+
* // Access the Handsontable instance
|
149
|
+
* // Call a method
|
150
|
+
* this.hotTable?.hotInstance?.setDataAtCell(0, 0, "new value");
|
151
|
+
* }
|
152
|
+
* }
|
153
|
+
* ```
|
154
|
+
* :::
|
155
|
+
*
|
156
|
+
* @param {HTMLElement} rootContainer The element to which the Handsontable instance is injected.
|
114
157
|
* @param {object} userSettings The user defined options.
|
115
158
|
* @param {boolean} [rootInstanceSymbol=false] Indicates if the instance is root of all later instances created.
|
116
159
|
*/
|
117
|
-
export default function Core(
|
160
|
+
export default function Core(rootContainer, userSettings) {
|
118
161
|
var _userSettings$layoutD,
|
119
162
|
_this = this;
|
120
163
|
let rootInstanceSymbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
@@ -131,6 +174,30 @@ export default function Core(rootElement, userSettings) {
|
|
131
174
|
registerAsRootInstance(this);
|
132
175
|
}
|
133
176
|
|
177
|
+
/**
|
178
|
+
* Reference to the root container.
|
179
|
+
*
|
180
|
+
* @private
|
181
|
+
* @type {HTMLElement}
|
182
|
+
*/
|
183
|
+
this.rootContainer = rootContainer;
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Reference to the wrapper element.
|
187
|
+
*
|
188
|
+
* @private
|
189
|
+
* @type {HTMLElement}
|
190
|
+
*/
|
191
|
+
this.rootWrapperElement = undefined;
|
192
|
+
|
193
|
+
/**
|
194
|
+
* Reference to the portal element.
|
195
|
+
*
|
196
|
+
* @private
|
197
|
+
* @type {HTMLElement}
|
198
|
+
*/
|
199
|
+
this.rootPortalElement = undefined;
|
200
|
+
|
134
201
|
// TODO: check if references to DOM elements should be move to UI layer (Walkontable)
|
135
202
|
/**
|
136
203
|
* Reference to the container element.
|
@@ -138,14 +205,16 @@ export default function Core(rootElement, userSettings) {
|
|
138
205
|
* @private
|
139
206
|
* @type {HTMLElement}
|
140
207
|
*/
|
141
|
-
this.rootElement =
|
208
|
+
this.rootElement = isRootInstance(this) ? rootContainer.ownerDocument.createElement('div') : rootContainer;
|
209
|
+
|
142
210
|
/**
|
143
211
|
* The nearest document over container.
|
144
212
|
*
|
145
213
|
* @private
|
146
214
|
* @type {Document}
|
147
215
|
*/
|
148
|
-
this.rootDocument =
|
216
|
+
this.rootDocument = rootContainer.ownerDocument;
|
217
|
+
|
149
218
|
/**
|
150
219
|
* Window object over container's document.
|
151
220
|
*
|
@@ -153,6 +222,17 @@ export default function Core(rootElement, userSettings) {
|
|
153
222
|
* @type {Window}
|
154
223
|
*/
|
155
224
|
this.rootWindow = this.rootDocument.defaultView;
|
225
|
+
if (isRootInstance(this)) {
|
226
|
+
this.rootWrapperElement = this.rootDocument.createElement('div');
|
227
|
+
this.rootPortalElement = this.rootDocument.createElement('div');
|
228
|
+
addClass(this.rootElement, 'ht-wrapper');
|
229
|
+
addClass(this.rootWrapperElement, 'ht-root-wrapper');
|
230
|
+
this.rootWrapperElement.appendChild(this.rootElement);
|
231
|
+
this.rootContainer.appendChild(this.rootWrapperElement);
|
232
|
+
addClass(this.rootPortalElement, 'ht-portal');
|
233
|
+
this.rootDocument.body.appendChild(this.rootPortalElement);
|
234
|
+
}
|
235
|
+
|
156
236
|
/**
|
157
237
|
* A boolean to tell if the Handsontable has been fully destroyed. This is set to `true`
|
158
238
|
* after `afterDestroy` hook is called.
|
@@ -162,6 +242,7 @@ export default function Core(rootElement, userSettings) {
|
|
162
242
|
* @type {boolean}
|
163
243
|
*/
|
164
244
|
this.isDestroyed = false;
|
245
|
+
|
165
246
|
/**
|
166
247
|
* The counter determines how many times the render suspending was called. It allows
|
167
248
|
* tracking the nested suspending calls. For each render suspend resuming call the
|
@@ -172,6 +253,7 @@ export default function Core(rootElement, userSettings) {
|
|
172
253
|
* @type {number}
|
173
254
|
*/
|
174
255
|
this.renderSuspendedCounter = 0;
|
256
|
+
|
175
257
|
/**
|
176
258
|
* The counter determines how many times the execution suspending was called. It allows
|
177
259
|
* tracking the nested suspending calls. For each execution suspend resuming call the
|
@@ -221,6 +303,14 @@ export default function Core(rootElement, userSettings) {
|
|
221
303
|
this.getDirectionFactor = function () {
|
222
304
|
return instance.isLtr() ? 1 : -1;
|
223
305
|
};
|
306
|
+
|
307
|
+
/**
|
308
|
+
* Styles handler instance.
|
309
|
+
*
|
310
|
+
* @private
|
311
|
+
* @type {StylesHandler}
|
312
|
+
*/
|
313
|
+
this.stylesHandler = new StylesHandler(instance.rootElement, instance.rootDocument);
|
224
314
|
userSettings.language = getValidLanguageCode(userSettings.language);
|
225
315
|
const settingsWithoutHooks = Object.fromEntries(Object.entries(userSettings).filter(_ref => {
|
226
316
|
let [key] = _ref;
|
@@ -231,10 +321,9 @@ export default function Core(rootElement, userSettings) {
|
|
231
321
|
const globalMeta = metaManager.getGlobalMeta();
|
232
322
|
const pluginsRegistry = createUniqueMap();
|
233
323
|
this.container = this.rootDocument.createElement('div');
|
234
|
-
rootElement.insertBefore(this.container, rootElement.firstChild);
|
324
|
+
this.rootElement.insertBefore(this.container, this.rootElement.firstChild);
|
235
325
|
if (isRootInstance(this)) {
|
236
|
-
_injectProductInfo(userSettings.licenseKey,
|
237
|
-
addClass(rootElement, 'ht-wrapper');
|
326
|
+
_injectProductInfo(userSettings.licenseKey, this.rootWrapperElement);
|
238
327
|
}
|
239
328
|
this.guid = `ht_${randomString()}`; // this is the namespace for global events
|
240
329
|
|
@@ -248,6 +337,7 @@ export default function Core(rootElement, userSettings) {
|
|
248
337
|
* @type {IndexMapper}
|
249
338
|
*/
|
250
339
|
this.columnIndexMapper = new IndexMapper();
|
340
|
+
|
251
341
|
/**
|
252
342
|
* Instance of index mapper which is responsible for managing the row indexes.
|
253
343
|
*
|
@@ -266,6 +356,11 @@ export default function Core(rootElement, userSettings) {
|
|
266
356
|
instance.runHooks('beforeCompositionStart', event);
|
267
357
|
});
|
268
358
|
dataSource = new DataSource(instance);
|
359
|
+
const moduleRegisterer = staticRegister(this.guid);
|
360
|
+
moduleRegisterer.register('cellRangeMapper', new CellRangeToRenderableMapper({
|
361
|
+
rowIndexMapper: this.rowIndexMapper,
|
362
|
+
columnIndexMapper: this.columnIndexMapper
|
363
|
+
}));
|
269
364
|
if (!this.rootElement.id || this.rootElement.id.substring(0, 3) === 'ht_') {
|
270
365
|
this.rootElement.id = this.guid; // if root element does not have an id, assign a random id
|
271
366
|
}
|
@@ -381,11 +476,13 @@ export default function Core(rootElement, userSettings) {
|
|
381
476
|
} else {
|
382
477
|
removeClass(this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);
|
383
478
|
}
|
384
|
-
if (selection.getSelectionSource()
|
479
|
+
if (!['shift', 'refresh'].includes(selection.getSelectionSource())) {
|
385
480
|
editorManager.closeEditor(null);
|
386
481
|
}
|
387
|
-
|
388
|
-
|
482
|
+
if (selection.getSelectionSource() !== 'refresh') {
|
483
|
+
instance.view.render();
|
484
|
+
editorManager.prepareEditor();
|
485
|
+
}
|
389
486
|
});
|
390
487
|
this.selection.addLocalHook('beforeSetFocus', cellCoords => {
|
391
488
|
this.runHooks('beforeSelectionFocusSet', cellCoords.row, cellCoords.col);
|
@@ -408,6 +505,10 @@ export default function Core(rootElement, userSettings) {
|
|
408
505
|
} = cellRanges[selectionLayerLevel];
|
409
506
|
this.runHooks('afterSelectionEnd', from.row, from.col, to.row, to.col, selectionLayerLevel);
|
410
507
|
this.runHooks('afterSelectionEndByProp', from.row, instance.colToProp(from.col), to.row, instance.colToProp(to.col), selectionLayerLevel);
|
508
|
+
if (selection.getSelectionSource() === 'refresh') {
|
509
|
+
instance.view.render();
|
510
|
+
editorManager.prepareEditor();
|
511
|
+
}
|
411
512
|
});
|
412
513
|
this.selection.addLocalHook('afterIsMultipleSelection', isMultiple => {
|
413
514
|
const changedIsMultiple = this.runHooks('afterIsMultipleSelection', isMultiple.value);
|
@@ -467,33 +568,33 @@ export default function Core(rootElement, userSettings) {
|
|
467
568
|
}
|
468
569
|
return _this.runHooks('afterModifyTransformStart', ...args);
|
469
570
|
}).addLocalHook('beforeModifyTransformFocus', function () {
|
470
|
-
for (var
|
471
|
-
args[
|
571
|
+
for (var _len0 = arguments.length, args = new Array(_len0), _key0 = 0; _key0 < _len0; _key0++) {
|
572
|
+
args[_key0] = arguments[_key0];
|
472
573
|
}
|
473
574
|
return _this.runHooks('modifyTransformFocus', ...args);
|
474
575
|
}).addLocalHook('afterModifyTransformFocus', function () {
|
475
|
-
for (var
|
476
|
-
args[
|
576
|
+
for (var _len1 = arguments.length, args = new Array(_len1), _key1 = 0; _key1 < _len1; _key1++) {
|
577
|
+
args[_key1] = arguments[_key1];
|
477
578
|
}
|
478
579
|
return _this.runHooks('afterModifyTransformFocus', ...args);
|
479
580
|
}).addLocalHook('beforeModifyTransformEnd', function () {
|
480
|
-
for (var
|
481
|
-
args[
|
581
|
+
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
582
|
+
args[_key10] = arguments[_key10];
|
482
583
|
}
|
483
584
|
return _this.runHooks('modifyTransformEnd', ...args);
|
484
585
|
}).addLocalHook('afterModifyTransformEnd', function () {
|
485
|
-
for (var
|
486
|
-
args[
|
586
|
+
for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
|
587
|
+
args[_key11] = arguments[_key11];
|
487
588
|
}
|
488
589
|
return _this.runHooks('afterModifyTransformEnd', ...args);
|
489
590
|
}).addLocalHook('beforeRowWrap', function () {
|
490
|
-
for (var
|
491
|
-
args[
|
591
|
+
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
592
|
+
args[_key12] = arguments[_key12];
|
492
593
|
}
|
493
594
|
return _this.runHooks('beforeRowWrap', ...args);
|
494
595
|
}).addLocalHook('beforeColumnWrap', function () {
|
495
|
-
for (var
|
496
|
-
args[
|
596
|
+
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
597
|
+
args[_key13] = arguments[_key13];
|
497
598
|
}
|
498
599
|
return _this.runHooks('beforeColumnWrap', ...args);
|
499
600
|
}).addLocalHook('insertRowRequire', totalRows => this.alter('insert_row_above', totalRows, 1, 'auto')).addLocalHook('insertColRequire', totalCols => this.alter('insert_col_start', totalCols, 1, 'auto'));
|
@@ -639,6 +740,9 @@ export default function Core(rootElement, userSettings) {
|
|
639
740
|
if (totalRows === 0) {
|
640
741
|
selection.deselect();
|
641
742
|
} else if (source === 'ContextMenu.removeRow') {
|
743
|
+
const selectionRange = selection.getSelectedRange();
|
744
|
+
const lastSelection = selectionRange.pop();
|
745
|
+
selectionRange.clear().set(lastSelection.from).current().setTo(lastSelection.to);
|
642
746
|
selection.refresh();
|
643
747
|
} else {
|
644
748
|
selection.shiftRows(groupIndex, -groupAmount);
|
@@ -687,6 +791,9 @@ export default function Core(rootElement, userSettings) {
|
|
687
791
|
if (totalColumns === 0) {
|
688
792
|
selection.deselect();
|
689
793
|
} else if (source === 'ContextMenu.removeColumn') {
|
794
|
+
const selectionRange = selection.getSelectedRange();
|
795
|
+
const lastSelection = selectionRange.pop();
|
796
|
+
selectionRange.clear().set(lastSelection.from).current().setTo(lastSelection.to);
|
690
797
|
selection.refresh();
|
691
798
|
} else {
|
692
799
|
selection.shiftColumns(groupIndex, -groupAmount);
|
@@ -1038,13 +1145,10 @@ export default function Core(rootElement, userSettings) {
|
|
1038
1145
|
}
|
1039
1146
|
this.updateSettings(userSettings, true);
|
1040
1147
|
this.view = new TableView(this);
|
1041
|
-
const themeName = tableMeta.themeName || getThemeClassName(instance.
|
1148
|
+
const themeName = tableMeta.themeName || getThemeClassName(instance.rootContainer);
|
1042
1149
|
|
1043
|
-
// Use the theme defined as a root
|
1150
|
+
// Use the theme defined in the settings object or set as a root container class name (in that order).
|
1044
1151
|
instance.useTheme(themeName);
|
1045
|
-
|
1046
|
-
// Add the theme class name to the license info element.
|
1047
|
-
instance.view.addClassNameToLicenseElement(instance.getCurrentThemeName());
|
1048
1152
|
editorManager = EditorManager.getInstance(instance, tableMeta, selection);
|
1049
1153
|
viewportScroller = createViewportScroller(instance);
|
1050
1154
|
focusManager = new FocusManager(instance);
|
@@ -1587,8 +1691,8 @@ export default function Core(rootElement, userSettings) {
|
|
1587
1691
|
* @returns {Array} Returns removed portion of columns.
|
1588
1692
|
*/
|
1589
1693
|
this.spliceCol = function (column, index, amount) {
|
1590
|
-
for (var
|
1591
|
-
elements[
|
1694
|
+
for (var _len14 = arguments.length, elements = new Array(_len14 > 3 ? _len14 - 3 : 0), _key14 = 3; _key14 < _len14; _key14++) {
|
1695
|
+
elements[_key14 - 3] = arguments[_key14];
|
1592
1696
|
}
|
1593
1697
|
return datamap.spliceCol(column, index, amount, ...elements);
|
1594
1698
|
};
|
@@ -1605,8 +1709,8 @@ export default function Core(rootElement, userSettings) {
|
|
1605
1709
|
* @returns {Array} Returns removed portion of rows.
|
1606
1710
|
*/
|
1607
1711
|
this.spliceRow = function (row, index, amount) {
|
1608
|
-
for (var
|
1609
|
-
elements[
|
1712
|
+
for (var _len15 = arguments.length, elements = new Array(_len15 > 3 ? _len15 - 3 : 0), _key15 = 3; _key15 < _len15; _key15++) {
|
1713
|
+
elements[_key15 - 3] = arguments[_key15];
|
1610
1714
|
}
|
1611
1715
|
return datamap.spliceRow(row, index, amount, ...elements);
|
1612
1716
|
};
|
@@ -2423,17 +2527,9 @@ export default function Core(rootElement, userSettings) {
|
|
2423
2527
|
instance.view._wt.exportSettingsAsClassNames();
|
2424
2528
|
const currentThemeName = instance.getCurrentThemeName();
|
2425
2529
|
const themeNameOptionExists = hasOwnProperty(settings, 'themeName');
|
2426
|
-
if (
|
2427
|
-
instance.
|
2428
|
-
instance.view.removeClassNameFromLicenseElement(currentThemeName);
|
2530
|
+
if (themeNameOptionExists && currentThemeName !== settings.themeName) {
|
2531
|
+
instance.useTheme(settings.themeName);
|
2429
2532
|
}
|
2430
|
-
const themeName = themeNameOptionExists && settings.themeName || getThemeClassName(instance.rootElement);
|
2431
|
-
|
2432
|
-
// Use the theme defined as a root element class or in the settings (in that order).
|
2433
|
-
instance.useTheme(themeName);
|
2434
|
-
|
2435
|
-
// Add the theme class name to the license info element.
|
2436
|
-
instance.view.addClassNameToLicenseElement(instance.getCurrentThemeName());
|
2437
2533
|
}
|
2438
2534
|
instance.runHooks('afterUpdateSettings', settings);
|
2439
2535
|
}
|
@@ -2875,8 +2971,8 @@ export default function Core(rootElement, userSettings) {
|
|
2875
2971
|
changeValue]);
|
2876
2972
|
});
|
2877
2973
|
}
|
2878
|
-
arrayEach(input,
|
2879
|
-
let [changeRow, changeProp, changeValue] =
|
2974
|
+
arrayEach(input, _ref0 => {
|
2975
|
+
let [changeRow, changeProp, changeValue] = _ref0;
|
2880
2976
|
dataSource.setAtCell(changeRow, changeProp, changeValue);
|
2881
2977
|
});
|
2882
2978
|
if (isThereAnySetSourceListener) {
|
@@ -3014,8 +3110,8 @@ export default function Core(rootElement, userSettings) {
|
|
3014
3110
|
*/
|
3015
3111
|
this.spliceCellsMeta = function (visualIndex) {
|
3016
3112
|
let deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
3017
|
-
for (var
|
3018
|
-
cellMetaRows[
|
3113
|
+
for (var _len16 = arguments.length, cellMetaRows = new Array(_len16 > 2 ? _len16 - 2 : 0), _key16 = 2; _key16 < _len16; _key16++) {
|
3114
|
+
cellMetaRows[_key16 - 2] = arguments[_key16];
|
3019
3115
|
}
|
3020
3116
|
if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
|
3021
3117
|
throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
|
@@ -3573,7 +3669,7 @@ export default function Core(rootElement, userSettings) {
|
|
3573
3669
|
* @returns {number}
|
3574
3670
|
*/
|
3575
3671
|
this._getRowHeightFromSettings = function (row) {
|
3576
|
-
const defaultRowHeight =
|
3672
|
+
const defaultRowHeight = instance.stylesHandler.getDefaultRowHeight();
|
3577
3673
|
let height = tableMeta.rowHeights;
|
3578
3674
|
if (height !== undefined && height !== null) {
|
3579
3675
|
switch (typeof height) {
|
@@ -4228,27 +4324,27 @@ export default function Core(rootElement, userSettings) {
|
|
4228
4324
|
}
|
4229
4325
|
dataSource = null;
|
4230
4326
|
this.getShortcutManager().destroy();
|
4327
|
+
moduleRegisterer.clear();
|
4231
4328
|
metaManager.clearCache();
|
4232
4329
|
foreignHotInstances.delete(this.guid);
|
4233
|
-
if (isRootInstance(instance)) {
|
4234
|
-
const licenseInfo = this.rootDocument.querySelector('.hot-display-license-info');
|
4235
|
-
if (licenseInfo) {
|
4236
|
-
licenseInfo.parentNode.removeChild(licenseInfo);
|
4237
|
-
}
|
4238
|
-
}
|
4239
|
-
empty(instance.rootElement);
|
4240
4330
|
eventManager.destroy();
|
4241
4331
|
if (editorManager) {
|
4242
4332
|
editorManager.destroy();
|
4243
4333
|
}
|
4334
|
+
if (instance.rootContainer) {
|
4335
|
+
empty(instance.rootContainer);
|
4336
|
+
}
|
4337
|
+
if (instance.rootPortalElement) {
|
4338
|
+
instance.rootPortalElement.remove();
|
4339
|
+
}
|
4244
4340
|
|
4245
4341
|
// The plugin's `destroy` method is called as a consequence and it should handle
|
4246
4342
|
// unregistration of plugin's maps. Some unregistered maps reset the cache.
|
4247
4343
|
instance.batchExecution(() => {
|
4248
4344
|
instance.rowIndexMapper.unregisterAll();
|
4249
4345
|
instance.columnIndexMapper.unregisterAll();
|
4250
|
-
pluginsRegistry.getItems().forEach(
|
4251
|
-
let [, plugin] =
|
4346
|
+
pluginsRegistry.getItems().forEach(_ref1 => {
|
4347
|
+
let [, plugin] = _ref1;
|
4252
4348
|
plugin.destroy();
|
4253
4349
|
});
|
4254
4350
|
pluginsRegistry.clear();
|
@@ -4649,8 +4745,32 @@ export default function Core(rootElement, userSettings) {
|
|
4649
4745
|
* @param {string|boolean|undefined} themeName The name of the theme to use.
|
4650
4746
|
*/
|
4651
4747
|
this.useTheme = themeName => {
|
4652
|
-
|
4653
|
-
this.
|
4748
|
+
const isFirstRun = !!firstRun;
|
4749
|
+
this.stylesHandler.useTheme(themeName);
|
4750
|
+
const validThemeName = this.stylesHandler.getThemeName();
|
4751
|
+
if (isRootInstance(this)) {
|
4752
|
+
removeClass(this.rootWrapperElement, /ht-theme-.*/g);
|
4753
|
+
removeClass(this.rootPortalElement, /ht-theme-.*/g);
|
4754
|
+
if (validThemeName) {
|
4755
|
+
addClass(this.rootWrapperElement, validThemeName);
|
4756
|
+
addClass(this.rootPortalElement, validThemeName);
|
4757
|
+
if (!getComputedStyle(this.rootWrapperElement).getPropertyValue('--ht-line-height')) {
|
4758
|
+
warn(`The "${validThemeName}" theme is enabled, but its stylesheets are missing or not imported correctly. \
|
4759
|
+
Import the correct CSS files in order to use that theme.`);
|
4760
|
+
}
|
4761
|
+
}
|
4762
|
+
}
|
4763
|
+
if (!isFirstRun) {
|
4764
|
+
instance.render();
|
4765
|
+
instance.scrollViewportTo(0, 0);
|
4766
|
+
if (getThemeClassName(this.rootContainer)) {
|
4767
|
+
removeClass(this.rootContainer, /ht-theme-.*/g);
|
4768
|
+
if (validThemeName) {
|
4769
|
+
addClass(this.rootContainer, validThemeName);
|
4770
|
+
}
|
4771
|
+
}
|
4772
|
+
}
|
4773
|
+
this.runHooks('afterSetTheme', validThemeName, isFirstRun);
|
4654
4774
|
};
|
4655
4775
|
|
4656
4776
|
/**
|
@@ -4662,7 +4782,31 @@ export default function Core(rootElement, userSettings) {
|
|
4662
4782
|
* @returns {string|undefined} The name of the currently used theme.
|
4663
4783
|
*/
|
4664
4784
|
this.getCurrentThemeName = () => {
|
4665
|
-
return this.
|
4785
|
+
return this.stylesHandler.getThemeName();
|
4786
|
+
};
|
4787
|
+
|
4788
|
+
/**
|
4789
|
+
* Gets the table's root container element height.
|
4790
|
+
*
|
4791
|
+
* @memberof Core#
|
4792
|
+
* @function getTableHeight
|
4793
|
+
* @since 16.0.0
|
4794
|
+
* @returns {number}
|
4795
|
+
*/
|
4796
|
+
this.getTableHeight = () => {
|
4797
|
+
return this.rootElement.offsetHeight;
|
4798
|
+
};
|
4799
|
+
|
4800
|
+
/**
|
4801
|
+
* Gets the table's root container element width.
|
4802
|
+
*
|
4803
|
+
* @memberof Core#
|
4804
|
+
* @function getTableWidth
|
4805
|
+
* @since 16.0.0
|
4806
|
+
* @returns {number}
|
4807
|
+
*/
|
4808
|
+
this.getTableWidth = () => {
|
4809
|
+
return this.rootElement.offsetWidth;
|
4666
4810
|
};
|
4667
4811
|
|
4668
4812
|
/**
|
package/dataMap/dataMap.js
CHANGED
@@ -386,31 +386,20 @@ class DataMap {
|
|
386
386
|
}
|
387
387
|
const dataSource = this.dataSource;
|
388
388
|
const maxCols = this.tableMeta.maxCols;
|
389
|
-
const
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
const continueProcess = this.hot.runHooks('beforeCreateCol', columnIndex, amount, source);
|
395
|
-
if (continueProcess === false) {
|
389
|
+
const numberOfSourceCols = this.hot.countSourceCols();
|
390
|
+
const numberOfVisualCols = this.hot.countCols();
|
391
|
+
const numberOfSourceRows = this.hot.countSourceRows();
|
392
|
+
const visualColumnIndex = typeof index === 'number' && index <= numberOfSourceCols ? index : numberOfVisualCols;
|
393
|
+
if (this.hot.runHooks('beforeCreateCol', visualColumnIndex, amount, source) === false) {
|
396
394
|
return {
|
397
395
|
delta: 0
|
398
396
|
};
|
399
397
|
}
|
400
|
-
|
401
|
-
|
402
|
-
physicalColumnIndex = this.hot.toPhysicalColumn(columnIndex);
|
403
|
-
}
|
404
|
-
const numberOfSourceRows = this.hot.countSourceRows();
|
405
|
-
let nrOfColumns = this.hot.countCols();
|
398
|
+
const physicalColumnIndex = visualColumnIndex < numberOfVisualCols ? this.hot.toPhysicalColumn(visualColumnIndex) : numberOfSourceCols;
|
399
|
+
const firstNewPhysicalColumnIndex = mode === 'end' ? Math.min(physicalColumnIndex + 1, numberOfSourceCols) : physicalColumnIndex;
|
406
400
|
let numberOfCreatedCols = 0;
|
407
|
-
let
|
408
|
-
|
409
|
-
currentIndex = Math.min(currentIndex + 1, countSourceCols);
|
410
|
-
}
|
411
|
-
const startPhysicalIndex = currentIndex;
|
412
|
-
while (numberOfCreatedCols < amount && nrOfColumns < maxCols) {
|
413
|
-
if (typeof columnIndex !== 'number' || columnIndex >= nrOfColumns) {
|
401
|
+
for (let col = firstNewPhysicalColumnIndex; numberOfCreatedCols < amount && numberOfVisualCols + numberOfCreatedCols < maxCols; col++) {
|
402
|
+
if (typeof visualColumnIndex !== 'number' || visualColumnIndex >= numberOfVisualCols + numberOfCreatedCols) {
|
414
403
|
if (numberOfSourceRows > 0) {
|
415
404
|
for (let row = 0; row < numberOfSourceRows; row += 1) {
|
416
405
|
if (typeof dataSource[row] === 'undefined') {
|
@@ -423,29 +412,26 @@ class DataMap {
|
|
423
412
|
}
|
424
413
|
} else {
|
425
414
|
for (let row = 0; row < numberOfSourceRows; row++) {
|
426
|
-
dataSource[row].splice(
|
415
|
+
dataSource[row].splice(col, 0, null);
|
427
416
|
}
|
428
417
|
}
|
429
418
|
numberOfCreatedCols += 1;
|
430
|
-
currentIndex += 1;
|
431
|
-
nrOfColumns += 1;
|
432
419
|
}
|
433
|
-
this.hot.columnIndexMapper.insertIndexes(columnIndex, numberOfCreatedCols);
|
434
420
|
if (numberOfCreatedCols > 0) {
|
435
421
|
if (index === undefined || index === null) {
|
436
422
|
// Creates the meta columns at the end of the columns collection without shifting the cells
|
437
423
|
// that were defined out of the range of the dataset.
|
438
424
|
this.metaManager.createColumn(null, numberOfCreatedCols);
|
439
425
|
} else if (source !== 'auto') {
|
440
|
-
this.metaManager.createColumn(
|
426
|
+
this.metaManager.createColumn(firstNewPhysicalColumnIndex, amount);
|
441
427
|
}
|
442
428
|
}
|
443
|
-
|
444
|
-
this.hot.runHooks('afterCreateCol',
|
429
|
+
this.hot.columnIndexMapper.insertIndexes(visualColumnIndex, numberOfCreatedCols, mode);
|
430
|
+
this.hot.runHooks('afterCreateCol', this.hot.toVisualColumn(firstNewPhysicalColumnIndex), numberOfCreatedCols, source);
|
445
431
|
this.refreshDuckSchema();
|
446
432
|
return {
|
447
433
|
delta: numberOfCreatedCols,
|
448
|
-
startPhysicalIndex
|
434
|
+
startPhysicalIndex: firstNewPhysicalColumnIndex
|
449
435
|
};
|
450
436
|
}
|
451
437
|
|
@@ -685,7 +671,7 @@ class DataMap {
|
|
685
671
|
}
|
686
672
|
if (this.hot.hasHook('modifyData')) {
|
687
673
|
const valueHolder = (0, _object.createObjectPropListener)(value);
|
688
|
-
this.hot.runHooks('modifyData',
|
674
|
+
this.hot.runHooks('modifyData', row, this.propToCol(prop), valueHolder, 'get');
|
689
675
|
if (valueHolder.isTouched()) {
|
690
676
|
value = valueHolder.value;
|
691
677
|
}
|
@@ -725,7 +711,7 @@ class DataMap {
|
|
725
711
|
|
726
712
|
if (this.hot.hasHook('modifyData')) {
|
727
713
|
const valueHolder = (0, _object.createObjectPropListener)(newValue);
|
728
|
-
this.hot.runHooks('modifyData',
|
714
|
+
this.hot.runHooks('modifyData', row, this.propToCol(prop), valueHolder, 'set');
|
729
715
|
if (valueHolder.isTouched()) {
|
730
716
|
newValue = valueHolder.value;
|
731
717
|
}
|