handsontable 0.0.0-next-b66c79f-20230713 → 0.0.0-next-08765b9-20230714
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/cell/coords.d.ts +6 -1
- package/3rdparty/walkontable/src/cell/coords.js +87 -33
- package/3rdparty/walkontable/src/cell/coords.mjs +87 -33
- package/3rdparty/walkontable/src/cell/range.d.ts +9 -2
- package/3rdparty/walkontable/src/cell/range.js +92 -46
- package/3rdparty/walkontable/src/cell/range.mjs +92 -46
- package/3rdparty/walkontable/src/core/_base.js +41 -33
- package/3rdparty/walkontable/src/core/_base.mjs +41 -33
- package/3rdparty/walkontable/src/core/clone.js +8 -5
- package/3rdparty/walkontable/src/core/clone.mjs +8 -5
- package/3rdparty/walkontable/src/core/core.js +3 -2
- package/3rdparty/walkontable/src/core/core.mjs +3 -2
- package/3rdparty/walkontable/src/event.js +9 -8
- package/3rdparty/walkontable/src/event.mjs +9 -8
- package/3rdparty/walkontable/src/facade/core.js +2 -2
- package/3rdparty/walkontable/src/facade/core.mjs +2 -2
- package/3rdparty/walkontable/src/index.js +10 -2
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/_base.js +11 -9
- package/3rdparty/walkontable/src/overlay/_base.mjs +11 -9
- package/3rdparty/walkontable/src/overlay/bottom.js +10 -8
- package/3rdparty/walkontable/src/overlay/bottom.mjs +10 -8
- package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -6
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -6
- package/3rdparty/walkontable/src/overlay/top.js +12 -14
- package/3rdparty/walkontable/src/overlay/top.mjs +12 -14
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +16 -13
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +16 -13
- package/3rdparty/walkontable/src/overlays.js +75 -80
- package/3rdparty/walkontable/src/overlays.mjs +75 -80
- package/3rdparty/walkontable/src/scroll.js +27 -24
- package/3rdparty/walkontable/src/scroll.mjs +27 -24
- package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
- package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
- package/3rdparty/walkontable/src/selection/border/constants.js +16 -0
- package/3rdparty/walkontable/src/selection/border/constants.mjs +12 -0
- package/3rdparty/walkontable/src/selection/constants.js +62 -0
- package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
- package/3rdparty/walkontable/src/selection/index.js +26 -0
- package/3rdparty/walkontable/src/selection/index.mjs +5 -0
- package/3rdparty/walkontable/src/selection/manager.js +259 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +254 -0
- package/3rdparty/walkontable/src/selection/scanner.js +270 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +267 -0
- package/3rdparty/walkontable/src/selection/selection.js +101 -0
- package/3rdparty/walkontable/src/selection/selection.mjs +96 -0
- package/3rdparty/walkontable/src/settings.js +18 -17
- package/3rdparty/walkontable/src/settings.mjs +18 -17
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
- package/3rdparty/walkontable/src/table.js +48 -115
- package/3rdparty/walkontable/src/table.mjs +49 -116
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/focusDetector.js +58 -0
- package/core/focusCatcher/focusDetector.mjs +54 -0
- package/core/focusCatcher/index.js +142 -0
- package/core/focusCatcher/index.mjs +138 -0
- package/core/index.js +9 -0
- package/core/index.mjs +1 -0
- package/core.d.ts +6 -3
- package/core.js +181 -298
- package/core.mjs +181 -298
- package/dataMap/metaManager/metaLayers/cellMeta.js +2 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +2 -1
- package/dataMap/metaManager/metaLayers/globalMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +1 -1
- package/dataMap/metaManager/metaSchema.js +41 -0
- package/dataMap/metaManager/metaSchema.mjs +41 -0
- package/dataMap/metaManager/mods/dynamicCellMeta.js +3 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +3 -2
- package/dataMap/metaManager/utils.js +4 -2
- package/dataMap/metaManager/utils.mjs +4 -2
- package/dist/handsontable.css +19 -3
- package/dist/handsontable.full.css +19 -3
- package/dist/handsontable.full.js +10739 -7037
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +25 -25
- package/dist/handsontable.js +24884 -21182
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +19 -19
- package/editorManager.js +11 -75
- package/editorManager.mjs +11 -74
- package/editors/autocompleteEditor/autocompleteEditor.js +70 -67
- package/editors/autocompleteEditor/autocompleteEditor.mjs +70 -67
- package/editors/baseEditor/baseEditor.js +1 -1
- package/editors/baseEditor/baseEditor.mjs +1 -1
- package/editors/dateEditor/dateEditor.js +2 -1
- package/editors/dateEditor/dateEditor.mjs +2 -1
- package/editors/textEditor/textEditor.js +3 -11
- package/editors/textEditor/textEditor.mjs +4 -12
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/number.d.ts +1 -0
- package/helpers/number.js +18 -0
- package/helpers/number.mjs +17 -0
- package/helpers/object.js +1 -0
- package/helpers/object.mjs +1 -0
- package/index.js +5 -5
- package/index.mjs +5 -5
- package/package.json +1 -1
- package/pluginHooks.d.ts +7 -1
- package/pluginHooks.js +106 -1
- package/pluginHooks.mjs +106 -1
- package/plugins/autoColumnSize/autoColumnSize.js +4 -1
- package/plugins/autoColumnSize/autoColumnSize.mjs +4 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +110 -40
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +110 -40
- package/plugins/columnSorting/columnSorting.js +40 -1
- package/plugins/columnSorting/columnSorting.mjs +40 -3
- package/plugins/columnSorting/columnStatesManager.js +2 -1
- package/plugins/columnSorting/columnStatesManager.mjs +2 -1
- package/plugins/columnSorting/index.js +3 -1
- package/plugins/columnSorting/index.mjs +1 -1
- package/plugins/comments/commentEditor.js +1 -0
- package/plugins/comments/commentEditor.mjs +1 -0
- package/plugins/comments/comments.js +253 -191
- package/plugins/comments/comments.mjs +252 -192
- package/plugins/comments/contextMenuItem/addEditComment.js +41 -0
- package/plugins/comments/contextMenuItem/addEditComment.mjs +35 -0
- package/plugins/comments/contextMenuItem/readOnlyComment.js +49 -0
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +43 -0
- package/plugins/comments/contextMenuItem/removeComment.js +38 -0
- package/plugins/comments/contextMenuItem/removeComment.mjs +32 -0
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/contextMenu/contextMenu.js +72 -30
- package/plugins/contextMenu/contextMenu.mjs +73 -31
- package/plugins/contextMenu/predefinedItems/alignment.js +7 -0
- package/plugins/contextMenu/predefinedItems/alignment.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/clearColumn.js +5 -3
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +7 -0
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/removeColumn.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/removeRow.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +5 -3
- package/plugins/contextMenu/utils.js +28 -16
- package/plugins/contextMenu/utils.mjs +27 -15
- package/plugins/copyPaste/contextMenuItem/copy.js +7 -0
- package/plugins/copyPaste/contextMenuItem/copy.mjs +7 -0
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/cut.js +7 -0
- package/plugins/copyPaste/contextMenuItem/cut.mjs +7 -0
- package/plugins/copyPaste/copyPaste.js +12 -6
- package/plugins/copyPaste/copyPaste.mjs +12 -6
- package/plugins/customBorders/customBorders.js +36 -29
- package/plugins/customBorders/customBorders.mjs +37 -30
- package/plugins/customBorders/utils.js +3 -3
- package/plugins/customBorders/utils.mjs +3 -3
- package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
- package/plugins/dropdownMenu/dropdownMenu.js +89 -32
- package/plugins/dropdownMenu/dropdownMenu.mjs +89 -32
- package/plugins/filters/conditionCollection.js +6 -5
- package/plugins/filters/conditionCollection.mjs +6 -5
- package/plugins/filters/filters.js +44 -21
- package/plugins/filters/filters.mjs +43 -20
- package/plugins/formulas/engine/register.js +3 -3
- package/plugins/formulas/engine/register.mjs +3 -3
- package/plugins/formulas/engine/settings.js +6 -3
- package/plugins/formulas/engine/settings.mjs +6 -3
- package/plugins/formulas/formulas.js +151 -143
- package/plugins/formulas/formulas.mjs +151 -143
- package/plugins/formulas/indexSyncer/axisSyncer.js +115 -79
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +115 -79
- package/plugins/formulas/indexSyncer/index.js +100 -64
- package/plugins/formulas/indexSyncer/index.mjs +100 -64
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +2 -2
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +2 -2
- package/plugins/hiddenColumns/hiddenColumns.js +51 -34
- package/plugins/hiddenColumns/hiddenColumns.mjs +51 -34
- package/plugins/hiddenRows/contextMenuItem/showRow.js +2 -2
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +2 -2
- package/plugins/hiddenRows/hiddenRows.js +50 -33
- package/plugins/hiddenRows/hiddenRows.mjs +50 -33
- package/plugins/manualRowResize/manualRowResize.js +2 -1
- package/plugins/manualRowResize/manualRowResize.mjs +2 -1
- package/plugins/mergeCells/mergeCells.js +6 -17
- package/plugins/mergeCells/mergeCells.mjs +6 -17
- package/plugins/multiColumnSorting/multiColumnSorting.js +37 -2
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +37 -2
- package/plugins/nestedHeaders/nestedHeaders.js +209 -75
- package/plugins/nestedHeaders/nestedHeaders.mjs +208 -74
- package/plugins/nestedHeaders/stateManager/headersTree.js +58 -38
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +58 -38
- package/plugins/nestedHeaders/stateManager/index.js +107 -49
- package/plugins/nestedHeaders/stateManager/index.mjs +105 -47
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.js +1 -1
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +1 -1
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +57 -37
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +57 -37
- package/plugins/nestedHeaders/utils/ghostTable.js +39 -35
- package/plugins/nestedHeaders/utils/ghostTable.mjs +39 -35
- package/plugins/nestedRows/data/dataManager.js +4 -2
- package/plugins/nestedRows/data/dataManager.mjs +4 -2
- package/plugins/nestedRows/nestedRows.js +41 -0
- package/plugins/nestedRows/nestedRows.mjs +41 -0
- package/plugins/persistentState/storage.js +1 -0
- package/plugins/persistentState/storage.mjs +1 -0
- package/plugins/undoRedo/undoRedo.js +2 -1
- package/plugins/undoRedo/undoRedo.mjs +2 -1
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/highlight.js +256 -71
- package/selection/highlight/highlight.mjs +250 -71
- package/selection/highlight/types/activeHeader.js +10 -8
- package/selection/highlight/types/activeHeader.mjs +10 -8
- package/selection/highlight/types/area.js +6 -18
- package/selection/highlight/types/area.mjs +6 -18
- package/selection/highlight/types/areaLayered.js +31 -0
- package/selection/highlight/types/areaLayered.mjs +26 -0
- package/selection/highlight/types/column.js +27 -0
- package/selection/highlight/types/column.mjs +22 -0
- package/selection/highlight/types/customSelection.js +7 -9
- package/selection/highlight/types/customSelection.mjs +7 -9
- package/selection/highlight/types/fill.js +5 -7
- package/selection/highlight/types/fill.mjs +5 -7
- package/selection/highlight/types/{cell.js → focus.js} +5 -7
- package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
- package/selection/highlight/types/header.js +9 -18
- package/selection/highlight/types/header.mjs +9 -18
- package/selection/highlight/types/row.js +27 -0
- package/selection/highlight/types/row.mjs +22 -0
- package/selection/highlight/visualSelection.js +41 -33
- package/selection/highlight/visualSelection.mjs +41 -33
- package/selection/index.js +4 -7
- package/selection/index.mjs +2 -3
- package/selection/mouseEventHandler.js +1 -1
- package/selection/mouseEventHandler.mjs +1 -1
- package/selection/range.js +8 -8
- package/selection/range.mjs +8 -8
- package/selection/selection.js +290 -154
- package/selection/selection.mjs +287 -153
- package/selection/transformation.js +232 -90
- package/selection/transformation.mjs +232 -90
- package/selection/utils.js +15 -21
- package/selection/utils.mjs +16 -21
- package/settings.d.ts +2 -0
- package/shortcutContexts/commands/editor/closeAndSave.js +12 -0
- package/shortcutContexts/commands/editor/closeAndSave.mjs +8 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +12 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +8 -0
- package/shortcutContexts/commands/editor/fastOpen.js +16 -0
- package/shortcutContexts/commands/editor/fastOpen.mjs +12 -0
- package/shortcutContexts/commands/editor/index.js +16 -0
- package/shortcutContexts/commands/editor/index.mjs +12 -0
- package/shortcutContexts/commands/editor/open.js +27 -0
- package/shortcutContexts/commands/editor/open.mjs +23 -0
- package/shortcutContexts/commands/emptySelectedCells.js +11 -0
- package/shortcutContexts/commands/emptySelectedCells.mjs +7 -0
- package/shortcutContexts/commands/extendCellsSelection/down.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +17 -0
- package/shortcutContexts/commands/extendCellsSelection/index.js +26 -0
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +22 -0
- package/shortcutContexts/commands/extendCellsSelection/left.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/right.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/up.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +17 -0
- package/shortcutContexts/commands/index.js +35 -0
- package/shortcutContexts/commands/index.mjs +31 -0
- package/shortcutContexts/commands/moveCellSelection/down.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/down.mjs +9 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +31 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +27 -0
- package/shortcutContexts/commands/moveCellSelection/index.js +28 -0
- package/shortcutContexts/commands/moveCellSelection/index.mjs +24 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/left.js +10 -0
- package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/right.js +10 -0
- package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +18 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +14 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +14 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +10 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +19 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +15 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +21 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +19 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +15 -0
- package/shortcutContexts/commands/moveCellSelection/up.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/up.mjs +9 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +31 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +27 -0
- package/shortcutContexts/commands/populateSelectedCellsData.js +29 -0
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +25 -0
- package/shortcutContexts/commands/scrollToFocusedCell.js +36 -0
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +32 -0
- package/shortcutContexts/commands/selectAll.js +10 -0
- package/shortcutContexts/commands/selectAll.mjs +6 -0
- package/shortcutContexts/constants.js +13 -0
- package/shortcutContexts/constants.mjs +8 -0
- package/shortcutContexts/editor.js +25 -0
- package/shortcutContexts/editor.mjs +21 -0
- package/shortcutContexts/grid.js +163 -0
- package/shortcutContexts/grid.mjs +159 -0
- package/shortcutContexts/index.js +24 -0
- package/shortcutContexts/index.mjs +11 -0
- package/shortcuts/manager.js +2 -0
- package/shortcuts/manager.mjs +2 -0
- package/shortcuts/recorder.js +2 -2
- package/shortcuts/recorder.mjs +2 -2
- package/shortcuts/utils.js +19 -5
- package/shortcuts/utils.mjs +18 -4
- package/tableView.js +163 -91
- package/tableView.mjs +163 -91
- package/translations/changesObservable/observable.js +82 -54
- package/translations/changesObservable/observable.mjs +82 -54
- package/translations/changesObservable/observer.js +24 -11
- package/translations/changesObservable/observer.mjs +24 -11
- package/translations/maps/linkedPhysicalIndexToValueMap.js +14 -8
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +14 -8
- package/utils/dataStructures/tree.js +21 -18
- package/utils/dataStructures/tree.mjs +21 -18
- package/3rdparty/walkontable/src/selection.js +0 -295
- package/3rdparty/walkontable/src/selection.mjs +0 -290
- package/selection/highlight/constants.js +0 -15
- package/selection/highlight/constants.mjs +0 -6
- package/selection/highlight/types/index.js +0 -35
- package/selection/highlight/types/index.mjs +0 -31
@@ -1,4 +1,12 @@
|
|
1
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
3
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
4
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
5
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
6
|
+
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; } }
|
7
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
8
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
9
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
2
10
|
import { arrayMap, arrayReduce } from "../../../helpers/array.mjs";
|
3
11
|
import SourceSettings from "./sourceSettings.mjs";
|
4
12
|
import HeadersTree from "./headersTree.mjs";
|
@@ -32,29 +40,42 @@ import { generateMatrix } from "./matrixGenerator.mjs";
|
|
32
40
|
*
|
33
41
|
* @class StateManager
|
34
42
|
*/
|
43
|
+
var _sourceSettings = /*#__PURE__*/new WeakMap();
|
44
|
+
var _headersTree = /*#__PURE__*/new WeakMap();
|
45
|
+
var _stateMatrix = /*#__PURE__*/new WeakMap();
|
35
46
|
export default class StateManager {
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
47
|
+
constructor() {
|
48
|
+
/**
|
49
|
+
* The instance of the source settings class.
|
50
|
+
*
|
51
|
+
* @private
|
52
|
+
* @type {SourceSettings}
|
53
|
+
*/
|
54
|
+
_classPrivateFieldInitSpec(this, _sourceSettings, {
|
55
|
+
writable: true,
|
56
|
+
value: new SourceSettings()
|
57
|
+
});
|
58
|
+
/**
|
59
|
+
* The instance of the headers tree. The tree is generated after setting new configuration data.
|
60
|
+
*
|
61
|
+
* @private
|
62
|
+
* @type {HeadersTree}
|
63
|
+
*/
|
64
|
+
_classPrivateFieldInitSpec(this, _headersTree, {
|
65
|
+
writable: true,
|
66
|
+
value: new HeadersTree(_classPrivateFieldGet(this, _sourceSettings))
|
67
|
+
});
|
68
|
+
/**
|
69
|
+
* Cached matrix which is generated from the tree structure.
|
70
|
+
*
|
71
|
+
* @private
|
72
|
+
* @type {Array[]}
|
73
|
+
*/
|
74
|
+
_classPrivateFieldInitSpec(this, _stateMatrix, {
|
75
|
+
writable: true,
|
76
|
+
value: [[]]
|
77
|
+
});
|
78
|
+
}
|
58
79
|
/**
|
59
80
|
* Sets a new state for the nested headers plugin based on settings passed
|
60
81
|
* directly to the plugin.
|
@@ -63,16 +84,16 @@ export default class StateManager {
|
|
63
84
|
* @returns {boolean} Returns `true` if the settings are processed correctly, `false` otherwise.
|
64
85
|
*/
|
65
86
|
setState(nestedHeadersSettings) {
|
66
|
-
this
|
87
|
+
_classPrivateFieldGet(this, _sourceSettings).setData(nestedHeadersSettings);
|
67
88
|
let hasError = false;
|
68
89
|
try {
|
69
|
-
this
|
90
|
+
_classPrivateFieldGet(this, _headersTree).buildTree();
|
70
91
|
} catch (ex) {
|
71
|
-
this
|
72
|
-
this
|
92
|
+
_classPrivateFieldGet(this, _headersTree).clear();
|
93
|
+
_classPrivateFieldGet(this, _sourceSettings).clear();
|
73
94
|
hasError = true;
|
74
95
|
}
|
75
|
-
this
|
96
|
+
_classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
|
76
97
|
return hasError;
|
77
98
|
}
|
78
99
|
|
@@ -83,7 +104,7 @@ export default class StateManager {
|
|
83
104
|
* @param {number} columnsCount The number of columns to limit to.
|
84
105
|
*/
|
85
106
|
setColumnsLimit(columnsCount) {
|
86
|
-
this
|
107
|
+
_classPrivateFieldGet(this, _sourceSettings).setColumnsLimit(columnsCount);
|
87
108
|
}
|
88
109
|
|
89
110
|
/**
|
@@ -107,9 +128,9 @@ export default class StateManager {
|
|
107
128
|
...rest
|
108
129
|
};
|
109
130
|
});
|
110
|
-
this
|
111
|
-
this
|
112
|
-
this
|
131
|
+
_classPrivateFieldGet(this, _sourceSettings).mergeWith(transformedSettings);
|
132
|
+
_classPrivateFieldGet(this, _headersTree).buildTree();
|
133
|
+
_classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
|
113
134
|
}
|
114
135
|
|
115
136
|
/**
|
@@ -124,9 +145,9 @@ export default class StateManager {
|
|
124
145
|
* header settings.
|
125
146
|
*/
|
126
147
|
mapState(callback) {
|
127
|
-
this
|
128
|
-
this
|
129
|
-
this
|
148
|
+
_classPrivateFieldGet(this, _sourceSettings).map(callback);
|
149
|
+
_classPrivateFieldGet(this, _headersTree).buildTree();
|
150
|
+
_classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
|
130
151
|
}
|
131
152
|
|
132
153
|
/**
|
@@ -139,7 +160,7 @@ export default class StateManager {
|
|
139
160
|
* @returns {Array}
|
140
161
|
*/
|
141
162
|
mapNodes(callback) {
|
142
|
-
return arrayReduce(this
|
163
|
+
return arrayReduce(_classPrivateFieldGet(this, _headersTree).getRoots(), (acc, rootNode) => {
|
143
164
|
rootNode.walkDown(node => {
|
144
165
|
const result = callback(node.data);
|
145
166
|
if (result !== void 0) {
|
@@ -164,13 +185,13 @@ export default class StateManager {
|
|
164
185
|
if (headerLevel < 0) {
|
165
186
|
headerLevel = this.rowCoordsToLevel(headerLevel);
|
166
187
|
}
|
167
|
-
const nodeToProcess = this
|
188
|
+
const nodeToProcess = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex);
|
168
189
|
let actionResult;
|
169
190
|
if (nodeToProcess) {
|
170
191
|
actionResult = triggerNodeModification(action, nodeToProcess, columnIndex);
|
171
192
|
|
172
193
|
// TODO (perf-tip): Trigger matrix generation once after multiple node modifications.
|
173
|
-
this
|
194
|
+
_classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
|
174
195
|
}
|
175
196
|
return actionResult;
|
176
197
|
}
|
@@ -272,14 +293,14 @@ export default class StateManager {
|
|
272
293
|
* @returns {object|null}
|
273
294
|
*/
|
274
295
|
getHeaderSettings(headerLevel, columnIndex) {
|
275
|
-
var
|
296
|
+
var _classPrivateFieldGet2, _classPrivateFieldGet3;
|
276
297
|
if (headerLevel < 0) {
|
277
298
|
headerLevel = this.rowCoordsToLevel(headerLevel);
|
278
299
|
}
|
279
300
|
if (headerLevel === null || headerLevel >= this.getLayersCount()) {
|
280
301
|
return null;
|
281
302
|
}
|
282
|
-
return (
|
303
|
+
return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateMatrix)[headerLevel]) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3[columnIndex]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : null;
|
283
304
|
}
|
284
305
|
|
285
306
|
/**
|
@@ -298,7 +319,7 @@ export default class StateManager {
|
|
298
319
|
if (headerLevel === null || headerLevel >= this.getLayersCount()) {
|
299
320
|
return null;
|
300
321
|
}
|
301
|
-
const node = this
|
322
|
+
const node = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex);
|
302
323
|
if (!node) {
|
303
324
|
return null;
|
304
325
|
}
|
@@ -320,7 +341,7 @@ export default class StateManager {
|
|
320
341
|
var _this$getHeaderSettin;
|
321
342
|
const {
|
322
343
|
isRoot
|
323
|
-
} = (_this$getHeaderSettin = this.getHeaderSettings(headerLevel, columnIndex))
|
344
|
+
} = (_this$getHeaderSettin = this.getHeaderSettings(headerLevel, columnIndex)) !== null && _this$getHeaderSettin !== void 0 ? _this$getHeaderSettin : {
|
324
345
|
isRoot: true
|
325
346
|
};
|
326
347
|
if (isRoot) {
|
@@ -331,7 +352,7 @@ export default class StateManager {
|
|
331
352
|
var _this$getHeaderSettin2;
|
332
353
|
const {
|
333
354
|
isRoot: isRootNode
|
334
|
-
} = (_this$getHeaderSettin2 = this.getHeaderSettings(headerLevel, stepBackColumn))
|
355
|
+
} = (_this$getHeaderSettin2 = this.getHeaderSettings(headerLevel, stepBackColumn)) !== null && _this$getHeaderSettin2 !== void 0 ? _this$getHeaderSettin2 : {
|
335
356
|
isRoot: true
|
336
357
|
};
|
337
358
|
if (isRootNode) {
|
@@ -342,13 +363,50 @@ export default class StateManager {
|
|
342
363
|
return stepBackColumn;
|
343
364
|
}
|
344
365
|
|
366
|
+
/**
|
367
|
+
* The method is helpful in cases where the column index targets in-between currently
|
368
|
+
* collapsed column. In that case, the method returns the right-most column index
|
369
|
+
* where the nested header ends.
|
370
|
+
*
|
371
|
+
* @param {number} headerLevel Header level (there is support for negative and positive values).
|
372
|
+
* @param {number} columnIndex A visual column index.
|
373
|
+
* @returns {number}
|
374
|
+
*/
|
375
|
+
findRightMostColumnIndex(headerLevel, columnIndex) {
|
376
|
+
var _this$getHeaderSettin3;
|
377
|
+
const {
|
378
|
+
isRoot,
|
379
|
+
origColspan
|
380
|
+
} = (_this$getHeaderSettin3 = this.getHeaderSettings(headerLevel, columnIndex)) !== null && _this$getHeaderSettin3 !== void 0 ? _this$getHeaderSettin3 : {
|
381
|
+
isRoot: true,
|
382
|
+
origColspan: 1
|
383
|
+
};
|
384
|
+
if (isRoot) {
|
385
|
+
return columnIndex + origColspan - 1;
|
386
|
+
}
|
387
|
+
let stepForthColumn = columnIndex + 1;
|
388
|
+
while (stepForthColumn < this.getColumnsCount()) {
|
389
|
+
var _this$getHeaderSettin4;
|
390
|
+
const {
|
391
|
+
isRoot: isRootNode
|
392
|
+
} = (_this$getHeaderSettin4 = this.getHeaderSettings(headerLevel, stepForthColumn)) !== null && _this$getHeaderSettin4 !== void 0 ? _this$getHeaderSettin4 : {
|
393
|
+
isRoot: true
|
394
|
+
};
|
395
|
+
if (isRootNode) {
|
396
|
+
break;
|
397
|
+
}
|
398
|
+
stepForthColumn += 1;
|
399
|
+
}
|
400
|
+
return stepForthColumn - 1;
|
401
|
+
}
|
402
|
+
|
345
403
|
/**
|
346
404
|
* Gets a total number of headers levels.
|
347
405
|
*
|
348
406
|
* @returns {number}
|
349
407
|
*/
|
350
408
|
getLayersCount() {
|
351
|
-
return this
|
409
|
+
return _classPrivateFieldGet(this, _sourceSettings).getLayersCount();
|
352
410
|
}
|
353
411
|
|
354
412
|
/**
|
@@ -357,15 +415,15 @@ export default class StateManager {
|
|
357
415
|
* @returns {number}
|
358
416
|
*/
|
359
417
|
getColumnsCount() {
|
360
|
-
return this
|
418
|
+
return _classPrivateFieldGet(this, _sourceSettings).getColumnsCount();
|
361
419
|
}
|
362
420
|
|
363
421
|
/**
|
364
422
|
* Clears the column state manager to the initial state.
|
365
423
|
*/
|
366
424
|
clear() {
|
367
|
-
this
|
368
|
-
this
|
369
|
-
this
|
425
|
+
_classPrivateFieldSet(this, _stateMatrix, []);
|
426
|
+
_classPrivateFieldGet(this, _sourceSettings).clear();
|
427
|
+
_classPrivateFieldGet(this, _headersTree).clear();
|
370
428
|
}
|
371
429
|
}
|
@@ -76,7 +76,7 @@ function collapseNode(nodeToProcess) {
|
|
76
76
|
|
77
77
|
// Calculate by how many colspan it needs to reduce the headings to match them to
|
78
78
|
// the first child colspan width.
|
79
|
-
const colspanCompensation = nodeData.colspan - ((_getFirstChildPropert = (0, _tree.getFirstChildProperty)(nodeToProcess, 'colspan'))
|
79
|
+
const colspanCompensation = nodeData.colspan - ((_getFirstChildPropert = (0, _tree.getFirstChildProperty)(nodeToProcess, 'colspan')) !== null && _getFirstChildPropert !== void 0 ? _getFirstChildPropert : 1);
|
80
80
|
nodeToProcess.walkUp(node => {
|
81
81
|
const {
|
82
82
|
data
|
@@ -72,7 +72,7 @@ export function collapseNode(nodeToProcess) {
|
|
72
72
|
|
73
73
|
// Calculate by how many colspan it needs to reduce the headings to match them to
|
74
74
|
// the first child colspan width.
|
75
|
-
const colspanCompensation = nodeData.colspan - ((_getFirstChildPropert = getFirstChildProperty(nodeToProcess, 'colspan'))
|
75
|
+
const colspanCompensation = nodeData.colspan - ((_getFirstChildPropert = getFirstChildProperty(nodeToProcess, 'colspan')) !== null && _getFirstChildPropert !== void 0 ? _getFirstChildPropert : 1);
|
76
76
|
nodeToProcess.walkUp(node => {
|
77
77
|
const {
|
78
78
|
data
|
@@ -6,6 +6,13 @@ require("core-js/modules/es.array.push.js");
|
|
6
6
|
var _object = require("../../../helpers/object");
|
7
7
|
var _array = require("../../../helpers/array");
|
8
8
|
var _settingsNormalizer = require("./settingsNormalizer");
|
9
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
10
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
11
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
12
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
13
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
14
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
15
|
+
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; } }
|
9
16
|
/**
|
10
17
|
* List of properties which are configurable. That properties can be changed using public API.
|
11
18
|
*
|
@@ -22,30 +29,43 @@ const HEADER_CONFIGURABLE_PROPS = ['label', 'collapsible'];
|
|
22
29
|
* @class SourceSettings
|
23
30
|
*/
|
24
31
|
exports.HEADER_CONFIGURABLE_PROPS = HEADER_CONFIGURABLE_PROPS;
|
32
|
+
var _data = /*#__PURE__*/new WeakMap();
|
33
|
+
var _dataLength = /*#__PURE__*/new WeakMap();
|
34
|
+
var _columnsLimit = /*#__PURE__*/new WeakMap();
|
25
35
|
class SourceSettings {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
36
|
+
constructor() {
|
37
|
+
/**
|
38
|
+
* The normalized source data (normalized user-defined settings for nested headers).
|
39
|
+
*
|
40
|
+
* @private
|
41
|
+
* @type {Array[]}
|
42
|
+
*/
|
43
|
+
_classPrivateFieldInitSpec(this, _data, {
|
44
|
+
writable: true,
|
45
|
+
value: []
|
46
|
+
});
|
47
|
+
/**
|
48
|
+
* The total length of the nested header layers.
|
49
|
+
*
|
50
|
+
* @private
|
51
|
+
* @type {number}
|
52
|
+
*/
|
53
|
+
_classPrivateFieldInitSpec(this, _dataLength, {
|
54
|
+
writable: true,
|
55
|
+
value: 0
|
56
|
+
});
|
57
|
+
/**
|
58
|
+
* Columns count limit value trims source settings to that value. If columns
|
59
|
+
* count limit intersects nested header, the header's colspan value is reduced
|
60
|
+
* to keep the whole structure stable (trimmed precisely where the limit is set).
|
61
|
+
*
|
62
|
+
* @type {number}
|
63
|
+
*/
|
64
|
+
_classPrivateFieldInitSpec(this, _columnsLimit, {
|
65
|
+
writable: true,
|
66
|
+
value: Infinity
|
67
|
+
});
|
68
|
+
}
|
49
69
|
/**
|
50
70
|
* Sets columns limit to the source settings will be trimmed. All headers which
|
51
71
|
* overlap the column limit will be reduced to keep the structure solid.
|
@@ -53,7 +73,7 @@ class SourceSettings {
|
|
53
73
|
* @param {number} columnsCount The number of columns to limit to.
|
54
74
|
*/
|
55
75
|
setColumnsLimit(columnsCount) {
|
56
|
-
this
|
76
|
+
_classPrivateFieldSet(this, _columnsLimit, columnsCount);
|
57
77
|
}
|
58
78
|
|
59
79
|
/**
|
@@ -63,8 +83,8 @@ class SourceSettings {
|
|
63
83
|
*/
|
64
84
|
setData() {
|
65
85
|
let nestedHeadersSettings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
66
|
-
this
|
67
|
-
this
|
86
|
+
_classPrivateFieldSet(this, _data, (0, _settingsNormalizer.normalizeSettings)(nestedHeadersSettings, _classPrivateFieldGet(this, _columnsLimit)));
|
87
|
+
_classPrivateFieldSet(this, _dataLength, _classPrivateFieldGet(this, _data).length);
|
68
88
|
}
|
69
89
|
|
70
90
|
/**
|
@@ -73,7 +93,7 @@ class SourceSettings {
|
|
73
93
|
* @returns {Array[]}
|
74
94
|
*/
|
75
95
|
getData() {
|
76
|
-
return this
|
96
|
+
return _classPrivateFieldGet(this, _data);
|
77
97
|
}
|
78
98
|
|
79
99
|
/**
|
@@ -105,7 +125,7 @@ class SourceSettings {
|
|
105
125
|
* header settings.
|
106
126
|
*/
|
107
127
|
map(callback) {
|
108
|
-
(0, _array.arrayEach)(this
|
128
|
+
(0, _array.arrayEach)(_classPrivateFieldGet(this, _data), header => {
|
109
129
|
(0, _array.arrayEach)(header, headerSettings => {
|
110
130
|
const propsToExtend = callback({
|
111
131
|
...headerSettings
|
@@ -128,14 +148,14 @@ class SourceSettings {
|
|
128
148
|
*/
|
129
149
|
getHeaderSettings(headerLevel, columnIndex) {
|
130
150
|
var _headersSettings$colu;
|
131
|
-
if (headerLevel >= this
|
151
|
+
if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
|
132
152
|
return null;
|
133
153
|
}
|
134
|
-
const headersSettings = this
|
154
|
+
const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
|
135
155
|
if (columnIndex >= headersSettings.length) {
|
136
156
|
return null;
|
137
157
|
}
|
138
|
-
return (_headersSettings$colu = headersSettings[columnIndex])
|
158
|
+
return (_headersSettings$colu = headersSettings[columnIndex]) !== null && _headersSettings$colu !== void 0 ? _headersSettings$colu : null;
|
139
159
|
}
|
140
160
|
|
141
161
|
/**
|
@@ -151,10 +171,10 @@ class SourceSettings {
|
|
151
171
|
getHeadersSettings(headerLevel, columnIndex) {
|
152
172
|
let columnsLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
153
173
|
const headersSettingsChunks = [];
|
154
|
-
if (headerLevel >= this
|
174
|
+
if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
|
155
175
|
return headersSettingsChunks;
|
156
176
|
}
|
157
|
-
const headersSettings = this
|
177
|
+
const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
|
158
178
|
let currentLength = 0;
|
159
179
|
for (let i = columnIndex; i < headersSettings.length; i++) {
|
160
180
|
const headerSettings = headersSettings[i];
|
@@ -185,7 +205,7 @@ class SourceSettings {
|
|
185
205
|
* @returns {number}
|
186
206
|
*/
|
187
207
|
getLayersCount() {
|
188
|
-
return this
|
208
|
+
return _classPrivateFieldGet(this, _dataLength);
|
189
209
|
}
|
190
210
|
|
191
211
|
/**
|
@@ -194,15 +214,15 @@ class SourceSettings {
|
|
194
214
|
* @returns {number}
|
195
215
|
*/
|
196
216
|
getColumnsCount() {
|
197
|
-
return this
|
217
|
+
return _classPrivateFieldGet(this, _dataLength) > 0 ? _classPrivateFieldGet(this, _data)[0].length : 0;
|
198
218
|
}
|
199
219
|
|
200
220
|
/**
|
201
221
|
* Clears the data.
|
202
222
|
*/
|
203
223
|
clear() {
|
204
|
-
this
|
205
|
-
this
|
224
|
+
_classPrivateFieldSet(this, _data, []);
|
225
|
+
_classPrivateFieldSet(this, _dataLength, 0);
|
206
226
|
}
|
207
227
|
}
|
208
228
|
exports.default = SourceSettings;
|
@@ -1,5 +1,12 @@
|
|
1
1
|
import "core-js/modules/es.error.cause.js";
|
2
2
|
import "core-js/modules/es.array.push.js";
|
3
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
4
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
5
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
6
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
7
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
8
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
9
|
+
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; } }
|
3
10
|
import { extend, isObject } from "../../../helpers/object.mjs";
|
4
11
|
import { arrayEach } from "../../../helpers/array.mjs";
|
5
12
|
import { normalizeSettings } from "./settingsNormalizer.mjs";
|
@@ -18,30 +25,43 @@ export const HEADER_CONFIGURABLE_PROPS = ['label', 'collapsible'];
|
|
18
25
|
* @private
|
19
26
|
* @class SourceSettings
|
20
27
|
*/
|
28
|
+
var _data = /*#__PURE__*/new WeakMap();
|
29
|
+
var _dataLength = /*#__PURE__*/new WeakMap();
|
30
|
+
var _columnsLimit = /*#__PURE__*/new WeakMap();
|
21
31
|
export default class SourceSettings {
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
32
|
+
constructor() {
|
33
|
+
/**
|
34
|
+
* The normalized source data (normalized user-defined settings for nested headers).
|
35
|
+
*
|
36
|
+
* @private
|
37
|
+
* @type {Array[]}
|
38
|
+
*/
|
39
|
+
_classPrivateFieldInitSpec(this, _data, {
|
40
|
+
writable: true,
|
41
|
+
value: []
|
42
|
+
});
|
43
|
+
/**
|
44
|
+
* The total length of the nested header layers.
|
45
|
+
*
|
46
|
+
* @private
|
47
|
+
* @type {number}
|
48
|
+
*/
|
49
|
+
_classPrivateFieldInitSpec(this, _dataLength, {
|
50
|
+
writable: true,
|
51
|
+
value: 0
|
52
|
+
});
|
53
|
+
/**
|
54
|
+
* Columns count limit value trims source settings to that value. If columns
|
55
|
+
* count limit intersects nested header, the header's colspan value is reduced
|
56
|
+
* to keep the whole structure stable (trimmed precisely where the limit is set).
|
57
|
+
*
|
58
|
+
* @type {number}
|
59
|
+
*/
|
60
|
+
_classPrivateFieldInitSpec(this, _columnsLimit, {
|
61
|
+
writable: true,
|
62
|
+
value: Infinity
|
63
|
+
});
|
64
|
+
}
|
45
65
|
/**
|
46
66
|
* Sets columns limit to the source settings will be trimmed. All headers which
|
47
67
|
* overlap the column limit will be reduced to keep the structure solid.
|
@@ -49,7 +69,7 @@ export default class SourceSettings {
|
|
49
69
|
* @param {number} columnsCount The number of columns to limit to.
|
50
70
|
*/
|
51
71
|
setColumnsLimit(columnsCount) {
|
52
|
-
this
|
72
|
+
_classPrivateFieldSet(this, _columnsLimit, columnsCount);
|
53
73
|
}
|
54
74
|
|
55
75
|
/**
|
@@ -59,8 +79,8 @@ export default class SourceSettings {
|
|
59
79
|
*/
|
60
80
|
setData() {
|
61
81
|
let nestedHeadersSettings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
62
|
-
this
|
63
|
-
this
|
82
|
+
_classPrivateFieldSet(this, _data, normalizeSettings(nestedHeadersSettings, _classPrivateFieldGet(this, _columnsLimit)));
|
83
|
+
_classPrivateFieldSet(this, _dataLength, _classPrivateFieldGet(this, _data).length);
|
64
84
|
}
|
65
85
|
|
66
86
|
/**
|
@@ -69,7 +89,7 @@ export default class SourceSettings {
|
|
69
89
|
* @returns {Array[]}
|
70
90
|
*/
|
71
91
|
getData() {
|
72
|
-
return this
|
92
|
+
return _classPrivateFieldGet(this, _data);
|
73
93
|
}
|
74
94
|
|
75
95
|
/**
|
@@ -101,7 +121,7 @@ export default class SourceSettings {
|
|
101
121
|
* header settings.
|
102
122
|
*/
|
103
123
|
map(callback) {
|
104
|
-
arrayEach(this
|
124
|
+
arrayEach(_classPrivateFieldGet(this, _data), header => {
|
105
125
|
arrayEach(header, headerSettings => {
|
106
126
|
const propsToExtend = callback({
|
107
127
|
...headerSettings
|
@@ -124,14 +144,14 @@ export default class SourceSettings {
|
|
124
144
|
*/
|
125
145
|
getHeaderSettings(headerLevel, columnIndex) {
|
126
146
|
var _headersSettings$colu;
|
127
|
-
if (headerLevel >= this
|
147
|
+
if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
|
128
148
|
return null;
|
129
149
|
}
|
130
|
-
const headersSettings = this
|
150
|
+
const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
|
131
151
|
if (columnIndex >= headersSettings.length) {
|
132
152
|
return null;
|
133
153
|
}
|
134
|
-
return (_headersSettings$colu = headersSettings[columnIndex])
|
154
|
+
return (_headersSettings$colu = headersSettings[columnIndex]) !== null && _headersSettings$colu !== void 0 ? _headersSettings$colu : null;
|
135
155
|
}
|
136
156
|
|
137
157
|
/**
|
@@ -147,10 +167,10 @@ export default class SourceSettings {
|
|
147
167
|
getHeadersSettings(headerLevel, columnIndex) {
|
148
168
|
let columnsLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
149
169
|
const headersSettingsChunks = [];
|
150
|
-
if (headerLevel >= this
|
170
|
+
if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
|
151
171
|
return headersSettingsChunks;
|
152
172
|
}
|
153
|
-
const headersSettings = this
|
173
|
+
const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
|
154
174
|
let currentLength = 0;
|
155
175
|
for (let i = columnIndex; i < headersSettings.length; i++) {
|
156
176
|
const headerSettings = headersSettings[i];
|
@@ -181,7 +201,7 @@ export default class SourceSettings {
|
|
181
201
|
* @returns {number}
|
182
202
|
*/
|
183
203
|
getLayersCount() {
|
184
|
-
return this
|
204
|
+
return _classPrivateFieldGet(this, _dataLength);
|
185
205
|
}
|
186
206
|
|
187
207
|
/**
|
@@ -190,14 +210,14 @@ export default class SourceSettings {
|
|
190
210
|
* @returns {number}
|
191
211
|
*/
|
192
212
|
getColumnsCount() {
|
193
|
-
return this
|
213
|
+
return _classPrivateFieldGet(this, _dataLength) > 0 ? _classPrivateFieldGet(this, _data)[0].length : 0;
|
194
214
|
}
|
195
215
|
|
196
216
|
/**
|
197
217
|
* Clears the data.
|
198
218
|
*/
|
199
219
|
clear() {
|
200
|
-
this
|
201
|
-
this
|
220
|
+
_classPrivateFieldSet(this, _data, []);
|
221
|
+
_classPrivateFieldSet(this, _dataLength, 0);
|
202
222
|
}
|
203
223
|
}
|