handsontable 0.0.0-next-87b048b-20250409 → 0.0.0-next-ff10728-20250410
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.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/cell/range.js +0 -14
- package/3rdparty/walkontable/src/cell/range.mjs +0 -14
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +1 -4
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +1 -4
- package/3rdparty/walkontable/src/selection/border/border.js +0 -5
- package/3rdparty/walkontable/src/selection/border/border.mjs +0 -5
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +4 -3
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +4 -3
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +10 -8
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +10 -8
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +4 -3
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +4 -3
- package/3rdparty/walkontable/src/table.js +2 -5
- package/3rdparty/walkontable/src/table.mjs +2 -5
- package/CHANGELOG.md +0 -39
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/focusDetector.js +1 -1
- package/core/focusCatcher/focusDetector.mjs +2 -2
- package/core/hooks/constants.js +0 -8
- package/core/hooks/constants.mjs +0 -8
- package/core/hooks/index.d.ts +0 -1
- package/core.d.ts +1 -0
- package/core.js +25 -32
- package/core.mjs +26 -33
- package/dataMap/dataMap.js +7 -0
- package/dataMap/dataMap.mjs +7 -0
- package/dataMap/metaManager/metaSchema.js +0 -1
- package/dataMap/metaManager/metaSchema.mjs +0 -1
- package/dist/handsontable.css +3 -3
- package/dist/handsontable.full.css +3 -3
- package/dist/handsontable.full.js +350 -437
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +17 -17
- package/dist/handsontable.js +350 -437
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +18 -18
- package/editorManager.js +7 -1
- package/editorManager.mjs +7 -1
- package/editors/autocompleteEditor/autocompleteEditor.js +4 -14
- package/editors/autocompleteEditor/autocompleteEditor.mjs +4 -14
- package/editors/textEditor/textEditor.js +1 -1
- package/editors/textEditor/textEditor.mjs +2 -2
- package/helpers/browser.js +1 -1
- package/helpers/browser.mjs +1 -1
- package/helpers/dom/element.js +2 -2
- package/helpers/dom/element.mjs +1 -1
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/object.js +0 -3
- package/helpers/object.mjs +0 -3
- package/package.json +1 -1
- package/plugins/autoColumnSize/autoColumnSize.js +1 -1
- package/plugins/autoColumnSize/autoColumnSize.mjs +1 -1
- package/plugins/autoRowSize/autoRowSize.js +6 -1
- package/plugins/autoRowSize/autoRowSize.mjs +6 -1
- package/plugins/columnSorting/columnSorting.js +4 -0
- package/plugins/columnSorting/columnSorting.mjs +4 -0
- package/plugins/comments/comments.js +0 -1
- package/plugins/comments/comments.mjs +0 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +2 -2
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +2 -2
- package/plugins/contextMenu/menu/menu.js +0 -1
- package/plugins/contextMenu/menu/menu.mjs +0 -1
- package/plugins/contextMenu/menu/positioner.js +2 -10
- package/plugins/contextMenu/menu/positioner.mjs +2 -10
- package/plugins/copyPaste/copyPaste.js +15 -12
- package/plugins/copyPaste/copyPaste.mjs +16 -13
- package/plugins/copyPaste/pasteEvent.js +0 -3
- package/plugins/copyPaste/pasteEvent.mjs +0 -3
- package/plugins/filters/filters.js +24 -25
- package/plugins/filters/filters.mjs +24 -25
- package/plugins/filters/ui/multipleSelect.js +1 -7
- package/plugins/filters/ui/multipleSelect.mjs +1 -7
- package/plugins/hiddenColumns/hiddenColumns.js +1 -1
- package/plugins/hiddenColumns/hiddenColumns.mjs +1 -1
- package/plugins/hiddenRows/hiddenRows.js +1 -1
- package/plugins/hiddenRows/hiddenRows.mjs +1 -1
- package/plugins/manualColumnResize/manualColumnResize.js +6 -4
- package/plugins/manualColumnResize/manualColumnResize.mjs +6 -4
- package/plugins/manualRowResize/manualRowResize.js +6 -4
- package/plugins/manualRowResize/manualRowResize.mjs +6 -4
- package/plugins/mergeCells/mergeCells.js +29 -8
- package/plugins/mergeCells/mergeCells.mjs +29 -8
- package/plugins/mergeCells/renderer.js +0 -15
- package/plugins/mergeCells/renderer.mjs +0 -15
- package/plugins/nestedRows/data/dataManager.js +2 -2
- package/plugins/nestedRows/data/dataManager.mjs +2 -2
- package/plugins/undoRedo/actions/removeColumn.js +14 -19
- package/plugins/undoRedo/actions/removeColumn.mjs +14 -19
- package/plugins/undoRedo/actions/removeRow.js +4 -12
- package/plugins/undoRedo/actions/removeRow.mjs +4 -12
- package/selection/selection.js +1 -3
- package/selection/selection.mjs +1 -3
- package/styles/handsontable.css +15 -14
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-horizon.css +2 -2
- package/styles/ht-theme-horizon.min.css +2 -2
- package/styles/ht-theme-main.css +2 -2
- package/styles/ht-theme-main.min.css +2 -2
- package/tableView.js +8 -5
- package/tableView.mjs +8 -5
- package/utils/ghostTable.js +0 -3
- package/utils/ghostTable.mjs +0 -3
- package/plugins/mergeCells/utils.js +0 -31
- package/plugins/mergeCells/utils.mjs +0 -27
|
@@ -17,7 +17,7 @@ import { Hooks } from "../../core/hooks/index.mjs";
|
|
|
17
17
|
import { stringify, parse } from "../../3rdparty/SheetClip/index.mjs";
|
|
18
18
|
import { arrayEach } from "../../helpers/array.mjs";
|
|
19
19
|
import { sanitize } from "../../helpers/string.mjs";
|
|
20
|
-
import { removeContentEditableFromElementAndDeselect, runWithSelectedContendEditableElement, makeElementContentEditableAndSelectItsContent, isHTMLElement
|
|
20
|
+
import { removeContentEditableFromElementAndDeselect, runWithSelectedContendEditableElement, makeElementContentEditableAndSelectItsContent, isHTMLElement } from "../../helpers/dom/element.mjs";
|
|
21
21
|
import { isSafari } from "../../helpers/browser.mjs";
|
|
22
22
|
import copyItem from "./contextMenuItem/copy.mjs";
|
|
23
23
|
import copyColumnHeadersOnlyItem from "./contextMenuItem/copyColumnHeadersOnly.mjs";
|
|
@@ -252,9 +252,6 @@ export class CopyPaste extends BasePlugin {
|
|
|
252
252
|
return _assertClassBrand(_CopyPaste_brand, _this, _onAfterSelection).call(_this, ...args);
|
|
253
253
|
});
|
|
254
254
|
this.addHook('afterSelectionEnd', () => _assertClassBrand(_CopyPaste_brand, this, _onAfterSelectionEnd).call(this));
|
|
255
|
-
|
|
256
|
-
// Events are attached to the document, not the root table element - as it should,
|
|
257
|
-
// for Chrome 133 and lower to copy/paste/cut work properly (#dev-2277).
|
|
258
255
|
this.eventManager.addEventListener(this.hot.rootDocument, 'copy', function () {
|
|
259
256
|
return _this.onCopy(...arguments);
|
|
260
257
|
});
|
|
@@ -561,10 +558,12 @@ export class CopyPaste extends BasePlugin {
|
|
|
561
558
|
* @private
|
|
562
559
|
*/
|
|
563
560
|
onCopy(event) {
|
|
564
|
-
|
|
561
|
+
var _event$target, _this$hot$getSelected;
|
|
565
562
|
const focusedElement = this.hot.getFocusManager().getRefocusElement();
|
|
566
|
-
const isHotInput =
|
|
567
|
-
|
|
563
|
+
const isHotInput = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.hasAttribute('data-hot-input');
|
|
564
|
+
const selectedCell = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
|
565
|
+
const TD = selectedCell ? this.hot.getCell(selectedCell.row, selectedCell.col, true) : null;
|
|
566
|
+
if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened() || isHTMLElement(event.target) && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body && TD !== event.target)) {
|
|
568
567
|
return;
|
|
569
568
|
}
|
|
570
569
|
event.preventDefault();
|
|
@@ -594,10 +593,12 @@ export class CopyPaste extends BasePlugin {
|
|
|
594
593
|
* @private
|
|
595
594
|
*/
|
|
596
595
|
onCut(event) {
|
|
597
|
-
|
|
596
|
+
var _event$target2, _this$hot$getSelected2;
|
|
598
597
|
const focusedElement = this.hot.getFocusManager().getRefocusElement();
|
|
599
|
-
const isHotInput =
|
|
600
|
-
|
|
598
|
+
const isHotInput = (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.hasAttribute('data-hot-input');
|
|
599
|
+
const selectedCell = (_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight;
|
|
600
|
+
const TD = selectedCell ? this.hot.getCell(selectedCell.row, selectedCell.col, true) : null;
|
|
601
|
+
if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened() || isHTMLElement(event.target) && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body && TD !== event.target)) {
|
|
601
602
|
return;
|
|
602
603
|
}
|
|
603
604
|
event.preventDefault();
|
|
@@ -626,10 +627,12 @@ export class CopyPaste extends BasePlugin {
|
|
|
626
627
|
* @private
|
|
627
628
|
*/
|
|
628
629
|
onPaste(event) {
|
|
629
|
-
|
|
630
|
+
var _event$target3, _this$hot$getSelected3;
|
|
630
631
|
const focusedElement = this.hot.getFocusManager().getRefocusElement();
|
|
631
|
-
const isHotInput =
|
|
632
|
-
|
|
632
|
+
const isHotInput = (_event$target3 = event.target) === null || _event$target3 === void 0 ? void 0 : _event$target3.hasAttribute('data-hot-input');
|
|
633
|
+
const selectedCell = (_this$hot$getSelected3 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected3 === void 0 ? void 0 : _this$hot$getSelected3.highlight;
|
|
634
|
+
const TD = selectedCell ? this.hot.getCell(selectedCell.row, selectedCell.col, true) : null;
|
|
635
|
+
if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected() || isHTMLElement(event.target) && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body && TD !== event.target)) {
|
|
633
636
|
return;
|
|
634
637
|
}
|
|
635
638
|
event.preventDefault();
|
|
@@ -542,10 +542,10 @@ class Filters extends _base.BasePlugin {
|
|
|
542
542
|
*
|
|
543
543
|
* @returns {Array}
|
|
544
544
|
*/
|
|
545
|
+
/* eslint-enable jsdoc/require-description-complete-sentence */
|
|
545
546
|
exportConditions() {
|
|
546
547
|
return this.conditionCollection.exportAllConditions();
|
|
547
548
|
}
|
|
548
|
-
/* eslint-enable jsdoc/require-description-complete-sentence */
|
|
549
549
|
|
|
550
550
|
/**
|
|
551
551
|
* Filters data based on added filter conditions.
|
|
@@ -562,39 +562,38 @@ class Filters extends _base.BasePlugin {
|
|
|
562
562
|
let visibleVisualRows = [];
|
|
563
563
|
const conditions = this.exportConditions();
|
|
564
564
|
const allowFiltering = this.hot.runHooks('beforeFilter', conditions, _classPrivateFieldGet(_previousConditionStack, this));
|
|
565
|
-
if (allowFiltering !== false
|
|
566
|
-
|
|
567
|
-
|
|
565
|
+
if (allowFiltering !== false) {
|
|
566
|
+
if (needToFilter) {
|
|
567
|
+
const trimmedRows = [];
|
|
568
|
+
this.hot.batchExecution(() => {
|
|
569
|
+
this.filtersRowsMap.clear();
|
|
570
|
+
visibleVisualRows = (0, _array.arrayMap)(dataFilter.filter(), rowData => rowData.meta.visualRow);
|
|
571
|
+
const visibleVisualRowsAssertion = (0, _utils.createArrayAssertion)(visibleVisualRows);
|
|
572
|
+
(0, _number.rangeEach)(this.hot.countSourceRows() - 1, row => {
|
|
573
|
+
if (!visibleVisualRowsAssertion(row)) {
|
|
574
|
+
trimmedRows.push(row);
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
(0, _array.arrayEach)(trimmedRows, physicalRow => {
|
|
578
|
+
this.filtersRowsMap.setValueAtIndex(physicalRow, true);
|
|
579
|
+
});
|
|
580
|
+
}, true);
|
|
581
|
+
if (!navigableHeaders && !visibleVisualRows.length) {
|
|
582
|
+
this.hot.deselectCell();
|
|
583
|
+
}
|
|
584
|
+
} else {
|
|
568
585
|
this.filtersRowsMap.clear();
|
|
569
|
-
visibleVisualRows = (0, _array.arrayMap)(dataFilter.filter(), rowData => rowData.meta.visualRow);
|
|
570
|
-
const visibleVisualRowsAssertion = (0, _utils.createArrayAssertion)(visibleVisualRows);
|
|
571
|
-
(0, _number.rangeEach)(this.hot.countSourceRows() - 1, row => {
|
|
572
|
-
if (!visibleVisualRowsAssertion(row)) {
|
|
573
|
-
trimmedRows.push(row);
|
|
574
|
-
}
|
|
575
|
-
});
|
|
576
|
-
(0, _array.arrayEach)(trimmedRows, physicalRow => {
|
|
577
|
-
this.filtersRowsMap.setValueAtIndex(physicalRow, true);
|
|
578
|
-
});
|
|
579
|
-
}, true);
|
|
580
|
-
if (!navigableHeaders && !visibleVisualRows.length) {
|
|
581
|
-
this.hot.deselectCell();
|
|
582
586
|
}
|
|
583
587
|
_classPrivateFieldSet(_previousConditionStack, this, this.exportConditions());
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
this.
|
|
588
|
+
this.hot.runHooks('afterFilter', conditions);
|
|
589
|
+
this.hot.view.adjustElementsSize();
|
|
590
|
+
this.hot.render();
|
|
587
591
|
} else {
|
|
588
592
|
this.importConditions(_classPrivateFieldGet(_previousConditionStack, this));
|
|
589
593
|
}
|
|
590
594
|
if (this.hot.selection.isSelected()) {
|
|
591
595
|
this.hot.selectCell(navigableHeaders ? -1 : 0, this.hot.getSelectedRangeLast().highlight.col);
|
|
592
596
|
}
|
|
593
|
-
if (allowFiltering !== false) {
|
|
594
|
-
this.hot.runHooks('afterFilter', conditions);
|
|
595
|
-
this.hot.view.adjustElementsSize();
|
|
596
|
-
this.hot.render();
|
|
597
|
-
}
|
|
598
597
|
}
|
|
599
598
|
|
|
600
599
|
/**
|
|
@@ -536,10 +536,10 @@ export class Filters extends BasePlugin {
|
|
|
536
536
|
*
|
|
537
537
|
* @returns {Array}
|
|
538
538
|
*/
|
|
539
|
+
/* eslint-enable jsdoc/require-description-complete-sentence */
|
|
539
540
|
exportConditions() {
|
|
540
541
|
return this.conditionCollection.exportAllConditions();
|
|
541
542
|
}
|
|
542
|
-
/* eslint-enable jsdoc/require-description-complete-sentence */
|
|
543
543
|
|
|
544
544
|
/**
|
|
545
545
|
* Filters data based on added filter conditions.
|
|
@@ -556,39 +556,38 @@ export class Filters extends BasePlugin {
|
|
|
556
556
|
let visibleVisualRows = [];
|
|
557
557
|
const conditions = this.exportConditions();
|
|
558
558
|
const allowFiltering = this.hot.runHooks('beforeFilter', conditions, _classPrivateFieldGet(_previousConditionStack, this));
|
|
559
|
-
if (allowFiltering !== false
|
|
560
|
-
|
|
561
|
-
|
|
559
|
+
if (allowFiltering !== false) {
|
|
560
|
+
if (needToFilter) {
|
|
561
|
+
const trimmedRows = [];
|
|
562
|
+
this.hot.batchExecution(() => {
|
|
563
|
+
this.filtersRowsMap.clear();
|
|
564
|
+
visibleVisualRows = arrayMap(dataFilter.filter(), rowData => rowData.meta.visualRow);
|
|
565
|
+
const visibleVisualRowsAssertion = createArrayAssertion(visibleVisualRows);
|
|
566
|
+
rangeEach(this.hot.countSourceRows() - 1, row => {
|
|
567
|
+
if (!visibleVisualRowsAssertion(row)) {
|
|
568
|
+
trimmedRows.push(row);
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
arrayEach(trimmedRows, physicalRow => {
|
|
572
|
+
this.filtersRowsMap.setValueAtIndex(physicalRow, true);
|
|
573
|
+
});
|
|
574
|
+
}, true);
|
|
575
|
+
if (!navigableHeaders && !visibleVisualRows.length) {
|
|
576
|
+
this.hot.deselectCell();
|
|
577
|
+
}
|
|
578
|
+
} else {
|
|
562
579
|
this.filtersRowsMap.clear();
|
|
563
|
-
visibleVisualRows = arrayMap(dataFilter.filter(), rowData => rowData.meta.visualRow);
|
|
564
|
-
const visibleVisualRowsAssertion = createArrayAssertion(visibleVisualRows);
|
|
565
|
-
rangeEach(this.hot.countSourceRows() - 1, row => {
|
|
566
|
-
if (!visibleVisualRowsAssertion(row)) {
|
|
567
|
-
trimmedRows.push(row);
|
|
568
|
-
}
|
|
569
|
-
});
|
|
570
|
-
arrayEach(trimmedRows, physicalRow => {
|
|
571
|
-
this.filtersRowsMap.setValueAtIndex(physicalRow, true);
|
|
572
|
-
});
|
|
573
|
-
}, true);
|
|
574
|
-
if (!navigableHeaders && !visibleVisualRows.length) {
|
|
575
|
-
this.hot.deselectCell();
|
|
576
580
|
}
|
|
577
581
|
_classPrivateFieldSet(_previousConditionStack, this, this.exportConditions());
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
this.
|
|
582
|
+
this.hot.runHooks('afterFilter', conditions);
|
|
583
|
+
this.hot.view.adjustElementsSize();
|
|
584
|
+
this.hot.render();
|
|
581
585
|
} else {
|
|
582
586
|
this.importConditions(_classPrivateFieldGet(_previousConditionStack, this));
|
|
583
587
|
}
|
|
584
588
|
if (this.hot.selection.isSelected()) {
|
|
585
589
|
this.hot.selectCell(navigableHeaders ? -1 : 0, this.hot.getSelectedRangeLast().highlight.col);
|
|
586
590
|
}
|
|
587
|
-
if (allowFiltering !== false) {
|
|
588
|
-
this.hot.runHooks('afterFilter', conditions);
|
|
589
|
-
this.hot.view.adjustElementsSize();
|
|
590
|
-
this.hot.render();
|
|
591
|
-
}
|
|
592
591
|
}
|
|
593
592
|
|
|
594
593
|
/**
|
|
@@ -253,13 +253,7 @@ class MultipleSelectUI extends _base.BaseUI {
|
|
|
253
253
|
beforeOnCellMouseUp: () => {
|
|
254
254
|
_classPrivateFieldGet(_itemsBox, this).listen();
|
|
255
255
|
},
|
|
256
|
-
|
|
257
|
-
const minWidth = _classPrivateFieldGet(_itemsBox, this).container.scrollWidth - (0, _element.getScrollbarWidth)(rootDocument);
|
|
258
|
-
if (width !== undefined && width < minWidth) {
|
|
259
|
-
return minWidth;
|
|
260
|
-
}
|
|
261
|
-
return width;
|
|
262
|
-
},
|
|
256
|
+
colWidths: () => _classPrivateFieldGet(_itemsBox, this).container.scrollWidth - (0, _element.getScrollbarWidth)(rootDocument),
|
|
263
257
|
maxCols: 1,
|
|
264
258
|
autoWrapCol: true,
|
|
265
259
|
height: 110,
|
|
@@ -248,13 +248,7 @@ export class MultipleSelectUI extends BaseUI {
|
|
|
248
248
|
beforeOnCellMouseUp: () => {
|
|
249
249
|
_classPrivateFieldGet(_itemsBox, this).listen();
|
|
250
250
|
},
|
|
251
|
-
|
|
252
|
-
const minWidth = _classPrivateFieldGet(_itemsBox, this).container.scrollWidth - getScrollbarWidth(rootDocument);
|
|
253
|
-
if (width !== undefined && width < minWidth) {
|
|
254
|
-
return minWidth;
|
|
255
|
-
}
|
|
256
|
-
return width;
|
|
257
|
-
},
|
|
251
|
+
colWidths: () => _classPrivateFieldGet(_itemsBox, this).container.scrollWidth - getScrollbarWidth(rootDocument),
|
|
258
252
|
maxCols: 1,
|
|
259
253
|
autoWrapCol: true,
|
|
260
254
|
height: 110,
|
|
@@ -231,8 +231,8 @@ class HiddenColumns extends _base.BasePlugin {
|
|
|
231
231
|
* Disables the plugin functionality for this Handsontable instance.
|
|
232
232
|
*/
|
|
233
233
|
disablePlugin() {
|
|
234
|
-
super.disablePlugin();
|
|
235
234
|
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
|
235
|
+
super.disablePlugin();
|
|
236
236
|
this.resetCellsMeta();
|
|
237
237
|
}
|
|
238
238
|
|
|
@@ -227,8 +227,8 @@ export class HiddenColumns extends BasePlugin {
|
|
|
227
227
|
* Disables the plugin functionality for this Handsontable instance.
|
|
228
228
|
*/
|
|
229
229
|
disablePlugin() {
|
|
230
|
-
super.disablePlugin();
|
|
231
230
|
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
|
231
|
+
super.disablePlugin();
|
|
232
232
|
this.resetCellsMeta();
|
|
233
233
|
}
|
|
234
234
|
|
|
@@ -231,8 +231,8 @@ class HiddenRows extends _base.BasePlugin {
|
|
|
231
231
|
* Disables the plugin functionality for this Handsontable instance.
|
|
232
232
|
*/
|
|
233
233
|
disablePlugin() {
|
|
234
|
-
super.disablePlugin();
|
|
235
234
|
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
|
235
|
+
super.disablePlugin();
|
|
236
236
|
this.resetCellsMeta();
|
|
237
237
|
}
|
|
238
238
|
|
|
@@ -227,8 +227,8 @@ export class HiddenRows extends BasePlugin {
|
|
|
227
227
|
* Disables the plugin functionality for this Handsontable instance.
|
|
228
228
|
*/
|
|
229
229
|
disablePlugin() {
|
|
230
|
-
super.disablePlugin();
|
|
231
230
|
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
|
231
|
+
super.disablePlugin();
|
|
232
232
|
this.resetCellsMeta();
|
|
233
233
|
}
|
|
234
234
|
|
|
@@ -341,12 +341,12 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
|
341
341
|
setupGuidePosition() {
|
|
342
342
|
const handleHeight = parseInt((0, _element.outerHeight)(_classPrivateFieldGet(_handle, this)), 10);
|
|
343
343
|
const handleBottomPosition = parseInt(_classPrivateFieldGet(_handle, this).style.top, 10) + handleHeight;
|
|
344
|
-
const
|
|
344
|
+
const maximumVisibleElementHeight = parseInt(this.hot.view.maximumVisibleElementHeight(0), 10);
|
|
345
345
|
(0, _element.addClass)(_classPrivateFieldGet(_handle, this), 'active');
|
|
346
346
|
(0, _element.addClass)(_classPrivateFieldGet(_guide, this), 'active');
|
|
347
347
|
_classPrivateFieldGet(_guide, this).style.top = `${handleBottomPosition}px`;
|
|
348
348
|
this.refreshGuidePosition();
|
|
349
|
-
_classPrivateFieldGet(_guide, this).style.height = `${
|
|
349
|
+
_classPrivateFieldGet(_guide, this).style.height = `${maximumVisibleElementHeight - handleHeight}px`;
|
|
350
350
|
this.hot.rootElement.appendChild(_classPrivateFieldGet(_guide, this));
|
|
351
351
|
}
|
|
352
352
|
|
|
@@ -417,7 +417,8 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
|
417
417
|
*/
|
|
418
418
|
afterMouseDownTimeout() {
|
|
419
419
|
const render = () => {
|
|
420
|
-
this.hot.
|
|
420
|
+
this.hot.forceFullRender = true;
|
|
421
|
+
this.hot.view.render(); // updates all
|
|
421
422
|
this.hot.view.adjustElementsSize();
|
|
422
423
|
};
|
|
423
424
|
const resize = (column, forceRender) => {
|
|
@@ -577,7 +578,8 @@ function _onMouseMove(event) {
|
|
|
577
578
|
*/
|
|
578
579
|
function _onMouseUp() {
|
|
579
580
|
const render = () => {
|
|
580
|
-
this.hot.
|
|
581
|
+
this.hot.forceFullRender = true;
|
|
582
|
+
this.hot.view.render(); // updates all
|
|
581
583
|
this.hot.view.adjustElementsSize();
|
|
582
584
|
};
|
|
583
585
|
const resize = (column, forceRender) => {
|
|
@@ -336,12 +336,12 @@ export class ManualColumnResize extends BasePlugin {
|
|
|
336
336
|
setupGuidePosition() {
|
|
337
337
|
const handleHeight = parseInt(outerHeight(_classPrivateFieldGet(_handle, this)), 10);
|
|
338
338
|
const handleBottomPosition = parseInt(_classPrivateFieldGet(_handle, this).style.top, 10) + handleHeight;
|
|
339
|
-
const
|
|
339
|
+
const maximumVisibleElementHeight = parseInt(this.hot.view.maximumVisibleElementHeight(0), 10);
|
|
340
340
|
addClass(_classPrivateFieldGet(_handle, this), 'active');
|
|
341
341
|
addClass(_classPrivateFieldGet(_guide, this), 'active');
|
|
342
342
|
_classPrivateFieldGet(_guide, this).style.top = `${handleBottomPosition}px`;
|
|
343
343
|
this.refreshGuidePosition();
|
|
344
|
-
_classPrivateFieldGet(_guide, this).style.height = `${
|
|
344
|
+
_classPrivateFieldGet(_guide, this).style.height = `${maximumVisibleElementHeight - handleHeight}px`;
|
|
345
345
|
this.hot.rootElement.appendChild(_classPrivateFieldGet(_guide, this));
|
|
346
346
|
}
|
|
347
347
|
|
|
@@ -412,7 +412,8 @@ export class ManualColumnResize extends BasePlugin {
|
|
|
412
412
|
*/
|
|
413
413
|
afterMouseDownTimeout() {
|
|
414
414
|
const render = () => {
|
|
415
|
-
this.hot.
|
|
415
|
+
this.hot.forceFullRender = true;
|
|
416
|
+
this.hot.view.render(); // updates all
|
|
416
417
|
this.hot.view.adjustElementsSize();
|
|
417
418
|
};
|
|
418
419
|
const resize = (column, forceRender) => {
|
|
@@ -571,7 +572,8 @@ function _onMouseMove(event) {
|
|
|
571
572
|
*/
|
|
572
573
|
function _onMouseUp() {
|
|
573
574
|
const render = () => {
|
|
574
|
-
this.hot.
|
|
575
|
+
this.hot.forceFullRender = true;
|
|
576
|
+
this.hot.view.render(); // updates all
|
|
575
577
|
this.hot.view.adjustElementsSize();
|
|
576
578
|
};
|
|
577
579
|
const resize = (column, forceRender) => {
|
|
@@ -328,12 +328,12 @@ class ManualRowResize extends _base.BasePlugin {
|
|
|
328
328
|
setupGuidePosition() {
|
|
329
329
|
const handleWidth = parseInt((0, _element.outerWidth)(_classPrivateFieldGet(_handle, this)), 10);
|
|
330
330
|
const handleEndPosition = parseInt(_classPrivateFieldGet(_handle, this).style[this.inlineDir], 10) + handleWidth;
|
|
331
|
-
const
|
|
331
|
+
const maximumVisibleElementWidth = parseInt(this.hot.view.maximumVisibleElementWidth(0), 10);
|
|
332
332
|
(0, _element.addClass)(_classPrivateFieldGet(_handle, this), 'active');
|
|
333
333
|
(0, _element.addClass)(_classPrivateFieldGet(_guide, this), 'active');
|
|
334
334
|
_classPrivateFieldGet(_guide, this).style.top = _classPrivateFieldGet(_handle, this).style.top;
|
|
335
335
|
_classPrivateFieldGet(_guide, this).style[this.inlineDir] = `${handleEndPosition}px`;
|
|
336
|
-
_classPrivateFieldGet(_guide, this).style.width = `${
|
|
336
|
+
_classPrivateFieldGet(_guide, this).style.width = `${maximumVisibleElementWidth - handleWidth}px`;
|
|
337
337
|
this.hot.rootElement.appendChild(_classPrivateFieldGet(_guide, this));
|
|
338
338
|
}
|
|
339
339
|
|
|
@@ -414,7 +414,8 @@ class ManualRowResize extends _base.BasePlugin {
|
|
|
414
414
|
*/
|
|
415
415
|
afterMouseDownTimeout() {
|
|
416
416
|
const render = () => {
|
|
417
|
-
this.hot.
|
|
417
|
+
this.hot.forceFullRender = true;
|
|
418
|
+
this.hot.view.render(); // updates all
|
|
418
419
|
this.hot.view.adjustElementsSize();
|
|
419
420
|
};
|
|
420
421
|
const resize = (row, forceRender) => {
|
|
@@ -542,7 +543,8 @@ function _onMouseMove(event) {
|
|
|
542
543
|
*/
|
|
543
544
|
function _onMouseUp() {
|
|
544
545
|
const render = () => {
|
|
545
|
-
this.hot.
|
|
546
|
+
this.hot.forceFullRender = true;
|
|
547
|
+
this.hot.view.render(); // updates all
|
|
546
548
|
this.hot.view.adjustElementsSize();
|
|
547
549
|
};
|
|
548
550
|
const runHooks = (row, forceRender) => {
|
|
@@ -323,12 +323,12 @@ export class ManualRowResize extends BasePlugin {
|
|
|
323
323
|
setupGuidePosition() {
|
|
324
324
|
const handleWidth = parseInt(outerWidth(_classPrivateFieldGet(_handle, this)), 10);
|
|
325
325
|
const handleEndPosition = parseInt(_classPrivateFieldGet(_handle, this).style[this.inlineDir], 10) + handleWidth;
|
|
326
|
-
const
|
|
326
|
+
const maximumVisibleElementWidth = parseInt(this.hot.view.maximumVisibleElementWidth(0), 10);
|
|
327
327
|
addClass(_classPrivateFieldGet(_handle, this), 'active');
|
|
328
328
|
addClass(_classPrivateFieldGet(_guide, this), 'active');
|
|
329
329
|
_classPrivateFieldGet(_guide, this).style.top = _classPrivateFieldGet(_handle, this).style.top;
|
|
330
330
|
_classPrivateFieldGet(_guide, this).style[this.inlineDir] = `${handleEndPosition}px`;
|
|
331
|
-
_classPrivateFieldGet(_guide, this).style.width = `${
|
|
331
|
+
_classPrivateFieldGet(_guide, this).style.width = `${maximumVisibleElementWidth - handleWidth}px`;
|
|
332
332
|
this.hot.rootElement.appendChild(_classPrivateFieldGet(_guide, this));
|
|
333
333
|
}
|
|
334
334
|
|
|
@@ -409,7 +409,8 @@ export class ManualRowResize extends BasePlugin {
|
|
|
409
409
|
*/
|
|
410
410
|
afterMouseDownTimeout() {
|
|
411
411
|
const render = () => {
|
|
412
|
-
this.hot.
|
|
412
|
+
this.hot.forceFullRender = true;
|
|
413
|
+
this.hot.view.render(); // updates all
|
|
413
414
|
this.hot.view.adjustElementsSize();
|
|
414
415
|
};
|
|
415
416
|
const resize = (row, forceRender) => {
|
|
@@ -536,7 +537,8 @@ function _onMouseMove(event) {
|
|
|
536
537
|
*/
|
|
537
538
|
function _onMouseUp() {
|
|
538
539
|
const render = () => {
|
|
539
|
-
this.hot.
|
|
540
|
+
this.hot.forceFullRender = true;
|
|
541
|
+
this.hot.view.render(); // updates all
|
|
540
542
|
this.hot.view.adjustElementsSize();
|
|
541
543
|
};
|
|
542
544
|
const runHooks = (row, forceRender) => {
|
|
@@ -30,7 +30,6 @@ var _element = require("../../helpers/dom/element");
|
|
|
30
30
|
var _browser = require("../../helpers/browser");
|
|
31
31
|
var _focusOrder2 = require("./focusOrder");
|
|
32
32
|
var _renderer = require("./renderer");
|
|
33
|
-
var _utils = require("./utils");
|
|
34
33
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
35
34
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
36
35
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
@@ -667,12 +666,8 @@ class MergeCells extends _base.BasePlugin {
|
|
|
667
666
|
* @param {CellRange} cellRange The cell range to merge or unmerged.
|
|
668
667
|
*/
|
|
669
668
|
toggleMerge(cellRange) {
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
to
|
|
673
|
-
} = cellRange.clone().normalize();
|
|
674
|
-
const mergedCell = this.mergedCellsCollection.get(from.row, from.col);
|
|
675
|
-
const mergedCellCoversWholeRange = mergedCell.row === from.row && mergedCell.col === from.col && mergedCell.row + mergedCell.rowspan - 1 === to.row && mergedCell.col + mergedCell.colspan - 1 === to.col;
|
|
669
|
+
const mergedCell = this.mergedCellsCollection.get(cellRange.from.row, cellRange.from.col);
|
|
670
|
+
const mergedCellCoversWholeRange = mergedCell.row === cellRange.from.row && mergedCell.col === cellRange.from.col && mergedCell.row + mergedCell.rowspan - 1 === cellRange.to.row && mergedCell.col + mergedCell.colspan - 1 === cellRange.to.col;
|
|
676
671
|
if (mergedCellCoversWholeRange) {
|
|
677
672
|
this.unmergeRange(cellRange);
|
|
678
673
|
} else {
|
|
@@ -1484,7 +1479,33 @@ function _onModifyRowHeightByOverlayName(height, row, overlayType) {
|
|
|
1484
1479
|
} else {
|
|
1485
1480
|
rowspanAfterCorrection = rowspan - rowspanCorrection;
|
|
1486
1481
|
}
|
|
1487
|
-
height = Math.max(height !== null && height !== void 0 ? height : 0, (
|
|
1482
|
+
height = Math.max(height !== null && height !== void 0 ? height : 0, _assertClassBrand(_MergeCells_brand, this, _sumCellsHeights).call(this, row, rowspanAfterCorrection));
|
|
1488
1483
|
});
|
|
1489
1484
|
return height;
|
|
1485
|
+
}
|
|
1486
|
+
/**
|
|
1487
|
+
* Sums the heights of the all cells that the merge cell consists of.
|
|
1488
|
+
*
|
|
1489
|
+
* @param {number} row The visual row index of the merged cell.
|
|
1490
|
+
* @param {number} rowspan The rowspan value of the merged cell.
|
|
1491
|
+
* @returns {number}
|
|
1492
|
+
*/
|
|
1493
|
+
function _sumCellsHeights(row, rowspan) {
|
|
1494
|
+
const {
|
|
1495
|
+
view,
|
|
1496
|
+
rowIndexMapper
|
|
1497
|
+
} = this.hot;
|
|
1498
|
+
const stylesHandler = view.getStylesHandler();
|
|
1499
|
+
const defaultHeight = view.getDefaultRowHeight();
|
|
1500
|
+
let height = 0;
|
|
1501
|
+
for (let i = row; i < row + rowspan; i++) {
|
|
1502
|
+
if (!rowIndexMapper.isHidden(i)) {
|
|
1503
|
+
var _this$hot$getRowHeigh;
|
|
1504
|
+
height += (_this$hot$getRowHeigh = this.hot.getRowHeight(i)) !== null && _this$hot$getRowHeigh !== void 0 ? _this$hot$getRowHeigh : defaultHeight;
|
|
1505
|
+
if (i === 0 && !stylesHandler.isClassicTheme()) {
|
|
1506
|
+
height += 1; // border-top-width
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
return height;
|
|
1490
1511
|
}
|
|
@@ -36,7 +36,6 @@ import { getStyle } from "../../helpers/dom/element.mjs";
|
|
|
36
36
|
import { isChrome } from "../../helpers/browser.mjs";
|
|
37
37
|
import { FocusOrder } from "./focusOrder.mjs";
|
|
38
38
|
import { createMergeCellRenderer } from "./renderer.mjs";
|
|
39
|
-
import { sumCellsHeights } from "./utils.mjs";
|
|
40
39
|
Hooks.getSingleton().register('beforeMergeCells');
|
|
41
40
|
Hooks.getSingleton().register('afterMergeCells');
|
|
42
41
|
Hooks.getSingleton().register('beforeUnmergeCells');
|
|
@@ -663,12 +662,8 @@ export class MergeCells extends BasePlugin {
|
|
|
663
662
|
* @param {CellRange} cellRange The cell range to merge or unmerged.
|
|
664
663
|
*/
|
|
665
664
|
toggleMerge(cellRange) {
|
|
666
|
-
const
|
|
667
|
-
|
|
668
|
-
to
|
|
669
|
-
} = cellRange.clone().normalize();
|
|
670
|
-
const mergedCell = this.mergedCellsCollection.get(from.row, from.col);
|
|
671
|
-
const mergedCellCoversWholeRange = mergedCell.row === from.row && mergedCell.col === from.col && mergedCell.row + mergedCell.rowspan - 1 === to.row && mergedCell.col + mergedCell.colspan - 1 === to.col;
|
|
665
|
+
const mergedCell = this.mergedCellsCollection.get(cellRange.from.row, cellRange.from.col);
|
|
666
|
+
const mergedCellCoversWholeRange = mergedCell.row === cellRange.from.row && mergedCell.col === cellRange.from.col && mergedCell.row + mergedCell.rowspan - 1 === cellRange.to.row && mergedCell.col + mergedCell.colspan - 1 === cellRange.to.col;
|
|
672
667
|
if (mergedCellCoversWholeRange) {
|
|
673
668
|
this.unmergeRange(cellRange);
|
|
674
669
|
} else {
|
|
@@ -1479,7 +1474,33 @@ function _onModifyRowHeightByOverlayName(height, row, overlayType) {
|
|
|
1479
1474
|
} else {
|
|
1480
1475
|
rowspanAfterCorrection = rowspan - rowspanCorrection;
|
|
1481
1476
|
}
|
|
1482
|
-
height = Math.max(height !== null && height !== void 0 ? height : 0,
|
|
1477
|
+
height = Math.max(height !== null && height !== void 0 ? height : 0, _assertClassBrand(_MergeCells_brand, this, _sumCellsHeights).call(this, row, rowspanAfterCorrection));
|
|
1483
1478
|
});
|
|
1484
1479
|
return height;
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* Sums the heights of the all cells that the merge cell consists of.
|
|
1483
|
+
*
|
|
1484
|
+
* @param {number} row The visual row index of the merged cell.
|
|
1485
|
+
* @param {number} rowspan The rowspan value of the merged cell.
|
|
1486
|
+
* @returns {number}
|
|
1487
|
+
*/
|
|
1488
|
+
function _sumCellsHeights(row, rowspan) {
|
|
1489
|
+
const {
|
|
1490
|
+
view,
|
|
1491
|
+
rowIndexMapper
|
|
1492
|
+
} = this.hot;
|
|
1493
|
+
const stylesHandler = view.getStylesHandler();
|
|
1494
|
+
const defaultHeight = view.getDefaultRowHeight();
|
|
1495
|
+
let height = 0;
|
|
1496
|
+
for (let i = row; i < row + rowspan; i++) {
|
|
1497
|
+
if (!rowIndexMapper.isHidden(i)) {
|
|
1498
|
+
var _this$hot$getRowHeigh;
|
|
1499
|
+
height += (_this$hot$getRowHeigh = this.hot.getRowHeight(i)) !== null && _this$hot$getRowHeigh !== void 0 ? _this$hot$getRowHeigh : defaultHeight;
|
|
1500
|
+
if (i === 0 && !stylesHandler.isClassicTheme()) {
|
|
1501
|
+
height += 1; // border-top-width
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
return height;
|
|
1485
1506
|
}
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.createMergeCellRenderer = createMergeCellRenderer;
|
|
5
5
|
var _object = require("../../helpers/object");
|
|
6
|
-
var _browser = require("../../helpers/browser");
|
|
7
|
-
var _utils = require("./utils");
|
|
8
6
|
/**
|
|
9
7
|
* Creates a renderer object for the `MergeCells` plugin.
|
|
10
8
|
*
|
|
@@ -20,7 +18,6 @@ function createMergeCellRenderer(plugin) {
|
|
|
20
18
|
rowIndexMapper: rowMapper,
|
|
21
19
|
columnIndexMapper: columnMapper
|
|
22
20
|
} = hot;
|
|
23
|
-
const updateNextCellsHeight = new Map();
|
|
24
21
|
|
|
25
22
|
/**
|
|
26
23
|
* Runs before the cell is rendered.
|
|
@@ -42,10 +39,6 @@ function createMergeCellRenderer(plugin) {
|
|
|
42
39
|
if (!(0, _object.isObject)(mergedCell)) {
|
|
43
40
|
TD.removeAttribute('rowspan');
|
|
44
41
|
TD.removeAttribute('colspan');
|
|
45
|
-
if ((0, _browser.isSafari)() && updateNextCellsHeight.has(row) && !hot.getSettings().rowHeaders) {
|
|
46
|
-
TD.style.height = `${updateNextCellsHeight.get(row)}px`;
|
|
47
|
-
updateNextCellsHeight.delete(row);
|
|
48
|
-
}
|
|
49
42
|
TD.style.display = '';
|
|
50
43
|
return;
|
|
51
44
|
}
|
|
@@ -57,14 +50,6 @@ function createMergeCellRenderer(plugin) {
|
|
|
57
50
|
} = mergedCell;
|
|
58
51
|
const [lastMergedRowIndex, lastMergedColumnIndex] = plugin.translateMergedCellToRenderable(origRow, origRowspan, origColumn, origColspan);
|
|
59
52
|
const isVirtualRenderingEnabled = plugin.getSetting('virtualized');
|
|
60
|
-
|
|
61
|
-
// Safari bug fix - the height of the cells next to the merged cell must be defined
|
|
62
|
-
// so that their height is proportional to the height of the merged cell
|
|
63
|
-
// (this emulates default behavior in Chrome, FF etc.)
|
|
64
|
-
if ((0, _browser.isSafari)() && origColumn === 0 && !hot.getSettings().rowHeaders) {
|
|
65
|
-
const height = (0, _utils.sumCellsHeights)(hot, origRow, origRowspan);
|
|
66
|
-
updateNextCellsHeight.set(row, height / origRowspan);
|
|
67
|
-
}
|
|
68
53
|
const renderedRowIndex = rowMapper.getRenderableFromVisualIndex(row);
|
|
69
54
|
const renderedColumnIndex = columnMapper.getRenderableFromVisualIndex(col);
|
|
70
55
|
const maxRowSpan = lastMergedRowIndex - renderedRowIndex + 1; // Number of rendered columns.
|