handsontable 12.0.0 → 12.0.1

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/helpers/mixed.js CHANGED
@@ -194,7 +194,7 @@ var domMessages = {
194
194
  function _injectProductInfo(key, element) {
195
195
  var hasValidType = !isEmpty(key);
196
196
  var isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
197
- var hotVersion = "12.0.0";
197
+ var hotVersion = "12.0.1";
198
198
  var keyValidityDate;
199
199
  var consoleMessageState = 'invalid';
200
200
  var domMessageState = 'invalid';
@@ -204,7 +204,7 @@ function _injectProductInfo(key, element) {
204
204
 
205
205
  if (hasValidType || isNonCommercial || schemaValidity) {
206
206
  if (schemaValidity) {
207
- var releaseDate = (0, _moment.default)("28/04/2022", 'DD/MM/YYYY');
207
+ var releaseDate = (0, _moment.default)("16/05/2022", 'DD/MM/YYYY');
208
208
  var releaseDays = Math.floor(releaseDate.toDate().getTime() / 8.64e7);
209
209
 
210
210
  var keyValidityDays = _extractTime(key);
package/helpers/mixed.mjs CHANGED
@@ -162,7 +162,7 @@ var domMessages = {
162
162
  export function _injectProductInfo(key, element) {
163
163
  var hasValidType = !isEmpty(key);
164
164
  var isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
165
- var hotVersion = "12.0.0";
165
+ var hotVersion = "12.0.1";
166
166
  var keyValidityDate;
167
167
  var consoleMessageState = 'invalid';
168
168
  var domMessageState = 'invalid';
@@ -172,7 +172,7 @@ export function _injectProductInfo(key, element) {
172
172
 
173
173
  if (hasValidType || isNonCommercial || schemaValidity) {
174
174
  if (schemaValidity) {
175
- var releaseDate = moment("28/04/2022", 'DD/MM/YYYY');
175
+ var releaseDate = moment("16/05/2022", 'DD/MM/YYYY');
176
176
  var releaseDays = Math.floor(releaseDate.toDate().getTime() / 8.64e7);
177
177
 
178
178
  var keyValidityDays = _extractTime(key);
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/handsontable/handsontable/issues"
11
11
  },
12
12
  "author": "Handsoncode <hello@handsontable.com>",
13
- "version": "12.0.0",
13
+ "version": "12.0.1",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
@@ -273,7 +273,7 @@ var AutoColumnSize = /*#__PURE__*/function (_BasePlugin) {
273
273
  _this.columnWidthsMap = new _translations.PhysicalIndexToValueMap();
274
274
 
275
275
  _this.hot.columnIndexMapper.registerMap(COLUMN_SIZE_MAP_NAME, _this.columnWidthsMap); // Leave the listener active to allow auto-sizing the columns when the plugin is disabled.
276
- // This is necesseary for width recalculation for resize handler doubleclick (ManualColumnResize).
276
+ // This is necessary for width recalculation for resize handler doubleclick (ManualColumnResize).
277
277
 
278
278
 
279
279
  _this.addHook('beforeColumnResize', function (size, column, isDblClick) {
@@ -318,7 +318,7 @@ var AutoColumnSize = /*#__PURE__*/function (_BasePlugin) {
318
318
  this.addHook('afterLoadData', function () {
319
319
  return _this2.onAfterLoadData.apply(_this2, arguments);
320
320
  });
321
- this.addHook('beforeChange', function (changes) {
321
+ this.addHook('beforeChangeRender', function (changes) {
322
322
  return _this2.onBeforeChange(changes);
323
323
  });
324
324
  this.addHook('afterFormulasValuesUpdate', function (changes) {
@@ -362,7 +362,7 @@ var AutoColumnSize = /*#__PURE__*/function (_BasePlugin) {
362
362
  var _this3 = this;
363
363
 
364
364
  _get(_getPrototypeOf(AutoColumnSize.prototype), "disablePlugin", this).call(this); // Leave the listener active to allow auto-sizing the columns when the plugin is disabled.
365
- // This is necesseary for width recalculation for resize handler doubleclick (ManualColumnResize).
365
+ // This is necessary for width recalculation for resize handler doubleclick (ManualColumnResize).
366
366
 
367
367
 
368
368
  this.addHook('beforeColumnResize', function (size, column, isDblClick) {
@@ -232,7 +232,7 @@ export var AutoColumnSize = /*#__PURE__*/function (_BasePlugin) {
232
232
  _this.columnWidthsMap = new IndexToValueMap();
233
233
 
234
234
  _this.hot.columnIndexMapper.registerMap(COLUMN_SIZE_MAP_NAME, _this.columnWidthsMap); // Leave the listener active to allow auto-sizing the columns when the plugin is disabled.
235
- // This is necesseary for width recalculation for resize handler doubleclick (ManualColumnResize).
235
+ // This is necessary for width recalculation for resize handler doubleclick (ManualColumnResize).
236
236
 
237
237
 
238
238
  _this.addHook('beforeColumnResize', function (size, column, isDblClick) {
@@ -277,7 +277,7 @@ export var AutoColumnSize = /*#__PURE__*/function (_BasePlugin) {
277
277
  this.addHook('afterLoadData', function () {
278
278
  return _this2.onAfterLoadData.apply(_this2, arguments);
279
279
  });
280
- this.addHook('beforeChange', function (changes) {
280
+ this.addHook('beforeChangeRender', function (changes) {
281
281
  return _this2.onBeforeChange(changes);
282
282
  });
283
283
  this.addHook('afterFormulasValuesUpdate', function (changes) {
@@ -321,7 +321,7 @@ export var AutoColumnSize = /*#__PURE__*/function (_BasePlugin) {
321
321
  var _this3 = this;
322
322
 
323
323
  _get(_getPrototypeOf(AutoColumnSize.prototype), "disablePlugin", this).call(this); // Leave the listener active to allow auto-sizing the columns when the plugin is disabled.
324
- // This is necesseary for width recalculation for resize handler doubleclick (ManualColumnResize).
324
+ // This is necessary for width recalculation for resize handler doubleclick (ManualColumnResize).
325
325
 
326
326
 
327
327
  this.addHook('beforeColumnResize', function (size, column, isDblClick) {
@@ -287,7 +287,7 @@ var AutoRowSize = /*#__PURE__*/function (_BasePlugin) {
287
287
  this.addHook('afterLoadData', function () {
288
288
  return _this2.onAfterLoadData.apply(_this2, arguments);
289
289
  });
290
- this.addHook('beforeChange', function (changes) {
290
+ this.addHook('beforeChangeRender', function (changes) {
291
291
  return _this2.onBeforeChange(changes);
292
292
  });
293
293
  this.addHook('beforeColumnResize', function () {
@@ -252,7 +252,7 @@ export var AutoRowSize = /*#__PURE__*/function (_BasePlugin) {
252
252
  this.addHook('afterLoadData', function () {
253
253
  return _this2.onAfterLoadData.apply(_this2, arguments);
254
254
  });
255
- this.addHook('beforeChange', function (changes) {
255
+ this.addHook('beforeChangeRender', function (changes) {
256
256
  return _this2.onBeforeChange(changes);
257
257
  });
258
258
  this.addHook('beforeColumnResize', function () {
@@ -908,13 +908,14 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
908
908
  var customBorders = this.hot.getSettings()[PLUGIN_KEY];
909
909
 
910
910
  if (Array.isArray(customBorders)) {
911
- this.checkSettingsCohesion(customBorders);
911
+ var bordersClone = (0, _object.deepClone)(customBorders);
912
+ this.checkSettingsCohesion(bordersClone);
912
913
 
913
- if (!customBorders.length) {
914
- this.savedBorders = customBorders;
914
+ if (!bordersClone.length) {
915
+ this.savedBorders = bordersClone;
915
916
  }
916
917
 
917
- this.createCustomBorders(customBorders);
918
+ this.createCustomBorders(bordersClone);
918
919
  } else if (customBorders !== void 0) {
919
920
  this.createCustomBorders(this.savedBorders);
920
921
  }
@@ -61,7 +61,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
61
61
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
62
62
 
63
63
  import { BasePlugin } from "../base/index.mjs";
64
- import { hasOwnProperty, objectEach } from "../../helpers/object.mjs";
64
+ import { hasOwnProperty, objectEach, deepClone } from "../../helpers/object.mjs";
65
65
  import { rangeEach } from "../../helpers/number.mjs";
66
66
  import { arrayEach, arrayReduce, arrayMap } from "../../helpers/array.mjs";
67
67
  import * as C from "../../i18n/constants.mjs";
@@ -866,13 +866,14 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
866
866
  var customBorders = this.hot.getSettings()[PLUGIN_KEY];
867
867
 
868
868
  if (Array.isArray(customBorders)) {
869
- this.checkSettingsCohesion(customBorders);
869
+ var bordersClone = deepClone(customBorders);
870
+ this.checkSettingsCohesion(bordersClone);
870
871
 
871
- if (!customBorders.length) {
872
- this.savedBorders = customBorders;
872
+ if (!bordersClone.length) {
873
+ this.savedBorders = bordersClone;
873
874
  }
874
875
 
875
- this.createCustomBorders(customBorders);
876
+ this.createCustomBorders(bordersClone);
876
877
  } else if (customBorders !== void 0) {
877
878
  this.createCustomBorders(this.savedBorders);
878
879
  }
@@ -728,9 +728,14 @@ var Formulas = /*#__PURE__*/function (_BasePlugin) {
728
728
  // where the user directly changes the values - the Core triggers those validators.
729
729
 
730
730
  if (sheetId !== void 0 && !changedCellsSet.has(addressId)) {
731
- var hot = (0, _register.getRegisteredHotInstances)(_this12.engine).get(sheetId); // It will just re-render certain cell when necessary.
731
+ var boundHot = (0, _register.getRegisteredHotInstances)(_this12.engine).get(sheetId); // if `sheetId` is not bound to any Handsontable instance, skip the validation process
732
732
 
733
- hot.validateCell(hot.getDataAtCell(visualRow, visualColumn), hot.getCellMeta(visualRow, visualColumn), function () {});
733
+ if (!boundHot) {
734
+ return;
735
+ } // It will just re-render certain cell when necessary.
736
+
737
+
738
+ boundHot.validateCell(boundHot.getDataAtCell(visualRow, visualColumn), boundHot.getCellMeta(visualRow, visualColumn), function () {});
734
739
  }
735
740
  });
736
741
  }
@@ -674,9 +674,14 @@ export var Formulas = /*#__PURE__*/function (_BasePlugin) {
674
674
  // where the user directly changes the values - the Core triggers those validators.
675
675
 
676
676
  if (sheetId !== void 0 && !changedCellsSet.has(addressId)) {
677
- var hot = getRegisteredHotInstances(_this12.engine).get(sheetId); // It will just re-render certain cell when necessary.
677
+ var boundHot = getRegisteredHotInstances(_this12.engine).get(sheetId); // if `sheetId` is not bound to any Handsontable instance, skip the validation process
678
678
 
679
- hot.validateCell(hot.getDataAtCell(visualRow, visualColumn), hot.getCellMeta(visualRow, visualColumn), function () {});
679
+ if (!boundHot) {
680
+ return;
681
+ } // It will just re-render certain cell when necessary.
682
+
683
+
684
+ boundHot.validateCell(boundHot.getDataAtCell(visualRow, visualColumn), boundHot.getCellMeta(visualRow, visualColumn), function () {});
680
685
  }
681
686
  });
682
687
  }
@@ -5,41 +5,45 @@ exports.default = void 0;
5
5
 
6
6
  var _element = require("../../../helpers/dom/element");
7
7
 
8
- var _object = require("../../../helpers/object");
9
-
10
8
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
9
 
12
10
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
13
11
 
14
12
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
15
13
 
14
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+
16
16
  /**
17
17
  * @private
18
18
  */
19
19
  var GhostTable = /*#__PURE__*/function () {
20
+ /**
21
+ * Reference to NestedHeaders plugin.
22
+ *
23
+ * @type {NestedHeaders}
24
+ */
25
+
26
+ /**
27
+ * Temporary element created to get minimal headers widths.
28
+ *
29
+ * @type {*}
30
+ */
31
+
32
+ /**
33
+ * Cached the headers widths.
34
+ *
35
+ * @type {Array}
36
+ */
20
37
  function GhostTable(plugin) {
21
38
  _classCallCheck(this, GhostTable);
22
39
 
23
- /**
24
- * Reference to NestedHeaders plugin.
25
- *
26
- * @type {NestedHeaders}
27
- */
28
- this.nestedHeaders = plugin;
29
- /**
30
- * Temporary element created to get minimal headers widths.
31
- *
32
- * @type {*}
33
- */
40
+ _defineProperty(this, "nestedHeaders", void 0);
34
41
 
35
- this.container = void 0;
36
- /**
37
- * Cached the headers widths.
38
- *
39
- * @type {Array}
40
- */
42
+ _defineProperty(this, "container", void 0);
43
+
44
+ _defineProperty(this, "widthsCache", []);
41
45
 
42
- this.widthsCache = [];
46
+ this.nestedHeaders = plugin;
43
47
  }
44
48
  /**
45
49
  * Build cache of the headers widths.
@@ -90,28 +94,25 @@ var GhostTable = /*#__PURE__*/function () {
90
94
  lastRowColspan = false;
91
95
 
92
96
  for (var col = 0; col < maxCols; col++) {
93
- var td = rootDocument.createElement('th');
94
- var headerObj = (0, _object.clone)(this.nestedHeaders.getHeaderSettings(row, col));
97
+ var th = rootDocument.createElement('th');
98
+ var headerSettings = this.nestedHeaders.getHeaderSettings(row, col);
99
+
100
+ if (headerSettings && !headerSettings.isPlaceholder) {
101
+ var label = headerSettings.label;
95
102
 
96
- if (headerObj && !headerObj.isHidden) {
97
103
  if (row === lastRowIndex) {
98
- if (headerObj.colspan > 1) {
104
+ if (headerSettings.colspan > 1) {
99
105
  lastRowColspan = true;
100
106
  }
101
107
 
102
108
  if (isDropdownEnabled) {
103
- headerObj.label += '<button class="changeType"></button>';
109
+ label += '<button class="changeType"></button>';
104
110
  }
105
111
  }
106
112
 
107
- (0, _element.fastInnerHTML)(td, headerObj.label); // The guard here is needed because on IE11 an error is thrown if you
108
- // try to assign an incorrect value to `td.colSpan` here.
109
-
110
- if (headerObj.colspan !== undefined) {
111
- td.colSpan = headerObj.colspan;
112
- }
113
-
114
- tr.appendChild(td);
113
+ (0, _element.fastInnerHTML)(th, label);
114
+ th.colSpan = headerSettings.colspan;
115
+ tr.appendChild(th);
115
116
  }
116
117
  }
117
118
 
@@ -124,9 +125,9 @@ var GhostTable = /*#__PURE__*/function () {
124
125
  var _tr = rootDocument.createElement('tr');
125
126
 
126
127
  for (var _col = 0; _col < maxCols; _col++) {
127
- var _td = rootDocument.createElement('th');
128
+ var td = rootDocument.createElement('th');
128
129
 
129
- _tr.appendChild(_td);
130
+ _tr.appendChild(td);
130
131
  }
131
132
 
132
133
  table.appendChild(_tr);
@@ -4,36 +4,41 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
4
4
 
5
5
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
6
 
7
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+
7
9
  import { fastInnerHTML } from "../../../helpers/dom/element.mjs";
8
- import { clone } from "../../../helpers/object.mjs";
9
10
  /**
10
11
  * @private
11
12
  */
12
13
 
13
14
  var GhostTable = /*#__PURE__*/function () {
15
+ /**
16
+ * Reference to NestedHeaders plugin.
17
+ *
18
+ * @type {NestedHeaders}
19
+ */
20
+
21
+ /**
22
+ * Temporary element created to get minimal headers widths.
23
+ *
24
+ * @type {*}
25
+ */
26
+
27
+ /**
28
+ * Cached the headers widths.
29
+ *
30
+ * @type {Array}
31
+ */
14
32
  function GhostTable(plugin) {
15
33
  _classCallCheck(this, GhostTable);
16
34
 
17
- /**
18
- * Reference to NestedHeaders plugin.
19
- *
20
- * @type {NestedHeaders}
21
- */
22
- this.nestedHeaders = plugin;
23
- /**
24
- * Temporary element created to get minimal headers widths.
25
- *
26
- * @type {*}
27
- */
35
+ _defineProperty(this, "nestedHeaders", void 0);
28
36
 
29
- this.container = void 0;
30
- /**
31
- * Cached the headers widths.
32
- *
33
- * @type {Array}
34
- */
37
+ _defineProperty(this, "container", void 0);
38
+
39
+ _defineProperty(this, "widthsCache", []);
35
40
 
36
- this.widthsCache = [];
41
+ this.nestedHeaders = plugin;
37
42
  }
38
43
  /**
39
44
  * Build cache of the headers widths.
@@ -84,28 +89,25 @@ var GhostTable = /*#__PURE__*/function () {
84
89
  lastRowColspan = false;
85
90
 
86
91
  for (var col = 0; col < maxCols; col++) {
87
- var td = rootDocument.createElement('th');
88
- var headerObj = clone(this.nestedHeaders.getHeaderSettings(row, col));
92
+ var th = rootDocument.createElement('th');
93
+ var headerSettings = this.nestedHeaders.getHeaderSettings(row, col);
94
+
95
+ if (headerSettings && !headerSettings.isPlaceholder) {
96
+ var label = headerSettings.label;
89
97
 
90
- if (headerObj && !headerObj.isHidden) {
91
98
  if (row === lastRowIndex) {
92
- if (headerObj.colspan > 1) {
99
+ if (headerSettings.colspan > 1) {
93
100
  lastRowColspan = true;
94
101
  }
95
102
 
96
103
  if (isDropdownEnabled) {
97
- headerObj.label += '<button class="changeType"></button>';
104
+ label += '<button class="changeType"></button>';
98
105
  }
99
106
  }
100
107
 
101
- fastInnerHTML(td, headerObj.label); // The guard here is needed because on IE11 an error is thrown if you
102
- // try to assign an incorrect value to `td.colSpan` here.
103
-
104
- if (headerObj.colspan !== undefined) {
105
- td.colSpan = headerObj.colspan;
106
- }
107
-
108
- tr.appendChild(td);
108
+ fastInnerHTML(th, label);
109
+ th.colSpan = headerSettings.colspan;
110
+ tr.appendChild(th);
109
111
  }
110
112
  }
111
113
 
@@ -118,9 +120,9 @@ var GhostTable = /*#__PURE__*/function () {
118
120
  var _tr = rootDocument.createElement('tr');
119
121
 
120
122
  for (var _col = 0; _col < maxCols; _col++) {
121
- var _td = rootDocument.createElement('th');
123
+ var td = rootDocument.createElement('th');
122
124
 
123
- _tr.appendChild(_td);
125
+ _tr.appendChild(td);
124
126
  }
125
127
 
126
128
  table.appendChild(_tr);