handsontable 16.0.1 → 16.1.0-next-91b8a0f-20250905
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/overlays.js +12 -2
- package/3rdparty/walkontable/src/overlays.mjs +12 -2
- package/3rdparty/walkontable/src/viewport.js +2 -6
- package/3rdparty/walkontable/src/viewport.mjs +2 -6
- package/CHANGELOG.md +37 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/autocompleteType/accessors/index.js +7 -0
- package/cellTypes/autocompleteType/accessors/index.mjs +2 -0
- package/cellTypes/autocompleteType/accessors/valueGetter.js +14 -0
- package/cellTypes/autocompleteType/accessors/valueGetter.mjs +10 -0
- package/cellTypes/autocompleteType/accessors/valueSetter.js +25 -0
- package/cellTypes/autocompleteType/accessors/valueSetter.mjs +21 -0
- package/cellTypes/autocompleteType/autocompleteType.js +4 -1
- package/cellTypes/autocompleteType/autocompleteType.mjs +4 -1
- package/cellTypes/checkboxType/accessors/index.js +5 -0
- package/cellTypes/checkboxType/accessors/index.mjs +1 -0
- package/cellTypes/checkboxType/accessors/valueSetter.js +26 -0
- package/cellTypes/checkboxType/accessors/valueSetter.mjs +22 -0
- package/cellTypes/checkboxType/checkboxType.js +3 -1
- package/cellTypes/checkboxType/checkboxType.mjs +3 -1
- package/cellTypes/dropdownType/accessors/index.js +7 -0
- package/cellTypes/dropdownType/accessors/index.mjs +2 -0
- package/cellTypes/dropdownType/accessors/valueGetter.js +14 -0
- package/cellTypes/dropdownType/accessors/valueGetter.mjs +10 -0
- package/cellTypes/dropdownType/accessors/valueSetter.js +17 -0
- package/cellTypes/dropdownType/accessors/valueSetter.mjs +13 -0
- package/cellTypes/dropdownType/dropdownType.js +4 -1
- package/cellTypes/dropdownType/dropdownType.mjs +4 -1
- package/cellTypes/numericType/accessors/index.js +5 -0
- package/cellTypes/numericType/accessors/index.mjs +1 -0
- package/cellTypes/numericType/accessors/valueSetter.js +19 -0
- package/cellTypes/numericType/accessors/valueSetter.mjs +15 -0
- package/cellTypes/numericType/numericType.js +3 -1
- package/cellTypes/numericType/numericType.mjs +3 -1
- package/core/focusCatcher/index.js +37 -112
- package/core/focusCatcher/index.mjs +35 -110
- package/core/focusCatcher/utils.js +31 -0
- package/core/focusCatcher/utils.mjs +27 -0
- package/core/hooks/constants.js +242 -0
- package/core/hooks/constants.mjs +242 -0
- package/core/hooks/index.d.ts +22 -0
- package/core/viewportScroll/scrollStrategies/focusScroll.js +5 -1
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +5 -1
- package/core/viewportScroll/utils.js +1 -1
- package/core/viewportScroll/utils.mjs +1 -1
- package/core.d.ts +4 -0
- package/core.js +237 -139
- package/core.mjs +240 -142
- package/dataMap/dataMap.js +13 -3
- package/dataMap/dataMap.mjs +14 -4
- package/dataMap/dataSource.js +16 -0
- package/dataMap/dataSource.mjs +16 -0
- package/dataMap/metaManager/lazyFactoryMap.js +4 -3
- package/dataMap/metaManager/lazyFactoryMap.mjs +2 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +3 -2
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +3 -2
- package/dataMap/metaManager/metaSchema.js +289 -4
- package/dataMap/metaManager/metaSchema.mjs +289 -4
- package/dataMap/metaManager/utils.js +0 -11
- package/dataMap/metaManager/utils.mjs +0 -10
- package/dataMap/replaceData.js +1 -0
- package/dataMap/replaceData.mjs +1 -0
- package/dist/handsontable.css +281 -4
- package/dist/handsontable.full.css +281 -4
- package/dist/handsontable.full.js +7842 -2990
- package/dist/handsontable.full.min.css +4 -5
- package/dist/handsontable.full.min.js +167 -165
- package/dist/handsontable.js +9638 -4807
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +52 -50
- package/dist/languages/all.js +231 -21
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.js +11 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.js +11 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.js +11 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.js +11 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.js +11 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.js +11 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fa-IR.js +11 -1
- package/dist/languages/fa-IR.min.js +1 -1
- package/dist/languages/fr-FR.js +11 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.js +11 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.js +11 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.js +11 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.js +11 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.js +11 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.js +11 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.js +11 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.js +11 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.js +11 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.js +11 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.js +11 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.js +11 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.js +11 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +4 -4
- package/editorManager.mjs +4 -4
- package/editors/autocompleteEditor/autocompleteEditor.js +50 -112
- package/editors/autocompleteEditor/autocompleteEditor.mjs +51 -113
- package/editors/baseEditor/baseEditor.js +10 -6
- package/editors/baseEditor/baseEditor.mjs +10 -6
- package/editors/handsontableEditor/handsontableEditor.js +9 -9
- package/editors/handsontableEditor/handsontableEditor.mjs +9 -9
- package/editors/textEditor/textEditor.js +0 -7
- package/editors/textEditor/textEditor.mjs +0 -7
- package/focusManager.js +2 -2
- package/focusManager.mjs +2 -2
- package/helpers/a11y.js +15 -2
- package/helpers/a11y.mjs +10 -2
- package/helpers/console.js +12 -0
- package/helpers/console.mjs +11 -0
- package/helpers/dom/element.js +4 -4
- package/helpers/dom/element.mjs +4 -4
- package/helpers/mixed.js +65 -2
- package/helpers/mixed.mjs +63 -2
- package/helpers/number.js +28 -0
- package/helpers/number.mjs +26 -0
- package/helpers/object.js +35 -0
- package/helpers/object.mjs +34 -0
- package/helpers/string.js +19 -0
- package/helpers/string.mjs +18 -0
- package/helpers/templateLiteralTag.js +57 -1
- package/helpers/templateLiteralTag.mjs +56 -1
- package/i18n/constants.js +13 -1
- package/i18n/constants.mjs +13 -1
- package/i18n/languages/ar-AR.js +11 -1
- package/i18n/languages/ar-AR.mjs +11 -1
- package/i18n/languages/cs-CZ.js +11 -1
- package/i18n/languages/cs-CZ.mjs +11 -1
- package/i18n/languages/de-CH.js +11 -1
- package/i18n/languages/de-CH.mjs +11 -1
- package/i18n/languages/de-DE.js +11 -1
- package/i18n/languages/de-DE.mjs +11 -1
- package/i18n/languages/en-US.js +11 -1
- package/i18n/languages/en-US.mjs +11 -1
- package/i18n/languages/es-MX.js +11 -1
- package/i18n/languages/es-MX.mjs +11 -1
- package/i18n/languages/fa-IR.js +11 -1
- package/i18n/languages/fa-IR.mjs +11 -1
- package/i18n/languages/fr-FR.js +11 -1
- package/i18n/languages/fr-FR.mjs +11 -1
- package/i18n/languages/hr-HR.js +11 -1
- package/i18n/languages/hr-HR.mjs +11 -1
- package/i18n/languages/it-IT.js +11 -1
- package/i18n/languages/it-IT.mjs +11 -1
- package/i18n/languages/ja-JP.js +11 -1
- package/i18n/languages/ja-JP.mjs +11 -1
- package/i18n/languages/ko-KR.js +11 -1
- package/i18n/languages/ko-KR.mjs +11 -1
- package/i18n/languages/lv-LV.js +11 -1
- package/i18n/languages/lv-LV.mjs +11 -1
- package/i18n/languages/nb-NO.js +11 -1
- package/i18n/languages/nb-NO.mjs +11 -1
- package/i18n/languages/nl-NL.js +11 -1
- package/i18n/languages/nl-NL.mjs +11 -1
- package/i18n/languages/pl-PL.js +11 -1
- package/i18n/languages/pl-PL.mjs +11 -1
- package/i18n/languages/pt-BR.js +11 -1
- package/i18n/languages/pt-BR.mjs +11 -1
- package/i18n/languages/ru-RU.js +11 -1
- package/i18n/languages/ru-RU.mjs +11 -1
- package/i18n/languages/sr-SP.js +11 -1
- package/i18n/languages/sr-SP.mjs +11 -1
- package/i18n/languages/zh-CN.js +11 -1
- package/i18n/languages/zh-CN.mjs +11 -1
- package/i18n/languages/zh-TW.js +11 -1
- package/i18n/languages/zh-TW.mjs +11 -1
- package/i18n/phraseFormatters/index.js +3 -1
- package/i18n/phraseFormatters/index.mjs +3 -1
- package/i18n/registry.js +5 -6
- package/i18n/registry.mjs +5 -6
- package/index.d.ts +27 -0
- package/languages/all.js +231 -21
- package/languages/ar-AR.js +11 -1
- package/languages/ar-AR.mjs +11 -1
- package/languages/cs-CZ.js +11 -1
- package/languages/cs-CZ.mjs +11 -1
- package/languages/de-CH.js +11 -1
- package/languages/de-CH.mjs +11 -1
- package/languages/de-DE.js +11 -1
- package/languages/de-DE.mjs +11 -1
- package/languages/en-US.js +11 -1
- package/languages/en-US.mjs +11 -1
- package/languages/es-MX.js +11 -1
- package/languages/es-MX.mjs +11 -1
- package/languages/fa-IR.js +11 -1
- package/languages/fa-IR.mjs +11 -1
- package/languages/fr-FR.js +11 -1
- package/languages/fr-FR.mjs +11 -1
- package/languages/hr-HR.js +11 -1
- package/languages/hr-HR.mjs +11 -1
- package/languages/index.js +231 -21
- package/languages/it-IT.js +11 -1
- package/languages/it-IT.mjs +11 -1
- package/languages/ja-JP.js +11 -1
- package/languages/ja-JP.mjs +11 -1
- package/languages/ko-KR.js +11 -1
- package/languages/ko-KR.mjs +11 -1
- package/languages/lv-LV.js +11 -1
- package/languages/lv-LV.mjs +11 -1
- package/languages/nb-NO.js +11 -1
- package/languages/nb-NO.mjs +11 -1
- package/languages/nl-NL.js +11 -1
- package/languages/nl-NL.mjs +11 -1
- package/languages/pl-PL.js +11 -1
- package/languages/pl-PL.mjs +11 -1
- package/languages/pt-BR.js +11 -1
- package/languages/pt-BR.mjs +11 -1
- package/languages/ru-RU.js +11 -1
- package/languages/ru-RU.mjs +11 -1
- package/languages/sr-SP.js +11 -1
- package/languages/sr-SP.mjs +11 -1
- package/languages/zh-CN.js +11 -1
- package/languages/zh-CN.mjs +11 -1
- package/languages/zh-TW.js +11 -1
- package/languages/zh-TW.mjs +11 -1
- package/mixins/localHooks.js +16 -0
- package/mixins/localHooks.mjs +16 -0
- package/package.json +19 -1
- package/plugins/autoRowSize/autoRowSize.js +43 -6
- package/plugins/autoRowSize/autoRowSize.mjs +43 -6
- package/plugins/autofill/autofill.js +50 -3
- package/plugins/autofill/autofill.mjs +50 -3
- package/plugins/base/base.js +86 -15
- package/plugins/base/base.mjs +87 -16
- package/plugins/collapsibleColumns/collapsibleColumns.js +4 -4
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -4
- package/plugins/columnSorting/columnSorting.js +3 -3
- package/plugins/columnSorting/columnSorting.mjs +3 -3
- package/plugins/comments/comments.js +52 -22
- package/plugins/comments/comments.mjs +52 -22
- package/plugins/comments/contextMenuItem/addEditComment.js +3 -3
- package/plugins/comments/contextMenuItem/addEditComment.mjs +3 -3
- package/plugins/comments/contextMenuItem/readOnlyComment.js +2 -2
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +2 -2
- package/plugins/comments/contextMenuItem/removeComment.js +2 -2
- package/plugins/comments/contextMenuItem/removeComment.mjs +2 -2
- package/plugins/contextMenu/contextMenu.js +4 -5
- package/plugins/contextMenu/contextMenu.mjs +4 -5
- package/plugins/contextMenu/menu/cursor.js +1 -1
- package/plugins/contextMenu/menu/cursor.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +5 -5
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +5 -5
- package/plugins/contextMenu/menu/menu.js +3 -3
- package/plugins/contextMenu/menu/menu.mjs +3 -3
- package/plugins/contextMenu/menu/positioner.js +1 -1
- package/plugins/contextMenu/menu/positioner.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.js +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +3 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +1 -1
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copy.js +1 -1
- package/plugins/copyPaste/contextMenuItem/copy.mjs +1 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/cut.js +1 -1
- package/plugins/copyPaste/contextMenuItem/cut.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +75 -40
- package/plugins/copyPaste/copyPaste.mjs +76 -41
- package/plugins/customBorders/customBorders.js +1 -1
- package/plugins/customBorders/customBorders.mjs +1 -1
- package/plugins/dialog/dialog.d.ts +23 -0
- package/plugins/dialog/dialog.js +489 -0
- package/plugins/dialog/dialog.mjs +485 -0
- package/plugins/dialog/index.d.ts +1 -0
- package/plugins/dialog/index.js +7 -0
- package/plugins/dialog/index.mjs +1 -0
- package/plugins/dialog/ui.js +264 -0
- package/plugins/dialog/ui.mjs +259 -0
- package/plugins/dropdownMenu/dropdownMenu.js +5 -4
- package/plugins/dropdownMenu/dropdownMenu.mjs +5 -4
- package/plugins/filters/filters.js +2 -2
- package/plugins/filters/filters.mjs +2 -2
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +3 -3
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +3 -3
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +4 -4
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +4 -4
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +3 -3
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +3 -3
- package/plugins/hiddenRows/contextMenuItem/showRow.js +4 -4
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +4 -4
- package/plugins/index.d.ts +9 -0
- package/plugins/index.js +9 -0
- package/plugins/index.mjs +7 -1
- package/plugins/loading/content.js +36 -0
- package/plugins/loading/content.mjs +31 -0
- package/plugins/loading/index.d.ts +1 -0
- package/plugins/loading/index.js +7 -0
- package/plugins/loading/index.mjs +1 -0
- package/plugins/loading/loading.d.ts +19 -0
- package/plugins/loading/loading.js +290 -0
- package/plugins/loading/loading.mjs +285 -0
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +3 -3
- package/plugins/manualColumnMove/manualColumnMove.mjs +3 -3
- package/plugins/manualColumnResize/manualColumnResize.js +3 -3
- package/plugins/manualColumnResize/manualColumnResize.mjs +3 -3
- package/plugins/manualRowMove/manualRowMove.js +4 -4
- package/plugins/manualRowMove/manualRowMove.mjs +4 -4
- package/plugins/manualRowResize/manualRowResize.js +5 -2
- package/plugins/manualRowResize/manualRowResize.mjs +5 -2
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +15 -15
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +15 -15
- package/plugins/mergeCells/focusOrder.js +75 -39
- package/plugins/mergeCells/focusOrder.mjs +75 -39
- package/plugins/mergeCells/mergeCells.js +26 -19
- package/plugins/mergeCells/mergeCells.mjs +26 -19
- package/plugins/mergeCells/renderer.js +14 -8
- package/plugins/mergeCells/renderer.mjs +14 -8
- package/plugins/multiColumnSorting/multiColumnSorting.js +3 -3
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +3 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +3 -3
- package/plugins/nestedHeaders/nestedHeaders.js +47 -41
- package/plugins/nestedHeaders/nestedHeaders.mjs +47 -41
- package/plugins/nestedRows/nestedRows.js +3 -3
- package/plugins/nestedRows/nestedRows.mjs +3 -3
- package/plugins/nestedRows/ui/collapsing.js +1 -2
- package/plugins/nestedRows/ui/collapsing.mjs +1 -2
- package/plugins/nestedRows/ui/contextMenu.js +4 -4
- package/plugins/nestedRows/ui/contextMenu.mjs +4 -4
- package/plugins/nestedRows/ui/headers.js +4 -1
- package/plugins/nestedRows/ui/headers.mjs +4 -1
- package/plugins/pagination/focusController.js +27 -0
- package/plugins/pagination/focusController.mjs +23 -0
- package/plugins/pagination/index.d.ts +1 -0
- package/plugins/pagination/index.js +7 -0
- package/plugins/pagination/index.mjs +1 -0
- package/plugins/pagination/pagination.d.ts +52 -0
- package/plugins/pagination/pagination.js +1034 -0
- package/plugins/pagination/pagination.mjs +1030 -0
- package/plugins/pagination/strategies/autoPageSize.js +96 -0
- package/plugins/pagination/strategies/autoPageSize.mjs +92 -0
- package/plugins/pagination/strategies/fixedPageSize.js +88 -0
- package/plugins/pagination/strategies/fixedPageSize.mjs +84 -0
- package/plugins/pagination/strategies/index.js +22 -0
- package/plugins/pagination/strategies/index.mjs +18 -0
- package/plugins/pagination/ui.js +449 -0
- package/plugins/pagination/ui.mjs +443 -0
- package/plugins/pagination/utils.js +28 -0
- package/plugins/pagination/utils.mjs +24 -0
- package/plugins/stretchColumns/calculator.js +4 -0
- package/plugins/stretchColumns/calculator.mjs +4 -0
- package/plugins/stretchColumns/stretchColumns.js +1 -1
- package/plugins/stretchColumns/stretchColumns.mjs +1 -1
- package/plugins/undoRedo/actions/dataChange.js +17 -15
- package/plugins/undoRedo/actions/dataChange.mjs +17 -15
- package/renderers/checkboxRenderer/checkboxRenderer.js +3 -3
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +3 -3
- package/selection/range.js +11 -0
- package/selection/range.mjs +11 -0
- package/selection/selection.js +163 -124
- package/selection/selection.mjs +163 -124
- package/selection/transformation/_base.js +448 -0
- package/selection/transformation/_base.mjs +443 -0
- package/selection/transformation/extender.js +55 -0
- package/selection/transformation/extender.mjs +51 -0
- package/selection/transformation/focus.js +77 -0
- package/selection/transformation/focus.mjs +73 -0
- package/selection/transformation/index.js +7 -0
- package/selection/transformation/index.mjs +2 -0
- package/selection/utils.js +2 -1
- package/selection/utils.mjs +2 -1
- package/settings.d.ts +10 -1
- package/shortcutContexts/commands/editor/fastOpen.js +1 -1
- package/shortcutContexts/commands/editor/fastOpen.mjs +1 -1
- package/shortcutContexts/commands/editor/open.js +10 -4
- package/shortcutContexts/commands/editor/open.mjs +10 -4
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +2 -2
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +2 -2
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +2 -2
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +5 -2
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +2 -2
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/scrollToFocusedCell.js +1 -1
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +1 -1
- package/shortcutContexts/grid.js +3 -3
- package/shortcutContexts/grid.mjs +3 -3
- package/shortcuts/context.js +4 -1
- package/shortcuts/context.mjs +4 -1
- package/shortcuts/manager.js +17 -3
- package/shortcuts/manager.mjs +17 -3
- package/styles/handsontable.css +288 -22
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-classic.css +828 -0
- package/styles/ht-theme-classic.min.css +30 -0
- package/styles/ht-theme-horizon.css +122 -26
- package/styles/ht-theme-horizon.min.css +3 -3
- package/styles/ht-theme-main.css +124 -28
- package/styles/ht-theme-main.min.css +3 -3
- package/tableView.js +61 -25
- package/tableView.mjs +61 -25
- package/utils/a11yAnnouncer.js +70 -0
- package/utils/a11yAnnouncer.mjs +64 -0
- package/{core/focusCatcher → utils}/focusDetector.js +30 -12
- package/{core/focusCatcher → utils}/focusDetector.mjs +30 -12
- package/utils/samplesGenerator.js +17 -1
- package/utils/samplesGenerator.mjs +17 -1
- package/utils/stylesHandler.js +23 -8
- package/utils/stylesHandler.mjs +23 -8
- package/utils/valueAccessors.js +45 -0
- package/utils/valueAccessors.mjs +40 -0
- package/validators/autocompleteValidator/autocompleteValidator.js +2 -1
- package/validators/autocompleteValidator/autocompleteValidator.mjs +2 -1
- package/selection/transformation.js +0 -335
- package/selection/transformation.mjs +0 -331
@@ -47,6 +47,13 @@ class SamplesGenerator {
|
|
47
47
|
* @default {false}
|
48
48
|
*/
|
49
49
|
_defineProperty(this, "allowDuplicates", false);
|
50
|
+
/**
|
51
|
+
* `true` if hidden samples should be included, `false` otherwise.
|
52
|
+
*
|
53
|
+
* @type {boolean}
|
54
|
+
* @default {false}
|
55
|
+
*/
|
56
|
+
_defineProperty(this, "includeHidden", false);
|
50
57
|
this.dataFactory = dataFactory;
|
51
58
|
}
|
52
59
|
|
@@ -80,6 +87,15 @@ class SamplesGenerator {
|
|
80
87
|
this.allowDuplicates = allowDuplicates;
|
81
88
|
}
|
82
89
|
|
90
|
+
/**
|
91
|
+
* Sets the sampler to the mode where it will generate samples for hidden indexes.
|
92
|
+
*
|
93
|
+
* @param {boolean} includeHidden `true` to include hidden indexes, `false` otherwise.
|
94
|
+
*/
|
95
|
+
setIncludeHidden(includeHidden) {
|
96
|
+
this.includeHidden = includeHidden;
|
97
|
+
}
|
98
|
+
|
83
99
|
/**
|
84
100
|
* Generate samples for row. You can control which area should be sampled by passing `rowRange` object and `colRange` object.
|
85
101
|
*
|
@@ -142,7 +158,7 @@ class SamplesGenerator {
|
|
142
158
|
const computedKey = type === 'row' ? 'col' : 'row';
|
143
159
|
const sampledValues = [];
|
144
160
|
rangeEach(range.from, range.to, index => {
|
145
|
-
const data = type === 'row' ? this.dataFactory(specifierValue, index) : this.dataFactory(index, specifierValue);
|
161
|
+
const data = type === 'row' ? this.dataFactory(specifierValue, index, this) : this.dataFactory(index, specifierValue, this);
|
146
162
|
if (data === false) {
|
147
163
|
return;
|
148
164
|
}
|
package/utils/stylesHandler.js
CHANGED
@@ -23,15 +23,23 @@ var _rootDocument = /*#__PURE__*/new WeakMap();
|
|
23
23
|
var _isClassicTheme = /*#__PURE__*/new WeakMap();
|
24
24
|
var _cssVars = /*#__PURE__*/new WeakMap();
|
25
25
|
var _computedStyles = /*#__PURE__*/new WeakMap();
|
26
|
+
var _onThemeChange = /*#__PURE__*/new WeakMap();
|
26
27
|
var _StylesHandler_brand = /*#__PURE__*/new WeakSet();
|
27
28
|
class StylesHandler {
|
28
29
|
/**
|
29
30
|
* Initializes a new instance of the `StylesHandler` class.
|
30
31
|
*
|
31
|
-
* @param {
|
32
|
-
* @param {
|
32
|
+
* @param {object} options The options for the `StylesHandler` instance.
|
33
|
+
* @param {HTMLElement} options.rootElement The root element of the instance.
|
34
|
+
* @param {Document} options.rootDocument The root document of the instance.
|
35
|
+
* @param {function(string)} options.onThemeChange The callback function to be called when the theme changes.
|
33
36
|
*/
|
34
|
-
constructor(
|
37
|
+
constructor(_ref) {
|
38
|
+
let {
|
39
|
+
rootElement: _rootElement2,
|
40
|
+
rootDocument: _rootDocument2,
|
41
|
+
onThemeChange = () => {}
|
42
|
+
} = _ref;
|
35
43
|
/**
|
36
44
|
* Calculates the row height based on the current theme and CSS variables.
|
37
45
|
*
|
@@ -61,7 +69,6 @@ class StylesHandler {
|
|
61
69
|
* The root document of the instance.
|
62
70
|
*
|
63
71
|
* @type {Document}
|
64
|
-
* @private
|
65
72
|
*/
|
66
73
|
_classPrivateFieldInitSpec(this, _rootDocument, void 0);
|
67
74
|
/**
|
@@ -74,18 +81,23 @@ class StylesHandler {
|
|
74
81
|
* An object to store CSS variable values.
|
75
82
|
*
|
76
83
|
* @type {object}
|
77
|
-
* @private
|
78
84
|
*/
|
79
85
|
_classPrivateFieldInitSpec(this, _cssVars, {});
|
80
86
|
/**
|
81
87
|
* Stores the computed styles for various elements.
|
82
88
|
*
|
83
|
-
* @type {object} - An object containing the computed styles if a nested
|
84
|
-
* @private
|
89
|
+
* @type {object} - An object containing the computed styles if a nested structure of `element: { [element type]: {property: value} }`.
|
85
90
|
*/
|
86
91
|
_classPrivateFieldInitSpec(this, _computedStyles, {});
|
92
|
+
/**
|
93
|
+
* The callback function to be called when the theme changes.
|
94
|
+
*
|
95
|
+
* @type {function(string)}
|
96
|
+
*/
|
97
|
+
_classPrivateFieldInitSpec(this, _onThemeChange, void 0);
|
87
98
|
_classPrivateFieldSet(_rootElement, this, _rootElement2);
|
88
99
|
_classPrivateFieldSet(_rootDocument, this, _rootDocument2);
|
100
|
+
_classPrivateFieldSet(_onThemeChange, this, onThemeChange);
|
89
101
|
}
|
90
102
|
|
91
103
|
/**
|
@@ -163,6 +175,7 @@ class StylesHandler {
|
|
163
175
|
if (!themeName) {
|
164
176
|
_classPrivateFieldSet(_themeName, this, undefined);
|
165
177
|
_classPrivateFieldSet(_isClassicTheme, this, true);
|
178
|
+
_classPrivateFieldGet(_onThemeChange, this).call(this, _classPrivateFieldGet(_themeName, this));
|
166
179
|
_assertClassBrand(_StylesHandler_brand, this, _cacheStylesheetValues).call(this);
|
167
180
|
return;
|
168
181
|
}
|
@@ -171,6 +184,7 @@ class StylesHandler {
|
|
171
184
|
(0, _console.warn)(`Invalid theme name: ${themeName}. Please provide a valid theme name.`);
|
172
185
|
_classPrivateFieldSet(_themeName, this, undefined);
|
173
186
|
_classPrivateFieldSet(_isClassicTheme, this, false);
|
187
|
+
_classPrivateFieldGet(_onThemeChange, this).call(this, _classPrivateFieldGet(_themeName, this));
|
174
188
|
_assertClassBrand(_StylesHandler_brand, this, _cacheStylesheetValues).call(this);
|
175
189
|
return;
|
176
190
|
}
|
@@ -179,6 +193,7 @@ class StylesHandler {
|
|
179
193
|
}
|
180
194
|
_classPrivateFieldSet(_themeName, this, themeName);
|
181
195
|
_classPrivateFieldSet(_isClassicTheme, this, false);
|
196
|
+
_classPrivateFieldGet(_onThemeChange, this).call(this, _classPrivateFieldGet(_themeName, this));
|
182
197
|
_assertClassBrand(_StylesHandler_brand, this, _cacheStylesheetValues).call(this);
|
183
198
|
}
|
184
199
|
}
|
@@ -235,7 +250,7 @@ function _getStylesForTD(cssProps) {
|
|
235
250
|
const table = rootDocument.createElement('table');
|
236
251
|
const tbody = rootDocument.createElement('tbody');
|
237
252
|
const tr = rootDocument.createElement('tr');
|
238
|
-
// This needs not to be the first row in order to get "regular"
|
253
|
+
// This needs not to be the first row in order to get "regular" values.
|
239
254
|
const tr2 = rootDocument.createElement('tr');
|
240
255
|
const td = rootDocument.createElement('td');
|
241
256
|
tr2.appendChild(td);
|
package/utils/stylesHandler.mjs
CHANGED
@@ -20,15 +20,23 @@ var _rootDocument = /*#__PURE__*/new WeakMap();
|
|
20
20
|
var _isClassicTheme = /*#__PURE__*/new WeakMap();
|
21
21
|
var _cssVars = /*#__PURE__*/new WeakMap();
|
22
22
|
var _computedStyles = /*#__PURE__*/new WeakMap();
|
23
|
+
var _onThemeChange = /*#__PURE__*/new WeakMap();
|
23
24
|
var _StylesHandler_brand = /*#__PURE__*/new WeakSet();
|
24
25
|
export class StylesHandler {
|
25
26
|
/**
|
26
27
|
* Initializes a new instance of the `StylesHandler` class.
|
27
28
|
*
|
28
|
-
* @param {
|
29
|
-
* @param {
|
29
|
+
* @param {object} options The options for the `StylesHandler` instance.
|
30
|
+
* @param {HTMLElement} options.rootElement The root element of the instance.
|
31
|
+
* @param {Document} options.rootDocument The root document of the instance.
|
32
|
+
* @param {function(string)} options.onThemeChange The callback function to be called when the theme changes.
|
30
33
|
*/
|
31
|
-
constructor(
|
34
|
+
constructor(_ref) {
|
35
|
+
let {
|
36
|
+
rootElement: _rootElement2,
|
37
|
+
rootDocument: _rootDocument2,
|
38
|
+
onThemeChange = () => {}
|
39
|
+
} = _ref;
|
32
40
|
/**
|
33
41
|
* Calculates the row height based on the current theme and CSS variables.
|
34
42
|
*
|
@@ -58,7 +66,6 @@ export class StylesHandler {
|
|
58
66
|
* The root document of the instance.
|
59
67
|
*
|
60
68
|
* @type {Document}
|
61
|
-
* @private
|
62
69
|
*/
|
63
70
|
_classPrivateFieldInitSpec(this, _rootDocument, void 0);
|
64
71
|
/**
|
@@ -71,18 +78,23 @@ export class StylesHandler {
|
|
71
78
|
* An object to store CSS variable values.
|
72
79
|
*
|
73
80
|
* @type {object}
|
74
|
-
* @private
|
75
81
|
*/
|
76
82
|
_classPrivateFieldInitSpec(this, _cssVars, {});
|
77
83
|
/**
|
78
84
|
* Stores the computed styles for various elements.
|
79
85
|
*
|
80
|
-
* @type {object} - An object containing the computed styles if a nested
|
81
|
-
* @private
|
86
|
+
* @type {object} - An object containing the computed styles if a nested structure of `element: { [element type]: {property: value} }`.
|
82
87
|
*/
|
83
88
|
_classPrivateFieldInitSpec(this, _computedStyles, {});
|
89
|
+
/**
|
90
|
+
* The callback function to be called when the theme changes.
|
91
|
+
*
|
92
|
+
* @type {function(string)}
|
93
|
+
*/
|
94
|
+
_classPrivateFieldInitSpec(this, _onThemeChange, void 0);
|
84
95
|
_classPrivateFieldSet(_rootElement, this, _rootElement2);
|
85
96
|
_classPrivateFieldSet(_rootDocument, this, _rootDocument2);
|
97
|
+
_classPrivateFieldSet(_onThemeChange, this, onThemeChange);
|
86
98
|
}
|
87
99
|
|
88
100
|
/**
|
@@ -160,6 +172,7 @@ export class StylesHandler {
|
|
160
172
|
if (!themeName) {
|
161
173
|
_classPrivateFieldSet(_themeName, this, undefined);
|
162
174
|
_classPrivateFieldSet(_isClassicTheme, this, true);
|
175
|
+
_classPrivateFieldGet(_onThemeChange, this).call(this, _classPrivateFieldGet(_themeName, this));
|
163
176
|
_assertClassBrand(_StylesHandler_brand, this, _cacheStylesheetValues).call(this);
|
164
177
|
return;
|
165
178
|
}
|
@@ -168,6 +181,7 @@ export class StylesHandler {
|
|
168
181
|
warn(`Invalid theme name: ${themeName}. Please provide a valid theme name.`);
|
169
182
|
_classPrivateFieldSet(_themeName, this, undefined);
|
170
183
|
_classPrivateFieldSet(_isClassicTheme, this, false);
|
184
|
+
_classPrivateFieldGet(_onThemeChange, this).call(this, _classPrivateFieldGet(_themeName, this));
|
171
185
|
_assertClassBrand(_StylesHandler_brand, this, _cacheStylesheetValues).call(this);
|
172
186
|
return;
|
173
187
|
}
|
@@ -176,6 +190,7 @@ export class StylesHandler {
|
|
176
190
|
}
|
177
191
|
_classPrivateFieldSet(_themeName, this, themeName);
|
178
192
|
_classPrivateFieldSet(_isClassicTheme, this, false);
|
193
|
+
_classPrivateFieldGet(_onThemeChange, this).call(this, _classPrivateFieldGet(_themeName, this));
|
179
194
|
_assertClassBrand(_StylesHandler_brand, this, _cacheStylesheetValues).call(this);
|
180
195
|
}
|
181
196
|
}
|
@@ -231,7 +246,7 @@ function _getStylesForTD(cssProps) {
|
|
231
246
|
const table = rootDocument.createElement('table');
|
232
247
|
const tbody = rootDocument.createElement('tbody');
|
233
248
|
const tr = rootDocument.createElement('tr');
|
234
|
-
// This needs not to be the first row in order to get "regular"
|
249
|
+
// This needs not to be the first row in order to get "regular" values.
|
235
250
|
const tr2 = rootDocument.createElement('tr');
|
236
251
|
const td = rootDocument.createElement('td');
|
237
252
|
tr2.appendChild(td);
|
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.getValueGetterValue = getValueGetterValue;
|
5
|
+
exports.getValueSetterValue = getValueSetterValue;
|
6
|
+
var _function = require("../helpers/function");
|
7
|
+
/**
|
8
|
+
* Get the value to be set in the cell.
|
9
|
+
*
|
10
|
+
* @param {*} value Initial value.
|
11
|
+
* @param {object} cellMeta The cell meta object.
|
12
|
+
* @returns {*} The value to be set in the cell.
|
13
|
+
*/
|
14
|
+
function getValueSetterValue(value, cellMeta) {
|
15
|
+
const {
|
16
|
+
instance,
|
17
|
+
visualRow,
|
18
|
+
visualCol,
|
19
|
+
valueSetter
|
20
|
+
} = cellMeta;
|
21
|
+
if ((0, _function.isFunction)(valueSetter)) {
|
22
|
+
return valueSetter.call(instance, value, visualRow, visualCol, cellMeta);
|
23
|
+
}
|
24
|
+
return value;
|
25
|
+
}
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Get the value to be displayed in the cell.
|
29
|
+
*
|
30
|
+
* @param {*} value Initial value.
|
31
|
+
* @param {object} cellMeta The cell meta object.
|
32
|
+
* @returns {*} The value to be displayed in the cell.
|
33
|
+
*/
|
34
|
+
function getValueGetterValue(value, cellMeta) {
|
35
|
+
const {
|
36
|
+
instance,
|
37
|
+
visualRow,
|
38
|
+
visualCol,
|
39
|
+
valueGetter
|
40
|
+
} = cellMeta;
|
41
|
+
if ((0, _function.isFunction)(valueGetter)) {
|
42
|
+
return valueGetter.call(instance, value, visualRow, visualCol, cellMeta);
|
43
|
+
}
|
44
|
+
return value;
|
45
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { isFunction } from "../helpers/function.mjs";
|
2
|
+
/**
|
3
|
+
* Get the value to be set in the cell.
|
4
|
+
*
|
5
|
+
* @param {*} value Initial value.
|
6
|
+
* @param {object} cellMeta The cell meta object.
|
7
|
+
* @returns {*} The value to be set in the cell.
|
8
|
+
*/
|
9
|
+
export function getValueSetterValue(value, cellMeta) {
|
10
|
+
const {
|
11
|
+
instance,
|
12
|
+
visualRow,
|
13
|
+
visualCol,
|
14
|
+
valueSetter
|
15
|
+
} = cellMeta;
|
16
|
+
if (isFunction(valueSetter)) {
|
17
|
+
return valueSetter.call(instance, value, visualRow, visualCol, cellMeta);
|
18
|
+
}
|
19
|
+
return value;
|
20
|
+
}
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Get the value to be displayed in the cell.
|
24
|
+
*
|
25
|
+
* @param {*} value Initial value.
|
26
|
+
* @param {object} cellMeta The cell meta object.
|
27
|
+
* @returns {*} The value to be displayed in the cell.
|
28
|
+
*/
|
29
|
+
export function getValueGetterValue(value, cellMeta) {
|
30
|
+
const {
|
31
|
+
instance,
|
32
|
+
visualRow,
|
33
|
+
visualCol,
|
34
|
+
valueGetter
|
35
|
+
} = cellMeta;
|
36
|
+
if (isFunction(valueGetter)) {
|
37
|
+
return valueGetter.call(instance, value, visualRow, visualCol, cellMeta);
|
38
|
+
}
|
39
|
+
return value;
|
40
|
+
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.autocompleteValidator = autocompleteValidator;
|
5
|
+
var _object = require("../../helpers/object");
|
5
6
|
const VALIDATOR_TYPE = exports.VALIDATOR_TYPE = 'autocomplete';
|
6
7
|
|
7
8
|
/**
|
@@ -44,7 +45,7 @@ function process(value, callback) {
|
|
44
45
|
return function (source) {
|
45
46
|
let found = false;
|
46
47
|
for (let s = 0, slen = source.length; s < slen; s++) {
|
47
|
-
if (originalVal
|
48
|
+
if ((0, _object.isObjectEqual)(originalVal, source[s])) {
|
48
49
|
found = true; // perfect match
|
49
50
|
break;
|
50
51
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { isObjectEqual } from "../../helpers/object.mjs";
|
1
2
|
export const VALIDATOR_TYPE = 'autocomplete';
|
2
3
|
|
3
4
|
/**
|
@@ -40,7 +41,7 @@ function process(value, callback) {
|
|
40
41
|
return function (source) {
|
41
42
|
let found = false;
|
42
43
|
for (let s = 0, slen = source.length; s < slen; s++) {
|
43
|
-
if (originalVal
|
44
|
+
if (isObjectEqual(originalVal, source[s])) {
|
44
45
|
found = true; // perfect match
|
45
46
|
break;
|
46
47
|
}
|
@@ -1,335 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
5
|
-
var _object = require("../helpers/object");
|
6
|
-
var _localHooks = _interopRequireDefault(require("./../mixins/localHooks"));
|
7
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
8
|
-
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
9
|
-
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
10
|
-
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
11
|
-
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
12
|
-
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
13
|
-
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
14
|
-
/**
|
15
|
-
* The Transformation class implements algorithms for transforming coordinates based on current settings
|
16
|
-
* passed to the Handsontable. The class performs the calculations based on the renderable indexes.
|
17
|
-
*
|
18
|
-
* Transformation is always applied relative to the current selection.
|
19
|
-
*
|
20
|
-
* The class operates on a table size defined by the renderable indexes. If the `navigableHeaders`
|
21
|
-
* option is enabled, the table size is increased by the number of row and/or column headers.
|
22
|
-
* Because the headers are treated as cells as part of the table size (indexes always go from 0 to N),
|
23
|
-
* the algorithm can be written as simply as possible (without new if's that distinguish the headers
|
24
|
-
* logic).
|
25
|
-
*
|
26
|
-
* @class Transformation
|
27
|
-
* @util
|
28
|
-
*/
|
29
|
-
var _range = /*#__PURE__*/new WeakMap();
|
30
|
-
var _options = /*#__PURE__*/new WeakMap();
|
31
|
-
var _offset = /*#__PURE__*/new WeakMap();
|
32
|
-
var _Transformation_brand = /*#__PURE__*/new WeakSet();
|
33
|
-
class Transformation {
|
34
|
-
constructor(range, options) {
|
35
|
-
/**
|
36
|
-
* Clamps the coords to make sure they points to the cell (or header) in the table range.
|
37
|
-
*
|
38
|
-
* @param {CellCoords} zeroBasedCoords The coords object to clamp.
|
39
|
-
* @returns {{rowDir: 1|0|-1, colDir: 1|0|-1}}
|
40
|
-
*/
|
41
|
-
_classPrivateMethodInitSpec(this, _Transformation_brand);
|
42
|
-
/**
|
43
|
-
* Instance of the SelectionRange, holder for visual coordinates applied to the table.
|
44
|
-
*
|
45
|
-
* @type {SelectionRange}
|
46
|
-
*/
|
47
|
-
_classPrivateFieldInitSpec(this, _range, void 0);
|
48
|
-
/**
|
49
|
-
* Additional options which define the state of the settings which can infer transformation and
|
50
|
-
* give the possibility to translate indexes.
|
51
|
-
*
|
52
|
-
* @type {object}
|
53
|
-
*/
|
54
|
-
_classPrivateFieldInitSpec(this, _options, void 0);
|
55
|
-
/**
|
56
|
-
* Increases the table size by applying the offsets. The option is used by the `navigableHeaders`
|
57
|
-
* option.
|
58
|
-
*
|
59
|
-
* @type {{ x: number, y: number }}
|
60
|
-
*/
|
61
|
-
_classPrivateFieldInitSpec(this, _offset, {
|
62
|
-
x: 0,
|
63
|
-
y: 0
|
64
|
-
});
|
65
|
-
_classPrivateFieldSet(_range, this, range);
|
66
|
-
_classPrivateFieldSet(_options, this, options);
|
67
|
-
}
|
68
|
-
|
69
|
-
/**
|
70
|
-
* Selects cell relative to the current cell (if possible).
|
71
|
-
*
|
72
|
-
* @param {number} rowDelta Rows number to move, value can be passed as negative number.
|
73
|
-
* @param {number} colDelta Columns number to move, value can be passed as negative number.
|
74
|
-
* @param {boolean} [createMissingRecords=false] If `true` the new rows/columns will be created if necessary. Otherwise, row/column will
|
75
|
-
* be created according to `minSpareRows/minSpareCols` settings of Handsontable.
|
76
|
-
* @returns {CellCoords} Visual coordinates after transformation.
|
77
|
-
*/
|
78
|
-
transformStart(rowDelta, colDelta) {
|
79
|
-
let createMissingRecords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
80
|
-
const delta = _classPrivateFieldGet(_options, this).createCellCoords(rowDelta, colDelta);
|
81
|
-
let visualCoords = _classPrivateFieldGet(_range, this).current().highlight;
|
82
|
-
const highlightRenderableCoords = _classPrivateFieldGet(_options, this).visualToRenderableCoords(visualCoords);
|
83
|
-
let rowTransformDir = 0;
|
84
|
-
let colTransformDir = 0;
|
85
|
-
this.runLocalHooks('beforeTransformStart', delta);
|
86
|
-
if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null) {
|
87
|
-
const {
|
88
|
-
width,
|
89
|
-
height
|
90
|
-
} = _assertClassBrand(_Transformation_brand, this, _getTableSize).call(this);
|
91
|
-
const {
|
92
|
-
row,
|
93
|
-
col
|
94
|
-
} = _assertClassBrand(_Transformation_brand, this, _visualToZeroBasedCoords).call(this, visualCoords);
|
95
|
-
const fixedRowsBottom = _classPrivateFieldGet(_options, this).fixedRowsBottom();
|
96
|
-
const minSpareRows = _classPrivateFieldGet(_options, this).minSpareRows();
|
97
|
-
const minSpareCols = _classPrivateFieldGet(_options, this).minSpareCols();
|
98
|
-
const autoWrapRow = _classPrivateFieldGet(_options, this).autoWrapRow();
|
99
|
-
const autoWrapCol = _classPrivateFieldGet(_options, this).autoWrapCol();
|
100
|
-
const zeroBasedCoords = _classPrivateFieldGet(_options, this).createCellCoords(row + delta.row, col + delta.col);
|
101
|
-
if (zeroBasedCoords.row >= height) {
|
102
|
-
const isActionInterrupted = (0, _object.createObjectPropListener)(createMissingRecords && minSpareRows > 0 && fixedRowsBottom === 0);
|
103
|
-
const nextColumn = zeroBasedCoords.col + 1;
|
104
|
-
const newCoords = _classPrivateFieldGet(_options, this).createCellCoords(zeroBasedCoords.row - height, nextColumn >= width ? nextColumn - width : nextColumn);
|
105
|
-
this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, newCoords), nextColumn >= width);
|
106
|
-
if (isActionInterrupted.value) {
|
107
|
-
this.runLocalHooks('insertRowRequire', _classPrivateFieldGet(_options, this).countRenderableRows());
|
108
|
-
} else if (autoWrapCol) {
|
109
|
-
zeroBasedCoords.assign(newCoords);
|
110
|
-
}
|
111
|
-
} else if (zeroBasedCoords.row < 0) {
|
112
|
-
const isActionInterrupted = (0, _object.createObjectPropListener)(autoWrapCol);
|
113
|
-
const previousColumn = zeroBasedCoords.col - 1;
|
114
|
-
const newCoords = _classPrivateFieldGet(_options, this).createCellCoords(height + zeroBasedCoords.row, previousColumn < 0 ? width + previousColumn : previousColumn);
|
115
|
-
this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, newCoords), previousColumn < 0);
|
116
|
-
if (autoWrapCol) {
|
117
|
-
zeroBasedCoords.assign(newCoords);
|
118
|
-
}
|
119
|
-
}
|
120
|
-
if (zeroBasedCoords.col >= width) {
|
121
|
-
const isActionInterrupted = (0, _object.createObjectPropListener)(createMissingRecords && minSpareCols > 0);
|
122
|
-
const nextRow = zeroBasedCoords.row + 1;
|
123
|
-
const newCoords = _classPrivateFieldGet(_options, this).createCellCoords(nextRow >= height ? nextRow - height : nextRow, zeroBasedCoords.col - width);
|
124
|
-
this.runLocalHooks('beforeRowWrap', isActionInterrupted, _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, newCoords), nextRow >= height);
|
125
|
-
if (isActionInterrupted.value) {
|
126
|
-
this.runLocalHooks('insertColRequire', _classPrivateFieldGet(_options, this).countRenderableColumns());
|
127
|
-
} else if (autoWrapRow) {
|
128
|
-
zeroBasedCoords.assign(newCoords);
|
129
|
-
}
|
130
|
-
} else if (zeroBasedCoords.col < 0) {
|
131
|
-
const isActionInterrupted = (0, _object.createObjectPropListener)(autoWrapRow);
|
132
|
-
const previousRow = zeroBasedCoords.row - 1;
|
133
|
-
const newCoords = _classPrivateFieldGet(_options, this).createCellCoords(previousRow < 0 ? height + previousRow : previousRow, width + zeroBasedCoords.col);
|
134
|
-
this.runLocalHooks('beforeRowWrap', isActionInterrupted, _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, newCoords), previousRow < 0);
|
135
|
-
if (autoWrapRow) {
|
136
|
-
zeroBasedCoords.assign(newCoords);
|
137
|
-
}
|
138
|
-
}
|
139
|
-
const {
|
140
|
-
rowDir,
|
141
|
-
colDir
|
142
|
-
} = _assertClassBrand(_Transformation_brand, this, _clampCoords).call(this, zeroBasedCoords);
|
143
|
-
rowTransformDir = rowDir;
|
144
|
-
colTransformDir = colDir;
|
145
|
-
visualCoords = _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, zeroBasedCoords);
|
146
|
-
}
|
147
|
-
this.runLocalHooks('afterTransformStart', visualCoords, rowTransformDir, colTransformDir);
|
148
|
-
return visualCoords;
|
149
|
-
}
|
150
|
-
|
151
|
-
/**
|
152
|
-
* Sets selection end cell relative to the current selection end cell (if possible).
|
153
|
-
*
|
154
|
-
* @param {number} rowDelta Rows number to move, value can be passed as negative number.
|
155
|
-
* @param {number} colDelta Columns number to move, value can be passed as negative number.
|
156
|
-
* @returns {CellCoords} Visual coordinates after transformation.
|
157
|
-
*/
|
158
|
-
transformEnd(rowDelta, colDelta) {
|
159
|
-
const delta = _classPrivateFieldGet(_options, this).createCellCoords(rowDelta, colDelta);
|
160
|
-
const cellRange = _classPrivateFieldGet(_range, this).current();
|
161
|
-
const highlightRenderableCoords = _classPrivateFieldGet(_options, this).visualToRenderableCoords(cellRange.highlight);
|
162
|
-
const toRow = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedRow).call(this, cellRange.to.row, cellRange.from.row);
|
163
|
-
const toColumn = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedColumn).call(this, cellRange.to.col, cellRange.from.col);
|
164
|
-
const visualCoords = cellRange.to.clone();
|
165
|
-
let rowTransformDir = 0;
|
166
|
-
let colTransformDir = 0;
|
167
|
-
this.runLocalHooks('beforeTransformEnd', delta);
|
168
|
-
if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null && toRow !== null && toColumn !== null) {
|
169
|
-
const {
|
170
|
-
row: highlightRow,
|
171
|
-
col: highlightColumn
|
172
|
-
} = _assertClassBrand(_Transformation_brand, this, _visualToZeroBasedCoords).call(this, cellRange.highlight);
|
173
|
-
const coords = _classPrivateFieldGet(_options, this).createCellCoords(toRow + delta.row, toColumn + delta.col);
|
174
|
-
const topStartCorner = cellRange.getTopStartCorner();
|
175
|
-
const topEndCorner = cellRange.getTopEndCorner();
|
176
|
-
const bottomEndCorner = cellRange.getBottomEndCorner();
|
177
|
-
if (delta.col < 0 && toColumn >= highlightColumn && coords.col < highlightColumn) {
|
178
|
-
const columnRestDelta = coords.col - highlightColumn;
|
179
|
-
coords.col = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedColumn).call(this, topStartCorner.col, topEndCorner.col) + columnRestDelta;
|
180
|
-
} else if (delta.col > 0 && toColumn <= highlightColumn && coords.col > highlightColumn) {
|
181
|
-
const endColumnIndex = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedColumn).call(this, topEndCorner.col, topStartCorner.col);
|
182
|
-
const columnRestDelta = Math.max(coords.col - endColumnIndex, 1);
|
183
|
-
coords.col = endColumnIndex + columnRestDelta;
|
184
|
-
}
|
185
|
-
if (delta.row < 0 && toRow >= highlightRow && coords.row < highlightRow) {
|
186
|
-
const rowRestDelta = coords.row - highlightRow;
|
187
|
-
coords.row = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedRow).call(this, topStartCorner.row, bottomEndCorner.row) + rowRestDelta;
|
188
|
-
} else if (delta.row > 0 && toRow <= highlightRow && coords.row > highlightRow) {
|
189
|
-
const bottomRowIndex = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedRow).call(this, bottomEndCorner.row, topStartCorner.row);
|
190
|
-
const rowRestDelta = Math.max(coords.row - bottomRowIndex, 1);
|
191
|
-
coords.row = bottomRowIndex + rowRestDelta;
|
192
|
-
}
|
193
|
-
const {
|
194
|
-
rowDir,
|
195
|
-
colDir
|
196
|
-
} = _assertClassBrand(_Transformation_brand, this, _clampCoords).call(this, coords);
|
197
|
-
rowTransformDir = rowDir;
|
198
|
-
colTransformDir = colDir;
|
199
|
-
const newVisualCoords = _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, coords);
|
200
|
-
if (delta.row === 0 && delta.col !== 0) {
|
201
|
-
visualCoords.col = newVisualCoords.col;
|
202
|
-
} else if (delta.row !== 0 && delta.col === 0) {
|
203
|
-
visualCoords.row = newVisualCoords.row;
|
204
|
-
} else {
|
205
|
-
visualCoords.row = newVisualCoords.row;
|
206
|
-
visualCoords.col = newVisualCoords.col;
|
207
|
-
}
|
208
|
-
}
|
209
|
-
this.runLocalHooks('afterTransformEnd', visualCoords, rowTransformDir, colTransformDir);
|
210
|
-
return visualCoords;
|
211
|
-
}
|
212
|
-
|
213
|
-
/**
|
214
|
-
* Sets the additional offset in table size that may occur when the `navigableHeaders` option
|
215
|
-
* is enabled.
|
216
|
-
*
|
217
|
-
* @param {{x: number, y: number}} offset Offset as x and y properties.
|
218
|
-
*/
|
219
|
-
setOffsetSize(_ref) {
|
220
|
-
let {
|
221
|
-
x,
|
222
|
-
y
|
223
|
-
} = _ref;
|
224
|
-
_classPrivateFieldSet(_offset, this, {
|
225
|
-
x,
|
226
|
-
y
|
227
|
-
});
|
228
|
-
}
|
229
|
-
|
230
|
-
/**
|
231
|
-
* Resets the offset size to the default values.
|
232
|
-
*/
|
233
|
-
resetOffsetSize() {
|
234
|
-
_classPrivateFieldSet(_offset, this, {
|
235
|
-
x: 0,
|
236
|
-
y: 0
|
237
|
-
});
|
238
|
-
}
|
239
|
-
}
|
240
|
-
function _clampCoords(zeroBasedCoords) {
|
241
|
-
const {
|
242
|
-
width,
|
243
|
-
height
|
244
|
-
} = _assertClassBrand(_Transformation_brand, this, _getTableSize).call(this);
|
245
|
-
let rowDir = 0;
|
246
|
-
let colDir = 0;
|
247
|
-
if (zeroBasedCoords.row < 0) {
|
248
|
-
rowDir = -1;
|
249
|
-
zeroBasedCoords.row = 0;
|
250
|
-
} else if (zeroBasedCoords.row > 0 && zeroBasedCoords.row >= height) {
|
251
|
-
rowDir = 1;
|
252
|
-
zeroBasedCoords.row = height - 1;
|
253
|
-
}
|
254
|
-
if (zeroBasedCoords.col < 0) {
|
255
|
-
colDir = -1;
|
256
|
-
zeroBasedCoords.col = 0;
|
257
|
-
} else if (zeroBasedCoords.col > 0 && zeroBasedCoords.col >= width) {
|
258
|
-
colDir = 1;
|
259
|
-
zeroBasedCoords.col = width - 1;
|
260
|
-
}
|
261
|
-
return {
|
262
|
-
rowDir,
|
263
|
-
colDir
|
264
|
-
};
|
265
|
-
}
|
266
|
-
/**
|
267
|
-
* Gets the table size in number of rows with headers as "height" and number of columns with
|
268
|
-
* headers as "width".
|
269
|
-
*
|
270
|
-
* @returns {{width: number, height: number}}
|
271
|
-
*/
|
272
|
-
function _getTableSize() {
|
273
|
-
return {
|
274
|
-
width: _classPrivateFieldGet(_offset, this).x + _classPrivateFieldGet(_options, this).countRenderableColumns(),
|
275
|
-
height: _classPrivateFieldGet(_offset, this).y + _classPrivateFieldGet(_options, this).countRenderableRows()
|
276
|
-
};
|
277
|
-
}
|
278
|
-
/**
|
279
|
-
* Finds the first non-hidden zero-based row in the table range.
|
280
|
-
*
|
281
|
-
* @param {number} visualRowFrom The visual row from which the search should start.
|
282
|
-
* @param {number} visualRowTo The visual row to which the search should end.
|
283
|
-
* @returns {number | null}
|
284
|
-
*/
|
285
|
-
function _findFirstNonHiddenZeroBasedRow(visualRowFrom, visualRowTo) {
|
286
|
-
const row = _classPrivateFieldGet(_options, this).findFirstNonHiddenRenderableRow(visualRowFrom, visualRowTo);
|
287
|
-
if (row === null) {
|
288
|
-
return null;
|
289
|
-
}
|
290
|
-
return _classPrivateFieldGet(_offset, this).y + row;
|
291
|
-
}
|
292
|
-
/**
|
293
|
-
* Finds the first non-hidden zero-based column in the table range.
|
294
|
-
*
|
295
|
-
* @param {number} visualColumnFrom The visual column from which the search should start.
|
296
|
-
* @param {number} visualColumnTo The visual column to which the search should end.
|
297
|
-
* @returns {number | null}
|
298
|
-
*/
|
299
|
-
function _findFirstNonHiddenZeroBasedColumn(visualColumnFrom, visualColumnTo) {
|
300
|
-
const column = _classPrivateFieldGet(_options, this).findFirstNonHiddenRenderableColumn(visualColumnFrom, visualColumnTo);
|
301
|
-
if (column === null) {
|
302
|
-
return null;
|
303
|
-
}
|
304
|
-
return _classPrivateFieldGet(_offset, this).x + column;
|
305
|
-
}
|
306
|
-
/**
|
307
|
-
* Translates the visual coordinates to zero-based ones.
|
308
|
-
*
|
309
|
-
* @param {CellCoords} visualCoords The visual coords to process.
|
310
|
-
* @returns {CellCoords}
|
311
|
-
*/
|
312
|
-
function _visualToZeroBasedCoords(visualCoords) {
|
313
|
-
const {
|
314
|
-
row,
|
315
|
-
col
|
316
|
-
} = _classPrivateFieldGet(_options, this).visualToRenderableCoords(visualCoords);
|
317
|
-
if (row === null || col === null) {
|
318
|
-
throw new Error('Renderable coords are not visible.');
|
319
|
-
}
|
320
|
-
return _classPrivateFieldGet(_options, this).createCellCoords(_classPrivateFieldGet(_offset, this).y + row, _classPrivateFieldGet(_offset, this).x + col);
|
321
|
-
}
|
322
|
-
/**
|
323
|
-
* Translates the zero-based coordinates to visual ones.
|
324
|
-
*
|
325
|
-
* @param {CellCoords} zeroBasedCoords The coordinates to process.
|
326
|
-
* @returns {CellCoords}
|
327
|
-
*/
|
328
|
-
function _zeroBasedToVisualCoords(zeroBasedCoords) {
|
329
|
-
const coords = zeroBasedCoords.clone();
|
330
|
-
coords.col = zeroBasedCoords.col - _classPrivateFieldGet(_offset, this).x;
|
331
|
-
coords.row = zeroBasedCoords.row - _classPrivateFieldGet(_offset, this).y;
|
332
|
-
return _classPrivateFieldGet(_options, this).renderableToVisualCoords(coords);
|
333
|
-
}
|
334
|
-
(0, _object.mixin)(Transformation, _localHooks.default);
|
335
|
-
var _default = exports.default = Transformation;
|