handsontable 0.0.0-next-53a190b-20240403 → 0.0.0-next-5a535ed-20240403
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/calculator/viewportColumns.js +17 -12
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
- package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
- package/3rdparty/walkontable/src/cell/coords.js +17 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
- package/3rdparty/walkontable/src/cell/range.js +28 -40
- package/3rdparty/walkontable/src/cell/range.mjs +28 -40
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +104 -72
- package/3rdparty/walkontable/src/event.mjs +104 -72
- package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -15
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -16
- package/3rdparty/walkontable/src/overlay/top.js +0 -11
- package/3rdparty/walkontable/src/overlay/top.mjs +1 -12
- package/3rdparty/walkontable/src/overlays.js +4 -46
- package/3rdparty/walkontable/src/overlays.mjs +4 -46
- package/3rdparty/walkontable/src/scroll.js +17 -15
- package/3rdparty/walkontable/src/scroll.mjs +17 -15
- package/3rdparty/walkontable/src/selection/manager.js +69 -48
- package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
- package/3rdparty/walkontable/src/selection/scanner.js +42 -33
- package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
- package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
- package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +1 -4
- package/core/viewportScroll/index.mjs +1 -4
- package/core.d.ts +3 -4
- package/core.js +22 -77
- package/core.mjs +22 -77
- package/dataMap/dataSource.js +1 -1
- package/dataMap/dataSource.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
- package/dataMap/metaManager/metaSchema.js +1 -1
- package/dataMap/metaManager/metaSchema.mjs +1 -1
- package/dataMap/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +4 -4
- package/dist/handsontable.full.css +4 -4
- package/dist/handsontable.full.js +9121 -9062
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +292 -292
- package/dist/handsontable.js +6573 -6967
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +25 -25
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +23 -25
- package/editorManager.mjs +23 -25
- package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
- package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
- package/editors/selectEditor/selectEditor.js +19 -20
- package/editors/selectEditor/selectEditor.mjs +19 -20
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +82 -64
- package/focusManager.mjs +82 -64
- package/helpers/dom/element.js +1 -23
- package/helpers/dom/element.mjs +1 -21
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +2 -2
- package/helpers/object.mjs +2 -2
- package/index.d.ts +0 -10
- package/package.json +2 -7
- package/pluginHooks.d.ts +3 -4
- package/pluginHooks.js +38 -99
- package/pluginHooks.mjs +38 -99
- package/plugins/autoColumnSize/autoColumnSize.js +65 -49
- package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
- package/plugins/autoRowSize/autoRowSize.js +34 -28
- package/plugins/autoRowSize/autoRowSize.mjs +34 -28
- package/plugins/autofill/autofill.js +38 -30
- package/plugins/autofill/autofill.mjs +38 -30
- package/plugins/base/base.js +17 -12
- package/plugins/base/base.mjs +17 -12
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
- package/plugins/columnSorting/columnSorting.js +45 -49
- package/plugins/columnSorting/columnSorting.mjs +45 -49
- package/plugins/columnSummary/columnSummary.js +26 -22
- package/plugins/columnSummary/columnSummary.mjs +26 -22
- package/plugins/comments/comments.js +158 -116
- package/plugins/comments/comments.mjs +158 -116
- package/plugins/contextMenu/contextMenu.js +26 -20
- package/plugins/contextMenu/contextMenu.mjs +26 -20
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
- package/plugins/contextMenu/menu/menu.js +21 -13
- package/plugins/contextMenu/menu/menu.mjs +21 -13
- package/plugins/contextMenu/menu/positioner.js +58 -41
- package/plugins/contextMenu/menu/positioner.mjs +58 -41
- package/plugins/copyPaste/copyPaste.js +157 -116
- package/plugins/copyPaste/copyPaste.mjs +157 -116
- package/plugins/copyPaste/copyableRanges.js +66 -43
- package/plugins/copyPaste/copyableRanges.mjs +66 -43
- package/plugins/customBorders/customBorders.js +13 -11
- package/plugins/customBorders/customBorders.mjs +13 -11
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +106 -80
- package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
- package/plugins/exportFile/dataProvider.js +1 -1
- package/plugins/exportFile/dataProvider.mjs +1 -1
- package/plugins/filters/component/actionBar.js +9 -9
- package/plugins/filters/component/actionBar.mjs +8 -8
- package/plugins/filters/component/condition.js +15 -13
- package/plugins/filters/component/condition.mjs +15 -13
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +28 -24
- package/plugins/filters/component/value.mjs +28 -24
- package/plugins/filters/conditionUpdateObserver.js +24 -22
- package/plugins/filters/conditionUpdateObserver.mjs +24 -22
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +95 -81
- package/plugins/filters/filters.mjs +95 -81
- package/plugins/filters/ui/input.js +19 -13
- package/plugins/filters/ui/input.mjs +19 -13
- package/plugins/filters/ui/link.js +13 -8
- package/plugins/filters/ui/link.mjs +13 -8
- package/plugins/filters/ui/multipleSelect.js +112 -85
- package/plugins/filters/ui/multipleSelect.mjs +112 -85
- package/plugins/filters/ui/radioInput.js +20 -12
- package/plugins/filters/ui/radioInput.mjs +20 -12
- package/plugins/filters/ui/select.js +72 -50
- package/plugins/filters/ui/select.mjs +71 -49
- package/plugins/formulas/formulas.js +326 -268
- package/plugins/formulas/formulas.mjs +327 -269
- package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
- package/plugins/formulas/indexSyncer/index.js +48 -25
- package/plugins/formulas/indexSyncer/index.mjs +48 -25
- package/plugins/hiddenColumns/hiddenColumns.js +83 -64
- package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
- package/plugins/hiddenRows/hiddenRows.js +82 -63
- package/plugins/hiddenRows/hiddenRows.mjs +82 -63
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
- package/plugins/manualColumnMove/manualColumnMove.js +170 -126
- package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
- package/plugins/manualColumnResize/manualColumnResize.js +230 -169
- package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
- package/plugins/manualRowMove/manualRowMove.js +128 -99
- package/plugins/manualRowMove/manualRowMove.mjs +128 -99
- package/plugins/manualRowResize/manualRowResize.js +209 -150
- package/plugins/manualRowResize/manualRowResize.mjs +209 -150
- package/plugins/mergeCells/calculations/selection.js +71 -2
- package/plugins/mergeCells/calculations/selection.mjs +71 -2
- package/plugins/mergeCells/cellsCollection.js +1 -117
- package/plugins/mergeCells/cellsCollection.mjs +1 -117
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
- package/plugins/mergeCells/mergeCells.js +397 -499
- package/plugins/mergeCells/mergeCells.mjs +397 -499
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +253 -205
- package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
- package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
- package/plugins/nestedHeaders/stateManager/index.js +41 -30
- package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +182 -151
- package/plugins/nestedRows/nestedRows.mjs +183 -152
- package/plugins/nestedRows/ui/contextMenu.js +15 -11
- package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
- package/plugins/nestedRows/utils/rowMoveController.js +1 -1
- package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
- package/plugins/persistentState/storage.js +2 -2
- package/plugins/persistentState/storage.mjs +2 -2
- package/plugins/search/search.js +7 -7
- package/plugins/search/search.mjs +7 -7
- package/plugins/touchScroll/touchScroll.js +19 -15
- package/plugins/touchScroll/touchScroll.mjs +20 -16
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +0 -2
- package/selection/highlight/visualSelection.mjs +0 -2
- package/selection/selection.js +67 -225
- package/selection/selection.mjs +66 -224
- package/selection/transformation.js +118 -149
- package/selection/transformation.mjs +118 -149
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +3 -18
- package/shortcutContexts/commands/editor/open.mjs +3 -18
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
- package/shortcutContexts/grid.js +3 -9
- package/shortcutContexts/grid.mjs +3 -9
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +78 -52
- package/tableView.mjs +78 -52
- package/translations/changesObservable/observable.js +38 -21
- package/translations/changesObservable/observable.mjs +38 -21
- package/translations/changesObservable/observer.js +12 -7
- package/translations/changesObservable/observer.mjs +11 -6
- package/translations/mapCollections/aggregatedCollection.js +1 -1
- package/translations/mapCollections/aggregatedCollection.mjs +1 -1
- package/translations/maps/indexMap.js +1 -1
- package/translations/maps/indexMap.mjs +1 -1
- package/utils/dataStructures/linkedList.js +1 -6
- package/utils/dataStructures/linkedList.mjs +1 -6
- package/utils/dataStructures/tree.js +1 -1
- package/utils/dataStructures/tree.mjs +1 -1
- package/utils/interval.js +44 -26
- package/utils/interval.mjs +44 -26
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/i18n/languages/ar-AR.d.ts +0 -5
- package/i18n/languages/cs-CZ.d.ts +0 -5
- package/i18n/languages/hr-HR.d.ts +0 -5
- package/i18n/languages/sr-SP.d.ts +0 -5
- package/plugins/mergeCells/focusOrder.js +0 -305
- package/plugins/mergeCells/focusOrder.mjs +0 -300
@@ -2,9 +2,12 @@ import "core-js/modules/es.error.cause.js";
|
|
2
2
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
3
3
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
4
4
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
5
|
-
function
|
6
|
-
function
|
7
|
-
function
|
5
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
6
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
7
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
8
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
9
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
10
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
8
11
|
/* eslint-disable no-continue */
|
9
12
|
import { addClass } from "../../../../helpers/dom/element.mjs";
|
10
13
|
/**
|
@@ -15,7 +18,7 @@ import { addClass } from "../../../../helpers/dom/element.mjs";
|
|
15
18
|
*/
|
16
19
|
var _selection = /*#__PURE__*/new WeakMap();
|
17
20
|
var _activeOverlaysWot = /*#__PURE__*/new WeakMap();
|
18
|
-
var
|
21
|
+
var _scanCellsRange = /*#__PURE__*/new WeakSet();
|
19
22
|
export class SelectionScanner {
|
20
23
|
constructor() {
|
21
24
|
/**
|
@@ -23,19 +26,25 @@ export class SelectionScanner {
|
|
23
26
|
*
|
24
27
|
* @param {function(number, number): void} callback The callback function to trigger.
|
25
28
|
*/
|
26
|
-
_classPrivateMethodInitSpec(this,
|
29
|
+
_classPrivateMethodInitSpec(this, _scanCellsRange);
|
27
30
|
/**
|
28
31
|
* Active Selection instance to process.
|
29
32
|
*
|
30
33
|
* @type {Selection}
|
31
34
|
*/
|
32
|
-
_classPrivateFieldInitSpec(this, _selection,
|
35
|
+
_classPrivateFieldInitSpec(this, _selection, {
|
36
|
+
writable: true,
|
37
|
+
value: void 0
|
38
|
+
});
|
33
39
|
/**
|
34
40
|
* The Walkontable instance that the scans depends on.
|
35
41
|
*
|
36
42
|
* @type {Walkontable}
|
37
43
|
*/
|
38
|
-
_classPrivateFieldInitSpec(this, _activeOverlaysWot,
|
44
|
+
_classPrivateFieldInitSpec(this, _activeOverlaysWot, {
|
45
|
+
writable: true,
|
46
|
+
value: void 0
|
47
|
+
});
|
39
48
|
}
|
40
49
|
/**
|
41
50
|
* Sets the Walkontable instance that will be taking into account while scanning the table.
|
@@ -44,7 +53,7 @@ export class SelectionScanner {
|
|
44
53
|
* @returns {SelectionScanner}
|
45
54
|
*/
|
46
55
|
setActiveOverlay(activeOverlaysWot) {
|
47
|
-
_classPrivateFieldSet(
|
56
|
+
_classPrivateFieldSet(this, _activeOverlaysWot, activeOverlaysWot);
|
48
57
|
return this;
|
49
58
|
}
|
50
59
|
|
@@ -55,7 +64,7 @@ export class SelectionScanner {
|
|
55
64
|
* @returns {SelectionScanner}
|
56
65
|
*/
|
57
66
|
setActiveSelection(selection) {
|
58
|
-
_classPrivateFieldSet(
|
67
|
+
_classPrivateFieldSet(this, _selection, selection);
|
59
68
|
return this;
|
60
69
|
}
|
61
70
|
|
@@ -66,7 +75,7 @@ export class SelectionScanner {
|
|
66
75
|
* @returns {HTMLTableElement[]}
|
67
76
|
*/
|
68
77
|
scan() {
|
69
|
-
const selectionType = _classPrivateFieldGet(
|
78
|
+
const selectionType = _classPrivateFieldGet(this, _selection).settings.selectionType;
|
70
79
|
const elements = new Set();
|
71
80
|
|
72
81
|
// TODO(improvement): use heuristics from coords to detect what type of scan
|
@@ -102,10 +111,10 @@ export class SelectionScanner {
|
|
102
111
|
* @param {function(HTMLTableElement): void} callback The callback function to trigger.
|
103
112
|
*/
|
104
113
|
scanColumnsInHeadersRange(callback) {
|
105
|
-
const [topRow, topColumn, bottomRow, bottomColumn] = _classPrivateFieldGet(
|
114
|
+
const [topRow, topColumn, bottomRow, bottomColumn] = _classPrivateFieldGet(this, _selection).getCorners();
|
106
115
|
const {
|
107
116
|
wtTable
|
108
|
-
} = _classPrivateFieldGet(
|
117
|
+
} = _classPrivateFieldGet(this, _activeOverlaysWot);
|
109
118
|
const renderedColumnsCount = wtTable.getRenderedColumnsCount();
|
110
119
|
const columnHeadersCount = wtTable.getColumnHeadersCount();
|
111
120
|
let cursor = 0;
|
@@ -120,8 +129,8 @@ export class SelectionScanner {
|
|
120
129
|
}
|
121
130
|
const positiveBasedHeaderLevel = headerLevel + columnHeadersCount;
|
122
131
|
let TH = wtTable.getColumnHeader(sourceColumn, positiveBasedHeaderLevel);
|
123
|
-
const newSourceCol = _classPrivateFieldGet(
|
124
|
-
selectionType: _classPrivateFieldGet(
|
132
|
+
const newSourceCol = _classPrivateFieldGet(this, _activeOverlaysWot).getSetting('onBeforeHighlightingColumnHeader', sourceColumn, positiveBasedHeaderLevel, {
|
133
|
+
selectionType: _classPrivateFieldGet(this, _selection).settings.selectionType,
|
125
134
|
columnCursor: cursor,
|
126
135
|
selectionWidth: bottomColumn - topColumn + 1
|
127
136
|
});
|
@@ -144,10 +153,10 @@ export class SelectionScanner {
|
|
144
153
|
* @param {function(HTMLTableElement): void} callback The callback function to trigger.
|
145
154
|
*/
|
146
155
|
scanRowsInHeadersRange(callback) {
|
147
|
-
const [topRow, topColumn, bottomRow, bottomColumn] = _classPrivateFieldGet(
|
156
|
+
const [topRow, topColumn, bottomRow, bottomColumn] = _classPrivateFieldGet(this, _selection).getCorners();
|
148
157
|
const {
|
149
158
|
wtTable
|
150
|
-
} = _classPrivateFieldGet(
|
159
|
+
} = _classPrivateFieldGet(this, _activeOverlaysWot);
|
151
160
|
const renderedRowsCount = wtTable.getRenderedRowsCount();
|
152
161
|
const rowHeadersCount = wtTable.getRowHeadersCount();
|
153
162
|
let cursor = 0;
|
@@ -162,8 +171,8 @@ export class SelectionScanner {
|
|
162
171
|
}
|
163
172
|
const positiveBasedHeaderLevel = headerLevel + rowHeadersCount;
|
164
173
|
let TH = wtTable.getRowHeader(sourceRow, positiveBasedHeaderLevel);
|
165
|
-
const newSourceRow = _classPrivateFieldGet(
|
166
|
-
selectionType: _classPrivateFieldGet(
|
174
|
+
const newSourceRow = _classPrivateFieldGet(this, _activeOverlaysWot).getSetting('onBeforeHighlightingRowHeader', sourceRow, positiveBasedHeaderLevel, {
|
175
|
+
selectionType: _classPrivateFieldGet(this, _selection).settings.selectionType,
|
167
176
|
rowCursor: cursor,
|
168
177
|
selectionHeight: bottomRow - topRow + 1
|
169
178
|
});
|
@@ -186,16 +195,16 @@ export class SelectionScanner {
|
|
186
195
|
* @param {function(HTMLTableElement): void} callback The callback function to trigger.
|
187
196
|
*/
|
188
197
|
scanCellsRange(callback) {
|
189
|
-
const [topRow, topColumn, bottomRow, bottomColumn] = _classPrivateFieldGet(
|
198
|
+
const [topRow, topColumn, bottomRow, bottomColumn] = _classPrivateFieldGet(this, _selection).getCorners();
|
190
199
|
const {
|
191
200
|
wtTable
|
192
|
-
} = _classPrivateFieldGet(
|
193
|
-
|
201
|
+
} = _classPrivateFieldGet(this, _activeOverlaysWot);
|
202
|
+
_classPrivateMethodGet(this, _scanCellsRange, _scanCellsRange2).call(this, (sourceRow, sourceColumn) => {
|
194
203
|
if (sourceRow >= topRow && sourceRow <= bottomRow && sourceColumn >= topColumn && sourceColumn <= bottomColumn) {
|
195
|
-
const cell = wtTable.getCell(_classPrivateFieldGet(
|
204
|
+
const cell = wtTable.getCell(_classPrivateFieldGet(this, _activeOverlaysWot).createCellCoords(sourceRow, sourceColumn));
|
196
205
|
|
197
206
|
// support for old API
|
198
|
-
const additionalSelectionClass = _classPrivateFieldGet(
|
207
|
+
const additionalSelectionClass = _classPrivateFieldGet(this, _activeOverlaysWot).getSetting('onAfterDrawSelection', sourceRow, sourceColumn, _classPrivateFieldGet(this, _selection).settings.layerLevel);
|
199
208
|
if (typeof additionalSelectionClass === 'string') {
|
200
209
|
addClass(cell, additionalSelectionClass);
|
201
210
|
}
|
@@ -212,13 +221,13 @@ export class SelectionScanner {
|
|
212
221
|
*/
|
213
222
|
scanRowsInCellsRange(callback) {
|
214
223
|
// eslint-disable-next-line comma-spacing
|
215
|
-
const [topRow,, bottomRow] = _classPrivateFieldGet(
|
224
|
+
const [topRow,, bottomRow] = _classPrivateFieldGet(this, _selection).getCorners();
|
216
225
|
const {
|
217
226
|
wtTable
|
218
|
-
} = _classPrivateFieldGet(
|
219
|
-
|
227
|
+
} = _classPrivateFieldGet(this, _activeOverlaysWot);
|
228
|
+
_classPrivateMethodGet(this, _scanCellsRange, _scanCellsRange2).call(this, (sourceRow, sourceColumn) => {
|
220
229
|
if (sourceRow >= topRow && sourceRow <= bottomRow) {
|
221
|
-
const cell = wtTable.getCell(_classPrivateFieldGet(
|
230
|
+
const cell = wtTable.getCell(_classPrivateFieldGet(this, _activeOverlaysWot).createCellCoords(sourceRow, sourceColumn));
|
222
231
|
callback(cell);
|
223
232
|
}
|
224
233
|
});
|
@@ -231,22 +240,22 @@ export class SelectionScanner {
|
|
231
240
|
* @param {function(HTMLTableElement): void} callback The callback function to trigger.
|
232
241
|
*/
|
233
242
|
scanColumnsInCellsRange(callback) {
|
234
|
-
const [, topColumn,, bottomColumn] = _classPrivateFieldGet(
|
243
|
+
const [, topColumn,, bottomColumn] = _classPrivateFieldGet(this, _selection).getCorners();
|
235
244
|
const {
|
236
245
|
wtTable
|
237
|
-
} = _classPrivateFieldGet(
|
238
|
-
|
246
|
+
} = _classPrivateFieldGet(this, _activeOverlaysWot);
|
247
|
+
_classPrivateMethodGet(this, _scanCellsRange, _scanCellsRange2).call(this, (sourceRow, sourceColumn) => {
|
239
248
|
if (sourceColumn >= topColumn && sourceColumn <= bottomColumn) {
|
240
|
-
const cell = wtTable.getCell(_classPrivateFieldGet(
|
249
|
+
const cell = wtTable.getCell(_classPrivateFieldGet(this, _activeOverlaysWot).createCellCoords(sourceRow, sourceColumn));
|
241
250
|
callback(cell);
|
242
251
|
}
|
243
252
|
});
|
244
253
|
}
|
245
254
|
}
|
246
|
-
function
|
255
|
+
function _scanCellsRange2(callback) {
|
247
256
|
const {
|
248
257
|
wtTable
|
249
|
-
} = _classPrivateFieldGet(
|
258
|
+
} = _classPrivateFieldGet(this, _activeOverlaysWot);
|
250
259
|
const renderedRowsCount = wtTable.getRenderedRowsCount();
|
251
260
|
const renderedColumnsCount = wtTable.getRenderedColumnsCount();
|
252
261
|
for (let row = 0; row < renderedRowsCount; row += 1) {
|
@@ -7,9 +7,11 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
7
7
|
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; }
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
9
9
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
10
|
-
function _classPrivateFieldGet(
|
11
|
-
function
|
12
|
-
function
|
10
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
11
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
12
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
13
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
14
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
13
15
|
var _totalTargetWidth = /*#__PURE__*/new WeakMap();
|
14
16
|
var _totalColumns = /*#__PURE__*/new WeakMap();
|
15
17
|
var _stretchingColumnWidthFn = /*#__PURE__*/new WeakMap();
|
@@ -61,7 +63,10 @@ class ColumnStretching {
|
|
61
63
|
/**
|
62
64
|
* @type {number}
|
63
65
|
*/
|
64
|
-
_classPrivateFieldInitSpec(this, _totalTargetWidth,
|
66
|
+
_classPrivateFieldInitSpec(this, _totalTargetWidth, {
|
67
|
+
writable: true,
|
68
|
+
value: 0
|
69
|
+
});
|
65
70
|
/**
|
66
71
|
* @type {boolean}
|
67
72
|
*/
|
@@ -71,29 +76,41 @@ class ColumnStretching {
|
|
71
76
|
*
|
72
77
|
* @type {function(): number}
|
73
78
|
*/
|
74
|
-
_classPrivateFieldInitSpec(this, _totalColumns,
|
79
|
+
_classPrivateFieldInitSpec(this, _totalColumns, {
|
80
|
+
writable: true,
|
81
|
+
value: () => 0
|
82
|
+
});
|
75
83
|
/**
|
76
84
|
* Function that returns the width of the stretched column at a given index (in px).
|
77
85
|
*
|
78
86
|
* @type {function(): number}
|
79
87
|
*/
|
80
|
-
_classPrivateFieldInitSpec(this, _stretchingColumnWidthFn,
|
88
|
+
_classPrivateFieldInitSpec(this, _stretchingColumnWidthFn, {
|
89
|
+
writable: true,
|
90
|
+
value: width => width
|
91
|
+
});
|
81
92
|
/**
|
82
93
|
* Function that returns the width of the column at a given index (in px).
|
83
94
|
*
|
84
95
|
* @type {function(): number}
|
85
96
|
*/
|
86
|
-
_classPrivateFieldInitSpec(this, _columnWidthFn,
|
97
|
+
_classPrivateFieldInitSpec(this, _columnWidthFn, {
|
98
|
+
writable: true,
|
99
|
+
value: width => width
|
100
|
+
});
|
87
101
|
/**
|
88
102
|
* Stretch mode.
|
89
103
|
*
|
90
104
|
* @type {function(): 'all' | 'last' | 'none'}
|
91
105
|
*/
|
92
|
-
_classPrivateFieldInitSpec(this, _stretchMode,
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
_classPrivateFieldSet(
|
106
|
+
_classPrivateFieldInitSpec(this, _stretchMode, {
|
107
|
+
writable: true,
|
108
|
+
value: () => 'none'
|
109
|
+
});
|
110
|
+
_classPrivateFieldSet(this, _totalColumns, totalColumns);
|
111
|
+
_classPrivateFieldSet(this, _stretchMode, stretchMode);
|
112
|
+
_classPrivateFieldSet(this, _stretchingColumnWidthFn, stretchingColumnWidthFn !== null && stretchingColumnWidthFn !== void 0 ? stretchingColumnWidthFn : _classPrivateFieldGet(this, _stretchingColumnWidthFn));
|
113
|
+
_classPrivateFieldSet(this, _columnWidthFn, columnWidthFn !== null && columnWidthFn !== void 0 ? columnWidthFn : _classPrivateFieldGet(this, _columnWidthFn));
|
97
114
|
}
|
98
115
|
|
99
116
|
/**
|
@@ -102,14 +119,14 @@ class ColumnStretching {
|
|
102
119
|
* @param {number} totalWidth The total width of the table.
|
103
120
|
*/
|
104
121
|
refreshStretching(totalWidth) {
|
105
|
-
if (_classPrivateFieldGet(
|
122
|
+
if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'none') {
|
106
123
|
return;
|
107
124
|
}
|
108
|
-
_classPrivateFieldSet(
|
125
|
+
_classPrivateFieldSet(this, _totalTargetWidth, totalWidth);
|
109
126
|
let sumAll = 0;
|
110
|
-
for (let i = 0; i < _classPrivateFieldGet(
|
127
|
+
for (let i = 0; i < _classPrivateFieldGet(this, _totalColumns).call(this); i++) {
|
111
128
|
const columnWidth = this._getColumnWidth(i);
|
112
|
-
const permanentColumnWidth = _classPrivateFieldGet(
|
129
|
+
const permanentColumnWidth = _classPrivateFieldGet(this, _stretchingColumnWidthFn).call(this, undefined, i);
|
113
130
|
if (typeof permanentColumnWidth === 'number') {
|
114
131
|
totalWidth -= permanentColumnWidth;
|
115
132
|
} else {
|
@@ -117,12 +134,12 @@ class ColumnStretching {
|
|
117
134
|
}
|
118
135
|
}
|
119
136
|
const remainingSize = totalWidth - sumAll;
|
120
|
-
if (_classPrivateFieldGet(
|
137
|
+
if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'all' && remainingSize > 0) {
|
121
138
|
this.stretchAllRatio = totalWidth / sumAll;
|
122
139
|
this.stretchAllColumnsWidth = [];
|
123
140
|
this.needVerifyLastColumnWidth = true;
|
124
|
-
} else if (_classPrivateFieldGet(
|
125
|
-
const columnWidth = this._getColumnWidth(_classPrivateFieldGet(
|
141
|
+
} else if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'last' && totalWidth !== Infinity) {
|
142
|
+
const columnWidth = this._getColumnWidth(_classPrivateFieldGet(this, _totalColumns).call(this) - 1);
|
126
143
|
const lastColumnWidth = remainingSize + columnWidth;
|
127
144
|
this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth;
|
128
145
|
}
|
@@ -137,9 +154,9 @@ class ColumnStretching {
|
|
137
154
|
*/
|
138
155
|
getStretchedColumnWidth(column, baseWidth) {
|
139
156
|
let result = null;
|
140
|
-
if (_classPrivateFieldGet(
|
157
|
+
if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'all' && this.stretchAllRatio !== 0) {
|
141
158
|
result = this._getStretchedAllColumnWidth(column, baseWidth);
|
142
|
-
} else if (_classPrivateFieldGet(
|
159
|
+
} else if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'last' && this.stretchLastWidth !== 0) {
|
143
160
|
result = this._getStretchedLastColumnWidth(column);
|
144
161
|
}
|
145
162
|
return result;
|
@@ -155,20 +172,20 @@ class ColumnStretching {
|
|
155
172
|
let sumRatioWidth = 0;
|
156
173
|
if (!this.stretchAllColumnsWidth[column]) {
|
157
174
|
const stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);
|
158
|
-
const newStretchedWidth = _classPrivateFieldGet(
|
175
|
+
const newStretchedWidth = _classPrivateFieldGet(this, _stretchingColumnWidthFn).call(this, stretchedWidth, column);
|
159
176
|
if (newStretchedWidth === undefined) {
|
160
177
|
this.stretchAllColumnsWidth[column] = stretchedWidth;
|
161
178
|
} else {
|
162
179
|
this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;
|
163
180
|
}
|
164
181
|
}
|
165
|
-
if (this.stretchAllColumnsWidth.length === _classPrivateFieldGet(
|
182
|
+
if (this.stretchAllColumnsWidth.length === _classPrivateFieldGet(this, _totalColumns).call(this) && this.needVerifyLastColumnWidth) {
|
166
183
|
this.needVerifyLastColumnWidth = false;
|
167
184
|
for (let i = 0; i < this.stretchAllColumnsWidth.length; i++) {
|
168
185
|
sumRatioWidth += this.stretchAllColumnsWidth[i];
|
169
186
|
}
|
170
|
-
if (sumRatioWidth !== _classPrivateFieldGet(
|
171
|
-
this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += _classPrivateFieldGet(
|
187
|
+
if (sumRatioWidth !== _classPrivateFieldGet(this, _totalTargetWidth)) {
|
188
|
+
this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += _classPrivateFieldGet(this, _totalTargetWidth) - sumRatioWidth;
|
172
189
|
}
|
173
190
|
}
|
174
191
|
return this.stretchAllColumnsWidth[column];
|
@@ -180,7 +197,7 @@ class ColumnStretching {
|
|
180
197
|
* @private
|
181
198
|
*/
|
182
199
|
_getStretchedLastColumnWidth(column) {
|
183
|
-
if (column === _classPrivateFieldGet(
|
200
|
+
if (column === _classPrivateFieldGet(this, _totalColumns).call(this) - 1) {
|
184
201
|
return this.stretchLastWidth;
|
185
202
|
}
|
186
203
|
return null;
|
@@ -192,7 +209,7 @@ class ColumnStretching {
|
|
192
209
|
* @private
|
193
210
|
*/
|
194
211
|
_getColumnWidth(column) {
|
195
|
-
let width = _classPrivateFieldGet(
|
212
|
+
let width = _classPrivateFieldGet(this, _columnWidthFn).call(this, column);
|
196
213
|
if (isNaN(width)) {
|
197
214
|
width = ColumnStretching.DEFAULT_WIDTH;
|
198
215
|
}
|
@@ -4,9 +4,11 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
4
4
|
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; }
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
6
6
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
7
|
-
function _classPrivateFieldGet(
|
8
|
-
function
|
9
|
-
function
|
7
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
8
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
9
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
10
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
11
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
10
12
|
var _totalTargetWidth = /*#__PURE__*/new WeakMap();
|
11
13
|
var _totalColumns = /*#__PURE__*/new WeakMap();
|
12
14
|
var _stretchingColumnWidthFn = /*#__PURE__*/new WeakMap();
|
@@ -58,7 +60,10 @@ export class ColumnStretching {
|
|
58
60
|
/**
|
59
61
|
* @type {number}
|
60
62
|
*/
|
61
|
-
_classPrivateFieldInitSpec(this, _totalTargetWidth,
|
63
|
+
_classPrivateFieldInitSpec(this, _totalTargetWidth, {
|
64
|
+
writable: true,
|
65
|
+
value: 0
|
66
|
+
});
|
62
67
|
/**
|
63
68
|
* @type {boolean}
|
64
69
|
*/
|
@@ -68,29 +73,41 @@ export class ColumnStretching {
|
|
68
73
|
*
|
69
74
|
* @type {function(): number}
|
70
75
|
*/
|
71
|
-
_classPrivateFieldInitSpec(this, _totalColumns,
|
76
|
+
_classPrivateFieldInitSpec(this, _totalColumns, {
|
77
|
+
writable: true,
|
78
|
+
value: () => 0
|
79
|
+
});
|
72
80
|
/**
|
73
81
|
* Function that returns the width of the stretched column at a given index (in px).
|
74
82
|
*
|
75
83
|
* @type {function(): number}
|
76
84
|
*/
|
77
|
-
_classPrivateFieldInitSpec(this, _stretchingColumnWidthFn,
|
85
|
+
_classPrivateFieldInitSpec(this, _stretchingColumnWidthFn, {
|
86
|
+
writable: true,
|
87
|
+
value: width => width
|
88
|
+
});
|
78
89
|
/**
|
79
90
|
* Function that returns the width of the column at a given index (in px).
|
80
91
|
*
|
81
92
|
* @type {function(): number}
|
82
93
|
*/
|
83
|
-
_classPrivateFieldInitSpec(this, _columnWidthFn,
|
94
|
+
_classPrivateFieldInitSpec(this, _columnWidthFn, {
|
95
|
+
writable: true,
|
96
|
+
value: width => width
|
97
|
+
});
|
84
98
|
/**
|
85
99
|
* Stretch mode.
|
86
100
|
*
|
87
101
|
* @type {function(): 'all' | 'last' | 'none'}
|
88
102
|
*/
|
89
|
-
_classPrivateFieldInitSpec(this, _stretchMode,
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
_classPrivateFieldSet(
|
103
|
+
_classPrivateFieldInitSpec(this, _stretchMode, {
|
104
|
+
writable: true,
|
105
|
+
value: () => 'none'
|
106
|
+
});
|
107
|
+
_classPrivateFieldSet(this, _totalColumns, totalColumns);
|
108
|
+
_classPrivateFieldSet(this, _stretchMode, stretchMode);
|
109
|
+
_classPrivateFieldSet(this, _stretchingColumnWidthFn, stretchingColumnWidthFn !== null && stretchingColumnWidthFn !== void 0 ? stretchingColumnWidthFn : _classPrivateFieldGet(this, _stretchingColumnWidthFn));
|
110
|
+
_classPrivateFieldSet(this, _columnWidthFn, columnWidthFn !== null && columnWidthFn !== void 0 ? columnWidthFn : _classPrivateFieldGet(this, _columnWidthFn));
|
94
111
|
}
|
95
112
|
|
96
113
|
/**
|
@@ -99,14 +116,14 @@ export class ColumnStretching {
|
|
99
116
|
* @param {number} totalWidth The total width of the table.
|
100
117
|
*/
|
101
118
|
refreshStretching(totalWidth) {
|
102
|
-
if (_classPrivateFieldGet(
|
119
|
+
if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'none') {
|
103
120
|
return;
|
104
121
|
}
|
105
|
-
_classPrivateFieldSet(
|
122
|
+
_classPrivateFieldSet(this, _totalTargetWidth, totalWidth);
|
106
123
|
let sumAll = 0;
|
107
|
-
for (let i = 0; i < _classPrivateFieldGet(
|
124
|
+
for (let i = 0; i < _classPrivateFieldGet(this, _totalColumns).call(this); i++) {
|
108
125
|
const columnWidth = this._getColumnWidth(i);
|
109
|
-
const permanentColumnWidth = _classPrivateFieldGet(
|
126
|
+
const permanentColumnWidth = _classPrivateFieldGet(this, _stretchingColumnWidthFn).call(this, undefined, i);
|
110
127
|
if (typeof permanentColumnWidth === 'number') {
|
111
128
|
totalWidth -= permanentColumnWidth;
|
112
129
|
} else {
|
@@ -114,12 +131,12 @@ export class ColumnStretching {
|
|
114
131
|
}
|
115
132
|
}
|
116
133
|
const remainingSize = totalWidth - sumAll;
|
117
|
-
if (_classPrivateFieldGet(
|
134
|
+
if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'all' && remainingSize > 0) {
|
118
135
|
this.stretchAllRatio = totalWidth / sumAll;
|
119
136
|
this.stretchAllColumnsWidth = [];
|
120
137
|
this.needVerifyLastColumnWidth = true;
|
121
|
-
} else if (_classPrivateFieldGet(
|
122
|
-
const columnWidth = this._getColumnWidth(_classPrivateFieldGet(
|
138
|
+
} else if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'last' && totalWidth !== Infinity) {
|
139
|
+
const columnWidth = this._getColumnWidth(_classPrivateFieldGet(this, _totalColumns).call(this) - 1);
|
123
140
|
const lastColumnWidth = remainingSize + columnWidth;
|
124
141
|
this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth;
|
125
142
|
}
|
@@ -134,9 +151,9 @@ export class ColumnStretching {
|
|
134
151
|
*/
|
135
152
|
getStretchedColumnWidth(column, baseWidth) {
|
136
153
|
let result = null;
|
137
|
-
if (_classPrivateFieldGet(
|
154
|
+
if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'all' && this.stretchAllRatio !== 0) {
|
138
155
|
result = this._getStretchedAllColumnWidth(column, baseWidth);
|
139
|
-
} else if (_classPrivateFieldGet(
|
156
|
+
} else if (_classPrivateFieldGet(this, _stretchMode).call(this) === 'last' && this.stretchLastWidth !== 0) {
|
140
157
|
result = this._getStretchedLastColumnWidth(column);
|
141
158
|
}
|
142
159
|
return result;
|
@@ -152,20 +169,20 @@ export class ColumnStretching {
|
|
152
169
|
let sumRatioWidth = 0;
|
153
170
|
if (!this.stretchAllColumnsWidth[column]) {
|
154
171
|
const stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);
|
155
|
-
const newStretchedWidth = _classPrivateFieldGet(
|
172
|
+
const newStretchedWidth = _classPrivateFieldGet(this, _stretchingColumnWidthFn).call(this, stretchedWidth, column);
|
156
173
|
if (newStretchedWidth === undefined) {
|
157
174
|
this.stretchAllColumnsWidth[column] = stretchedWidth;
|
158
175
|
} else {
|
159
176
|
this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;
|
160
177
|
}
|
161
178
|
}
|
162
|
-
if (this.stretchAllColumnsWidth.length === _classPrivateFieldGet(
|
179
|
+
if (this.stretchAllColumnsWidth.length === _classPrivateFieldGet(this, _totalColumns).call(this) && this.needVerifyLastColumnWidth) {
|
163
180
|
this.needVerifyLastColumnWidth = false;
|
164
181
|
for (let i = 0; i < this.stretchAllColumnsWidth.length; i++) {
|
165
182
|
sumRatioWidth += this.stretchAllColumnsWidth[i];
|
166
183
|
}
|
167
|
-
if (sumRatioWidth !== _classPrivateFieldGet(
|
168
|
-
this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += _classPrivateFieldGet(
|
184
|
+
if (sumRatioWidth !== _classPrivateFieldGet(this, _totalTargetWidth)) {
|
185
|
+
this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += _classPrivateFieldGet(this, _totalTargetWidth) - sumRatioWidth;
|
169
186
|
}
|
170
187
|
}
|
171
188
|
return this.stretchAllColumnsWidth[column];
|
@@ -177,7 +194,7 @@ export class ColumnStretching {
|
|
177
194
|
* @private
|
178
195
|
*/
|
179
196
|
_getStretchedLastColumnWidth(column) {
|
180
|
-
if (column === _classPrivateFieldGet(
|
197
|
+
if (column === _classPrivateFieldGet(this, _totalColumns).call(this) - 1) {
|
181
198
|
return this.stretchLastWidth;
|
182
199
|
}
|
183
200
|
return null;
|
@@ -189,7 +206,7 @@ export class ColumnStretching {
|
|
189
206
|
* @private
|
190
207
|
*/
|
191
208
|
_getColumnWidth(column) {
|
192
|
-
let width = _classPrivateFieldGet(
|
209
|
+
let width = _classPrivateFieldGet(this, _columnWidthFn).call(this, column);
|
193
210
|
if (isNaN(width)) {
|
194
211
|
width = ColumnStretching.DEFAULT_WIDTH;
|
195
212
|
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
5
4
|
require("core-js/modules/es.array.push.js");
|
5
|
+
require("core-js/modules/es.error.cause.js");
|
6
6
|
var _constants = require("./constants");
|
7
7
|
var _viewSizeSet = _interopRequireDefault(require("./viewSizeSet"));
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
3
3
|
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; }
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
package/base.js
CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
|
|
45
45
|
Handsontable.CellCoords = _src.CellCoords;
|
46
46
|
Handsontable.CellRange = _src.CellRange;
|
47
47
|
Handsontable.packageName = 'handsontable';
|
48
|
-
Handsontable.buildDate = "03/04/2024
|
49
|
-
Handsontable.version = "0.0.0-next-
|
48
|
+
Handsontable.buildDate = "03/04/2024 12:33:47";
|
49
|
+
Handsontable.version = "0.0.0-next-5a535ed-20240403";
|
50
50
|
Handsontable.languages = {
|
51
51
|
dictionaryKeys: _registry.dictionaryKeys,
|
52
52
|
getLanguageDictionary: _registry.getLanguageDictionary,
|
package/base.mjs
CHANGED
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
|
|
35
35
|
Handsontable.CellCoords = CellCoords;
|
36
36
|
Handsontable.CellRange = CellRange;
|
37
37
|
Handsontable.packageName = 'handsontable';
|
38
|
-
Handsontable.buildDate = "03/04/2024
|
39
|
-
Handsontable.version = "0.0.0-next-
|
38
|
+
Handsontable.buildDate = "03/04/2024 12:33:52";
|
39
|
+
Handsontable.version = "0.0.0-next-5a535ed-20240403";
|
40
40
|
Handsontable.languages = {
|
41
41
|
dictionaryKeys,
|
42
42
|
getLanguageDictionary,
|
@@ -4,7 +4,6 @@ exports.__esModule = true;
|
|
4
4
|
exports.createViewportScroller = createViewportScroller;
|
5
5
|
var _columnHeaderScroll = require("./scrollStrategies/columnHeaderScroll");
|
6
6
|
var _cornerHeaderScroll = require("./scrollStrategies/cornerHeaderScroll");
|
7
|
-
var _focusScroll = require("./scrollStrategies/focusScroll");
|
8
7
|
var _multipleScroll = require("./scrollStrategies/multipleScroll");
|
9
8
|
var _noncontiguousScroll = require("./scrollStrategies/noncontiguousScroll");
|
10
9
|
var _rowHeaderScroll = require("./scrollStrategies/rowHeaderScroll");
|
@@ -47,9 +46,7 @@ function createViewportScroller(hot) {
|
|
47
46
|
return;
|
48
47
|
}
|
49
48
|
let scrollStrategy;
|
50
|
-
if (selection.
|
51
|
-
scrollStrategy = (0, _focusScroll.focusScrollStrategy)(hot);
|
52
|
-
} else if (selection.isSelectedByCorner()) {
|
49
|
+
if (selection.isSelectedByCorner()) {
|
53
50
|
scrollStrategy = (0, _cornerHeaderScroll.cornerHeaderScrollStrategy)(hot);
|
54
51
|
} else if (selection.isSelectedByRowHeader()) {
|
55
52
|
scrollStrategy = (0, _rowHeaderScroll.rowHeaderScrollStrategy)(hot);
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { columnHeaderScrollStrategy } from "./scrollStrategies/columnHeaderScroll.mjs";
|
2
2
|
import { cornerHeaderScrollStrategy } from "./scrollStrategies/cornerHeaderScroll.mjs";
|
3
|
-
import { focusScrollStrategy } from "./scrollStrategies/focusScroll.mjs";
|
4
3
|
import { multipleScrollStrategy } from "./scrollStrategies/multipleScroll.mjs";
|
5
4
|
import { noncontiguousScrollStrategy } from "./scrollStrategies/noncontiguousScroll.mjs";
|
6
5
|
import { rowHeaderScrollStrategy } from "./scrollStrategies/rowHeaderScroll.mjs";
|
@@ -43,9 +42,7 @@ export function createViewportScroller(hot) {
|
|
43
42
|
return;
|
44
43
|
}
|
45
44
|
let scrollStrategy;
|
46
|
-
if (selection.
|
47
|
-
scrollStrategy = focusScrollStrategy(hot);
|
48
|
-
} else if (selection.isSelectedByCorner()) {
|
45
|
+
if (selection.isSelectedByCorner()) {
|
49
46
|
scrollStrategy = cornerHeaderScrollStrategy(hot);
|
50
47
|
} else if (selection.isSelectedByRowHeader()) {
|
51
48
|
scrollStrategy = rowHeaderScrollStrategy(hot);
|