| 1 |
- {"version":3,"file":"helpers.entry.js","sources":["webpack:///webpack/bootstrap 04a8d6900f40f9b615ea?6974","webpack:///src/3rdparty/walkontable/test/helpers/common.js","webpack:///external \"window\"","webpack:///src/3rdparty/walkontable/test/helpers/index.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 = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 04a8d6900f40f9b615ea","export function spec() {\n return currentSpec;\n};\n\nexport function createDataArray(rows, cols) {\n spec().data = [];\n rows = typeof rows === 'number' ? rows : 100;\n cols = typeof cols === 'number' ? cols : 4;\n\n for (var i = 0; i < rows; i++) {\n var row = [];\n\n if (cols > 0) {\n row.push(i);\n\n for (var j = 0; j < cols - 1; j++) {\n /* eslint-disable no-mixed-operators */\n /* eslint-disable no-bitwise */\n row.push(String.fromCharCode(65 + j % 20).toLowerCase() + (j / 20 | 0 || '')); // | 0 is parseInt - see http://jsperf.com/math-floor-vs-math-round-vs-parseint/18\n }\n }\n spec().data.push(row);\n }\n};\n\nexport function getData(row, col) {\n return spec().data[row][col];\n};\n\nexport function getTotalRows() {\n return spec().data.length;\n};\n\nexport function getTotalColumns() {\n return spec().data[0] ? spec().data[0].length : 0;\n};\n\nvar currentSpec;\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\nafterEach(() => {\n window.scrollTo(0, 0);\n});\n\nexport function getTableWidth(elem) {\n return $(elem).outerWidth() || $(elem).find('tbody').outerWidth() || $(elem).find('thead').outerWidth(); // IE8 reports 0 as <table> offsetWidth\n};\n\nexport function range(from, to) {\n if (!arguments.length) {\n return [];\n }\n\n if (arguments.length == 1) {\n to = from;\n from = 0;\n }\n\n if (to > from) {\n from = [to, to = from][0]; // one-liner for swapping two values\n }\n\n var result = [];\n\n while (to++ < from) {\n result.push(to);\n }\n\n return result;\n};\n\n/**\n * Rewrite all existing selections from selections[0] etc. to selections.current etc\n * @param instance\n * @returns {object} modified instance\n */\nexport function shimSelectionProperties(instance) {\n if (instance.selections[0]) {\n instance.selections.current = instance.selections[0];\n }\n if (instance.selections[1]) {\n instance.selections.area = instance.selections[1];\n }\n if (instance.selections[2]) {\n instance.selections.highlight = instance.selections[2];\n }\n if (instance.selections[3]) {\n instance.selections.fill = instance.selections[3];\n }\n\n return instance;\n}\n\nexport function getTableTopClone() {\n return $('.ht_clone_top');\n}\n\nexport function getTableLeftClone() {\n return $('.ht_clone_left');\n}\n\nexport function getTableCornerClone() {\n return $('.ht_clone_top_left_corner');\n}\n\nexport function createSpreadsheetData(rows, columns) {\n var _rows = [],\n i,\n j;\n\n for (i = 0; i < rows; i++) {\n var row = [];\n\n for (j = 0; j < columns; j++) {\n row.push(spreadsheetColumnLabel(j) + (i + 1));\n }\n _rows.push(row);\n }\n\n return _rows;\n}\n\nconst COLUMN_LABEL_BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst COLUMN_LABEL_BASE_LENGTH = COLUMN_LABEL_BASE.length;\n\n/**\n * Generates spreadsheet-like column names: A, B, C, ..., Z, AA, AB, etc.\n *\n * @param {Number} index Column index.\n * @returns {String}\n */\nexport function spreadsheetColumnLabel(index) {\n let dividend = index + 1;\n let columnLabel = '';\n let modulo;\n\n while (dividend > 0) {\n modulo = (dividend - 1) % COLUMN_LABEL_BASE_LENGTH;\n columnLabel = String.fromCharCode(65 + modulo) + columnLabel;\n dividend = parseInt((dividend - modulo) / COLUMN_LABEL_BASE_LENGTH, 10);\n }\n\n return columnLabel;\n}\n\nexport function walkontableCalculateScrollbarWidth() {\n var inner = document.createElement('div');\n inner.style.height = '200px';\n inner.style.width = '100%';\n\n var outer = document.createElement('div');\n outer.style.boxSizing = 'content-box';\n outer.style.height = '150px';\n outer.style.left = '0px';\n outer.style.overflow = 'hidden';\n outer.style.position = 'absolute';\n outer.style.top = '0px';\n outer.style.width = '200px';\n outer.style.visibility = 'hidden';\n outer.appendChild(inner);\n\n (document.body || document.documentElement).appendChild(outer);\n var w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n var w2 = inner.offsetWidth;\n if (w1 == w2) {\n w2 = outer.clientWidth;\n }\n\n (document.body || document.documentElement).removeChild(outer);\n\n return (w1 - w2);\n}\n\nvar cachedScrollbarWidth;\n\nexport function getScrollbarWidth() {\n if (cachedScrollbarWidth === void 0) {\n cachedScrollbarWidth = walkontableCalculateScrollbarWidth();\n }\n\n return cachedScrollbarWidth;\n}\n\n\n\n// WEBPACK FOOTER //\n// src/3rdparty/walkontable/test/helpers/common.js","module.exports = window;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"window\"\n// module id = 2\n// module chunks = 1","/* eslint-disable import/no-unresolved */\nimport window from 'window';\nimport * as common from './common';\n\n// Export all helpers to the window.\nObject.keys(common).forEach((key) => {\n window[key] = common[key];\n});\n\n\n\n// WEBPACK FOOTER //\n// src/3rdparty/walkontable/test/helpers/index.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;AAIA;AAqBA;AAIA;AAIA;AAwDA;AAIA;AA4BA;AAiBA;AAIA;AAIA;AAIA;AA0BA;AAcA;AA+BA;AA7NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AAAA;AAAA;AACA;AAGA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACnOA;;;;;;;;;ACCA;AACA;;;AAAA;AACA;AADA;AACA;;;;;AACA;AAJA;AAKA;AACA;AACA;;;A","sourceRoot":""}
|