handsontable 14.0.0-next-0f92d92-20231130 → 14.1.0-next-514dcd3-20240109
Sign up to get free protection for your applications and to get access to all the features.
- package/3rdparty/walkontable/src/calculator/index.js +11 -6
- package/3rdparty/walkontable/src/calculator/index.mjs +5 -3
- package/3rdparty/walkontable/src/calculator/renderAllColumns.js +50 -0
- package/3rdparty/walkontable/src/calculator/renderAllColumns.mjs +46 -0
- package/3rdparty/walkontable/src/calculator/renderAllRows.js +50 -0
- package/3rdparty/walkontable/src/calculator/renderAllRows.mjs +46 -0
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +3 -124
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +4 -126
- package/3rdparty/walkontable/src/calculator/viewportRows.js +3 -3
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +4 -5
- package/3rdparty/walkontable/src/cell/coords.d.ts +5 -5
- package/3rdparty/walkontable/src/cell/coords.js +2 -2
- package/3rdparty/walkontable/src/cell/coords.mjs +2 -2
- package/3rdparty/walkontable/src/cell/range.d.ts +5 -5
- package/3rdparty/walkontable/src/cell/range.js +16 -41
- package/3rdparty/walkontable/src/cell/range.mjs +16 -41
- package/3rdparty/walkontable/src/core/_base.js +2 -14
- package/3rdparty/walkontable/src/core/_base.mjs +2 -14
- package/3rdparty/walkontable/src/core/clone.js +2 -2
- package/3rdparty/walkontable/src/core/clone.mjs +2 -2
- package/3rdparty/walkontable/src/core/core.js +0 -2
- package/3rdparty/walkontable/src/core/core.mjs +0 -2
- package/3rdparty/walkontable/src/facade/core.js +0 -9
- package/3rdparty/walkontable/src/facade/core.mjs +0 -9
- package/3rdparty/walkontable/src/filter/column.js +2 -2
- package/3rdparty/walkontable/src/filter/column.mjs +2 -2
- package/3rdparty/walkontable/src/filter/row.js +2 -2
- package/3rdparty/walkontable/src/filter/row.mjs +2 -2
- package/3rdparty/walkontable/src/index.js +3 -4
- package/3rdparty/walkontable/src/index.mjs +1 -2
- package/3rdparty/walkontable/src/overlay/_base.js +2 -2
- package/3rdparty/walkontable/src/overlay/_base.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/bottom.js +2 -2
- package/3rdparty/walkontable/src/overlay/bottom.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/top.js +2 -2
- package/3rdparty/walkontable/src/overlay/top.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +2 -2
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +2 -2
- package/3rdparty/walkontable/src/overlays.js +2 -5
- package/3rdparty/walkontable/src/overlays.mjs +2 -6
- package/3rdparty/walkontable/src/renderer/_base.js +2 -2
- package/3rdparty/walkontable/src/renderer/_base.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/cells.js +2 -2
- package/3rdparty/walkontable/src/renderer/cells.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/colGroup.js +10 -0
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +10 -0
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +2 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/rows.js +6 -5
- package/3rdparty/walkontable/src/renderer/rows.mjs +6 -5
- package/3rdparty/walkontable/src/renderer/table.js +2 -2
- package/3rdparty/walkontable/src/renderer/table.mjs +2 -2
- package/3rdparty/walkontable/src/scroll.js +4 -60
- package/3rdparty/walkontable/src/scroll.mjs +4 -60
- package/3rdparty/walkontable/src/selection/manager.js +0 -1
- package/3rdparty/walkontable/src/selection/manager.mjs +0 -1
- package/3rdparty/walkontable/src/settings.js +5 -2
- package/3rdparty/walkontable/src/settings.mjs +4 -2
- package/3rdparty/walkontable/src/table.js +2 -3
- package/3rdparty/walkontable/src/table.mjs +2 -3
- package/3rdparty/walkontable/src/utils/column.js +29 -14
- package/3rdparty/walkontable/src/utils/column.mjs +29 -14
- package/3rdparty/walkontable/src/utils/columnStretching.js +219 -0
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +215 -0
- package/3rdparty/walkontable/src/utils/nodesPool.js +2 -2
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +2 -2
- package/3rdparty/walkontable/src/utils/orderView/view.js +2 -2
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +2 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSize.js +2 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +2 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +2 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +2 -2
- package/3rdparty/walkontable/src/utils/row.js +2 -2
- package/3rdparty/walkontable/src/utils/row.mjs +2 -2
- package/3rdparty/walkontable/src/viewport.js +22 -17
- package/3rdparty/walkontable/src/viewport.mjs +23 -18
- package/CHANGELOG.md +36 -0
- package/base.js +4 -2
- package/base.mjs +2 -2
- package/cellTypes/dropdownType/dropdownType.d.ts +6 -6
- package/cellTypes/dropdownType/dropdownType.js +4 -4
- package/cellTypes/dropdownType/dropdownType.mjs +4 -4
- package/core/focusCatcher/index.js +44 -6
- package/core/focusCatcher/index.mjs +44 -6
- package/core.d.ts +19 -19
- package/core.js +7 -12
- package/core.mjs +7 -12
- package/dataMap/dataMap.js +3 -2
- package/dataMap/dataMap.mjs +2 -2
- package/dataMap/dataSource.js +2 -2
- package/dataMap/dataSource.mjs +2 -2
- package/dataMap/metaManager/lazyFactoryMap.js +2 -2
- package/dataMap/metaManager/lazyFactoryMap.mjs +2 -2
- package/dataMap/metaManager/metaLayers/cellMeta.js +2 -2
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +2 -2
- package/dataMap/metaManager/metaLayers/columnMeta.js +2 -2
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +2 -2
- package/dataMap/metaManager/metaLayers/globalMeta.js +2 -2
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +2 -2
- package/dataMap/metaManager/metaLayers/tableMeta.js +2 -2
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +2 -2
- package/dataMap/metaManager/metaSchema.js +40 -25
- package/dataMap/metaManager/metaSchema.mjs +40 -25
- package/dataMap/metaManager/mods/dynamicCellMeta.js +2 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +2 -2
- package/dataMap/metaManager/mods/extendMetaProperties.js +14 -2
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +14 -2
- package/dist/handsontable.css +5 -5
- package/dist/handsontable.full.css +6 -6
- package/dist/handsontable.full.js +4835 -4508
- package/dist/handsontable.full.min.css +4 -4
- package/dist/handsontable.full.min.js +156 -154
- package/dist/handsontable.js +3441 -2825
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +18 -15
- package/editorManager.js +5 -6
- package/editorManager.mjs +5 -6
- package/editors/autocompleteEditor/autocompleteEditor.js +2 -4
- package/editors/autocompleteEditor/autocompleteEditor.mjs +2 -4
- package/editors/baseEditor/baseEditor.d.ts +1 -1
- package/editors/baseEditor/baseEditor.js +2 -2
- package/editors/baseEditor/baseEditor.mjs +2 -2
- package/editors/dateEditor/dateEditor.d.ts +1 -1
- package/editors/dateEditor/dateEditor.js +29 -33
- package/editors/dateEditor/dateEditor.mjs +29 -33
- package/editors/handsontableEditor/handsontableEditor.js +0 -1
- package/editors/handsontableEditor/handsontableEditor.mjs +0 -1
- package/editors/selectEditor/selectEditor.js +8 -2
- package/editors/selectEditor/selectEditor.mjs +8 -2
- package/editors/textEditor/textEditor.js +2 -6
- package/editors/textEditor/textEditor.mjs +2 -6
- package/eventManager.js +4 -3
- package/eventManager.mjs +4 -3
- package/helpers/browser.js +5 -2
- package/helpers/browser.mjs +5 -2
- package/helpers/feature.js +10 -0
- package/helpers/feature.mjs +9 -0
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/index.d.ts +12 -0
- package/package.json +13 -4
- package/pluginHooks.d.ts +10 -9
- package/pluginHooks.js +10 -8
- package/pluginHooks.mjs +7 -7
- package/plugins/autoColumnSize/autoColumnSize.d.ts +2 -2
- package/plugins/autoColumnSize/autoColumnSize.js +2 -2
- package/plugins/autoColumnSize/autoColumnSize.mjs +2 -2
- package/plugins/autoRowSize/autoRowSize.d.ts +3 -3
- package/plugins/autoRowSize/autoRowSize.js +2 -2
- package/plugins/autoRowSize/autoRowSize.mjs +2 -2
- package/plugins/autofill/autofill.js +2 -2
- package/plugins/autofill/autofill.mjs +2 -2
- package/plugins/base/base.js +2 -2
- package/plugins/base/base.mjs +2 -2
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.d.ts +1 -1
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +2 -2
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +2 -2
- package/plugins/collapsibleColumns/collapsibleColumns.js +2 -2
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +2 -2
- package/plugins/columnSorting/columnSorting.js +2 -2
- package/plugins/columnSorting/columnSorting.mjs +2 -2
- package/plugins/columnSorting/columnStatesManager.js +2 -2
- package/plugins/columnSorting/columnStatesManager.mjs +2 -2
- package/plugins/columnSummary/columnSummary.d.ts +11 -11
- package/plugins/columnSummary/columnSummary.js +20 -5
- package/plugins/columnSummary/columnSummary.mjs +20 -5
- package/plugins/columnSummary/endpoints.js +19 -5
- package/plugins/columnSummary/endpoints.mjs +19 -5
- package/plugins/comments/commentEditor.js +2 -2
- package/plugins/comments/commentEditor.mjs +2 -2
- package/plugins/comments/comments.js +2 -2
- package/plugins/comments/comments.mjs +2 -2
- package/plugins/comments/displaySwitch.js +2 -2
- package/plugins/comments/displaySwitch.mjs +2 -2
- package/plugins/contextMenu/commandExecutor.js +2 -2
- package/plugins/contextMenu/commandExecutor.mjs +2 -2
- package/plugins/contextMenu/contextMenu.js +2 -2
- package/plugins/contextMenu/contextMenu.mjs +2 -2
- package/plugins/contextMenu/itemsFactory.js +2 -2
- package/plugins/contextMenu/itemsFactory.mjs +2 -2
- package/plugins/contextMenu/menu/cursor.js +2 -2
- package/plugins/contextMenu/menu/cursor.mjs +2 -2
- package/plugins/contextMenu/menu/menu.js +2 -2
- package/plugins/contextMenu/menu/menu.mjs +2 -2
- package/plugins/copyPaste/copyPaste.js +40 -6
- package/plugins/copyPaste/copyPaste.mjs +40 -6
- package/plugins/customBorders/customBorders.d.ts +17 -8
- package/plugins/customBorders/customBorders.js +2 -7
- package/plugins/customBorders/customBorders.mjs +2 -7
- package/plugins/customBorders/utils.js +0 -1
- package/plugins/customBorders/utils.mjs +0 -1
- package/plugins/dragToScroll/dragToScroll.d.ts +8 -1
- package/plugins/dragToScroll/dragToScroll.js +18 -22
- package/plugins/dragToScroll/dragToScroll.mjs +18 -22
- package/plugins/dropdownMenu/dropdownMenu.js +2 -2
- package/plugins/dropdownMenu/dropdownMenu.mjs +2 -2
- package/plugins/exportFile/dataProvider.js +2 -2
- package/plugins/exportFile/dataProvider.mjs +2 -2
- package/plugins/exportFile/exportFile.d.ts +18 -3
- package/plugins/exportFile/types/_base.js +2 -2
- package/plugins/exportFile/types/_base.mjs +2 -2
- package/plugins/filters/component/_base.js +2 -2
- package/plugins/filters/component/_base.mjs +2 -2
- package/plugins/filters/component/actionBar.js +2 -2
- package/plugins/filters/component/actionBar.mjs +2 -2
- package/plugins/filters/component/condition.js +2 -2
- package/plugins/filters/component/condition.mjs +2 -2
- package/plugins/filters/component/operators.js +2 -2
- package/plugins/filters/component/operators.mjs +2 -2
- package/plugins/filters/component/value.js +2 -2
- package/plugins/filters/component/value.mjs +2 -2
- package/plugins/filters/conditionCollection.js +2 -2
- package/plugins/filters/conditionCollection.mjs +2 -2
- package/plugins/filters/conditionUpdateObserver.js +2 -2
- package/plugins/filters/conditionUpdateObserver.mjs +2 -2
- package/plugins/filters/dataFilter.js +2 -2
- package/plugins/filters/dataFilter.mjs +2 -2
- package/plugins/filters/filters.js +2 -2
- package/plugins/filters/filters.mjs +2 -2
- package/plugins/filters/ui/_base.js +2 -2
- package/plugins/filters/ui/_base.mjs +2 -2
- package/plugins/filters/ui/radioInput.js +1 -1
- package/plugins/filters/ui/radioInput.mjs +1 -1
- package/plugins/formulas/formulas.d.ts +1 -0
- package/plugins/formulas/formulas.js +2 -4
- package/plugins/formulas/formulas.mjs +2 -4
- package/plugins/formulas/indexSyncer/axisSyncer.js +0 -1
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +0 -1
- package/plugins/manualColumnMove/ui/_base.js +2 -2
- package/plugins/manualColumnMove/ui/_base.mjs +2 -2
- package/plugins/manualColumnResize/manualColumnResize.js +6 -2
- package/plugins/manualColumnResize/manualColumnResize.mjs +6 -2
- package/plugins/manualRowMove/ui/_base.js +2 -2
- package/plugins/manualRowMove/ui/_base.mjs +2 -2
- package/plugins/manualRowResize/manualRowResize.js +7 -3
- package/plugins/manualRowResize/manualRowResize.mjs +7 -3
- package/plugins/mergeCells/calculations/autofill.js +2 -2
- package/plugins/mergeCells/calculations/autofill.mjs +2 -2
- package/plugins/mergeCells/calculations/selection.js +2 -2
- package/plugins/mergeCells/calculations/selection.mjs +2 -2
- package/plugins/mergeCells/cellCoords.js +2 -2
- package/plugins/mergeCells/cellCoords.mjs +2 -2
- package/plugins/mergeCells/cellsCollection.js +2 -2
- package/plugins/mergeCells/cellsCollection.mjs +2 -2
- package/plugins/mergeCells/mergeCells.js +2 -4
- package/plugins/mergeCells/mergeCells.mjs +2 -4
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -2
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -2
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.d.ts +8 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +2 -2
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +2 -2
- package/plugins/nestedHeaders/nestedHeaders.js +2 -3
- package/plugins/nestedHeaders/nestedHeaders.mjs +2 -3
- package/plugins/nestedHeaders/stateManager/headersTree.js +0 -1
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +0 -1
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +1 -1
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +1 -1
- package/plugins/nestedHeaders/utils/ghostTable.js +2 -2
- package/plugins/nestedHeaders/utils/ghostTable.mjs +2 -2
- package/plugins/nestedRows/data/dataManager.js +2 -2
- package/plugins/nestedRows/data/dataManager.mjs +2 -2
- package/plugins/nestedRows/nestedRows.js +2 -2
- package/plugins/nestedRows/nestedRows.mjs +2 -2
- package/plugins/nestedRows/ui/_base.js +2 -2
- package/plugins/nestedRows/ui/_base.mjs +2 -2
- package/plugins/nestedRows/ui/contextMenu.js +2 -2
- package/plugins/nestedRows/ui/contextMenu.mjs +2 -2
- package/plugins/nestedRows/utils/rowMoveController.js +2 -2
- package/plugins/nestedRows/utils/rowMoveController.mjs +2 -2
- package/plugins/persistentState/persistentState.d.ts +5 -2
- package/plugins/persistentState/persistentState.js +2 -2
- package/plugins/persistentState/persistentState.mjs +2 -2
- package/plugins/persistentState/storage.js +2 -2
- package/plugins/persistentState/storage.mjs +2 -2
- package/plugins/search/search.js +2 -2
- package/plugins/search/search.mjs +2 -2
- package/plugins/touchScroll/touchScroll.js +2 -2
- package/plugins/touchScroll/touchScroll.mjs +2 -2
- package/plugins/trimRows/trimRows.js +2 -2
- package/plugins/trimRows/trimRows.mjs +2 -2
- package/plugins/undoRedo/undoRedo.d.ts +3 -0
- package/plugins/undoRedo/undoRedo.js +64 -7
- package/plugins/undoRedo/undoRedo.mjs +64 -7
- package/renderers/autocompleteRenderer/autocompleteRenderer.d.ts +1 -1
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +0 -1
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +0 -1
- package/renderers/baseRenderer/baseRenderer.d.ts +1 -1
- package/renderers/checkboxRenderer/checkboxRenderer.d.ts +1 -1
- package/renderers/checkboxRenderer/checkboxRenderer.js +0 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +0 -2
- package/renderers/dateRenderer/dateRenderer.d.ts +1 -1
- package/renderers/dropdownRenderer/dropdownRenderer.d.ts +5 -0
- package/renderers/dropdownRenderer/dropdownRenderer.js +23 -0
- package/renderers/dropdownRenderer/dropdownRenderer.mjs +19 -0
- package/renderers/dropdownRenderer/index.d.ts +1 -0
- package/renderers/dropdownRenderer/index.js +6 -0
- package/renderers/dropdownRenderer/index.mjs +1 -0
- package/renderers/handsontableRenderer/handsontableRenderer.d.ts +1 -1
- package/renderers/htmlRenderer/htmlRenderer.d.ts +1 -1
- package/renderers/index.d.ts +3 -0
- package/renderers/index.js +12 -0
- package/renderers/index.mjs +7 -1
- package/renderers/numericRenderer/numericRenderer.d.ts +1 -1
- package/renderers/passwordRenderer/passwordRenderer.d.ts +1 -1
- package/renderers/selectRenderer/selectRenderer.d.ts +1 -1
- package/renderers/textRenderer/textRenderer.d.ts +1 -1
- package/renderers/timeRenderer/timeRenderer.d.ts +1 -1
- package/selection/highlight/highlight.js +2 -3
- package/selection/highlight/highlight.mjs +2 -3
- package/selection/highlight/visualSelection.js +2 -2
- package/selection/highlight/visualSelection.mjs +2 -2
- package/selection/range.js +2 -2
- package/selection/range.mjs +2 -2
- package/selection/selection.js +2 -2
- package/selection/selection.mjs +2 -2
- package/settings.d.ts +27 -14
- package/tableView.js +4 -5
- package/tableView.mjs +4 -5
- package/translations/indexMapper.d.ts +1 -1
- package/translations/indexMapper.js +4 -3
- package/translations/indexMapper.mjs +2 -2
- package/translations/mapCollections/aggregatedCollection.js +2 -2
- package/translations/mapCollections/aggregatedCollection.mjs +2 -2
- package/translations/mapCollections/mapCollection.js +2 -2
- package/translations/mapCollections/mapCollection.mjs +2 -2
- package/translations/maps/indexMap.js +2 -2
- package/translations/maps/indexMap.mjs +2 -2
- package/translations/maps/linkedPhysicalIndexToValueMap.js +2 -2
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +2 -2
- package/utils/dataStructures/linkedList.js +2 -2
- package/utils/dataStructures/linkedList.mjs +2 -2
- package/utils/dataStructures/tree.js +2 -2
- package/utils/dataStructures/tree.mjs +2 -2
- package/utils/ghostTable.js +2 -2
- package/utils/ghostTable.mjs +2 -2
- package/utils/interval.js +2 -2
- package/utils/interval.mjs +2 -2
- package/utils/samplesGenerator.js +2 -2
- package/utils/samplesGenerator.mjs +2 -2
- package/validators/dropdownValidator/dropdownValidator.d.ts +5 -0
- package/validators/dropdownValidator/dropdownValidator.js +18 -0
- package/validators/dropdownValidator/dropdownValidator.mjs +14 -0
- package/validators/dropdownValidator/index.d.ts +1 -0
- package/validators/dropdownValidator/index.js +6 -0
- package/validators/dropdownValidator/index.mjs +1 -0
- package/validators/index.d.ts +2 -0
- package/validators/index.js +4 -0
- package/validators/index.mjs +3 -1
- package/validators/timeValidator/timeValidator.js +0 -1
- package/validators/timeValidator/timeValidator.mjs +0 -1
@@ -2,18 +2,23 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
var _exportNames = {
|
5
|
+
RenderAllColumnsCalculator: true,
|
6
|
+
RenderAllRowsCalculator: true,
|
5
7
|
ViewportColumnsCalculator: true,
|
6
8
|
ViewportRowsCalculator: true
|
7
9
|
};
|
8
|
-
var
|
9
|
-
exports.
|
10
|
-
var
|
11
|
-
exports.
|
10
|
+
var _renderAllColumns = require("./renderAllColumns");
|
11
|
+
exports.RenderAllColumnsCalculator = _renderAllColumns.RenderAllColumnsCalculator;
|
12
|
+
var _renderAllRows = require("./renderAllRows");
|
13
|
+
exports.RenderAllRowsCalculator = _renderAllRows.RenderAllRowsCalculator;
|
14
|
+
var _viewportColumns = require("./viewportColumns");
|
15
|
+
exports.ViewportColumnsCalculator = _viewportColumns.ViewportColumnsCalculator;
|
16
|
+
var _viewportRows = require("./viewportRows");
|
17
|
+
exports.ViewportRowsCalculator = _viewportRows.ViewportRowsCalculator;
|
12
18
|
var _constants = require("./constants");
|
13
19
|
Object.keys(_constants).forEach(function (key) {
|
14
20
|
if (key === "default" || key === "__esModule") return;
|
15
21
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
16
22
|
if (key in exports && exports[key] === _constants[key]) return;
|
17
23
|
exports[key] = _constants[key];
|
18
|
-
});
|
19
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
24
|
+
});
|
@@ -1,4 +1,6 @@
|
|
1
|
-
import
|
2
|
-
import
|
1
|
+
import { RenderAllColumnsCalculator } from "./renderAllColumns.mjs";
|
2
|
+
import { RenderAllRowsCalculator } from "./renderAllRows.mjs";
|
3
|
+
import { ViewportColumnsCalculator } from "./viewportColumns.mjs";
|
4
|
+
import { ViewportRowsCalculator } from "./viewportRows.mjs";
|
3
5
|
export * from "./constants.mjs";
|
4
|
-
export { ViewportColumnsCalculator, ViewportRowsCalculator };
|
6
|
+
export { RenderAllColumnsCalculator, RenderAllRowsCalculator, ViewportColumnsCalculator, ViewportRowsCalculator };
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
5
|
+
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
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
7
|
+
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); }
|
8
|
+
/**
|
9
|
+
* @typedef {object} RenderAllColumnsCalculatorOptions
|
10
|
+
* @property {number} totalColumns Total number of columns.
|
11
|
+
*/
|
12
|
+
/**
|
13
|
+
* Holds all calculations needed to perform rendering of the all columns.
|
14
|
+
*
|
15
|
+
* @class RenderAllColumnsCalculator
|
16
|
+
*/
|
17
|
+
class RenderAllColumnsCalculator {
|
18
|
+
/**
|
19
|
+
* @param {RenderAllColumnsCalculatorOptions} options Object with all options specified for column viewport calculation.
|
20
|
+
*/
|
21
|
+
constructor(options) {
|
22
|
+
/**
|
23
|
+
* Number of rendered/visible columns.
|
24
|
+
*
|
25
|
+
* @type {number}
|
26
|
+
*/
|
27
|
+
_defineProperty(this, "count", 0);
|
28
|
+
/**
|
29
|
+
* Index of the first rendered/visible column.
|
30
|
+
*
|
31
|
+
* @type {number}
|
32
|
+
*/
|
33
|
+
_defineProperty(this, "startColumn", 0);
|
34
|
+
/**
|
35
|
+
* Index of the last rendered/visible column.
|
36
|
+
*
|
37
|
+
* @type {number}
|
38
|
+
*/
|
39
|
+
_defineProperty(this, "endColumn", 0);
|
40
|
+
/**
|
41
|
+
* Position of the first rendered/visible column (in px).
|
42
|
+
*
|
43
|
+
* @type {number}
|
44
|
+
*/
|
45
|
+
_defineProperty(this, "startPosition", 0);
|
46
|
+
this.count = options.totalColumns;
|
47
|
+
this.endColumn = this.count - 1;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
exports.RenderAllColumnsCalculator = RenderAllColumnsCalculator;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import "core-js/modules/es.error.cause.js";
|
2
|
+
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; }
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
4
|
+
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); }
|
5
|
+
/**
|
6
|
+
* @typedef {object} RenderAllColumnsCalculatorOptions
|
7
|
+
* @property {number} totalColumns Total number of columns.
|
8
|
+
*/
|
9
|
+
/**
|
10
|
+
* Holds all calculations needed to perform rendering of the all columns.
|
11
|
+
*
|
12
|
+
* @class RenderAllColumnsCalculator
|
13
|
+
*/
|
14
|
+
export class RenderAllColumnsCalculator {
|
15
|
+
/**
|
16
|
+
* @param {RenderAllColumnsCalculatorOptions} options Object with all options specified for column viewport calculation.
|
17
|
+
*/
|
18
|
+
constructor(options) {
|
19
|
+
/**
|
20
|
+
* Number of rendered/visible columns.
|
21
|
+
*
|
22
|
+
* @type {number}
|
23
|
+
*/
|
24
|
+
_defineProperty(this, "count", 0);
|
25
|
+
/**
|
26
|
+
* Index of the first rendered/visible column.
|
27
|
+
*
|
28
|
+
* @type {number}
|
29
|
+
*/
|
30
|
+
_defineProperty(this, "startColumn", 0);
|
31
|
+
/**
|
32
|
+
* Index of the last rendered/visible column.
|
33
|
+
*
|
34
|
+
* @type {number}
|
35
|
+
*/
|
36
|
+
_defineProperty(this, "endColumn", 0);
|
37
|
+
/**
|
38
|
+
* Position of the first rendered/visible column (in px).
|
39
|
+
*
|
40
|
+
* @type {number}
|
41
|
+
*/
|
42
|
+
_defineProperty(this, "startPosition", 0);
|
43
|
+
this.count = options.totalColumns;
|
44
|
+
this.endColumn = this.count - 1;
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
5
|
+
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
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
7
|
+
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); }
|
8
|
+
/**
|
9
|
+
* @typedef {object} RenderAllRowsCalculatorOptions
|
10
|
+
* @property {number} totalRows Total number of rows.
|
11
|
+
*/
|
12
|
+
/**
|
13
|
+
* Holds all calculations needed to perform rendering of the all rows.
|
14
|
+
*
|
15
|
+
* @class RenderAllRowsCalculator
|
16
|
+
*/
|
17
|
+
class RenderAllRowsCalculator {
|
18
|
+
/**
|
19
|
+
* @param {RenderAllRowsCalculatorOptions} options Object with all options specified for row viewport calculation.
|
20
|
+
*/
|
21
|
+
constructor(options) {
|
22
|
+
/**
|
23
|
+
* Number of rendered/visible rows.
|
24
|
+
*
|
25
|
+
* @type {number}
|
26
|
+
*/
|
27
|
+
_defineProperty(this, "count", 0);
|
28
|
+
/**
|
29
|
+
* Index of the first rendered/visible row.
|
30
|
+
*
|
31
|
+
* @type {number}
|
32
|
+
*/
|
33
|
+
_defineProperty(this, "startRow", 0);
|
34
|
+
/**
|
35
|
+
* Index of the last rendered/visible row.
|
36
|
+
*
|
37
|
+
* @type {number}
|
38
|
+
*/
|
39
|
+
_defineProperty(this, "endRow", 0);
|
40
|
+
/**
|
41
|
+
* Position of the first rendered/visible row (in px).
|
42
|
+
*
|
43
|
+
* @type {number}
|
44
|
+
*/
|
45
|
+
_defineProperty(this, "startPosition", 0);
|
46
|
+
this.count = options.totalRows;
|
47
|
+
this.endRow = this.count - 1;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
exports.RenderAllRowsCalculator = RenderAllRowsCalculator;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import "core-js/modules/es.error.cause.js";
|
2
|
+
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; }
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
4
|
+
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); }
|
5
|
+
/**
|
6
|
+
* @typedef {object} RenderAllRowsCalculatorOptions
|
7
|
+
* @property {number} totalRows Total number of rows.
|
8
|
+
*/
|
9
|
+
/**
|
10
|
+
* Holds all calculations needed to perform rendering of the all rows.
|
11
|
+
*
|
12
|
+
* @class RenderAllRowsCalculator
|
13
|
+
*/
|
14
|
+
export class RenderAllRowsCalculator {
|
15
|
+
/**
|
16
|
+
* @param {RenderAllRowsCalculatorOptions} options Object with all options specified for row viewport calculation.
|
17
|
+
*/
|
18
|
+
constructor(options) {
|
19
|
+
/**
|
20
|
+
* Number of rendered/visible rows.
|
21
|
+
*
|
22
|
+
* @type {number}
|
23
|
+
*/
|
24
|
+
_defineProperty(this, "count", 0);
|
25
|
+
/**
|
26
|
+
* Index of the first rendered/visible row.
|
27
|
+
*
|
28
|
+
* @type {number}
|
29
|
+
*/
|
30
|
+
_defineProperty(this, "startRow", 0);
|
31
|
+
/**
|
32
|
+
* Index of the last rendered/visible row.
|
33
|
+
*
|
34
|
+
* @type {number}
|
35
|
+
*/
|
36
|
+
_defineProperty(this, "endRow", 0);
|
37
|
+
/**
|
38
|
+
* Position of the first rendered/visible row (in px).
|
39
|
+
*
|
40
|
+
* @type {number}
|
41
|
+
*/
|
42
|
+
_defineProperty(this, "startPosition", 0);
|
43
|
+
this.count = options.totalRows;
|
44
|
+
this.endRow = this.count - 1;
|
45
|
+
}
|
46
|
+
}
|
@@ -8,8 +8,8 @@ var _constants = require("./constants");
|
|
8
8
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
9
9
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
10
10
|
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; }
|
11
|
-
function _toPropertyKey(
|
12
|
-
function _toPrimitive(
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
12
|
+
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); }
|
13
13
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
14
14
|
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
15
15
|
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
@@ -34,7 +34,6 @@ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.
|
|
34
34
|
*
|
35
35
|
* @class ViewportColumnsCalculator
|
36
36
|
*/
|
37
|
-
var _totalTargetWidth = /*#__PURE__*/new WeakMap();
|
38
37
|
var _options = /*#__PURE__*/new WeakMap();
|
39
38
|
class ViewportColumnsCalculator {
|
40
39
|
/**
|
@@ -81,29 +80,6 @@ class ViewportColumnsCalculator {
|
|
81
80
|
* @type {boolean}
|
82
81
|
*/
|
83
82
|
_defineProperty(this, "isVisibleInTrimmingContainer", false);
|
84
|
-
/**
|
85
|
-
* @type {number}
|
86
|
-
*/
|
87
|
-
_defineProperty(this, "stretchAllRatio", 0);
|
88
|
-
/**
|
89
|
-
* @type {number}
|
90
|
-
*/
|
91
|
-
_defineProperty(this, "stretchLastWidth", 0);
|
92
|
-
/**
|
93
|
-
* @type {number}
|
94
|
-
*/
|
95
|
-
_classPrivateFieldInitSpec(this, _totalTargetWidth, {
|
96
|
-
writable: true,
|
97
|
-
value: 0
|
98
|
-
});
|
99
|
-
/**
|
100
|
-
* @type {boolean}
|
101
|
-
*/
|
102
|
-
_defineProperty(this, "needVerifyLastColumnWidth", true);
|
103
|
-
/**
|
104
|
-
* @type {number[]}
|
105
|
-
*/
|
106
|
-
_defineProperty(this, "stretchAllColumnsWidth", []);
|
107
83
|
/**
|
108
84
|
* The calculator options.
|
109
85
|
*
|
@@ -114,9 +90,6 @@ class ViewportColumnsCalculator {
|
|
114
90
|
value: void 0
|
115
91
|
});
|
116
92
|
_classPrivateFieldSet(this, _options, options);
|
117
|
-
if (typeof _classPrivateFieldGet(this, _options).stretchingColumnWidthFn !== 'function') {
|
118
|
-
_classPrivateFieldGet(this, _options).stretchingColumnWidthFn = width => width;
|
119
|
-
}
|
120
93
|
this.calculate();
|
121
94
|
}
|
122
95
|
|
@@ -205,100 +178,6 @@ class ViewportColumnsCalculator {
|
|
205
178
|
}
|
206
179
|
}
|
207
180
|
|
208
|
-
/**
|
209
|
-
* Recalculate columns stretching.
|
210
|
-
*
|
211
|
-
* @param {number} totalWidth The total width of the table.
|
212
|
-
*/
|
213
|
-
refreshStretching(totalWidth) {
|
214
|
-
if (_classPrivateFieldGet(this, _options).stretchMode === 'none') {
|
215
|
-
return;
|
216
|
-
}
|
217
|
-
let totalColumnsWidth = totalWidth;
|
218
|
-
_classPrivateFieldSet(this, _totalTargetWidth, totalColumnsWidth);
|
219
|
-
const totalColumns = _classPrivateFieldGet(this, _options).totalColumns;
|
220
|
-
let sumAll = 0;
|
221
|
-
for (let i = 0; i < totalColumns; i++) {
|
222
|
-
const columnWidth = this._getColumnWidth(i);
|
223
|
-
const permanentColumnWidth = _classPrivateFieldGet(this, _options).stretchingColumnWidthFn(undefined, i);
|
224
|
-
if (typeof permanentColumnWidth === 'number') {
|
225
|
-
totalColumnsWidth -= permanentColumnWidth;
|
226
|
-
} else {
|
227
|
-
sumAll += columnWidth;
|
228
|
-
}
|
229
|
-
}
|
230
|
-
const remainingSize = totalColumnsWidth - sumAll;
|
231
|
-
if (_classPrivateFieldGet(this, _options).stretchMode === 'all' && remainingSize > 0) {
|
232
|
-
this.stretchAllRatio = totalColumnsWidth / sumAll;
|
233
|
-
this.stretchAllColumnsWidth = [];
|
234
|
-
this.needVerifyLastColumnWidth = true;
|
235
|
-
} else if (_classPrivateFieldGet(this, _options).stretchMode === 'last' && totalColumnsWidth !== Infinity) {
|
236
|
-
const columnWidth = this._getColumnWidth(totalColumns - 1);
|
237
|
-
const lastColumnWidth = remainingSize + columnWidth;
|
238
|
-
this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth;
|
239
|
-
}
|
240
|
-
}
|
241
|
-
|
242
|
-
/**
|
243
|
-
* Get stretched column width based on stretchH (all or last) setting passed in handsontable instance.
|
244
|
-
*
|
245
|
-
* @param {number} column The visual column index.
|
246
|
-
* @param {number} baseWidth The default column width.
|
247
|
-
* @returns {number|null}
|
248
|
-
*/
|
249
|
-
getStretchedColumnWidth(column, baseWidth) {
|
250
|
-
let result = null;
|
251
|
-
if (_classPrivateFieldGet(this, _options).stretchMode === 'all' && this.stretchAllRatio !== 0) {
|
252
|
-
result = this._getStretchedAllColumnWidth(column, baseWidth);
|
253
|
-
} else if (_classPrivateFieldGet(this, _options).stretchMode === 'last' && this.stretchLastWidth !== 0) {
|
254
|
-
result = this._getStretchedLastColumnWidth(column);
|
255
|
-
}
|
256
|
-
return result;
|
257
|
-
}
|
258
|
-
|
259
|
-
/**
|
260
|
-
* @param {number} column The visual column index.
|
261
|
-
* @param {number} baseWidth The default column width.
|
262
|
-
* @returns {number}
|
263
|
-
* @private
|
264
|
-
*/
|
265
|
-
_getStretchedAllColumnWidth(column, baseWidth) {
|
266
|
-
let sumRatioWidth = 0;
|
267
|
-
const totalColumns = _classPrivateFieldGet(this, _options).totalColumns;
|
268
|
-
if (!this.stretchAllColumnsWidth[column]) {
|
269
|
-
const stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);
|
270
|
-
const newStretchedWidth = _classPrivateFieldGet(this, _options).stretchingColumnWidthFn(stretchedWidth, column);
|
271
|
-
if (newStretchedWidth === undefined) {
|
272
|
-
this.stretchAllColumnsWidth[column] = stretchedWidth;
|
273
|
-
} else {
|
274
|
-
this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;
|
275
|
-
}
|
276
|
-
}
|
277
|
-
if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) {
|
278
|
-
this.needVerifyLastColumnWidth = false;
|
279
|
-
for (let i = 0; i < this.stretchAllColumnsWidth.length; i++) {
|
280
|
-
sumRatioWidth += this.stretchAllColumnsWidth[i];
|
281
|
-
}
|
282
|
-
if (sumRatioWidth !== _classPrivateFieldGet(this, _totalTargetWidth)) {
|
283
|
-
this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += _classPrivateFieldGet(this, _totalTargetWidth) - sumRatioWidth;
|
284
|
-
}
|
285
|
-
}
|
286
|
-
return this.stretchAllColumnsWidth[column];
|
287
|
-
}
|
288
|
-
|
289
|
-
/**
|
290
|
-
* @param {number} column The visual column index.
|
291
|
-
* @returns {number|null}
|
292
|
-
* @private
|
293
|
-
*/
|
294
|
-
_getStretchedLastColumnWidth(column) {
|
295
|
-
const totalColumns = _classPrivateFieldGet(this, _options).totalColumns;
|
296
|
-
if (column === totalColumns - 1) {
|
297
|
-
return this.stretchLastWidth;
|
298
|
-
}
|
299
|
-
return null;
|
300
|
-
}
|
301
|
-
|
302
181
|
/**
|
303
182
|
* @param {number} column The visual column index.
|
304
183
|
* @returns {number}
|
@@ -312,4 +191,4 @@ class ViewportColumnsCalculator {
|
|
312
191
|
return width;
|
313
192
|
}
|
314
193
|
}
|
315
|
-
|
194
|
+
exports.ViewportColumnsCalculator = ViewportColumnsCalculator;
|
@@ -4,8 +4,8 @@ import "core-js/modules/es.error.cause.js";
|
|
4
4
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
5
5
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
6
6
|
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; }
|
7
|
-
function _toPropertyKey(
|
8
|
-
function _toPrimitive(
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
8
|
+
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); }
|
9
9
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
10
10
|
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
11
11
|
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
@@ -31,9 +31,8 @@ import { RENDER_TYPE, FULLY_VISIBLE_TYPE } from "./constants.mjs";
|
|
31
31
|
*
|
32
32
|
* @class ViewportColumnsCalculator
|
33
33
|
*/
|
34
|
-
var _totalTargetWidth = /*#__PURE__*/new WeakMap();
|
35
34
|
var _options = /*#__PURE__*/new WeakMap();
|
36
|
-
class ViewportColumnsCalculator {
|
35
|
+
export class ViewportColumnsCalculator {
|
37
36
|
/**
|
38
37
|
* Default column width.
|
39
38
|
*
|
@@ -78,29 +77,6 @@ class ViewportColumnsCalculator {
|
|
78
77
|
* @type {boolean}
|
79
78
|
*/
|
80
79
|
_defineProperty(this, "isVisibleInTrimmingContainer", false);
|
81
|
-
/**
|
82
|
-
* @type {number}
|
83
|
-
*/
|
84
|
-
_defineProperty(this, "stretchAllRatio", 0);
|
85
|
-
/**
|
86
|
-
* @type {number}
|
87
|
-
*/
|
88
|
-
_defineProperty(this, "stretchLastWidth", 0);
|
89
|
-
/**
|
90
|
-
* @type {number}
|
91
|
-
*/
|
92
|
-
_classPrivateFieldInitSpec(this, _totalTargetWidth, {
|
93
|
-
writable: true,
|
94
|
-
value: 0
|
95
|
-
});
|
96
|
-
/**
|
97
|
-
* @type {boolean}
|
98
|
-
*/
|
99
|
-
_defineProperty(this, "needVerifyLastColumnWidth", true);
|
100
|
-
/**
|
101
|
-
* @type {number[]}
|
102
|
-
*/
|
103
|
-
_defineProperty(this, "stretchAllColumnsWidth", []);
|
104
80
|
/**
|
105
81
|
* The calculator options.
|
106
82
|
*
|
@@ -111,9 +87,6 @@ class ViewportColumnsCalculator {
|
|
111
87
|
value: void 0
|
112
88
|
});
|
113
89
|
_classPrivateFieldSet(this, _options, options);
|
114
|
-
if (typeof _classPrivateFieldGet(this, _options).stretchingColumnWidthFn !== 'function') {
|
115
|
-
_classPrivateFieldGet(this, _options).stretchingColumnWidthFn = width => width;
|
116
|
-
}
|
117
90
|
this.calculate();
|
118
91
|
}
|
119
92
|
|
@@ -202,100 +175,6 @@ class ViewportColumnsCalculator {
|
|
202
175
|
}
|
203
176
|
}
|
204
177
|
|
205
|
-
/**
|
206
|
-
* Recalculate columns stretching.
|
207
|
-
*
|
208
|
-
* @param {number} totalWidth The total width of the table.
|
209
|
-
*/
|
210
|
-
refreshStretching(totalWidth) {
|
211
|
-
if (_classPrivateFieldGet(this, _options).stretchMode === 'none') {
|
212
|
-
return;
|
213
|
-
}
|
214
|
-
let totalColumnsWidth = totalWidth;
|
215
|
-
_classPrivateFieldSet(this, _totalTargetWidth, totalColumnsWidth);
|
216
|
-
const totalColumns = _classPrivateFieldGet(this, _options).totalColumns;
|
217
|
-
let sumAll = 0;
|
218
|
-
for (let i = 0; i < totalColumns; i++) {
|
219
|
-
const columnWidth = this._getColumnWidth(i);
|
220
|
-
const permanentColumnWidth = _classPrivateFieldGet(this, _options).stretchingColumnWidthFn(undefined, i);
|
221
|
-
if (typeof permanentColumnWidth === 'number') {
|
222
|
-
totalColumnsWidth -= permanentColumnWidth;
|
223
|
-
} else {
|
224
|
-
sumAll += columnWidth;
|
225
|
-
}
|
226
|
-
}
|
227
|
-
const remainingSize = totalColumnsWidth - sumAll;
|
228
|
-
if (_classPrivateFieldGet(this, _options).stretchMode === 'all' && remainingSize > 0) {
|
229
|
-
this.stretchAllRatio = totalColumnsWidth / sumAll;
|
230
|
-
this.stretchAllColumnsWidth = [];
|
231
|
-
this.needVerifyLastColumnWidth = true;
|
232
|
-
} else if (_classPrivateFieldGet(this, _options).stretchMode === 'last' && totalColumnsWidth !== Infinity) {
|
233
|
-
const columnWidth = this._getColumnWidth(totalColumns - 1);
|
234
|
-
const lastColumnWidth = remainingSize + columnWidth;
|
235
|
-
this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth;
|
236
|
-
}
|
237
|
-
}
|
238
|
-
|
239
|
-
/**
|
240
|
-
* Get stretched column width based on stretchH (all or last) setting passed in handsontable instance.
|
241
|
-
*
|
242
|
-
* @param {number} column The visual column index.
|
243
|
-
* @param {number} baseWidth The default column width.
|
244
|
-
* @returns {number|null}
|
245
|
-
*/
|
246
|
-
getStretchedColumnWidth(column, baseWidth) {
|
247
|
-
let result = null;
|
248
|
-
if (_classPrivateFieldGet(this, _options).stretchMode === 'all' && this.stretchAllRatio !== 0) {
|
249
|
-
result = this._getStretchedAllColumnWidth(column, baseWidth);
|
250
|
-
} else if (_classPrivateFieldGet(this, _options).stretchMode === 'last' && this.stretchLastWidth !== 0) {
|
251
|
-
result = this._getStretchedLastColumnWidth(column);
|
252
|
-
}
|
253
|
-
return result;
|
254
|
-
}
|
255
|
-
|
256
|
-
/**
|
257
|
-
* @param {number} column The visual column index.
|
258
|
-
* @param {number} baseWidth The default column width.
|
259
|
-
* @returns {number}
|
260
|
-
* @private
|
261
|
-
*/
|
262
|
-
_getStretchedAllColumnWidth(column, baseWidth) {
|
263
|
-
let sumRatioWidth = 0;
|
264
|
-
const totalColumns = _classPrivateFieldGet(this, _options).totalColumns;
|
265
|
-
if (!this.stretchAllColumnsWidth[column]) {
|
266
|
-
const stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);
|
267
|
-
const newStretchedWidth = _classPrivateFieldGet(this, _options).stretchingColumnWidthFn(stretchedWidth, column);
|
268
|
-
if (newStretchedWidth === undefined) {
|
269
|
-
this.stretchAllColumnsWidth[column] = stretchedWidth;
|
270
|
-
} else {
|
271
|
-
this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;
|
272
|
-
}
|
273
|
-
}
|
274
|
-
if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) {
|
275
|
-
this.needVerifyLastColumnWidth = false;
|
276
|
-
for (let i = 0; i < this.stretchAllColumnsWidth.length; i++) {
|
277
|
-
sumRatioWidth += this.stretchAllColumnsWidth[i];
|
278
|
-
}
|
279
|
-
if (sumRatioWidth !== _classPrivateFieldGet(this, _totalTargetWidth)) {
|
280
|
-
this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += _classPrivateFieldGet(this, _totalTargetWidth) - sumRatioWidth;
|
281
|
-
}
|
282
|
-
}
|
283
|
-
return this.stretchAllColumnsWidth[column];
|
284
|
-
}
|
285
|
-
|
286
|
-
/**
|
287
|
-
* @param {number} column The visual column index.
|
288
|
-
* @returns {number|null}
|
289
|
-
* @private
|
290
|
-
*/
|
291
|
-
_getStretchedLastColumnWidth(column) {
|
292
|
-
const totalColumns = _classPrivateFieldGet(this, _options).totalColumns;
|
293
|
-
if (column === totalColumns - 1) {
|
294
|
-
return this.stretchLastWidth;
|
295
|
-
}
|
296
|
-
return null;
|
297
|
-
}
|
298
|
-
|
299
178
|
/**
|
300
179
|
* @param {number} column The visual column index.
|
301
180
|
* @returns {number}
|
@@ -308,5 +187,4 @@ class ViewportColumnsCalculator {
|
|
308
187
|
}
|
309
188
|
return width;
|
310
189
|
}
|
311
|
-
}
|
312
|
-
export default ViewportColumnsCalculator;
|
190
|
+
}
|
@@ -8,8 +8,8 @@ var _constants = require("./constants");
|
|
8
8
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
9
9
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
10
10
|
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; }
|
11
|
-
function _toPropertyKey(
|
12
|
-
function _toPrimitive(
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
12
|
+
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); }
|
13
13
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
14
14
|
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
15
15
|
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
@@ -181,4 +181,4 @@ class ViewportRowsCalculator {
|
|
181
181
|
}
|
182
182
|
}
|
183
183
|
}
|
184
|
-
|
184
|
+
exports.ViewportRowsCalculator = ViewportRowsCalculator;
|
@@ -4,8 +4,8 @@ import "core-js/modules/es.error.cause.js";
|
|
4
4
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
5
5
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
6
6
|
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; }
|
7
|
-
function _toPropertyKey(
|
8
|
-
function _toPrimitive(
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
8
|
+
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); }
|
9
9
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
10
10
|
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
11
11
|
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
@@ -29,7 +29,7 @@ import { RENDER_TYPE, FULLY_VISIBLE_TYPE } from "./constants.mjs";
|
|
29
29
|
* @class ViewportRowsCalculator
|
30
30
|
*/
|
31
31
|
var _options = /*#__PURE__*/new WeakMap();
|
32
|
-
class ViewportRowsCalculator {
|
32
|
+
export class ViewportRowsCalculator {
|
33
33
|
/**
|
34
34
|
* Default row height.
|
35
35
|
*
|
@@ -177,5 +177,4 @@ class ViewportRowsCalculator {
|
|
177
177
|
this.count = this.endRow - this.startRow + 1;
|
178
178
|
}
|
179
179
|
}
|
180
|
-
}
|
181
|
-
export default ViewportRowsCalculator;
|
180
|
+
}
|
@@ -12,12 +12,12 @@ export default class CellCoords {
|
|
12
12
|
}): boolean;
|
13
13
|
isRtl(): boolean;
|
14
14
|
isEqual(cellCoords: CellCoords): boolean;
|
15
|
-
isSouthEastOf(testedCoords:
|
16
|
-
isNorthWestOf(testedCoords:
|
17
|
-
isSouthWestOf(testedCoords:
|
18
|
-
isNorthEastOf(testedCoords:
|
15
|
+
isSouthEastOf(testedCoords: CellCoords): boolean;
|
16
|
+
isNorthWestOf(testedCoords: CellCoords): boolean;
|
17
|
+
isSouthWestOf(testedCoords: CellCoords): boolean;
|
18
|
+
isNorthEastOf(testedCoords: CellCoords): boolean;
|
19
19
|
normalize(): CellCoords;
|
20
20
|
assign(coords: CellCoords | { row?: number, col?: number }): CellCoords;
|
21
21
|
clone(): CellCoords;
|
22
|
-
toObject():
|
22
|
+
toObject(): { row: number, col: number };
|
23
23
|
}
|
@@ -5,8 +5,8 @@ require("core-js/modules/es.error.cause.js");
|
|
5
5
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
6
6
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
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
|
-
function _toPropertyKey(
|
9
|
-
function _toPrimitive(
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
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
10
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
11
11
|
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
12
12
|
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|