handsontable 0.0.0-next-a5069f0-20240819 → 0.0.0-next-aebdd36-20240821

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/helpers/mixed.js CHANGED
@@ -134,7 +134,7 @@ const domMessages = {
134
134
  function _injectProductInfo(key, element) {
135
135
  const hasValidType = !isEmpty(key);
136
136
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
137
- const hotVersion = "0.0.0-next-a5069f0-20240819";
137
+ const hotVersion = "0.0.0-next-aebdd36-20240821";
138
138
  let keyValidityDate;
139
139
  let consoleMessageState = 'invalid';
140
140
  let domMessageState = 'invalid';
package/helpers/mixed.mjs CHANGED
@@ -124,7 +124,7 @@ const domMessages = {
124
124
  export function _injectProductInfo(key, element) {
125
125
  const hasValidType = !isEmpty(key);
126
126
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
127
- const hotVersion = "0.0.0-next-a5069f0-20240819";
127
+ const hotVersion = "0.0.0-next-aebdd36-20240821";
128
128
  let keyValidityDate;
129
129
  let consoleMessageState = 'invalid';
130
130
  let domMessageState = 'invalid';
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": "0.0.0-next-a5069f0-20240819",
13
+ "version": "0.0.0-next-aebdd36-20240821",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
@@ -25,9 +25,6 @@ function createMenuItemRenderer(mainTableHot) {
25
25
  * @param {string} value The cell value.
26
26
  */
27
27
  return (menuHot, TD, row, col, prop, value) => {
28
- if (TD.hasAttribute('ghost-table')) {
29
- return;
30
- }
31
28
  const item = menuHot.getSourceDataAtRow(row);
32
29
  const wrapper = mainTableHot.rootDocument.createElement('div');
33
30
  const itemValue = typeof value === 'function' ? value.call(mainTableHot) : value;
@@ -21,9 +21,6 @@ export function createMenuItemRenderer(mainTableHot) {
21
21
  * @param {string} value The cell value.
22
22
  */
23
23
  return (menuHot, TD, row, col, prop, value) => {
24
- if (TD.hasAttribute('ghost-table')) {
25
- return;
26
- }
27
24
  const item = menuHot.getSourceDataAtRow(row);
28
25
  const wrapper = mainTableHot.rootDocument.createElement('div');
29
26
  const itemValue = typeof value === 'function' ? value.call(mainTableHot) : value;
@@ -554,7 +554,9 @@ class CopyPaste extends _base.BasePlugin {
554
554
  */
555
555
  onCopy(event) {
556
556
  var _event$target;
557
- if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened() || (_event$target = event.target) !== null && _event$target !== void 0 && _event$target.hasAttribute('data-hot-input') || !this.hot.getSettings().outsideClickDeselects && event.target !== this.hot.rootDocument.body) {
557
+ const focusedElement = this.hot.getFocusManager().getRefocusElement();
558
+ const isHotInput = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.hasAttribute('data-hot-input');
559
+ if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
558
560
  return;
559
561
  }
560
562
  event.preventDefault();
@@ -585,7 +587,9 @@ class CopyPaste extends _base.BasePlugin {
585
587
  */
586
588
  onCut(event) {
587
589
  var _event$target2;
588
- if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened() || (_event$target2 = event.target) !== null && _event$target2 !== void 0 && _event$target2.hasAttribute('data-hot-input') || !this.hot.getSettings().outsideClickDeselects && event.target !== this.hot.rootDocument.body) {
590
+ const focusedElement = this.hot.getFocusManager().getRefocusElement();
591
+ const isHotInput = (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.hasAttribute('data-hot-input');
592
+ if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
589
593
  return;
590
594
  }
591
595
  event.preventDefault();
@@ -615,7 +619,9 @@ class CopyPaste extends _base.BasePlugin {
615
619
  */
616
620
  onPaste(event) {
617
621
  var _event$target3;
618
- if (!this.hot.isListening() || this.isEditorOpened() || (_event$target3 = event.target) !== null && _event$target3 !== void 0 && _event$target3.hasAttribute('data-hot-input') || !this.hot.getSelected() || !this.hot.getSettings().outsideClickDeselects && event.target !== this.hot.rootDocument.body) {
622
+ const focusedElement = this.hot.getFocusManager().getRefocusElement();
623
+ const isHotInput = (_event$target3 = event.target) === null || _event$target3 === void 0 ? void 0 : _event$target3.hasAttribute('data-hot-input');
624
+ if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
619
625
  return;
620
626
  }
621
627
  event.preventDefault();
@@ -550,7 +550,9 @@ export class CopyPaste extends BasePlugin {
550
550
  */
551
551
  onCopy(event) {
552
552
  var _event$target;
553
- if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened() || (_event$target = event.target) !== null && _event$target !== void 0 && _event$target.hasAttribute('data-hot-input') || !this.hot.getSettings().outsideClickDeselects && event.target !== this.hot.rootDocument.body) {
553
+ const focusedElement = this.hot.getFocusManager().getRefocusElement();
554
+ const isHotInput = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.hasAttribute('data-hot-input');
555
+ if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
554
556
  return;
555
557
  }
556
558
  event.preventDefault();
@@ -581,7 +583,9 @@ export class CopyPaste extends BasePlugin {
581
583
  */
582
584
  onCut(event) {
583
585
  var _event$target2;
584
- if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened() || (_event$target2 = event.target) !== null && _event$target2 !== void 0 && _event$target2.hasAttribute('data-hot-input') || !this.hot.getSettings().outsideClickDeselects && event.target !== this.hot.rootDocument.body) {
586
+ const focusedElement = this.hot.getFocusManager().getRefocusElement();
587
+ const isHotInput = (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.hasAttribute('data-hot-input');
588
+ if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
585
589
  return;
586
590
  }
587
591
  event.preventDefault();
@@ -611,7 +615,9 @@ export class CopyPaste extends BasePlugin {
611
615
  */
612
616
  onPaste(event) {
613
617
  var _event$target3;
614
- if (!this.hot.isListening() || this.isEditorOpened() || (_event$target3 = event.target) !== null && _event$target3 !== void 0 && _event$target3.hasAttribute('data-hot-input') || !this.hot.getSelected() || !this.hot.getSettings().outsideClickDeselects && event.target !== this.hot.rootDocument.body) {
618
+ const focusedElement = this.hot.getFocusManager().getRefocusElement();
619
+ const isHotInput = (_event$target3 = event.target) === null || _event$target3 === void 0 ? void 0 : _event$target3.hasAttribute('data-hot-input');
620
+ if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
615
621
  return;
616
622
  }
617
623
  event.preventDefault();
@@ -191,7 +191,12 @@ class ConditionComponent extends _base.BaseComponent {
191
191
  (0, _element.addClass)(label, 'htFiltersMenuLabel');
192
192
  label.textContent = value;
193
193
  wrapper.appendChild(label);
194
- (0, _array.arrayEach)(this.elements, ui => wrapper.appendChild(ui.element));
194
+
195
+ // The SelectUI should not extend the menu width (it should adjust to the menu item width only).
196
+ // That's why it's skipped from rendering when the GhostTable tries to render it.
197
+ if (!wrapper.parentElement.hasAttribute('ghost-table')) {
198
+ (0, _array.arrayEach)(this.elements, ui => wrapper.appendChild(ui.element));
199
+ }
195
200
  return wrapper;
196
201
  }
197
202
  };
@@ -186,7 +186,12 @@ export class ConditionComponent extends BaseComponent {
186
186
  addClass(label, 'htFiltersMenuLabel');
187
187
  label.textContent = value;
188
188
  wrapper.appendChild(label);
189
- arrayEach(this.elements, ui => wrapper.appendChild(ui.element));
189
+
190
+ // The SelectUI should not extend the menu width (it should adjust to the menu item width only).
191
+ // That's why it's skipped from rendering when the GhostTable tries to render it.
192
+ if (!wrapper.parentElement.hasAttribute('ghost-table')) {
193
+ arrayEach(this.elements, ui => wrapper.appendChild(ui.element));
194
+ }
190
195
  return wrapper;
191
196
  }
192
197
  };
@@ -177,7 +177,12 @@ class ValueComponent extends _base.BaseComponent {
177
177
  (0, _element.addClass)(label, 'htFiltersMenuLabel');
178
178
  label.textContent = value;
179
179
  wrapper.appendChild(label);
180
- (0, _array.arrayEach)(this.elements, ui => wrapper.appendChild(ui.element));
180
+
181
+ // The MultipleSelectUI should not extend the menu width (it should adjust to the menu item width only).
182
+ // That's why it's skipped from rendering when the GhostTable tries to render it.
183
+ if (!wrapper.parentElement.hasAttribute('ghost-table')) {
184
+ (0, _array.arrayEach)(this.elements, ui => wrapper.appendChild(ui.element));
185
+ }
181
186
  return wrapper;
182
187
  }
183
188
  };
@@ -172,7 +172,12 @@ export class ValueComponent extends BaseComponent {
172
172
  addClass(label, 'htFiltersMenuLabel');
173
173
  label.textContent = value;
174
174
  wrapper.appendChild(label);
175
- arrayEach(this.elements, ui => wrapper.appendChild(ui.element));
175
+
176
+ // The MultipleSelectUI should not extend the menu width (it should adjust to the menu item width only).
177
+ // That's why it's skipped from rendering when the GhostTable tries to render it.
178
+ if (!wrapper.parentElement.hasAttribute('ghost-table')) {
179
+ arrayEach(this.elements, ui => wrapper.appendChild(ui.element));
180
+ }
176
181
  return wrapper;
177
182
  }
178
183
  };
@@ -128,10 +128,9 @@ class MultipleSelectUI extends _base.BaseUI {
128
128
  * @param {Array} items Array of objects with `checked` and `label` property.
129
129
  */
130
130
  setItems(items) {
131
+ var _classPrivateFieldGet2;
131
132
  _classPrivateFieldSet(_items, this, items);
132
- if (_classPrivateFieldGet(_itemsBox, this)) {
133
- _classPrivateFieldGet(_itemsBox, this).loadData(_classPrivateFieldGet(_items, this));
134
- }
133
+ (_classPrivateFieldGet2 = _classPrivateFieldGet(_itemsBox, this)) === null || _classPrivateFieldGet2 === void 0 || _classPrivateFieldGet2.loadData(_classPrivateFieldGet(_items, this));
135
134
  }
136
135
 
137
136
  /**
@@ -223,13 +222,13 @@ class MultipleSelectUI extends _base.BaseUI {
223
222
  this._element.appendChild(selectionControl.element);
224
223
  this._element.appendChild(itemsBoxWrapper);
225
224
  const hotInitializer = wrapper => {
225
+ var _classPrivateFieldGet3;
226
226
  if (!this._element) {
227
227
  return;
228
228
  }
229
- if (_classPrivateFieldGet(_itemsBox, this)) {
230
- _classPrivateFieldGet(_itemsBox, this).destroy();
231
- }
229
+ (_classPrivateFieldGet3 = _classPrivateFieldGet(_itemsBox, this)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.destroy();
232
230
  (0, _element.addClass)(wrapper, 'htUIMultipleSelectHot');
231
+
233
232
  // Constructs and initializes a new Handsontable instance
234
233
  _classPrivateFieldSet(_itemsBox, this, new this.hot.constructor(wrapper, {
235
234
  data: _classPrivateFieldGet(_items, this),
@@ -323,9 +322,8 @@ class MultipleSelectUI extends _base.BaseUI {
323
322
  * Destroy instance.
324
323
  */
325
324
  destroy() {
326
- if (_classPrivateFieldGet(_itemsBox, this)) {
327
- _classPrivateFieldGet(_itemsBox, this).destroy();
328
- }
325
+ var _classPrivateFieldGet4;
326
+ (_classPrivateFieldGet4 = _classPrivateFieldGet(_itemsBox, this)) === null || _classPrivateFieldGet4 === void 0 || _classPrivateFieldGet4.destroy();
329
327
  _classPrivateFieldGet(_searchInput, this).destroy();
330
328
  _classPrivateFieldGet(_clearAllUI, this).destroy();
331
329
  _classPrivateFieldGet(_selectAllUI, this).destroy();
@@ -123,10 +123,9 @@ export class MultipleSelectUI extends BaseUI {
123
123
  * @param {Array} items Array of objects with `checked` and `label` property.
124
124
  */
125
125
  setItems(items) {
126
+ var _classPrivateFieldGet2;
126
127
  _classPrivateFieldSet(_items, this, items);
127
- if (_classPrivateFieldGet(_itemsBox, this)) {
128
- _classPrivateFieldGet(_itemsBox, this).loadData(_classPrivateFieldGet(_items, this));
129
- }
128
+ (_classPrivateFieldGet2 = _classPrivateFieldGet(_itemsBox, this)) === null || _classPrivateFieldGet2 === void 0 || _classPrivateFieldGet2.loadData(_classPrivateFieldGet(_items, this));
130
129
  }
131
130
 
132
131
  /**
@@ -218,13 +217,13 @@ export class MultipleSelectUI extends BaseUI {
218
217
  this._element.appendChild(selectionControl.element);
219
218
  this._element.appendChild(itemsBoxWrapper);
220
219
  const hotInitializer = wrapper => {
220
+ var _classPrivateFieldGet3;
221
221
  if (!this._element) {
222
222
  return;
223
223
  }
224
- if (_classPrivateFieldGet(_itemsBox, this)) {
225
- _classPrivateFieldGet(_itemsBox, this).destroy();
226
- }
224
+ (_classPrivateFieldGet3 = _classPrivateFieldGet(_itemsBox, this)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.destroy();
227
225
  addClass(wrapper, 'htUIMultipleSelectHot');
226
+
228
227
  // Constructs and initializes a new Handsontable instance
229
228
  _classPrivateFieldSet(_itemsBox, this, new this.hot.constructor(wrapper, {
230
229
  data: _classPrivateFieldGet(_items, this),
@@ -318,9 +317,8 @@ export class MultipleSelectUI extends BaseUI {
318
317
  * Destroy instance.
319
318
  */
320
319
  destroy() {
321
- if (_classPrivateFieldGet(_itemsBox, this)) {
322
- _classPrivateFieldGet(_itemsBox, this).destroy();
323
- }
320
+ var _classPrivateFieldGet4;
321
+ (_classPrivateFieldGet4 = _classPrivateFieldGet(_itemsBox, this)) === null || _classPrivateFieldGet4 === void 0 || _classPrivateFieldGet4.destroy();
324
322
  _classPrivateFieldGet(_searchInput, this).destroy();
325
323
  _classPrivateFieldGet(_clearAllUI, this).destroy();
326
324
  _classPrivateFieldGet(_selectAllUI, this).destroy();