handsontable 12.1.2 → 12.2.0
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/SheetClip/SheetClip.js +3 -32
- package/3rdparty/SheetClip/SheetClip.mjs +3 -23
- package/3rdparty/SheetClip/index.js +0 -2
- package/3rdparty/autoResize/autoResize.js +119 -145
- package/3rdparty/autoResize/autoResize.mjs +119 -143
- package/3rdparty/autoResize/index.js +0 -2
- package/3rdparty/walkontable/src/border.js +72 -174
- package/3rdparty/walkontable/src/border.mjs +74 -161
- package/3rdparty/walkontable/src/calculator/constants.js +0 -3
- package/3rdparty/walkontable/src/calculator/constants.mjs +0 -2
- package/3rdparty/walkontable/src/calculator/index.js +0 -10
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +26 -76
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +26 -69
- package/3rdparty/walkontable/src/calculator/viewportRows.js +20 -48
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +20 -41
- package/3rdparty/walkontable/src/cell/coords.js +13 -43
- package/3rdparty/walkontable/src/cell/coords.mjs +13 -38
- package/3rdparty/walkontable/src/cell/range.js +55 -130
- package/3rdparty/walkontable/src/cell/range.mjs +60 -126
- package/3rdparty/walkontable/src/core/_base.js +16 -74
- package/3rdparty/walkontable/src/core/_base.mjs +19 -70
- package/3rdparty/walkontable/src/core/clone.js +1 -40
- package/3rdparty/walkontable/src/core/clone.mjs +3 -30
- package/3rdparty/walkontable/src/core/core.js +3 -57
- package/3rdparty/walkontable/src/core/core.mjs +5 -41
- package/3rdparty/walkontable/src/event.js +31 -78
- package/3rdparty/walkontable/src/event.mjs +31 -65
- package/3rdparty/walkontable/src/facade/core.js +1 -17
- package/3rdparty/walkontable/src/facade/core.mjs +7 -20
- package/3rdparty/walkontable/src/filter/column.js +9 -18
- package/3rdparty/walkontable/src/filter/column.mjs +9 -17
- package/3rdparty/walkontable/src/filter/row.js +9 -18
- package/3rdparty/walkontable/src/filter/row.mjs +9 -17
- package/3rdparty/walkontable/src/index.js +0 -31
- package/3rdparty/walkontable/src/overlay/_base.js +24 -69
- package/3rdparty/walkontable/src/overlay/_base.mjs +31 -68
- package/3rdparty/walkontable/src/overlay/bottom.js +28 -99
- package/3rdparty/walkontable/src/overlay/bottom.mjs +30 -86
- package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.js +7 -53
- package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.mjs +9 -40
- package/3rdparty/walkontable/src/overlay/constants.js +0 -6
- package/3rdparty/walkontable/src/overlay/constants.mjs +0 -1
- package/3rdparty/walkontable/src/overlay/index.js +0 -17
- package/3rdparty/walkontable/src/overlay/inlineStart.js +21 -91
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +23 -78
- package/3rdparty/walkontable/src/overlay/top.js +27 -100
- package/3rdparty/walkontable/src/overlay/top.mjs +29 -87
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +4 -51
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +6 -38
- package/3rdparty/walkontable/src/overlays.js +58 -129
- package/3rdparty/walkontable/src/overlays.mjs +60 -121
- package/3rdparty/walkontable/src/renderer/_base.js +4 -20
- package/3rdparty/walkontable/src/renderer/_base.mjs +8 -22
- package/3rdparty/walkontable/src/renderer/cells.js +10 -54
- package/3rdparty/walkontable/src/renderer/cells.mjs +22 -52
- package/3rdparty/walkontable/src/renderer/colGroup.js +10 -47
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +21 -46
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +8 -50
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +19 -49
- package/3rdparty/walkontable/src/renderer/index.js +13 -36
- package/3rdparty/walkontable/src/renderer/index.mjs +17 -27
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +8 -50
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +20 -49
- package/3rdparty/walkontable/src/renderer/rows.js +3 -46
- package/3rdparty/walkontable/src/renderer/rows.mjs +3 -29
- package/3rdparty/walkontable/src/renderer/table.js +22 -49
- package/3rdparty/walkontable/src/renderer/table.mjs +22 -48
- package/3rdparty/walkontable/src/scroll.js +56 -86
- package/3rdparty/walkontable/src/scroll.mjs +58 -86
- package/3rdparty/walkontable/src/selection.js +20 -101
- package/3rdparty/walkontable/src/selection.mjs +22 -85
- package/3rdparty/walkontable/src/settings.js +9 -29
- package/3rdparty/walkontable/src/settings.mjs +9 -27
- package/3rdparty/walkontable/src/table/bottom.js +1 -35
- package/3rdparty/walkontable/src/table/bottom.mjs +6 -25
- package/3rdparty/walkontable/src/table/bottomInlineStartCorner.js +1 -35
- package/3rdparty/walkontable/src/table/bottomInlineStartCorner.mjs +7 -26
- package/3rdparty/walkontable/src/table/inlineStart.js +1 -35
- package/3rdparty/walkontable/src/table/inlineStart.mjs +3 -22
- package/3rdparty/walkontable/src/table/master.js +10 -55
- package/3rdparty/walkontable/src/table/master.mjs +15 -44
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +7 -28
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +7 -26
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +7 -28
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +7 -26
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +7 -22
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +7 -20
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +7 -23
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +7 -21
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +7 -22
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +7 -20
- package/3rdparty/walkontable/src/table/top.js +1 -35
- package/3rdparty/walkontable/src/table/top.mjs +6 -25
- package/3rdparty/walkontable/src/table/topInlineStartCorner.js +1 -35
- package/3rdparty/walkontable/src/table/topInlineStartCorner.mjs +7 -26
- package/3rdparty/walkontable/src/table.js +74 -238
- package/3rdparty/walkontable/src/table.mjs +84 -227
- package/3rdparty/walkontable/src/types.js +0 -5
- package/3rdparty/walkontable/src/types.mjs +0 -5
- package/3rdparty/walkontable/src/utils/column.js +9 -31
- package/3rdparty/walkontable/src/utils/column.mjs +13 -30
- package/3rdparty/walkontable/src/utils/nodesPool.js +3 -12
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +3 -11
- package/3rdparty/walkontable/src/utils/orderView/constants.js +0 -3
- package/3rdparty/walkontable/src/utils/orderView/constants.mjs +0 -2
- package/3rdparty/walkontable/src/utils/orderView/index.js +0 -5
- package/3rdparty/walkontable/src/utils/orderView/sharedView.js +2 -33
- package/3rdparty/walkontable/src/utils/orderView/sharedView.mjs +6 -26
- package/3rdparty/walkontable/src/utils/orderView/view.js +14 -46
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +21 -50
- package/3rdparty/walkontable/src/utils/orderView/viewSize.js +3 -15
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +3 -14
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +8 -22
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +23 -34
- package/3rdparty/walkontable/src/utils/row.js +2 -13
- package/3rdparty/walkontable/src/utils/row.mjs +2 -12
- package/3rdparty/walkontable/src/viewport.js +38 -100
- package/3rdparty/walkontable/src/viewport.mjs +40 -99
- package/CHANGELOG.md +103 -5
- package/base.js +6 -17
- package/base.mjs +6 -12
- package/cellTypes/autocompleteType/autocompleteType.js +0 -4
- package/cellTypes/autocompleteType/index.js +0 -2
- package/cellTypes/checkboxType/checkboxType.js +0 -3
- package/cellTypes/checkboxType/index.js +0 -2
- package/cellTypes/dateType/dateType.js +0 -4
- package/cellTypes/dateType/index.js +0 -2
- package/cellTypes/dropdownType/dropdownType.js +0 -4
- package/cellTypes/dropdownType/index.js +0 -2
- package/cellTypes/handsontableType/handsontableType.js +0 -3
- package/cellTypes/handsontableType/index.js +0 -2
- package/cellTypes/index.js +0 -21
- package/cellTypes/index.mjs +3 -5
- package/cellTypes/numericType/index.js +0 -2
- package/cellTypes/numericType/numericType.js +0 -4
- package/cellTypes/passwordType/index.js +0 -2
- package/cellTypes/passwordType/passwordType.js +0 -3
- package/cellTypes/registry.js +10 -25
- package/cellTypes/registry.mjs +10 -20
- package/cellTypes/textType/index.js +0 -2
- package/cellTypes/textType/textType.js +0 -3
- package/cellTypes/timeType/index.js +0 -2
- package/cellTypes/timeType/timeType.js +0 -4
- package/core.d.ts +6 -4
- package/core.js +514 -974
- package/core.mjs +519 -921
- package/dataMap/dataMap.js +127 -212
- package/dataMap/dataMap.mjs +127 -188
- package/{dataSource.js → dataMap/dataSource.js} +18 -66
- package/{dataSource.mjs → dataMap/dataSource.mjs} +20 -60
- package/dataMap/index.js +0 -13
- package/dataMap/metaManager/index.js +21 -46
- package/dataMap/metaManager/index.mjs +47 -64
- package/dataMap/metaManager/lazyFactoryMap.js +23 -55
- package/dataMap/metaManager/lazyFactoryMap.mjs +23 -43
- package/dataMap/metaManager/metaLayers/cellMeta.js +16 -52
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +16 -37
- package/dataMap/metaManager/metaLayers/columnMeta.js +8 -22
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +14 -25
- package/dataMap/metaManager/metaLayers/globalMeta.js +4 -19
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +4 -15
- package/dataMap/metaManager/metaLayers/tableMeta.js +4 -15
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +28 -37
- package/dataMap/metaManager/metaSchema.js +196 -257
- package/dataMap/metaManager/metaSchema.mjs +196 -248
- package/dataMap/metaManager/mods/dynamicCellMeta.js +6 -36
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +20 -39
- package/dataMap/metaManager/mods/extendMetaProperties.js +5 -28
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +4 -18
- package/dataMap/metaManager/utils.js +11 -20
- package/dataMap/metaManager/utils.mjs +21 -23
- package/dataMap/replaceData.js +14 -35
- package/dataMap/replaceData.mjs +35 -45
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +64469 -93042
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +527 -284
- package/dist/handsontable.js +9616 -21414
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +3 -3
- package/dist/languages/all.js +0 -175
- package/dist/languages/ar-AR.js +0 -10
- package/dist/languages/cs-CZ.js +0 -10
- package/dist/languages/de-CH.js +0 -10
- package/dist/languages/de-DE.js +0 -10
- package/dist/languages/en-US.js +0 -10
- package/dist/languages/es-MX.js +0 -10
- package/dist/languages/fr-FR.js +0 -10
- package/dist/languages/it-IT.js +0 -10
- package/dist/languages/ja-JP.js +0 -10
- package/dist/languages/ko-KR.js +0 -10
- package/dist/languages/lv-LV.js +0 -10
- package/dist/languages/nb-NO.js +0 -10
- package/dist/languages/nl-NL.js +0 -10
- package/dist/languages/pl-PL.js +0 -10
- package/dist/languages/pt-BR.js +0 -10
- package/dist/languages/ru-RU.js +0 -10
- package/dist/languages/sr-SP.js +0 -10
- package/dist/languages/zh-CN.js +0 -10
- package/dist/languages/zh-TW.js +0 -10
- package/editorManager.js +89 -124
- package/editorManager.mjs +89 -104
- package/editors/autocompleteEditor/autocompleteEditor.js +26 -133
- package/editors/autocompleteEditor/autocompleteEditor.mjs +26 -104
- package/editors/autocompleteEditor/index.js +0 -2
- package/editors/baseEditor/baseEditor.js +45 -155
- package/editors/baseEditor/baseEditor.mjs +45 -129
- package/editors/baseEditor/index.js +0 -2
- package/editors/checkboxEditor/checkboxEditor.js +2 -33
- package/editors/checkboxEditor/checkboxEditor.mjs +2 -19
- package/editors/checkboxEditor/index.js +0 -2
- package/editors/dateEditor/dateEditor.js +36 -97
- package/editors/dateEditor/dateEditor.mjs +35 -74
- package/editors/dateEditor/index.js +0 -2
- package/editors/dropdownEditor/dropdownEditor.js +1 -41
- package/editors/dropdownEditor/dropdownEditor.mjs +1 -22
- package/editors/dropdownEditor/index.js +0 -2
- package/editors/handsontableEditor/handsontableEditor.js +13 -85
- package/editors/handsontableEditor/handsontableEditor.mjs +13 -66
- package/editors/handsontableEditor/index.js +0 -2
- package/editors/index.js +0 -25
- package/editors/index.mjs +3 -5
- package/editors/numericEditor/index.js +0 -2
- package/editors/numericEditor/numericEditor.js +1 -31
- package/editors/numericEditor/numericEditor.mjs +1 -18
- package/editors/passwordEditor/index.js +0 -2
- package/editors/passwordEditor/passwordEditor.js +1 -38
- package/editors/passwordEditor/passwordEditor.mjs +1 -22
- package/editors/registry.js +10 -36
- package/editors/registry.mjs +10 -28
- package/editors/selectEditor/index.js +0 -2
- package/editors/selectEditor/selectEditor.js +21 -73
- package/editors/selectEditor/selectEditor.mjs +21 -56
- package/editors/textEditor/caretPositioner.js +0 -12
- package/editors/textEditor/caretPositioner.mjs +10 -20
- package/editors/textEditor/index.js +0 -2
- package/editors/textEditor/textEditor.js +38 -137
- package/editors/textEditor/textEditor.mjs +38 -106
- package/editors/timeEditor/index.js +0 -2
- package/editors/timeEditor/timeEditor.js +1 -36
- package/editors/timeEditor/timeEditor.mjs +1 -21
- package/eventManager.js +20 -56
- package/eventManager.mjs +23 -56
- package/helpers/array.js +22 -88
- package/helpers/array.mjs +22 -58
- package/helpers/browser.js +25 -51
- package/helpers/browser.mjs +25 -32
- package/helpers/console.js +3 -13
- package/helpers/console.mjs +8 -16
- package/helpers/data.d.ts +0 -1
- package/helpers/data.js +10 -55
- package/helpers/data.mjs +10 -33
- package/helpers/date.js +2 -3
- package/helpers/date.mjs +2 -2
- package/helpers/dom/element.js +67 -259
- package/helpers/dom/element.mjs +74 -194
- package/helpers/dom/event.js +3 -7
- package/helpers/dom/event.mjs +3 -3
- package/helpers/feature.js +13 -47
- package/helpers/feature.mjs +13 -31
- package/helpers/function.js +14 -59
- package/helpers/function.mjs +20 -52
- package/helpers/mixed.js +9 -66
- package/helpers/mixed.mjs +15 -51
- package/helpers/number.js +4 -46
- package/helpers/number.mjs +4 -23
- package/helpers/object.js +15 -72
- package/helpers/object.mjs +21 -52
- package/helpers/string.js +6 -28
- package/helpers/string.mjs +12 -21
- package/helpers/templateLiteralTag.js +0 -6
- package/helpers/templateLiteralTag.mjs +7 -10
- package/helpers/unicode.js +17 -26
- package/helpers/unicode.mjs +17 -15
- package/helpers/wrappers/jquery.js +4 -14
- package/helpers/wrappers/jquery.mjs +4 -13
- package/i18n/constants.js +1 -3
- package/i18n/constants.mjs +1 -1
- package/i18n/index.js +0 -7
- package/i18n/languages/ar-AR.js +0 -16
- package/i18n/languages/ar-AR.mjs +1 -4
- package/i18n/languages/cs-CZ.js +0 -16
- package/i18n/languages/cs-CZ.mjs +1 -4
- package/i18n/languages/de-CH.js +0 -16
- package/i18n/languages/de-CH.mjs +1 -4
- package/i18n/languages/de-DE.js +0 -16
- package/i18n/languages/de-DE.mjs +1 -4
- package/i18n/languages/en-US.js +0 -16
- package/i18n/languages/en-US.mjs +1 -4
- package/i18n/languages/es-MX.js +0 -16
- package/i18n/languages/es-MX.mjs +1 -4
- package/i18n/languages/fr-FR.js +0 -16
- package/i18n/languages/fr-FR.mjs +1 -4
- package/i18n/languages/index.js +0 -39
- package/i18n/languages/it-IT.js +0 -16
- package/i18n/languages/it-IT.mjs +1 -4
- package/i18n/languages/ja-JP.js +0 -16
- package/i18n/languages/ja-JP.mjs +1 -4
- package/i18n/languages/ko-KR.js +0 -16
- package/i18n/languages/ko-KR.mjs +1 -4
- package/i18n/languages/lv-LV.js +0 -16
- package/i18n/languages/lv-LV.mjs +1 -4
- package/i18n/languages/nb-NO.js +0 -16
- package/i18n/languages/nb-NO.mjs +1 -4
- package/i18n/languages/nl-NL.js +0 -16
- package/i18n/languages/nl-NL.mjs +1 -4
- package/i18n/languages/pl-PL.js +0 -16
- package/i18n/languages/pl-PL.mjs +1 -4
- package/i18n/languages/pt-BR.js +0 -16
- package/i18n/languages/pt-BR.mjs +1 -4
- package/i18n/languages/ru-RU.js +0 -16
- package/i18n/languages/ru-RU.mjs +1 -4
- package/i18n/languages/sr-SP.js +0 -16
- package/i18n/languages/sr-SP.mjs +1 -4
- package/i18n/languages/zh-CN.js +0 -16
- package/i18n/languages/zh-CN.mjs +1 -4
- package/i18n/languages/zh-TW.js +0 -16
- package/i18n/languages/zh-TW.mjs +1 -4
- package/i18n/phraseFormatters/index.js +4 -11
- package/i18n/phraseFormatters/index.mjs +4 -6
- package/i18n/phraseFormatters/pluralize.js +0 -5
- package/i18n/phraseFormatters/pluralize.mjs +0 -3
- package/i18n/phraseFormatters/substituteVariables.js +0 -4
- package/i18n/phraseFormatters/substituteVariables.mjs +8 -11
- package/i18n/registry.js +18 -59
- package/i18n/registry.mjs +18 -30
- package/i18n/utils.js +4 -22
- package/i18n/utils.mjs +13 -21
- package/index.js +19 -56
- package/index.mjs +19 -15
- package/languages/all.js +0 -175
- package/languages/ar-AR.js +0 -10
- package/languages/ar-AR.mjs +1 -4
- package/languages/cs-CZ.js +0 -10
- package/languages/cs-CZ.mjs +1 -4
- package/languages/de-CH.js +0 -10
- package/languages/de-CH.mjs +1 -4
- package/languages/de-DE.js +0 -10
- package/languages/de-DE.mjs +1 -4
- package/languages/en-US.js +0 -10
- package/languages/en-US.mjs +1 -4
- package/languages/es-MX.js +0 -10
- package/languages/es-MX.mjs +1 -4
- package/languages/fr-FR.js +0 -10
- package/languages/fr-FR.mjs +1 -4
- package/languages/index.js +0 -175
- package/languages/it-IT.js +0 -10
- package/languages/it-IT.mjs +1 -4
- package/languages/ja-JP.js +0 -10
- package/languages/ja-JP.mjs +1 -4
- package/languages/ko-KR.js +0 -10
- package/languages/ko-KR.mjs +1 -4
- package/languages/lv-LV.js +0 -10
- package/languages/lv-LV.mjs +1 -4
- package/languages/nb-NO.js +0 -10
- package/languages/nb-NO.mjs +1 -4
- package/languages/nl-NL.js +0 -10
- package/languages/nl-NL.mjs +1 -4
- package/languages/pl-PL.js +0 -10
- package/languages/pl-PL.mjs +1 -4
- package/languages/pt-BR.js +0 -10
- package/languages/pt-BR.mjs +1 -4
- package/languages/ru-RU.js +0 -10
- package/languages/ru-RU.mjs +1 -4
- package/languages/sr-SP.js +0 -10
- package/languages/sr-SP.mjs +1 -4
- package/languages/zh-CN.js +0 -10
- package/languages/zh-CN.mjs +1 -4
- package/languages/zh-TW.js +0 -10
- package/languages/zh-TW.mjs +1 -4
- package/mixins/hooksRefRegisterer.js +4 -18
- package/mixins/hooksRefRegisterer.mjs +4 -15
- package/mixins/localHooks.js +7 -17
- package/mixins/localHooks.mjs +7 -14
- package/package.json +1 -1
- package/pluginHooks.d.ts +3 -4
- package/pluginHooks.js +288 -110
- package/pluginHooks.mjs +287 -97
- package/plugins/autoColumnSize/autoColumnSize.js +74 -172
- package/plugins/autoColumnSize/autoColumnSize.mjs +74 -137
- package/plugins/autoColumnSize/index.js +0 -2
- package/plugins/autoRowSize/autoRowSize.js +73 -153
- package/plugins/autoRowSize/autoRowSize.mjs +73 -124
- package/plugins/autoRowSize/index.js +0 -2
- package/plugins/autofill/autofill.js +46 -163
- package/plugins/autofill/autofill.mjs +46 -131
- package/plugins/autofill/index.js +0 -2
- package/plugins/autofill/utils.js +4 -26
- package/plugins/autofill/utils.mjs +4 -18
- package/plugins/base/base.js +21 -92
- package/plugins/base/base.mjs +21 -63
- package/plugins/base/index.js +0 -2
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +19 -52
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +19 -33
- package/plugins/bindRowsWithHeaders/index.js +0 -2
- package/plugins/bindRowsWithHeaders/maps/looseBindsMap.js +5 -41
- package/plugins/bindRowsWithHeaders/maps/looseBindsMap.mjs +5 -29
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.js +6 -53
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.mjs +6 -37
- package/plugins/collapsibleColumns/collapsibleColumns.js +96 -188
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +97 -158
- package/plugins/collapsibleColumns/index.js +0 -2
- package/plugins/columnSorting/columnSorting.js +50 -188
- package/plugins/columnSorting/columnSorting.mjs +50 -143
- package/plugins/columnSorting/columnStatesManager.js +15 -71
- package/plugins/columnSorting/columnStatesManager.mjs +15 -48
- package/plugins/columnSorting/domHelpers.js +2 -18
- package/plugins/columnSorting/domHelpers.mjs +2 -7
- package/plugins/columnSorting/index.js +0 -2
- package/plugins/columnSorting/rootComparator.js +5 -24
- package/plugins/columnSorting/rootComparator.mjs +12 -21
- package/plugins/columnSorting/sortFunction/checkbox.js +8 -16
- package/plugins/columnSorting/sortFunction/checkbox.mjs +16 -21
- package/plugins/columnSorting/sortFunction/date.js +2 -19
- package/plugins/columnSorting/sortFunction/date.mjs +10 -23
- package/plugins/columnSorting/sortFunction/default.js +2 -17
- package/plugins/columnSorting/sortFunction/default.mjs +10 -23
- package/plugins/columnSorting/sortFunction/numeric.js +2 -11
- package/plugins/columnSorting/sortFunction/numeric.mjs +10 -17
- package/plugins/columnSorting/sortService/engine.js +3 -13
- package/plugins/columnSorting/sortService/engine.mjs +3 -5
- package/plugins/columnSorting/sortService/index.js +0 -5
- package/plugins/columnSorting/sortService/registry.js +6 -18
- package/plugins/columnSorting/sortService/registry.mjs +6 -10
- package/plugins/columnSorting/utils.js +9 -34
- package/plugins/columnSorting/utils.mjs +9 -15
- package/plugins/columnSummary/columnSummary.js +66 -126
- package/plugins/columnSummary/columnSummary.mjs +66 -101
- package/plugins/columnSummary/endpoints.js +21 -98
- package/plugins/columnSummary/endpoints.mjs +26 -99
- package/plugins/columnSummary/index.js +0 -2
- package/plugins/columnSummary/utils.js +13 -0
- package/plugins/columnSummary/utils.mjs +9 -0
- package/plugins/comments/commentEditor.js +16 -28
- package/plugins/comments/commentEditor.mjs +21 -32
- package/plugins/comments/comments.js +92 -175
- package/plugins/comments/comments.mjs +92 -149
- package/plugins/comments/displaySwitch.js +6 -23
- package/plugins/comments/displaySwitch.mjs +6 -18
- package/plugins/comments/index.js +0 -2
- package/plugins/contextMenu/commandExecutor.js +9 -40
- package/plugins/contextMenu/commandExecutor.mjs +14 -41
- package/plugins/contextMenu/contextMenu.js +26 -105
- package/plugins/contextMenu/contextMenu.mjs +26 -75
- package/plugins/contextMenu/cursor.js +6 -20
- package/plugins/contextMenu/cursor.mjs +11 -24
- package/plugins/contextMenu/index.js +0 -2
- package/plugins/contextMenu/itemsFactory.js +14 -43
- package/plugins/contextMenu/itemsFactory.mjs +19 -44
- package/plugins/contextMenu/menu.js +61 -177
- package/plugins/contextMenu/menu.mjs +61 -149
- package/plugins/contextMenu/predefinedItems/alignment.js +1 -55
- package/plugins/contextMenu/predefinedItems/alignment.mjs +1 -37
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -20
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +1 -4
- package/plugins/contextMenu/predefinedItems/columnLeft.js +6 -43
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +6 -26
- package/plugins/contextMenu/predefinedItems/columnRight.js +4 -42
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +4 -25
- package/plugins/contextMenu/predefinedItems/noItems.js +1 -4
- package/plugins/contextMenu/predefinedItems/noItems.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/readOnly.js +1 -25
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +1 -8
- package/plugins/contextMenu/predefinedItems/redo.js +1 -16
- package/plugins/contextMenu/predefinedItems/redo.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.js +3 -38
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +3 -18
- package/plugins/contextMenu/predefinedItems/removeRow.js +3 -37
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +3 -17
- package/plugins/contextMenu/predefinedItems/rowAbove.js +6 -35
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +6 -19
- package/plugins/contextMenu/predefinedItems/rowBelow.js +4 -42
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +4 -25
- package/plugins/contextMenu/predefinedItems/separator.js +1 -2
- package/plugins/contextMenu/predefinedItems/separator.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/undo.js +1 -16
- package/plugins/contextMenu/predefinedItems/undo.mjs +1 -1
- package/plugins/contextMenu/predefinedItems.js +2 -48
- package/plugins/contextMenu/predefinedItems.mjs +2 -7
- package/plugins/contextMenu/utils.js +17 -57
- package/plugins/contextMenu/utils.mjs +21 -39
- package/plugins/copyPaste/clipboardData.js +1 -10
- package/plugins/copyPaste/clipboardData.mjs +1 -9
- package/plugins/copyPaste/contextMenuItem/copy.js +2 -17
- package/plugins/copyPaste/contextMenuItem/copy.mjs +6 -9
- package/plugins/copyPaste/contextMenuItem/cut.js +2 -17
- package/plugins/copyPaste/contextMenuItem/cut.mjs +6 -9
- package/plugins/copyPaste/copyPaste.js +53 -185
- package/plugins/copyPaste/copyPaste.mjs +53 -144
- package/plugins/copyPaste/focusableElement.js +12 -56
- package/plugins/copyPaste/focusableElement.mjs +15 -49
- package/plugins/copyPaste/index.js +0 -2
- package/plugins/copyPaste/pasteEvent.js +1 -10
- package/plugins/copyPaste/pasteEvent.mjs +3 -10
- package/plugins/customBorders/contextMenuItem/bottom.js +0 -17
- package/plugins/customBorders/contextMenuItem/bottom.mjs +4 -8
- package/plugins/customBorders/contextMenuItem/index.js +0 -11
- package/plugins/customBorders/contextMenuItem/left.js +0 -17
- package/plugins/customBorders/contextMenuItem/left.mjs +4 -8
- package/plugins/customBorders/contextMenuItem/noBorders.js +0 -15
- package/plugins/customBorders/contextMenuItem/noBorders.mjs +4 -6
- package/plugins/customBorders/contextMenuItem/right.js +0 -17
- package/plugins/customBorders/contextMenuItem/right.mjs +4 -8
- package/plugins/customBorders/contextMenuItem/top.js +0 -17
- package/plugins/customBorders/contextMenuItem/top.mjs +4 -8
- package/plugins/customBorders/customBorders.js +52 -181
- package/plugins/customBorders/customBorders.mjs +52 -147
- package/plugins/customBorders/index.js +0 -2
- package/plugins/customBorders/utils.js +13 -52
- package/plugins/customBorders/utils.mjs +20 -39
- package/plugins/dragToScroll/dragToScroll.js +17 -74
- package/plugins/dragToScroll/dragToScroll.mjs +17 -55
- package/plugins/dragToScroll/index.js +0 -2
- package/plugins/dropdownMenu/dropdownMenu.js +47 -126
- package/plugins/dropdownMenu/dropdownMenu.mjs +47 -95
- package/plugins/dropdownMenu/index.js +0 -2
- package/plugins/exportFile/dataProvider.js +24 -69
- package/plugins/exportFile/dataProvider.mjs +26 -60
- package/plugins/exportFile/exportFile.js +48 -58
- package/plugins/exportFile/exportFile.mjs +48 -36
- package/plugins/exportFile/index.js +0 -2
- package/plugins/exportFile/typeFactory.js +1 -11
- package/plugins/exportFile/typeFactory.mjs +1 -4
- package/plugins/exportFile/types/_base.js +2 -16
- package/plugins/exportFile/types/_base.mjs +4 -16
- package/plugins/exportFile/types/csv.js +2 -50
- package/plugins/exportFile/types/csv.mjs +2 -29
- package/plugins/filters/component/_base.js +12 -32
- package/plugins/filters/component/_base.mjs +15 -30
- package/plugins/filters/component/actionBar.js +6 -55
- package/plugins/filters/component/actionBar.mjs +9 -38
- package/plugins/filters/component/condition.js +25 -122
- package/plugins/filters/component/condition.mjs +24 -88
- package/plugins/filters/component/operators.js +10 -68
- package/plugins/filters/component/operators.mjs +10 -45
- package/plugins/filters/component/value.js +25 -99
- package/plugins/filters/component/value.mjs +28 -72
- package/plugins/filters/condition/beginsWith.js +2 -32
- package/plugins/filters/condition/beginsWith.mjs +2 -10
- package/plugins/filters/condition/between.js +3 -37
- package/plugins/filters/condition/between.mjs +3 -15
- package/plugins/filters/condition/byValue.js +3 -27
- package/plugins/filters/condition/byValue.mjs +3 -12
- package/plugins/filters/condition/contains.js +2 -32
- package/plugins/filters/condition/contains.mjs +2 -10
- package/plugins/filters/condition/date/after.js +2 -34
- package/plugins/filters/condition/date/after.mjs +2 -12
- package/plugins/filters/condition/date/before.js +2 -34
- package/plugins/filters/condition/date/before.mjs +2 -12
- package/plugins/filters/condition/date/today.js +1 -22
- package/plugins/filters/condition/date/today.mjs +1 -3
- package/plugins/filters/condition/date/tomorrow.js +1 -22
- package/plugins/filters/condition/date/tomorrow.mjs +1 -3
- package/plugins/filters/condition/date/yesterday.js +1 -22
- package/plugins/filters/condition/date/yesterday.mjs +1 -3
- package/plugins/filters/condition/empty.js +1 -19
- package/plugins/filters/condition/empty.mjs +1 -1
- package/plugins/filters/condition/endsWith.js +2 -32
- package/plugins/filters/condition/endsWith.mjs +2 -10
- package/plugins/filters/condition/equal.js +2 -31
- package/plugins/filters/condition/equal.mjs +2 -10
- package/plugins/filters/condition/false.js +1 -5
- package/plugins/filters/condition/false.mjs +1 -1
- package/plugins/filters/condition/greaterThan.js +2 -32
- package/plugins/filters/condition/greaterThan.mjs +2 -12
- package/plugins/filters/condition/greaterThanOrEqual.js +2 -32
- package/plugins/filters/condition/greaterThanOrEqual.mjs +2 -12
- package/plugins/filters/condition/lessThan.js +2 -32
- package/plugins/filters/condition/lessThan.mjs +2 -12
- package/plugins/filters/condition/lessThanOrEqual.js +2 -32
- package/plugins/filters/condition/lessThanOrEqual.mjs +2 -12
- package/plugins/filters/condition/none.js +1 -18
- package/plugins/filters/condition/none.mjs +1 -1
- package/plugins/filters/condition/notBetween.js +1 -19
- package/plugins/filters/condition/notBetween.mjs +1 -1
- package/plugins/filters/condition/notContains.js +1 -19
- package/plugins/filters/condition/notContains.mjs +1 -1
- package/plugins/filters/condition/notEmpty.js +1 -19
- package/plugins/filters/condition/notEmpty.mjs +1 -1
- package/plugins/filters/condition/notEqual.js +1 -19
- package/plugins/filters/condition/notEqual.mjs +1 -1
- package/plugins/filters/condition/true.js +1 -5
- package/plugins/filters/condition/true.mjs +1 -1
- package/plugins/filters/conditionCollection.js +21 -80
- package/plugins/filters/conditionCollection.mjs +21 -57
- package/plugins/filters/conditionRegisterer.js +5 -14
- package/plugins/filters/conditionRegisterer.mjs +5 -9
- package/plugins/filters/conditionUpdateObserver.js +17 -57
- package/plugins/filters/conditionUpdateObserver.mjs +25 -53
- package/plugins/filters/constants.js +1 -66
- package/plugins/filters/constants.mjs +1 -8
- package/plugins/filters/dataFilter.js +4 -21
- package/plugins/filters/dataFilter.mjs +7 -23
- package/plugins/filters/filters.d.ts +1 -1
- package/plugins/filters/filters.js +147 -272
- package/plugins/filters/filters.mjs +148 -228
- package/plugins/filters/index.js +0 -2
- package/plugins/filters/logicalOperationRegisterer.js +3 -9
- package/plugins/filters/logicalOperationRegisterer.mjs +3 -4
- package/plugins/filters/logicalOperations/conjunction.js +2 -19
- package/plugins/filters/logicalOperations/conjunction.mjs +2 -2
- package/plugins/filters/logicalOperations/disjunction.js +2 -19
- package/plugins/filters/logicalOperations/disjunction.mjs +2 -2
- package/plugins/filters/logicalOperations/disjunctionWithExtraCondition.js +2 -21
- package/plugins/filters/logicalOperations/disjunctionWithExtraCondition.mjs +2 -3
- package/plugins/filters/ui/_base.js +12 -55
- package/plugins/filters/ui/_base.mjs +12 -35
- package/plugins/filters/ui/input.js +7 -52
- package/plugins/filters/ui/input.mjs +7 -34
- package/plugins/filters/ui/link.js +3 -43
- package/plugins/filters/ui/link.mjs +3 -25
- package/plugins/filters/ui/multipleSelect.js +26 -120
- package/plugins/filters/ui/multipleSelect.mjs +20 -76
- package/plugins/filters/ui/radioInput.js +6 -47
- package/plugins/filters/ui/radioInput.mjs +6 -30
- package/plugins/filters/ui/select.js +14 -76
- package/plugins/filters/ui/select.mjs +14 -52
- package/plugins/filters/utils.js +6 -39
- package/plugins/filters/utils.mjs +6 -23
- package/plugins/formulas/engine/register.js +24 -74
- package/plugins/formulas/engine/register.mjs +29 -51
- package/plugins/formulas/engine/settings.js +4 -24
- package/plugins/formulas/engine/settings.mjs +4 -12
- package/plugins/formulas/formulas.js +103 -295
- package/plugins/formulas/formulas.mjs +104 -248
- package/plugins/formulas/index.js +0 -2
- package/plugins/formulas/utils.js +1 -3
- package/plugins/formulas/utils.mjs +1 -1
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +4 -38
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +8 -25
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +17 -45
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +21 -29
- package/plugins/hiddenColumns/hiddenColumns.js +72 -153
- package/plugins/hiddenColumns/hiddenColumns.mjs +72 -110
- package/plugins/hiddenColumns/index.js +0 -2
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +4 -38
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +8 -25
- package/plugins/hiddenRows/contextMenuItem/showRow.js +17 -45
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +21 -29
- package/plugins/hiddenRows/hiddenRows.js +70 -152
- package/plugins/hiddenRows/hiddenRows.mjs +70 -109
- package/plugins/hiddenRows/index.js +0 -2
- package/plugins/index.js +0 -71
- package/plugins/index.mjs +3 -5
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -28
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +5 -17
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -28
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +5 -17
- package/plugins/manualColumnFreeze/index.js +0 -2
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +21 -78
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +21 -54
- package/plugins/manualColumnMove/index.js +0 -2
- package/plugins/manualColumnMove/manualColumnMove.js +45 -134
- package/plugins/manualColumnMove/manualColumnMove.mjs +45 -106
- package/plugins/manualColumnMove/ui/_base.js +12 -30
- package/plugins/manualColumnMove/ui/_base.mjs +12 -27
- package/plugins/manualColumnMove/ui/backlight.js +1 -37
- package/plugins/manualColumnMove/ui/backlight.mjs +1 -22
- package/plugins/manualColumnMove/ui/guideline.js +1 -37
- package/plugins/manualColumnMove/ui/guideline.mjs +1 -22
- package/plugins/manualColumnResize/index.js +0 -2
- package/plugins/manualColumnResize/manualColumnResize.js +44 -143
- package/plugins/manualColumnResize/manualColumnResize.mjs +43 -118
- package/plugins/manualRowMove/index.js +0 -2
- package/plugins/manualRowMove/manualRowMove.js +45 -137
- package/plugins/manualRowMove/manualRowMove.mjs +45 -109
- package/plugins/manualRowMove/ui/_base.js +12 -27
- package/plugins/manualRowMove/ui/_base.mjs +12 -26
- package/plugins/manualRowMove/ui/backlight.js +1 -37
- package/plugins/manualRowMove/ui/backlight.mjs +1 -22
- package/plugins/manualRowMove/ui/guideline.js +1 -37
- package/plugins/manualRowMove/ui/guideline.mjs +1 -22
- package/plugins/manualRowResize/index.js +0 -2
- package/plugins/manualRowResize/manualRowResize.js +42 -138
- package/plugins/manualRowResize/manualRowResize.mjs +41 -112
- package/plugins/mergeCells/calculations/autofill.js +39 -130
- package/plugins/mergeCells/calculations/autofill.mjs +44 -122
- package/plugins/mergeCells/calculations/selection.js +9 -40
- package/plugins/mergeCells/calculations/selection.mjs +9 -37
- package/plugins/mergeCells/cellCoords.js +30 -51
- package/plugins/mergeCells/cellCoords.mjs +35 -54
- package/plugins/mergeCells/cellsCollection.js +13 -84
- package/plugins/mergeCells/cellsCollection.mjs +18 -69
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +0 -22
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +4 -11
- package/plugins/mergeCells/index.js +0 -2
- package/plugins/mergeCells/mergeCells.js +130 -333
- package/plugins/mergeCells/mergeCells.mjs +130 -292
- package/plugins/mergeCells/utils.js +0 -3
- package/plugins/mergeCells/utils.mjs +0 -1
- package/plugins/multiColumnSorting/domHelpers.js +3 -15
- package/plugins/multiColumnSorting/domHelpers.mjs +3 -7
- package/plugins/multiColumnSorting/index.js +0 -2
- package/plugins/multiColumnSorting/multiColumnSorting.js +14 -66
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +14 -44
- package/plugins/multiColumnSorting/rootComparator.js +2 -26
- package/plugins/multiColumnSorting/rootComparator.mjs +9 -23
- package/plugins/multiColumnSorting/utils.js +0 -7
- package/plugins/multiColumnSorting/utils.mjs +3 -8
- package/plugins/multipleSelectionHandles/index.js +0 -2
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +6 -109
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +6 -87
- package/plugins/nestedHeaders/index.js +0 -2
- package/plugins/nestedHeaders/nestedHeaders.js +79 -200
- package/plugins/nestedHeaders/nestedHeaders.mjs +80 -173
- package/plugins/nestedHeaders/stateManager/headersTree.js +16 -93
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +16 -73
- package/plugins/nestedHeaders/stateManager/index.js +24 -107
- package/plugins/nestedHeaders/stateManager/index.mjs +51 -115
- package/plugins/nestedHeaders/stateManager/matrixGenerator.js +7 -25
- package/plugins/nestedHeaders/stateManager/matrixGenerator.mjs +38 -51
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.js +12 -27
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +29 -35
- package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.js +10 -25
- package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs +26 -32
- package/plugins/nestedHeaders/stateManager/nodeModifiers/hideColumn.js +3 -19
- package/plugins/nestedHeaders/stateManager/nodeModifiers/hideColumn.mjs +9 -20
- package/plugins/nestedHeaders/stateManager/nodeModifiers/index.js +2 -12
- package/plugins/nestedHeaders/stateManager/nodeModifiers/index.mjs +2 -5
- package/plugins/nestedHeaders/stateManager/nodeModifiers/showColumn.js +3 -22
- package/plugins/nestedHeaders/stateManager/nodeModifiers/showColumn.mjs +9 -21
- package/plugins/nestedHeaders/stateManager/nodeModifiers/utils/tree.js +3 -10
- package/plugins/nestedHeaders/stateManager/nodeModifiers/utils/tree.mjs +3 -7
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +5 -36
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.mjs +44 -61
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +16 -78
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +21 -68
- package/plugins/nestedHeaders/stateManager/utils.js +19 -22
- package/plugins/nestedHeaders/stateManager/utils.mjs +19 -20
- package/plugins/nestedHeaders/utils/ghostTable.js +9 -37
- package/plugins/nestedHeaders/utils/ghostTable.mjs +16 -43
- package/plugins/nestedRows/data/dataManager.js +40 -161
- package/plugins/nestedRows/data/dataManager.mjs +44 -148
- package/plugins/nestedRows/index.js +0 -2
- package/plugins/nestedRows/nestedRows.js +41 -119
- package/plugins/nestedRows/nestedRows.mjs +41 -86
- package/plugins/nestedRows/ui/_base.js +1 -9
- package/plugins/nestedRows/ui/_base.mjs +1 -8
- package/plugins/nestedRows/ui/collapsing.js +28 -134
- package/plugins/nestedRows/ui/collapsing.mjs +34 -118
- package/plugins/nestedRows/ui/contextMenu.js +2 -53
- package/plugins/nestedRows/ui/contextMenu.mjs +2 -32
- package/plugins/nestedRows/ui/headers.js +5 -50
- package/plugins/nestedRows/ui/headers.mjs +11 -41
- package/plugins/nestedRows/utils/rowMoveController.js +28 -78
- package/plugins/nestedRows/utils/rowMoveController.mjs +33 -66
- package/plugins/persistentState/index.js +0 -2
- package/plugins/persistentState/persistentState.js +10 -58
- package/plugins/persistentState/persistentState.mjs +10 -37
- package/plugins/persistentState/storage.js +9 -25
- package/plugins/persistentState/storage.mjs +12 -26
- package/plugins/registry.js +7 -51
- package/plugins/registry.mjs +8 -34
- package/plugins/search/index.js +0 -2
- package/plugins/search/search.js +16 -98
- package/plugins/search/search.mjs +16 -68
- package/plugins/touchScroll/index.js +0 -2
- package/plugins/touchScroll/touchScroll.js +15 -76
- package/plugins/touchScroll/touchScroll.mjs +15 -58
- package/plugins/trimRows/index.js +0 -2
- package/plugins/trimRows/trimRows.js +62 -88
- package/plugins/trimRows/trimRows.mjs +62 -65
- package/plugins/undoRedo/index.js +0 -14
- package/plugins/undoRedo/undoRedo.js +48 -218
- package/plugins/undoRedo/undoRedo.mjs +48 -188
- package/registry.js +0 -11
- package/registry.mjs +2 -4
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +5 -14
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +5 -6
- package/renderers/autocompleteRenderer/index.js +0 -2
- package/renderers/baseRenderer/baseRenderer.js +2 -11
- package/renderers/baseRenderer/baseRenderer.mjs +2 -9
- package/renderers/baseRenderer/index.js +0 -2
- package/renderers/checkboxRenderer/checkboxRenderer.js +22 -103
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +22 -81
- package/renderers/checkboxRenderer/index.js +0 -2
- package/renderers/htmlRenderer/htmlRenderer.js +1 -7
- package/renderers/htmlRenderer/htmlRenderer.mjs +1 -1
- package/renderers/htmlRenderer/index.js +0 -2
- package/renderers/index.js +0 -19
- package/renderers/index.mjs +3 -5
- package/renderers/numericRenderer/index.js +0 -2
- package/renderers/numericRenderer/numericRenderer.js +1 -23
- package/renderers/numericRenderer/numericRenderer.mjs +1 -10
- package/renderers/passwordRenderer/index.js +0 -2
- package/renderers/passwordRenderer/passwordRenderer.js +1 -8
- package/renderers/passwordRenderer/passwordRenderer.mjs +1 -1
- package/renderers/registry.js +7 -16
- package/renderers/registry.mjs +7 -14
- package/renderers/textRenderer/index.js +0 -2
- package/renderers/textRenderer/textRenderer.js +2 -14
- package/renderers/textRenderer/textRenderer.mjs +2 -6
- package/renderers/timeRenderer/index.js +0 -2
- package/renderers/timeRenderer/timeRenderer.js +1 -6
- package/renderers/timeRenderer/timeRenderer.mjs +1 -1
- package/selection/highlight/highlight.js +17 -73
- package/selection/highlight/highlight.mjs +31 -64
- package/selection/highlight/types/activeHeader.js +1 -21
- package/selection/highlight/types/activeHeader.mjs +6 -16
- package/selection/highlight/types/area.js +2 -22
- package/selection/highlight/types/area.mjs +10 -20
- package/selection/highlight/types/cell.js +1 -21
- package/selection/highlight/types/cell.mjs +9 -19
- package/selection/highlight/types/customSelection.js +2 -22
- package/selection/highlight/types/customSelection.mjs +11 -21
- package/selection/highlight/types/fill.js +2 -17
- package/selection/highlight/types/fill.mjs +9 -14
- package/selection/highlight/types/header.js +3 -23
- package/selection/highlight/types/header.mjs +13 -23
- package/selection/highlight/types/index.js +3 -24
- package/selection/highlight/types/index.mjs +3 -10
- package/selection/highlight/visualSelection.js +24 -74
- package/selection/highlight/visualSelection.mjs +24 -62
- package/selection/index.js +0 -14
- package/selection/mouseEventHandler.js +19 -30
- package/selection/mouseEventHandler.mjs +32 -36
- package/selection/range.js +11 -31
- package/selection/range.mjs +11 -22
- package/selection/selection.js +62 -157
- package/selection/selection.mjs +65 -132
- package/selection/transformation.js +10 -40
- package/selection/transformation.mjs +18 -45
- package/selection/utils.js +22 -70
- package/selection/utils.mjs +22 -47
- package/shortcuts/context.js +23 -78
- package/shortcuts/context.mjs +23 -55
- package/shortcuts/index.js +0 -2
- package/shortcuts/keyObserver.js +4 -17
- package/shortcuts/keyObserver.mjs +4 -12
- package/shortcuts/manager.js +16 -36
- package/shortcuts/manager.mjs +16 -33
- package/shortcuts/recorder.js +20 -47
- package/shortcuts/recorder.mjs +20 -39
- package/shortcuts/utils.js +5 -24
- package/shortcuts/utils.mjs +5 -8
- package/tableView.js +100 -270
- package/tableView.mjs +100 -248
- package/translations/changesObservable/observable.js +5 -54
- package/translations/changesObservable/observable.mjs +12 -51
- package/translations/changesObservable/observer.js +4 -32
- package/translations/changesObservable/observer.mjs +9 -29
- package/translations/changesObservable/utils.js +1 -5
- package/translations/changesObservable/utils.mjs +1 -4
- package/translations/index.js +0 -11
- package/translations/indexMapper.js +70 -158
- package/translations/indexMapper.mjs +70 -125
- package/translations/mapCollections/aggregatedCollection.js +9 -51
- package/translations/mapCollections/aggregatedCollection.mjs +12 -41
- package/translations/mapCollections/index.js +0 -7
- package/translations/mapCollections/mapCollection.js +10 -33
- package/translations/mapCollections/mapCollection.mjs +10 -22
- package/translations/maps/hidingMap.js +2 -35
- package/translations/maps/hidingMap.mjs +7 -28
- package/translations/maps/index.js +1 -24
- package/translations/maps/index.mjs +1 -3
- package/translations/maps/indexMap.js +12 -34
- package/translations/maps/indexMap.mjs +16 -32
- package/translations/maps/indexesSequence.js +3 -41
- package/translations/maps/indexesSequence.mjs +9 -32
- package/translations/maps/linkedPhysicalIndexToValueMap.js +9 -78
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +16 -59
- package/translations/maps/physicalIndexToValueMap.js +2 -39
- package/translations/maps/physicalIndexToValueMap.mjs +8 -31
- package/translations/maps/trimmingMap.js +2 -35
- package/translations/maps/trimmingMap.mjs +7 -28
- package/translations/maps/utils/actionsOnIndexes.js +1 -7
- package/translations/maps/utils/actionsOnIndexes.mjs +9 -12
- package/translations/maps/utils/index.js +0 -13
- package/translations/maps/utils/index.mjs +0 -3
- package/translations/maps/utils/indexesSequence.js +1 -24
- package/translations/maps/utils/indexesSequence.mjs +10 -19
- package/translations/maps/utils/physicallyIndexed.js +1 -27
- package/translations/maps/utils/physicallyIndexed.mjs +11 -21
- package/utils/dataStructures/linkedList.js +15 -56
- package/utils/dataStructures/linkedList.mjs +15 -54
- package/utils/dataStructures/priorityMap.js +8 -46
- package/utils/dataStructures/priorityMap.mjs +8 -29
- package/utils/dataStructures/queue.js +6 -17
- package/utils/dataStructures/queue.mjs +6 -16
- package/utils/dataStructures/stack.js +6 -17
- package/utils/dataStructures/stack.mjs +6 -16
- package/utils/dataStructures/tree.js +11 -75
- package/utils/dataStructures/tree.mjs +11 -54
- package/utils/dataStructures/uniqueMap.js +17 -56
- package/utils/dataStructures/uniqueMap.mjs +17 -42
- package/utils/dataStructures/uniqueSet.js +5 -32
- package/utils/dataStructures/uniqueSet.mjs +5 -19
- package/utils/ghostTable.js +33 -104
- package/utils/ghostTable.mjs +35 -92
- package/utils/interval.js +10 -37
- package/utils/interval.mjs +7 -29
- package/utils/parseTable.js +11 -92
- package/utils/parseTable.mjs +11 -62
- package/utils/rootInstance.js +3 -14
- package/utils/rootInstance.mjs +3 -3
- package/utils/samplesGenerator.js +15 -51
- package/utils/samplesGenerator.mjs +17 -44
- package/utils/staticRegister.js +6 -33
- package/utils/staticRegister.mjs +6 -19
- package/validators/autocompleteValidator/autocompleteValidator.js +2 -10
- package/validators/autocompleteValidator/autocompleteValidator.mjs +2 -8
- package/validators/autocompleteValidator/index.js +0 -2
- package/validators/dateValidator/dateValidator.js +2 -21
- package/validators/dateValidator/dateValidator.mjs +2 -11
- package/validators/dateValidator/index.js +0 -2
- package/validators/index.js +0 -11
- package/validators/index.mjs +3 -5
- package/validators/numericValidator/index.js +0 -2
- package/validators/numericValidator/numericValidator.js +1 -7
- package/validators/numericValidator/numericValidator.mjs +1 -3
- package/validators/registry.js +7 -16
- package/validators/registry.mjs +7 -14
- package/validators/timeValidator/index.js +0 -2
- package/validators/timeValidator/timeValidator.js +6 -18
- package/validators/timeValidator/timeValidator.mjs +8 -13
- package/utils/sortingAlgorithms/mergeSort.js +0 -120
- package/utils/sortingAlgorithms/mergeSort.mjs +0 -110
package/helpers/dom/element.mjs
CHANGED
@@ -1,15 +1,9 @@
|
|
1
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
2
|
-
|
3
2
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
|
-
|
5
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
6
|
-
|
7
4
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
8
|
-
|
9
5
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
10
|
-
|
11
6
|
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; }
|
12
|
-
|
13
7
|
import "core-js/modules/es.object.get-prototype-of.js";
|
14
8
|
import "core-js/modules/es.array.includes.js";
|
15
9
|
import "core-js/modules/es.string.includes.js";
|
@@ -17,9 +11,8 @@ import "core-js/modules/es.array.slice.js";
|
|
17
11
|
import "core-js/modules/es.array.index-of.js";
|
18
12
|
import "core-js/modules/es.array.filter.js";
|
19
13
|
import "core-js/modules/es.object.to-string.js";
|
20
|
-
import "core-js/modules/es.regexp.exec.js";
|
21
|
-
import "core-js/modules/es.string.split.js";
|
22
14
|
import "core-js/modules/es.regexp.constructor.js";
|
15
|
+
import "core-js/modules/es.regexp.exec.js";
|
23
16
|
import "core-js/modules/es.regexp.to-string.js";
|
24
17
|
import "core-js/modules/es.array.join.js";
|
25
18
|
import "core-js/modules/es.string.trim.js";
|
@@ -35,27 +28,23 @@ import "core-js/modules/es.array.from.js";
|
|
35
28
|
import "core-js/modules/es.function.name.js";
|
36
29
|
import { hasCaptionProblem, isClassListSupported, isTextContentSupported, isGetComputedStyleSupported } from "../feature.mjs";
|
37
30
|
import { isSafari, isIE9 } from "../browser.mjs";
|
38
|
-
import { sanitize } from "../string.mjs";
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
*/
|
46
|
-
|
31
|
+
import { sanitize } from "../string.mjs"; /**
|
32
|
+
* Get the parent of the specified node in the DOM tree.
|
33
|
+
*
|
34
|
+
* @param {HTMLElement} element Element from which traversing is started.
|
35
|
+
* @param {number} [level=0] Traversing deep level.
|
36
|
+
* @returns {HTMLElement|null}
|
37
|
+
*/
|
47
38
|
export function getParent(element) {
|
48
39
|
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
49
40
|
var iteration = -1;
|
50
41
|
var parent = null;
|
51
42
|
var elementToCheck = element;
|
52
|
-
|
53
43
|
while (elementToCheck !== null) {
|
54
44
|
if (iteration === level) {
|
55
45
|
parent = elementToCheck;
|
56
46
|
break;
|
57
47
|
}
|
58
|
-
|
59
48
|
if (elementToCheck.host && elementToCheck.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
|
60
49
|
elementToCheck = elementToCheck.host;
|
61
50
|
} else {
|
@@ -63,39 +52,39 @@ export function getParent(element) {
|
|
63
52
|
elementToCheck = elementToCheck.parentNode;
|
64
53
|
}
|
65
54
|
}
|
66
|
-
|
67
55
|
return parent;
|
68
56
|
}
|
57
|
+
|
69
58
|
/**
|
70
59
|
* Gets `frameElement` of the specified frame. Returns null if it is a top frame or if script has no access to read property.
|
71
60
|
*
|
72
61
|
* @param {Window} frame Frame from which should be get frameElement in safe way.
|
73
62
|
* @returns {HTMLIFrameElement|null}
|
74
63
|
*/
|
75
|
-
|
76
64
|
export function getFrameElement(frame) {
|
77
65
|
return Object.getPrototypeOf(frame.parent) && frame.frameElement;
|
78
66
|
}
|
67
|
+
|
79
68
|
/**
|
80
69
|
* Gets parent frame of the specified frame. Returns null if it is a top frame or if script has no access to read property.
|
81
70
|
*
|
82
71
|
* @param {Window} frame Frame from which should be get frameElement in safe way.
|
83
72
|
* @returns {Window|null}
|
84
73
|
*/
|
85
|
-
|
86
74
|
export function getParentWindow(frame) {
|
87
75
|
return getFrameElement(frame) && frame.parent;
|
88
76
|
}
|
77
|
+
|
89
78
|
/**
|
90
79
|
* Checks if script has access to read from parent frame of specified frame.
|
91
80
|
*
|
92
81
|
* @param {Window} frame Frame from which should be get frameElement in safe way.
|
93
82
|
* @returns {boolean}
|
94
83
|
*/
|
95
|
-
|
96
84
|
export function hasAccessToParentWindow(frame) {
|
97
85
|
return !!Object.getPrototypeOf(frame.parent);
|
98
86
|
}
|
87
|
+
|
99
88
|
/**
|
100
89
|
* Goes up the DOM tree (including given element) until it finds an parent element that matches the nodes or nodes name.
|
101
90
|
* This method goes up through web components.
|
@@ -105,36 +94,31 @@ export function hasAccessToParentWindow(frame) {
|
|
105
94
|
* @param {Node} [until] The element until the traversing ends.
|
106
95
|
* @returns {Node|null}
|
107
96
|
*/
|
108
|
-
|
109
97
|
export function closest(element) {
|
110
98
|
var nodes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
111
99
|
var until = arguments.length > 2 ? arguments[2] : undefined;
|
112
100
|
var _Node = Node,
|
113
|
-
|
114
|
-
|
101
|
+
ELEMENT_NODE = _Node.ELEMENT_NODE,
|
102
|
+
DOCUMENT_FRAGMENT_NODE = _Node.DOCUMENT_FRAGMENT_NODE;
|
115
103
|
var elementToCheck = element;
|
116
|
-
|
117
104
|
while (elementToCheck !== null && elementToCheck !== void 0 && elementToCheck !== until) {
|
118
105
|
var _elementToCheck = elementToCheck,
|
119
|
-
|
120
|
-
|
121
|
-
|
106
|
+
nodeType = _elementToCheck.nodeType,
|
107
|
+
nodeName = _elementToCheck.nodeName;
|
122
108
|
if (nodeType === ELEMENT_NODE && (nodes.includes(nodeName) || nodes.includes(elementToCheck))) {
|
123
109
|
return elementToCheck;
|
124
110
|
}
|
125
|
-
|
126
111
|
var _elementToCheck2 = elementToCheck,
|
127
|
-
|
128
|
-
|
112
|
+
host = _elementToCheck2.host;
|
129
113
|
if (host && nodeType === DOCUMENT_FRAGMENT_NODE) {
|
130
114
|
elementToCheck = host;
|
131
115
|
} else {
|
132
116
|
elementToCheck = elementToCheck.parentNode;
|
133
117
|
}
|
134
118
|
}
|
135
|
-
|
136
119
|
return null;
|
137
120
|
}
|
121
|
+
|
138
122
|
/**
|
139
123
|
* Goes "down" the DOM tree (including given element) until it finds an element that matches the nodes or nodes name.
|
140
124
|
*
|
@@ -143,30 +127,25 @@ export function closest(element) {
|
|
143
127
|
* @param {HTMLElement} [until] The list of elements until the traversing ends.
|
144
128
|
* @returns {HTMLElement|null}
|
145
129
|
*/
|
146
|
-
|
147
130
|
export function closestDown(element, nodes, until) {
|
148
131
|
var matched = [];
|
149
132
|
var elementToCheck = element;
|
150
|
-
|
151
133
|
while (elementToCheck) {
|
152
134
|
elementToCheck = closest(elementToCheck, nodes, until);
|
153
|
-
|
154
135
|
if (!elementToCheck || until && !until.contains(elementToCheck)) {
|
155
136
|
break;
|
156
137
|
}
|
157
|
-
|
158
138
|
matched.push(elementToCheck);
|
159
|
-
|
160
139
|
if (elementToCheck.host && elementToCheck.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
|
161
140
|
elementToCheck = elementToCheck.host;
|
162
141
|
} else {
|
163
142
|
elementToCheck = elementToCheck.parentNode;
|
164
143
|
}
|
165
144
|
}
|
166
|
-
|
167
145
|
var length = matched.length;
|
168
146
|
return length ? matched[length - 1] : null;
|
169
147
|
}
|
148
|
+
|
170
149
|
/**
|
171
150
|
* Goes up the DOM tree and checks if element is child of another element.
|
172
151
|
*
|
@@ -175,11 +154,9 @@ export function closestDown(element, nodes, until) {
|
|
175
154
|
* If string provided, function returns `true` for the first occurrence of element with that class.
|
176
155
|
* @returns {boolean}
|
177
156
|
*/
|
178
|
-
|
179
157
|
export function isChildOf(child, parent) {
|
180
158
|
var node = child.parentNode;
|
181
159
|
var queriedParents = [];
|
182
|
-
|
183
160
|
if (typeof parent === 'string') {
|
184
161
|
if (child.defaultView) {
|
185
162
|
queriedParents = Array.prototype.slice.call(child.querySelectorAll(parent), 0);
|
@@ -189,17 +166,15 @@ export function isChildOf(child, parent) {
|
|
189
166
|
} else {
|
190
167
|
queriedParents.push(parent);
|
191
168
|
}
|
192
|
-
|
193
169
|
while (node !== null) {
|
194
170
|
if (queriedParents.indexOf(node) > -1) {
|
195
171
|
return true;
|
196
172
|
}
|
197
|
-
|
198
173
|
node = node.parentNode;
|
199
174
|
}
|
200
|
-
|
201
175
|
return false;
|
202
176
|
}
|
177
|
+
|
203
178
|
/**
|
204
179
|
* Counts index of element within its parent.
|
205
180
|
* WARNING: for performance reasons, assumes there are only element nodes (no text nodes). This is true
|
@@ -209,20 +184,18 @@ export function isChildOf(child, parent) {
|
|
209
184
|
* @param {Element} element The element to check.
|
210
185
|
* @returns {number}
|
211
186
|
*/
|
212
|
-
|
213
187
|
export function index(element) {
|
214
188
|
var i = 0;
|
215
189
|
var elementToCheck = element;
|
216
|
-
|
217
190
|
if (elementToCheck.previousSibling) {
|
218
191
|
/* eslint-disable no-cond-assign */
|
219
192
|
while (elementToCheck = elementToCheck.previousSibling) {
|
220
193
|
i += 1;
|
221
194
|
}
|
222
195
|
}
|
223
|
-
|
224
196
|
return i;
|
225
197
|
}
|
198
|
+
|
226
199
|
/**
|
227
200
|
* Check if the provided overlay contains the provided element.
|
228
201
|
*
|
@@ -231,66 +204,51 @@ export function index(element) {
|
|
231
204
|
* @param {HTMLElement} root The root element.
|
232
205
|
* @returns {boolean}
|
233
206
|
*/
|
234
|
-
|
235
207
|
export function overlayContainsElement(overlayType, element, root) {
|
236
208
|
var overlayElement = root.parentElement.querySelector(".ht_clone_".concat(overlayType));
|
237
209
|
return overlayElement ? overlayElement.contains(element) : null;
|
238
210
|
}
|
239
|
-
|
240
211
|
var _hasClass;
|
241
|
-
|
242
212
|
var _addClass;
|
243
|
-
|
244
213
|
var _removeClass;
|
214
|
+
|
245
215
|
/**
|
246
216
|
* @param {string} classNames The element "class" attribute string.
|
247
217
|
* @returns {string[]}
|
248
218
|
*/
|
249
|
-
|
250
|
-
|
251
219
|
function filterEmptyClassNames(classNames) {
|
252
220
|
if (!classNames || !classNames.length) {
|
253
221
|
return [];
|
254
222
|
}
|
255
|
-
|
256
223
|
return classNames.filter(function (x) {
|
257
224
|
return !!x;
|
258
225
|
});
|
259
226
|
}
|
260
|
-
|
261
227
|
if (isClassListSupported()) {
|
262
228
|
var isSupportMultipleClassesArg = function isSupportMultipleClassesArg(rootDocument) {
|
263
229
|
var element = rootDocument.createElement('div');
|
264
230
|
element.classList.add('test', 'test2');
|
265
231
|
return element.classList.contains('test2');
|
266
232
|
};
|
267
|
-
|
268
233
|
_hasClass = function _hasClass(element, className) {
|
269
234
|
if (element.classList === void 0 || typeof className !== 'string' || className === '') {
|
270
235
|
return false;
|
271
236
|
}
|
272
|
-
|
273
237
|
return element.classList.contains(className);
|
274
238
|
};
|
275
|
-
|
276
239
|
_addClass = function _addClass(element, classes) {
|
277
240
|
var rootDocument = element.ownerDocument;
|
278
241
|
var className = classes;
|
279
|
-
|
280
242
|
if (typeof className === 'string') {
|
281
243
|
className = className.split(' ');
|
282
244
|
}
|
283
|
-
|
284
245
|
className = filterEmptyClassNames(className);
|
285
|
-
|
286
246
|
if (className.length > 0) {
|
287
247
|
if (isSupportMultipleClassesArg(rootDocument)) {
|
288
248
|
var _element$classList;
|
289
|
-
|
290
249
|
(_element$classList = element.classList).add.apply(_element$classList, _toConsumableArray(className));
|
291
250
|
} else {
|
292
251
|
var len = 0;
|
293
|
-
|
294
252
|
while (className[len]) {
|
295
253
|
element.classList.add(className[len]);
|
296
254
|
len += 1;
|
@@ -298,25 +256,19 @@ if (isClassListSupported()) {
|
|
298
256
|
}
|
299
257
|
}
|
300
258
|
};
|
301
|
-
|
302
259
|
_removeClass = function _removeClass(element, classes) {
|
303
260
|
var rootDocument = element.ownerDocument;
|
304
261
|
var className = classes;
|
305
|
-
|
306
262
|
if (typeof className === 'string') {
|
307
263
|
className = className.split(' ');
|
308
264
|
}
|
309
|
-
|
310
265
|
className = filterEmptyClassNames(className);
|
311
|
-
|
312
266
|
if (className.length > 0) {
|
313
267
|
if (isSupportMultipleClassesArg(rootDocument)) {
|
314
268
|
var _element$classList2;
|
315
|
-
|
316
269
|
(_element$classList2 = element.classList).remove.apply(_element$classList2, _toConsumableArray(className));
|
317
270
|
} else {
|
318
271
|
var len = 0;
|
319
|
-
|
320
272
|
while (className[len]) {
|
321
273
|
element.classList.remove(className[len]);
|
322
274
|
len += 1;
|
@@ -328,22 +280,17 @@ if (isClassListSupported()) {
|
|
328
280
|
var createClassNameRegExp = function createClassNameRegExp(className) {
|
329
281
|
return new RegExp("(\\s|^)".concat(className, "(\\s|$)"));
|
330
282
|
};
|
331
|
-
|
332
283
|
_hasClass = function _hasClass(element, className) {
|
333
284
|
// http://snipplr.com/view/3561/addclass-removeclass-hasclass/
|
334
285
|
return element.className !== void 0 && createClassNameRegExp(className).test(element.className);
|
335
286
|
};
|
336
|
-
|
337
287
|
_addClass = function _addClass(element, classes) {
|
338
288
|
var _className = element.className;
|
339
289
|
var className = classes;
|
340
|
-
|
341
290
|
if (typeof className === 'string') {
|
342
291
|
className = className.split(' ');
|
343
292
|
}
|
344
|
-
|
345
293
|
className = filterEmptyClassNames(className);
|
346
|
-
|
347
294
|
if (_className === '') {
|
348
295
|
_className = className.join(' ');
|
349
296
|
} else {
|
@@ -353,32 +300,27 @@ if (isClassListSupported()) {
|
|
353
300
|
}
|
354
301
|
}
|
355
302
|
}
|
356
|
-
|
357
303
|
element.className = _className;
|
358
304
|
};
|
359
|
-
|
360
305
|
_removeClass = function _removeClass(element, classes) {
|
361
306
|
var len = 0;
|
362
307
|
var _className = element.className;
|
363
308
|
var className = classes;
|
364
|
-
|
365
309
|
if (typeof className === 'string') {
|
366
310
|
className = className.split(' ');
|
367
311
|
}
|
368
|
-
|
369
312
|
className = filterEmptyClassNames(className);
|
370
|
-
|
371
313
|
while (className[len]) {
|
372
314
|
// String.prototype.trim is defined in polyfill.js
|
373
315
|
_className = _className.replace(createClassNameRegExp(className[len]), ' ').trim();
|
374
316
|
len += 1;
|
375
317
|
}
|
376
|
-
|
377
318
|
if (element.className !== _className) {
|
378
319
|
element.className = _className;
|
379
320
|
}
|
380
321
|
};
|
381
322
|
}
|
323
|
+
|
382
324
|
/**
|
383
325
|
* Checks if element has class name.
|
384
326
|
*
|
@@ -386,46 +328,44 @@ if (isClassListSupported()) {
|
|
386
328
|
* @param {string} className Class name to check.
|
387
329
|
* @returns {boolean}
|
388
330
|
*/
|
389
|
-
|
390
|
-
|
391
331
|
export function hasClass(element, className) {
|
392
332
|
return _hasClass(element, className);
|
393
333
|
}
|
334
|
+
|
394
335
|
/**
|
395
336
|
* Add class name to an element.
|
396
337
|
*
|
397
338
|
* @param {HTMLElement} element An element to process.
|
398
339
|
* @param {string|Array} className Class name as string or array of strings.
|
399
340
|
*/
|
400
|
-
|
401
341
|
export function addClass(element, className) {
|
402
342
|
_addClass(element, className);
|
403
343
|
}
|
344
|
+
|
404
345
|
/**
|
405
346
|
* Remove class name from an element.
|
406
347
|
*
|
407
348
|
* @param {HTMLElement} element An element to process.
|
408
349
|
* @param {string|Array} className Class name as string or array of strings.
|
409
350
|
*/
|
410
|
-
|
411
351
|
export function removeClass(element, className) {
|
412
352
|
_removeClass(element, className);
|
413
353
|
}
|
354
|
+
|
414
355
|
/**
|
415
356
|
* @param {HTMLElement} element An element from the text is removed.
|
416
357
|
*/
|
417
|
-
|
418
358
|
export function removeTextNodes(element) {
|
419
359
|
if (element.nodeType === 3) {
|
420
360
|
element.parentNode.removeChild(element); // bye text nodes!
|
421
361
|
} else if (['TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TR'].indexOf(element.nodeName) > -1) {
|
422
362
|
var childs = element.childNodes;
|
423
|
-
|
424
363
|
for (var i = childs.length - 1; i >= 0; i--) {
|
425
364
|
removeTextNodes(childs[i]);
|
426
365
|
}
|
427
366
|
}
|
428
367
|
}
|
368
|
+
|
429
369
|
/**
|
430
370
|
* Remove childs function
|
431
371
|
* WARNING - this doesn't unload events and data attached by jQuery
|
@@ -434,16 +374,16 @@ export function removeTextNodes(element) {
|
|
434
374
|
*
|
435
375
|
* @param {HTMLElement} element An element to clear.
|
436
376
|
*/
|
437
|
-
|
438
377
|
export function empty(element) {
|
439
378
|
var child;
|
440
|
-
/* eslint-disable no-cond-assign */
|
441
379
|
|
380
|
+
/* eslint-disable no-cond-assign */
|
442
381
|
while (child = element.lastChild) {
|
443
382
|
element.removeChild(child);
|
444
383
|
}
|
445
384
|
}
|
446
385
|
export var HTML_CHARACTERS = /(<(.*)>|&(.*);)/;
|
386
|
+
|
447
387
|
/**
|
448
388
|
* Insert content into element trying avoid innerHTML method.
|
449
389
|
*
|
@@ -451,28 +391,26 @@ export var HTML_CHARACTERS = /(<(.*)>|&(.*);)/;
|
|
451
391
|
* @param {string} content The text to write.
|
452
392
|
* @param {boolean} [sanitizeContent=true] If `true`, the content will be sanitized before writing to the element.
|
453
393
|
*/
|
454
|
-
|
455
394
|
export function fastInnerHTML(element, content) {
|
456
395
|
var sanitizeContent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
457
|
-
|
458
396
|
if (HTML_CHARACTERS.test(content)) {
|
459
397
|
element.innerHTML = sanitizeContent ? sanitize(content) : content;
|
460
398
|
} else {
|
461
399
|
fastInnerText(element, content);
|
462
400
|
}
|
463
401
|
}
|
402
|
+
|
464
403
|
/**
|
465
404
|
* Insert text content into element.
|
466
405
|
*
|
467
406
|
* @param {HTMLElement} element An element to write into.
|
468
407
|
* @param {string} content The text to write.
|
469
408
|
*/
|
470
|
-
|
471
409
|
export function fastInnerText(element, content) {
|
472
410
|
var child = element.firstChild;
|
473
|
-
|
474
411
|
if (child && child.nodeType === 3 && child.nextSibling === null) {
|
475
412
|
// fast lane - replace existing text node
|
413
|
+
|
476
414
|
if (isTextContentSupported) {
|
477
415
|
// http://jsperf.com/replace-text-vs-reuse
|
478
416
|
child.textContent = content;
|
@@ -486,17 +424,16 @@ export function fastInnerText(element, content) {
|
|
486
424
|
element.appendChild(element.ownerDocument.createTextNode(content));
|
487
425
|
}
|
488
426
|
}
|
427
|
+
|
489
428
|
/**
|
490
429
|
* Returns true if element is attached to the DOM and visible, false otherwise.
|
491
430
|
*
|
492
431
|
* @param {HTMLElement} element An element to check.
|
493
432
|
* @returns {boolean}
|
494
433
|
*/
|
495
|
-
|
496
434
|
export function isVisible(element) {
|
497
435
|
var documentElement = element.ownerDocument.documentElement;
|
498
436
|
var next = element;
|
499
|
-
|
500
437
|
while (next !== documentElement) {
|
501
438
|
// until <html> reached
|
502
439
|
if (next === null) {
|
@@ -514,7 +451,6 @@ export function isVisible(element) {
|
|
514
451
|
// Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features enabled
|
515
452
|
return isVisible(next.host);
|
516
453
|
}
|
517
|
-
|
518
454
|
throw new Error('Lost in Web Components world');
|
519
455
|
} else {
|
520
456
|
return false; // this is a node detached from document in IE8
|
@@ -522,19 +458,17 @@ export function isVisible(element) {
|
|
522
458
|
} else if (next.style && next.style.display === 'none') {
|
523
459
|
return false;
|
524
460
|
}
|
525
|
-
|
526
461
|
next = next.parentNode;
|
527
462
|
}
|
528
|
-
|
529
463
|
return true;
|
530
464
|
}
|
465
|
+
|
531
466
|
/**
|
532
467
|
* Returns elements top and left offset relative to the document. Function is not compatible with jQuery offset.
|
533
468
|
*
|
534
469
|
* @param {HTMLElement} element An element to get the offset position from.
|
535
470
|
* @returns {object} Returns object with `top` and `left` props.
|
536
471
|
*/
|
537
|
-
|
538
472
|
export function offset(element) {
|
539
473
|
var rootDocument = element.ownerDocument;
|
540
474
|
var rootWindow = rootDocument.defaultView;
|
@@ -544,7 +478,6 @@ export function offset(element) {
|
|
544
478
|
var offsetTop;
|
545
479
|
var lastElem;
|
546
480
|
var box;
|
547
|
-
|
548
481
|
if (hasCaptionProblem() && elementToCheck.firstChild && elementToCheck.firstChild.nodeName === 'CAPTION') {
|
549
482
|
// fixes problem with Firefox ignoring <caption> in TABLE offset (see also export outerHeight)
|
550
483
|
// http://jsperf.com/offset-vs-getboundingclientrect/8
|
@@ -554,35 +487,33 @@ export function offset(element) {
|
|
554
487
|
left: box.left + (rootWindow.pageXOffset || documentElement.scrollLeft) - (documentElement.clientLeft || 0)
|
555
488
|
};
|
556
489
|
}
|
557
|
-
|
558
490
|
offsetLeft = elementToCheck.offsetLeft;
|
559
491
|
offsetTop = elementToCheck.offsetTop;
|
560
492
|
lastElem = elementToCheck;
|
561
|
-
/* eslint-disable no-cond-assign */
|
562
493
|
|
494
|
+
/* eslint-disable no-cond-assign */
|
563
495
|
while (elementToCheck = elementToCheck.offsetParent) {
|
564
496
|
// from my observation, document.body always has scrollLeft/scrollTop == 0
|
565
497
|
if (elementToCheck === rootDocument.body) {
|
566
498
|
break;
|
567
499
|
}
|
568
|
-
|
569
500
|
offsetLeft += elementToCheck.offsetLeft;
|
570
501
|
offsetTop += elementToCheck.offsetTop;
|
571
502
|
lastElem = elementToCheck;
|
572
|
-
}
|
573
|
-
|
503
|
+
}
|
574
504
|
|
505
|
+
// slow - http://jsperf.com/offset-vs-getboundingclientrect/6
|
575
506
|
if (lastElem && lastElem.style.position === 'fixed') {
|
576
507
|
// if(lastElem !== document.body) { //faster but does gives false positive in Firefox
|
577
508
|
offsetLeft += rootWindow.pageXOffset || documentElement.scrollLeft;
|
578
509
|
offsetTop += rootWindow.pageYOffset || documentElement.scrollTop;
|
579
510
|
}
|
580
|
-
|
581
511
|
return {
|
582
512
|
left: offsetLeft,
|
583
513
|
top: offsetTop
|
584
514
|
};
|
585
515
|
}
|
516
|
+
|
586
517
|
/**
|
587
518
|
* Returns the document's scrollTop property.
|
588
519
|
*
|
@@ -590,18 +521,16 @@ export function offset(element) {
|
|
590
521
|
* @returns {number}
|
591
522
|
*/
|
592
523
|
// eslint-disable-next-line no-restricted-globals
|
593
|
-
|
594
524
|
export function getWindowScrollTop() {
|
595
525
|
var rootWindow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
|
596
526
|
var res = rootWindow.scrollY;
|
597
|
-
|
598
527
|
if (res === void 0) {
|
599
528
|
// IE8-11
|
600
529
|
res = rootWindow.document.documentElement.scrollTop;
|
601
530
|
}
|
602
|
-
|
603
531
|
return res;
|
604
532
|
}
|
533
|
+
|
605
534
|
/**
|
606
535
|
* Returns the document's scrollLeft property.
|
607
536
|
*
|
@@ -609,18 +538,16 @@ export function getWindowScrollTop() {
|
|
609
538
|
* @returns {number}
|
610
539
|
*/
|
611
540
|
// eslint-disable-next-line no-restricted-globals
|
612
|
-
|
613
541
|
export function getWindowScrollLeft() {
|
614
542
|
var rootWindow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
|
615
543
|
var res = rootWindow.scrollX;
|
616
|
-
|
617
544
|
if (res === void 0) {
|
618
545
|
// IE8-11
|
619
546
|
res = rootWindow.document.documentElement.scrollLeft;
|
620
547
|
}
|
621
|
-
|
622
548
|
return res;
|
623
549
|
}
|
550
|
+
|
624
551
|
/**
|
625
552
|
* Returns the provided element's scrollTop property.
|
626
553
|
*
|
@@ -629,16 +556,14 @@ export function getWindowScrollLeft() {
|
|
629
556
|
* @returns {number}
|
630
557
|
*/
|
631
558
|
// eslint-disable-next-line no-restricted-globals
|
632
|
-
|
633
559
|
export function getScrollTop(element) {
|
634
560
|
var rootWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
|
635
|
-
|
636
561
|
if (element === rootWindow) {
|
637
562
|
return getWindowScrollTop(rootWindow);
|
638
563
|
}
|
639
|
-
|
640
564
|
return element.scrollTop;
|
641
565
|
}
|
566
|
+
|
642
567
|
/**
|
643
568
|
* Returns the provided element's scrollLeft property.
|
644
569
|
*
|
@@ -647,102 +572,86 @@ export function getScrollTop(element) {
|
|
647
572
|
* @returns {number}
|
648
573
|
*/
|
649
574
|
// eslint-disable-next-line no-restricted-globals
|
650
|
-
|
651
575
|
export function getScrollLeft(element) {
|
652
576
|
var rootWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
|
653
|
-
|
654
577
|
if (element === rootWindow) {
|
655
578
|
return getWindowScrollLeft(rootWindow);
|
656
579
|
}
|
657
|
-
|
658
580
|
return element.scrollLeft;
|
659
581
|
}
|
582
|
+
|
660
583
|
/**
|
661
584
|
* Returns a DOM element responsible for scrolling of the provided element.
|
662
585
|
*
|
663
586
|
* @param {HTMLElement} element An element to get the scrollable element from.
|
664
587
|
* @returns {HTMLElement} Element's scrollable parent.
|
665
588
|
*/
|
666
|
-
|
667
589
|
export function getScrollableElement(element) {
|
668
590
|
var rootDocument = element.ownerDocument;
|
669
591
|
var rootWindow = rootDocument ? rootDocument.defaultView : void 0;
|
670
|
-
|
671
592
|
if (!rootDocument) {
|
672
593
|
rootDocument = element.document ? element.document : element;
|
673
594
|
rootWindow = rootDocument.defaultView;
|
674
595
|
}
|
675
|
-
|
676
596
|
var props = ['auto', 'scroll'];
|
677
597
|
var supportedGetComputedStyle = isGetComputedStyleSupported();
|
678
598
|
var el = element.parentNode;
|
679
|
-
|
680
599
|
while (el && el.style && rootDocument.body !== el) {
|
681
600
|
var _el$style = el.style,
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
601
|
+
overflow = _el$style.overflow,
|
602
|
+
overflowX = _el$style.overflowX,
|
603
|
+
overflowY = _el$style.overflowY;
|
686
604
|
if ([overflow, overflowX, overflowY].includes('scroll')) {
|
687
605
|
return el;
|
688
606
|
} else if (supportedGetComputedStyle) {
|
689
607
|
var _rootWindow$getComput = rootWindow.getComputedStyle(el);
|
690
|
-
|
691
608
|
overflow = _rootWindow$getComput.overflow;
|
692
609
|
overflowX = _rootWindow$getComput.overflowX;
|
693
610
|
overflowY = _rootWindow$getComput.overflowY;
|
694
|
-
|
695
611
|
if (props.includes(overflow) || props.includes(overflowX) || props.includes(overflowY)) {
|
696
612
|
return el;
|
697
613
|
}
|
698
|
-
}
|
699
|
-
|
614
|
+
}
|
700
615
|
|
616
|
+
// The '+ 1' after the scrollHeight/scrollWidth is to prevent problems with zoomed out Chrome.
|
701
617
|
if (el.clientHeight <= el.scrollHeight + 1 && (props.includes(overflowY) || props.includes(overflow))) {
|
702
618
|
return el;
|
703
619
|
}
|
704
|
-
|
705
620
|
if (el.clientWidth <= el.scrollWidth + 1 && (props.includes(overflowX) || props.includes(overflow))) {
|
706
621
|
return el;
|
707
622
|
}
|
708
|
-
|
709
623
|
el = el.parentNode;
|
710
624
|
}
|
711
|
-
|
712
625
|
return rootWindow;
|
713
626
|
}
|
627
|
+
|
714
628
|
/**
|
715
629
|
* Returns a DOM element responsible for trimming the provided element.
|
716
630
|
*
|
717
631
|
* @param {HTMLElement} base Base element.
|
718
632
|
* @returns {HTMLElement} Base element's trimming parent.
|
719
633
|
*/
|
720
|
-
|
721
634
|
export function getTrimmingContainer(base) {
|
722
635
|
var rootDocument = base.ownerDocument;
|
723
636
|
var rootWindow = rootDocument.defaultView;
|
724
637
|
var el = base.parentNode;
|
725
|
-
|
726
638
|
while (el && el.style && rootDocument.body !== el) {
|
727
639
|
if (el.style.overflow !== 'visible' && el.style.overflow !== '') {
|
728
640
|
return el;
|
729
641
|
}
|
730
|
-
|
731
642
|
var computedStyle = getComputedStyle(el, rootWindow);
|
732
643
|
var allowedProperties = ['scroll', 'hidden', 'auto'];
|
733
644
|
var property = computedStyle.getPropertyValue('overflow');
|
734
645
|
var propertyY = computedStyle.getPropertyValue('overflow-y');
|
735
646
|
var propertyX = computedStyle.getPropertyValue('overflow-x');
|
736
|
-
|
737
647
|
if (allowedProperties.includes(property) || allowedProperties.includes(propertyY) || allowedProperties.includes(propertyX)) {
|
738
648
|
return el;
|
739
649
|
}
|
740
|
-
|
741
650
|
el = el.parentNode;
|
742
651
|
}
|
743
|
-
|
744
652
|
return rootWindow;
|
745
653
|
}
|
654
|
+
|
746
655
|
/**
|
747
656
|
* Returns a style property for the provided element. (Be it an inline or external style).
|
748
657
|
*
|
@@ -752,10 +661,8 @@ export function getTrimmingContainer(base) {
|
|
752
661
|
* @returns {string|undefined} Element's style property.
|
753
662
|
*/
|
754
663
|
// eslint-disable-next-line no-restricted-globals
|
755
|
-
|
756
664
|
export function getStyle(element, prop) {
|
757
665
|
var rootWindow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : window;
|
758
|
-
|
759
666
|
if (!element) {
|
760
667
|
return;
|
761
668
|
} else if (element === rootWindow) {
|
@@ -764,22 +671,18 @@ export function getStyle(element, prop) {
|
|
764
671
|
} else if (prop === 'height') {
|
765
672
|
return "".concat(rootWindow.innerHeight, "px");
|
766
673
|
}
|
767
|
-
|
768
674
|
return;
|
769
675
|
}
|
770
|
-
|
771
676
|
var styleProp = element.style[prop];
|
772
|
-
|
773
677
|
if (styleProp !== '' && styleProp !== void 0) {
|
774
678
|
return styleProp;
|
775
679
|
}
|
776
|
-
|
777
680
|
var computedStyle = getComputedStyle(element, rootWindow);
|
778
|
-
|
779
681
|
if (computedStyle[prop] !== '' && computedStyle[prop] !== void 0) {
|
780
682
|
return computedStyle[prop];
|
781
683
|
}
|
782
684
|
}
|
685
|
+
|
783
686
|
/**
|
784
687
|
* Verifies if element fit to provided CSSRule.
|
785
688
|
*
|
@@ -787,11 +690,9 @@ export function getStyle(element, prop) {
|
|
787
690
|
* @param {CSSRule} rule Selector text from CSSRule.
|
788
691
|
* @returns {boolean}
|
789
692
|
*/
|
790
|
-
|
791
693
|
export function matchesCSSRules(element, rule) {
|
792
694
|
var selectorText = rule.selectorText;
|
793
695
|
var result = false;
|
794
|
-
|
795
696
|
if (rule.type === CSSRule.STYLE_RULE && selectorText) {
|
796
697
|
if (element.msMatchesSelector) {
|
797
698
|
result = element.msMatchesSelector(selectorText);
|
@@ -799,9 +700,9 @@ export function matchesCSSRules(element, rule) {
|
|
799
700
|
result = element.matches(selectorText);
|
800
701
|
}
|
801
702
|
}
|
802
|
-
|
803
703
|
return result;
|
804
704
|
}
|
705
|
+
|
805
706
|
/**
|
806
707
|
* Returns a computed style object for the provided element. (Needed if style is declared in external stylesheet).
|
807
708
|
*
|
@@ -810,28 +711,27 @@ export function matchesCSSRules(element, rule) {
|
|
810
711
|
* @returns {IEElementStyle|CssStyle} Elements computed style object.
|
811
712
|
*/
|
812
713
|
// eslint-disable-next-line no-restricted-globals
|
813
|
-
|
814
714
|
export function getComputedStyle(element) {
|
815
715
|
var rootWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
|
816
716
|
return element.currentStyle || rootWindow.getComputedStyle(element);
|
817
717
|
}
|
718
|
+
|
818
719
|
/**
|
819
720
|
* Returns the element's outer width.
|
820
721
|
*
|
821
722
|
* @param {HTMLElement} element An element to get the width from.
|
822
723
|
* @returns {number} Element's outer width.
|
823
724
|
*/
|
824
|
-
|
825
725
|
export function outerWidth(element) {
|
826
726
|
return element.offsetWidth;
|
827
727
|
}
|
728
|
+
|
828
729
|
/**
|
829
730
|
* Returns the element's outer height.
|
830
731
|
*
|
831
732
|
* @param {HTMLElement} element An element to get the height from.
|
832
733
|
* @returns {number} Element's outer height.
|
833
734
|
*/
|
834
|
-
|
835
735
|
export function outerHeight(element) {
|
836
736
|
if (hasCaptionProblem() && element.firstChild && element.firstChild.nodeName === 'CAPTION') {
|
837
737
|
// fixes problem with Firefox ignoring <caption> in TABLE.offsetHeight
|
@@ -843,47 +743,47 @@ export function outerHeight(element) {
|
|
843
743
|
// http://lists.w3.org/Archives/Public/www-style/2009Oct/0140.html#start140
|
844
744
|
return element.offsetHeight + element.firstChild.offsetHeight;
|
845
745
|
}
|
846
|
-
|
847
746
|
return element.offsetHeight;
|
848
747
|
}
|
748
|
+
|
849
749
|
/**
|
850
750
|
* Returns the element's inner height.
|
851
751
|
*
|
852
752
|
* @param {HTMLElement} element An element to get the height from.
|
853
753
|
* @returns {number} Element's inner height.
|
854
754
|
*/
|
855
|
-
|
856
755
|
export function innerHeight(element) {
|
857
756
|
return element.clientHeight || element.innerHeight;
|
858
757
|
}
|
758
|
+
|
859
759
|
/**
|
860
760
|
* Returns the element's inner width.
|
861
761
|
*
|
862
762
|
* @param {HTMLElement} element An element to get the width from.
|
863
763
|
* @returns {number} Element's inner width.
|
864
764
|
*/
|
865
|
-
|
866
765
|
export function innerWidth(element) {
|
867
766
|
return element.clientWidth || element.innerWidth;
|
868
767
|
}
|
768
|
+
|
869
769
|
/**
|
870
770
|
* @param {HTMLElement} element An element to which the event is added.
|
871
771
|
* @param {string} event The event name.
|
872
772
|
* @param {Function} callback The callback to add.
|
873
773
|
*/
|
874
|
-
|
875
774
|
export function addEvent(element, event, callback) {
|
876
775
|
element.addEventListener(event, callback, false);
|
877
776
|
}
|
777
|
+
|
878
778
|
/**
|
879
779
|
* @param {HTMLElement} element An element from which the event is removed.
|
880
780
|
* @param {string} event The event name.
|
881
781
|
* @param {Function} callback The function reference to remove.
|
882
782
|
*/
|
883
|
-
|
884
783
|
export function removeEvent(element, event, callback) {
|
885
784
|
element.removeEventListener(event, callback, false);
|
886
785
|
}
|
786
|
+
|
887
787
|
/**
|
888
788
|
* Returns caret position in text input.
|
889
789
|
*
|
@@ -891,56 +791,48 @@ export function removeEvent(element, event, callback) {
|
|
891
791
|
* @param {HTMLElement} el An element to check.
|
892
792
|
* @returns {number}
|
893
793
|
*/
|
894
|
-
|
895
794
|
export function getCaretPosition(el) {
|
896
795
|
var rootDocument = el.ownerDocument;
|
897
|
-
|
898
796
|
if (el.selectionStart) {
|
899
797
|
return el.selectionStart;
|
900
798
|
} else if (rootDocument.selection) {
|
901
799
|
// IE8
|
902
800
|
el.focus();
|
903
801
|
var r = rootDocument.selection.createRange();
|
904
|
-
|
905
802
|
if (r === null) {
|
906
803
|
return 0;
|
907
804
|
}
|
908
|
-
|
909
805
|
var re = el.createTextRange();
|
910
806
|
var rc = re.duplicate();
|
911
807
|
re.moveToBookmark(r.getBookmark());
|
912
808
|
rc.setEndPoint('EndToStart', re);
|
913
809
|
return rc.text.length;
|
914
810
|
}
|
915
|
-
|
916
811
|
return 0;
|
917
812
|
}
|
813
|
+
|
918
814
|
/**
|
919
815
|
* Returns end of the selection in text input.
|
920
816
|
*
|
921
817
|
* @param {HTMLElement} el An element to check.
|
922
818
|
* @returns {number}
|
923
819
|
*/
|
924
|
-
|
925
820
|
export function getSelectionEndPosition(el) {
|
926
821
|
var rootDocument = el.ownerDocument;
|
927
|
-
|
928
822
|
if (el.selectionEnd) {
|
929
823
|
return el.selectionEnd;
|
930
824
|
} else if (rootDocument.selection) {
|
931
825
|
// IE8
|
932
826
|
var r = rootDocument.selection.createRange();
|
933
|
-
|
934
827
|
if (r === null) {
|
935
828
|
return 0;
|
936
829
|
}
|
937
|
-
|
938
830
|
var re = el.createTextRange();
|
939
831
|
return re.text.indexOf(r.text) + r.text.length;
|
940
832
|
}
|
941
|
-
|
942
833
|
return 0;
|
943
834
|
}
|
835
|
+
|
944
836
|
/**
|
945
837
|
* Returns text under selection.
|
946
838
|
*
|
@@ -948,31 +840,29 @@ export function getSelectionEndPosition(el) {
|
|
948
840
|
* @returns {string}
|
949
841
|
*/
|
950
842
|
// eslint-disable-next-line no-restricted-globals
|
951
|
-
|
952
843
|
export function getSelectionText() {
|
953
844
|
var rootWindow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
|
954
845
|
var rootDocument = rootWindow.document;
|
955
846
|
var text = '';
|
956
|
-
|
957
847
|
if (rootWindow.getSelection) {
|
958
848
|
text = rootWindow.getSelection().toString();
|
959
849
|
} else if (rootDocument.selection && rootDocument.selection.type !== 'Control') {
|
960
850
|
text = rootDocument.selection.createRange().text;
|
961
851
|
}
|
962
|
-
|
963
852
|
return text;
|
964
853
|
}
|
854
|
+
|
965
855
|
/**
|
966
856
|
* Cross-platform helper to clear text selection.
|
967
857
|
*
|
968
858
|
* @param {Window} [rootWindow] The document window owner.
|
969
859
|
*/
|
970
860
|
// eslint-disable-next-line no-restricted-globals
|
971
|
-
|
972
861
|
export function clearTextSelection() {
|
973
862
|
var rootWindow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
|
974
|
-
var rootDocument = rootWindow.document;
|
863
|
+
var rootDocument = rootWindow.document;
|
975
864
|
|
865
|
+
// http://stackoverflow.com/questions/3169786/clear-text-selection-with-javascript
|
976
866
|
if (rootWindow.getSelection) {
|
977
867
|
if (rootWindow.getSelection().empty) {
|
978
868
|
// Chrome
|
@@ -986,6 +876,7 @@ export function clearTextSelection() {
|
|
986
876
|
rootDocument.selection.empty();
|
987
877
|
}
|
988
878
|
}
|
879
|
+
|
989
880
|
/**
|
990
881
|
* Sets caret position in text input.
|
991
882
|
*
|
@@ -994,15 +885,12 @@ export function clearTextSelection() {
|
|
994
885
|
* @param {number} pos The selection start position.
|
995
886
|
* @param {number} endPos The selection end position.
|
996
887
|
*/
|
997
|
-
|
998
888
|
export function setCaretPosition(element, pos, endPos) {
|
999
889
|
if (endPos === void 0) {
|
1000
890
|
endPos = pos;
|
1001
891
|
}
|
1002
|
-
|
1003
892
|
if (element.setSelectionRange) {
|
1004
893
|
element.focus();
|
1005
|
-
|
1006
894
|
try {
|
1007
895
|
element.setSelectionRange(pos, endPos);
|
1008
896
|
} catch (err) {
|
@@ -1015,6 +903,7 @@ export function setCaretPosition(element, pos, endPos) {
|
|
1015
903
|
}
|
1016
904
|
}
|
1017
905
|
var cachedScrollbarWidth;
|
906
|
+
|
1018
907
|
/**
|
1019
908
|
* Helper to calculate scrollbar width.
|
1020
909
|
* Source: https://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes.
|
@@ -1024,7 +913,6 @@ var cachedScrollbarWidth;
|
|
1024
913
|
* @returns {number}
|
1025
914
|
*/
|
1026
915
|
// eslint-disable-next-line no-restricted-globals
|
1027
|
-
|
1028
916
|
function walkontableCalculateScrollbarWidth() {
|
1029
917
|
var rootDocument = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
1030
918
|
var inner = rootDocument.createElement('div');
|
@@ -1044,14 +932,13 @@ function walkontableCalculateScrollbarWidth() {
|
|
1044
932
|
var w1 = inner.offsetWidth;
|
1045
933
|
outer.style.overflow = 'scroll';
|
1046
934
|
var w2 = inner.offsetWidth;
|
1047
|
-
|
1048
935
|
if (w1 === w2) {
|
1049
936
|
w2 = outer.clientWidth;
|
1050
937
|
}
|
1051
|
-
|
1052
938
|
(rootDocument.body || rootDocument.documentElement).removeChild(outer);
|
1053
939
|
return w1 - w2;
|
1054
940
|
}
|
941
|
+
|
1055
942
|
/**
|
1056
943
|
* Returns the computed width of the native browser scroll bar.
|
1057
944
|
*
|
@@ -1059,37 +946,34 @@ function walkontableCalculateScrollbarWidth() {
|
|
1059
946
|
* @returns {number} Width.
|
1060
947
|
*/
|
1061
948
|
// eslint-disable-next-line no-restricted-globals
|
1062
|
-
|
1063
|
-
|
1064
949
|
export function getScrollbarWidth() {
|
1065
950
|
var rootDocument = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
1066
|
-
|
1067
951
|
if (cachedScrollbarWidth === void 0) {
|
1068
952
|
cachedScrollbarWidth = walkontableCalculateScrollbarWidth(rootDocument);
|
1069
953
|
}
|
1070
|
-
|
1071
954
|
return cachedScrollbarWidth;
|
1072
955
|
}
|
956
|
+
|
1073
957
|
/**
|
1074
958
|
* Checks if the provided element has a vertical scrollbar.
|
1075
959
|
*
|
1076
960
|
* @param {HTMLElement} element An element to check.
|
1077
961
|
* @returns {boolean}
|
1078
962
|
*/
|
1079
|
-
|
1080
963
|
export function hasVerticalScrollbar(element) {
|
1081
964
|
return element.offsetWidth !== element.clientWidth;
|
1082
965
|
}
|
966
|
+
|
1083
967
|
/**
|
1084
968
|
* Checks if the provided element has a vertical scrollbar.
|
1085
969
|
*
|
1086
970
|
* @param {HTMLElement} element An element to check.
|
1087
971
|
* @returns {boolean}
|
1088
972
|
*/
|
1089
|
-
|
1090
973
|
export function hasHorizontalScrollbar(element) {
|
1091
974
|
return element.offsetHeight !== element.clientHeight;
|
1092
975
|
}
|
976
|
+
|
1093
977
|
/**
|
1094
978
|
* Sets overlay position depending on it's type and used browser.
|
1095
979
|
*
|
@@ -1097,7 +981,6 @@ export function hasHorizontalScrollbar(element) {
|
|
1097
981
|
* @param {number|string} left The left position of the overlay.
|
1098
982
|
* @param {number|string} top The top position of the overlay.
|
1099
983
|
*/
|
1100
|
-
|
1101
984
|
export function setOverlayPosition(overlayElem, left, top) {
|
1102
985
|
if (isIE9()) {
|
1103
986
|
overlayElem.style.top = top;
|
@@ -1108,26 +991,24 @@ export function setOverlayPosition(overlayElem, left, top) {
|
|
1108
991
|
overlayElem.style.transform = "translate3d(".concat(left, ",").concat(top, ",0)");
|
1109
992
|
}
|
1110
993
|
}
|
994
|
+
|
1111
995
|
/**
|
1112
996
|
* @param {HTMLElement} element An element to process.
|
1113
997
|
* @returns {number|Array}
|
1114
998
|
*/
|
1115
|
-
|
1116
999
|
export function getCssTransform(element) {
|
1117
1000
|
var transform;
|
1118
|
-
|
1119
1001
|
if (element.style.transform && (transform = element.style.transform) !== '') {
|
1120
1002
|
return ['transform', transform];
|
1121
1003
|
} else if (element.style['-webkit-transform'] && (transform = element.style['-webkit-transform']) !== '') {
|
1122
1004
|
return ['-webkit-transform', transform];
|
1123
1005
|
}
|
1124
|
-
|
1125
1006
|
return -1;
|
1126
1007
|
}
|
1008
|
+
|
1127
1009
|
/**
|
1128
1010
|
* @param {HTMLElement} element An element to process.
|
1129
1011
|
*/
|
1130
|
-
|
1131
1012
|
export function resetCssTransform(element) {
|
1132
1013
|
if (element.style.transform && element.style.transform !== '') {
|
1133
1014
|
element.style.transform = '';
|
@@ -1135,6 +1016,7 @@ export function resetCssTransform(element) {
|
|
1135
1016
|
element.style['-webkit-transform'] = '';
|
1136
1017
|
}
|
1137
1018
|
}
|
1019
|
+
|
1138
1020
|
/**
|
1139
1021
|
* Determines if the given DOM element is an input field.
|
1140
1022
|
* Notice: By 'input' we mean input, textarea and select nodes.
|
@@ -1142,11 +1024,11 @@ export function resetCssTransform(element) {
|
|
1142
1024
|
* @param {HTMLElement} element - DOM element.
|
1143
1025
|
* @returns {boolean}
|
1144
1026
|
*/
|
1145
|
-
|
1146
1027
|
export function isInput(element) {
|
1147
1028
|
var inputs = ['INPUT', 'SELECT', 'TEXTAREA'];
|
1148
1029
|
return element && (inputs.indexOf(element.nodeName) > -1 || element.contentEditable === 'true');
|
1149
1030
|
}
|
1031
|
+
|
1150
1032
|
/**
|
1151
1033
|
* Determines if the given DOM element is an input field placed OUTSIDE of HOT.
|
1152
1034
|
* Notice: By 'input' we mean input, textarea and select nodes which have defined 'data-hot-input' attribute.
|
@@ -1154,30 +1036,28 @@ export function isInput(element) {
|
|
1154
1036
|
* @param {HTMLElement} element - DOM element.
|
1155
1037
|
* @returns {boolean}
|
1156
1038
|
*/
|
1157
|
-
|
1158
1039
|
export function isOutsideInput(element) {
|
1159
1040
|
return isInput(element) && element.hasAttribute('data-hot-input') === false;
|
1160
1041
|
}
|
1042
|
+
|
1161
1043
|
/**
|
1162
1044
|
* Check if the given DOM element can be focused (by using "select" method).
|
1163
1045
|
*
|
1164
1046
|
* @param {HTMLElement} element - DOM element.
|
1165
1047
|
*/
|
1166
|
-
|
1167
1048
|
export function selectElementIfAllowed(element) {
|
1168
1049
|
var activeElement = element.ownerDocument.activeElement;
|
1169
|
-
|
1170
1050
|
if (!isOutsideInput(activeElement)) {
|
1171
1051
|
element.select();
|
1172
1052
|
}
|
1173
1053
|
}
|
1054
|
+
|
1174
1055
|
/**
|
1175
1056
|
* Check if the provided element is detached from DOM.
|
1176
1057
|
*
|
1177
1058
|
* @param {HTMLElement} element HTML element to be checked.
|
1178
1059
|
* @returns {boolean} `true` if the element is detached, `false` otherwise.
|
1179
1060
|
*/
|
1180
|
-
|
1181
1061
|
export function isDetached(element) {
|
1182
1062
|
return !element.parentNode;
|
1183
1063
|
}
|