handsontable 9.0.1 → 11.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/3rdparty/autoResize/autoResize.js +2 -0
- package/3rdparty/autoResize/autoResize.mjs +1 -0
- package/3rdparty/walkontable/src/border.js +3 -1
- package/3rdparty/walkontable/src/border.mjs +2 -1
- package/3rdparty/walkontable/src/calculator/constants.js +1 -1
- package/3rdparty/walkontable/src/calculator/index.js +2 -0
- package/3rdparty/walkontable/src/calculator/viewportColumns.d.ts +18 -0
- package/3rdparty/walkontable/src/cell/coords.d.ts +16 -0
- package/3rdparty/walkontable/src/cell/range.d.ts +51 -0
- package/3rdparty/walkontable/src/index.d.ts +1 -0
- package/3rdparty/walkontable/src/overlay/bottom.js +3 -3
- package/3rdparty/walkontable/src/overlay/bottom.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/bottomLeftCorner.js +3 -3
- package/3rdparty/walkontable/src/overlay/bottomLeftCorner.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/constants.js +1 -1
- package/3rdparty/walkontable/src/overlay/index.js +2 -0
- package/3rdparty/walkontable/src/overlay/left.js +3 -3
- package/3rdparty/walkontable/src/overlay/left.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/registerer.js +1 -1
- package/3rdparty/walkontable/src/overlay/top.js +3 -3
- package/3rdparty/walkontable/src/overlay/top.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/topLeftCorner.js +3 -3
- package/3rdparty/walkontable/src/overlay/topLeftCorner.mjs +2 -2
- package/3rdparty/walkontable/src/overlays.js +2 -0
- package/3rdparty/walkontable/src/overlays.mjs +1 -0
- package/3rdparty/walkontable/src/renderer/cells.js +1 -1
- package/3rdparty/walkontable/src/renderer/cells.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/colGroup.js +3 -3
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +3 -3
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +1 -1
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/rows.js +3 -3
- package/3rdparty/walkontable/src/renderer/rows.mjs +2 -2
- package/3rdparty/walkontable/src/selection.js +5 -3
- package/3rdparty/walkontable/src/selection.mjs +3 -2
- package/3rdparty/walkontable/src/table/bottom.js +3 -3
- package/3rdparty/walkontable/src/table/bottom.mjs +2 -2
- package/3rdparty/walkontable/src/table/bottomLeftCorner.js +3 -3
- package/3rdparty/walkontable/src/table/bottomLeftCorner.mjs +2 -2
- package/3rdparty/walkontable/src/table/left.js +3 -3
- package/3rdparty/walkontable/src/table/left.mjs +2 -2
- package/3rdparty/walkontable/src/table/master.js +3 -3
- package/3rdparty/walkontable/src/table/master.mjs +2 -2
- package/3rdparty/walkontable/src/table/top.js +3 -3
- package/3rdparty/walkontable/src/table/top.mjs +2 -2
- package/3rdparty/walkontable/src/table/topLeftCorner.js +3 -3
- package/3rdparty/walkontable/src/table/topLeftCorner.mjs +2 -2
- package/3rdparty/walkontable/src/table.js +5 -3
- package/3rdparty/walkontable/src/table.mjs +3 -2
- package/3rdparty/walkontable/src/utils/orderView/constants.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/sharedView.js +3 -3
- package/3rdparty/walkontable/src/utils/orderView/sharedView.mjs +2 -2
- package/CHANGELOG.md +72 -0
- package/LICENSE.txt +19 -22
- package/README.md +2 -1
- package/base.d.ts +1 -1
- package/base.js +16 -3
- package/base.mjs +14 -4
- package/cellTypes/autocompleteType/autocompleteType.d.ts +17 -0
- package/cellTypes/autocompleteType/autocompleteType.js +1 -1
- package/cellTypes/autocompleteType/index.d.ts +1 -0
- package/cellTypes/base.d.ts +14 -0
- package/cellTypes/checkboxType/checkboxType.d.ts +14 -0
- package/cellTypes/checkboxType/index.d.ts +1 -0
- package/cellTypes/dateType/dateType.d.ts +17 -0
- package/cellTypes/dateType/index.d.ts +1 -0
- package/cellTypes/dropdownType/dropdownType.d.ts +17 -0
- package/cellTypes/dropdownType/index.d.ts +1 -0
- package/cellTypes/handsontableType/handsontableType.d.ts +14 -0
- package/cellTypes/handsontableType/index.d.ts +1 -0
- package/cellTypes/index.d.ts +47 -0
- package/cellTypes/index.js +18 -2
- package/cellTypes/index.mjs +26 -9
- package/cellTypes/numericType/index.d.ts +1 -0
- package/cellTypes/numericType/numericType.d.ts +17 -0
- package/cellTypes/passwordType/index.d.ts +1 -0
- package/cellTypes/passwordType/passwordType.d.ts +14 -0
- package/cellTypes/registry.d.ts +18 -0
- package/cellTypes/registry.js +2 -2
- package/cellTypes/textType/index.d.ts +1 -0
- package/cellTypes/textType/textType.d.ts +14 -0
- package/cellTypes/timeType/index.d.ts +1 -0
- package/cellTypes/timeType/timeType.d.ts +17 -0
- package/common.d.ts +74 -0
- package/core.d.ts +159 -0
- package/core.js +143 -103
- package/core.mjs +141 -103
- package/{dataMap.js → dataMap/dataMap.js} +37 -35
- package/{dataMap.mjs → dataMap/dataMap.mjs} +37 -35
- package/dataMap/index.js +5 -1
- package/dataMap/index.mjs +3 -2
- package/dataMap/metaManager/index.js +54 -6
- package/dataMap/metaManager/index.mjs +51 -6
- package/dataMap/metaManager/lazyFactoryMap.js +3 -3
- package/dataMap/metaManager/lazyFactoryMap.mjs +3 -3
- package/dataMap/metaManager/metaLayers/cellMeta.js +2 -0
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -0
- package/dataMap/metaManager/metaLayers/globalMeta.js +2 -1
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +2 -1
- package/dataMap/metaManager/metaSchema.js +2331 -871
- package/dataMap/metaManager/metaSchema.mjs +2331 -871
- package/dataMap/metaManager/mods/dynamicCellMeta.js +136 -0
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +119 -0
- package/dataMap/metaManager/utils.js +3 -3
- package/dataSource.js +2 -0
- package/dataSource.mjs +1 -0
- package/dist/handsontable.css +309 -303
- package/dist/handsontable.full.css +309 -303
- package/dist/handsontable.full.js +50435 -45020
- package/dist/handsontable.full.min.css +25 -28
- package/dist/handsontable.full.min.js +181 -164
- package/dist/handsontable.js +31234 -28030
- package/dist/handsontable.min.css +25 -28
- package/dist/handsontable.min.js +22 -25
- package/editorManager.js +15 -12
- package/editorManager.mjs +15 -13
- package/editors/autocompleteEditor/autocompleteEditor.d.ts +29 -0
- package/editors/autocompleteEditor/autocompleteEditor.js +91 -87
- package/editors/autocompleteEditor/autocompleteEditor.mjs +89 -84
- package/editors/autocompleteEditor/index.d.ts +1 -0
- package/editors/autocompleteEditor/index.js +1 -1
- package/editors/baseEditor/baseEditor.d.ts +45 -0
- package/editors/baseEditor/baseEditor.js +8 -7
- package/editors/baseEditor/baseEditor.mjs +5 -5
- package/editors/baseEditor/index.d.ts +1 -0
- package/editors/baseEditor/index.js +1 -1
- package/editors/checkboxEditor/checkboxEditor.d.ts +12 -0
- package/editors/checkboxEditor/checkboxEditor.js +4 -4
- package/editors/checkboxEditor/checkboxEditor.mjs +2 -2
- package/editors/checkboxEditor/index.d.ts +1 -0
- package/editors/checkboxEditor/index.js +1 -1
- package/editors/dateEditor/dateEditor.d.ts +18 -0
- package/editors/dateEditor/dateEditor.js +20 -20
- package/editors/dateEditor/dateEditor.mjs +19 -19
- package/editors/dateEditor/index.d.ts +1 -0
- package/editors/dateEditor/index.js +1 -1
- package/editors/dropdownEditor/dropdownEditor.d.ts +7 -0
- package/editors/dropdownEditor/dropdownEditor.js +5 -5
- package/editors/dropdownEditor/dropdownEditor.mjs +3 -3
- package/editors/dropdownEditor/index.d.ts +1 -0
- package/editors/dropdownEditor/index.js +1 -1
- package/editors/handsontableEditor/handsontableEditor.d.ts +10 -0
- package/editors/handsontableEditor/handsontableEditor.js +4 -4
- package/editors/handsontableEditor/handsontableEditor.mjs +3 -3
- package/editors/handsontableEditor/index.d.ts +1 -0
- package/editors/index.d.ts +53 -0
- package/editors/index.js +19 -2
- package/editors/index.mjs +28 -10
- package/editors/numericEditor/index.d.ts +1 -0
- package/editors/numericEditor/numericEditor.d.ts +7 -0
- package/editors/numericEditor/numericEditor.js +3 -3
- package/editors/numericEditor/numericEditor.mjs +2 -2
- package/editors/passwordEditor/index.d.ts +1 -0
- package/editors/passwordEditor/passwordEditor.d.ts +7 -0
- package/editors/passwordEditor/passwordEditor.js +4 -4
- package/editors/passwordEditor/passwordEditor.mjs +3 -3
- package/editors/registry.d.ts +29 -0
- package/editors/registry.js +2 -2
- package/editors/selectEditor/index.d.ts +1 -0
- package/editors/selectEditor/selectEditor.d.ts +16 -0
- package/editors/selectEditor/selectEditor.js +4 -4
- package/editors/selectEditor/selectEditor.mjs +3 -3
- package/editors/textEditor/index.d.ts +1 -0
- package/editors/textEditor/textEditor.d.ts +24 -0
- package/editors/textEditor/textEditor.js +4 -4
- package/editors/textEditor/textEditor.mjs +3 -3
- package/eventManager.d.ts +13 -0
- package/eventManager.js +1 -1
- package/handsontable-non-commercial-license.pdf +0 -0
- package/helpers/array.d.ts +18 -0
- package/helpers/array.js +10 -10
- package/helpers/array.mjs +1 -1
- package/helpers/browser.d.ts +25 -0
- package/helpers/browser.js +11 -9
- package/helpers/browser.mjs +1 -0
- package/helpers/console.d.ts +4 -0
- package/helpers/console.js +2 -2
- package/helpers/data.d.ts +13 -0
- package/helpers/data.js +7 -35
- package/helpers/data.mjs +1 -27
- package/helpers/date.d.ts +1 -0
- package/helpers/dom/element.d.ts +49 -0
- package/helpers/dom/element.js +44 -45
- package/helpers/dom/element.mjs +7 -8
- package/helpers/dom/event.d.ts +4 -0
- package/helpers/dom/event.js +2 -2
- package/helpers/dom/index.d.ts +2 -0
- package/helpers/feature.d.ts +11 -0
- package/helpers/feature.js +6 -6
- package/helpers/function.d.ts +10 -0
- package/helpers/function.js +43 -5
- package/helpers/function.mjs +35 -0
- package/helpers/index.d.ts +14 -0
- package/helpers/mixed.d.ts +5 -0
- package/helpers/mixed.js +5 -5
- package/helpers/mixed.mjs +2 -2
- package/helpers/number.d.ts +5 -0
- package/helpers/number.js +96 -17
- package/helpers/number.mjs +85 -17
- package/helpers/object.d.ts +16 -0
- package/helpers/object.js +11 -11
- package/helpers/string.d.ts +7 -0
- package/helpers/string.js +4 -4
- package/helpers/templateLiteralTag.d.ts +1 -0
- package/helpers/unicode.d.ts +73 -0
- package/helpers/unicode.js +49 -33
- package/helpers/unicode.mjs +44 -27
- package/i18n/constants.js +1 -1
- package/i18n/index.d.ts +2 -0
- package/i18n/index.js +2 -0
- package/i18n/languages/de-CH.d.ts +5 -0
- package/i18n/languages/de-DE.d.ts +5 -0
- package/i18n/languages/en-US.d.ts +5 -0
- package/i18n/languages/es-MX.d.ts +5 -0
- package/i18n/languages/fr-FR.d.ts +5 -0
- package/i18n/languages/index.d.ts +35 -0
- package/i18n/languages/it-IT.d.ts +5 -0
- package/i18n/languages/ja-JP.d.ts +5 -0
- package/i18n/languages/ko-KR.d.ts +5 -0
- package/i18n/languages/lv-LV.d.ts +5 -0
- package/i18n/languages/nb-NO.d.ts +5 -0
- package/i18n/languages/nl-NL.d.ts +5 -0
- package/i18n/languages/pl-PL.d.ts +5 -0
- package/i18n/languages/pt-BR.d.ts +5 -0
- package/i18n/languages/ru-RU.d.ts +5 -0
- package/i18n/languages/zh-CN.d.ts +5 -0
- package/i18n/languages/zh-TW.d.ts +5 -0
- package/i18n/phraseFormatters/index.js +1 -1
- package/i18n/registry.d.ts +13 -0
- package/i18n/registry.js +4 -4
- package/i18n/utils.js +1 -1
- package/index.d.ts +516 -0
- package/index.js +40 -112
- package/index.mjs +17 -90
- package/mixins/localHooks.js +17 -14
- package/mixins/localHooks.mjs +16 -13
- package/package.json +103 -10
- package/pluginHooks.d.ts +255 -0
- package/pluginHooks.js +132 -57
- package/pluginHooks.mjs +131 -57
- package/plugins/autoColumnSize/autoColumnSize.d.ts +27 -0
- package/plugins/autoColumnSize/autoColumnSize.js +20 -13
- package/plugins/autoColumnSize/autoColumnSize.mjs +18 -12
- package/plugins/autoColumnSize/index.d.ts +1 -0
- package/plugins/autoColumnSize/index.js +1 -1
- package/plugins/autoRowSize/autoRowSize.d.ts +27 -0
- package/plugins/autoRowSize/autoRowSize.js +22 -14
- package/plugins/autoRowSize/autoRowSize.mjs +19 -12
- package/plugins/autoRowSize/index.d.ts +1 -0
- package/plugins/autoRowSize/index.js +1 -1
- package/plugins/autofill/autofill.d.ts +18 -0
- package/plugins/autofill/autofill.js +10 -19
- package/plugins/autofill/autofill.mjs +7 -16
- package/plugins/autofill/index.d.ts +1 -0
- package/plugins/autofill/index.js +1 -1
- package/plugins/autofill/utils.js +1 -1
- package/plugins/base/base.d.ts +21 -0
- package/plugins/base/base.js +2 -2
- package/plugins/base/base.mjs +1 -1
- package/plugins/base/index.d.ts +1 -0
- package/plugins/base/index.js +1 -1
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.d.ts +9 -0
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +4 -3
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +3 -2
- package/plugins/bindRowsWithHeaders/index.d.ts +1 -0
- package/plugins/bindRowsWithHeaders/index.js +1 -1
- package/plugins/bindRowsWithHeaders/maps/looseBindsMap.js +4 -4
- package/plugins/bindRowsWithHeaders/maps/looseBindsMap.mjs +3 -3
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.js +6 -4
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.mjs +4 -3
- package/plugins/collapsibleColumns/collapsibleColumns.d.ts +22 -0
- package/plugins/collapsibleColumns/collapsibleColumns.js +13 -6
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +11 -5
- package/plugins/collapsibleColumns/index.d.ts +1 -0
- package/plugins/collapsibleColumns/index.js +1 -1
- package/plugins/columnSorting/columnSorting.d.ts +30 -0
- package/plugins/columnSorting/columnSorting.js +19 -14
- package/plugins/columnSorting/columnSorting.mjs +16 -12
- package/plugins/columnSorting/columnStatesManager.js +5 -3
- package/plugins/columnSorting/columnStatesManager.mjs +4 -3
- package/plugins/columnSorting/index.d.ts +1 -0
- package/plugins/columnSorting/index.js +1 -1
- package/plugins/columnSorting/rootComparator.js +2 -0
- package/plugins/columnSorting/rootComparator.mjs +1 -0
- package/plugins/columnSorting/sortFunction/checkbox.js +1 -1
- package/plugins/columnSorting/sortFunction/date.js +1 -1
- package/plugins/columnSorting/sortFunction/default.js +4 -3
- package/plugins/columnSorting/sortFunction/default.mjs +3 -2
- package/plugins/columnSorting/sortFunction/numeric.js +1 -1
- package/plugins/columnSorting/sortService/engine.js +1 -1
- package/plugins/columnSorting/sortService/registry.js +1 -1
- package/plugins/columnSorting/utils.js +4 -4
- package/plugins/columnSorting/utils.mjs +1 -1
- package/plugins/columnSummary/columnSummary.d.ts +72 -0
- package/plugins/columnSummary/columnSummary.js +31 -12
- package/plugins/columnSummary/columnSummary.mjs +29 -10
- package/plugins/columnSummary/endpoints.js +6 -4
- package/plugins/columnSummary/endpoints.mjs +5 -4
- package/plugins/columnSummary/index.d.ts +1 -0
- package/plugins/columnSummary/index.js +1 -1
- package/plugins/comments/commentEditor.js +1 -1
- package/plugins/comments/commentEditor.mjs +1 -1
- package/plugins/comments/comments.d.ts +50 -0
- package/plugins/comments/comments.js +11 -6
- package/plugins/comments/comments.mjs +10 -5
- package/plugins/comments/displaySwitch.js +1 -1
- package/plugins/comments/displaySwitch.mjs +1 -1
- package/plugins/comments/index.d.ts +1 -0
- package/plugins/comments/index.js +1 -1
- package/plugins/contextMenu/commandExecutor.js +1 -1
- package/plugins/contextMenu/commandExecutor.mjs +1 -1
- package/plugins/contextMenu/contextMenu.d.ts +65 -0
- package/plugins/contextMenu/contextMenu.js +8 -7
- package/plugins/contextMenu/contextMenu.mjs +6 -5
- package/plugins/contextMenu/cursor.js +1 -1
- package/plugins/contextMenu/cursor.mjs +1 -1
- package/plugins/contextMenu/index.d.ts +1 -0
- package/plugins/contextMenu/index.js +1 -1
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu.js +4 -4
- package/plugins/contextMenu/menu.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/alignment.js +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/columnLeft.js +1 -1
- package/plugins/contextMenu/predefinedItems/columnRight.js +1 -1
- package/plugins/contextMenu/predefinedItems/noItems.js +1 -1
- package/plugins/contextMenu/predefinedItems/readOnly.js +1 -1
- package/plugins/contextMenu/predefinedItems/redo.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.js +4 -2
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +2 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +4 -2
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +2 -1
- package/plugins/contextMenu/predefinedItems/rowAbove.js +1 -1
- package/plugins/contextMenu/predefinedItems/rowBelow.js +1 -1
- package/plugins/contextMenu/predefinedItems/separator.js +1 -1
- package/plugins/contextMenu/predefinedItems/undo.js +1 -1
- package/plugins/contextMenu/predefinedItems.js +2 -2
- package/plugins/contextMenu/utils.js +10 -10
- package/plugins/copyPaste/clipboardData.js +3 -0
- package/plugins/copyPaste/clipboardData.mjs +3 -0
- package/plugins/copyPaste/copyPaste.d.ts +35 -0
- package/plugins/copyPaste/copyPaste.js +13 -10
- package/plugins/copyPaste/copyPaste.mjs +11 -9
- package/plugins/copyPaste/focusableElement.js +1 -2
- package/plugins/copyPaste/focusableElement.mjs +1 -2
- package/plugins/copyPaste/index.d.ts +1 -0
- package/plugins/copyPaste/index.js +1 -1
- package/plugins/copyPaste/pasteEvent.js +3 -0
- package/plugins/copyPaste/pasteEvent.mjs +3 -0
- package/plugins/customBorders/customBorders.d.ts +38 -0
- package/plugins/customBorders/customBorders.js +11 -9
- package/plugins/customBorders/customBorders.mjs +8 -7
- package/plugins/customBorders/index.d.ts +1 -0
- package/plugins/customBorders/index.js +1 -1
- package/plugins/customBorders/utils.js +3 -3
- package/plugins/dragToScroll/dragToScroll.d.ts +15 -0
- package/plugins/dragToScroll/dragToScroll.js +5 -5
- package/plugins/dragToScroll/dragToScroll.mjs +3 -3
- package/plugins/dragToScroll/index.d.ts +1 -0
- package/plugins/dragToScroll/index.js +1 -1
- package/plugins/dropdownMenu/dropdownMenu.d.ts +24 -0
- package/plugins/dropdownMenu/dropdownMenu.js +9 -9
- package/plugins/dropdownMenu/dropdownMenu.mjs +7 -7
- package/plugins/dropdownMenu/index.d.ts +1 -0
- package/plugins/dropdownMenu/index.js +1 -1
- package/plugins/exportFile/dataProvider.js +3 -5
- package/plugins/exportFile/dataProvider.mjs +3 -5
- package/plugins/exportFile/exportFile.d.ts +12 -0
- package/plugins/exportFile/exportFile.js +6 -5
- package/plugins/exportFile/exportFile.mjs +4 -3
- package/plugins/exportFile/index.d.ts +1 -0
- package/plugins/exportFile/index.js +1 -1
- package/plugins/exportFile/typeFactory.js +2 -1
- package/plugins/exportFile/typeFactory.mjs +1 -0
- package/plugins/exportFile/types/_base.js +0 -1
- package/plugins/exportFile/types/_base.mjs +0 -1
- package/plugins/exportFile/types/csv.js +3 -4
- package/plugins/exportFile/types/csv.mjs +2 -3
- package/plugins/filters/component/_base.js +1 -1
- package/plugins/filters/component/_base.mjs +1 -1
- package/plugins/filters/component/actionBar.js +4 -4
- package/plugins/filters/component/actionBar.mjs +3 -3
- package/plugins/filters/component/condition.js +7 -5
- package/plugins/filters/component/condition.mjs +5 -4
- package/plugins/filters/component/operators.js +4 -4
- package/plugins/filters/component/operators.mjs +3 -3
- package/plugins/filters/component/value.js +13 -6
- package/plugins/filters/component/value.mjs +11 -5
- package/plugins/filters/condition/beginsWith.js +5 -3
- package/plugins/filters/condition/beginsWith.mjs +3 -2
- package/plugins/filters/condition/between.js +4 -2
- package/plugins/filters/condition/between.mjs +2 -1
- package/plugins/filters/condition/byValue.js +4 -2
- package/plugins/filters/condition/byValue.mjs +2 -1
- package/plugins/filters/condition/contains.js +5 -3
- package/plugins/filters/condition/contains.mjs +3 -2
- package/plugins/filters/condition/date/after.js +4 -2
- package/plugins/filters/condition/date/after.mjs +2 -1
- package/plugins/filters/condition/date/before.js +4 -2
- package/plugins/filters/condition/date/before.mjs +2 -1
- package/plugins/filters/condition/date/today.js +1 -1
- package/plugins/filters/condition/date/tomorrow.js +1 -1
- package/plugins/filters/condition/date/yesterday.js +1 -1
- package/plugins/filters/condition/empty.js +1 -1
- package/plugins/filters/condition/endsWith.js +5 -3
- package/plugins/filters/condition/endsWith.mjs +3 -2
- package/plugins/filters/condition/equal.js +5 -3
- package/plugins/filters/condition/equal.mjs +3 -2
- package/plugins/filters/condition/false.js +1 -1
- package/plugins/filters/condition/greaterThan.js +4 -2
- package/plugins/filters/condition/greaterThan.mjs +2 -1
- package/plugins/filters/condition/greaterThanOrEqual.js +4 -2
- package/plugins/filters/condition/greaterThanOrEqual.mjs +2 -1
- package/plugins/filters/condition/lessThan.js +4 -2
- package/plugins/filters/condition/lessThan.mjs +2 -1
- package/plugins/filters/condition/lessThanOrEqual.js +4 -2
- package/plugins/filters/condition/lessThanOrEqual.mjs +2 -1
- package/plugins/filters/condition/none.js +1 -1
- package/plugins/filters/condition/notBetween.js +1 -1
- package/plugins/filters/condition/notContains.js +1 -1
- package/plugins/filters/condition/notEmpty.js +1 -1
- package/plugins/filters/condition/notEqual.js +1 -1
- package/plugins/filters/condition/true.js +1 -1
- package/plugins/filters/conditionCollection.d.ts +32 -0
- package/plugins/filters/conditionCollection.js +8 -5
- package/plugins/filters/conditionCollection.mjs +6 -4
- package/plugins/filters/conditionRegisterer.js +1 -1
- package/plugins/filters/conditionUpdateObserver.d.ts +10 -0
- package/plugins/filters/conditionUpdateObserver.js +3 -1
- package/plugins/filters/conditionUpdateObserver.mjs +2 -1
- package/plugins/filters/constants.js +2 -1
- package/plugins/filters/constants.mjs +1 -0
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.d.ts +56 -0
- package/plugins/filters/filters.js +19 -14
- package/plugins/filters/filters.mjs +17 -13
- package/plugins/filters/index.d.ts +1 -0
- package/plugins/filters/index.js +1 -1
- package/plugins/filters/logicalOperationRegisterer.js +1 -1
- package/plugins/filters/logicalOperations/conjunction.js +3 -3
- package/plugins/filters/logicalOperations/conjunction.mjs +1 -0
- package/plugins/filters/logicalOperations/disjunction.js +3 -3
- package/plugins/filters/logicalOperations/disjunction.mjs +1 -0
- package/plugins/filters/logicalOperations/disjunctionWithExtraCondition.js +3 -3
- package/plugins/filters/logicalOperations/disjunctionWithExtraCondition.mjs +1 -0
- package/plugins/filters/ui/_base.js +2 -3
- package/plugins/filters/ui/_base.mjs +2 -3
- package/plugins/filters/ui/input.js +3 -3
- package/plugins/filters/ui/input.mjs +3 -3
- package/plugins/filters/ui/link.js +3 -3
- package/plugins/filters/ui/link.mjs +3 -3
- package/plugins/filters/ui/multipleSelect.js +31 -5
- package/plugins/filters/ui/multipleSelect.mjs +30 -5
- package/plugins/filters/ui/radioInput.js +3 -3
- package/plugins/filters/ui/radioInput.mjs +3 -3
- package/plugins/filters/ui/select.js +3 -3
- package/plugins/filters/ui/select.mjs +3 -3
- package/plugins/filters/utils.js +3 -3
- package/plugins/formulas/engine/register.js +3 -3
- package/plugins/formulas/engine/settings.js +4 -4
- package/plugins/formulas/engine/settings.mjs +2 -3
- package/plugins/formulas/formulas.d.ts +31 -0
- package/plugins/formulas/formulas.js +286 -89
- package/plugins/formulas/formulas.mjs +279 -86
- package/plugins/formulas/index.d.ts +1 -0
- package/plugins/formulas/index.js +1 -1
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +3 -1
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +2 -1
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +4 -2
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +2 -1
- package/plugins/hiddenColumns/hiddenColumns.d.ts +21 -0
- package/plugins/hiddenColumns/hiddenColumns.js +37 -24
- package/plugins/hiddenColumns/hiddenColumns.mjs +36 -23
- package/plugins/hiddenColumns/index.d.ts +1 -0
- package/plugins/hiddenColumns/index.js +1 -1
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +3 -1
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +2 -1
- package/plugins/hiddenRows/contextMenuItem/showRow.js +4 -2
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +2 -1
- package/plugins/hiddenRows/hiddenRows.d.ts +21 -0
- package/plugins/hiddenRows/hiddenRows.js +37 -25
- package/plugins/hiddenRows/hiddenRows.mjs +36 -24
- package/plugins/hiddenRows/index.d.ts +1 -0
- package/plugins/hiddenRows/index.js +1 -1
- package/plugins/index.d.ts +111 -0
- package/plugins/index.js +98 -58
- package/plugins/index.mjs +75 -34
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +3 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +2 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +3 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +2 -1
- package/plugins/manualColumnFreeze/index.d.ts +1 -0
- package/plugins/manualColumnFreeze/index.js +1 -1
- package/plugins/manualColumnFreeze/manualColumnFreeze.d.ts +11 -0
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +11 -6
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +10 -5
- package/plugins/manualColumnMove/index.d.ts +1 -0
- package/plugins/manualColumnMove/index.js +1 -1
- package/plugins/manualColumnMove/manualColumnMove.d.ts +14 -0
- package/plugins/manualColumnMove/manualColumnMove.js +28 -23
- package/plugins/manualColumnMove/manualColumnMove.mjs +27 -22
- package/plugins/manualColumnMove/ui/_base.js +1 -1
- package/plugins/manualColumnMove/ui/_base.mjs +1 -1
- package/plugins/manualColumnMove/ui/backlight.js +4 -4
- package/plugins/manualColumnMove/ui/backlight.mjs +3 -3
- package/plugins/manualColumnMove/ui/guideline.js +4 -4
- package/plugins/manualColumnMove/ui/guideline.mjs +3 -3
- package/plugins/manualColumnResize/index.d.ts +1 -0
- package/plugins/manualColumnResize/index.js +1 -1
- package/plugins/manualColumnResize/manualColumnResize.d.ts +30 -0
- package/plugins/manualColumnResize/manualColumnResize.js +7 -6
- package/plugins/manualColumnResize/manualColumnResize.mjs +6 -5
- package/plugins/manualRowMove/index.d.ts +1 -0
- package/plugins/manualRowMove/index.js +1 -1
- package/plugins/manualRowMove/manualRowMove.d.ts +14 -0
- package/plugins/manualRowMove/manualRowMove.js +25 -22
- package/plugins/manualRowMove/manualRowMove.mjs +24 -21
- package/plugins/manualRowMove/ui/_base.js +1 -2
- package/plugins/manualRowMove/ui/_base.mjs +1 -2
- package/plugins/manualRowMove/ui/backlight.js +5 -5
- package/plugins/manualRowMove/ui/backlight.mjs +4 -4
- package/plugins/manualRowMove/ui/guideline.js +5 -5
- package/plugins/manualRowMove/ui/guideline.mjs +4 -4
- package/plugins/manualRowResize/index.d.ts +1 -0
- package/plugins/manualRowResize/index.js +1 -1
- package/plugins/manualRowResize/manualRowResize.d.ts +29 -0
- package/plugins/manualRowResize/manualRowResize.js +6 -5
- package/plugins/manualRowResize/manualRowResize.mjs +5 -4
- package/plugins/mergeCells/calculations/autofill.js +4 -3
- package/plugins/mergeCells/calculations/autofill.mjs +3 -3
- package/plugins/mergeCells/calculations/selection.js +1 -2
- package/plugins/mergeCells/calculations/selection.mjs +1 -2
- package/plugins/mergeCells/cellCoords.js +1 -1
- package/plugins/mergeCells/cellCoords.mjs +1 -1
- package/plugins/mergeCells/cellsCollection.js +5 -3
- package/plugins/mergeCells/cellsCollection.mjs +4 -3
- package/plugins/mergeCells/index.d.ts +1 -0
- package/plugins/mergeCells/index.js +1 -1
- package/plugins/mergeCells/mergeCells.d.ts +22 -0
- package/plugins/mergeCells/mergeCells.js +7 -4
- package/plugins/mergeCells/mergeCells.mjs +5 -3
- package/plugins/multiColumnSorting/domHelpers.js +2 -0
- package/plugins/multiColumnSorting/domHelpers.mjs +1 -0
- package/plugins/multiColumnSorting/index.d.ts +1 -0
- package/plugins/multiColumnSorting/index.js +1 -1
- package/plugins/multiColumnSorting/multiColumnSorting.d.ts +8 -0
- package/plugins/multiColumnSorting/multiColumnSorting.js +11 -8
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +9 -6
- package/plugins/multiColumnSorting/rootComparator.js +2 -0
- package/plugins/multiColumnSorting/rootComparator.mjs +1 -0
- package/plugins/multipleSelectionHandles/index.d.ts +1 -0
- package/plugins/multipleSelectionHandles/index.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.d.ts +21 -0
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +7 -5
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +5 -3
- package/plugins/nestedHeaders/index.d.ts +1 -0
- package/plugins/nestedHeaders/index.js +1 -1
- package/plugins/nestedHeaders/nestedHeaders.d.ts +17 -0
- package/plugins/nestedHeaders/nestedHeaders.js +41 -21
- package/plugins/nestedHeaders/nestedHeaders.mjs +38 -19
- package/plugins/nestedHeaders/stateManager/headersTree.js +11 -5
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +10 -5
- package/plugins/nestedHeaders/stateManager/index.js +9 -6
- package/plugins/nestedHeaders/stateManager/index.mjs +9 -6
- package/plugins/nestedHeaders/stateManager/nodeModifiers/utils/tree.js +1 -1
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +2 -0
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.mjs +1 -0
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +8 -4
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +8 -4
- package/plugins/nestedHeaders/utils/ghostTable.js +10 -2
- package/plugins/nestedHeaders/utils/ghostTable.mjs +10 -2
- package/plugins/nestedRows/data/dataManager.js +40 -14
- package/plugins/nestedRows/data/dataManager.mjs +38 -13
- package/plugins/nestedRows/index.d.ts +1 -0
- package/plugins/nestedRows/index.js +1 -1
- package/plugins/nestedRows/nestedRows.d.ts +12 -0
- package/plugins/nestedRows/nestedRows.js +48 -34
- package/plugins/nestedRows/nestedRows.mjs +43 -32
- package/plugins/nestedRows/ui/_base.js +1 -2
- package/plugins/nestedRows/ui/_base.mjs +1 -2
- package/plugins/nestedRows/ui/collapsing.js +6 -5
- package/plugins/nestedRows/ui/collapsing.mjs +4 -4
- package/plugins/nestedRows/ui/contextMenu.js +2 -3
- package/plugins/nestedRows/ui/contextMenu.mjs +2 -3
- package/plugins/nestedRows/ui/headers.js +4 -5
- package/plugins/nestedRows/ui/headers.mjs +3 -4
- package/plugins/nestedRows/utils/rowMoveController.js +10 -9
- package/plugins/nestedRows/utils/rowMoveController.mjs +8 -8
- package/plugins/persistentState/index.d.ts +1 -0
- package/plugins/persistentState/persistentState.d.ts +13 -0
- package/plugins/persistentState/persistentState.js +13 -4
- package/plugins/persistentState/persistentState.mjs +12 -3
- package/plugins/persistentState/storage.js +1 -1
- package/plugins/persistentState/storage.mjs +1 -1
- package/plugins/registry.d.ts +9 -0
- package/plugins/registry.js +4 -2
- package/plugins/registry.mjs +2 -1
- package/plugins/search/index.d.ts +1 -0
- package/plugins/search/search.d.ts +28 -0
- package/plugins/search/search.js +7 -6
- package/plugins/search/search.mjs +7 -6
- package/plugins/touchScroll/index.d.ts +1 -0
- package/plugins/touchScroll/touchScroll.d.ts +13 -0
- package/plugins/touchScroll/touchScroll.js +9 -9
- package/plugins/touchScroll/touchScroll.mjs +8 -8
- package/plugins/trimRows/index.d.ts +1 -0
- package/plugins/trimRows/trimRows.d.ts +17 -0
- package/plugins/trimRows/trimRows.js +3 -2
- package/plugins/trimRows/trimRows.mjs +3 -2
- package/plugins/undoRedo/index.d.ts +1 -0
- package/plugins/undoRedo/undoRedo.d.ts +49 -0
- package/plugins/undoRedo/undoRedo.js +28 -30
- package/plugins/undoRedo/undoRedo.mjs +26 -29
- package/registry.d.ts +6 -0
- package/registry.js +46 -0
- package/registry.mjs +27 -0
- package/renderers/autocompleteRenderer/autocompleteRenderer.d.ts +5 -0
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +1 -1
- package/renderers/autocompleteRenderer/index.d.ts +1 -0
- package/renderers/base.d.ts +3 -0
- package/renderers/baseRenderer/baseRenderer.d.ts +5 -0
- package/renderers/baseRenderer/baseRenderer.js +1 -1
- package/renderers/baseRenderer/index.d.ts +1 -0
- package/renderers/checkboxRenderer/checkboxRenderer.d.ts +5 -0
- package/renderers/checkboxRenderer/checkboxRenderer.js +3 -5
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +3 -4
- package/renderers/checkboxRenderer/index.d.ts +1 -0
- package/renderers/htmlRenderer/htmlRenderer.d.ts +5 -0
- package/renderers/htmlRenderer/htmlRenderer.js +1 -1
- package/renderers/htmlRenderer/index.d.ts +1 -0
- package/renderers/index.d.ts +42 -0
- package/renderers/index.js +16 -2
- package/renderers/index.mjs +22 -7
- package/renderers/numericRenderer/index.d.ts +1 -0
- package/renderers/numericRenderer/numericRenderer.d.ts +5 -0
- package/renderers/numericRenderer/numericRenderer.js +1 -1
- package/renderers/passwordRenderer/index.d.ts +1 -0
- package/renderers/passwordRenderer/passwordRenderer.d.ts +5 -0
- package/renderers/passwordRenderer/passwordRenderer.js +1 -1
- package/renderers/registry.d.ts +18 -0
- package/renderers/registry.js +3 -2
- package/renderers/textRenderer/index.d.ts +1 -0
- package/renderers/textRenderer/textRenderer.d.ts +5 -0
- package/renderers/textRenderer/textRenderer.js +1 -1
- package/selection/highlight/constants.js +1 -1
- package/selection/highlight/highlight.js +7 -5
- package/selection/highlight/highlight.mjs +5 -4
- package/selection/highlight/types/activeHeader.js +2 -0
- package/selection/highlight/types/activeHeader.mjs +1 -0
- package/selection/highlight/types/area.js +2 -0
- package/selection/highlight/types/area.mjs +1 -0
- package/selection/highlight/types/cell.js +2 -0
- package/selection/highlight/types/cell.mjs +1 -0
- package/selection/highlight/types/customSelection.js +2 -0
- package/selection/highlight/types/customSelection.mjs +1 -0
- package/selection/highlight/types/fill.js +2 -0
- package/selection/highlight/types/fill.mjs +1 -0
- package/selection/highlight/types/header.js +2 -0
- package/selection/highlight/types/header.mjs +1 -0
- package/selection/highlight/types/index.js +2 -0
- package/selection/highlight/types/index.mjs +1 -0
- package/selection/highlight/visualSelection.js +7 -5
- package/selection/highlight/visualSelection.mjs +5 -4
- package/selection/index.d.ts +5 -0
- package/selection/index.js +2 -0
- package/selection/mouseEventHandler.js +4 -4
- package/selection/mouseEventHandler.mjs +3 -3
- package/selection/range.js +5 -5
- package/selection/range.mjs +4 -4
- package/selection/selection.js +18 -9
- package/selection/selection.mjs +17 -9
- package/selection/transformation.js +3 -2
- package/selection/transformation.mjs +3 -2
- package/selection/utils.js +6 -4
- package/selection/utils.mjs +3 -2
- package/settings.d.ts +208 -0
- package/tableView.js +20 -14
- package/tableView.mjs +19 -14
- package/translations/changesObservable/observable.js +10 -5
- package/translations/changesObservable/observable.mjs +10 -5
- package/translations/changesObservable/observer.js +6 -1
- package/translations/changesObservable/observer.mjs +6 -1
- package/translations/changesObservable/utils.js +1 -0
- package/translations/changesObservable/utils.mjs +1 -0
- package/translations/index.d.ts +1 -0
- package/translations/index.js +3 -1
- package/translations/indexMapper.d.ts +45 -0
- package/translations/indexMapper.js +8 -3
- package/translations/indexMapper.mjs +6 -2
- package/translations/mapCollections/aggregatedCollection.js +3 -3
- package/translations/mapCollections/aggregatedCollection.mjs +2 -2
- package/translations/mapCollections/index.js +2 -0
- package/translations/mapCollections/mapCollection.js +1 -1
- package/translations/maps/hidingMap.js +3 -3
- package/translations/maps/hidingMap.mjs +2 -2
- package/translations/maps/indexMap.d.ts +10 -0
- package/translations/maps/indexesSequence.js +4 -4
- package/translations/maps/indexesSequence.mjs +3 -3
- package/translations/maps/linkedPhysicalIndexToValueMap.js +4 -2
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +3 -2
- package/translations/maps/physicalIndexToValueMap.js +4 -4
- package/translations/maps/physicalIndexToValueMap.mjs +3 -3
- package/translations/maps/trimmingMap.js +3 -3
- package/translations/maps/trimmingMap.mjs +2 -2
- package/translations/maps/utils/actionsOnIndexes.js +2 -0
- package/translations/maps/utils/actionsOnIndexes.mjs +1 -0
- package/translations/maps/utils/indexesSequence.js +2 -0
- package/translations/maps/utils/indexesSequence.mjs +1 -0
- package/translations/maps/utils/physicallyIndexed.js +2 -0
- package/translations/maps/utils/physicallyIndexed.mjs +1 -0
- package/utils/dataStructures/priorityMap.js +4 -2
- package/utils/dataStructures/priorityMap.mjs +2 -1
- package/utils/dataStructures/tree.js +3 -1
- package/utils/dataStructures/tree.mjs +1 -0
- package/utils/dataStructures/uniqueMap.js +3 -1
- package/utils/dataStructures/uniqueMap.mjs +2 -1
- package/utils/dataStructures/uniqueSet.js +2 -0
- package/utils/dataStructures/uniqueSet.mjs +1 -0
- package/utils/ghostTable.js +5 -4
- package/utils/ghostTable.mjs +3 -3
- package/utils/interval.js +1 -2
- package/utils/interval.mjs +0 -1
- package/utils/parseTable.d.ts +5 -0
- package/utils/parseTable.js +2 -2
- package/utils/parseTable.mjs +1 -1
- package/utils/rootInstance.js +3 -2
- package/utils/samplesGenerator.js +0 -1
- package/utils/samplesGenerator.mjs +0 -1
- package/utils/staticRegister.js +3 -1
- package/utils/staticRegister.mjs +1 -0
- package/validators/autocompleteValidator/autocompleteValidator.d.ts +5 -0
- package/validators/autocompleteValidator/autocompleteValidator.js +1 -1
- package/validators/autocompleteValidator/index.d.ts +1 -0
- package/validators/base.d.ts +6 -0
- package/validators/dateValidator/dateValidator.d.ts +5 -0
- package/validators/dateValidator/dateValidator.js +2 -2
- package/validators/dateValidator/index.d.ts +1 -0
- package/validators/index.d.ts +33 -0
- package/validators/index.js +13 -2
- package/validators/index.mjs +16 -4
- package/validators/numericValidator/index.d.ts +1 -0
- package/validators/numericValidator/numericValidator.d.ts +5 -0
- package/validators/numericValidator/numericValidator.js +1 -1
- package/validators/registry.d.ts +18 -0
- package/validators/registry.js +3 -2
- package/validators/timeValidator/index.d.ts +1 -0
- package/validators/timeValidator/timeValidator.d.ts +5 -0
- package/validators/timeValidator/timeValidator.js +3 -1
- package/validators/timeValidator/timeValidator.mjs +1 -0
- package/handsontable-general-terms.pdf +0 -0
- package/handsontable.d.ts +0 -2616
- package/plugins/formulas/autofill.js +0 -180
- package/plugins/formulas/autofill.mjs +0 -172
package/editorManager.js
CHANGED
@@ -12,6 +12,8 @@ require("core-js/modules/es.function.name.js");
|
|
12
12
|
|
13
13
|
require("core-js/modules/es.array.from.js");
|
14
14
|
|
15
|
+
require("core-js/modules/es.regexp.exec.js");
|
16
|
+
|
15
17
|
exports.__esModule = true;
|
16
18
|
exports.default = void 0;
|
17
19
|
|
@@ -49,7 +51,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
49
51
|
|
50
52
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
51
53
|
|
52
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
54
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
53
55
|
|
54
56
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
55
57
|
|
@@ -121,7 +123,7 @@ var EditorManager = /*#__PURE__*/function () {
|
|
121
123
|
* A reference to an instance of the activeEditor.
|
122
124
|
*
|
123
125
|
* @private
|
124
|
-
* @type {
|
126
|
+
* @type {BaseEditor}
|
125
127
|
*/
|
126
128
|
|
127
129
|
this.activeEditor = void 0;
|
@@ -201,7 +203,7 @@ var EditorManager = /*#__PURE__*/function () {
|
|
201
203
|
/**
|
202
204
|
* Get active editor.
|
203
205
|
*
|
204
|
-
* @returns {
|
206
|
+
* @returns {BaseEditor}
|
205
207
|
*/
|
206
208
|
|
207
209
|
}, {
|
@@ -417,9 +419,9 @@ var EditorManager = /*#__PURE__*/function () {
|
|
417
419
|
key: "moveSelectionRight",
|
418
420
|
value: function moveSelectionRight(isShiftPressed) {
|
419
421
|
if (isShiftPressed) {
|
420
|
-
this.selection.transformEnd(0,
|
422
|
+
this.selection.transformEnd(0, this.instance.getDirectionFactor());
|
421
423
|
} else {
|
422
|
-
this.selection.transformStart(0,
|
424
|
+
this.selection.transformStart(0, this.instance.getDirectionFactor());
|
423
425
|
}
|
424
426
|
}
|
425
427
|
/**
|
@@ -433,9 +435,9 @@ var EditorManager = /*#__PURE__*/function () {
|
|
433
435
|
key: "moveSelectionLeft",
|
434
436
|
value: function moveSelectionLeft(isShiftPressed) {
|
435
437
|
if (isShiftPressed) {
|
436
|
-
this.selection.transformEnd(0, -1);
|
438
|
+
this.selection.transformEnd(0, -1 * this.instance.getDirectionFactor());
|
437
439
|
} else {
|
438
|
-
this.selection.transformStart(0, -1);
|
440
|
+
this.selection.transformStart(0, -1 * this.instance.getDirectionFactor());
|
439
441
|
}
|
440
442
|
}
|
441
443
|
/**
|
@@ -452,10 +454,11 @@ var EditorManager = /*#__PURE__*/function () {
|
|
452
454
|
return;
|
453
455
|
}
|
454
456
|
|
455
|
-
this.instance.runHooks('beforeKeyDown', event);
|
457
|
+
this.instance.runHooks('beforeKeyDown', event);
|
458
|
+
var keyCode = event.keyCode; // keyCode 229 aka 'uninitialized' doesn't take into account with editors. This key code is produced when unfinished
|
456
459
|
// character is entering (using IME editor). It is fired mainly on linux (ubuntu) with installed ibus-pinyin package.
|
457
460
|
|
458
|
-
if (this.destroyed ||
|
461
|
+
if (this.destroyed || keyCode === 229) {
|
459
462
|
return;
|
460
463
|
}
|
461
464
|
|
@@ -463,7 +466,7 @@ var EditorManager = /*#__PURE__*/function () {
|
|
463
466
|
return;
|
464
467
|
}
|
465
468
|
|
466
|
-
this.lastKeyCode =
|
469
|
+
this.lastKeyCode = keyCode;
|
467
470
|
|
468
471
|
if (!this.selection.isSelected()) {
|
469
472
|
return;
|
@@ -473,7 +476,7 @@ var EditorManager = /*#__PURE__*/function () {
|
|
473
476
|
var isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
|
474
477
|
|
475
478
|
if (this.activeEditor && !this.activeEditor.isWaiting()) {
|
476
|
-
if (!(0, _unicode.
|
479
|
+
if (!(0, _unicode.isFunctionKey)(keyCode) && !(0, _unicode.isCtrlMetaKey)(keyCode) && !isCtrlPressed && !this.isEditorOpened()) {
|
477
480
|
this.openEditor('', event);
|
478
481
|
return;
|
479
482
|
}
|
@@ -483,7 +486,7 @@ var EditorManager = /*#__PURE__*/function () {
|
|
483
486
|
var rangeModifier = isShiftPressed ? this.selection.setRangeEnd : this.selection.setRangeStart;
|
484
487
|
var tabMoves;
|
485
488
|
|
486
|
-
switch (
|
489
|
+
switch (keyCode) {
|
487
490
|
case _unicode.KEY_CODES.A:
|
488
491
|
if (!this.isEditorOpened() && isCtrlPressed) {
|
489
492
|
this.instance.selectAll();
|
package/editorManager.mjs
CHANGED
@@ -9,6 +9,7 @@ import "core-js/modules/es.symbol.iterator.js";
|
|
9
9
|
import "core-js/modules/es.array.slice.js";
|
10
10
|
import "core-js/modules/es.function.name.js";
|
11
11
|
import "core-js/modules/es.array.from.js";
|
12
|
+
import "core-js/modules/es.regexp.exec.js";
|
12
13
|
|
13
14
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
14
15
|
|
@@ -18,7 +19,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
18
19
|
|
19
20
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
20
21
|
|
21
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
22
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
22
23
|
|
23
24
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
24
25
|
|
@@ -29,7 +30,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
29
30
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
30
31
|
|
31
32
|
import { CellCoords } from "./3rdparty/walkontable/src/index.mjs";
|
32
|
-
import { KEY_CODES,
|
33
|
+
import { KEY_CODES, isFunctionKey, isCtrlMetaKey } from "./helpers/unicode.mjs";
|
33
34
|
import { stopImmediatePropagation, isImmediatePropagationStopped } from "./helpers/dom/event.mjs";
|
34
35
|
import { getEditorInstance } from "./editors/registry.mjs";
|
35
36
|
import EventManager from "./eventManager.mjs";
|
@@ -98,7 +99,7 @@ var EditorManager = /*#__PURE__*/function () {
|
|
98
99
|
* A reference to an instance of the activeEditor.
|
99
100
|
*
|
100
101
|
* @private
|
101
|
-
* @type {
|
102
|
+
* @type {BaseEditor}
|
102
103
|
*/
|
103
104
|
|
104
105
|
this.activeEditor = void 0;
|
@@ -178,7 +179,7 @@ var EditorManager = /*#__PURE__*/function () {
|
|
178
179
|
/**
|
179
180
|
* Get active editor.
|
180
181
|
*
|
181
|
-
* @returns {
|
182
|
+
* @returns {BaseEditor}
|
182
183
|
*/
|
183
184
|
|
184
185
|
}, {
|
@@ -394,9 +395,9 @@ var EditorManager = /*#__PURE__*/function () {
|
|
394
395
|
key: "moveSelectionRight",
|
395
396
|
value: function moveSelectionRight(isShiftPressed) {
|
396
397
|
if (isShiftPressed) {
|
397
|
-
this.selection.transformEnd(0,
|
398
|
+
this.selection.transformEnd(0, this.instance.getDirectionFactor());
|
398
399
|
} else {
|
399
|
-
this.selection.transformStart(0,
|
400
|
+
this.selection.transformStart(0, this.instance.getDirectionFactor());
|
400
401
|
}
|
401
402
|
}
|
402
403
|
/**
|
@@ -410,9 +411,9 @@ var EditorManager = /*#__PURE__*/function () {
|
|
410
411
|
key: "moveSelectionLeft",
|
411
412
|
value: function moveSelectionLeft(isShiftPressed) {
|
412
413
|
if (isShiftPressed) {
|
413
|
-
this.selection.transformEnd(0, -1);
|
414
|
+
this.selection.transformEnd(0, -1 * this.instance.getDirectionFactor());
|
414
415
|
} else {
|
415
|
-
this.selection.transformStart(0, -1);
|
416
|
+
this.selection.transformStart(0, -1 * this.instance.getDirectionFactor());
|
416
417
|
}
|
417
418
|
}
|
418
419
|
/**
|
@@ -429,10 +430,11 @@ var EditorManager = /*#__PURE__*/function () {
|
|
429
430
|
return;
|
430
431
|
}
|
431
432
|
|
432
|
-
this.instance.runHooks('beforeKeyDown', event);
|
433
|
+
this.instance.runHooks('beforeKeyDown', event);
|
434
|
+
var keyCode = event.keyCode; // keyCode 229 aka 'uninitialized' doesn't take into account with editors. This key code is produced when unfinished
|
433
435
|
// character is entering (using IME editor). It is fired mainly on linux (ubuntu) with installed ibus-pinyin package.
|
434
436
|
|
435
|
-
if (this.destroyed ||
|
437
|
+
if (this.destroyed || keyCode === 229) {
|
436
438
|
return;
|
437
439
|
}
|
438
440
|
|
@@ -440,7 +442,7 @@ var EditorManager = /*#__PURE__*/function () {
|
|
440
442
|
return;
|
441
443
|
}
|
442
444
|
|
443
|
-
this.lastKeyCode =
|
445
|
+
this.lastKeyCode = keyCode;
|
444
446
|
|
445
447
|
if (!this.selection.isSelected()) {
|
446
448
|
return;
|
@@ -450,7 +452,7 @@ var EditorManager = /*#__PURE__*/function () {
|
|
450
452
|
var isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
|
451
453
|
|
452
454
|
if (this.activeEditor && !this.activeEditor.isWaiting()) {
|
453
|
-
if (!
|
455
|
+
if (!isFunctionKey(keyCode) && !isCtrlMetaKey(keyCode) && !isCtrlPressed && !this.isEditorOpened()) {
|
454
456
|
this.openEditor('', event);
|
455
457
|
return;
|
456
458
|
}
|
@@ -460,7 +462,7 @@ var EditorManager = /*#__PURE__*/function () {
|
|
460
462
|
var rangeModifier = isShiftPressed ? this.selection.setRangeEnd : this.selection.setRangeStart;
|
461
463
|
var tabMoves;
|
462
464
|
|
463
|
-
switch (
|
465
|
+
switch (keyCode) {
|
464
466
|
case KEY_CODES.A:
|
465
467
|
if (!this.isEditorOpened() && isCtrlPressed) {
|
466
468
|
this.instance.selectAll();
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import Core from '../../core';
|
2
|
+
import { HandsontableEditor } from '../handsontableEditor';
|
3
|
+
|
4
|
+
export const EDITOR_TYPE: 'autocomplete';
|
5
|
+
|
6
|
+
export class AutocompleteEditor extends HandsontableEditor {
|
7
|
+
constructor(instance: Core);
|
8
|
+
|
9
|
+
query: string;
|
10
|
+
strippedChoices: string[];
|
11
|
+
rawChoices: string[];
|
12
|
+
|
13
|
+
getValue(): string;
|
14
|
+
queryChoices(query: string): void;
|
15
|
+
updateChoicesList(choicesList: string[]): void;
|
16
|
+
flipDropdownIfNeeded(): boolean;
|
17
|
+
limitDropdownIfNeeded(spaceAvailable: number, dropdownHeight: number): void;
|
18
|
+
flipDropdown(dropdownHeight: number): void;
|
19
|
+
unflipDropdown(): void;
|
20
|
+
updateDropdownHeight(): void;
|
21
|
+
setDropdownHeight(height: number): void;
|
22
|
+
highlightBestMatchingChoice(index?: number): void;
|
23
|
+
getDropdownHeight(): number;
|
24
|
+
stripValueIfNeeded(value: string): string;
|
25
|
+
stripValuesIfNeeded(values: string[]): string[];
|
26
|
+
}
|
27
|
+
export namespace AutocompleteEditor {
|
28
|
+
export function sortByRelevance(value: any, choices: string[], caseSensitive: boolean): number[];
|
29
|
+
}
|
@@ -19,7 +19,7 @@ require("core-js/modules/es.symbol.description.js");
|
|
19
19
|
require("core-js/modules/es.symbol.iterator.js");
|
20
20
|
|
21
21
|
exports.__esModule = true;
|
22
|
-
exports.
|
22
|
+
exports.EDITOR_TYPE = exports.AutocompleteEditor = void 0;
|
23
23
|
|
24
24
|
require("core-js/modules/es.array.iterator.js");
|
25
25
|
|
@@ -33,6 +33,8 @@ require("core-js/modules/web.dom-collections.iterator.js");
|
|
33
33
|
|
34
34
|
require("core-js/modules/es.array.index-of.js");
|
35
35
|
|
36
|
+
require("core-js/modules/es.array.sort.js");
|
37
|
+
|
36
38
|
require("core-js/modules/es.array.find.js");
|
37
39
|
|
38
40
|
require("core-js/modules/es.regexp.exec.js");
|
@@ -41,8 +43,6 @@ require("core-js/modules/es.string.replace.js");
|
|
41
43
|
|
42
44
|
require("core-js/modules/es.array.filter.js");
|
43
45
|
|
44
|
-
require("core-js/modules/es.array.sort.js");
|
45
|
-
|
46
46
|
var _handsontableEditor = require("../handsontableEditor");
|
47
47
|
|
48
48
|
var _array = require("../../helpers/array");
|
@@ -63,7 +63,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
63
63
|
|
64
64
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
65
65
|
|
66
|
-
function _get(
|
66
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
67
67
|
|
68
68
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
69
69
|
|
@@ -73,7 +73,7 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
73
73
|
|
74
74
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
75
75
|
|
76
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
76
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
77
77
|
|
78
78
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
79
79
|
|
@@ -81,6 +81,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
81
81
|
|
82
82
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
83
83
|
|
84
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
85
|
+
|
84
86
|
var privatePool = new WeakMap();
|
85
87
|
var EDITOR_TYPE = 'autocomplete';
|
86
88
|
/**
|
@@ -107,6 +109,76 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
107
109
|
* @type {string}
|
108
110
|
*/
|
109
111
|
|
112
|
+
_defineProperty(_assertThisInitialized(_this), "sortByRelevance", function (value, choices, caseSensitive) {
|
113
|
+
var choicesRelevance = [];
|
114
|
+
var result = [];
|
115
|
+
var valueLength = value.length;
|
116
|
+
var choicesCount = choices.length;
|
117
|
+
var charsLeft;
|
118
|
+
var currentItem;
|
119
|
+
var i;
|
120
|
+
var valueIndex;
|
121
|
+
|
122
|
+
if (valueLength === 0) {
|
123
|
+
for (i = 0; i < choicesCount; i++) {
|
124
|
+
result.push(i);
|
125
|
+
}
|
126
|
+
|
127
|
+
return result;
|
128
|
+
}
|
129
|
+
|
130
|
+
for (i = 0; i < choicesCount; i++) {
|
131
|
+
currentItem = (0, _string.stripTags)((0, _mixed.stringify)(choices[i]));
|
132
|
+
|
133
|
+
if (caseSensitive) {
|
134
|
+
valueIndex = currentItem.indexOf(value);
|
135
|
+
} else {
|
136
|
+
var locale = this.cellProperties.locale;
|
137
|
+
valueIndex = currentItem.toLocaleLowerCase(locale).indexOf(value.toLocaleLowerCase(locale));
|
138
|
+
}
|
139
|
+
|
140
|
+
if (valueIndex !== -1) {
|
141
|
+
charsLeft = currentItem.length - valueIndex - valueLength;
|
142
|
+
choicesRelevance.push({
|
143
|
+
baseIndex: i,
|
144
|
+
index: valueIndex,
|
145
|
+
charsLeft: charsLeft,
|
146
|
+
value: currentItem
|
147
|
+
});
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
choicesRelevance.sort(function (a, b) {
|
152
|
+
if (b.index === -1) {
|
153
|
+
return -1;
|
154
|
+
}
|
155
|
+
|
156
|
+
if (a.index === -1) {
|
157
|
+
return 1;
|
158
|
+
}
|
159
|
+
|
160
|
+
if (a.index < b.index) {
|
161
|
+
return -1;
|
162
|
+
} else if (b.index < a.index) {
|
163
|
+
return 1;
|
164
|
+
} else if (a.index === b.index) {
|
165
|
+
if (a.charsLeft < b.charsLeft) {
|
166
|
+
return -1;
|
167
|
+
} else if (a.charsLeft > b.charsLeft) {
|
168
|
+
return 1;
|
169
|
+
}
|
170
|
+
}
|
171
|
+
|
172
|
+
return 0;
|
173
|
+
});
|
174
|
+
|
175
|
+
for (i = 0, choicesCount = choicesRelevance.length; i < choicesCount; i++) {
|
176
|
+
result.push(choicesRelevance[i].baseIndex);
|
177
|
+
}
|
178
|
+
|
179
|
+
return result;
|
180
|
+
});
|
181
|
+
|
110
182
|
_this.query = null;
|
111
183
|
/**
|
112
184
|
* Contains stripped choices.
|
@@ -194,14 +266,15 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
194
266
|
(0, _textRenderer.textRenderer)(instance, TD, row, col, prop, value, cellProperties);
|
195
267
|
var _this3$cellProperties = _this3.cellProperties,
|
196
268
|
filteringCaseSensitive = _this3$cellProperties.filteringCaseSensitive,
|
197
|
-
allowHtml = _this3$cellProperties.allowHtml
|
269
|
+
allowHtml = _this3$cellProperties.allowHtml,
|
270
|
+
locale = _this3$cellProperties.locale;
|
198
271
|
var query = _this3.query;
|
199
272
|
var cellValue = (0, _mixed.stringify)(value);
|
200
273
|
var indexOfMatch;
|
201
274
|
var match;
|
202
275
|
|
203
276
|
if (cellValue && !allowHtml) {
|
204
|
-
indexOfMatch = filteringCaseSensitive === true ? cellValue.indexOf(query) : cellValue.
|
277
|
+
indexOfMatch = filteringCaseSensitive === true ? cellValue.indexOf(query) : cellValue.toLocaleLowerCase(locale).indexOf(query.toLocaleLowerCase(locale));
|
205
278
|
|
206
279
|
if (indexOfMatch !== -1) {
|
207
280
|
match = cellValue.substr(indexOfMatch, query.length);
|
@@ -294,7 +367,7 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
294
367
|
var choices = choicesList;
|
295
368
|
|
296
369
|
if (sortByRelevanceSetting) {
|
297
|
-
orderByRelevance =
|
370
|
+
orderByRelevance = this.sortByRelevance(this.stripValueIfNeeded(this.getValue()), choices, this.cellProperties.filteringCaseSensitive);
|
298
371
|
}
|
299
372
|
|
300
373
|
var orderByRelevanceLength = Array.isArray(orderByRelevance) ? orderByRelevance.length : 0;
|
@@ -595,6 +668,15 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
595
668
|
|
596
669
|
_get(_getPrototypeOf(AutocompleteEditor.prototype), "onBeforeKeyDown", this).call(this, event);
|
597
670
|
}
|
671
|
+
/**
|
672
|
+
* Filters and sorts by relevance.
|
673
|
+
*
|
674
|
+
* @param {*} value The selected value.
|
675
|
+
* @param {string[]} choices The list of available choices.
|
676
|
+
* @param {boolean} caseSensitive Indicates if it's sorted by case.
|
677
|
+
* @returns {number[]} Array of indexes in original choices array.
|
678
|
+
*/
|
679
|
+
|
598
680
|
}], [{
|
599
681
|
key: "EDITOR_TYPE",
|
600
682
|
get: function get() {
|
@@ -604,83 +686,5 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
604
686
|
|
605
687
|
return AutocompleteEditor;
|
606
688
|
}(_handsontableEditor.HandsontableEditor);
|
607
|
-
/**
|
608
|
-
* Filters and sorts by relevance.
|
609
|
-
*
|
610
|
-
* @param {*} value The selected value.
|
611
|
-
* @param {string[]} choices The list of available choices.
|
612
|
-
* @param {boolean} caseSensitive Indicates if it's sorted by case.
|
613
|
-
* @returns {number[]} Array of indexes in original choices array.
|
614
|
-
*/
|
615
|
-
|
616
|
-
|
617
|
-
exports.AutocompleteEditor = AutocompleteEditor;
|
618
|
-
|
619
|
-
AutocompleteEditor.sortByRelevance = function (value, choices, caseSensitive) {
|
620
|
-
var choicesRelevance = [];
|
621
|
-
var result = [];
|
622
|
-
var valueLength = value.length;
|
623
|
-
var choicesCount = choices.length;
|
624
|
-
var charsLeft;
|
625
|
-
var currentItem;
|
626
|
-
var i;
|
627
|
-
var valueIndex;
|
628
|
-
|
629
|
-
if (valueLength === 0) {
|
630
|
-
for (i = 0; i < choicesCount; i++) {
|
631
|
-
result.push(i);
|
632
|
-
}
|
633
|
-
|
634
|
-
return result;
|
635
|
-
}
|
636
|
-
|
637
|
-
for (i = 0; i < choicesCount; i++) {
|
638
|
-
currentItem = (0, _string.stripTags)((0, _mixed.stringify)(choices[i]));
|
639
|
-
|
640
|
-
if (caseSensitive) {
|
641
|
-
valueIndex = currentItem.indexOf(value);
|
642
|
-
} else {
|
643
|
-
valueIndex = currentItem.toLowerCase().indexOf(value.toLowerCase());
|
644
|
-
}
|
645
|
-
|
646
|
-
if (valueIndex !== -1) {
|
647
|
-
charsLeft = currentItem.length - valueIndex - valueLength;
|
648
|
-
choicesRelevance.push({
|
649
|
-
baseIndex: i,
|
650
|
-
index: valueIndex,
|
651
|
-
charsLeft: charsLeft,
|
652
|
-
value: currentItem
|
653
|
-
});
|
654
|
-
}
|
655
|
-
}
|
656
|
-
|
657
|
-
choicesRelevance.sort(function (a, b) {
|
658
|
-
if (b.index === -1) {
|
659
|
-
return -1;
|
660
|
-
}
|
661
|
-
|
662
|
-
if (a.index === -1) {
|
663
|
-
return 1;
|
664
|
-
}
|
665
|
-
|
666
|
-
if (a.index < b.index) {
|
667
|
-
return -1;
|
668
|
-
} else if (b.index < a.index) {
|
669
|
-
return 1;
|
670
|
-
} else if (a.index === b.index) {
|
671
|
-
if (a.charsLeft < b.charsLeft) {
|
672
|
-
return -1;
|
673
|
-
} else if (a.charsLeft > b.charsLeft) {
|
674
|
-
return 1;
|
675
|
-
}
|
676
|
-
}
|
677
|
-
|
678
|
-
return 0;
|
679
|
-
});
|
680
|
-
|
681
|
-
for (i = 0, choicesCount = choicesRelevance.length; i < choicesCount; i++) {
|
682
|
-
result.push(choicesRelevance[i].baseIndex);
|
683
|
-
}
|
684
689
|
|
685
|
-
|
686
|
-
};
|
690
|
+
exports.AutocompleteEditor = AutocompleteEditor;
|