handsontable 0.34.1 → 0.34.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/.travis.yml +2 -0
- package/README.md +127 -96
- package/commonjs/core.js +11 -6
- package/commonjs/helpers/dom/element.js +4 -3
- package/commonjs/helpers/mixed.js +8 -4
- package/commonjs/index.js +5 -4
- package/commonjs/pluginHooks.js +18 -2
- package/commonjs/plugins/copyPaste/clipboardData.js +31 -0
- package/commonjs/plugins/copyPaste/contextMenuItem/copy.js +1 -2
- package/commonjs/plugins/copyPaste/contextMenuItem/cut.js +1 -2
- package/commonjs/plugins/copyPaste/copyPaste.js +127 -134
- package/commonjs/plugins/copyPaste/pasteEvent.js +19 -0
- package/commonjs/plugins/copyPaste/test/copyPaste.e2e.js +90 -189
- package/commonjs/plugins/copyPaste/test/textarea.unit.js +2 -2
- package/commonjs/plugins/copyPaste/textarea.js +2 -1
- package/commonjs/plugins/manualColumnMove/manualColumnMove.js +8 -11
- package/commonjs/plugins/manualColumnMove/test/manualColumnMoveUI.e2e.js +35 -0
- package/commonjs/plugins/manualRowMove/manualRowMove.js +9 -12
- package/commonjs/plugins/manualRowMove/test/manualRowMove.e2e.js +256 -60
- package/commonjs/plugins/manualRowMove/test/manualRowMoveUI.e2e.js +40 -182
- package/commonjs/plugins/manualRowMove/ui/_base.js +2 -2
- package/commonjs/tableView.js +1 -0
- package/dist/handsontable.css +6 -5
- package/dist/handsontable.css.map +1 -1
- package/dist/handsontable.full.css +6 -5
- package/dist/handsontable.full.js +37721 -42290
- package/dist/handsontable.full.min.css +4 -4
- package/dist/handsontable.full.min.js +5 -5
- package/dist/handsontable.js +28732 -28433
- package/dist/handsontable.js.map +1 -1
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +3 -3
- package/es/core.js +11 -6
- package/es/helpers/dom/element.js +4 -3
- package/es/helpers/mixed.js +4 -4
- package/es/index.js +3 -4
- package/es/pluginHooks.js +18 -2
- package/es/plugins/copyPaste/clipboardData.js +27 -0
- package/es/plugins/copyPaste/contextMenuItem/copy.js +1 -2
- package/es/plugins/copyPaste/contextMenuItem/cut.js +1 -2
- package/es/plugins/copyPaste/copyPaste.js +124 -132
- package/es/plugins/copyPaste/pasteEvent.js +11 -0
- package/es/plugins/copyPaste/test/copyPaste.e2e.js +90 -189
- package/es/plugins/copyPaste/test/textarea.unit.js +2 -2
- package/es/plugins/copyPaste/textarea.js +2 -1
- package/es/plugins/manualColumnMove/manualColumnMove.js +8 -11
- package/es/plugins/manualColumnMove/test/manualColumnMoveUI.e2e.js +35 -0
- package/es/plugins/manualRowMove/manualRowMove.js +9 -12
- package/es/plugins/manualRowMove/test/manualRowMove.e2e.js +256 -60
- package/es/plugins/manualRowMove/test/manualRowMoveUI.e2e.js +40 -182
- package/es/plugins/manualRowMove/ui/_base.js +2 -2
- package/es/tableView.js +1 -0
- package/handsontable.jquery.json +1 -1
- package/hot.config.js +1 -1
- package/package.json +5 -5
- package/src/3rdparty/walkontable/dist/walkontable.js +27234 -11175
- package/src/3rdparty/walkontable/dist/walkontable.js.map +1 -1
- package/src/3rdparty/walkontable/test/dist/helpers.entry.js +32 -36
- package/src/3rdparty/walkontable/test/dist/helpers.entry.js.map +1 -1
- package/src/3rdparty/walkontable/test/dist/specs.entry.js +36 -39
- package/src/3rdparty/walkontable/test/dist/specs.entry.js.map +1 -1
- package/src/core.js +11 -6
- package/src/css/handsontable.css +1 -2
- package/src/helpers/dom/element.js +4 -3
- package/src/helpers/mixed.js +3 -3
- package/src/index.js +1 -2
- package/src/pluginHooks.js +18 -2
- package/src/plugins/copyPaste/clipboardData.js +11 -0
- package/src/plugins/copyPaste/contextMenuItem/copy.js +1 -2
- package/src/plugins/copyPaste/contextMenuItem/cut.js +1 -2
- package/src/plugins/copyPaste/copyPaste.css +3 -1
- package/src/plugins/copyPaste/copyPaste.js +120 -127
- package/src/plugins/copyPaste/pasteEvent.js +7 -0
- package/src/plugins/copyPaste/test/copyPaste.e2e.js +75 -193
- package/src/plugins/copyPaste/test/textarea.unit.js +2 -2
- package/src/plugins/copyPaste/textarea.js +2 -1
- package/src/plugins/manualColumnMove/manualColumnMove.js +6 -9
- package/src/plugins/manualColumnMove/test/manualColumnMoveUI.e2e.js +35 -0
- package/src/plugins/manualRowMove/manualRowMove.js +7 -10
- package/src/plugins/manualRowMove/test/manualRowMove.e2e.js +282 -86
- package/src/plugins/manualRowMove/test/manualRowMoveUI.e2e.js +51 -190
- package/src/plugins/manualRowMove/ui/_base.js +2 -2
- package/test/dist/e2e.entry.js +31381 -31131
- package/test/dist/e2e.entry.js.map +1 -1
- package/test/dist/helpers.entry.js +16 -19
- package/test/dist/helpers.entry.js.map +1 -1
- package/test/e2e/Core_listen.spec.js +32 -0
- package/test/e2e/Core_selection.spec.js +1 -1
- package/test/e2e/Core_validate.spec.js +29 -0
- package/test/e2e/renderers/checkboxRenderer.spec.js +20 -7
- package/test/e2e/settings/fragmentSelection.spec.js +12 -9
- package/test/scripts/trigger-pro-tests.sh +41 -0
- package/yarn.lock +260 -208
- package/.npmignore +0 -19
- package/demo/bower_components/numbro/package.json +0 -63
@@ -23,8 +23,8 @@
|
|
23
23
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
24
24
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
25
|
*
|
26
|
-
* Version: 0.34.
|
27
|
-
* Release date:
|
26
|
+
* Version: 0.34.5
|
27
|
+
* Release date: 11/10/2017 (built at 12/10/2017 09:35:44)
|
28
28
|
*/
|
29
29
|
/******/ (function(modules) { // webpackBootstrap
|
30
30
|
/******/ // The module cache
|
@@ -61,9 +61,6 @@
|
|
61
61
|
/******/ // expose the module cache
|
62
62
|
/******/ __webpack_require__.c = installedModules;
|
63
63
|
/******/
|
64
|
-
/******/ // identity function for calling harmony imports with the correct context
|
65
|
-
/******/ __webpack_require__.i = function(value) { return value; };
|
66
|
-
/******/
|
67
64
|
/******/ // define getter function for harmony exports
|
68
65
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
69
66
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
@@ -91,33 +88,26 @@
|
|
91
88
|
/******/ __webpack_require__.p = "";
|
92
89
|
/******/
|
93
90
|
/******/ // Load entry module and return exports
|
94
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
91
|
+
/******/ return __webpack_require__(__webpack_require__.s = 76);
|
95
92
|
/******/ })
|
96
93
|
/************************************************************************/
|
97
94
|
/******/ ({
|
98
95
|
|
99
|
-
/***/
|
100
|
-
/***/ (function(module, exports) {
|
101
|
-
|
102
|
-
module.exports = window;
|
103
|
-
|
104
|
-
/***/ }),
|
105
|
-
|
106
|
-
/***/ 242:
|
96
|
+
/***/ 76:
|
107
97
|
/***/ (function(module, exports, __webpack_require__) {
|
108
98
|
|
109
99
|
"use strict";
|
110
100
|
|
111
101
|
|
112
|
-
var _window = __webpack_require__(
|
102
|
+
var _window = __webpack_require__(77);
|
113
103
|
|
114
104
|
var _window2 = _interopRequireDefault(_window);
|
115
105
|
|
116
|
-
var _common = __webpack_require__(
|
106
|
+
var _common = __webpack_require__(78);
|
117
107
|
|
118
108
|
var common = _interopRequireWildcard(_common);
|
119
109
|
|
120
|
-
var _jasmine = __webpack_require__(
|
110
|
+
var _jasmine = __webpack_require__(79);
|
121
111
|
|
122
112
|
var jasmine = _interopRequireWildcard(_jasmine);
|
123
113
|
|
@@ -146,7 +136,14 @@ exportToWindow(jasmine);
|
|
146
136
|
|
147
137
|
/***/ }),
|
148
138
|
|
149
|
-
/***/
|
139
|
+
/***/ 77:
|
140
|
+
/***/ (function(module, exports) {
|
141
|
+
|
142
|
+
module.exports = window;
|
143
|
+
|
144
|
+
/***/ }),
|
145
|
+
|
146
|
+
/***/ 78:
|
150
147
|
/***/ (function(module, exports, __webpack_require__) {
|
151
148
|
|
152
149
|
"use strict";
|
@@ -915,7 +912,7 @@ function triggerTouchEvent(type, target, pageX, pageY) {
|
|
915
912
|
|
916
913
|
/***/ }),
|
917
914
|
|
918
|
-
/***/
|
915
|
+
/***/ 79:
|
919
916
|
/***/ (function(module, exports, __webpack_require__) {
|
920
917
|
|
921
918
|
"use strict";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.entry.js","sources":["webpack:///webpack/bootstrap 4abd23edcb7fa8e5a0c8?3c81","webpack:///external \"window\"","webpack:///test/helpers/index.js","webpack:///test/helpers/common.js","webpack:///test/helpers/jasmine.js"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 242);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4abd23edcb7fa8e5a0c8","module.exports = window;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"window\"\n// module id = 125\n// module chunks = 1","/* eslint-disable import/no-unresolved */\nimport window from 'window';\nimport * as common from './common';\nimport * as jasmine from './jasmine';\n\nconst exportToWindow = (helpersHolder) => {\n Object.keys(helpersHolder).forEach((key) => {\n if (key === '__esModule') {\n return;\n }\n\n if (window[key] !== void 0) {\n throw Error(`Cannot export \"${key}\" helper because this name is already assigned.`);\n }\n\n window[key] = helpersHolder[key];\n });\n};\n\n// Export all helpers to the window.\nexportToWindow(common);\nexportToWindow(jasmine);\n\n\n\n// WEBPACK FOOTER //\n// test/helpers/index.js","export function sleep(delay = 100) {\n return Promise.resolve({\n then: function(resolve) {\n setTimeout(resolve, delay);\n }\n });\n};\n\nexport function hot() {\n return spec().$container.data('handsontable');\n};\n\nexport function handsontable(options) {\n var currentSpec = spec();\n\n currentSpec.$container.handsontable(options);\n currentSpec.$container[0].focus(); // otherwise TextEditor tests do not pass in IE8\n\n return currentSpec.$container.data('handsontable');\n};\n\n/**\n * As for v. 0.11 the only scrolling method is native scroll, which creates copies of main htCore table inside of the container.\n * Therefore, simple $(\".htCore\") will return more than one object. Most of the time, you're interested in the original\n * htCore, not the copies made by native scroll.\n *\n * This method returns the original htCore object\n *\n * @returns {jqObject} reference to the original htCore\n */\n\nexport function getHtCore() {\n return spec().$container.find('.htCore').first();\n};\n\nexport function getTopClone() {\n return spec().$container.find('.ht_clone_top');\n};\n\nexport function getTopLeftClone() {\n return spec().$container.find('.ht_clone_top_left_corner');\n};\n// for compatybility\n// var getCornerClone = getTopLeftClone;\n\nexport function getLeftClone() {\n return spec().$container.find('.ht_clone_left');\n};\n\nexport function getBottomClone() {\n return spec().$container.find('.ht_clone_bottom');\n};\n\nexport function getBottomLeftClone() {\n return spec().$container.find('.ht_clone_bottom_left_corner');\n};\n\n// Rename me to countTD\nexport function countCells() {\n return getHtCore().find('tbody td').length;\n};\n\nexport function isEditorVisible() {\n return !!(keyProxy().is(':visible') && keyProxy().parent().is(':visible') && !keyProxy().parent().is('.htHidden'));\n};\n\nexport function isFillHandleVisible() {\n return !!spec().$container.find('.wtBorder.corner:visible').length;\n};\n\nexport function getCorrespondingOverlay(cell, container) {\n var overlay = $(cell).parents('.handsontable');\n\n if (overlay[0] == container[0]) {\n return $('.ht_master');\n }\n\n return $(overlay[0]);\n};\n\n/**\n * Shows context menu\n */\nexport function contextMenu(cell) {\n var hot = spec().$container.data('handsontable');\n var selected = hot.getSelected();\n\n if (!selected) {\n hot.selectCell(0, 0);\n selected = hot.getSelected();\n }\n if (!cell) {\n cell = getCell(selected[0], selected[1]);\n }\n var cellOffset = $(cell).offset();\n\n $(cell).simulate('contextmenu', {\n clientX: cellOffset.left - Handsontable.dom.getWindowScrollLeft(),\n clientY: cellOffset.top - Handsontable.dom.getWindowScrollTop(),\n });\n};\n\nexport function closeContextMenu() {\n $(document).simulate('mousedown');\n // $(document).trigger('mousedown');\n};\n\n/**\n * Shows dropdown menu\n */\nexport function dropdownMenu(columnIndex) {\n var hot = spec().$container.data('handsontable');\n var th = hot.view.wt.wtTable.getColumnHeader(columnIndex || 0);\n var button = th.querySelector('.changeType');\n\n if (button) {\n $(button).simulate('mousedown');\n $(button).simulate('click');\n }\n};\n\nexport function closeDropdownMenu() {\n $(document).simulate('mousedown');\n};\n\nexport function dropdownMenuRootElement() {\n var plugin = hot().getPlugin('dropdownMenu');\n var root;\n\n if (plugin && plugin.menu) {\n root = plugin.menu.container;\n }\n\n return root;\n};\n\n/**\n * Returns a function that triggers a mouse event\n * @param {String} type Event type\n * @return {Function}\n */\nexport function handsontableMouseTriggerFactory(type, button) {\n return function(element) {\n if (!(element instanceof jQuery)) {\n element = $(element);\n }\n var ev = $.Event(type);\n ev.which = button || 1; // left click by default\n\n element.simulate(type, ev);\n };\n};\n\nexport const mouseDown = handsontableMouseTriggerFactory('mousedown');\nexport const mouseMove = handsontableMouseTriggerFactory('mousemove');\nexport const mouseOver = handsontableMouseTriggerFactory('mouseover');\nexport const mouseUp = handsontableMouseTriggerFactory('mouseup');\n\nexport function mouseDoubleClick(element) {\n mouseDown(element);\n mouseUp(element);\n mouseDown(element);\n mouseUp(element);\n};\n\nexport const mouseRightDown = handsontableMouseTriggerFactory('mousedown', 3);\nexport const mouseRightUp = handsontableMouseTriggerFactory('mouseup', 3);\n\n/**\n * Returns a function that triggers a key event\n * @param {String} type Event type\n * @return {Function}\n */\nexport function handsontableKeyTriggerFactory(type) {\n return function(key, extend) {\n var ev = {}; // $.Event(type);\n\n if (typeof key === 'string') {\n if (key.indexOf('shift+') > -1) {\n key = key.substring(6);\n ev.shiftKey = true;\n }\n\n if (key.indexOf('ctrl+') > -1) {\n key = key.substring(5);\n ev.ctrlKey = true;\n ev.metaKey = true;\n }\n\n switch (key) {\n case 'tab':\n ev.keyCode = 9;\n break;\n\n case 'enter':\n ev.keyCode = 13;\n break;\n\n case 'esc':\n ev.keyCode = 27;\n break;\n\n case 'f2':\n ev.keyCode = 113;\n break;\n\n case 'arrow_left':\n ev.keyCode = 37;\n break;\n\n case 'arrow_up':\n ev.keyCode = 38;\n break;\n\n case 'arrow_right':\n ev.keyCode = 39;\n break;\n\n case 'arrow_down':\n ev.keyCode = 40;\n break;\n\n case 'ctrl':\n ev.keyCode = 17;\n break;\n\n case 'shift':\n ev.keyCode = 16;\n break;\n\n case 'backspace':\n ev.keyCode = 8;\n break;\n\n case 'delete':\n ev.keyCode = 46;\n break;\n\n case 'space':\n ev.keyCode = 32;\n break;\n\n case 'x':\n ev.keyCode = 88;\n break;\n\n case 'c':\n ev.keyCode = 67;\n break;\n\n case 'v':\n ev.keyCode = 86;\n break;\n\n default:\n throw new Error(`Unrecognised key name: ${key}`);\n }\n } else if (typeof key === 'number') {\n ev.keyCode = key;\n }\n // ev.originalEvent = {}; //needed as long Handsontable searches for event.originalEvent\n $.extend(ev, extend);\n $(document.activeElement).simulate(type, ev);\n };\n};\n\nexport const keyDown = handsontableKeyTriggerFactory('keydown');\nexport const keyUp = handsontableKeyTriggerFactory('keyup');\n\n/**\n * Presses keyDown, then keyUp\n */\nexport function keyDownUp(key, extend) {\n if (typeof key === 'string' && key.indexOf('shift+') > -1) {\n keyDown('shift');\n }\n\n keyDown(key, extend);\n keyUp(key, extend);\n\n if (typeof key === 'string' && key.indexOf('shift+') > -1) {\n keyUp('shift');\n }\n};\n\n/**\n * Returns current value of the keyboard proxy textarea\n * @return {String}\n */\nexport function keyProxy() {\n return spec().$container.find('textarea.handsontableInput');\n};\n\nexport function serveImmediatePropagation(event) {\n if (event != null && event.isImmediatePropagationEnabled == null) {\n event.stopImmediatePropagation = function() {\n this.isImmediatePropagationEnabled = false;\n this.cancelBubble = true;\n };\n event.isImmediatePropagationEnabled = true;\n event.isImmediatePropagationStopped = function() {\n return !this.isImmediatePropagationEnabled;\n };\n }\n\n return event;\n};\n\nexport function autocompleteEditor() {\n return spec().$container.find('.handsontableInput');\n};\n\n/**\n * Sets text cursor inside keyboard proxy\n */\nexport function setCaretPosition(pos) {\n var el = keyProxy()[0];\n\n if (el.setSelectionRange) {\n el.focus();\n el.setSelectionRange(pos, pos);\n } else if (el.createTextRange) {\n var range = el.createTextRange();\n range.collapse(true);\n range.moveEnd('character', pos);\n range.moveStart('character', pos);\n range.select();\n }\n};\n\n/**\n * Returns autocomplete instance\n */\nexport function autocomplete() {\n return spec().$container.find('.autocompleteEditor');\n};\n\n/**\n * Triggers paste string on current selection\n */\nexport function triggerPaste(str) {\n spec().$container.data('handsontable').getPlugin('CopyPaste').paste(str);\n};\n\n/**\n * Calls a method in current Handsontable instance, returns its output\n * @param method\n * @return {Function}\n */\nexport function handsontableMethodFactory(method) {\n return function() {\n var instance;\n try {\n instance = spec().$container.handsontable('getInstance');\n } catch (err) {\n console.error(err);\n }\n\n if (instance) {\n if (method === 'destroy') {\n spec().$container.removeData();\n }\n } else {\n if (method === 'destroy') {\n return; // we can forgive this... maybe it was destroyed in the test\n }\n throw new Error('Something wrong with the test spec: Handsontable instance not found');\n }\n\n return instance[method](...arguments);\n };\n};\n\nexport const addHook = handsontableMethodFactory('addHook');\nexport const alter = handsontableMethodFactory('alter');\nexport const colToProp = handsontableMethodFactory('colToProp');\nexport const countCols = handsontableMethodFactory('countCols');\nexport const countRows = handsontableMethodFactory('countRows');\nexport const deselectCell = handsontableMethodFactory('deselectCell');\nexport const destroy = handsontableMethodFactory('destroy');\nexport const destroyEditor = handsontableMethodFactory('destroyEditor');\nexport const getActiveEditor = handsontableMethodFactory('getActiveEditor');\nexport const getCell = handsontableMethodFactory('getCell');\nexport const getCellEditor = handsontableMethodFactory('getCellEditor');\nexport const getCellMeta = handsontableMethodFactory('getCellMeta');\nexport const getCellMetaAtRow = handsontableMethodFactory('getCellMetaAtRow');\nexport const getCellRenderer = handsontableMethodFactory('getCellRenderer');\nexport const getCellsMeta = handsontableMethodFactory('getCellsMeta');\nexport const getCellValidator = handsontableMethodFactory('getCellValidator');\nexport const getColHeader = handsontableMethodFactory('getColHeader');\nexport const getCopyableData = handsontableMethodFactory('getCopyableData');\nexport const getCopyableText = handsontableMethodFactory('getCopyableText');\nexport const getData = handsontableMethodFactory('getData');\nexport const getDataAtCell = handsontableMethodFactory('getDataAtCell');\nexport const getDataAtCol = handsontableMethodFactory('getDataAtCol');\nexport const getDataAtRow = handsontableMethodFactory('getDataAtRow');\nexport const getDataAtRowProp = handsontableMethodFactory('getDataAtRowProp');\nexport const getDataType = handsontableMethodFactory('getDataType');\nexport const getInstance = handsontableMethodFactory('getInstance');\nexport const getRowHeader = handsontableMethodFactory('getRowHeader');\nexport const getSelected = handsontableMethodFactory('getSelected');\nexport const getSourceData = handsontableMethodFactory('getSourceData');\nexport const getSourceDataArray = handsontableMethodFactory('getSourceDataArray');\nexport const getSourceDataAtCell = handsontableMethodFactory('getSourceDataAtCell');\nexport const getSourceDataAtCol = handsontableMethodFactory('getSourceDataAtCol');\nexport const getSourceDataAtRow = handsontableMethodFactory('getSourceDataAtRow');\nexport const getValue = handsontableMethodFactory('getValue');\nexport const loadData = handsontableMethodFactory('loadData');\nexport const populateFromArray = handsontableMethodFactory('populateFromArray');\nexport const propToCol = handsontableMethodFactory('propToCol');\nexport const removeCellMeta = handsontableMethodFactory('removeCellMeta');\nexport const render = handsontableMethodFactory('render');\nexport const selectCell = handsontableMethodFactory('selectCell');\nexport const setCellMeta = handsontableMethodFactory('setCellMeta');\nexport const setDataAtCell = handsontableMethodFactory('setDataAtCell');\nexport const setDataAtRowProp = handsontableMethodFactory('setDataAtRowProp');\nexport const spliceCellsMeta = handsontableMethodFactory('spliceCellsMeta');\nexport const spliceCol = handsontableMethodFactory('spliceCol');\nexport const spliceRow = handsontableMethodFactory('spliceRow');\nexport const updateSettings = handsontableMethodFactory('updateSettings');\nexport const countSourceRows = handsontableMethodFactory('countSourceRows');\nexport const countSourceCols = handsontableMethodFactory('countSourceCols');\nexport const countEmptyRows = handsontableMethodFactory('countEmptyRows');\nexport const countEmptyCols = handsontableMethodFactory('countEmptyCols');\n\n/**\n * Returns column width for HOT container\n * @param $elem\n * @param col\n * @returns {Number}\n */\nexport function colWidth($elem, col) {\n var TR = $elem[0].querySelector('TBODY TR');\n var cell;\n\n if (TR) {\n cell = TR.querySelectorAll('TD')[col];\n } else {\n cell = $elem[0].querySelector('THEAD TR').querySelectorAll('TH')[col];\n }\n\n if (!cell) {\n throw new Error(`Cannot find table column of index '${col}'`);\n }\n\n return cell.offsetWidth;\n}\n\n/**\n * Returns row height for HOT container\n * @param $elem\n * @param row\n * @returns {Number}\n */\nexport function rowHeight($elem, row) {\n var TD;\n\n if (row >= 0) {\n TD = $elem[0].querySelector(`tbody tr:nth-child(${row + 1}) td`);\n } else {\n TD = $elem[0].querySelector(`thead tr:nth-child(${Math.abs(row)})`);\n }\n\n if (!TD) {\n throw new Error(`Cannot find table row of index '${row}'`);\n }\n\n return Handsontable.dom.outerHeight(TD);\n}\n\n/**\n * Returns value that has been rendered in table cell\n * @param {Number} trIndex\n * @param {Number} tdIndex\n * @returns {String}\n */\nexport function getRenderedValue(trIndex, tdIndex) {\n return spec().$container.find('tbody tr').eq(trIndex).find('td').eq(tdIndex).html();\n}\n\n/**\n * Returns nodes that have been rendered in table cell\n * @param {Number} trIndex\n * @param {Number} tdIndex\n * @returns {String}\n */\nexport function getRenderedContent(trIndex, tdIndex) {\n return spec().$container.find('tbody tr').eq(trIndex).find('td').eq(tdIndex).children();\n}\n\n/**\n * Create numerical data values for the table\n * @param rowCount\n * @param colCount\n * @returns {Array}\n */\nexport function createNumericData(rowCount, colCount) {\n rowCount = typeof rowCount === 'number' ? rowCount : 100;\n colCount = typeof colCount === 'number' ? colCount : 4;\n\n var\n rows = [],\n i,\n j;\n\n for (i = 0; i < rowCount; i++) {\n var row = [];\n\n for (j = 0; j < colCount; j++) {\n row.push((i + 1));\n }\n rows.push(row);\n }\n\n return rows;\n}\n\n/**\n * Model factory, which creates object with private properties, accessible by setters and getters.\n * Created for the purpose of testing HOT with Backbone-like Models\n * @param opts\n * @returns {{}}\n * @constructor\n */\nexport function Model(opts) {\n var obj = {};\n\n var _data = $.extend({\n id: undefined,\n name: undefined,\n address: undefined\n }, opts);\n\n obj.attr = function(name, value) {\n if (typeof value === 'undefined') {\n return this.get(name);\n }\n\n return this.set(name, value);\n };\n\n obj.get = function(name) {\n return _data[name];\n };\n\n obj.set = function(name, value) {\n _data[name] = value;\n\n return this;\n };\n\n return obj;\n}\n/**\n * Factory which produces an accessor for objects of type \"Model\" (see above).\n * This function should be used to create accessor for a given property name and pass it as `data` option in column\n * configuration.\n *\n * @param name - name of the property for which an accessor function will be created\n * @returns {Function}\n */\nexport function createAccessorForProperty(name) {\n return function(obj, value) {\n return obj.attr(name, value);\n };\n}\n\nexport function resizeColumn(displayedColumnIndex, width) {\n var $container = spec().$container;\n var $th = $container.find(`thead tr:eq(0) th:eq(${displayedColumnIndex})`);\n\n $th.simulate('mouseover');\n\n var $resizer = $container.find('.manualColumnResizer');\n var resizerPosition = $resizer.position();\n\n $resizer.simulate('mousedown', {\n clientX: resizerPosition.left,\n });\n\n var delta = width - $th.width() - 2;\n var newPosition = resizerPosition.left + delta;\n $resizer.simulate('mousemove', {\n clientX: newPosition\n });\n\n $resizer.simulate('mouseup');\n}\n\nexport function resizeRow(displayedRowIndex, height) {\n var $container = spec().$container;\n var $th = $container.find(`tbody tr:eq(${displayedRowIndex}) th:eq(0)`);\n\n $th.simulate('mouseover');\n\n var $resizer = $container.find('.manualRowResizer');\n var resizerPosition = $resizer.position();\n\n $resizer.simulate('mousedown', {\n clientY: resizerPosition.top\n });\n\n var delta = height - $th.height() - 2;\n\n if (delta < 0) {\n delta = 0;\n }\n\n $resizer.simulate('mousemove', {\n clientY: resizerPosition.top + delta\n });\n\n $resizer.simulate('mouseup');\n}\n\nexport function moveSecondDisplayedRowBeforeFirstRow(container, secondDisplayedRowIndex) {\n var\n $mainContainer = container.parents('.handsontable').not('[class*=clone]').not('[class*=master]').first(),\n $rowHeaders = container.find('tbody tr th'),\n $firstRowHeader = $rowHeaders.eq(secondDisplayedRowIndex - 1),\n $secondRowHeader = $rowHeaders.eq(secondDisplayedRowIndex);\n\n $secondRowHeader.simulate('mouseover');\n var $manualRowMover = $mainContainer.find('.manualRowMover');\n\n if ($manualRowMover.length) {\n $manualRowMover.simulate('mousedown', {\n clientY: $manualRowMover[0].getBoundingClientRect().top\n });\n\n $manualRowMover.simulate('mousemove', {\n clientY: $manualRowMover[0].getBoundingClientRect().top - 20\n });\n\n $firstRowHeader.simulate('mouseover');\n $secondRowHeader.simulate('mouseup');\n }\n}\n\nexport function moveFirstDisplayedRowAfterSecondRow(container, firstDisplayedRowIndex) {\n var\n $mainContainer = container.parents('.handsontable').not('[class*=clone]').not('[class*=master]').first(),\n $rowHeaders = container.find('tbody tr th'),\n $firstRowHeader = $rowHeaders.eq(firstDisplayedRowIndex),\n $secondRowHeader = $rowHeaders.eq(firstDisplayedRowIndex + 1);\n\n $secondRowHeader.simulate('mouseover');\n var $manualRowMover = $mainContainer.find('.manualRowMover');\n\n if ($manualRowMover.length) {\n $manualRowMover.simulate('mousedown', {\n clientY: $manualRowMover[0].getBoundingClientRect().top\n });\n\n $manualRowMover.simulate('mousemove', {\n clientY: $manualRowMover[0].getBoundingClientRect().top + 20\n });\n\n $firstRowHeader.simulate('mouseover');\n $secondRowHeader.simulate('mouseup');\n }\n}\n\nexport function swapDisplayedColumns(container, from, to) {\n var $mainContainer = container.parents('.handsontable').not('[class*=clone]').not('[class*=master]').first();\n var $colHeaders = container.find('thead tr:eq(0) th');\n var $to = $colHeaders.eq(to);\n var $from = $colHeaders.eq(from);\n\n // Enter the second column header\n $from.simulate('mouseover');\n var $manualColumnMover = $mainContainer.find('.manualColumnMover');\n\n // Grab the second column\n $manualColumnMover.simulate('mousedown', {\n pageX: $manualColumnMover[0].getBoundingClientRect().left,\n });\n\n // Drag the second column over the first column\n $manualColumnMover.simulate('mousemove', {\n pageX: $manualColumnMover[0].getBoundingClientRect().left - 20,\n });\n\n $to.simulate('mouseover');\n\n // Drop the second column\n $from.simulate('mouseup');\n}\n\nexport function triggerTouchEvent(type, target, pageX, pageY) {\n var e = document.createEvent('TouchEvent');\n var targetCoords = target.getBoundingClientRect();\n var touches;\n var targetTouches;\n var changedTouches;\n\n if (!pageX && !pageY) {\n pageX = parseInt(targetCoords.left + 3, 10);\n pageY = parseInt(targetCoords.top + 3, 10);\n }\n\n var touch = document.createTouch(window, target, 0, pageX, pageY, pageX, pageY);\n\n if (type == 'touchend') {\n touches = document.createTouchList();\n targetTouches = document.createTouchList();\n changedTouches = document.createTouchList(touch);\n } else {\n touches = document.createTouchList(touch);\n targetTouches = document.createTouchList(touch);\n changedTouches = document.createTouchList(touch);\n }\n\n e.initTouchEvent(type, true, true, window, null, 0, 0, 0, 0, false, false, false, false, touches, targetTouches, changedTouches, 1, 0);\n target.dispatchEvent(e);\n};\n\n\n\n// WEBPACK FOOTER //\n// test/helpers/common.js","/* eslint-disable import/prefer-default-export */\nvar currentSpec;\n\nexport function spec() {\n return currentSpec;\n};\n\nbeforeEach(function() {\n currentSpec = this;\n\n var matchers = {\n toBeInArray() {\n return {\n compare(actual, expected) {\n return {\n pass: Array.isArray(expected) && expected.indexOf(actual) > -1\n };\n }\n };\n },\n toBeFunction() {\n return {\n compare(actual, expected) {\n return {\n pass: typeof actual === 'function'\n };\n }\n };\n },\n toBeAroundValue() {\n return {\n compare(actual, expected, diff) {\n diff = diff || 1;\n\n var pass = actual >= expected - diff && actual <= expected + diff;\n var message = `Expected ${actual} to be around ${expected} (between ${expected - diff} and ${expected + diff})`;\n\n if (!pass) {\n message = `Expected ${actual} NOT to be around ${expected} (between ${expected - diff} and ${expected + diff})`;\n }\n\n return {\n pass,\n message\n };\n }\n };\n }\n };\n\n jasmine.addMatchers(matchers);\n\n if (document.activeElement && document.activeElement != document.body) {\n document.activeElement.blur();\n\n } else if (!document.activeElement) { // IE\n document.body.focus();\n }\n});\n\nafterEach(() => {\n window.scrollTo(0, 0);\n});\n\n\n\n// WEBPACK FOOTER //\n// test/helpers/jasmine.js"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;AChEA;;;;;;;;;;ACCA;AACA;;;AAAA;AACA;AADA;AACA;AAAA;AACA;AADA;AACA;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAnBA;AAoBA;AACA;;;;;;;;;;;ACrBA;AAQA;AAIA;AAmBA;AAIA;AAIA;AAMA;AAIA;AAIA;AAKA;AAIA;AAIA;AAIA;AAaA;AAmBA;AAQA;AAWA;AAIA;AAgBA;AAiBA;AAeA;AAmGA;AAiBA;AAIA;AAeA;AAOA;AAkBA;AAOA;AASA;AAkFA;AAuBA;AAsBA;AAUA;AAUA;AA4BA;AAqCA;AAMA;AAsBA;AA0BA;AAwBA;AAwBA;AA0BA;AAjrBA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAHA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAFA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAlEA;AAoEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;;;AAKA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AAHA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACxsBA;AAHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AAGA;AALA;AAOA;AACA;AACA;AACA;AACA;AACA;AADA;AAGA;AALA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAFA;AAIA;AAfA;AAiBA;AArCA;AACA;AAuCA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;A","sourceRoot":""}
|
1
|
+
{"version":3,"file":"helpers.entry.js","sources":["webpack:///webpack/bootstrap ea584ebd757c27955b09","webpack:///test/helpers/index.js","webpack:///external \"window\"","webpack:///test/helpers/common.js","webpack:///test/helpers/jasmine.js"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 76);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap ea584ebd757c27955b09","/* eslint-disable import/no-unresolved */\nimport window from 'window';\nimport * as common from './common';\nimport * as jasmine from './jasmine';\n\nconst exportToWindow = (helpersHolder) => {\n Object.keys(helpersHolder).forEach((key) => {\n if (key === '__esModule') {\n return;\n }\n\n if (window[key] !== void 0) {\n throw Error(`Cannot export \"${key}\" helper because this name is already assigned.`);\n }\n\n window[key] = helpersHolder[key];\n });\n};\n\n// Export all helpers to the window.\nexportToWindow(common);\nexportToWindow(jasmine);\n\n\n\n// WEBPACK FOOTER //\n// test/helpers/index.js","module.exports = window;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"window\"\n// module id = 77\n// module chunks = 1","export function sleep(delay = 100) {\n return Promise.resolve({\n then: function(resolve) {\n setTimeout(resolve, delay);\n }\n });\n};\n\nexport function hot() {\n return spec().$container.data('handsontable');\n};\n\nexport function handsontable(options) {\n var currentSpec = spec();\n\n currentSpec.$container.handsontable(options);\n currentSpec.$container[0].focus(); // otherwise TextEditor tests do not pass in IE8\n\n return currentSpec.$container.data('handsontable');\n};\n\n/**\n * As for v. 0.11 the only scrolling method is native scroll, which creates copies of main htCore table inside of the container.\n * Therefore, simple $(\".htCore\") will return more than one object. Most of the time, you're interested in the original\n * htCore, not the copies made by native scroll.\n *\n * This method returns the original htCore object\n *\n * @returns {jqObject} reference to the original htCore\n */\n\nexport function getHtCore() {\n return spec().$container.find('.htCore').first();\n};\n\nexport function getTopClone() {\n return spec().$container.find('.ht_clone_top');\n};\n\nexport function getTopLeftClone() {\n return spec().$container.find('.ht_clone_top_left_corner');\n};\n// for compatybility\n// var getCornerClone = getTopLeftClone;\n\nexport function getLeftClone() {\n return spec().$container.find('.ht_clone_left');\n};\n\nexport function getBottomClone() {\n return spec().$container.find('.ht_clone_bottom');\n};\n\nexport function getBottomLeftClone() {\n return spec().$container.find('.ht_clone_bottom_left_corner');\n};\n\n// Rename me to countTD\nexport function countCells() {\n return getHtCore().find('tbody td').length;\n};\n\nexport function isEditorVisible() {\n return !!(keyProxy().is(':visible') && keyProxy().parent().is(':visible') && !keyProxy().parent().is('.htHidden'));\n};\n\nexport function isFillHandleVisible() {\n return !!spec().$container.find('.wtBorder.corner:visible').length;\n};\n\nexport function getCorrespondingOverlay(cell, container) {\n var overlay = $(cell).parents('.handsontable');\n\n if (overlay[0] == container[0]) {\n return $('.ht_master');\n }\n\n return $(overlay[0]);\n};\n\n/**\n * Shows context menu\n */\nexport function contextMenu(cell) {\n var hot = spec().$container.data('handsontable');\n var selected = hot.getSelected();\n\n if (!selected) {\n hot.selectCell(0, 0);\n selected = hot.getSelected();\n }\n if (!cell) {\n cell = getCell(selected[0], selected[1]);\n }\n var cellOffset = $(cell).offset();\n\n $(cell).simulate('contextmenu', {\n clientX: cellOffset.left - Handsontable.dom.getWindowScrollLeft(),\n clientY: cellOffset.top - Handsontable.dom.getWindowScrollTop(),\n });\n};\n\nexport function closeContextMenu() {\n $(document).simulate('mousedown');\n // $(document).trigger('mousedown');\n};\n\n/**\n * Shows dropdown menu\n */\nexport function dropdownMenu(columnIndex) {\n var hot = spec().$container.data('handsontable');\n var th = hot.view.wt.wtTable.getColumnHeader(columnIndex || 0);\n var button = th.querySelector('.changeType');\n\n if (button) {\n $(button).simulate('mousedown');\n $(button).simulate('click');\n }\n};\n\nexport function closeDropdownMenu() {\n $(document).simulate('mousedown');\n};\n\nexport function dropdownMenuRootElement() {\n var plugin = hot().getPlugin('dropdownMenu');\n var root;\n\n if (plugin && plugin.menu) {\n root = plugin.menu.container;\n }\n\n return root;\n};\n\n/**\n * Returns a function that triggers a mouse event\n * @param {String} type Event type\n * @return {Function}\n */\nexport function handsontableMouseTriggerFactory(type, button) {\n return function(element) {\n if (!(element instanceof jQuery)) {\n element = $(element);\n }\n var ev = $.Event(type);\n ev.which = button || 1; // left click by default\n\n element.simulate(type, ev);\n };\n};\n\nexport const mouseDown = handsontableMouseTriggerFactory('mousedown');\nexport const mouseMove = handsontableMouseTriggerFactory('mousemove');\nexport const mouseOver = handsontableMouseTriggerFactory('mouseover');\nexport const mouseUp = handsontableMouseTriggerFactory('mouseup');\n\nexport function mouseDoubleClick(element) {\n mouseDown(element);\n mouseUp(element);\n mouseDown(element);\n mouseUp(element);\n};\n\nexport const mouseRightDown = handsontableMouseTriggerFactory('mousedown', 3);\nexport const mouseRightUp = handsontableMouseTriggerFactory('mouseup', 3);\n\n/**\n * Returns a function that triggers a key event\n * @param {String} type Event type\n * @return {Function}\n */\nexport function handsontableKeyTriggerFactory(type) {\n return function(key, extend) {\n var ev = {}; // $.Event(type);\n\n if (typeof key === 'string') {\n if (key.indexOf('shift+') > -1) {\n key = key.substring(6);\n ev.shiftKey = true;\n }\n\n if (key.indexOf('ctrl+') > -1) {\n key = key.substring(5);\n ev.ctrlKey = true;\n ev.metaKey = true;\n }\n\n switch (key) {\n case 'tab':\n ev.keyCode = 9;\n break;\n\n case 'enter':\n ev.keyCode = 13;\n break;\n\n case 'esc':\n ev.keyCode = 27;\n break;\n\n case 'f2':\n ev.keyCode = 113;\n break;\n\n case 'arrow_left':\n ev.keyCode = 37;\n break;\n\n case 'arrow_up':\n ev.keyCode = 38;\n break;\n\n case 'arrow_right':\n ev.keyCode = 39;\n break;\n\n case 'arrow_down':\n ev.keyCode = 40;\n break;\n\n case 'ctrl':\n ev.keyCode = 17;\n break;\n\n case 'shift':\n ev.keyCode = 16;\n break;\n\n case 'backspace':\n ev.keyCode = 8;\n break;\n\n case 'delete':\n ev.keyCode = 46;\n break;\n\n case 'space':\n ev.keyCode = 32;\n break;\n\n case 'x':\n ev.keyCode = 88;\n break;\n\n case 'c':\n ev.keyCode = 67;\n break;\n\n case 'v':\n ev.keyCode = 86;\n break;\n\n default:\n throw new Error(`Unrecognised key name: ${key}`);\n }\n } else if (typeof key === 'number') {\n ev.keyCode = key;\n }\n // ev.originalEvent = {}; //needed as long Handsontable searches for event.originalEvent\n $.extend(ev, extend);\n $(document.activeElement).simulate(type, ev);\n };\n};\n\nexport const keyDown = handsontableKeyTriggerFactory('keydown');\nexport const keyUp = handsontableKeyTriggerFactory('keyup');\n\n/**\n * Presses keyDown, then keyUp\n */\nexport function keyDownUp(key, extend) {\n if (typeof key === 'string' && key.indexOf('shift+') > -1) {\n keyDown('shift');\n }\n\n keyDown(key, extend);\n keyUp(key, extend);\n\n if (typeof key === 'string' && key.indexOf('shift+') > -1) {\n keyUp('shift');\n }\n};\n\n/**\n * Returns current value of the keyboard proxy textarea\n * @return {String}\n */\nexport function keyProxy() {\n return spec().$container.find('textarea.handsontableInput');\n};\n\nexport function serveImmediatePropagation(event) {\n if (event != null && event.isImmediatePropagationEnabled == null) {\n event.stopImmediatePropagation = function() {\n this.isImmediatePropagationEnabled = false;\n this.cancelBubble = true;\n };\n event.isImmediatePropagationEnabled = true;\n event.isImmediatePropagationStopped = function() {\n return !this.isImmediatePropagationEnabled;\n };\n }\n\n return event;\n};\n\nexport function autocompleteEditor() {\n return spec().$container.find('.handsontableInput');\n};\n\n/**\n * Sets text cursor inside keyboard proxy\n */\nexport function setCaretPosition(pos) {\n var el = keyProxy()[0];\n\n if (el.setSelectionRange) {\n el.focus();\n el.setSelectionRange(pos, pos);\n } else if (el.createTextRange) {\n var range = el.createTextRange();\n range.collapse(true);\n range.moveEnd('character', pos);\n range.moveStart('character', pos);\n range.select();\n }\n};\n\n/**\n * Returns autocomplete instance\n */\nexport function autocomplete() {\n return spec().$container.find('.autocompleteEditor');\n};\n\n/**\n * Triggers paste string on current selection\n */\nexport function triggerPaste(str) {\n spec().$container.data('handsontable').getPlugin('CopyPaste').paste(str);\n};\n\n/**\n * Calls a method in current Handsontable instance, returns its output\n * @param method\n * @return {Function}\n */\nexport function handsontableMethodFactory(method) {\n return function() {\n var instance;\n try {\n instance = spec().$container.handsontable('getInstance');\n } catch (err) {\n console.error(err);\n }\n\n if (instance) {\n if (method === 'destroy') {\n spec().$container.removeData();\n }\n } else {\n if (method === 'destroy') {\n return; // we can forgive this... maybe it was destroyed in the test\n }\n throw new Error('Something wrong with the test spec: Handsontable instance not found');\n }\n\n return instance[method](...arguments);\n };\n};\n\nexport const addHook = handsontableMethodFactory('addHook');\nexport const alter = handsontableMethodFactory('alter');\nexport const colToProp = handsontableMethodFactory('colToProp');\nexport const countCols = handsontableMethodFactory('countCols');\nexport const countRows = handsontableMethodFactory('countRows');\nexport const deselectCell = handsontableMethodFactory('deselectCell');\nexport const destroy = handsontableMethodFactory('destroy');\nexport const destroyEditor = handsontableMethodFactory('destroyEditor');\nexport const getActiveEditor = handsontableMethodFactory('getActiveEditor');\nexport const getCell = handsontableMethodFactory('getCell');\nexport const getCellEditor = handsontableMethodFactory('getCellEditor');\nexport const getCellMeta = handsontableMethodFactory('getCellMeta');\nexport const getCellMetaAtRow = handsontableMethodFactory('getCellMetaAtRow');\nexport const getCellRenderer = handsontableMethodFactory('getCellRenderer');\nexport const getCellsMeta = handsontableMethodFactory('getCellsMeta');\nexport const getCellValidator = handsontableMethodFactory('getCellValidator');\nexport const getColHeader = handsontableMethodFactory('getColHeader');\nexport const getCopyableData = handsontableMethodFactory('getCopyableData');\nexport const getCopyableText = handsontableMethodFactory('getCopyableText');\nexport const getData = handsontableMethodFactory('getData');\nexport const getDataAtCell = handsontableMethodFactory('getDataAtCell');\nexport const getDataAtCol = handsontableMethodFactory('getDataAtCol');\nexport const getDataAtRow = handsontableMethodFactory('getDataAtRow');\nexport const getDataAtRowProp = handsontableMethodFactory('getDataAtRowProp');\nexport const getDataType = handsontableMethodFactory('getDataType');\nexport const getInstance = handsontableMethodFactory('getInstance');\nexport const getRowHeader = handsontableMethodFactory('getRowHeader');\nexport const getSelected = handsontableMethodFactory('getSelected');\nexport const getSourceData = handsontableMethodFactory('getSourceData');\nexport const getSourceDataArray = handsontableMethodFactory('getSourceDataArray');\nexport const getSourceDataAtCell = handsontableMethodFactory('getSourceDataAtCell');\nexport const getSourceDataAtCol = handsontableMethodFactory('getSourceDataAtCol');\nexport const getSourceDataAtRow = handsontableMethodFactory('getSourceDataAtRow');\nexport const getValue = handsontableMethodFactory('getValue');\nexport const loadData = handsontableMethodFactory('loadData');\nexport const populateFromArray = handsontableMethodFactory('populateFromArray');\nexport const propToCol = handsontableMethodFactory('propToCol');\nexport const removeCellMeta = handsontableMethodFactory('removeCellMeta');\nexport const render = handsontableMethodFactory('render');\nexport const selectCell = handsontableMethodFactory('selectCell');\nexport const setCellMeta = handsontableMethodFactory('setCellMeta');\nexport const setDataAtCell = handsontableMethodFactory('setDataAtCell');\nexport const setDataAtRowProp = handsontableMethodFactory('setDataAtRowProp');\nexport const spliceCellsMeta = handsontableMethodFactory('spliceCellsMeta');\nexport const spliceCol = handsontableMethodFactory('spliceCol');\nexport const spliceRow = handsontableMethodFactory('spliceRow');\nexport const updateSettings = handsontableMethodFactory('updateSettings');\nexport const countSourceRows = handsontableMethodFactory('countSourceRows');\nexport const countSourceCols = handsontableMethodFactory('countSourceCols');\nexport const countEmptyRows = handsontableMethodFactory('countEmptyRows');\nexport const countEmptyCols = handsontableMethodFactory('countEmptyCols');\n\n/**\n * Returns column width for HOT container\n * @param $elem\n * @param col\n * @returns {Number}\n */\nexport function colWidth($elem, col) {\n var TR = $elem[0].querySelector('TBODY TR');\n var cell;\n\n if (TR) {\n cell = TR.querySelectorAll('TD')[col];\n } else {\n cell = $elem[0].querySelector('THEAD TR').querySelectorAll('TH')[col];\n }\n\n if (!cell) {\n throw new Error(`Cannot find table column of index '${col}'`);\n }\n\n return cell.offsetWidth;\n}\n\n/**\n * Returns row height for HOT container\n * @param $elem\n * @param row\n * @returns {Number}\n */\nexport function rowHeight($elem, row) {\n var TD;\n\n if (row >= 0) {\n TD = $elem[0].querySelector(`tbody tr:nth-child(${row + 1}) td`);\n } else {\n TD = $elem[0].querySelector(`thead tr:nth-child(${Math.abs(row)})`);\n }\n\n if (!TD) {\n throw new Error(`Cannot find table row of index '${row}'`);\n }\n\n return Handsontable.dom.outerHeight(TD);\n}\n\n/**\n * Returns value that has been rendered in table cell\n * @param {Number} trIndex\n * @param {Number} tdIndex\n * @returns {String}\n */\nexport function getRenderedValue(trIndex, tdIndex) {\n return spec().$container.find('tbody tr').eq(trIndex).find('td').eq(tdIndex).html();\n}\n\n/**\n * Returns nodes that have been rendered in table cell\n * @param {Number} trIndex\n * @param {Number} tdIndex\n * @returns {String}\n */\nexport function getRenderedContent(trIndex, tdIndex) {\n return spec().$container.find('tbody tr').eq(trIndex).find('td').eq(tdIndex).children();\n}\n\n/**\n * Create numerical data values for the table\n * @param rowCount\n * @param colCount\n * @returns {Array}\n */\nexport function createNumericData(rowCount, colCount) {\n rowCount = typeof rowCount === 'number' ? rowCount : 100;\n colCount = typeof colCount === 'number' ? colCount : 4;\n\n var\n rows = [],\n i,\n j;\n\n for (i = 0; i < rowCount; i++) {\n var row = [];\n\n for (j = 0; j < colCount; j++) {\n row.push((i + 1));\n }\n rows.push(row);\n }\n\n return rows;\n}\n\n/**\n * Model factory, which creates object with private properties, accessible by setters and getters.\n * Created for the purpose of testing HOT with Backbone-like Models\n * @param opts\n * @returns {{}}\n * @constructor\n */\nexport function Model(opts) {\n var obj = {};\n\n var _data = $.extend({\n id: undefined,\n name: undefined,\n address: undefined\n }, opts);\n\n obj.attr = function(name, value) {\n if (typeof value === 'undefined') {\n return this.get(name);\n }\n\n return this.set(name, value);\n };\n\n obj.get = function(name) {\n return _data[name];\n };\n\n obj.set = function(name, value) {\n _data[name] = value;\n\n return this;\n };\n\n return obj;\n}\n/**\n * Factory which produces an accessor for objects of type \"Model\" (see above).\n * This function should be used to create accessor for a given property name and pass it as `data` option in column\n * configuration.\n *\n * @param name - name of the property for which an accessor function will be created\n * @returns {Function}\n */\nexport function createAccessorForProperty(name) {\n return function(obj, value) {\n return obj.attr(name, value);\n };\n}\n\nexport function resizeColumn(displayedColumnIndex, width) {\n var $container = spec().$container;\n var $th = $container.find(`thead tr:eq(0) th:eq(${displayedColumnIndex})`);\n\n $th.simulate('mouseover');\n\n var $resizer = $container.find('.manualColumnResizer');\n var resizerPosition = $resizer.position();\n\n $resizer.simulate('mousedown', {\n clientX: resizerPosition.left,\n });\n\n var delta = width - $th.width() - 2;\n var newPosition = resizerPosition.left + delta;\n $resizer.simulate('mousemove', {\n clientX: newPosition\n });\n\n $resizer.simulate('mouseup');\n}\n\nexport function resizeRow(displayedRowIndex, height) {\n var $container = spec().$container;\n var $th = $container.find(`tbody tr:eq(${displayedRowIndex}) th:eq(0)`);\n\n $th.simulate('mouseover');\n\n var $resizer = $container.find('.manualRowResizer');\n var resizerPosition = $resizer.position();\n\n $resizer.simulate('mousedown', {\n clientY: resizerPosition.top\n });\n\n var delta = height - $th.height() - 2;\n\n if (delta < 0) {\n delta = 0;\n }\n\n $resizer.simulate('mousemove', {\n clientY: resizerPosition.top + delta\n });\n\n $resizer.simulate('mouseup');\n}\n\nexport function moveSecondDisplayedRowBeforeFirstRow(container, secondDisplayedRowIndex) {\n var\n $mainContainer = container.parents('.handsontable').not('[class*=clone]').not('[class*=master]').first(),\n $rowHeaders = container.find('tbody tr th'),\n $firstRowHeader = $rowHeaders.eq(secondDisplayedRowIndex - 1),\n $secondRowHeader = $rowHeaders.eq(secondDisplayedRowIndex);\n\n $secondRowHeader.simulate('mouseover');\n var $manualRowMover = $mainContainer.find('.manualRowMover');\n\n if ($manualRowMover.length) {\n $manualRowMover.simulate('mousedown', {\n clientY: $manualRowMover[0].getBoundingClientRect().top\n });\n\n $manualRowMover.simulate('mousemove', {\n clientY: $manualRowMover[0].getBoundingClientRect().top - 20\n });\n\n $firstRowHeader.simulate('mouseover');\n $secondRowHeader.simulate('mouseup');\n }\n}\n\nexport function moveFirstDisplayedRowAfterSecondRow(container, firstDisplayedRowIndex) {\n var\n $mainContainer = container.parents('.handsontable').not('[class*=clone]').not('[class*=master]').first(),\n $rowHeaders = container.find('tbody tr th'),\n $firstRowHeader = $rowHeaders.eq(firstDisplayedRowIndex),\n $secondRowHeader = $rowHeaders.eq(firstDisplayedRowIndex + 1);\n\n $secondRowHeader.simulate('mouseover');\n var $manualRowMover = $mainContainer.find('.manualRowMover');\n\n if ($manualRowMover.length) {\n $manualRowMover.simulate('mousedown', {\n clientY: $manualRowMover[0].getBoundingClientRect().top\n });\n\n $manualRowMover.simulate('mousemove', {\n clientY: $manualRowMover[0].getBoundingClientRect().top + 20\n });\n\n $firstRowHeader.simulate('mouseover');\n $secondRowHeader.simulate('mouseup');\n }\n}\n\nexport function swapDisplayedColumns(container, from, to) {\n var $mainContainer = container.parents('.handsontable').not('[class*=clone]').not('[class*=master]').first();\n var $colHeaders = container.find('thead tr:eq(0) th');\n var $to = $colHeaders.eq(to);\n var $from = $colHeaders.eq(from);\n\n // Enter the second column header\n $from.simulate('mouseover');\n var $manualColumnMover = $mainContainer.find('.manualColumnMover');\n\n // Grab the second column\n $manualColumnMover.simulate('mousedown', {\n pageX: $manualColumnMover[0].getBoundingClientRect().left,\n });\n\n // Drag the second column over the first column\n $manualColumnMover.simulate('mousemove', {\n pageX: $manualColumnMover[0].getBoundingClientRect().left - 20,\n });\n\n $to.simulate('mouseover');\n\n // Drop the second column\n $from.simulate('mouseup');\n}\n\nexport function triggerTouchEvent(type, target, pageX, pageY) {\n var e = document.createEvent('TouchEvent');\n var targetCoords = target.getBoundingClientRect();\n var touches;\n var targetTouches;\n var changedTouches;\n\n if (!pageX && !pageY) {\n pageX = parseInt(targetCoords.left + 3, 10);\n pageY = parseInt(targetCoords.top + 3, 10);\n }\n\n var touch = document.createTouch(window, target, 0, pageX, pageY, pageX, pageY);\n\n if (type == 'touchend') {\n touches = document.createTouchList();\n targetTouches = document.createTouchList();\n changedTouches = document.createTouchList(touch);\n } else {\n touches = document.createTouchList(touch);\n targetTouches = document.createTouchList(touch);\n changedTouches = document.createTouchList(touch);\n }\n\n e.initTouchEvent(type, true, true, window, null, 0, 0, 0, 0, false, false, false, false, touches, targetTouches, changedTouches, 1, 0);\n target.dispatchEvent(e);\n};\n\n\n\n// WEBPACK FOOTER //\n// test/helpers/common.js","/* eslint-disable import/prefer-default-export */\nvar currentSpec;\n\nexport function spec() {\n return currentSpec;\n};\n\nbeforeEach(function() {\n currentSpec = this;\n\n var matchers = {\n toBeInArray() {\n return {\n compare(actual, expected) {\n return {\n pass: Array.isArray(expected) && expected.indexOf(actual) > -1\n };\n }\n };\n },\n toBeFunction() {\n return {\n compare(actual, expected) {\n return {\n pass: typeof actual === 'function'\n };\n }\n };\n },\n toBeAroundValue() {\n return {\n compare(actual, expected, diff) {\n diff = diff || 1;\n\n var pass = actual >= expected - diff && actual <= expected + diff;\n var message = `Expected ${actual} to be around ${expected} (between ${expected - diff} and ${expected + diff})`;\n\n if (!pass) {\n message = `Expected ${actual} NOT to be around ${expected} (between ${expected - diff} and ${expected + diff})`;\n }\n\n return {\n pass,\n message\n };\n }\n };\n }\n };\n\n jasmine.addMatchers(matchers);\n\n if (document.activeElement && document.activeElement != document.body) {\n document.activeElement.blur();\n\n } else if (!document.activeElement) { // IE\n document.body.focus();\n }\n});\n\nafterEach(() => {\n window.scrollTo(0, 0);\n});\n\n\n\n// WEBPACK FOOTER //\n// test/helpers/jasmine.js"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;;;AC5DA;AACA;;;AAAA;AACA;AADA;AACA;AAAA;AACA;AADA;AACA;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAnBA;AAoBA;AACA;;;;;;;ACrBA;;;;;;;;;;;ACAA;AAQA;AAIA;AAmBA;AAIA;AAIA;AAMA;AAIA;AAIA;AAKA;AAIA;AAIA;AAIA;AAaA;AAmBA;AAQA;AAWA;AAIA;AAgBA;AAiBA;AAeA;AAmGA;AAiBA;AAIA;AAeA;AAOA;AAkBA;AAOA;AASA;AAkFA;AAuBA;AAsBA;AAUA;AAUA;AA4BA;AAqCA;AAMA;AAsBA;AA0BA;AAwBA;AAwBA;AA0BA;AAjrBA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAHA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAFA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAlEA;AAoEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;;;AAKA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AAHA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAGA;AACA;AACA;AADA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACxsBA;AAHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AAGA;AALA;AAOA;AACA;AACA;AACA;AACA;AACA;AADA;AAGA;AALA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAFA;AAIA;AAfA;AAiBA;AArCA;AACA;AAuCA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;A","sourceRoot":""}
|
@@ -76,4 +76,36 @@ describe('Core_listen', () => {
|
|
76
76
|
$container2.handsontable('destroy');
|
77
77
|
$container2.remove();
|
78
78
|
});
|
79
|
+
|
80
|
+
describe('hooks', () => {
|
81
|
+
it('should call `afterListen` after set listen on instance', () => {
|
82
|
+
var afterListenCallback = jasmine.createSpy('afterListenCallback');
|
83
|
+
|
84
|
+
handsontable({
|
85
|
+
afterListen: afterListenCallback
|
86
|
+
});
|
87
|
+
|
88
|
+
expect(afterListenCallback.calls.count()).toBe(0);
|
89
|
+
|
90
|
+
spec().$container.handsontable('listen');
|
91
|
+
|
92
|
+
expect(afterListenCallback.calls.count()).toBe(1);
|
93
|
+
});
|
94
|
+
|
95
|
+
it('should call `afterUnlisten` after unset listen on instance', () => {
|
96
|
+
var afterUnlistenCallback = jasmine.createSpy('afterListenCallback');
|
97
|
+
|
98
|
+
handsontable({
|
99
|
+
afterUnlisten: afterUnlistenCallback
|
100
|
+
});
|
101
|
+
|
102
|
+
spec().$container.handsontable('listen');
|
103
|
+
|
104
|
+
expect(afterUnlistenCallback.calls.count()).toBe(0);
|
105
|
+
|
106
|
+
spec().$container.handsontable('unlisten');
|
107
|
+
|
108
|
+
expect(afterUnlistenCallback.calls.count()).toBe(1);
|
109
|
+
});
|
110
|
+
});
|
79
111
|
});
|
@@ -596,7 +596,7 @@ describe('Core_selection', () => {
|
|
596
596
|
|
597
597
|
selectCell(0, 0);
|
598
598
|
|
599
|
-
expect(document.activeElement.nodeName).toBeInArray(['BODY', 'HTML']);
|
599
|
+
expect(document.activeElement.nodeName).toBeInArray(['TEXTAREA', 'BODY', 'HTML']);
|
600
600
|
|
601
601
|
$input.focus();
|
602
602
|
|
@@ -976,6 +976,35 @@ describe('Core_validate', () => {
|
|
976
976
|
}, 200);
|
977
977
|
});
|
978
978
|
|
979
|
+
it('should remove htInvalid class properly after cancelling change, when physical indexes are not equal to visual indexes', (done) => {
|
980
|
+
handsontable({
|
981
|
+
data: Handsontable.helper.createSpreadsheetData(5, 2),
|
982
|
+
columnSorting: {
|
983
|
+
column: 0,
|
984
|
+
sortOrder: false
|
985
|
+
},
|
986
|
+
allowInvalid: false,
|
987
|
+
validator(value, callback) {
|
988
|
+
setTimeout(() => {
|
989
|
+
callback(value.length === 2);
|
990
|
+
}, 100);
|
991
|
+
}
|
992
|
+
});
|
993
|
+
|
994
|
+
selectCell(0, 0);
|
995
|
+
keyDown('enter');
|
996
|
+
|
997
|
+
document.activeElement.value = 'Ted';
|
998
|
+
|
999
|
+
keyDown('enter');
|
1000
|
+
|
1001
|
+
setTimeout(() => {
|
1002
|
+
const $cell = $(getCell(0, 0));
|
1003
|
+
expect($cell.hasClass('htInvalid')).toEqual(false);
|
1004
|
+
done();
|
1005
|
+
}, 200);
|
1006
|
+
});
|
1007
|
+
|
979
1008
|
it('should close the editor and save the new value if validation fails and allowInvalid is set to "true"', (done) => {
|
980
1009
|
var validated = false;
|
981
1010
|
var validationResult;
|
@@ -29,7 +29,7 @@ describe('CheckboxRenderer', () => {
|
|
29
29
|
handsontable({
|
30
30
|
data: [[true], [false], [true]],
|
31
31
|
columns: [
|
32
|
-
{type: 'checkbox'
|
32
|
+
{type: 'checkbox'}
|
33
33
|
]
|
34
34
|
});
|
35
35
|
|
@@ -55,7 +55,13 @@ describe('CheckboxRenderer', () => {
|
|
55
55
|
expect($(getRenderedContent(2, 0)).prop('checked')).toBe(true);
|
56
56
|
});
|
57
57
|
|
58
|
-
it('should select cell after checkbox click', function() {
|
58
|
+
it('should select cell after checkbox click', function(done) {
|
59
|
+
var spy = jasmine.createSpyObj('error', ['test']);
|
60
|
+
window.onerror = function(messageOrEvent, source, lineno, colno, error) {
|
61
|
+
spy.test();
|
62
|
+
return false;
|
63
|
+
};
|
64
|
+
|
59
65
|
var hot = handsontable({
|
60
66
|
data: [[true], [false], [true]],
|
61
67
|
columns: [
|
@@ -65,9 +71,16 @@ describe('CheckboxRenderer', () => {
|
|
65
71
|
|
66
72
|
hot.selectCell(0, 0);
|
67
73
|
|
68
|
-
|
74
|
+
spec().$container.find(':checkbox').eq(2).simulate('mousedown');
|
75
|
+
spec().$container.find(':checkbox').eq(2).simulate('mouseup');
|
76
|
+
spec().$container.find(':checkbox').eq(2).simulate('click');
|
69
77
|
|
70
|
-
|
78
|
+
setTimeout(() => {
|
79
|
+
expect(spy.test.calls.count()).toBe(0);
|
80
|
+
expect(hot.getSelected()).toEqual([2, 0, 2, 0]);
|
81
|
+
|
82
|
+
done();
|
83
|
+
}, 100);
|
71
84
|
});
|
72
85
|
|
73
86
|
it('should select cell after label click', function() {
|
@@ -89,7 +102,7 @@ describe('CheckboxRenderer', () => {
|
|
89
102
|
handsontable({
|
90
103
|
data: [[true], [false], [true]],
|
91
104
|
columns: [
|
92
|
-
{type: 'checkbox'
|
105
|
+
{type: 'checkbox'}
|
93
106
|
]
|
94
107
|
});
|
95
108
|
|
@@ -465,7 +478,7 @@ describe('CheckboxRenderer', () => {
|
|
465
478
|
handsontable({
|
466
479
|
data: [[true], [false], [true]],
|
467
480
|
columns: [
|
468
|
-
{
|
481
|
+
{type: 'checkbox'}
|
469
482
|
]
|
470
483
|
});
|
471
484
|
|
@@ -499,7 +512,7 @@ describe('CheckboxRenderer', () => {
|
|
499
512
|
handsontable({
|
500
513
|
data: [[true], [false], [true]],
|
501
514
|
columns: [
|
502
|
-
{
|
515
|
+
{type: 'checkbox'}
|
503
516
|
]
|
504
517
|
});
|
505
518
|
|
@@ -62,6 +62,7 @@ describe('settings', () => {
|
|
62
62
|
range.setEndAfter(fromEl, 0);
|
63
63
|
sel.removeAllRanges();
|
64
64
|
sel.addRange(range);
|
65
|
+
|
65
66
|
} else if (doc.body.createTextRange) { // IE8
|
66
67
|
range = doc.body.createTextRange();
|
67
68
|
range.moveToElementText(fromEl);
|
@@ -72,20 +73,22 @@ describe('settings', () => {
|
|
72
73
|
|
73
74
|
describe('constructor', () => {
|
74
75
|
it('should disallow fragmentSelection when set to false', function() {
|
75
|
-
handsontable({
|
76
|
+
const hot = handsontable({
|
76
77
|
data: Handsontable.helper.createSpreadsheetData(4, 4),
|
77
78
|
fragmentSelection: false
|
78
79
|
});
|
80
|
+
|
79
81
|
selectElementText(this.$container.find('tr:eq(0) td:eq(1)')[0], 3);
|
80
82
|
|
81
83
|
mouseDown(this.$container.find('tr:eq(0) td:eq(3)'));
|
82
84
|
mouseUp(this.$container.find('tr:eq(0) td:eq(3)'));
|
83
85
|
|
84
86
|
var sel = getSelected();
|
85
|
-
expect(sel).toEqual(
|
87
|
+
expect(sel).toEqual(' '); // copyPaste has selected space in textarea
|
86
88
|
});
|
87
89
|
|
88
|
-
|
90
|
+
xit('should allow fragmentSelection when set to true', function() {
|
91
|
+
// We have to try another way to simulate text selection.
|
89
92
|
handsontable({
|
90
93
|
data: Handsontable.helper.createSpreadsheetData(4, 4),
|
91
94
|
fragmentSelection: true
|
@@ -100,7 +103,8 @@ describe('settings', () => {
|
|
100
103
|
expect(sel).toEqual('B1C1D1');
|
101
104
|
});
|
102
105
|
|
103
|
-
|
106
|
+
xit('should allow fragmentSelection from one cell when set to `cell`', function() {
|
107
|
+
// We have to try another way to simulate text selection.
|
104
108
|
var hot = handsontable({
|
105
109
|
data: Handsontable.helper.createSpreadsheetData(4, 4),
|
106
110
|
fragmentSelection: 'cell'
|
@@ -108,8 +112,6 @@ describe('settings', () => {
|
|
108
112
|
selectElementText(this.$container.find('td')[1], 1);
|
109
113
|
|
110
114
|
mouseDown(this.$container.find('tr:eq(0) td:eq(1)'));
|
111
|
-
mouseOver(this.$container.find('tr:eq(0) td:eq(1)'));
|
112
|
-
mouseMove(this.$container.find('tr:eq(0) td:eq(1)'));
|
113
115
|
mouseUp(this.$container.find('tr:eq(0) td:eq(1)'));
|
114
116
|
|
115
117
|
expect(getSelected().replace(/\s/g, '')).toEqual('B1');
|
@@ -127,7 +129,7 @@ describe('settings', () => {
|
|
127
129
|
mouseMove(this.$container.find('tr:eq(0) td:eq(2)'));
|
128
130
|
mouseUp(this.$container.find('tr:eq(0) td:eq(2)'));
|
129
131
|
|
130
|
-
expect(getSelected()).toEqual(
|
132
|
+
expect(getSelected()).toEqual(' '); // copyPaste has selected space in textarea
|
131
133
|
});
|
132
134
|
|
133
135
|
it('should disallow fragmentSelection of Handsontable chrome (anything that is not table) when set to false', function() {
|
@@ -174,10 +176,11 @@ describe('settings', () => {
|
|
174
176
|
mouseUp(this.$container.find('tr:eq(0) td:eq(3)'));
|
175
177
|
|
176
178
|
var sel = getSelected();
|
177
|
-
expect(sel).toEqual(
|
179
|
+
expect(sel).toEqual(' '); // copyPaste has selected space in textarea
|
178
180
|
});
|
179
181
|
|
180
|
-
|
182
|
+
xit('should allow fragmentSelection when set to true', function() {
|
183
|
+
// We have to try another way to simulate text selection.
|
181
184
|
handsontable({
|
182
185
|
data: Handsontable.helper.createSpreadsheetData(4, 4),
|
183
186
|
fragmentSelection: false
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
const request = require('request');
|
3
|
+
|
4
|
+
const ENDPOINT = 'https://api.travis-ci.org';
|
5
|
+
const REPO_OWNER = 'handsontable';
|
6
|
+
const REPO_PROJECT = 'handsontable-pro';
|
7
|
+
|
8
|
+
const options = {
|
9
|
+
method: 'POST',
|
10
|
+
url: `${ENDPOINT}/repo/${REPO_OWNER}%2F${REPO_PROJECT}/requests`,
|
11
|
+
headers: {
|
12
|
+
Authorization: `token ${process.env.TCI_TOKEN}`,
|
13
|
+
Accept: 'application/json',
|
14
|
+
ContentType: 'application/json',
|
15
|
+
'Travis-API-Version': '3',
|
16
|
+
},
|
17
|
+
json: {
|
18
|
+
request: {
|
19
|
+
message: `Checking triggered from handsontable/handsontable repository (the ${process.env.TRAVIS_BRANCH} branch)`,
|
20
|
+
branch: 'develop',
|
21
|
+
config: {
|
22
|
+
env: {
|
23
|
+
global: [
|
24
|
+
`HOT_BRANCH=${process.env.TRAVIS_BRANCH}`,
|
25
|
+
`HOT_FOREIGN_TRIGGER=true`,
|
26
|
+
],
|
27
|
+
},
|
28
|
+
},
|
29
|
+
}
|
30
|
+
},
|
31
|
+
};
|
32
|
+
|
33
|
+
request(options, (err, res) => {
|
34
|
+
if (err) {
|
35
|
+
process.exit(1);
|
36
|
+
}
|
37
|
+
|
38
|
+
if (res.statusCode >= 400) {
|
39
|
+
process.exit(1);
|
40
|
+
}
|
41
|
+
});
|