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,3 +1,11 @@
|
|
1
|
+
import "core-js/modules/es.error.cause.js";
|
2
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
3
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
4
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
5
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
6
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
7
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
8
|
+
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; } }
|
1
9
|
import { ChangesObserver } from "./observer.mjs";
|
2
10
|
import { arrayDiff } from "./utils.mjs";
|
3
11
|
/**
|
@@ -8,53 +16,73 @@ import { arrayDiff } from "./utils.mjs";
|
|
8
16
|
* @private
|
9
17
|
* @class ChangesObservable
|
10
18
|
*/
|
19
|
+
var _observers = /*#__PURE__*/new WeakMap();
|
20
|
+
var _indexMatrix = /*#__PURE__*/new WeakMap();
|
21
|
+
var _currentIndexState = /*#__PURE__*/new WeakMap();
|
22
|
+
var _isMatrixIndexesInitialized = /*#__PURE__*/new WeakMap();
|
23
|
+
var _initialIndexValue = /*#__PURE__*/new WeakMap();
|
11
24
|
export class ChangesObservable {
|
12
|
-
/**
|
13
|
-
* The list of registered ChangesObserver instances.
|
14
|
-
*
|
15
|
-
* @type {ChangesObserver[]}
|
16
|
-
*/
|
17
|
-
#observers = new Set();
|
18
|
-
/**
|
19
|
-
* An array with default values that act as a base array that will be compared with
|
20
|
-
* the last saved index state. The changes are generated and immediately send through
|
21
|
-
* the newly created ChangesObserver object. Thanks to that, the observer initially has
|
22
|
-
* all information about what indexes are currently changed.
|
23
|
-
*
|
24
|
-
* @type {Array}
|
25
|
-
*/
|
26
|
-
#indexMatrix = [];
|
27
|
-
/**
|
28
|
-
* An array that holds the indexes state that is currently valid. The value is changed on every
|
29
|
-
* index mapper cache update.
|
30
|
-
*
|
31
|
-
* @type {Array}
|
32
|
-
*/
|
33
|
-
#currentIndexState = [];
|
34
|
-
/**
|
35
|
-
* The flag determines if the observable is initialized or not. Not initialized object creates
|
36
|
-
* index matrix once while emitting new changes.
|
37
|
-
*
|
38
|
-
* @type {boolean}
|
39
|
-
*/
|
40
|
-
#isMatrixIndexesInitialized = false;
|
41
|
-
/**
|
42
|
-
* The initial index value allows control from what value the index matrix array will be created.
|
43
|
-
* Changing that value changes how the array diff generates the changes for the initial data
|
44
|
-
* sent to the subscribers. For example, the changes can be triggered by detecting the changes
|
45
|
-
* from `false` to `true` value or vice versa. Generally, it depends on which index map type
|
46
|
-
* the Observable will work with. For "hiding" or "trimming" index types, it will be boolean
|
47
|
-
* values. For various index maps, it can be anything, but I suspect that the most appropriate
|
48
|
-
* initial value will be "undefined" in that case.
|
49
|
-
*
|
50
|
-
* @type {boolean}
|
51
|
-
*/
|
52
|
-
#initialIndexValue = false;
|
53
25
|
constructor() {
|
54
26
|
let {
|
55
27
|
initialIndexValue
|
56
28
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
57
|
-
|
29
|
+
/**
|
30
|
+
* The list of registered ChangesObserver instances.
|
31
|
+
*
|
32
|
+
* @type {ChangesObserver[]}
|
33
|
+
*/
|
34
|
+
_classPrivateFieldInitSpec(this, _observers, {
|
35
|
+
writable: true,
|
36
|
+
value: new Set()
|
37
|
+
});
|
38
|
+
/**
|
39
|
+
* An array with default values that act as a base array that will be compared with
|
40
|
+
* the last saved index state. The changes are generated and immediately send through
|
41
|
+
* the newly created ChangesObserver object. Thanks to that, the observer initially has
|
42
|
+
* all information about what indexes are currently changed.
|
43
|
+
*
|
44
|
+
* @type {Array}
|
45
|
+
*/
|
46
|
+
_classPrivateFieldInitSpec(this, _indexMatrix, {
|
47
|
+
writable: true,
|
48
|
+
value: []
|
49
|
+
});
|
50
|
+
/**
|
51
|
+
* An array that holds the indexes state that is currently valid. The value is changed on every
|
52
|
+
* index mapper cache update.
|
53
|
+
*
|
54
|
+
* @type {Array}
|
55
|
+
*/
|
56
|
+
_classPrivateFieldInitSpec(this, _currentIndexState, {
|
57
|
+
writable: true,
|
58
|
+
value: []
|
59
|
+
});
|
60
|
+
/**
|
61
|
+
* The flag determines if the observable is initialized or not. Not initialized object creates
|
62
|
+
* index matrix once while emitting new changes.
|
63
|
+
*
|
64
|
+
* @type {boolean}
|
65
|
+
*/
|
66
|
+
_classPrivateFieldInitSpec(this, _isMatrixIndexesInitialized, {
|
67
|
+
writable: true,
|
68
|
+
value: false
|
69
|
+
});
|
70
|
+
/**
|
71
|
+
* The initial index value allows control from what value the index matrix array will be created.
|
72
|
+
* Changing that value changes how the array diff generates the changes for the initial data
|
73
|
+
* sent to the subscribers. For example, the changes can be triggered by detecting the changes
|
74
|
+
* from `false` to `true` value or vice versa. Generally, it depends on which index map type
|
75
|
+
* the Observable will work with. For "hiding" or "trimming" index types, it will be boolean
|
76
|
+
* values. For various index maps, it can be anything, but I suspect that the most appropriate
|
77
|
+
* initial value will be "undefined" in that case.
|
78
|
+
*
|
79
|
+
* @type {boolean}
|
80
|
+
*/
|
81
|
+
_classPrivateFieldInitSpec(this, _initialIndexValue, {
|
82
|
+
writable: true,
|
83
|
+
value: false
|
84
|
+
});
|
85
|
+
_classPrivateFieldSet(this, _initialIndexValue, initialIndexValue !== null && initialIndexValue !== void 0 ? initialIndexValue : false);
|
58
86
|
}
|
59
87
|
|
60
88
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
@@ -83,11 +111,11 @@ export class ChangesObservable {
|
|
83
111
|
/* eslint-enable jsdoc/require-description-complete-sentence */
|
84
112
|
createObserver() {
|
85
113
|
const observer = new ChangesObserver();
|
86
|
-
this
|
114
|
+
_classPrivateFieldGet(this, _observers).add(observer);
|
87
115
|
observer.addLocalHook('unsubscribe', () => {
|
88
|
-
this
|
116
|
+
_classPrivateFieldGet(this, _observers).delete(observer);
|
89
117
|
});
|
90
|
-
observer._writeInitialChanges(arrayDiff(this
|
118
|
+
observer._writeInitialChanges(arrayDiff(_classPrivateFieldGet(this, _indexMatrix), _classPrivateFieldGet(this, _currentIndexState)));
|
91
119
|
return observer;
|
92
120
|
}
|
93
121
|
|
@@ -99,20 +127,20 @@ export class ChangesObservable {
|
|
99
127
|
* @param {Array} indexesState An array with index map state.
|
100
128
|
*/
|
101
129
|
emit(indexesState) {
|
102
|
-
let currentIndexState = this
|
103
|
-
if (!this
|
130
|
+
let currentIndexState = _classPrivateFieldGet(this, _currentIndexState);
|
131
|
+
if (!_classPrivateFieldGet(this, _isMatrixIndexesInitialized) || _classPrivateFieldGet(this, _indexMatrix).length !== indexesState.length) {
|
104
132
|
if (indexesState.length === 0) {
|
105
|
-
indexesState = new Array(currentIndexState.length).fill(this
|
133
|
+
indexesState = new Array(currentIndexState.length).fill(_classPrivateFieldGet(this, _initialIndexValue));
|
106
134
|
} else {
|
107
|
-
this
|
135
|
+
_classPrivateFieldSet(this, _indexMatrix, new Array(indexesState.length).fill(_classPrivateFieldGet(this, _initialIndexValue)));
|
108
136
|
}
|
109
|
-
if (!this
|
110
|
-
this
|
111
|
-
currentIndexState = this
|
137
|
+
if (!_classPrivateFieldGet(this, _isMatrixIndexesInitialized)) {
|
138
|
+
_classPrivateFieldSet(this, _isMatrixIndexesInitialized, true);
|
139
|
+
currentIndexState = _classPrivateFieldGet(this, _indexMatrix);
|
112
140
|
}
|
113
141
|
}
|
114
142
|
const changes = arrayDiff(currentIndexState, indexesState);
|
115
|
-
this
|
116
|
-
this
|
143
|
+
_classPrivateFieldGet(this, _observers).forEach(observer => observer._write(changes));
|
144
|
+
_classPrivateFieldSet(this, _currentIndexState, indexesState);
|
117
145
|
}
|
118
146
|
}
|
@@ -1,25 +1,38 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
require("core-js/modules/es.error.cause.js");
|
3
4
|
exports.__esModule = true;
|
4
5
|
var _object = require("../../helpers/object");
|
5
6
|
var _localHooks = _interopRequireDefault(require("../../mixins/localHooks"));
|
6
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
9
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
10
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
11
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
12
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
13
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
14
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
7
15
|
/**
|
8
16
|
* The ChangesObserver module is an object that represents a disposable resource
|
9
17
|
* provided by the ChangesObservable module.
|
10
18
|
*
|
11
19
|
* @class ChangesObserver
|
12
20
|
*/
|
21
|
+
var _currentInitialChanges = /*#__PURE__*/new WeakMap();
|
13
22
|
class ChangesObserver {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
+
constructor() {
|
24
|
+
/**
|
25
|
+
* The field holds initial changes that will be used to notify the callbacks added using
|
26
|
+
* subscribe method. Regardless of the moment of listening for changes, the subscriber
|
27
|
+
* will be notified once with all changes made before subscribing.
|
28
|
+
*
|
29
|
+
* @type {Array}
|
30
|
+
*/
|
31
|
+
_classPrivateFieldInitSpec(this, _currentInitialChanges, {
|
32
|
+
writable: true,
|
33
|
+
value: []
|
34
|
+
});
|
35
|
+
}
|
23
36
|
/**
|
24
37
|
* Subscribes to the observer.
|
25
38
|
*
|
@@ -28,7 +41,7 @@ class ChangesObserver {
|
|
28
41
|
*/
|
29
42
|
subscribe(callback) {
|
30
43
|
this.addLocalHook('change', callback);
|
31
|
-
this._write(this
|
44
|
+
this._write(_classPrivateFieldGet(this, _currentInitialChanges));
|
32
45
|
return this;
|
33
46
|
}
|
34
47
|
|
@@ -67,7 +80,7 @@ class ChangesObserver {
|
|
67
80
|
* @param {object} initialChanges The chunk of changes produced by the ChangesObservable module.
|
68
81
|
*/
|
69
82
|
_writeInitialChanges(initialChanges) {
|
70
|
-
this
|
83
|
+
_classPrivateFieldSet(this, _currentInitialChanges, initialChanges);
|
71
84
|
}
|
72
85
|
}
|
73
86
|
exports.ChangesObserver = ChangesObserver;
|
@@ -1,3 +1,11 @@
|
|
1
|
+
import "core-js/modules/es.error.cause.js";
|
2
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
3
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
4
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
5
|
+
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; } }
|
6
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
7
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
8
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
1
9
|
import { mixin } from "../../helpers/object.mjs";
|
2
10
|
import localHooks from "../../mixins/localHooks.mjs";
|
3
11
|
/**
|
@@ -6,16 +14,21 @@ import localHooks from "../../mixins/localHooks.mjs";
|
|
6
14
|
*
|
7
15
|
* @class ChangesObserver
|
8
16
|
*/
|
17
|
+
var _currentInitialChanges = /*#__PURE__*/new WeakMap();
|
9
18
|
export class ChangesObserver {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
+
constructor() {
|
20
|
+
/**
|
21
|
+
* The field holds initial changes that will be used to notify the callbacks added using
|
22
|
+
* subscribe method. Regardless of the moment of listening for changes, the subscriber
|
23
|
+
* will be notified once with all changes made before subscribing.
|
24
|
+
*
|
25
|
+
* @type {Array}
|
26
|
+
*/
|
27
|
+
_classPrivateFieldInitSpec(this, _currentInitialChanges, {
|
28
|
+
writable: true,
|
29
|
+
value: []
|
30
|
+
});
|
31
|
+
}
|
19
32
|
/**
|
20
33
|
* Subscribes to the observer.
|
21
34
|
*
|
@@ -24,7 +37,7 @@ export class ChangesObserver {
|
|
24
37
|
*/
|
25
38
|
subscribe(callback) {
|
26
39
|
this.addLocalHook('change', callback);
|
27
|
-
this._write(this
|
40
|
+
this._write(_classPrivateFieldGet(this, _currentInitialChanges));
|
28
41
|
return this;
|
29
42
|
}
|
30
43
|
|
@@ -63,7 +76,7 @@ export class ChangesObserver {
|
|
63
76
|
* @param {object} initialChanges The chunk of changes produced by the ChangesObservable module.
|
64
77
|
*/
|
65
78
|
_writeInitialChanges(initialChanges) {
|
66
|
-
this
|
79
|
+
_classPrivateFieldSet(this, _currentInitialChanges, initialChanges);
|
67
80
|
}
|
68
81
|
}
|
69
82
|
mixin(ChangesObserver, localHooks);
|
@@ -1,11 +1,15 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
4
5
|
var _indexMap = require("./indexMap");
|
5
6
|
var _physicallyIndexed = require("./utils/physicallyIndexed");
|
6
7
|
var _indexesSequence = require("./utils/indexesSequence");
|
7
8
|
var _actionsOnIndexes = require("./utils/actionsOnIndexes");
|
8
9
|
var _function = require("../../helpers/function");
|
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(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
12
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
9
13
|
/**
|
10
14
|
* Map for storing mappings from an physical index to a value. Those entries are linked and stored in a certain order.
|
11
15
|
*
|
@@ -15,14 +19,16 @@ var _function = require("../../helpers/function");
|
|
15
19
|
* @class LinkedPhysicalIndexToValueMap
|
16
20
|
*/
|
17
21
|
class LinkedPhysicalIndexToValueMap extends _indexMap.IndexMap {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
constructor() {
|
23
|
+
super(...arguments);
|
24
|
+
/**
|
25
|
+
* Indexes and values corresponding to them (entries) are stored in a certain order.
|
26
|
+
*
|
27
|
+
* @private
|
28
|
+
* @type {Array<number>}
|
29
|
+
*/
|
30
|
+
_defineProperty(this, "orderOfIndexes", []);
|
31
|
+
}
|
26
32
|
/**
|
27
33
|
* Get full list of ordered values for particular indexes.
|
28
34
|
*
|
@@ -1,3 +1,7 @@
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
4
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
1
5
|
import { IndexMap } from "./indexMap.mjs";
|
2
6
|
import { getListWithRemovedItems, getListWithInsertedItems } from "./utils/physicallyIndexed.mjs";
|
3
7
|
import { getListWithRemovedItems as getListWithoutIndexes } from "./utils/indexesSequence.mjs";
|
@@ -12,14 +16,16 @@ import { isFunction } from "../../helpers/function.mjs";
|
|
12
16
|
* @class LinkedPhysicalIndexToValueMap
|
13
17
|
*/
|
14
18
|
export class LinkedPhysicalIndexToValueMap extends IndexMap {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
constructor() {
|
20
|
+
super(...arguments);
|
21
|
+
/**
|
22
|
+
* Indexes and values corresponding to them (entries) are stored in a certain order.
|
23
|
+
*
|
24
|
+
* @private
|
25
|
+
* @type {Array<number>}
|
26
|
+
*/
|
27
|
+
_defineProperty(this, "orderOfIndexes", []);
|
28
|
+
}
|
23
29
|
/**
|
24
30
|
* Get full list of ordered values for particular indexes.
|
25
31
|
*
|
@@ -4,6 +4,9 @@ exports.__esModule = true;
|
|
4
4
|
exports.depthFirstPreOrder = depthFirstPreOrder;
|
5
5
|
require("core-js/modules/es.array.push.js");
|
6
6
|
require("core-js/modules/es.error.cause.js");
|
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(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
9
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
7
10
|
/**
|
8
11
|
* Depth-first pre-order strategy (https://en.wikipedia.org/wiki/Tree_traversal#Pre-order_(NLR)).
|
9
12
|
*
|
@@ -96,25 +99,25 @@ const TRAVERSAL_STRATEGIES = new Map([[TRAVERSAL_DF_PRE, depthFirstPreOrder], [T
|
|
96
99
|
*
|
97
100
|
*/
|
98
101
|
class TreeNode {
|
99
|
-
/**
|
100
|
-
* A tree data.
|
101
|
-
*
|
102
|
-
* @type {object}
|
103
|
-
*/
|
104
|
-
data = {};
|
105
|
-
/**
|
106
|
-
* A parent node.
|
107
|
-
*
|
108
|
-
* @type {TreeNode}
|
109
|
-
*/
|
110
|
-
parent = null;
|
111
|
-
/**
|
112
|
-
* A tree leaves.
|
113
|
-
*
|
114
|
-
* @type {TreeNode[]}
|
115
|
-
*/
|
116
|
-
childs = [];
|
117
102
|
constructor(data) {
|
103
|
+
/**
|
104
|
+
* A tree data.
|
105
|
+
*
|
106
|
+
* @type {object}
|
107
|
+
*/
|
108
|
+
_defineProperty(this, "data", {});
|
109
|
+
/**
|
110
|
+
* A parent node.
|
111
|
+
*
|
112
|
+
* @type {TreeNode}
|
113
|
+
*/
|
114
|
+
_defineProperty(this, "parent", null);
|
115
|
+
/**
|
116
|
+
* A tree leaves.
|
117
|
+
*
|
118
|
+
* @type {TreeNode[]}
|
119
|
+
*/
|
120
|
+
_defineProperty(this, "childs", []);
|
118
121
|
this.data = data;
|
119
122
|
}
|
120
123
|
|
@@ -1,3 +1,6 @@
|
|
1
|
+
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; }
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
1
4
|
import "core-js/modules/es.array.push.js";
|
2
5
|
import "core-js/modules/es.error.cause.js";
|
3
6
|
/**
|
@@ -89,25 +92,25 @@ const TRAVERSAL_STRATEGIES = new Map([[TRAVERSAL_DF_PRE, depthFirstPreOrder], [T
|
|
89
92
|
*
|
90
93
|
*/
|
91
94
|
export default class TreeNode {
|
92
|
-
/**
|
93
|
-
* A tree data.
|
94
|
-
*
|
95
|
-
* @type {object}
|
96
|
-
*/
|
97
|
-
data = {};
|
98
|
-
/**
|
99
|
-
* A parent node.
|
100
|
-
*
|
101
|
-
* @type {TreeNode}
|
102
|
-
*/
|
103
|
-
parent = null;
|
104
|
-
/**
|
105
|
-
* A tree leaves.
|
106
|
-
*
|
107
|
-
* @type {TreeNode[]}
|
108
|
-
*/
|
109
|
-
childs = [];
|
110
95
|
constructor(data) {
|
96
|
+
/**
|
97
|
+
* A tree data.
|
98
|
+
*
|
99
|
+
* @type {object}
|
100
|
+
*/
|
101
|
+
_defineProperty(this, "data", {});
|
102
|
+
/**
|
103
|
+
* A parent node.
|
104
|
+
*
|
105
|
+
* @type {TreeNode}
|
106
|
+
*/
|
107
|
+
_defineProperty(this, "parent", null);
|
108
|
+
/**
|
109
|
+
* A tree leaves.
|
110
|
+
*
|
111
|
+
* @type {TreeNode[]}
|
112
|
+
*/
|
113
|
+
_defineProperty(this, "childs", []);
|
111
114
|
this.data = data;
|
112
115
|
}
|
113
116
|
|