handsontable 14.3.0 → 14.4.0-next-0a79a1f-20240521
Sign up to get free protection for your applications and to get access to all the features.
- package/3rdparty/walkontable/src/calculator/viewportRows.js +3 -3
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +3 -3
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/_base.js +24 -20
- package/3rdparty/walkontable/src/overlay/_base.mjs +24 -20
- package/3rdparty/walkontable/src/overlay/bottom.js +3 -6
- package/3rdparty/walkontable/src/overlay/bottom.mjs +3 -6
- package/3rdparty/walkontable/src/overlay/inlineStart.js +22 -19
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +22 -19
- package/3rdparty/walkontable/src/overlay/top.js +13 -12
- package/3rdparty/walkontable/src/overlay/top.mjs +13 -12
- package/3rdparty/walkontable/src/overlays.js +46 -24
- package/3rdparty/walkontable/src/overlays.mjs +46 -24
- package/3rdparty/walkontable/src/selection/manager.js +7 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +7 -0
- package/3rdparty/walkontable/src/selection/scanner.js +7 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +7 -0
- package/3rdparty/walkontable/src/table.js +10 -11
- package/3rdparty/walkontable/src/table.mjs +10 -11
- package/3rdparty/walkontable/src/utils/columnStretching.js +4 -0
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +4 -0
- package/3rdparty/walkontable/src/viewport.js +18 -10
- package/3rdparty/walkontable/src/viewport.mjs +18 -10
- package/CHANGELOG.md +37 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +2 -2
- package/core.js +93 -162
- package/core.mjs +93 -162
- package/dataMap/dataMap.js +10 -4
- package/dataMap/dataMap.mjs +10 -4
- package/dataMap/dataSource.js +16 -3
- package/dataMap/dataSource.mjs +16 -3
- package/dataMap/metaManager/lazyFactoryMap.js +7 -0
- package/dataMap/metaManager/lazyFactoryMap.mjs +7 -0
- package/dataMap/metaManager/metaSchema.js +38 -0
- package/dataMap/metaManager/metaSchema.mjs +38 -0
- package/dataMap/metaManager/mods/dynamicCellMeta.js +7 -0
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +7 -0
- package/dataMap/metaManager/mods/extendMetaProperties.js +44 -31
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +44 -31
- package/dataMap/metaManager/utils.js +7 -0
- package/dataMap/metaManager/utils.mjs +7 -0
- package/dist/handsontable.css +4 -5
- package/dist/handsontable.full.css +4 -5
- package/dist/handsontable.full.js +5878 -4657
- package/dist/handsontable.full.min.css +4 -4
- package/dist/handsontable.full.min.js +59 -59
- package/dist/handsontable.js +5383 -4277
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +20 -20
- package/editorManager.js +0 -67
- package/editorManager.mjs +0 -67
- package/editors/autocompleteEditor/autocompleteEditor.js +6 -4
- package/editors/autocompleteEditor/autocompleteEditor.mjs +6 -4
- package/editors/baseEditor/baseEditor.js +1 -36
- package/editors/baseEditor/baseEditor.mjs +2 -37
- package/editors/dateEditor/dateEditor.js +4 -1
- package/editors/dateEditor/dateEditor.mjs +4 -1
- package/editors/dropdownEditor/dropdownEditor.js +8 -5
- package/editors/dropdownEditor/dropdownEditor.mjs +8 -5
- package/editors/handsontableEditor/handsontableEditor.js +2 -2
- package/editors/handsontableEditor/handsontableEditor.mjs +2 -2
- package/editors/selectEditor/selectEditor.js +1 -9
- package/editors/selectEditor/selectEditor.mjs +1 -9
- package/editors/textEditor/textEditor.js +2 -11
- package/editors/textEditor/textEditor.mjs +2 -11
- package/focusManager.js +3 -5
- package/focusManager.mjs +3 -5
- package/helpers/array.js +7 -0
- package/helpers/array.mjs +7 -0
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/number.js +12 -2
- package/helpers/number.mjs +12 -2
- package/package.json +3 -3
- package/pluginHooks.d.ts +1 -1
- package/pluginHooks.js +79 -2
- package/pluginHooks.mjs +79 -2
- package/plugins/autoColumnSize/autoColumnSize.js +7 -0
- package/plugins/autoColumnSize/autoColumnSize.mjs +7 -0
- package/plugins/autoRowSize/autoRowSize.js +2 -2
- package/plugins/autoRowSize/autoRowSize.mjs +2 -2
- package/plugins/autofill/autofill.js +1 -1
- package/plugins/autofill/autofill.mjs +1 -1
- package/plugins/base/base.d.ts +1 -1
- package/plugins/base/base.js +6 -2
- package/plugins/base/base.mjs +6 -2
- package/plugins/collapsibleColumns/collapsibleColumns.js +1 -1
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +1 -1
- package/plugins/columnSorting/sortFunction/date.js +2 -46
- package/plugins/columnSorting/sortFunction/date.mjs +2 -45
- package/plugins/columnSorting/sortFunction/time.js +17 -0
- package/plugins/columnSorting/sortFunction/time.mjs +13 -0
- package/plugins/columnSorting/sortService/registry.js +4 -2
- package/plugins/columnSorting/sortService/registry.mjs +3 -1
- package/plugins/columnSorting/utils.js +64 -0
- package/plugins/columnSorting/utils.mjs +62 -0
- package/plugins/columnSummary/columnSummary.js +27 -10
- package/plugins/columnSummary/columnSummary.mjs +27 -10
- package/plugins/columnSummary/endpoints.js +15 -0
- package/plugins/columnSummary/endpoints.mjs +15 -0
- package/plugins/comments/comments.js +2 -8
- package/plugins/comments/comments.mjs +2 -8
- package/plugins/comments/contextMenuItem/addEditComment.js +0 -1
- package/plugins/comments/contextMenuItem/addEditComment.mjs +0 -1
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/copyPaste/copyPaste.js +9 -2
- package/plugins/copyPaste/copyPaste.mjs +9 -2
- package/plugins/copyPaste/pasteEvent.js +1 -0
- package/plugins/copyPaste/pasteEvent.mjs +1 -0
- package/plugins/filters/filters.js +1 -1
- package/plugins/filters/filters.mjs +1 -1
- package/plugins/filters/ui/multipleSelect.js +22 -14
- package/plugins/filters/ui/multipleSelect.mjs +22 -14
- package/plugins/filters/utils.js +7 -0
- package/plugins/filters/utils.mjs +7 -0
- package/plugins/formulas/formulas.d.ts +10 -0
- package/plugins/formulas/formulas.js +11 -2
- package/plugins/formulas/formulas.mjs +11 -2
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -1
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +1 -1
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +1 -1
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +1 -1
- package/plugins/hiddenColumns/hiddenColumns.js +8 -1
- package/plugins/hiddenColumns/hiddenColumns.mjs +8 -1
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -1
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +1 -1
- package/plugins/hiddenRows/contextMenuItem/showRow.js +1 -1
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +1 -1
- package/plugins/hiddenRows/hiddenRows.js +7 -0
- package/plugins/hiddenRows/hiddenRows.mjs +7 -0
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +1 -1
- package/plugins/manualColumnMove/manualColumnMove.mjs +1 -1
- package/plugins/manualColumnResize/manualColumnResize.js +3 -3
- package/plugins/manualColumnResize/manualColumnResize.mjs +3 -3
- package/plugins/manualRowMove/manualRowMove.js +1 -1
- package/plugins/manualRowMove/manualRowMove.mjs +1 -1
- package/plugins/manualRowResize/manualRowResize.d.ts +1 -0
- package/plugins/manualRowResize/manualRowResize.js +11 -2
- package/plugins/manualRowResize/manualRowResize.mjs +11 -2
- package/plugins/mergeCells/cellsCollection.js +7 -0
- package/plugins/mergeCells/cellsCollection.mjs +7 -0
- package/plugins/mergeCells/mergeCells.js +7 -0
- package/plugins/mergeCells/mergeCells.mjs +7 -0
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.js +7 -0
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +7 -0
- package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.js +7 -0
- package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs +7 -0
- package/plugins/nestedRows/nestedRows.js +7 -0
- package/plugins/nestedRows/nestedRows.mjs +7 -0
- package/plugins/trimRows/trimRows.js +7 -0
- package/plugins/trimRows/trimRows.mjs +7 -0
- package/selection/selection.js +163 -4
- package/selection/selection.mjs +163 -4
- package/selection/utils.js +7 -0
- package/selection/utils.mjs +7 -0
- package/settings.d.ts +1 -0
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -3
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -3
- package/shortcutContexts/commands/editor/closeAndSaveByArrowKeys.js +27 -0
- package/shortcutContexts/commands/editor/closeAndSaveByArrowKeys.mjs +24 -0
- package/shortcutContexts/commands/editor/closeAndSaveByEnter.js +11 -0
- package/shortcutContexts/commands/editor/closeAndSaveByEnter.mjs +8 -0
- package/shortcutContexts/commands/editor/index.js +3 -1
- package/shortcutContexts/commands/editor/index.mjs +3 -1
- package/shortcutContexts/editor.js +9 -1
- package/shortcutContexts/editor.mjs +9 -1
- package/shortcutContexts/index.js +1 -1
- package/shortcutContexts/index.mjs +1 -1
- package/shortcuts/keyObserver.js +7 -0
- package/shortcuts/keyObserver.mjs +7 -0
- package/shortcuts/utils.js +7 -0
- package/shortcuts/utils.mjs +7 -0
- package/tableView.js +1 -4
- package/tableView.mjs +1 -4
- package/translations/changesObservable/observable.js +7 -0
- package/translations/changesObservable/observable.mjs +7 -0
- package/translations/indexMapper.js +7 -0
- package/translations/indexMapper.mjs +8 -1
- package/utils/dataStructures/uniqueSet.js +7 -0
- package/utils/dataStructures/uniqueSet.mjs +7 -0
- package/utils/ghostTable.js +0 -4
- package/utils/ghostTable.mjs +0 -4
- package/utils/paginator.js +7 -0
- package/utils/paginator.mjs +7 -0
- package/validators/dateValidator/dateValidator.js +1 -3
- package/validators/dateValidator/dateValidator.mjs +1 -3
- package/validators/timeValidator/timeValidator.js +1 -3
- package/validators/timeValidator/timeValidator.mjs +1 -3
@@ -556,6 +556,9 @@ class CopyPaste extends _base.BasePlugin {
|
|
556
556
|
if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened()) {
|
557
557
|
return;
|
558
558
|
}
|
559
|
+
if (!this.hot.getSettings().outsideClickDeselects && event.target !== this.hot.rootDocument.body) {
|
560
|
+
return;
|
561
|
+
}
|
559
562
|
this.setCopyableText();
|
560
563
|
_classPrivateFieldSet(_isTriggeredByCopy, this, false);
|
561
564
|
const data = this.getRangedData(this.copyableRanges);
|
@@ -586,6 +589,9 @@ class CopyPaste extends _base.BasePlugin {
|
|
586
589
|
if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened()) {
|
587
590
|
return;
|
588
591
|
}
|
592
|
+
if (!this.hot.getSettings().outsideClickDeselects && event.target !== this.hot.rootDocument.body) {
|
593
|
+
return;
|
594
|
+
}
|
589
595
|
this.setCopyableText();
|
590
596
|
_classPrivateFieldSet(_isTriggeredByCut, this, false);
|
591
597
|
const rangedData = this.getRangedData(this.copyableRanges);
|
@@ -615,9 +621,10 @@ class CopyPaste extends _base.BasePlugin {
|
|
615
621
|
if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected()) {
|
616
622
|
return;
|
617
623
|
}
|
618
|
-
if (
|
619
|
-
|
624
|
+
if (!this.hot.getSettings().outsideClickDeselects && event.target !== this.hot.rootDocument.body) {
|
625
|
+
return;
|
620
626
|
}
|
627
|
+
event.preventDefault();
|
621
628
|
let pastedData;
|
622
629
|
if (event && typeof event.clipboardData !== 'undefined') {
|
623
630
|
const textHTML = (0, _string.sanitize)(event.clipboardData.getData('text/html'), {
|
@@ -552,6 +552,9 @@ export class CopyPaste extends BasePlugin {
|
|
552
552
|
if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened()) {
|
553
553
|
return;
|
554
554
|
}
|
555
|
+
if (!this.hot.getSettings().outsideClickDeselects && event.target !== this.hot.rootDocument.body) {
|
556
|
+
return;
|
557
|
+
}
|
555
558
|
this.setCopyableText();
|
556
559
|
_classPrivateFieldSet(_isTriggeredByCopy, this, false);
|
557
560
|
const data = this.getRangedData(this.copyableRanges);
|
@@ -582,6 +585,9 @@ export class CopyPaste extends BasePlugin {
|
|
582
585
|
if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened()) {
|
583
586
|
return;
|
584
587
|
}
|
588
|
+
if (!this.hot.getSettings().outsideClickDeselects && event.target !== this.hot.rootDocument.body) {
|
589
|
+
return;
|
590
|
+
}
|
585
591
|
this.setCopyableText();
|
586
592
|
_classPrivateFieldSet(_isTriggeredByCut, this, false);
|
587
593
|
const rangedData = this.getRangedData(this.copyableRanges);
|
@@ -611,9 +617,10 @@ export class CopyPaste extends BasePlugin {
|
|
611
617
|
if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected()) {
|
612
618
|
return;
|
613
619
|
}
|
614
|
-
if (
|
615
|
-
|
620
|
+
if (!this.hot.getSettings().outsideClickDeselects && event.target !== this.hot.rootDocument.body) {
|
621
|
+
return;
|
616
622
|
}
|
623
|
+
event.preventDefault();
|
617
624
|
let pastedData;
|
618
625
|
if (event && typeof event.clipboardData !== 'undefined') {
|
619
626
|
const textHTML = sanitize(event.clipboardData.getData('text/html'), {
|
@@ -508,7 +508,7 @@ class Filters extends _base.BasePlugin {
|
|
508
508
|
}
|
509
509
|
}
|
510
510
|
this.hot.runHooks('afterFilter', conditions);
|
511
|
-
this.hot.view.adjustElementsSize(
|
511
|
+
this.hot.view.adjustElementsSize();
|
512
512
|
this.hot.render();
|
513
513
|
if (this.hot.selection.isSelected()) {
|
514
514
|
this.hot.selectCell(navigableHeaders ? -1 : 0, this.hot.getSelectedRangeLast().highlight.col);
|
@@ -502,7 +502,7 @@ export class Filters extends BasePlugin {
|
|
502
502
|
}
|
503
503
|
}
|
504
504
|
this.hot.runHooks('afterFilter', conditions);
|
505
|
-
this.hot.view.adjustElementsSize(
|
505
|
+
this.hot.view.adjustElementsSize();
|
506
506
|
this.hot.render();
|
507
507
|
if (this.hot.selection.isSelected()) {
|
508
508
|
this.hot.selectCell(navigableHeaders ? -1 : 0, this.hot.getSelectedRangeLast().highlight.col);
|
@@ -5,7 +5,6 @@ require("core-js/modules/es.error.cause.js");
|
|
5
5
|
require("core-js/modules/es.array.push.js");
|
6
6
|
var _element = require("../../../helpers/dom/element");
|
7
7
|
var _object = require("../../../helpers/object");
|
8
|
-
var _array = require("../../../helpers/array");
|
9
8
|
var _unicode = require("../../../helpers/unicode");
|
10
9
|
var _function = require("../../../helpers/function");
|
11
10
|
var _data = require("../../../helpers/data");
|
@@ -251,11 +250,17 @@ class MultipleSelectUI extends _base.BaseUI {
|
|
251
250
|
beforeOnCellMouseUp: () => {
|
252
251
|
_classPrivateFieldGet(_itemsBox, this).listen();
|
253
252
|
},
|
253
|
+
modifyColWidth: width => {
|
254
|
+
const minWidth = _classPrivateFieldGet(_itemsBox, this).container.scrollWidth - (0, _element.getScrollbarWidth)(rootDocument);
|
255
|
+
if (width !== undefined && width < minWidth) {
|
256
|
+
return minWidth;
|
257
|
+
}
|
258
|
+
return width;
|
259
|
+
},
|
260
|
+
hiddenRows: true,
|
254
261
|
maxCols: 1,
|
255
262
|
autoWrapCol: true,
|
256
263
|
height: 110,
|
257
|
-
// Workaround for #151.
|
258
|
-
colWidths: () => _classPrivateFieldGet(_itemsBox, this).container.scrollWidth - (0, _element.getScrollbarWidth)(rootDocument),
|
259
264
|
copyPaste: false,
|
260
265
|
disableVisualSelection: 'area',
|
261
266
|
fillHandle: false,
|
@@ -342,13 +347,16 @@ class MultipleSelectUI extends _base.BaseUI {
|
|
342
347
|
exports.MultipleSelectUI = MultipleSelectUI;
|
343
348
|
function _onInput(event) {
|
344
349
|
const value = event.target.value.toLocaleLowerCase(this.getLocale());
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
350
|
+
const hiddenRows = _classPrivateFieldGet(_itemsBox, this).getPlugin('hiddenRows');
|
351
|
+
hiddenRows.showRows(hiddenRows.getHiddenRows());
|
352
|
+
_classPrivateFieldGet(_items, this).forEach((item, index) => {
|
353
|
+
item.checked = `${item.value}`.toLocaleLowerCase(this.getLocale()).indexOf(value) >= 0;
|
354
|
+
if (!item.checked) {
|
355
|
+
hiddenRows.hideRow(index);
|
356
|
+
}
|
357
|
+
});
|
358
|
+
_classPrivateFieldGet(_itemsBox, this).view.adjustElementsSize();
|
359
|
+
_classPrivateFieldGet(_itemsBox, this).render();
|
352
360
|
}
|
353
361
|
/**
|
354
362
|
* 'keydown' event listener for input element.
|
@@ -373,7 +381,7 @@ function _onInputKeyDown(event) {
|
|
373
381
|
function _onSelectAllClick(event) {
|
374
382
|
const changes = [];
|
375
383
|
event.preventDefault();
|
376
|
-
|
384
|
+
_classPrivateFieldGet(_itemsBox, this).getSourceData().forEach((row, rowIndex) => {
|
377
385
|
row.checked = true;
|
378
386
|
changes.push((0, _data.dataRowToChangesArray)(row, rowIndex)[0]);
|
379
387
|
});
|
@@ -387,7 +395,7 @@ function _onSelectAllClick(event) {
|
|
387
395
|
function _onClearAllClick(event) {
|
388
396
|
const changes = [];
|
389
397
|
event.preventDefault();
|
390
|
-
|
398
|
+
_classPrivateFieldGet(_itemsBox, this).getSourceData().forEach((row, rowIndex) => {
|
391
399
|
row.checked = false;
|
392
400
|
changes.push((0, _data.dataRowToChangesArray)(row, rowIndex)[0]);
|
393
401
|
});
|
@@ -403,7 +411,7 @@ var _default = exports.default = MultipleSelectUI;
|
|
403
411
|
*/
|
404
412
|
function valueToItems(availableItems, selectedValue) {
|
405
413
|
const arrayAssertion = (0, _utils.createArrayAssertion)(selectedValue);
|
406
|
-
return
|
414
|
+
return availableItems.map(item => {
|
407
415
|
item.checked = arrayAssertion(item.value);
|
408
416
|
return item;
|
409
417
|
});
|
@@ -417,7 +425,7 @@ function valueToItems(availableItems, selectedValue) {
|
|
417
425
|
*/
|
418
426
|
function itemsToValue(availableItems) {
|
419
427
|
const items = [];
|
420
|
-
|
428
|
+
availableItems.forEach(item => {
|
421
429
|
if (item.checked) {
|
422
430
|
items.push(item.value);
|
423
431
|
}
|
@@ -8,7 +8,6 @@ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a),
|
|
8
8
|
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
9
9
|
import { addClass, getScrollbarWidth } from "../../../helpers/dom/element.mjs";
|
10
10
|
import { clone, extend } from "../../../helpers/object.mjs";
|
11
|
-
import { arrayFilter, arrayMap, arrayEach } from "../../../helpers/array.mjs";
|
12
11
|
import { isKey } from "../../../helpers/unicode.mjs";
|
13
12
|
import { partial } from "../../../helpers/function.mjs";
|
14
13
|
import { dataRowToChangesArray } from "../../../helpers/data.mjs";
|
@@ -246,11 +245,17 @@ export class MultipleSelectUI extends BaseUI {
|
|
246
245
|
beforeOnCellMouseUp: () => {
|
247
246
|
_classPrivateFieldGet(_itemsBox, this).listen();
|
248
247
|
},
|
248
|
+
modifyColWidth: width => {
|
249
|
+
const minWidth = _classPrivateFieldGet(_itemsBox, this).container.scrollWidth - getScrollbarWidth(rootDocument);
|
250
|
+
if (width !== undefined && width < minWidth) {
|
251
|
+
return minWidth;
|
252
|
+
}
|
253
|
+
return width;
|
254
|
+
},
|
255
|
+
hiddenRows: true,
|
249
256
|
maxCols: 1,
|
250
257
|
autoWrapCol: true,
|
251
258
|
height: 110,
|
252
|
-
// Workaround for #151.
|
253
|
-
colWidths: () => _classPrivateFieldGet(_itemsBox, this).container.scrollWidth - getScrollbarWidth(rootDocument),
|
254
259
|
copyPaste: false,
|
255
260
|
disableVisualSelection: 'area',
|
256
261
|
fillHandle: false,
|
@@ -336,13 +341,16 @@ export class MultipleSelectUI extends BaseUI {
|
|
336
341
|
}
|
337
342
|
function _onInput(event) {
|
338
343
|
const value = event.target.value.toLocaleLowerCase(this.getLocale());
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
344
|
+
const hiddenRows = _classPrivateFieldGet(_itemsBox, this).getPlugin('hiddenRows');
|
345
|
+
hiddenRows.showRows(hiddenRows.getHiddenRows());
|
346
|
+
_classPrivateFieldGet(_items, this).forEach((item, index) => {
|
347
|
+
item.checked = `${item.value}`.toLocaleLowerCase(this.getLocale()).indexOf(value) >= 0;
|
348
|
+
if (!item.checked) {
|
349
|
+
hiddenRows.hideRow(index);
|
350
|
+
}
|
351
|
+
});
|
352
|
+
_classPrivateFieldGet(_itemsBox, this).view.adjustElementsSize();
|
353
|
+
_classPrivateFieldGet(_itemsBox, this).render();
|
346
354
|
}
|
347
355
|
/**
|
348
356
|
* 'keydown' event listener for input element.
|
@@ -367,7 +375,7 @@ function _onInputKeyDown(event) {
|
|
367
375
|
function _onSelectAllClick(event) {
|
368
376
|
const changes = [];
|
369
377
|
event.preventDefault();
|
370
|
-
|
378
|
+
_classPrivateFieldGet(_itemsBox, this).getSourceData().forEach((row, rowIndex) => {
|
371
379
|
row.checked = true;
|
372
380
|
changes.push(dataRowToChangesArray(row, rowIndex)[0]);
|
373
381
|
});
|
@@ -381,7 +389,7 @@ function _onSelectAllClick(event) {
|
|
381
389
|
function _onClearAllClick(event) {
|
382
390
|
const changes = [];
|
383
391
|
event.preventDefault();
|
384
|
-
|
392
|
+
_classPrivateFieldGet(_itemsBox, this).getSourceData().forEach((row, rowIndex) => {
|
385
393
|
row.checked = false;
|
386
394
|
changes.push(dataRowToChangesArray(row, rowIndex)[0]);
|
387
395
|
});
|
@@ -398,7 +406,7 @@ export default MultipleSelectUI;
|
|
398
406
|
*/
|
399
407
|
function valueToItems(availableItems, selectedValue) {
|
400
408
|
const arrayAssertion = createArrayAssertion(selectedValue);
|
401
|
-
return
|
409
|
+
return availableItems.map(item => {
|
402
410
|
item.checked = arrayAssertion(item.value);
|
403
411
|
return item;
|
404
412
|
});
|
@@ -412,7 +420,7 @@ function valueToItems(availableItems, selectedValue) {
|
|
412
420
|
*/
|
413
421
|
function itemsToValue(availableItems) {
|
414
422
|
const items = [];
|
415
|
-
|
423
|
+
availableItems.forEach(item => {
|
416
424
|
if (item.checked) {
|
417
425
|
items.push(item.value);
|
418
426
|
}
|
package/plugins/filters/utils.js
CHANGED
@@ -8,6 +8,13 @@ exports.toEmptyString = toEmptyString;
|
|
8
8
|
exports.toVisualValue = toVisualValue;
|
9
9
|
exports.unifyColumnValues = unifyColumnValues;
|
10
10
|
require("core-js/modules/es.array.push.js");
|
11
|
+
require("core-js/modules/esnext.set.difference.v2.js");
|
12
|
+
require("core-js/modules/esnext.set.intersection.v2.js");
|
13
|
+
require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
|
14
|
+
require("core-js/modules/esnext.set.is-subset-of.v2.js");
|
15
|
+
require("core-js/modules/esnext.set.is-superset-of.v2.js");
|
16
|
+
require("core-js/modules/esnext.set.symmetric-difference.v2.js");
|
17
|
+
require("core-js/modules/esnext.set.union.v2.js");
|
11
18
|
var _feature = require("../../helpers/feature");
|
12
19
|
var _array = require("../../helpers/array");
|
13
20
|
const sortCompare = (0, _feature.getComparisonFunction)();
|
@@ -1,4 +1,11 @@
|
|
1
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/esnext.set.difference.v2.js";
|
3
|
+
import "core-js/modules/esnext.set.intersection.v2.js";
|
4
|
+
import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
|
5
|
+
import "core-js/modules/esnext.set.is-subset-of.v2.js";
|
6
|
+
import "core-js/modules/esnext.set.is-superset-of.v2.js";
|
7
|
+
import "core-js/modules/esnext.set.symmetric-difference.v2.js";
|
8
|
+
import "core-js/modules/esnext.set.union.v2.js";
|
2
9
|
import { getComparisonFunction } from "../../helpers/feature.mjs";
|
3
10
|
import { arrayUnique, arrayEach } from "../../helpers/array.mjs";
|
4
11
|
const sortCompare = getComparisonFunction();
|
@@ -2,17 +2,27 @@ import {
|
|
2
2
|
CellType as HyperFormulaCellType,
|
3
3
|
ConfigParams,
|
4
4
|
HyperFormula,
|
5
|
+
RawCellContent,
|
6
|
+
NamedExpressionOptions,
|
5
7
|
} from 'hyperformula';
|
6
8
|
import Core from '../../core';
|
7
9
|
import { CellValue } from '../../common';
|
8
10
|
import { BasePlugin } from '../base';
|
9
11
|
|
12
|
+
type NamedExpressions = {
|
13
|
+
name: string;
|
14
|
+
expression: RawCellContent;
|
15
|
+
scope?: number;
|
16
|
+
options?: NamedExpressionOptions;
|
17
|
+
}
|
18
|
+
|
10
19
|
export interface HyperFormulaSettings extends Partial<ConfigParams> {
|
11
20
|
hyperformula: typeof HyperFormula | HyperFormula;
|
12
21
|
}
|
13
22
|
export interface DetailedSettings {
|
14
23
|
engine: typeof HyperFormula | HyperFormula | HyperFormulaSettings;
|
15
24
|
sheetName?: string;
|
25
|
+
namedExpressions?: NamedExpressions[],
|
16
26
|
}
|
17
27
|
|
18
28
|
export type Settings = DetailedSettings;
|
@@ -4,6 +4,13 @@ exports.__esModule = true;
|
|
4
4
|
require("core-js/modules/es.error.cause.js");
|
5
5
|
require("core-js/modules/es.array.push.js");
|
6
6
|
require("core-js/modules/es.json.stringify.js");
|
7
|
+
require("core-js/modules/esnext.set.difference.v2.js");
|
8
|
+
require("core-js/modules/esnext.set.intersection.v2.js");
|
9
|
+
require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
|
10
|
+
require("core-js/modules/esnext.set.is-subset-of.v2.js");
|
11
|
+
require("core-js/modules/esnext.set.is-superset-of.v2.js");
|
12
|
+
require("core-js/modules/esnext.set.symmetric-difference.v2.js");
|
13
|
+
require("core-js/modules/esnext.set.union.v2.js");
|
7
14
|
var _base = require("../base");
|
8
15
|
var _staticRegister = _interopRequireDefault(require("../../utils/staticRegister"));
|
9
16
|
var _console = require("../../helpers/console");
|
@@ -1127,7 +1134,8 @@ function _onAfterRemoveRow(row, amount, physicalRows, source) {
|
|
1127
1134
|
if (isBlockedSource(source)) {
|
1128
1135
|
return;
|
1129
1136
|
}
|
1130
|
-
const descendingHfRows = this.rowAxisSyncer.getRemovedHfIndexes().sort(
|
1137
|
+
const descendingHfRows = this.rowAxisSyncer.getRemovedHfIndexes().sort((a, b) => b - a); // sort numeric values descending
|
1138
|
+
|
1131
1139
|
const changes = this.engine.batch(() => {
|
1132
1140
|
descendingHfRows.forEach(hfRow => {
|
1133
1141
|
this.engine.removeRows(this.sheetId, [hfRow, 1]);
|
@@ -1148,7 +1156,8 @@ function _onAfterRemoveCol(col, amount, physicalColumns, source) {
|
|
1148
1156
|
if (isBlockedSource(source)) {
|
1149
1157
|
return;
|
1150
1158
|
}
|
1151
|
-
const descendingHfColumns = this.columnAxisSyncer.getRemovedHfIndexes().sort(
|
1159
|
+
const descendingHfColumns = this.columnAxisSyncer.getRemovedHfIndexes().sort((a, b) => b - a); // sort numeric values descending
|
1160
|
+
|
1152
1161
|
const changes = this.engine.batch(() => {
|
1153
1162
|
descendingHfColumns.forEach(hfColumn => {
|
1154
1163
|
this.engine.removeColumns(this.sheetId, [hfColumn, 1]);
|
@@ -1,6 +1,13 @@
|
|
1
1
|
import "core-js/modules/es.error.cause.js";
|
2
2
|
import "core-js/modules/es.array.push.js";
|
3
3
|
import "core-js/modules/es.json.stringify.js";
|
4
|
+
import "core-js/modules/esnext.set.difference.v2.js";
|
5
|
+
import "core-js/modules/esnext.set.intersection.v2.js";
|
6
|
+
import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
|
7
|
+
import "core-js/modules/esnext.set.is-subset-of.v2.js";
|
8
|
+
import "core-js/modules/esnext.set.is-superset-of.v2.js";
|
9
|
+
import "core-js/modules/esnext.set.symmetric-difference.v2.js";
|
10
|
+
import "core-js/modules/esnext.set.union.v2.js";
|
4
11
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
5
12
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
@@ -1122,7 +1129,8 @@ function _onAfterRemoveRow(row, amount, physicalRows, source) {
|
|
1122
1129
|
if (isBlockedSource(source)) {
|
1123
1130
|
return;
|
1124
1131
|
}
|
1125
|
-
const descendingHfRows = this.rowAxisSyncer.getRemovedHfIndexes().sort(
|
1132
|
+
const descendingHfRows = this.rowAxisSyncer.getRemovedHfIndexes().sort((a, b) => b - a); // sort numeric values descending
|
1133
|
+
|
1126
1134
|
const changes = this.engine.batch(() => {
|
1127
1135
|
descendingHfRows.forEach(hfRow => {
|
1128
1136
|
this.engine.removeRows(this.sheetId, [hfRow, 1]);
|
@@ -1143,7 +1151,8 @@ function _onAfterRemoveCol(col, amount, physicalColumns, source) {
|
|
1143
1151
|
if (isBlockedSource(source)) {
|
1144
1152
|
return;
|
1145
1153
|
}
|
1146
|
-
const descendingHfColumns = this.columnAxisSyncer.getRemovedHfIndexes().sort(
|
1154
|
+
const descendingHfColumns = this.columnAxisSyncer.getRemovedHfIndexes().sort((a, b) => b - a); // sort numeric values descending
|
1155
|
+
|
1147
1156
|
const changes = this.engine.batch(() => {
|
1148
1157
|
descendingHfColumns.forEach(hfColumn => {
|
1149
1158
|
this.engine.removeColumns(this.sheetId, [hfColumn, 1]);
|
@@ -36,7 +36,7 @@ function showColumnItem(hiddenColumnsPlugin) {
|
|
36
36
|
// We render columns at first. It was needed for getting fixed columns.
|
37
37
|
// Please take a look at #6864 for broader description.
|
38
38
|
this.render();
|
39
|
-
this.view.adjustElementsSize(
|
39
|
+
this.view.adjustElementsSize();
|
40
40
|
const allColumnsSelected = endVisualColumn - startVisualColumn + 1 === this.countCols();
|
41
41
|
|
42
42
|
// When all headers needs to be selected then do nothing. The header selection is
|
@@ -30,7 +30,7 @@ export default function showColumnItem(hiddenColumnsPlugin) {
|
|
30
30
|
// We render columns at first. It was needed for getting fixed columns.
|
31
31
|
// Please take a look at #6864 for broader description.
|
32
32
|
this.render();
|
33
|
-
this.view.adjustElementsSize(
|
33
|
+
this.view.adjustElementsSize();
|
34
34
|
const allColumnsSelected = endVisualColumn - startVisualColumn + 1 === this.countCols();
|
35
35
|
|
36
36
|
// When all headers needs to be selected then do nothing. The header selection is
|
@@ -3,6 +3,13 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
require("core-js/modules/es.error.cause.js");
|
5
5
|
require("core-js/modules/es.array.push.js");
|
6
|
+
require("core-js/modules/esnext.set.difference.v2.js");
|
7
|
+
require("core-js/modules/esnext.set.intersection.v2.js");
|
8
|
+
require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
|
9
|
+
require("core-js/modules/esnext.set.is-subset-of.v2.js");
|
10
|
+
require("core-js/modules/esnext.set.is-superset-of.v2.js");
|
11
|
+
require("core-js/modules/esnext.set.symmetric-difference.v2.js");
|
12
|
+
require("core-js/modules/esnext.set.union.v2.js");
|
6
13
|
var _base = require("../base");
|
7
14
|
var _element = require("../../helpers/dom/element");
|
8
15
|
var _number = require("../../helpers/number");
|
@@ -204,7 +211,7 @@ class HiddenColumns extends _base.BasePlugin {
|
|
204
211
|
return _assertClassBrand(_HiddenColumns_brand, _this, _onAfterContextMenuDefaultOptions).call(_this, ...args);
|
205
212
|
});
|
206
213
|
this.addHook('afterGetCellMeta', (row, col, cellProperties) => _assertClassBrand(_HiddenColumns_brand, this, _onAfterGetCellMeta).call(this, row, col, cellProperties));
|
207
|
-
this.addHook('modifyColWidth', (width, col) => _assertClassBrand(_HiddenColumns_brand, this, _onModifyColWidth).call(this, width, col));
|
214
|
+
this.addHook('modifyColWidth', (width, col) => _assertClassBrand(_HiddenColumns_brand, this, _onModifyColWidth).call(this, width, col), 2);
|
208
215
|
this.addHook('afterGetColHeader', function () {
|
209
216
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
210
217
|
args[_key2] = arguments[_key2];
|
@@ -1,5 +1,12 @@
|
|
1
1
|
import "core-js/modules/es.error.cause.js";
|
2
2
|
import "core-js/modules/es.array.push.js";
|
3
|
+
import "core-js/modules/esnext.set.difference.v2.js";
|
4
|
+
import "core-js/modules/esnext.set.intersection.v2.js";
|
5
|
+
import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
|
6
|
+
import "core-js/modules/esnext.set.is-subset-of.v2.js";
|
7
|
+
import "core-js/modules/esnext.set.is-superset-of.v2.js";
|
8
|
+
import "core-js/modules/esnext.set.symmetric-difference.v2.js";
|
9
|
+
import "core-js/modules/esnext.set.union.v2.js";
|
3
10
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
4
11
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
5
12
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
@@ -200,7 +207,7 @@ export class HiddenColumns extends BasePlugin {
|
|
200
207
|
return _assertClassBrand(_HiddenColumns_brand, _this, _onAfterContextMenuDefaultOptions).call(_this, ...args);
|
201
208
|
});
|
202
209
|
this.addHook('afterGetCellMeta', (row, col, cellProperties) => _assertClassBrand(_HiddenColumns_brand, this, _onAfterGetCellMeta).call(this, row, col, cellProperties));
|
203
|
-
this.addHook('modifyColWidth', (width, col) => _assertClassBrand(_HiddenColumns_brand, this, _onModifyColWidth).call(this, width, col));
|
210
|
+
this.addHook('modifyColWidth', (width, col) => _assertClassBrand(_HiddenColumns_brand, this, _onModifyColWidth).call(this, width, col), 2);
|
204
211
|
this.addHook('afterGetColHeader', function () {
|
205
212
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
206
213
|
args[_key2] = arguments[_key2];
|
@@ -36,7 +36,7 @@ function showRowItem(hiddenRowsPlugin) {
|
|
36
36
|
// We render rows at first. It was needed for getting fixed rows.
|
37
37
|
// Please take a look at #6864 for broader description.
|
38
38
|
this.render();
|
39
|
-
this.view.adjustElementsSize(
|
39
|
+
this.view.adjustElementsSize();
|
40
40
|
const allRowsSelected = endVisualRow - startVisualRow + 1 === this.countRows();
|
41
41
|
|
42
42
|
// When all headers needs to be selected then do nothing. The header selection is
|
@@ -30,7 +30,7 @@ export default function showRowItem(hiddenRowsPlugin) {
|
|
30
30
|
// We render rows at first. It was needed for getting fixed rows.
|
31
31
|
// Please take a look at #6864 for broader description.
|
32
32
|
this.render();
|
33
|
-
this.view.adjustElementsSize(
|
33
|
+
this.view.adjustElementsSize();
|
34
34
|
const allRowsSelected = endVisualRow - startVisualRow + 1 === this.countRows();
|
35
35
|
|
36
36
|
// When all headers needs to be selected then do nothing. The header selection is
|
@@ -3,6 +3,13 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
require("core-js/modules/es.error.cause.js");
|
5
5
|
require("core-js/modules/es.array.push.js");
|
6
|
+
require("core-js/modules/esnext.set.difference.v2.js");
|
7
|
+
require("core-js/modules/esnext.set.intersection.v2.js");
|
8
|
+
require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
|
9
|
+
require("core-js/modules/esnext.set.is-subset-of.v2.js");
|
10
|
+
require("core-js/modules/esnext.set.is-superset-of.v2.js");
|
11
|
+
require("core-js/modules/esnext.set.symmetric-difference.v2.js");
|
12
|
+
require("core-js/modules/esnext.set.union.v2.js");
|
6
13
|
var _base = require("../base");
|
7
14
|
var _element = require("../../helpers/dom/element");
|
8
15
|
var _number = require("../../helpers/number");
|
@@ -1,5 +1,12 @@
|
|
1
1
|
import "core-js/modules/es.error.cause.js";
|
2
2
|
import "core-js/modules/es.array.push.js";
|
3
|
+
import "core-js/modules/esnext.set.difference.v2.js";
|
4
|
+
import "core-js/modules/esnext.set.intersection.v2.js";
|
5
|
+
import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
|
6
|
+
import "core-js/modules/esnext.set.is-subset-of.v2.js";
|
7
|
+
import "core-js/modules/esnext.set.is-superset-of.v2.js";
|
8
|
+
import "core-js/modules/esnext.set.symmetric-difference.v2.js";
|
9
|
+
import "core-js/modules/esnext.set.union.v2.js";
|
3
10
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
4
11
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
5
12
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
@@ -23,7 +23,7 @@ function freezeColumnItem(manualColumnFreezePlugin) {
|
|
23
23
|
}] = selected;
|
24
24
|
manualColumnFreezePlugin.freezeColumn(selectedColumn);
|
25
25
|
this.render();
|
26
|
-
this.view.adjustElementsSize(
|
26
|
+
this.view.adjustElementsSize();
|
27
27
|
},
|
28
28
|
hidden() {
|
29
29
|
const selection = this.getSelectedRange();
|
@@ -17,7 +17,7 @@ export default function freezeColumnItem(manualColumnFreezePlugin) {
|
|
17
17
|
}] = selected;
|
18
18
|
manualColumnFreezePlugin.freezeColumn(selectedColumn);
|
19
19
|
this.render();
|
20
|
-
this.view.adjustElementsSize(
|
20
|
+
this.view.adjustElementsSize();
|
21
21
|
},
|
22
22
|
hidden() {
|
23
23
|
const selection = this.getSelectedRange();
|
@@ -23,7 +23,7 @@ function unfreezeColumnItem(manualColumnFreezePlugin) {
|
|
23
23
|
}] = selected;
|
24
24
|
manualColumnFreezePlugin.unfreezeColumn(selectedColumn);
|
25
25
|
this.render();
|
26
|
-
this.view.adjustElementsSize(
|
26
|
+
this.view.adjustElementsSize();
|
27
27
|
},
|
28
28
|
hidden() {
|
29
29
|
const selection = this.getSelectedRange();
|
@@ -17,7 +17,7 @@ export default function unfreezeColumnItem(manualColumnFreezePlugin) {
|
|
17
17
|
}] = selected;
|
18
18
|
manualColumnFreezePlugin.unfreezeColumn(selectedColumn);
|
19
19
|
this.render();
|
20
|
-
this.view.adjustElementsSize(
|
20
|
+
this.view.adjustElementsSize();
|
21
21
|
},
|
22
22
|
hidden() {
|
23
23
|
const selection = this.getSelectedRange();
|
@@ -655,7 +655,7 @@ function _onMouseUp() {
|
|
655
655
|
if (movePerformed === true) {
|
656
656
|
this.persistentStateSave();
|
657
657
|
this.hot.render();
|
658
|
-
this.hot.view.adjustElementsSize(
|
658
|
+
this.hot.view.adjustElementsSize();
|
659
659
|
const selectionStart = this.hot.toVisualColumn(firstMovedPhysicalColumn);
|
660
660
|
const selectionEnd = selectionStart + columnsLen - 1;
|
661
661
|
this.hot.selectColumns(selectionStart, selectionEnd);
|