diff --git a/.babelrc b/.babelrc index fcadf192..b8a0a5af 100644 --- a/.babelrc +++ b/.babelrc @@ -138,7 +138,8 @@ "core-js/*", "regenerator-runtime/runtime", "./common", - "./jasmine", + "./../bootstrap", + "./helpers/custom-matchers", "./MemoryLeakTest" ] }] diff --git a/README.md b/README.md index a1e057f8..89da5afa 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ var hot = new Handsontable(container, { - Gantt Chart (beta) - Non-contiguous selection -[See a comparison table](//docs.handsontable.com/pro/tutorial-features.html) +[See a comparison table](//handsontable.com/docs/tutorial-features.html)
@@ -107,9 +107,9 @@ var hot = new Handsontable(container, {
### Resources -- [API Reference](//docs.handsontable.com/pro/Core.html) -- [Compatibility](//docs.handsontable.com/pro/tutorial-compatibility.html) -- [Change log](//docs.handsontable.com/pro/tutorial-release-notes.html) +- [API Reference](//handsontable.com/docs/Core.html) +- [Compatibility](//handsontable.com/docs/tutorial-compatibility.html) +- [Change log](//handsontable.com/docs/tutorial-release-notes.html) - [Roadmap](//trello.com/b/PztR4hpj) - [Newsroom](//twitter.com/handsontable) diff --git a/dist/handsontable.css b/dist/handsontable.css index fd2d48c1..83782e2f 100644 --- a/dist/handsontable.css +++ b/dist/handsontable.css @@ -20,8 +20,8 @@ * RELIABILITY AND PERFORMANCE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SOFTWARE WILL BE * UNINTERRUPTED OR ERROR FREE. * - * Version: 6.1.1 - * Release date: 23/10/2018 (built at 23/10/2018 12:28:31) + * Version: 6.2.0 + * Release date: 14/11/2018 (built at 14/11/2018 12:28:46) */ /** * Fix for bootstrap styles @@ -1505,16 +1505,6 @@ textarea#HandsontableCopyPaste { z-index: 1070; } -/* - AutoColumnSize will NOT count size of filter's value box and filter's selects. These elements should always fit - to another elements elbowing the table. Value box could scale, but we have two problems which were fixed by workaround: - - borders declared for the `table.htCore` are also counted by `offsetWidth` (however it could be fixed by not displaying them for GhostTable) - - MultipleSelectUI basing on Handsontable is built only once, so it's `wtHolder` width is counted only once. -*/ -.htGhostTable .htUIMultipleSelectHot, .htGhostTable .htUISelect { - display: none; -} - .htFiltersConditionsMenu .ht_clone_top, .htFiltersConditionsMenu .ht_clone_left, .htFiltersConditionsMenu .ht_clone_corner, diff --git a/dist/handsontable.css.map b/dist/handsontable.css.map index 6ff2fb92..109d2b9b 100644 --- a/dist/handsontable.css.map +++ b/dist/handsontable.css.map @@ -1 +1 @@ -{"version":3,"file":"handsontable.css","sources":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","sourceRoot":""} \ No newline at end of file +{"version":3,"file":"handsontable.css","sources":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","sourceRoot":""} \ No newline at end of file diff --git a/dist/handsontable.full.css b/dist/handsontable.full.css index 04bb31b2..bbfe085c 100644 --- a/dist/handsontable.full.css +++ b/dist/handsontable.full.css @@ -20,8 +20,8 @@ * RELIABILITY AND PERFORMANCE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SOFTWARE WILL BE * UNINTERRUPTED OR ERROR FREE. * - * Version: 6.1.1 - * Release date: 23/10/2018 (built at 23/10/2018 12:28:31) + * Version: 6.2.0 + * Release date: 14/11/2018 (built at 14/11/2018 12:28:46) */ /** * Fix for bootstrap styles @@ -1727,16 +1727,6 @@ textarea#HandsontableCopyPaste { z-index: 1070; } -/* - AutoColumnSize will NOT count size of filter's value box and filter's selects. These elements should always fit - to another elements elbowing the table. Value box could scale, but we have two problems which were fixed by workaround: - - borders declared for the `table.htCore` are also counted by `offsetWidth` (however it could be fixed by not displaying them for GhostTable) - - MultipleSelectUI basing on Handsontable is built only once, so it's `wtHolder` width is counted only once. -*/ -.htGhostTable .htUIMultipleSelectHot, .htGhostTable .htUISelect { - display: none; -} - .htFiltersConditionsMenu .ht_clone_top, .htFiltersConditionsMenu .ht_clone_left, .htFiltersConditionsMenu .ht_clone_corner, diff --git a/dist/handsontable.full.js b/dist/handsontable.full.js index 4dfad7bb..061028e2 100644 --- a/dist/handsontable.full.js +++ b/dist/handsontable.full.js @@ -20,8 +20,8 @@ * RELIABILITY AND PERFORMANCE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SOFTWARE WILL BE * UNINTERRUPTED OR ERROR FREE. * - * Version: 6.1.1 - * Release date: 23/10/2018 (built at 23/10/2018 12:28:31) + * Version: 6.2.0 + * Release date: 14/11/2018 (built at 14/11/2018 12:28:46) */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') @@ -95,7 +95,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 484); +/******/ return __webpack_require__(__webpack_require__.s = 483); /******/ }) /************************************************************************/ /******/ ([ @@ -799,9 +799,9 @@ exports.resetCssTransform = resetCssTransform; exports.isInput = isInput; exports.isOutsideInput = isOutsideInput; -var _browser = __webpack_require__(50); +var _browser = __webpack_require__(42); -var _feature = __webpack_require__(41); +var _feature = __webpack_require__(43); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } @@ -2121,6 +2121,55 @@ exports.getPluginName = getPluginName; /* 6 */ /***/ (function(module, exports, __webpack_require__) { +var global = __webpack_require__(16); +var core = __webpack_require__(50); +var hide = __webpack_require__(37); +var redefine = __webpack_require__(36); +var ctx = __webpack_require__(38); +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); + var key, own, out, exp; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if (target) redefine(target, key, out, type & $export.U); + // export + if (exports[key] != out) hide(exports, key, exp); + if (IS_PROTO && expProto[key] != out) expProto[key] = out; + } +}; +global.core = core; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; @@ -2375,55 +2424,6 @@ var BasePlugin = function () { exports.default = BasePlugin; -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(16); -var core = __webpack_require__(48); -var hide = __webpack_require__(37); -var redefine = __webpack_require__(36); -var ctx = __webpack_require__(38); -var PROTOTYPE = 'prototype'; - -var $export = function (type, name, source) { - var IS_FORCED = type & $export.F; - var IS_GLOBAL = type & $export.G; - var IS_STATIC = type & $export.S; - var IS_PROTO = type & $export.P; - var IS_BIND = type & $export.B; - var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; - var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); - var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); - var key, own, out, exp; - if (IS_GLOBAL) source = name; - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // extend global - if (target) redefine(target, key, out, type & $export.U); - // export - if (exports[key] != out) hide(exports, key, exp); - if (IS_PROTO && expProto[key] != out) expProto[key] = out; - } -}; -global.core = core; -// type bitmap -$export.F = 1; // forced -$export.G = 2; // global -$export.S = 4; // static -$export.P = 8; // proto -$export.B = 16; // bind -$export.W = 32; // wrap -$export.U = 64; // safe -$export.R = 128; // real proto method for `library` -module.exports = $export; - - /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { @@ -2431,197 +2431,6 @@ module.exports = $export; "use strict"; -exports.__esModule = true; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _templateObject = _taggedTemplateLiteral(['\n Your license key of Handsontable Pro has expired.\u200C\u200C\u200C\u200C \n Renew your maintenance plan at https://handsontable.com or downgrade to the previous version of the software.\n '], ['\n Your license key of Handsontable Pro has expired.\u200C\u200C\u200C\u200C \n Renew your maintenance plan at https://handsontable.com or downgrade to the previous version of the software.\n ']); - -exports.stringify = stringify; -exports.isDefined = isDefined; -exports.isUndefined = isUndefined; -exports.isEmpty = isEmpty; -exports.isRegExp = isRegExp; -exports._injectProductInfo = _injectProductInfo; - -var _moment = __webpack_require__(23); - -var _moment2 = _interopRequireDefault(_moment); - -var _templateLiteralTag = __webpack_require__(26); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } - -/** - * Converts any value to string. - * - * @param {*} value - * @returns {String} - */ -function stringify(value) { - var result = void 0; - - switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { - case 'string': - case 'number': - result = '' + value; - break; - - case 'object': - result = value === null ? '' : value.toString(); - break; - case 'undefined': - result = ''; - break; - default: - result = value.toString(); - break; - } - - return result; -} - -/** - * Checks if given variable is defined. - * - * @param {*} variable Variable to check. - * @returns {Boolean} - */ -function isDefined(variable) { - return typeof variable !== 'undefined'; -} - -/** - * Checks if given variable is undefined. - * - * @param {*} variable Variable to check. - * @returns {Boolean} - */ -function isUndefined(variable) { - return typeof variable === 'undefined'; -} - -/** - * Check if given variable is null, empty string or undefined. - * - * @param {*} variable Variable to check. - * @returns {Boolean} - */ -function isEmpty(variable) { - return variable === null || variable === '' || isUndefined(variable); -} - -/** - * Check if given variable is a regular expression. - * - * @param {*} variable Variable to check. - * @returns {Boolean} - */ -function isRegExp(variable) { - return Object.prototype.toString.call(variable) === '[object RegExp]'; -} - -/* eslint-disable */ -var _m = '\x6C\x65\x6E\x67\x74\x68'; -var _hd = function _hd(v) { - return parseInt(v, 16); -}; -var _pi = function _pi(v) { - return parseInt(v, 10); -}; -var _ss = function _ss(v, s, l) { - return v['\x73\x75\x62\x73\x74\x72'](s, l); -}; -var _cp = function _cp(v) { - return v['\x63\x6F\x64\x65\x50\x6F\x69\x6E\x74\x41\x74'](0) - 65; -}; -var _norm = function _norm(v) { - return ('' + v).replace(/\-/g, ''); -}; -var _extractTime = function _extractTime(v) { - return _hd(_ss(_norm(v), _hd('12'), _cp('\x46'))) / (_hd(_ss(_norm(v), _cp('\x42'), ~~![][_m])) || 9); -}; -var _ignored = function _ignored() { - return typeof location !== 'undefined' && /^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host); -}; -var _notified = false; - -function _injectProductInfo(key, element) { - key = _norm(key || ''); - - var warningMessage = ''; - var showDomMessage = true; - var schemaValidity = _checkKeySchema(key); - var ignored = _ignored(); - var trial = isEmpty(key) || key === 'trial'; - - if (trial || schemaValidity) { - if (schemaValidity) { - var releaseTime = Math.floor((0, _moment2.default)('23/10/2018', 'DD/MM/YYYY').toDate().getTime() / 8.64e7); - var keyGenTime = _extractTime(key); - - if (keyGenTime > 45000 || keyGenTime !== parseInt(keyGenTime, 10)) { - warningMessage = 'The license key provided to Handsontable Pro is invalid. Make sure you pass it correctly.'; - } - - if (!warningMessage) { - if (releaseTime > keyGenTime + 1) { - warningMessage = (0, _templateLiteralTag.toSingleLine)(_templateObject); - } - showDomMessage = releaseTime > keyGenTime + 15; - } - } else { - warningMessage = 'Evaluation version of Handsontable Pro. Not licensed for use in a production environment.'; - } - } else { - warningMessage = 'The license key provided to Handsontable Pro is invalid. Make sure you pass it correctly.'; - } - if (ignored) { - warningMessage = false; - showDomMessage = false; - } - - if (warningMessage && !_notified) { - console[trial ? 'info' : 'warn'](warningMessage); - _notified = true; - } - if (showDomMessage && element.parentNode) { - var message = document.createElement('div'); - - message.id = 'hot-display-license-info'; - message.appendChild(document.createTextNode('Evaluation version of Handsontable Pro.')); - message.appendChild(document.createElement('br')); - message.appendChild(document.createTextNode('Not licensed for production use.')); - - element.parentNode.insertBefore(message, element.nextSibling); - } -} - -function _checkKeySchema(v) { - var z = [][_m]; - var p = z; - - if (v[_m] !== _cp('\x5A')) { - return false; - } - - for (var c = '', i = '\x42\x3C\x48\x34\x50\x2B'.split(''), j = _cp(i.shift()); j; j = _cp(i.shift() || 'A')) { - --j < ''[_m] ? p = p | (_pi('' + _pi(_hd(c) + (_hd(_ss(v, Math.abs(j), 2)) + []).padStart(2, '0'))) % 97 || 2) >> 1 : c = _ss(v, j, !j ? 6 : i[_m] === 1 ? 9 : 8); - } - - return p === z; -} -/* eslint-enable */ - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -2632,7 +2441,7 @@ var _element = __webpack_require__(2); var _object = __webpack_require__(1); -var _feature = __webpack_require__(41); +var _feature = __webpack_require__(43); var _event = __webpack_require__(12); @@ -2930,7 +2739,7 @@ function getListenersCounter() { } /***/ }), -/* 10 */ +/* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2939,7 +2748,9 @@ function getListenersCounter() { exports.__esModule = true; exports.Viewport = exports.TableRenderer = exports.Table = exports.Settings = exports.Selection = exports.Scroll = exports.Overlays = exports.Event = exports.Core = exports.default = exports.Border = exports.BottomLeftCornerOverlay = exports.BottomOverlay = exports.TopLeftCornerOverlay = exports.TopOverlay = exports.LeftOverlay = exports.DebugOverlay = exports.RowFilter = exports.ColumnFilter = exports.CellRange = exports.CellCoords = exports.ViewportRowsCalculator = exports.ViewportColumnsCalculator = undefined; -__webpack_require__(90); +__webpack_require__(89); + +__webpack_require__(98); __webpack_require__(99); @@ -2947,9 +2758,9 @@ __webpack_require__(100); __webpack_require__(101); -__webpack_require__(102); +__webpack_require__(104); -__webpack_require__(105); +__webpack_require__(106); __webpack_require__(107); @@ -2987,7 +2798,7 @@ __webpack_require__(123); __webpack_require__(124); -__webpack_require__(125); +__webpack_require__(127); __webpack_require__(128); @@ -3003,7 +2814,7 @@ __webpack_require__(133); __webpack_require__(134); -__webpack_require__(135); +__webpack_require__(136); __webpack_require__(137); @@ -3013,9 +2824,9 @@ __webpack_require__(139); __webpack_require__(140); -__webpack_require__(141); +__webpack_require__(83); -__webpack_require__(82); +__webpack_require__(141); __webpack_require__(142); @@ -3045,8 +2856,6 @@ __webpack_require__(154); __webpack_require__(155); -__webpack_require__(156); - var _viewportColumns = __webpack_require__(194); var _viewportColumns2 = _interopRequireDefault(_viewportColumns); @@ -3055,7 +2864,7 @@ var _viewportRows = __webpack_require__(195); var _viewportRows2 = _interopRequireDefault(_viewportRows); -var _coords = __webpack_require__(64); +var _coords = __webpack_require__(65); var _coords2 = _interopRequireDefault(_coords); @@ -3071,27 +2880,27 @@ var _row = __webpack_require__(198); var _row2 = _interopRequireDefault(_row); -var _debug = __webpack_require__(507); +var _debug = __webpack_require__(506); var _debug2 = _interopRequireDefault(_debug); -var _left = __webpack_require__(509); +var _left = __webpack_require__(508); var _left2 = _interopRequireDefault(_left); -var _top = __webpack_require__(510); +var _top = __webpack_require__(509); var _top2 = _interopRequireDefault(_top); -var _topLeftCorner = __webpack_require__(511); +var _topLeftCorner = __webpack_require__(510); var _topLeftCorner2 = _interopRequireDefault(_topLeftCorner); -var _bottom = __webpack_require__(512); +var _bottom = __webpack_require__(511); var _bottom2 = _interopRequireDefault(_bottom); -var _bottomLeftCorner = __webpack_require__(513); +var _bottomLeftCorner = __webpack_require__(512); var _bottomLeftCorner2 = _interopRequireDefault(_bottomLeftCorner); @@ -3115,7 +2924,7 @@ var _scroll = __webpack_require__(322); var _scroll2 = _interopRequireDefault(_scroll); -var _selection = __webpack_require__(514); +var _selection = __webpack_require__(513); var _selection2 = _interopRequireDefault(_selection); @@ -3161,6 +2970,197 @@ exports.Table = _table2.default; exports.TableRenderer = _tableRenderer2.default; exports.Viewport = _viewport2.default; +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _templateObject = _taggedTemplateLiteral(['\n Your license key of Handsontable Pro has expired.\u200C\u200C\u200C\u200C \n Renew your maintenance plan at https://handsontable.com or downgrade to the previous version of the software.\n '], ['\n Your license key of Handsontable Pro has expired.\u200C\u200C\u200C\u200C \n Renew your maintenance plan at https://handsontable.com or downgrade to the previous version of the software.\n ']); + +exports.stringify = stringify; +exports.isDefined = isDefined; +exports.isUndefined = isUndefined; +exports.isEmpty = isEmpty; +exports.isRegExp = isRegExp; +exports._injectProductInfo = _injectProductInfo; + +var _moment = __webpack_require__(25); + +var _moment2 = _interopRequireDefault(_moment); + +var _templateLiteralTag = __webpack_require__(26); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +/** + * Converts any value to string. + * + * @param {*} value + * @returns {String} + */ +function stringify(value) { + var result = void 0; + + switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) { + case 'string': + case 'number': + result = '' + value; + break; + + case 'object': + result = value === null ? '' : value.toString(); + break; + case 'undefined': + result = ''; + break; + default: + result = value.toString(); + break; + } + + return result; +} + +/** + * Checks if given variable is defined. + * + * @param {*} variable Variable to check. + * @returns {Boolean} + */ +function isDefined(variable) { + return typeof variable !== 'undefined'; +} + +/** + * Checks if given variable is undefined. + * + * @param {*} variable Variable to check. + * @returns {Boolean} + */ +function isUndefined(variable) { + return typeof variable === 'undefined'; +} + +/** + * Check if given variable is null, empty string or undefined. + * + * @param {*} variable Variable to check. + * @returns {Boolean} + */ +function isEmpty(variable) { + return variable === null || variable === '' || isUndefined(variable); +} + +/** + * Check if given variable is a regular expression. + * + * @param {*} variable Variable to check. + * @returns {Boolean} + */ +function isRegExp(variable) { + return Object.prototype.toString.call(variable) === '[object RegExp]'; +} + +/* eslint-disable */ +var _m = '\x6C\x65\x6E\x67\x74\x68'; +var _hd = function _hd(v) { + return parseInt(v, 16); +}; +var _pi = function _pi(v) { + return parseInt(v, 10); +}; +var _ss = function _ss(v, s, l) { + return v['\x73\x75\x62\x73\x74\x72'](s, l); +}; +var _cp = function _cp(v) { + return v['\x63\x6F\x64\x65\x50\x6F\x69\x6E\x74\x41\x74'](0) - 65; +}; +var _norm = function _norm(v) { + return ('' + v).replace(/\-/g, ''); +}; +var _extractTime = function _extractTime(v) { + return _hd(_ss(_norm(v), _hd('12'), _cp('\x46'))) / (_hd(_ss(_norm(v), _cp('\x42'), ~~![][_m])) || 9); +}; +var _ignored = function _ignored() { + return typeof location !== 'undefined' && /^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host); +}; +var _notified = false; + +function _injectProductInfo(key, element) { + key = _norm(key || ''); + + var warningMessage = ''; + var showDomMessage = true; + var schemaValidity = _checkKeySchema(key); + var ignored = _ignored(); + var trial = isEmpty(key) || key === 'trial'; + + if (trial || schemaValidity) { + if (schemaValidity) { + var releaseTime = Math.floor((0, _moment2.default)('14/11/2018', 'DD/MM/YYYY').toDate().getTime() / 8.64e7); + var keyGenTime = _extractTime(key); + + if (keyGenTime > 45000 || keyGenTime !== parseInt(keyGenTime, 10)) { + warningMessage = 'The license key provided to Handsontable Pro is invalid. Make sure you pass it correctly.'; + } + + if (!warningMessage) { + if (releaseTime > keyGenTime + 1) { + warningMessage = (0, _templateLiteralTag.toSingleLine)(_templateObject); + } + showDomMessage = releaseTime > keyGenTime + 15; + } + } else { + warningMessage = 'Evaluation version of Handsontable Pro. Not licensed for use in a production environment.'; + } + } else { + warningMessage = 'The license key provided to Handsontable Pro is invalid. Make sure you pass it correctly.'; + } + if (ignored) { + warningMessage = false; + showDomMessage = false; + } + + if (warningMessage && !_notified) { + console[trial ? 'info' : 'warn'](warningMessage); + _notified = true; + } + if (showDomMessage && element.parentNode) { + var message = document.createElement('div'); + + message.id = 'hot-display-license-info'; + message.appendChild(document.createTextNode('Evaluation version of Handsontable Pro.')); + message.appendChild(document.createElement('br')); + message.appendChild(document.createTextNode('Not licensed for production use.')); + + element.parentNode.insertBefore(message, element.nextSibling); + } +} + +function _checkKeySchema(v) { + var z = [][_m]; + var p = z; + + if (v[_m] !== _cp('\x5A')) { + return false; + } + + for (var c = '', i = '\x42\x3C\x48\x34\x50\x2B'.split(''), j = _cp(i.shift()); j; j = _cp(i.shift() || 'A')) { + --j < ''[_m] ? p = p | (_pi('' + _pi(_hd(c) + (_hd(_ss(v, Math.abs(j), 2)) + []).padStart(2, '0'))) % 97 || 2) >> 1 : c = _ss(v, j, !j ? 6 : i[_m] === 1 ? 9 : 8); + } + + return p === z; +} +/* eslint-enable */ + /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { @@ -3342,8 +3342,8 @@ module.exports = function (it) { /* 14 */ /***/ (function(module, exports, __webpack_require__) { -var store = __webpack_require__(96)('wks'); -var uid = __webpack_require__(58); +var store = __webpack_require__(95)('wks'); +var uid = __webpack_require__(59); var Symbol = __webpack_require__(16).Symbol; var USE_SYMBOL = typeof Symbol == 'function'; @@ -3365,35 +3365,35 @@ $exports.store = store; exports.__esModule = true; exports.getRegisteredRenderers = exports.getRegisteredRendererNames = exports.hasRenderer = exports.getRenderer = exports.registerRenderer = undefined; -var _staticRegister2 = __webpack_require__(49); +var _staticRegister2 = __webpack_require__(41); var _staticRegister3 = _interopRequireDefault(_staticRegister2); -var _cellDecorator = __webpack_require__(526); +var _cellDecorator = __webpack_require__(525); var _cellDecorator2 = _interopRequireDefault(_cellDecorator); -var _autocompleteRenderer = __webpack_require__(527); +var _autocompleteRenderer = __webpack_require__(526); var _autocompleteRenderer2 = _interopRequireDefault(_autocompleteRenderer); -var _checkboxRenderer = __webpack_require__(528); +var _checkboxRenderer = __webpack_require__(527); var _checkboxRenderer2 = _interopRequireDefault(_checkboxRenderer); -var _htmlRenderer = __webpack_require__(529); +var _htmlRenderer = __webpack_require__(528); var _htmlRenderer2 = _interopRequireDefault(_htmlRenderer); -var _numericRenderer = __webpack_require__(530); +var _numericRenderer = __webpack_require__(529); var _numericRenderer2 = _interopRequireDefault(_numericRenderer); -var _passwordRenderer = __webpack_require__(531); +var _passwordRenderer = __webpack_require__(530); var _passwordRenderer2 = _interopRequireDefault(_passwordRenderer); -var _textRenderer = __webpack_require__(532); +var _textRenderer = __webpack_require__(531); var _textRenderer2 = _interopRequireDefault(_textRenderer); @@ -5747,7 +5747,7 @@ exports.getRegisteredEditors = exports.getRegisteredEditorNames = exports.hasEdi exports.RegisteredEditor = RegisteredEditor; exports._getEditorInstance = _getEditorInstance; -var _staticRegister2 = __webpack_require__(49); +var _staticRegister2 = __webpack_require__(41); var _staticRegister3 = _interopRequireDefault(_staticRegister2); @@ -5755,7 +5755,7 @@ var _pluginHooks = __webpack_require__(17); var _pluginHooks2 = _interopRequireDefault(_pluginHooks); -var _baseEditor = __webpack_require__(63); +var _baseEditor = __webpack_require__(64); var _baseEditor2 = _interopRequireDefault(_baseEditor); @@ -5763,15 +5763,15 @@ var _autocompleteEditor = __webpack_require__(328); var _autocompleteEditor2 = _interopRequireDefault(_autocompleteEditor); -var _checkboxEditor = __webpack_require__(516); +var _checkboxEditor = __webpack_require__(515); var _checkboxEditor2 = _interopRequireDefault(_checkboxEditor); -var _dateEditor = __webpack_require__(517); +var _dateEditor = __webpack_require__(516); var _dateEditor2 = _interopRequireDefault(_dateEditor); -var _dropdownEditor = __webpack_require__(522); +var _dropdownEditor = __webpack_require__(521); var _dropdownEditor2 = _interopRequireDefault(_dropdownEditor); @@ -5779,19 +5779,19 @@ var _handsontableEditor = __webpack_require__(329); var _handsontableEditor2 = _interopRequireDefault(_handsontableEditor); -var _numericEditor = __webpack_require__(523); +var _numericEditor = __webpack_require__(522); var _numericEditor2 = _interopRequireDefault(_numericEditor); -var _passwordEditor = __webpack_require__(524); +var _passwordEditor = __webpack_require__(523); var _passwordEditor2 = _interopRequireDefault(_passwordEditor); -var _selectEditor = __webpack_require__(525); +var _selectEditor = __webpack_require__(524); var _selectEditor2 = _interopRequireDefault(_selectEditor); -var _textEditor = __webpack_require__(65); +var _textEditor = __webpack_require__(66); var _textEditor2 = _interopRequireDefault(_textEditor); @@ -5912,83 +5912,6 @@ exports.getRegisteredEditors = getValues; "use strict"; -exports.__esModule = true; -exports.log = log; -exports.warn = warn; -exports.info = info; -exports.error = error; - -var _mixed = __webpack_require__(8); - -/** - * Logs message to the console if the `console` object is exposed. - * - * @param {...*} args Values which will be logged. - */ -function log() { - if ((0, _mixed.isDefined)(console)) { - var _console; - - (_console = console).log.apply(_console, arguments); - } -} - -/** - * Logs warn to the console if the `console` object is exposed. - * - * @param {...*} args Values which will be logged. - */ -/* eslint-disable no-console */ -/* eslint-disable no-restricted-globals */ - -/** - * "In Internet Explorer 9 (and 8), the console object is only exposed when the developer tools are opened - * for a particular tab." - * - * Source: https://stackoverflow.com/a/5473193 - */ - -function warn() { - if ((0, _mixed.isDefined)(console)) { - var _console2; - - (_console2 = console).warn.apply(_console2, arguments); - } -} - -/** - * Logs info to the console if the `console` object is exposed. - * - * @param {...*} args Values which will be logged. - */ -function info() { - if ((0, _mixed.isDefined)(console)) { - var _console3; - - (_console3 = console).info.apply(_console3, arguments); - } -} - -/** - * Logs error to the console if the `console` object is exposed. - * - * @param {...*} args Values which will be logged. - */ -function error() { - if ((0, _mixed.isDefined)(console)) { - var _console4; - - (_console4 = console).error.apply(_console4, arguments); - } -} - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - exports.__esModule = true; var _array = __webpack_require__(0); @@ -6066,7 +5989,7 @@ var localHooks = { exports.default = localHooks; /***/ }), -/* 22 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(13); @@ -6076,10 +5999,327 @@ module.exports = function (it) { }; +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.log = log; +exports.warn = warn; +exports.info = info; +exports.error = error; + +var _mixed = __webpack_require__(10); + +/** + * Logs message to the console if the `console` object is exposed. + * + * @param {...*} args Values which will be logged. + */ +function log() { + if ((0, _mixed.isDefined)(console)) { + var _console; + + (_console = console).log.apply(_console, arguments); + } +} + +/** + * Logs warn to the console if the `console` object is exposed. + * + * @param {...*} args Values which will be logged. + */ +/* eslint-disable no-console */ +/* eslint-disable no-restricted-globals */ + +/** + * "In Internet Explorer 9 (and 8), the console object is only exposed when the developer tools are opened + * for a particular tab." + * + * Source: https://stackoverflow.com/a/5473193 + */ + +function warn() { + if ((0, _mixed.isDefined)(console)) { + var _console2; + + (_console2 = console).warn.apply(_console2, arguments); + } +} + +/** + * Logs info to the console if the `console` object is exposed. + * + * @param {...*} args Values which will be logged. + */ +function info() { + if ((0, _mixed.isDefined)(console)) { + var _console3; + + (_console3 = console).info.apply(_console3, arguments); + } +} + +/** + * Logs error to the console if the `console` object is exposed. + * + * @param {...*} args Values which will be logged. + */ +function error() { + if ((0, _mixed.isDefined)(console)) { + var _console4; + + (_console4 = console).error.apply(_console4, arguments); + } +} + /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + + +exports.__esModule = true; +exports.normalizeSelection = normalizeSelection; +exports.isSeparator = isSeparator; +exports.hasSubMenu = hasSubMenu; +exports.isDisabled = isDisabled; +exports.isSelectionDisabled = isSelectionDisabled; +exports.getValidSelection = getValidSelection; +exports.prepareVerticalAlignClass = prepareVerticalAlignClass; +exports.prepareHorizontalAlignClass = prepareHorizontalAlignClass; +exports.getAlignmentClasses = getAlignmentClasses; +exports.align = align; +exports.checkSelectionConsistency = checkSelectionConsistency; +exports.markLabelAsSelected = markLabelAsSelected; +exports.isItemHidden = isItemHidden; +exports.filterSeparators = filterSeparators; + +var _array = __webpack_require__(0); + +var _element = __webpack_require__(2); + +var _separator = __webpack_require__(161); + +function normalizeSelection(selRanges) { + return (0, _array.arrayMap)(selRanges, function (range) { + return { + start: range.getTopLeftCorner(), + end: range.getBottomRightCorner() + }; + }); +} + +function isSeparator(cell) { + return (0, _element.hasClass)(cell, 'htSeparator'); +} + +function hasSubMenu(cell) { + return (0, _element.hasClass)(cell, 'htSubmenu'); +} + +function isDisabled(cell) { + return (0, _element.hasClass)(cell, 'htDisabled'); +} + +function isSelectionDisabled(cell) { + return (0, _element.hasClass)(cell, 'htSelectionDisabled'); +} + +function getValidSelection(hot) { + var selected = hot.getSelected(); + + if (!selected) { + return null; + } + if (selected[0] < 0) { + return null; + } + + return selected; +} + +function prepareVerticalAlignClass(className, alignment) { + if (className.indexOf(alignment) !== -1) { + return className; + } + + var replacedClassName = className.replace('htTop', '').replace('htMiddle', '').replace('htBottom', '').replace(' ', ''); + + return replacedClassName + ' ' + alignment; +} + +function prepareHorizontalAlignClass(className, alignment) { + if (className.indexOf(alignment) !== -1) { + return className; + } + var replacedClassName = className.replace('htLeft', '').replace('htCenter', '').replace('htRight', '').replace('htJustify', '').replace(' ', ''); + + return replacedClassName + ' ' + alignment; +} + +function getAlignmentClasses(ranges, callback) { + var classes = {}; + + (0, _array.arrayEach)(ranges, function (_ref) { + var from = _ref.from, + to = _ref.to; + + for (var row = from.row; row <= to.row; row++) { + for (var col = from.col; col <= to.col; col++) { + if (!classes[row]) { + classes[row] = []; + } + classes[row][col] = callback(row, col); + } + } + }); + + return classes; +} + +function align(ranges, type, alignment, cellDescriptor, propertySetter) { + (0, _array.arrayEach)(ranges, function (_ref2) { + var from = _ref2.from, + to = _ref2.to; + + if (from.row === to.row && from.col === to.col) { + applyAlignClassName(from.row, from.col, type, alignment, cellDescriptor, propertySetter); + } else { + for (var row = from.row; row <= to.row; row++) { + for (var col = from.col; col <= to.col; col++) { + applyAlignClassName(row, col, type, alignment, cellDescriptor, propertySetter); + } + } + } + }); +} + +function applyAlignClassName(row, col, type, alignment, cellDescriptor, propertySetter) { + var cellMeta = cellDescriptor(row, col); + var className = alignment; + + if (cellMeta.className) { + if (type === 'vertical') { + className = prepareVerticalAlignClass(cellMeta.className, alignment); + } else { + className = prepareHorizontalAlignClass(cellMeta.className, alignment); + } + } + + propertySetter(row, col, 'className', className); +} + +function checkSelectionConsistency(ranges, comparator) { + var result = false; + + if (Array.isArray(ranges)) { + (0, _array.arrayEach)(ranges, function (range) { + range.forAll(function (row, col) { + if (comparator(row, col)) { + result = true; + + return false; + } + }); + + return result; + }); + } + + return result; +} + +function markLabelAsSelected(label) { + // workaround for https://github.com/handsontable/handsontable/issues/1946 + return '' + String.fromCharCode(10003) + '' + label; +} + +function isItemHidden(item, instance) { + return !item.hidden || !(typeof item.hidden === 'function' && item.hidden.call(instance)); +} + +function shiftSeparators(items, separator) { + var result = items.slice(0); + + for (var i = 0; i < result.length;) { + if (result[i].name === separator) { + result.shift(); + } else { + break; + } + } + return result; +} + +function popSeparators(items, separator) { + var result = items.slice(0); + + result.reverse(); + result = shiftSeparators(result, separator); + result.reverse(); + + return result; +} + +function removeDuplicatedSeparators(items) { + var result = []; + + (0, _array.arrayEach)(items, function (value, index) { + if (index > 0) { + if (result[result.length - 1].name !== value.name) { + result.push(value); + } + } else { + result.push(value); + } + }); + + return result; +} + +function filterSeparators(items) { + var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _separator.KEY; + + var result = items.slice(0); + + result = shiftSeparators(result, separator); + result = popSeparators(result, separator); + result = removeDuplicatedSeparators(result); + + return result; +} + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(21); +var IE8_DOM_DEFINE = __webpack_require__(170); +var toPrimitive = __webpack_require__(91); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(27) ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + /* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js //! version : 2.20.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors @@ -7924,7 +8164,7 @@ function loadLocale(name) { try { oldLocale = globalLocale._abbr; var aliasedRequire = require; - __webpack_require__(508)("./" + name); + __webpack_require__(507)("./" + name); getSetGlobalLocale(oldLocale); } catch (e) {} } @@ -10618,249 +10858,9 @@ return hooks; /*** EXPORTS FROM exports-to-window-loader ***/ -window['moment'] = __webpack_require__(23); +window['moment'] = __webpack_require__(25); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(200)(module))) -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.normalizeSelection = normalizeSelection; -exports.isSeparator = isSeparator; -exports.hasSubMenu = hasSubMenu; -exports.isDisabled = isDisabled; -exports.isSelectionDisabled = isSelectionDisabled; -exports.getValidSelection = getValidSelection; -exports.prepareVerticalAlignClass = prepareVerticalAlignClass; -exports.prepareHorizontalAlignClass = prepareHorizontalAlignClass; -exports.getAlignmentClasses = getAlignmentClasses; -exports.align = align; -exports.checkSelectionConsistency = checkSelectionConsistency; -exports.markLabelAsSelected = markLabelAsSelected; -exports.isItemHidden = isItemHidden; -exports.filterSeparators = filterSeparators; - -var _array = __webpack_require__(0); - -var _element = __webpack_require__(2); - -var _separator = __webpack_require__(161); - -function normalizeSelection(selRanges) { - return (0, _array.arrayMap)(selRanges, function (range) { - return { - start: range.getTopLeftCorner(), - end: range.getBottomRightCorner() - }; - }); -} - -function isSeparator(cell) { - return (0, _element.hasClass)(cell, 'htSeparator'); -} - -function hasSubMenu(cell) { - return (0, _element.hasClass)(cell, 'htSubmenu'); -} - -function isDisabled(cell) { - return (0, _element.hasClass)(cell, 'htDisabled'); -} - -function isSelectionDisabled(cell) { - return (0, _element.hasClass)(cell, 'htSelectionDisabled'); -} - -function getValidSelection(hot) { - var selected = hot.getSelected(); - - if (!selected) { - return null; - } - if (selected[0] < 0) { - return null; - } - - return selected; -} - -function prepareVerticalAlignClass(className, alignment) { - if (className.indexOf(alignment) !== -1) { - return className; - } - - var replacedClassName = className.replace('htTop', '').replace('htMiddle', '').replace('htBottom', '').replace(' ', ''); - - return replacedClassName + ' ' + alignment; -} - -function prepareHorizontalAlignClass(className, alignment) { - if (className.indexOf(alignment) !== -1) { - return className; - } - var replacedClassName = className.replace('htLeft', '').replace('htCenter', '').replace('htRight', '').replace('htJustify', '').replace(' ', ''); - - return replacedClassName + ' ' + alignment; -} - -function getAlignmentClasses(ranges, callback) { - var classes = {}; - - (0, _array.arrayEach)(ranges, function (_ref) { - var from = _ref.from, - to = _ref.to; - - for (var row = from.row; row <= to.row; row++) { - for (var col = from.col; col <= to.col; col++) { - if (!classes[row]) { - classes[row] = []; - } - classes[row][col] = callback(row, col); - } - } - }); - - return classes; -} - -function align(ranges, type, alignment, cellDescriptor, propertySetter) { - (0, _array.arrayEach)(ranges, function (_ref2) { - var from = _ref2.from, - to = _ref2.to; - - if (from.row === to.row && from.col === to.col) { - applyAlignClassName(from.row, from.col, type, alignment, cellDescriptor, propertySetter); - } else { - for (var row = from.row; row <= to.row; row++) { - for (var col = from.col; col <= to.col; col++) { - applyAlignClassName(row, col, type, alignment, cellDescriptor, propertySetter); - } - } - } - }); -} - -function applyAlignClassName(row, col, type, alignment, cellDescriptor, propertySetter) { - var cellMeta = cellDescriptor(row, col); - var className = alignment; - - if (cellMeta.className) { - if (type === 'vertical') { - className = prepareVerticalAlignClass(cellMeta.className, alignment); - } else { - className = prepareHorizontalAlignClass(cellMeta.className, alignment); - } - } - - propertySetter(row, col, 'className', className); -} - -function checkSelectionConsistency(ranges, comparator) { - var result = false; - - if (Array.isArray(ranges)) { - (0, _array.arrayEach)(ranges, function (range) { - range.forAll(function (row, col) { - if (comparator(row, col)) { - result = true; - - return false; - } - }); - - return result; - }); - } - - return result; -} - -function markLabelAsSelected(label) { - // workaround for https://github.com/handsontable/handsontable/issues/1946 - return '' + String.fromCharCode(10003) + '' + label; -} - -function isItemHidden(item, instance) { - return !item.hidden || !(typeof item.hidden === 'function' && item.hidden.call(instance)); -} - -function shiftSeparators(items, separator) { - var result = items.slice(0); - - for (var i = 0; i < result.length;) { - if (result[i].name === separator) { - result.shift(); - } else { - break; - } - } - return result; -} - -function popSeparators(items, separator) { - var result = items.slice(0); - - result.reverse(); - result = shiftSeparators(result, separator); - result.reverse(); - - return result; -} - -function removeDuplicatedSeparators(items) { - var result = []; - - (0, _array.arrayEach)(items, function (value, index) { - if (index > 0) { - if (result[result.length - 1].name !== value.name) { - result.push(value); - } - } else { - result.push(value); - } - }); - - return result; -} - -function filterSeparators(items) { - var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _separator.KEY; - - var result = items.slice(0); - - result = shiftSeparators(result, separator); - result = popSeparators(result, separator); - result = removeDuplicatedSeparators(result); - - return result; -} - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(22); -var IE8_DOM_DEFINE = __webpack_require__(170); -var toPrimitive = __webpack_require__(92); -var dP = Object.defineProperty; - -exports.f = __webpack_require__(27) ? Object.defineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) try { - return dP(O, P, Attributes); - } catch (e) { /* empty */ } - if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); - if ('value' in Attributes) O[P] = Attributes.value; - return O; -}; - - /***/ }), /* 26 */ /***/ (function(module, exports, __webpack_require__) { @@ -10924,8 +10924,8 @@ module.exports = function (exec) { /***/ (function(module, exports, __webpack_require__) { // to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __webpack_require__(94); -var defined = __webpack_require__(47); +var IObject = __webpack_require__(93); +var defined = __webpack_require__(49); module.exports = function (it) { return IObject(defined(it)); }; @@ -10936,7 +10936,7 @@ module.exports = function (it) { /***/ (function(module, exports, __webpack_require__) { // 7.1.15 ToLength -var toInteger = __webpack_require__(71); +var toInteger = __webpack_require__(72); var min = Math.min; module.exports = function (it) { return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 @@ -10948,8 +10948,8 @@ module.exports = function (it) { /***/ (function(module, exports, __webpack_require__) { // most Object methods by ES6 should accept primitives -var $export = __webpack_require__(7); -var core = __webpack_require__(48); +var $export = __webpack_require__(6); +var core = __webpack_require__(50); var fails = __webpack_require__(28); module.exports = function (KEY, exec) { var fn = (core.Object || {})[KEY] || Object[KEY]; @@ -10974,7 +10974,7 @@ exports.isPercentValue = isPercentValue; exports.substitute = substitute; exports.stripTags = stripTags; -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); /** * Convert string to upper case first letter. @@ -11086,7 +11086,7 @@ var _object = __webpack_require__(1); var _array = __webpack_require__(0); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -11739,12 +11739,12 @@ module.exports = function (it, key) { var global = __webpack_require__(16); var hide = __webpack_require__(37); var has = __webpack_require__(35); -var SRC = __webpack_require__(58)('src'); +var SRC = __webpack_require__(59)('src'); var TO_STRING = 'toString'; var $toString = Function[TO_STRING]; var TPL = ('' + $toString).split(TO_STRING); -__webpack_require__(48).inspectSource = function (it) { +__webpack_require__(50).inspectSource = function (it) { return $toString.call(it); }; @@ -11773,8 +11773,8 @@ __webpack_require__(48).inspectSource = function (it) { /* 37 */ /***/ (function(module, exports, __webpack_require__) { -var dP = __webpack_require__(25); -var createDesc = __webpack_require__(59); +var dP = __webpack_require__(24); +var createDesc = __webpack_require__(60); module.exports = __webpack_require__(27) ? function (object, key, value) { return dP.f(object, key, createDesc(1, value)); } : function (object, key, value) { @@ -11788,7 +11788,7 @@ module.exports = __webpack_require__(27) ? function (object, key, value) { /***/ (function(module, exports, __webpack_require__) { // optional / simple context binding -var aFunction = __webpack_require__(74); +var aFunction = __webpack_require__(75); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; @@ -11814,7 +11814,7 @@ module.exports = function (fn, that, length) { /***/ (function(module, exports, __webpack_require__) { // 7.1.13 ToObject(argument) -var defined = __webpack_require__(47); +var defined = __webpack_require__(49); module.exports = function (it) { return Object(defined(it)); }; @@ -11824,10 +11824,10 @@ module.exports = function (it) { /* 40 */ /***/ (function(module, exports, __webpack_require__) { -var META = __webpack_require__(58)('meta'); +var META = __webpack_require__(59)('meta'); var isObject = __webpack_require__(13); var has = __webpack_require__(35); -var setDesc = __webpack_require__(25).f; +var setDesc = __webpack_require__(24).f; var id = 0; var isExtensible = Object.isExtensible || function () { return true; @@ -11886,6 +11886,192 @@ var meta = module.exports = { "use strict"; +exports.__esModule = true; +exports.default = staticRegister; + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +var collection = exports.collection = new Map(); + +function staticRegister() { + var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'common'; + + if (!collection.has(namespace)) { + collection.set(namespace, new Map()); + } + var subCollection = collection.get(namespace); + + /** + * Register an item to the collection. If the item under the same was exist earlier then this item will be replaced with new one. + * + * @param {String} name Identification of the item. + * @param {*} item Item to save in the collection. + */ + function register(name, item) { + subCollection.set(name, item); + } + + /** + * Retrieve the item from the collection. + * + * @param {String} name Identification of the item. + * @returns {*} Returns item which was saved in the collection. + */ + function getItem(name) { + return subCollection.get(name); + } + + /** + * Check if item under specyfied name is exists. + * + * @param {String} name Identification of the item. + * @returns {Boolean} Returns `true` or `false` depends on if element exists in the collection. + */ + function hasItem(name) { + return subCollection.has(name); + } + + /** + * Retrieve list of names registered from the collection. + * + * @returns {Array} Returns an array of strings with all names under which objects are stored. + */ + function getNames() { + return [].concat(_toConsumableArray(subCollection.keys())); + } + + /** + * Retrieve all registered values from the collection. + * + * @returns {Array} Returns an array with all values stored in the collection. + */ + function getValues() { + return [].concat(_toConsumableArray(subCollection.values())); + } + + return { + register: register, + getItem: getItem, + hasItem: hasItem, + getNames: getNames, + getValues: getValues + }; +} + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.setBrowserMeta = setBrowserMeta; +exports.isChrome = isChrome; +exports.isEdge = isEdge; +exports.isIE = isIE; +exports.isIE8 = isIE8; +exports.isIE9 = isIE9; +exports.isMSBrowser = isMSBrowser; +exports.isMobileBrowser = isMobileBrowser; +exports.isSafari = isSafari; + +var _object = __webpack_require__(1); + +var tester = function tester(testerFunc) { + var result = { + value: false + }; + result.test = function (ua, vendor) { + result.value = testerFunc(ua, vendor); + }; + + return result; +}; + +var browsers = { + chrome: tester(function (ua, vendor) { + return (/Chrome/.test(ua) && /Google/.test(vendor) + ); + }), + edge: tester(function (ua) { + return (/Edge/.test(ua) + ); + }), + ie: tester(function (ua) { + return (/Trident/.test(ua) + ); + }), + ie8: tester(function () { + return !document.createTextNode('test').textContent; + }), + ie9: tester(function () { + return !!document.documentMode; + }), + mobile: tester(function (ua) { + return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(ua) + ); + }), + safari: tester(function (ua, vendor) { + return (/Safari/.test(ua) && /Apple Computer/.test(vendor) + ); + }) +}; + +function setBrowserMeta() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$userAgent = _ref.userAgent, + userAgent = _ref$userAgent === undefined ? navigator.userAgent : _ref$userAgent, + _ref$vendor = _ref.vendor, + vendor = _ref$vendor === undefined ? navigator.vendor : _ref$vendor; + + (0, _object.objectEach)(browsers, function (_ref2) { + var test = _ref2.test; + return void test(userAgent, vendor); + }); +} + +setBrowserMeta(); + +function isChrome() { + return browsers.chrome.value; +} + +function isEdge() { + return browsers.edge.value; +} + +function isIE() { + return browsers.ie.value; +} + +function isIE8() { + return browsers.ie8.value; +} + +function isIE9() { + return browsers.ie9.value; +} + +function isMSBrowser() { + return browsers.ie.value || browsers.edge.value; +} + +function isMobileBrowser() { + return browsers.mobile.value; +} + +function isSafari() { + return browsers.safari.value; +} + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + exports.__esModule = true; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -12028,7 +12214,7 @@ function getComparisonFunction(language) { } /***/ }), -/* 42 */ +/* 44 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12037,23 +12223,23 @@ function getComparisonFunction(language) { exports.__esModule = true; exports.getRegisteredValidators = exports.getRegisteredValidatorNames = exports.hasValidator = exports.getValidator = exports.registerValidator = undefined; -var _staticRegister2 = __webpack_require__(49); +var _staticRegister2 = __webpack_require__(41); var _staticRegister3 = _interopRequireDefault(_staticRegister2); -var _autocompleteValidator = __webpack_require__(533); +var _autocompleteValidator = __webpack_require__(532); var _autocompleteValidator2 = _interopRequireDefault(_autocompleteValidator); -var _dateValidator = __webpack_require__(534); +var _dateValidator = __webpack_require__(533); var _dateValidator2 = _interopRequireDefault(_dateValidator); -var _numericValidator = __webpack_require__(535); +var _numericValidator = __webpack_require__(534); var _numericValidator2 = _interopRequireDefault(_numericValidator); -var _timeValidator = __webpack_require__(536); +var _timeValidator = __webpack_require__(535); var _timeValidator2 = _interopRequireDefault(_timeValidator); @@ -12095,7 +12281,7 @@ exports.getRegisteredValidatorNames = getNames; exports.getRegisteredValidators = getValues; /***/ }), -/* 43 */ +/* 45 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12106,7 +12292,7 @@ exports.ITEMS = exports.UNDO = exports.SEPARATOR = exports.ROW_BELOW = exports.R var _predefinedItems2; -var _alignment = __webpack_require__(586); +var _alignment = __webpack_require__(587); Object.defineProperty(exports, 'ALIGNMENT', { enumerable: true, @@ -12115,7 +12301,7 @@ Object.defineProperty(exports, 'ALIGNMENT', { } }); -var _clearColumn = __webpack_require__(587); +var _clearColumn = __webpack_require__(588); Object.defineProperty(exports, 'CLEAR_COLUMN', { enumerable: true, @@ -12124,7 +12310,7 @@ Object.defineProperty(exports, 'CLEAR_COLUMN', { } }); -var _columnLeft = __webpack_require__(588); +var _columnLeft = __webpack_require__(589); Object.defineProperty(exports, 'COLUMN_LEFT', { enumerable: true, @@ -12133,7 +12319,7 @@ Object.defineProperty(exports, 'COLUMN_LEFT', { } }); -var _columnRight = __webpack_require__(589); +var _columnRight = __webpack_require__(590); Object.defineProperty(exports, 'COLUMN_RIGHT', { enumerable: true, @@ -12142,7 +12328,7 @@ Object.defineProperty(exports, 'COLUMN_RIGHT', { } }); -var _readOnly = __webpack_require__(590); +var _readOnly = __webpack_require__(591); Object.defineProperty(exports, 'READ_ONLY', { enumerable: true, @@ -12151,7 +12337,7 @@ Object.defineProperty(exports, 'READ_ONLY', { } }); -var _redo = __webpack_require__(591); +var _redo = __webpack_require__(592); Object.defineProperty(exports, 'REDO', { enumerable: true, @@ -12160,7 +12346,7 @@ Object.defineProperty(exports, 'REDO', { } }); -var _removeColumn = __webpack_require__(592); +var _removeColumn = __webpack_require__(593); Object.defineProperty(exports, 'REMOVE_COLUMN', { enumerable: true, @@ -12169,7 +12355,7 @@ Object.defineProperty(exports, 'REMOVE_COLUMN', { } }); -var _removeRow = __webpack_require__(593); +var _removeRow = __webpack_require__(594); Object.defineProperty(exports, 'REMOVE_ROW', { enumerable: true, @@ -12178,7 +12364,7 @@ Object.defineProperty(exports, 'REMOVE_ROW', { } }); -var _rowAbove = __webpack_require__(594); +var _rowAbove = __webpack_require__(595); Object.defineProperty(exports, 'ROW_ABOVE', { enumerable: true, @@ -12187,7 +12373,7 @@ Object.defineProperty(exports, 'ROW_ABOVE', { } }); -var _rowBelow = __webpack_require__(595); +var _rowBelow = __webpack_require__(596); Object.defineProperty(exports, 'ROW_BELOW', { enumerable: true, @@ -12205,7 +12391,7 @@ Object.defineProperty(exports, 'SEPARATOR', { } }); -var _undo = __webpack_require__(596); +var _undo = __webpack_require__(597); Object.defineProperty(exports, 'UNDO', { enumerable: true, @@ -12278,7 +12464,7 @@ function addItem(key, item) { } /***/ }), -/* 44 */ +/* 46 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12355,7 +12541,7 @@ function cellCoordFactory(axis, defaultIndex) { } /***/ }), -/* 45 */ +/* 47 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12365,11 +12551,11 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _hotFormulaParser = __webpack_require__(69); +var _hotFormulaParser = __webpack_require__(70); var _array = __webpack_require__(0); -var _base = __webpack_require__(482); +var _base = __webpack_require__(481); var _base2 = _interopRequireDefault(_base); @@ -12645,12 +12831,12 @@ var CellValue = function (_BaseCell) { exports.default = CellValue; /***/ }), -/* 46 */ +/* 48 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = __webpack_require__(171); -var enumBugKeys = __webpack_require__(97); +var enumBugKeys = __webpack_require__(96); module.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); @@ -12658,7 +12844,7 @@ module.exports = Object.keys || function keys(O) { /***/ }), -/* 47 */ +/* 49 */ /***/ (function(module, exports) { // 7.2.1 RequireObjectCoercible(argument) @@ -12669,7 +12855,7 @@ module.exports = function (it) { /***/ }), -/* 48 */ +/* 50 */ /***/ (function(module, exports) { var core = module.exports = { version: '2.5.7' }; @@ -12677,193 +12863,257 @@ if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef /***/ }), -/* 49 */ +/* 51 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.default = staticRegister; +exports.sort = exports.DO_NOT_SWAP = exports.FIRST_BEFORE_SECOND = exports.FIRST_AFTER_SECOND = exports.getCompareFunctionFactory = exports.getRootComparator = exports.registerRootComparator = undefined; -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +var _registry = __webpack_require__(465); -var collection = exports.collection = new Map(); +var _engine = __webpack_require__(579); -function staticRegister() { - var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'common'; +exports.registerRootComparator = _registry.registerRootComparator; +exports.getRootComparator = _registry.getRootComparator; +exports.getCompareFunctionFactory = _registry.getCompareFunctionFactory; +exports.FIRST_AFTER_SECOND = _engine.FIRST_AFTER_SECOND; +exports.FIRST_BEFORE_SECOND = _engine.FIRST_BEFORE_SECOND; +exports.DO_NOT_SWAP = _engine.DO_NOT_SWAP; +exports.sort = _engine.sort; - if (!collection.has(namespace)) { - collection.set(namespace, new Map()); - } - var subCollection = collection.get(namespace); +/***/ }), +/* 52 */ +/***/ (function(module, exports) { - /** - * Register an item to the collection. If the item under the same was exist earlier then this item will be replaced with new one. - * - * @param {String} name Identification of the item. - * @param {*} item Item to save in the collection. - */ - function register(name, item) { - subCollection.set(name, item); - } +var toString = {}.toString; - /** - * Retrieve the item from the collection. - * - * @param {String} name Identification of the item. - * @returns {*} Returns item which was saved in the collection. - */ - function getItem(name) { - return subCollection.get(name); - } +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; - /** - * Check if item under specyfied name is exists. - * - * @param {String} name Identification of the item. - * @returns {Boolean} Returns `true` or `false` depends on if element exists in the collection. - */ - function hasItem(name) { - return subCollection.has(name); - } - /** - * Retrieve list of names registered from the collection. - * - * @returns {Array} Returns an array of strings with all names under which objects are stored. - */ - function getNames() { - return [].concat(_toConsumableArray(subCollection.keys())); - } +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Retrieve all registered values from the collection. - * - * @returns {Array} Returns an array with all values stored in the collection. - */ - function getValues() { - return [].concat(_toConsumableArray(subCollection.values())); - } +var isObject = __webpack_require__(13); +module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; +}; - return { - register: register, - getItem: getItem, - hasItem: hasItem, - getNames: getNames, - getValues: getValues - }; -} /***/ }), -/* 50 */ +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.31 Array.prototype[@@unscopables] +var UNSCOPABLES = __webpack_require__(14)('unscopables'); +var ArrayProto = Array.prototype; +if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(37)(ArrayProto, UNSCOPABLES, {}); +module.exports = function (key) { + ArrayProto[UNSCOPABLES][key] = true; +}; + + +/***/ }), +/* 55 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.setBrowserMeta = setBrowserMeta; -exports.isChrome = isChrome; -exports.isEdge = isEdge; -exports.isIE = isIE; -exports.isIE8 = isIE8; -exports.isIE9 = isIE9; -exports.isMSBrowser = isMSBrowser; -exports.isMobileBrowser = isMobileBrowser; -exports.isSafari = isSafari; +exports.RecordTranslator = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.registerIdentity = registerIdentity; +exports.getTranslator = getTranslator; +exports.getIdentity = getIdentity; + +var _core = __webpack_require__(157); + +var _core2 = _interopRequireDefault(_core); var _object = __webpack_require__(1); -var tester = function tester(testerFunc) { - var result = { - value: false - }; - result.test = function (ua, vendor) { - result.value = testerFunc(ua, vendor); - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - return result; -}; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var browsers = { - chrome: tester(function (ua, vendor) { - return (/Chrome/.test(ua) && /Google/.test(vendor) - ); - }), - edge: tester(function (ua) { - return (/Edge/.test(ua) - ); - }), - ie: tester(function (ua) { - return (/Trident/.test(ua) - ); - }), - ie8: tester(function () { - return !document.createTextNode('test').textContent; - }), - ie9: tester(function () { - return !!document.documentMode; - }), - mobile: tester(function (ua) { - return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(ua) - ); - }), - safari: tester(function (ua, vendor) { - return (/Safari/.test(ua) && /Apple Computer/.test(vendor) - ); - }) -}; +/** + * @class RecordTranslator + * @util + */ +var RecordTranslator = exports.RecordTranslator = function () { + function RecordTranslator(hot) { + _classCallCheck(this, RecordTranslator); -function setBrowserMeta() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - _ref$userAgent = _ref.userAgent, - userAgent = _ref$userAgent === undefined ? navigator.userAgent : _ref$userAgent, - _ref$vendor = _ref.vendor, - vendor = _ref$vendor === undefined ? navigator.vendor : _ref$vendor; + this.hot = hot; + } - (0, _object.objectEach)(browsers, function (_ref2) { - var test = _ref2.test; - return void test(userAgent, vendor); - }); -} + /** + * Translate physical row index into visual. + * + * @param {Number} row Physical row index. + * @returns {Number} Returns visual row index. + */ -setBrowserMeta(); -function isChrome() { - return browsers.chrome.value; -} + _createClass(RecordTranslator, [{ + key: 'toVisualRow', + value: function toVisualRow(row) { + return this.hot.runHooks('unmodifyRow', row); + } -function isEdge() { - return browsers.edge.value; -} + /** + * Translate physical column index into visual. + * + * @param {Number} column Physical column index. + * @returns {Number} Returns visual column index. + */ -function isIE() { - return browsers.ie.value; -} + }, { + key: 'toVisualColumn', + value: function toVisualColumn(column) { + return this.hot.runHooks('unmodifyCol', column); + } -function isIE8() { - return browsers.ie8.value; -} + /** + * Translate physical coordinates into visual. Can be passed as separate 2 arguments (row, column) or as an object in first + * argument with `row` and `column` keys. + * + * @param {Number|Object} row Physical coordinates or row index. + * @param {Number} [column] Physical column index. + * @returns {Object|Array} Returns an object with visual records or an array if coordinates passed as separate arguments. + */ -function isIE9() { - return browsers.ie9.value; -} + }, { + key: 'toVisual', + value: function toVisual(row, column) { + var result = void 0; -function isMSBrowser() { - return browsers.ie.value || browsers.edge.value; + if ((0, _object.isObject)(row)) { + result = { + row: this.toVisualRow(row.row), + column: this.toVisualColumn(row.column) + }; + } else { + result = [this.toVisualRow(row), this.toVisualColumn(column)]; + } + + return result; + } + + /** + * Translate visual row index into physical. + * + * @param {Number} row Visual row index. + * @returns {Number} Returns physical row index. + */ + + }, { + key: 'toPhysicalRow', + value: function toPhysicalRow(row) { + return this.hot.runHooks('modifyRow', row); + } + + /** + * Translate visual column index into physical. + * + * @param {Number} column Visual column index. + * @returns {Number} Returns physical column index. + */ + + }, { + key: 'toPhysicalColumn', + value: function toPhysicalColumn(column) { + return this.hot.runHooks('modifyCol', column); + } + + /** + * Translate visual coordinates into physical. Can be passed as separate 2 arguments (row, column) or as an object in first + * argument with `row` and `column` keys. + * + * @param {Number|Object} row Visual coordinates or row index. + * @param {Number} [column] Visual column index. + * @returns {Object|Array} Returns an object with physical records or an array if coordinates passed as separate arguments. + */ + + }, { + key: 'toPhysical', + value: function toPhysical(row, column) { + var result = void 0; + + if ((0, _object.isObject)(row)) { + result = { + row: this.toPhysicalRow(row.row), + column: this.toPhysicalColumn(row.column) + }; + } else { + result = [this.toPhysicalRow(row), this.toPhysicalColumn(column)]; + } + + return result; + } + }]); + + return RecordTranslator; +}(); + +var identities = new WeakMap(); +var translatorSingletons = new WeakMap(); + +/** + * Allows to register custom identity manually. + * + * @param {*} identity + * @param {*} hot + */ +function registerIdentity(identity, hot) { + identities.set(identity, hot); } -function isMobileBrowser() { - return browsers.mobile.value; +/** + * Returns a cached instance of RecordTranslator or create the new one for given identity. + * + * @param {*} identity + * @returns {RecordTranslator} + */ +function getTranslator(identity) { + var instance = identity instanceof _core2.default ? identity : getIdentity(identity); + var singleton = void 0; + + if (translatorSingletons.has(instance)) { + singleton = translatorSingletons.get(instance); + } else { + singleton = new RecordTranslator(instance); + translatorSingletons.set(instance, singleton); + } + + return singleton; } -function isSafari() { - return browsers.safari.value; +/** + * Returns mapped identity. + * + * @param {*} identity + * @returns {*} + */ +function getIdentity(identity) { + if (!identities.has(identity)) { + throw Error('Record translator was not registered for this object identity'); + } + + return identities.get(identity); } /***/ }), -/* 51 */ +/* 56 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13070,235 +13320,7 @@ var arrayMapper = { exports.default = arrayMapper; /***/ }), -/* 52 */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; - - -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(13); -module.exports = function (it, TYPE) { - if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); - return it; -}; - - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.3.31 Array.prototype[@@unscopables] -var UNSCOPABLES = __webpack_require__(14)('unscopables'); -var ArrayProto = Array.prototype; -if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(37)(ArrayProto, UNSCOPABLES, {}); -module.exports = function (key) { - ArrayProto[UNSCOPABLES][key] = true; -}; - - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.RecordTranslator = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.registerIdentity = registerIdentity; -exports.getTranslator = getTranslator; -exports.getIdentity = getIdentity; - -var _core = __webpack_require__(158); - -var _core2 = _interopRequireDefault(_core); - -var _object = __webpack_require__(1); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * @class RecordTranslator - * @util - */ -var RecordTranslator = exports.RecordTranslator = function () { - function RecordTranslator(hot) { - _classCallCheck(this, RecordTranslator); - - this.hot = hot; - } - - /** - * Translate physical row index into visual. - * - * @param {Number} row Physical row index. - * @returns {Number} Returns visual row index. - */ - - - _createClass(RecordTranslator, [{ - key: 'toVisualRow', - value: function toVisualRow(row) { - return this.hot.runHooks('unmodifyRow', row); - } - - /** - * Translate physical column index into visual. - * - * @param {Number} column Physical column index. - * @returns {Number} Returns visual column index. - */ - - }, { - key: 'toVisualColumn', - value: function toVisualColumn(column) { - return this.hot.runHooks('unmodifyCol', column); - } - - /** - * Translate physical coordinates into visual. Can be passed as separate 2 arguments (row, column) or as an object in first - * argument with `row` and `column` keys. - * - * @param {Number|Object} row Physical coordinates or row index. - * @param {Number} [column] Physical column index. - * @returns {Object|Array} Returns an object with visual records or an array if coordinates passed as separate arguments. - */ - - }, { - key: 'toVisual', - value: function toVisual(row, column) { - var result = void 0; - - if ((0, _object.isObject)(row)) { - result = { - row: this.toVisualRow(row.row), - column: this.toVisualColumn(row.column) - }; - } else { - result = [this.toVisualRow(row), this.toVisualColumn(column)]; - } - - return result; - } - - /** - * Translate visual row index into physical. - * - * @param {Number} row Visual row index. - * @returns {Number} Returns physical row index. - */ - - }, { - key: 'toPhysicalRow', - value: function toPhysicalRow(row) { - return this.hot.runHooks('modifyRow', row); - } - - /** - * Translate visual column index into physical. - * - * @param {Number} column Visual column index. - * @returns {Number} Returns physical column index. - */ - - }, { - key: 'toPhysicalColumn', - value: function toPhysicalColumn(column) { - return this.hot.runHooks('modifyCol', column); - } - - /** - * Translate visual coordinates into physical. Can be passed as separate 2 arguments (row, column) or as an object in first - * argument with `row` and `column` keys. - * - * @param {Number|Object} row Visual coordinates or row index. - * @param {Number} [column] Visual column index. - * @returns {Object|Array} Returns an object with physical records or an array if coordinates passed as separate arguments. - */ - - }, { - key: 'toPhysical', - value: function toPhysical(row, column) { - var result = void 0; - - if ((0, _object.isObject)(row)) { - result = { - row: this.toPhysicalRow(row.row), - column: this.toPhysicalColumn(row.column) - }; - } else { - result = [this.toPhysicalRow(row), this.toPhysicalColumn(column)]; - } - - return result; - } - }]); - - return RecordTranslator; -}(); - -var identities = new WeakMap(); -var translatorSingletons = new WeakMap(); - -/** - * Allows to register custom identity manually. - * - * @param {*} identity - * @param {*} hot - */ -function registerIdentity(identity, hot) { - identities.set(identity, hot); -} - -/** - * Returns a cached instance of RecordTranslator or create the new one for given identity. - * - * @param {*} identity - * @returns {RecordTranslator} - */ -function getTranslator(identity) { - var instance = identity instanceof _core2.default ? identity : getIdentity(identity); - var singleton = void 0; - - if (translatorSingletons.has(instance)) { - singleton = translatorSingletons.get(instance); - } else { - singleton = new RecordTranslator(instance); - translatorSingletons.set(instance, singleton); - } - - return singleton; -} - -/** - * Returns mapped identity. - * - * @param {*} identity - * @returns {*} - */ -function getIdentity(identity) { - if (!identities.has(identity)) { - throw Error('Record translator was not registered for this object identity'); - } - - return identities.get(identity); -} - -/***/ }), -/* 56 */ +/* 57 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13484,14 +13506,14 @@ function markSelected(label) { } /***/ }), -/* 57 */ +/* 58 */ /***/ (function(module, exports) { module.exports = false; /***/ }), -/* 58 */ +/* 59 */ /***/ (function(module, exports) { var id = 0; @@ -13502,7 +13524,7 @@ module.exports = function (key) { /***/ }), -/* 59 */ +/* 60 */ /***/ (function(module, exports) { module.exports = function (bitmap, value) { @@ -13516,17 +13538,17 @@ module.exports = function (bitmap, value) { /***/ }), -/* 60 */ +/* 61 */ /***/ (function(module, exports) { module.exports = {}; /***/ }), -/* 61 */ +/* 62 */ /***/ (function(module, exports, __webpack_require__) { -var def = __webpack_require__(25).f; +var def = __webpack_require__(24).f; var has = __webpack_require__(35); var TAG = __webpack_require__(14)('toStringTag'); @@ -13536,14 +13558,14 @@ module.exports = function (it, tag, stat) { /***/ }), -/* 62 */ +/* 63 */ /***/ (function(module, exports) { exports.f = {}.propertyIsEnumerable; /***/ }), -/* 63 */ +/* 64 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13552,9 +13574,9 @@ exports.f = {}.propertyIsEnumerable; exports.__esModule = true; exports.EditorState = undefined; -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); var EditorState = exports.EditorState = { VIRGIN: 'STATE_VIRGIN', // before editing @@ -13823,7 +13845,7 @@ BaseEditor.prototype.checkEditorSection = function () { exports.default = BaseEditor; /***/ }), -/* 64 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13977,7 +13999,7 @@ var CellCoords = function () { exports.default = CellCoords; /***/ }), -/* 65 */ +/* 66 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13987,15 +14009,15 @@ exports.__esModule = true; var _element = __webpack_require__(2); -var _autoResize = __webpack_require__(515); +var _autoResize = __webpack_require__(514); var _autoResize2 = _interopRequireDefault(_autoResize); -var _baseEditor = __webpack_require__(63); +var _baseEditor = __webpack_require__(64); var _baseEditor2 = _interopRequireDefault(_baseEditor); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -14428,7 +14450,7 @@ TextEditor.prototype.destroy = function () { exports.default = TextEditor; /***/ }), -/* 66 */ +/* 67 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14442,7 +14464,7 @@ exports.toEmptyString = toEmptyString; exports.unifyColumnValues = unifyColumnValues; exports.intersectValues = intersectValues; -var _feature = __webpack_require__(41); +var _feature = __webpack_require__(43); var _array = __webpack_require__(0); @@ -14587,7 +14609,7 @@ function intersectValues(base, selected, defaultEmptyValue, callback) { } /***/ }), -/* 67 */ +/* 68 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14637,7 +14659,7 @@ function registerOperation(id, name, func) { } /***/ }), -/* 68 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14649,11 +14671,11 @@ var _createClass = function () { function defineProperties(target, props) { for var _object = __webpack_require__(1); -var _localHooks = __webpack_require__(21); +var _localHooks = __webpack_require__(20); var _localHooks2 = _interopRequireDefault(_localHooks); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -14923,7 +14945,7 @@ var BaseUI = function () { exports.default = BaseUI; /***/ }), -/* 69 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { (function webpackUniversalModuleDefinition(root, factory) { @@ -31365,7 +31387,7 @@ function trimEdges(string) { }); /***/ }), -/* 70 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31377,17 +31399,17 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _hotFormulaParser = __webpack_require__(69); +var _hotFormulaParser = __webpack_require__(70); var _array = __webpack_require__(0); var _object = __webpack_require__(1); -var _localHooks = __webpack_require__(21); +var _localHooks = __webpack_require__(20); var _localHooks2 = _interopRequireDefault(_localHooks); -var _utils = __webpack_require__(44); +var _utils = __webpack_require__(46); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -31748,7 +31770,7 @@ var ExpressionModifier = function () { exports.default = ExpressionModifier; /***/ }), -/* 71 */ +/* 72 */ /***/ (function(module, exports) { // 7.1.4 ToInteger @@ -31760,10 +31782,10 @@ module.exports = function (it) { /***/ }), -/* 72 */ +/* 73 */ /***/ (function(module, exports, __webpack_require__) { -var toInteger = __webpack_require__(71); +var toInteger = __webpack_require__(72); var max = Math.max; var min = Math.min; module.exports = function (index, length) { @@ -31773,7 +31795,7 @@ module.exports = function (index, length) { /***/ }), -/* 73 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { var redefine = __webpack_require__(36); @@ -31784,7 +31806,7 @@ module.exports = function (target, src, safe) { /***/ }), -/* 74 */ +/* 75 */ /***/ (function(module, exports) { module.exports = function (it) { @@ -31794,7 +31816,7 @@ module.exports = function (it) { /***/ }), -/* 75 */ +/* 76 */ /***/ (function(module, exports) { module.exports = function (it, Constructor, name, forbiddenField) { @@ -31805,13 +31827,13 @@ module.exports = function (it, Constructor, name, forbiddenField) { /***/ }), -/* 76 */ +/* 77 */ /***/ (function(module, exports, __webpack_require__) { var ctx = __webpack_require__(38); var call = __webpack_require__(174); var isArrayIter = __webpack_require__(175); -var anObject = __webpack_require__(22); +var anObject = __webpack_require__(21); var toLength = __webpack_require__(30); var getIterFn = __webpack_require__(176); var BREAK = {}; @@ -31836,23 +31858,23 @@ exports.RETURN = RETURN; /***/ }), -/* 77 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var global = __webpack_require__(16); -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var redefine = __webpack_require__(36); -var redefineAll = __webpack_require__(73); +var redefineAll = __webpack_require__(74); var meta = __webpack_require__(40); -var forOf = __webpack_require__(76); -var anInstance = __webpack_require__(75); +var forOf = __webpack_require__(77); +var anInstance = __webpack_require__(76); var isObject = __webpack_require__(13); var fails = __webpack_require__(28); -var $iterDetect = __webpack_require__(98); -var setToStringTag = __webpack_require__(61); -var inheritIfRequired = __webpack_require__(487); +var $iterDetect = __webpack_require__(97); +var setToStringTag = __webpack_require__(62); +var inheritIfRequired = __webpack_require__(486); module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { var Base = global[NAME]; @@ -31928,13 +31950,13 @@ module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { /***/ }), -/* 78 */ +/* 79 */ /***/ (function(module, exports, __webpack_require__) { -var pIE = __webpack_require__(62); -var createDesc = __webpack_require__(59); +var pIE = __webpack_require__(63); +var createDesc = __webpack_require__(60); var toIObject = __webpack_require__(29); -var toPrimitive = __webpack_require__(92); +var toPrimitive = __webpack_require__(91); var has = __webpack_require__(35); var IE8_DOM_DEFINE = __webpack_require__(170); var gOPD = Object.getOwnPropertyDescriptor; @@ -31950,7 +31972,7 @@ exports.f = __webpack_require__(27) ? gOPD : function getOwnPropertyDescriptor(O /***/ }), -/* 79 */ +/* 80 */ /***/ (function(module, exports, __webpack_require__) { // 0 -> Array#forEach @@ -31961,10 +31983,10 @@ exports.f = __webpack_require__(27) ? gOPD : function getOwnPropertyDescriptor(O // 5 -> Array#find // 6 -> Array#findIndex var ctx = __webpack_require__(38); -var IObject = __webpack_require__(94); +var IObject = __webpack_require__(93); var toObject = __webpack_require__(39); var toLength = __webpack_require__(30); -var asc = __webpack_require__(488); +var asc = __webpack_require__(487); module.exports = function (TYPE, $create) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; @@ -32000,14 +32022,14 @@ module.exports = function (TYPE, $create) { /***/ }), -/* 80 */ +/* 81 */ /***/ (function(module, exports) { exports.f = Object.getOwnPropertySymbols; /***/ }), -/* 81 */ +/* 82 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32015,7 +32037,7 @@ exports.f = Object.getOwnPropertySymbols; var hide = __webpack_require__(37); var redefine = __webpack_require__(36); var fails = __webpack_require__(28); -var defined = __webpack_require__(47); +var defined = __webpack_require__(49); var wks = __webpack_require__(14); module.exports = function (KEY, length, exec) { @@ -32042,14 +32064,14 @@ module.exports = function (KEY, length, exec) { /***/ }), -/* 82 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var addToUnscopables = __webpack_require__(54); var step = __webpack_require__(180); -var Iterators = __webpack_require__(60); +var Iterators = __webpack_require__(61); var toIObject = __webpack_require__(29); // 22.1.3.4 Array.prototype.entries() @@ -32083,7 +32105,7 @@ addToUnscopables('entries'); /***/ }), -/* 83 */ +/* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32098,7 +32120,7 @@ exports.createEmptySpreadsheetData = createEmptySpreadsheetData; exports.translateRowsToColumns = translateRowsToColumns; exports.cellMethodLookupFactory = cellMethodLookupFactory; -var _cellTypes = __webpack_require__(157); +var _cellTypes = __webpack_require__(156); var _object = __webpack_require__(1); @@ -32290,7 +32312,7 @@ function cellMethodLookupFactory(methodName, allowUndefined) { } /***/ }), -/* 84 */ +/* 85 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32303,11 +32325,11 @@ var _object = __webpack_require__(1); var _utils = __webpack_require__(460); -var _staticRegister2 = __webpack_require__(49); +var _staticRegister2 = __webpack_require__(41); var _staticRegister3 = _interopRequireDefault(_staticRegister2); -var _enUS = __webpack_require__(552); +var _enUS = __webpack_require__(551); var _enUS2 = _interopRequireDefault(_enUS); @@ -32416,7 +32438,7 @@ exports.DEFAULT_LANGUAGE_CODE = DEFAULT_LANGUAGE_CODE; registerLanguage(_enUS2.default); /***/ }), -/* 85 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32425,7 +32447,7 @@ registerLanguage(_enUS2.default); exports.__esModule = true; exports.stopObserving = exports.startObserving = exports.isPressedCtrlKey = exports.isPressed = exports._resetState = exports._getRefCount = undefined; -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -32529,7 +32551,7 @@ exports.startObserving = startObserving; exports.stopObserving = stopObserving; /***/ }), -/* 86 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32548,11 +32570,11 @@ exports.transformSelectionToColumnDistance = transformSelectionToColumnDistance; exports.transformSelectionToRowDistance = transformSelectionToRowDistance; exports.isValidCoord = isValidCoord; -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); var _array = __webpack_require__(0); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); var SELECTION_TYPE_UNRECOGNIZED = exports.SELECTION_TYPE_UNRECOGNIZED = 0; var SELECTION_TYPE_EMPTY = exports.SELECTION_TYPE_EMPTY = 1; @@ -32795,89 +32817,6 @@ function isValidCoord(coord) { return typeof coord === 'number' && coord >= 0 && coord < maxTableItemsCount; } -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.FIRST_AFTER_SECOND = exports.FIRST_BEFORE_SECOND = exports.DO_NOT_SWAP = undefined; -exports.mainSortComparator = mainSortComparator; - -var _date = __webpack_require__(575); - -var _date2 = _interopRequireDefault(_date); - -var _default = __webpack_require__(576); - -var _default2 = _interopRequireDefault(_default); - -var _numeric = __webpack_require__(577); - -var _numeric2 = _interopRequireDefault(_numeric); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } - -var DO_NOT_SWAP = exports.DO_NOT_SWAP = 0; -var FIRST_BEFORE_SECOND = exports.FIRST_BEFORE_SECOND = -1; -var FIRST_AFTER_SECOND = exports.FIRST_AFTER_SECOND = 1; - -/** - * Gets sort function for the particular column basing on its column meta. - * - * @param {Array} columnMeta Column meta object. - * @returns {Function} - */ -function getCompareFunctionFactory(columnMeta) { - var columnSettings = columnMeta.columnSorting; - - if (columnSettings.compareFunctionFactory) { - return columnSettings.compareFunctionFactory; - } else if (columnMeta.type === 'date') { - return _date2.default; - } else if (columnMeta.type === 'numeric') { - return _numeric2.default; - } - - return _default2.default; -} - -/** - * Sort comparator handled by conventional sort algorithm. - * - * @param {Array} sortOrders Sort orders (`asc` for ascending, `desc` for descending). - * @param {Array} columnMeta Column meta objects. - * @returns {Function} - */ -function mainSortComparator(sortingOrders, columnMetas) { - return function (rowIndexWithValues, nextRowIndexWithValues) { - // We sort array of arrays. Single array is in form [rowIndex, ...values]. - // We compare just values, stored at second index of array. - var _rowIndexWithValues = _toArray(rowIndexWithValues), - values = _rowIndexWithValues.slice(1); - - var _nextRowIndexWithValu = _toArray(nextRowIndexWithValues), - nextValues = _nextRowIndexWithValu.slice(1); - - return function getCompareResult(column) { - var sortingOrder = sortingOrders[column]; - var columnMeta = columnMetas[column]; - var value = values[column]; - var nextValue = nextValues[column]; - var compareFunctionFactory = getCompareFunctionFactory(columnMeta); - var compareResult = compareFunctionFactory(sortingOrder, columnMeta)(value, nextValue); - - // DIFF - MultiColumnSorting & ColumnSorting: removed iteration through next sorted columns. - - return compareResult; - }(0); - }; -} - /***/ }), /* 88 */ /***/ (function(module, exports, __webpack_require__) { @@ -32885,95 +32824,6 @@ function mainSortComparator(sortingOrders, columnMetas) { "use strict"; -exports.__esModule = true; -exports.FIRST_AFTER_SECOND = exports.FIRST_BEFORE_SECOND = exports.DO_NOT_SWAP = undefined; -exports.mainSortComparator = mainSortComparator; - -var _date = __webpack_require__(662); - -var _date2 = _interopRequireDefault(_date); - -var _default = __webpack_require__(663); - -var _default2 = _interopRequireDefault(_default); - -var _numeric = __webpack_require__(664); - -var _numeric2 = _interopRequireDefault(_numeric); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } - -var DO_NOT_SWAP = exports.DO_NOT_SWAP = 0; -var FIRST_BEFORE_SECOND = exports.FIRST_BEFORE_SECOND = -1; -var FIRST_AFTER_SECOND = exports.FIRST_AFTER_SECOND = 1; - -/** - * Gets sort function for the particular column basing on its column meta. - * - * @param {Array} columnMeta Column meta object. - * @returns {Function} - */ -function getCompareFunctionFactory(columnMeta) { - var columnSettings = columnMeta.multiColumnSorting; - - if (columnSettings.compareFunctionFactory) { - return columnSettings.compareFunctionFactory; - } else if (columnMeta.type === 'date') { - return _date2.default; - } else if (columnMeta.type === 'numeric') { - return _numeric2.default; - } - - return _default2.default; -} - -/** - * Sort comparator handled by conventional sort algorithm. - * - * @param {Array} sortOrders Sort orders (`asc` for ascending, `desc` for descending). - * @param {Array} columnMeta Column meta objects. - * @returns {Function} - */ -function mainSortComparator(sortingOrders, columnMetas) { - return function (rowIndexWithValues, nextRowIndexWithValues) { - // We sort array of arrays. Single array is in form [rowIndex, ...values]. - // We compare just values, stored at second index of array. - var _rowIndexWithValues = _toArray(rowIndexWithValues), - values = _rowIndexWithValues.slice(1); - - var _nextRowIndexWithValu = _toArray(nextRowIndexWithValues), - nextValues = _nextRowIndexWithValu.slice(1); - - return function getCompareResult(column) { - var sortingOrder = sortingOrders[column]; - var columnMeta = columnMetas[column]; - var value = values[column]; - var nextValue = nextValues[column]; - var compareFunctionFactory = getCompareFunctionFactory(columnMeta); - var compareResult = compareFunctionFactory(sortingOrder, columnMeta)(value, nextValue); - - if (compareResult === DO_NOT_SWAP) { - var nextSortedColumn = column + 1; - - if (typeof columnMetas[nextSortedColumn] !== 'undefined') { - return getCompareResult(nextSortedColumn); - } - } - - return compareResult; - }(0); - }; -} - -/***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -32982,11 +32832,11 @@ var _array = __webpack_require__(0); var _object = __webpack_require__(1); -var _localHooks = __webpack_require__(21); +var _localHooks = __webpack_require__(20); var _localHooks2 = _interopRequireDefault(_localHooks); -var _stateSaver = __webpack_require__(671); +var _stateSaver = __webpack_require__(669); var _stateSaver2 = _interopRequireDefault(_stateSaver); @@ -33087,7 +32937,7 @@ var BaseComponent = function () { exports.default = BaseComponent; /***/ }), -/* 90 */ +/* 89 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33097,7 +32947,7 @@ var validate = __webpack_require__(53); var MAP = 'Map'; // 23.1 Map Objects -module.exports = __webpack_require__(77)(MAP, function (get) { +module.exports = __webpack_require__(78)(MAP, function (get) { return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.1.3.6 Map.prototype.get(key) @@ -33113,7 +32963,7 @@ module.exports = __webpack_require__(77)(MAP, function (get) { /***/ }), -/* 91 */ +/* 90 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(13); @@ -33126,7 +32976,7 @@ module.exports = function (it) { /***/ }), -/* 92 */ +/* 91 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.1 ToPrimitive(input [, PreferredType]) @@ -33144,21 +32994,21 @@ module.exports = function (it, S) { /***/ }), -/* 93 */ +/* 92 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = __webpack_require__(22); -var dPs = __webpack_require__(485); -var enumBugKeys = __webpack_require__(97); -var IE_PROTO = __webpack_require__(95)('IE_PROTO'); +var anObject = __webpack_require__(21); +var dPs = __webpack_require__(484); +var enumBugKeys = __webpack_require__(96); +var IE_PROTO = __webpack_require__(94)('IE_PROTO'); var Empty = function () { /* empty */ }; var PROTOTYPE = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict = function () { // Thrash, waste and sodomy: IE GC bug - var iframe = __webpack_require__(91)('iframe'); + var iframe = __webpack_require__(90)('iframe'); var i = enumBugKeys.length; var lt = '<'; var gt = '>'; @@ -33191,7 +33041,7 @@ module.exports = Object.create || function create(O, Properties) { /***/ }), -/* 94 */ +/* 93 */ /***/ (function(module, exports, __webpack_require__) { // fallback for non-array-like ES3 and non-enumerable old V8 strings @@ -33203,21 +33053,21 @@ module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { /***/ }), -/* 95 */ +/* 94 */ /***/ (function(module, exports, __webpack_require__) { -var shared = __webpack_require__(96)('keys'); -var uid = __webpack_require__(58); +var shared = __webpack_require__(95)('keys'); +var uid = __webpack_require__(59); module.exports = function (key) { return shared[key] || (shared[key] = uid(key)); }; /***/ }), -/* 96 */ +/* 95 */ /***/ (function(module, exports, __webpack_require__) { -var core = __webpack_require__(48); +var core = __webpack_require__(50); var global = __webpack_require__(16); var SHARED = '__core-js_shared__'; var store = global[SHARED] || (global[SHARED] = {}); @@ -33226,13 +33076,13 @@ var store = global[SHARED] || (global[SHARED] = {}); return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: core.version, - mode: __webpack_require__(57) ? 'pure' : 'global', + mode: __webpack_require__(58) ? 'pure' : 'global', copyright: '© 2018 Denis Pushkarev (zloirock.ru)' }); /***/ }), -/* 97 */ +/* 96 */ /***/ (function(module, exports) { // IE 8- don't enum bug keys @@ -33242,7 +33092,7 @@ module.exports = ( /***/ }), -/* 98 */ +/* 97 */ /***/ (function(module, exports, __webpack_require__) { var ITERATOR = __webpack_require__(14)('iterator'); @@ -33270,7 +33120,7 @@ module.exports = function (exec, skipClosing) { /***/ }), -/* 99 */ +/* 98 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33280,7 +33130,7 @@ var validate = __webpack_require__(53); var SET = 'Set'; // 23.2 Set Objects -module.exports = __webpack_require__(77)(SET, function (get) { +module.exports = __webpack_require__(78)(SET, function (get) { return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.2.3.1 Set.prototype.add(value) @@ -33291,12 +33141,12 @@ module.exports = __webpack_require__(77)(SET, function (get) { /***/ }), -/* 100 */ +/* 99 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var each = __webpack_require__(79)(0); +var each = __webpack_require__(80)(0); var redefine = __webpack_require__(36); var meta = __webpack_require__(40); var assign = __webpack_require__(184); @@ -33333,7 +33183,7 @@ var methods = { }; // 23.3 WeakMap Objects -var $WeakMap = module.exports = __webpack_require__(77)(WEAK_MAP, wrapper, methods, weak, true, true); +var $WeakMap = module.exports = __webpack_require__(78)(WEAK_MAP, wrapper, methods, weak, true, true); // IE11 WeakMap frozen keys fix if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { @@ -33357,7 +33207,7 @@ if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp) /***/ }), -/* 101 */ +/* 100 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33367,7 +33217,7 @@ var validate = __webpack_require__(53); var WEAK_SET = 'WeakSet'; // 23.4 WeakSet Objects -__webpack_require__(77)(WEAK_SET, function (get) { +__webpack_require__(78)(WEAK_SET, function (get) { return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.4.3.1 WeakSet.prototype.add(value) @@ -33378,27 +33228,27 @@ __webpack_require__(77)(WEAK_SET, function (get) { /***/ }), -/* 102 */ +/* 101 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var LIBRARY = __webpack_require__(57); +var LIBRARY = __webpack_require__(58); var global = __webpack_require__(16); var ctx = __webpack_require__(38); var classof = __webpack_require__(177); -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var isObject = __webpack_require__(13); -var aFunction = __webpack_require__(74); -var anInstance = __webpack_require__(75); -var forOf = __webpack_require__(76); -var speciesConstructor = __webpack_require__(490); -var task = __webpack_require__(103).set; -var microtask = __webpack_require__(492)(); +var aFunction = __webpack_require__(75); +var anInstance = __webpack_require__(76); +var forOf = __webpack_require__(77); +var speciesConstructor = __webpack_require__(489); +var task = __webpack_require__(102).set; +var microtask = __webpack_require__(491)(); var newPromiseCapabilityModule = __webpack_require__(186); -var perform = __webpack_require__(493); -var userAgent = __webpack_require__(104); -var promiseResolve = __webpack_require__(494); +var perform = __webpack_require__(492); +var userAgent = __webpack_require__(103); +var promiseResolve = __webpack_require__(493); var PROMISE = 'Promise'; var TypeError = global.TypeError; var process = global.process; @@ -33573,7 +33423,7 @@ if (!USE_NATIVE) { this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled this._n = false; // <- notify }; - Internal.prototype = __webpack_require__(73)($Promise.prototype, { + Internal.prototype = __webpack_require__(74)($Promise.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected) { var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); @@ -33604,9 +33454,9 @@ if (!USE_NATIVE) { } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); -__webpack_require__(61)($Promise, PROMISE); +__webpack_require__(62)($Promise, PROMISE); __webpack_require__(181)(PROMISE); -Wrapper = __webpack_require__(48)[PROMISE]; +Wrapper = __webpack_require__(50)[PROMISE]; // statics $export($export.S + $export.F * !USE_NATIVE, PROMISE, { @@ -33624,7 +33474,7 @@ $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); } }); -$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(98)(function (iter) { +$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(97)(function (iter) { $Promise.all(iter)['catch'](empty); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) @@ -33671,13 +33521,13 @@ $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(98)(function /***/ }), -/* 103 */ +/* 102 */ /***/ (function(module, exports, __webpack_require__) { var ctx = __webpack_require__(38); -var invoke = __webpack_require__(491); +var invoke = __webpack_require__(490); var html = __webpack_require__(173); -var cel = __webpack_require__(91); +var cel = __webpack_require__(90); var global = __webpack_require__(16); var process = global.process; var setTask = global.setImmediate; @@ -33761,7 +33611,7 @@ module.exports = { /***/ }), -/* 104 */ +/* 103 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(16); @@ -33771,7 +33621,7 @@ module.exports = navigator && navigator.userAgent || ''; /***/ }), -/* 105 */ +/* 104 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33780,28 +33630,28 @@ module.exports = navigator && navigator.userAgent || ''; var global = __webpack_require__(16); var has = __webpack_require__(35); var DESCRIPTORS = __webpack_require__(27); -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var redefine = __webpack_require__(36); var META = __webpack_require__(40).KEY; var $fails = __webpack_require__(28); -var shared = __webpack_require__(96); -var setToStringTag = __webpack_require__(61); -var uid = __webpack_require__(58); +var shared = __webpack_require__(95); +var setToStringTag = __webpack_require__(62); +var uid = __webpack_require__(59); var wks = __webpack_require__(14); var wksExt = __webpack_require__(187); -var wksDefine = __webpack_require__(495); -var enumKeys = __webpack_require__(496); +var wksDefine = __webpack_require__(494); +var enumKeys = __webpack_require__(495); var isArray = __webpack_require__(183); -var anObject = __webpack_require__(22); +var anObject = __webpack_require__(21); var isObject = __webpack_require__(13); var toIObject = __webpack_require__(29); -var toPrimitive = __webpack_require__(92); -var createDesc = __webpack_require__(59); -var _create = __webpack_require__(93); +var toPrimitive = __webpack_require__(91); +var createDesc = __webpack_require__(60); +var _create = __webpack_require__(92); var gOPNExt = __webpack_require__(188); -var $GOPD = __webpack_require__(78); -var $DP = __webpack_require__(25); -var $keys = __webpack_require__(46); +var $GOPD = __webpack_require__(79); +var $DP = __webpack_require__(24); +var $keys = __webpack_require__(48); var gOPD = $GOPD.f; var dP = $DP.f; var gOPN = gOPNExt.f; @@ -33924,11 +33774,11 @@ if (!USE_NATIVE) { $GOPD.f = $getOwnPropertyDescriptor; $DP.f = $defineProperty; - __webpack_require__(106).f = gOPNExt.f = $getOwnPropertyNames; - __webpack_require__(62).f = $propertyIsEnumerable; - __webpack_require__(80).f = $getOwnPropertySymbols; + __webpack_require__(105).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(63).f = $propertyIsEnumerable; + __webpack_require__(81).f = $getOwnPropertySymbols; - if (DESCRIPTORS && !__webpack_require__(57)) { + if (DESCRIPTORS && !__webpack_require__(58)) { redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); } @@ -34012,12 +33862,12 @@ setToStringTag(global.JSON, 'JSON', true); /***/ }), -/* 106 */ +/* 105 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = __webpack_require__(171); -var hiddenKeys = __webpack_require__(97).concat('length', 'prototype'); +var hiddenKeys = __webpack_require__(96).concat('length', 'prototype'); exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return $keys(O, hiddenKeys); @@ -34025,7 +33875,7 @@ exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { /***/ }), -/* 107 */ +/* 106 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.5 Object.freeze(O) @@ -34040,7 +33890,7 @@ __webpack_require__(31)('freeze', function ($freeze) { /***/ }), -/* 108 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.17 Object.seal(O) @@ -34055,7 +33905,7 @@ __webpack_require__(31)('seal', function ($seal) { /***/ }), -/* 109 */ +/* 108 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.15 Object.preventExtensions(O) @@ -34070,7 +33920,7 @@ __webpack_require__(31)('preventExtensions', function ($preventExtensions) { /***/ }), -/* 110 */ +/* 109 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.12 Object.isFrozen(O) @@ -34084,7 +33934,7 @@ __webpack_require__(31)('isFrozen', function ($isFrozen) { /***/ }), -/* 111 */ +/* 110 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.13 Object.isSealed(O) @@ -34098,7 +33948,7 @@ __webpack_require__(31)('isSealed', function ($isSealed) { /***/ }), -/* 112 */ +/* 111 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.11 Object.isExtensible(O) @@ -34112,12 +33962,12 @@ __webpack_require__(31)('isExtensible', function ($isExtensible) { /***/ }), -/* 113 */ +/* 112 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) var toIObject = __webpack_require__(29); -var $getOwnPropertyDescriptor = __webpack_require__(78).f; +var $getOwnPropertyDescriptor = __webpack_require__(79).f; __webpack_require__(31)('getOwnPropertyDescriptor', function () { return function getOwnPropertyDescriptor(it, key) { @@ -34127,7 +33977,7 @@ __webpack_require__(31)('getOwnPropertyDescriptor', function () { /***/ }), -/* 114 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.9 Object.getPrototypeOf(O) @@ -34142,12 +33992,12 @@ __webpack_require__(31)('getPrototypeOf', function () { /***/ }), -/* 115 */ +/* 114 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 Object.keys(O) var toObject = __webpack_require__(39); -var $keys = __webpack_require__(46); +var $keys = __webpack_require__(48); __webpack_require__(31)('keys', function () { return function keys(it) { @@ -34157,7 +34007,7 @@ __webpack_require__(31)('keys', function () { /***/ }), -/* 116 */ +/* 115 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.7 Object.getOwnPropertyNames(O) @@ -34167,38 +34017,38 @@ __webpack_require__(31)('getOwnPropertyNames', function () { /***/ }), -/* 117 */ +/* 116 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.3.1 Object.assign(target, source) -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); $export($export.S + $export.F, 'Object', { assign: __webpack_require__(184) }); /***/ }), -/* 118 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.3.10 Object.is(value1, value2) -var $export = __webpack_require__(7); -$export($export.S, 'Object', { is: __webpack_require__(497) }); +var $export = __webpack_require__(6); +$export($export.S, 'Object', { is: __webpack_require__(496) }); /***/ }), -/* 119 */ +/* 118 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.3.19 Object.setPrototypeOf(O, proto) -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(182).set }); /***/ }), -/* 120 */ +/* 119 */ /***/ (function(module, exports, __webpack_require__) { -var dP = __webpack_require__(25).f; +var dP = __webpack_require__(24).f; var FProto = Function.prototype; var nameRE = /^\s*function ([^ (]*)/; var NAME = 'name'; @@ -34217,10 +34067,10 @@ NAME in FProto || __webpack_require__(27) && dP(FProto, NAME, { /***/ }), -/* 121 */ +/* 120 */ /***/ (function(module, exports, __webpack_require__) { -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var toIObject = __webpack_require__(29); var toLength = __webpack_require__(30); @@ -34241,11 +34091,11 @@ $export($export.S, 'String', { /***/ }), -/* 122 */ +/* 121 */ /***/ (function(module, exports, __webpack_require__) { -var $export = __webpack_require__(7); -var toAbsoluteIndex = __webpack_require__(72); +var $export = __webpack_require__(6); +var toAbsoluteIndex = __webpack_require__(73); var fromCharCode = String.fromCharCode; var $fromCodePoint = String.fromCodePoint; @@ -34270,13 +34120,13 @@ $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1) /***/ }), -/* 123 */ +/* 122 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var $export = __webpack_require__(7); -var $at = __webpack_require__(498)(false); +var $export = __webpack_require__(6); +var $at = __webpack_require__(497)(false); $export($export.P, 'String', { // 21.1.3.3 String.prototype.codePointAt(pos) codePointAt: function codePointAt(pos) { @@ -34286,10 +34136,10 @@ $export($export.P, 'String', { /***/ }), -/* 124 */ +/* 123 */ /***/ (function(module, exports, __webpack_require__) { -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); $export($export.P, 'String', { // 21.1.3.13 String.prototype.repeat(count) @@ -34298,19 +34148,19 @@ $export($export.P, 'String', { /***/ }), -/* 125 */ +/* 124 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var toLength = __webpack_require__(30); -var context = __webpack_require__(126); +var context = __webpack_require__(125); var STARTS_WITH = 'startsWith'; var $startsWith = ''[STARTS_WITH]; -$export($export.P + $export.F * __webpack_require__(127)(STARTS_WITH), 'String', { +$export($export.P + $export.F * __webpack_require__(126)(STARTS_WITH), 'String', { startsWith: function startsWith(searchString /* , position = 0 */) { var that = context(this, searchString, STARTS_WITH); var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); @@ -34323,12 +34173,12 @@ $export($export.P + $export.F * __webpack_require__(127)(STARTS_WITH), 'String', /***/ }), -/* 126 */ +/* 125 */ /***/ (function(module, exports, __webpack_require__) { // helper for String#{startsWith, endsWith, includes} var isRegExp = __webpack_require__(190); -var defined = __webpack_require__(47); +var defined = __webpack_require__(49); module.exports = function (that, searchString, NAME) { if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); @@ -34337,7 +34187,7 @@ module.exports = function (that, searchString, NAME) { /***/ }), -/* 127 */ +/* 126 */ /***/ (function(module, exports, __webpack_require__) { var MATCH = __webpack_require__(14)('match'); @@ -34355,19 +34205,19 @@ module.exports = function (KEY) { /***/ }), -/* 128 */ +/* 127 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var toLength = __webpack_require__(30); -var context = __webpack_require__(126); +var context = __webpack_require__(125); var ENDS_WITH = 'endsWith'; var $endsWith = ''[ENDS_WITH]; -$export($export.P + $export.F * __webpack_require__(127)(ENDS_WITH), 'String', { +$export($export.P + $export.F * __webpack_require__(126)(ENDS_WITH), 'String', { endsWith: function endsWith(searchString /* , endPosition = @length */) { var that = context(this, searchString, ENDS_WITH); var endPosition = arguments.length > 1 ? arguments[1] : undefined; @@ -34382,17 +34232,17 @@ $export($export.P + $export.F * __webpack_require__(127)(ENDS_WITH), 'String', { /***/ }), -/* 129 */ +/* 128 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 21.1.3.7 String.prototype.includes(searchString, position = 0) -var $export = __webpack_require__(7); -var context = __webpack_require__(126); +var $export = __webpack_require__(6); +var context = __webpack_require__(125); var INCLUDES = 'includes'; -$export($export.P + $export.F * __webpack_require__(127)(INCLUDES), 'String', { +$export($export.P + $export.F * __webpack_require__(126)(INCLUDES), 'String', { includes: function includes(searchString /* , position = 0 */) { return !!~context(this, searchString, INCLUDES) .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); @@ -34401,22 +34251,22 @@ $export($export.P + $export.F * __webpack_require__(127)(INCLUDES), 'String', { /***/ }), -/* 130 */ +/* 129 */ /***/ (function(module, exports, __webpack_require__) { // 21.2.5.3 get RegExp.prototype.flags() -if (__webpack_require__(27) && /./g.flags != 'g') __webpack_require__(25).f(RegExp.prototype, 'flags', { +if (__webpack_require__(27) && /./g.flags != 'g') __webpack_require__(24).f(RegExp.prototype, 'flags', { configurable: true, - get: __webpack_require__(499) + get: __webpack_require__(498) }); /***/ }), -/* 131 */ +/* 130 */ /***/ (function(module, exports, __webpack_require__) { // @@match logic -__webpack_require__(81)('match', 1, function (defined, MATCH, $match) { +__webpack_require__(82)('match', 1, function (defined, MATCH, $match) { // 21.1.3.11 String.prototype.match(regexp) return [function match(regexp) { 'use strict'; @@ -34428,11 +34278,11 @@ __webpack_require__(81)('match', 1, function (defined, MATCH, $match) { /***/ }), -/* 132 */ +/* 131 */ /***/ (function(module, exports, __webpack_require__) { // @@replace logic -__webpack_require__(81)('replace', 2, function (defined, REPLACE, $replace) { +__webpack_require__(82)('replace', 2, function (defined, REPLACE, $replace) { // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) return [function replace(searchValue, replaceValue) { 'use strict'; @@ -34446,11 +34296,11 @@ __webpack_require__(81)('replace', 2, function (defined, REPLACE, $replace) { /***/ }), -/* 133 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { // @@split logic -__webpack_require__(81)('split', 2, function (defined, SPLIT, $split) { +__webpack_require__(82)('split', 2, function (defined, SPLIT, $split) { 'use strict'; var isRegExp = __webpack_require__(190); var _split = $split; @@ -34523,11 +34373,11 @@ __webpack_require__(81)('split', 2, function (defined, SPLIT, $split) { /***/ }), -/* 134 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { // @@search logic -__webpack_require__(81)('search', 1, function (defined, SEARCH, $search) { +__webpack_require__(82)('search', 1, function (defined, SEARCH, $search) { // 21.1.3.15 String.prototype.search(regexp) return [function search(regexp) { 'use strict'; @@ -34539,21 +34389,21 @@ __webpack_require__(81)('search', 1, function (defined, SEARCH, $search) { /***/ }), -/* 135 */ +/* 134 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ctx = __webpack_require__(38); -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var toObject = __webpack_require__(39); var call = __webpack_require__(174); var isArrayIter = __webpack_require__(175); var toLength = __webpack_require__(30); -var createProperty = __webpack_require__(136); +var createProperty = __webpack_require__(135); var getIterFn = __webpack_require__(176); -$export($export.S + $export.F * !__webpack_require__(98)(function (iter) { Array.from(iter); }), 'Array', { +$export($export.S + $export.F * !__webpack_require__(97)(function (iter) { Array.from(iter); }), 'Array', { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject(arrayLike); @@ -34583,13 +34433,13 @@ $export($export.S + $export.F * !__webpack_require__(98)(function (iter) { Array /***/ }), -/* 136 */ +/* 135 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var $defineProperty = __webpack_require__(25); -var createDesc = __webpack_require__(59); +var $defineProperty = __webpack_require__(24); +var createDesc = __webpack_require__(60); module.exports = function (object, index, value) { if (index in object) $defineProperty.f(object, index, createDesc(0, value)); @@ -34598,13 +34448,13 @@ module.exports = function (object, index, value) { /***/ }), -/* 137 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var $export = __webpack_require__(7); -var createProperty = __webpack_require__(136); +var $export = __webpack_require__(6); +var createProperty = __webpack_require__(135); // WebKit Array.of isn't generic $export($export.S + $export.F * __webpack_require__(28)(function () { @@ -34624,26 +34474,26 @@ $export($export.S + $export.F * __webpack_require__(28)(function () { /***/ }), -/* 138 */ +/* 137 */ /***/ (function(module, exports, __webpack_require__) { // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); -$export($export.P, 'Array', { copyWithin: __webpack_require__(500) }); +$export($export.P, 'Array', { copyWithin: __webpack_require__(499) }); __webpack_require__(54)('copyWithin'); /***/ }), -/* 139 */ +/* 138 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) -var $export = __webpack_require__(7); -var $find = __webpack_require__(79)(5); +var $export = __webpack_require__(6); +var $find = __webpack_require__(80)(5); var KEY = 'find'; var forced = true; // Shouldn't skip holes @@ -34657,14 +34507,14 @@ __webpack_require__(54)(KEY); /***/ }), -/* 140 */ +/* 139 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) -var $export = __webpack_require__(7); -var $find = __webpack_require__(79)(6); +var $export = __webpack_require__(6); +var $find = __webpack_require__(80)(6); var KEY = 'findIndex'; var forced = true; // Shouldn't skip holes @@ -34678,23 +34528,23 @@ __webpack_require__(54)(KEY); /***/ }), -/* 141 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); -$export($export.P, 'Array', { fill: __webpack_require__(501) }); +$export($export.P, 'Array', { fill: __webpack_require__(500) }); __webpack_require__(54)('fill'); /***/ }), -/* 142 */ +/* 141 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.2 Number.isFinite(number) -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var _isFinite = __webpack_require__(16).isFinite; $export($export.S, 'Number', { @@ -34705,21 +34555,21 @@ $export($export.S, 'Number', { /***/ }), -/* 143 */ +/* 142 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.3 Number.isInteger(number) -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); $export($export.S, 'Number', { isInteger: __webpack_require__(191) }); /***/ }), -/* 144 */ +/* 143 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.5 Number.isSafeInteger(number) -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var isInteger = __webpack_require__(191); var abs = Math.abs; @@ -34731,11 +34581,11 @@ $export($export.S, 'Number', { /***/ }), -/* 145 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.4 Number.isNaN(number) -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); $export($export.S, 'Number', { isNaN: function isNaN(number) { @@ -34746,43 +34596,43 @@ $export($export.S, 'Number', { /***/ }), -/* 146 */ +/* 145 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.1 Number.EPSILON -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); $export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); /***/ }), -/* 147 */ +/* 146 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.10 Number.MIN_SAFE_INTEGER -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); $export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); /***/ }), -/* 148 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { // 20.1.2.6 Number.MAX_SAFE_INTEGER -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); /***/ }), -/* 149 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/tc39/Array.prototype.includes -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var $includes = __webpack_require__(172)(true); $export($export.P, 'Array', { @@ -34795,11 +34645,11 @@ __webpack_require__(54)('includes'); /***/ }), -/* 150 */ +/* 149 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-object-values-entries -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var $values = __webpack_require__(192)(false); $export($export.S, 'Object', { @@ -34810,11 +34660,11 @@ $export($export.S, 'Object', { /***/ }), -/* 151 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-object-values-entries -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var $entries = __webpack_require__(192)(true); $export($export.S, 'Object', { @@ -34825,15 +34675,15 @@ $export($export.S, 'Object', { /***/ }), -/* 152 */ +/* 151 */ /***/ (function(module, exports, __webpack_require__) { // https://github.com/tc39/proposal-object-getownpropertydescriptors -var $export = __webpack_require__(7); -var ownKeys = __webpack_require__(502); +var $export = __webpack_require__(6); +var ownKeys = __webpack_require__(501); var toIObject = __webpack_require__(29); -var gOPD = __webpack_require__(78); -var createProperty = __webpack_require__(136); +var gOPD = __webpack_require__(79); +var createProperty = __webpack_require__(135); $export($export.S, 'Object', { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { @@ -34853,15 +34703,15 @@ $export($export.S, 'Object', { /***/ }), -/* 153 */ +/* 152 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/tc39/proposal-string-pad-start-end -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var $pad = __webpack_require__(193); -var userAgent = __webpack_require__(104); +var userAgent = __webpack_require__(103); // https://github.com/zloirock/core-js/issues/280 $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { @@ -34872,15 +34722,15 @@ $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAge /***/ }), -/* 154 */ +/* 153 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/tc39/proposal-string-pad-start-end -var $export = __webpack_require__(7); +var $export = __webpack_require__(6); var $pad = __webpack_require__(193); -var userAgent = __webpack_require__(104); +var userAgent = __webpack_require__(103); // https://github.com/zloirock/core-js/issues/280 $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { @@ -34891,11 +34741,11 @@ $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAge /***/ }), -/* 155 */ +/* 154 */ /***/ (function(module, exports, __webpack_require__) { -var $export = __webpack_require__(7); -var $task = __webpack_require__(103); +var $export = __webpack_require__(6); +var $task = __webpack_require__(102); $export($export.G + $export.B, { setImmediate: $task.set, clearImmediate: $task.clear @@ -34903,15 +34753,15 @@ $export($export.G + $export.B, { /***/ }), -/* 156 */ +/* 155 */ /***/ (function(module, exports, __webpack_require__) { -var $iterators = __webpack_require__(82); -var getKeys = __webpack_require__(46); +var $iterators = __webpack_require__(83); +var getKeys = __webpack_require__(48); var redefine = __webpack_require__(36); var global = __webpack_require__(16); var hide = __webpack_require__(37); -var Iterators = __webpack_require__(60); +var Iterators = __webpack_require__(61); var wks = __webpack_require__(14); var ITERATOR = wks('iterator'); var TO_STRING_TAG = wks('toStringTag'); @@ -34967,7 +34817,7 @@ for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++ /***/ }), -/* 157 */ +/* 156 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34976,7 +34826,7 @@ for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++ exports.__esModule = true; exports.getRegisteredCellTypes = exports.getRegisteredCellTypeNames = exports.hasCellType = exports.getCellType = exports.registerCellType = undefined; -var _staticRegister2 = __webpack_require__(49); +var _staticRegister2 = __webpack_require__(41); var _staticRegister3 = _interopRequireDefault(_staticRegister2); @@ -34984,41 +34834,41 @@ var _editors = __webpack_require__(19); var _renderers = __webpack_require__(15); -var _validators = __webpack_require__(42); +var _validators = __webpack_require__(44); -var _autocompleteType = __webpack_require__(537); +var _autocompleteType = __webpack_require__(536); var _autocompleteType2 = _interopRequireDefault(_autocompleteType); -var _checkboxType = __webpack_require__(538); +var _checkboxType = __webpack_require__(537); var _checkboxType2 = _interopRequireDefault(_checkboxType); -var _dateType = __webpack_require__(539); +var _dateType = __webpack_require__(538); var _dateType2 = _interopRequireDefault(_dateType); -var _dropdownType = __webpack_require__(540); +var _dropdownType = __webpack_require__(539); var _dropdownType2 = _interopRequireDefault(_dropdownType); -var _handsontableType = __webpack_require__(541); +var _handsontableType = __webpack_require__(540); var _handsontableType2 = _interopRequireDefault(_handsontableType); -var _numericType = __webpack_require__(542); +var _numericType = __webpack_require__(541); var _numericType2 = _interopRequireDefault(_numericType); -var _passwordType = __webpack_require__(543); +var _passwordType = __webpack_require__(542); var _passwordType2 = _interopRequireDefault(_passwordType); -var _textType = __webpack_require__(544); +var _textType = __webpack_require__(543); var _textType2 = _interopRequireDefault(_textType); -var _timeType = __webpack_require__(545); +var _timeType = __webpack_require__(544); var _timeType2 = _interopRequireDefault(_timeType); @@ -35087,7 +34937,7 @@ exports.getRegisteredCellTypeNames = getNames; exports.getRegisteredCellTypes = getValues; /***/ }), -/* 158 */ +/* 157 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35105,25 +34955,25 @@ exports.default = Core; var _element = __webpack_require__(2); -var _setting = __webpack_require__(159); +var _setting = __webpack_require__(158); var _function = __webpack_require__(34); -var _console = __webpack_require__(20); +var _console = __webpack_require__(22); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); -var _browser = __webpack_require__(50); +var _browser = __webpack_require__(42); -var _dataMap = __webpack_require__(546); +var _dataMap = __webpack_require__(545); var _dataMap2 = _interopRequireDefault(_dataMap); -var _editorManager = __webpack_require__(549); +var _editorManager = __webpack_require__(548); var _editorManager2 = _interopRequireDefault(_editorManager); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -35137,27 +34987,27 @@ var _plugins = __webpack_require__(5); var _renderers = __webpack_require__(15); -var _validators = __webpack_require__(42); +var _validators = __webpack_require__(44); var _string = __webpack_require__(32); var _number = __webpack_require__(4); -var _tableView = __webpack_require__(550); +var _tableView = __webpack_require__(549); var _tableView2 = _interopRequireDefault(_tableView); -var _dataSource = __webpack_require__(551); +var _dataSource = __webpack_require__(550); var _dataSource2 = _interopRequireDefault(_dataSource); -var _data = __webpack_require__(83); +var _data = __webpack_require__(84); var _recordTranslator = __webpack_require__(55); var _rootInstance = __webpack_require__(457); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); var _pluginHooks = __webpack_require__(17); @@ -35167,15 +35017,15 @@ var _defaultSettings = __webpack_require__(458); var _defaultSettings2 = _interopRequireDefault(_defaultSettings); -var _cellTypes = __webpack_require__(157); +var _cellTypes = __webpack_require__(156); var _i18n = __webpack_require__(459); -var _dictionariesManager = __webpack_require__(84); +var _dictionariesManager = __webpack_require__(85); var _utils = __webpack_require__(460); -var _keyStateObserver = __webpack_require__(85); +var _keyStateObserver = __webpack_require__(86); var _selection = __webpack_require__(461); @@ -38844,7 +38694,7 @@ function Core(rootElement, userSettings) { } /***/ }), -/* 159 */ +/* 158 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -38877,7 +38727,7 @@ function columnFactory(GridSettings, conflictList) { } /***/ }), -/* 160 */ +/* 159 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39249,6 +39099,9 @@ var GhostTable = function () { var td = d.createElement('td'); var tr = d.createElement('tr'); + // Indicate that this element is created and supported by GhostTable. It can be useful to + // exclude rendering performance costly logic or exclude logic which doesn't work within a hidden table. + td.setAttribute('ghost-table', 1); renderer(_this4.hot, td, row, column, _this4.hot.colToProp(column), string.value, cellProperties); tr.appendChild(td); fragment.appendChild(tr); @@ -39420,6 +39273,134 @@ var GhostTable = function () { exports.default = GhostTable; +/***/ }), +/* 160 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.HEADER_SPAN_CLASS = exports.DESC_SORT_STATE = exports.ASC_SORT_STATE = undefined; +exports.areValidSortStates = areValidSortStates; +exports.getNextSortOrder = getNextSortOrder; +exports.getHeaderSpanElement = getHeaderSpanElement; +exports.isFirstLevelColumnHeader = isFirstLevelColumnHeader; +exports.wasHeaderClickedProperly = wasHeaderClickedProperly; + +var _mixed = __webpack_require__(10); + +var _object = __webpack_require__(1); + +var _event = __webpack_require__(12); + +var ASC_SORT_STATE = exports.ASC_SORT_STATE = 'asc'; +var DESC_SORT_STATE = exports.DESC_SORT_STATE = 'desc'; +var HEADER_SPAN_CLASS = exports.HEADER_SPAN_CLASS = 'colHeader'; + +/** + * Get if column state is valid. + * + * @param {Number} columnState Particular column state. + * @returns {Boolean} + */ +function isValidColumnState(columnState) { + if ((0, _mixed.isUndefined)(columnState)) { + return false; + } + + var column = columnState.column, + sortOrder = columnState.sortOrder; + + + return Number.isInteger(column) && [ASC_SORT_STATE, DESC_SORT_STATE].includes(sortOrder); +} + +/** + * Get if all sorted columns states are valid. + * + * @param {Array} sortStates + * @returns {Boolean} + */ +function areValidSortStates(sortStates) { + if (Array.isArray(sortStates) === false || sortStates.every(function (columnState) { + return (0, _object.isObject)(columnState); + }) === false) { + return false; + } + + var sortedColumns = sortStates.map(function (_ref) { + var column = _ref.column; + return column; + }); + var indexOccursOnlyOnce = new Set(sortedColumns).size === sortedColumns.length; + + return indexOccursOnlyOnce && sortStates.every(isValidColumnState); +} + +/** + * Get next sort order for particular column. The order sequence looks as follows: 'asc' -> 'desc' -> undefined -> 'asc' + * + * @param {String|undefined} sortOrder sort order (`asc` for ascending, `desc` for descending and undefined for not sorted). + * @returns {String|undefined} Next sort order (`asc` for ascending, `desc` for descending and undefined for not sorted). + */ +function getNextSortOrder(sortOrder) { + if (sortOrder === DESC_SORT_STATE) { + return; + } else if (sortOrder === ASC_SORT_STATE) { + return DESC_SORT_STATE; + } + + return ASC_SORT_STATE; +} + +/** + * Get `span` DOM element inside `th` DOM element. + * + * @param {Element} TH th HTML element. + * @returns {Element | null} + */ +function getHeaderSpanElement(TH) { + var headerSpanElement = TH.querySelector('.' + HEADER_SPAN_CLASS); + + return headerSpanElement; +} + +/** + * + * Get if handled header is first level column header. + * + * @param {Number} column Visual column index. + * @param {Element} TH th HTML element. + * @returns {Boolean} + */ +function isFirstLevelColumnHeader(column, TH) { + if (column < 0 || !TH.parentNode) { + return false; + } + + var TRs = TH.parentNode.parentNode.childNodes; + var headerLevel = Array.from(TRs).indexOf(TH.parentNode) - TRs.length; + + if (headerLevel !== -1) { + return false; + } + + return true; +} + +/** + * Get if header was clicked properly. Click on column header and NOT done by right click return `true`. + * + * @param {Number} row Visual row index. + * @param {Number} column Visual column index. + * @param {Event} clickEvent Click event. + * @returns {Boolean} + */ +function wasHeaderClickedProperly(row, column, clickEvent) { + return row === -1 && column >= 0 && (0, _event.isRightClick)(clickEvent) === false; +} + /***/ }), /* 161 */ /***/ (function(module, exports, __webpack_require__) { @@ -39448,7 +39429,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _core = __webpack_require__(158); +var _core = __webpack_require__(157); var _core2 = _interopRequireDefault(_core); @@ -39456,29 +39437,29 @@ var _element = __webpack_require__(2); var _array = __webpack_require__(0); -var _cursor = __webpack_require__(597); +var _cursor = __webpack_require__(598); var _cursor2 = _interopRequireDefault(_cursor); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); var _object = __webpack_require__(1); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); var _function = __webpack_require__(34); -var _utils = __webpack_require__(24); +var _utils = __webpack_require__(23); var _unicode = __webpack_require__(18); -var _localHooks = __webpack_require__(21); +var _localHooks = __webpack_require__(20); var _localHooks2 = _interopRequireDefault(_localHooks); -var _predefinedItems = __webpack_require__(43); +var _predefinedItems = __webpack_require__(45); var _event = __webpack_require__(12); @@ -40344,7 +40325,7 @@ var _templateObject = _taggedTemplateLiteral(['The merged cell declared with {ro _templateObject3 = _taggedTemplateLiteral(['The merged cell declared at [', ', ', '] has both "rowspan" \n and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.'], ['The merged cell declared at [', ', ', '] has both "rowspan" \n and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.']), _templateObject4 = _taggedTemplateLiteral(['The merged cell declared at [', ', ', '] has "rowspan" or "colspan" declared as \n "0", which is not supported. It cannot be added to the collection.'], ['The merged cell declared at [', ', ', '] has "rowspan" or "colspan" declared as \n "0", which is not supported. It cannot be added to the collection.']); -var _index = __webpack_require__(10); +var _index = __webpack_require__(9); var _templateLiteralTag = __webpack_require__(26); @@ -40724,61 +40705,61 @@ var _object = __webpack_require__(1); var _array = __webpack_require__(0); -var _predefinedItems = __webpack_require__(43); +var _predefinedItems = __webpack_require__(45); var _conditionRegisterer = __webpack_require__(11); -var _none = __webpack_require__(672); +var _none = __webpack_require__(670); -var _empty = __webpack_require__(472); +var _empty = __webpack_require__(471); -var _notEmpty = __webpack_require__(673); +var _notEmpty = __webpack_require__(671); -var _equal = __webpack_require__(473); +var _equal = __webpack_require__(472); -var _notEqual = __webpack_require__(674); +var _notEqual = __webpack_require__(672); -var _greaterThan = __webpack_require__(675); +var _greaterThan = __webpack_require__(673); -var _greaterThanOrEqual = __webpack_require__(676); +var _greaterThanOrEqual = __webpack_require__(674); -var _lessThan = __webpack_require__(677); +var _lessThan = __webpack_require__(675); -var _lessThanOrEqual = __webpack_require__(678); +var _lessThanOrEqual = __webpack_require__(676); -var _between = __webpack_require__(474); +var _between = __webpack_require__(473); -var _notBetween = __webpack_require__(679); +var _notBetween = __webpack_require__(677); -var _beginsWith = __webpack_require__(680); +var _beginsWith = __webpack_require__(678); -var _endsWith = __webpack_require__(681); +var _endsWith = __webpack_require__(679); -var _contains = __webpack_require__(477); +var _contains = __webpack_require__(476); -var _notContains = __webpack_require__(682); +var _notContains = __webpack_require__(680); -var _before = __webpack_require__(476); +var _before = __webpack_require__(475); -var _after = __webpack_require__(475); +var _after = __webpack_require__(474); -var _tomorrow = __webpack_require__(683); +var _tomorrow = __webpack_require__(681); -var _today = __webpack_require__(684); +var _today = __webpack_require__(682); -var _yesterday = __webpack_require__(685); +var _yesterday = __webpack_require__(683); -var _byValue = __webpack_require__(686); +var _byValue = __webpack_require__(684); -var _true = __webpack_require__(687); +var _true = __webpack_require__(685); -var _false = __webpack_require__(688); +var _false = __webpack_require__(686); var _conjunction = __webpack_require__(165); -var _disjunction = __webpack_require__(478); +var _disjunction = __webpack_require__(477); -var _disjunctionWithExtraCondition = __webpack_require__(479); +var _disjunctionWithExtraCondition = __webpack_require__(478); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } @@ -40860,7 +40841,7 @@ var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _logicalOperationRegisterer = __webpack_require__(67); +var _logicalOperationRegisterer = __webpack_require__(68); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -40893,7 +40874,7 @@ var _element = __webpack_require__(2); var _object = __webpack_require__(1); -var _base = __webpack_require__(68); +var _base = __webpack_require__(69); var _base2 = _interopRequireDefault(_base); @@ -41254,12 +41235,12 @@ exports.default = BaseUI; "use strict"; -var dP = __webpack_require__(25).f; -var create = __webpack_require__(93); -var redefineAll = __webpack_require__(73); +var dP = __webpack_require__(24).f; +var create = __webpack_require__(92); +var redefineAll = __webpack_require__(74); var ctx = __webpack_require__(38); -var anInstance = __webpack_require__(75); -var forOf = __webpack_require__(76); +var anInstance = __webpack_require__(76); +var forOf = __webpack_require__(77); var $iterDefine = __webpack_require__(178); var step = __webpack_require__(180); var setSpecies = __webpack_require__(181); @@ -41404,7 +41385,7 @@ module.exports = { /***/ (function(module, exports, __webpack_require__) { module.exports = !__webpack_require__(27) && !__webpack_require__(28)(function () { - return Object.defineProperty(__webpack_require__(91)('div'), 'a', { get: function () { return 7; } }).a != 7; + return Object.defineProperty(__webpack_require__(90)('div'), 'a', { get: function () { return 7; } }).a != 7; }); @@ -41415,7 +41396,7 @@ module.exports = !__webpack_require__(27) && !__webpack_require__(28)(function ( var has = __webpack_require__(35); var toIObject = __webpack_require__(29); var arrayIndexOf = __webpack_require__(172)(false); -var IE_PROTO = __webpack_require__(95)('IE_PROTO'); +var IE_PROTO = __webpack_require__(94)('IE_PROTO'); module.exports = function (object, names) { var O = toIObject(object); @@ -41439,7 +41420,7 @@ module.exports = function (object, names) { // true -> Array#includes var toIObject = __webpack_require__(29); var toLength = __webpack_require__(30); -var toAbsoluteIndex = __webpack_require__(72); +var toAbsoluteIndex = __webpack_require__(73); module.exports = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIObject($this); @@ -41473,7 +41454,7 @@ module.exports = document && document.documentElement; /***/ (function(module, exports, __webpack_require__) { // call something on iterator step with safe closing on error -var anObject = __webpack_require__(22); +var anObject = __webpack_require__(21); module.exports = function (iterator, fn, value, entries) { try { return entries ? fn(anObject(value)[0], value[1]) : fn(value); @@ -41491,7 +41472,7 @@ module.exports = function (iterator, fn, value, entries) { /***/ (function(module, exports, __webpack_require__) { // check on default Array iterator -var Iterators = __webpack_require__(60); +var Iterators = __webpack_require__(61); var ITERATOR = __webpack_require__(14)('iterator'); var ArrayProto = Array.prototype; @@ -41506,8 +41487,8 @@ module.exports = function (it) { var classof = __webpack_require__(177); var ITERATOR = __webpack_require__(14)('iterator'); -var Iterators = __webpack_require__(60); -module.exports = __webpack_require__(48).getIteratorMethod = function (it) { +var Iterators = __webpack_require__(61); +module.exports = __webpack_require__(50).getIteratorMethod = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; @@ -41549,13 +41530,13 @@ module.exports = function (it) { "use strict"; -var LIBRARY = __webpack_require__(57); -var $export = __webpack_require__(7); +var LIBRARY = __webpack_require__(58); +var $export = __webpack_require__(6); var redefine = __webpack_require__(36); var hide = __webpack_require__(37); -var Iterators = __webpack_require__(60); -var $iterCreate = __webpack_require__(486); -var setToStringTag = __webpack_require__(61); +var Iterators = __webpack_require__(61); +var $iterCreate = __webpack_require__(485); +var setToStringTag = __webpack_require__(62); var getPrototypeOf = __webpack_require__(179); var ITERATOR = __webpack_require__(14)('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` @@ -41626,7 +41607,7 @@ module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = __webpack_require__(35); var toObject = __webpack_require__(39); -var IE_PROTO = __webpack_require__(95)('IE_PROTO'); +var IE_PROTO = __webpack_require__(94)('IE_PROTO'); var ObjectProto = Object.prototype; module.exports = Object.getPrototypeOf || function (O) { @@ -41654,7 +41635,7 @@ module.exports = function (done, value) { "use strict"; var global = __webpack_require__(16); -var dP = __webpack_require__(25); +var dP = __webpack_require__(24); var DESCRIPTORS = __webpack_require__(27); var SPECIES = __webpack_require__(14)('species'); @@ -41674,7 +41655,7 @@ module.exports = function (KEY) { // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var isObject = __webpack_require__(13); -var anObject = __webpack_require__(22); +var anObject = __webpack_require__(21); var check = function (O, proto) { anObject(O); if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); @@ -41683,7 +41664,7 @@ module.exports = { set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line function (test, buggy, set) { try { - set = __webpack_require__(38)(Function.call, __webpack_require__(78).f(Object.prototype, '__proto__').set, 2); + set = __webpack_require__(38)(Function.call, __webpack_require__(79).f(Object.prototype, '__proto__').set, 2); set(test, []); buggy = !(test instanceof Array); } catch (e) { buggy = true; } @@ -41716,11 +41697,11 @@ module.exports = Array.isArray || function isArray(arg) { "use strict"; // 19.1.2.1 Object.assign(target, source, ...) -var getKeys = __webpack_require__(46); -var gOPS = __webpack_require__(80); -var pIE = __webpack_require__(62); +var getKeys = __webpack_require__(48); +var gOPS = __webpack_require__(81); +var pIE = __webpack_require__(63); var toObject = __webpack_require__(39); -var IObject = __webpack_require__(94); +var IObject = __webpack_require__(93); var $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) @@ -41756,13 +41737,13 @@ module.exports = !$assign || __webpack_require__(28)(function () { "use strict"; -var redefineAll = __webpack_require__(73); +var redefineAll = __webpack_require__(74); var getWeak = __webpack_require__(40).getWeak; -var anObject = __webpack_require__(22); +var anObject = __webpack_require__(21); var isObject = __webpack_require__(13); -var anInstance = __webpack_require__(75); -var forOf = __webpack_require__(76); -var createArrayMethod = __webpack_require__(79); +var anInstance = __webpack_require__(76); +var forOf = __webpack_require__(77); +var createArrayMethod = __webpack_require__(80); var $has = __webpack_require__(35); var validate = __webpack_require__(53); var arrayFind = createArrayMethod(5); @@ -41849,7 +41830,7 @@ module.exports = { "use strict"; // 25.4.1.5 NewPromiseCapability(C) -var aFunction = __webpack_require__(74); +var aFunction = __webpack_require__(75); function PromiseCapability(C) { var resolve, reject; @@ -41880,7 +41861,7 @@ exports.f = __webpack_require__(14); // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = __webpack_require__(29); -var gOPN = __webpack_require__(106).f; +var gOPN = __webpack_require__(105).f; var toString = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames @@ -41905,8 +41886,8 @@ module.exports.f = function getOwnPropertyNames(it) { "use strict"; -var toInteger = __webpack_require__(71); -var defined = __webpack_require__(47); +var toInteger = __webpack_require__(72); +var defined = __webpack_require__(49); module.exports = function repeat(count) { var str = String(defined(this)); @@ -41948,9 +41929,9 @@ module.exports = function isInteger(it) { /* 192 */ /***/ (function(module, exports, __webpack_require__) { -var getKeys = __webpack_require__(46); +var getKeys = __webpack_require__(48); var toIObject = __webpack_require__(29); -var isEnum = __webpack_require__(62).f; +var isEnum = __webpack_require__(63).f; module.exports = function (isEntries) { return function (it) { var O = toIObject(it); @@ -41973,7 +41954,7 @@ module.exports = function (isEntries) { // https://github.com/tc39/proposal-string-pad-start-end var toLength = __webpack_require__(30); var repeat = __webpack_require__(189); -var defined = __webpack_require__(47); +var defined = __webpack_require__(49); module.exports = function (that, maxLength, fillString, left) { var S = String(defined(that)); @@ -42505,7 +42486,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _coords = __webpack_require__(64); +var _coords = __webpack_require__(65); var _coords2 = _interopRequireDefault(_coords); @@ -44549,9 +44530,9 @@ var _element = __webpack_require__(2); var _function = __webpack_require__(34); -var _browser = __webpack_require__(50); +var _browser = __webpack_require__(42); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -44826,9 +44807,9 @@ var _array = __webpack_require__(0); var _unicode = __webpack_require__(18); -var _browser = __webpack_require__(50); +var _browser = __webpack_require__(42); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -46066,7 +46047,7 @@ var _element = __webpack_require__(2); var _function = __webpack_require__(34); -var _coords = __webpack_require__(64); +var _coords = __webpack_require__(65); var _coords2 = _interopRequireDefault(_coords); @@ -46858,7 +46839,7 @@ var _templateObject = _taggedTemplateLiteral(['Performance tip: Handsontable ren var _element = __webpack_require__(2); -var _console = __webpack_require__(20); +var _console = __webpack_require__(22); var _templateLiteralTag = __webpack_require__(26); @@ -47606,7 +47587,7 @@ var _element = __webpack_require__(2); var _object = __webpack_require__(1); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -48165,13 +48146,13 @@ var _event = __webpack_require__(12); var _object = __webpack_require__(1); -var _browser = __webpack_require__(50); +var _browser = __webpack_require__(42); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); -var _coords = __webpack_require__(64); +var _coords = __webpack_require__(65); var _coords2 = _interopRequireDefault(_coords); @@ -48932,7 +48913,7 @@ exports.__esModule = true; var _unicode = __webpack_require__(18); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); var _string = __webpack_require__(32); @@ -49427,7 +49408,7 @@ var _element = __webpack_require__(2); var _event = __webpack_require__(12); -var _textEditor = __webpack_require__(65); +var _textEditor = __webpack_require__(66); var _textEditor2 = _interopRequireDefault(_textEditor); @@ -50577,7 +50558,7 @@ exports.handleMouseEvent = handleMouseEvent; var _event = __webpack_require__(12); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); /** * MouseDown handler. @@ -50767,7 +50748,7 @@ exports.__esModule = true; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); var _object = __webpack_require__(1); @@ -53555,11 +53536,11 @@ exports.getTranslatedPhrase = getTranslatedPhrase; var _array = __webpack_require__(0); -var _dictionariesManager = __webpack_require__(84); +var _dictionariesManager = __webpack_require__(85); -var _phraseFormatters = __webpack_require__(553); +var _phraseFormatters = __webpack_require__(552); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); /** * Get phrase for specified dictionary key. @@ -53629,15 +53610,15 @@ exports.normalizeLanguageCode = normalizeLanguageCode; exports.applyLanguageSetting = applyLanguageSetting; exports.warnUserAboutLanguageRegistration = warnUserAboutLanguageRegistration; -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); var _object = __webpack_require__(1); -var _console = __webpack_require__(20); +var _console = __webpack_require__(22); var _templateLiteralTag = __webpack_require__(26); -var _dictionariesManager = __webpack_require__(84); +var _dictionariesManager = __webpack_require__(85); function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } @@ -53753,13 +53734,13 @@ var _highlight = __webpack_require__(462); var _highlight2 = _interopRequireDefault(_highlight); -var _selection = __webpack_require__(562); +var _selection = __webpack_require__(561); var _selection2 = _interopRequireDefault(_selection); var _mouseEventHandler = __webpack_require__(456); -var _utils = __webpack_require__(86); +var _utils = __webpack_require__(87); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -53781,7 +53762,7 @@ exports.CUSTOM_SELECTION = exports.HEADER_TYPE = exports.FILL_TYPE = exports.CEL var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _types = __webpack_require__(555); +var _types = __webpack_require__(554); var _array = __webpack_require__(0); @@ -54124,7 +54105,7 @@ var _object = __webpack_require__(1); var _number = __webpack_require__(4); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } @@ -54355,1526 +54336,1647 @@ exports.default = SamplesGenerator; exports.__esModule = true; -exports.default = mergeSort; - -var _linkedList = __webpack_require__(574); - -var _linkedList2 = _interopRequireDefault(_linkedList); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Refactored implementation of mergeSort (part of javascript-algorithms project) by Github users: - * mgechev, AndriiHeonia and lekkas (part of javascript-algorithms project - all project contributors - * at repository website) - * - * Link to repository: https://github.com/mgechev/javascript-algorithms - */ - -/** - * Specifies a function that defines the sort order. The array is sorted according to each - * character's Unicode code point value, according to the string conversion of each element. - * - * @param a {*} first compared element. - * @param b {*} second compared element. - * @returns {Number} - */ -var defaultCompareFunction = function defaultCompareFunction(a, b) { - // sort lexically - - var firstValue = a.toString(); - var secondValue = b.toString(); - - if (firstValue === secondValue) { - return 0; - } else if (firstValue < secondValue) { - return -1; - } - return 1; -}; - -/** - * Mergesort method which is recursively called for sorting the input array. - * - * @param {Array} array The array which should be sorted. - * @param {Function} compareFunction Compares two items in an array. If compareFunction is not supplied, - * elements are sorted by converting them to strings and comparing strings in Unicode code point order. - * @param {Number} startIndex Left side of the subarray. - * @param {Number} endIndex Right side of the subarray. - * @returns {Array} Array with sorted subarray. - */ -function mergeSort(array) { - var compareFunction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultCompareFunction; - var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : array.length; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - if (Math.abs(endIndex - startIndex) <= 1) { - return []; - } +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - var middleIndex = Math.ceil((startIndex + endIndex) / 2); +var _element = __webpack_require__(2); - mergeSort(array, compareFunction, startIndex, middleIndex); - mergeSort(array, compareFunction, middleIndex, endIndex); +var _mixed = __webpack_require__(10); - return merge(array, compareFunction, startIndex, middleIndex, endIndex); -} +var _object = __webpack_require__(1); -/** - * Devides and sort merges two subarrays of given array - * - * @param {Array} array The array which subarrays should be sorted. - * @param {Number} startIndex The start of the first subarray. - * This subarray is with end middle - 1. - * @param {Number} middleIndex The start of the second array. - * @param {Number} endIndex end - 1 is the end of the second array. - * @returns {Array} The array with sorted subarray. - */ -function merge(array, compareFunction, startIndex, middleIndex, endIndex) { - var leftElements = new _linkedList2.default(); - var rightElements = new _linkedList2.default(); - var leftSize = middleIndex - startIndex; - var rightSize = endIndex - middleIndex; - var maxSize = Math.max(leftSize, rightSize); - var size = endIndex - startIndex; +var _array = __webpack_require__(0); - for (var _i = 0; _i < maxSize; _i += 1) { - if (_i < leftSize) { - leftElements.push(array[startIndex + _i]); - } +var _number = __webpack_require__(4); - if (_i < rightSize) { - rightElements.push(array[middleIndex + _i]); - } - } +var _base = __webpack_require__(7); - var i = 0; +var _base2 = _interopRequireDefault(_base); - while (i < size) { - if (leftElements.first && rightElements.first) { - if (compareFunction(leftElements.first.data, rightElements.first.data) > 0) { - array[startIndex + i] = rightElements.shift().data; - } else { - array[startIndex + i] = leftElements.shift().data; - } - } else if (leftElements.first) { +var _plugins = __webpack_require__(5); - array[startIndex + i] = leftElements.shift().data; - } else { +var _pluginHooks = __webpack_require__(17); - array[startIndex + i] = rightElements.shift().data; - } +var _pluginHooks2 = _interopRequireDefault(_pluginHooks); - i += 1; - } +var _keyStateObserver = __webpack_require__(86); - return array; -} +var _columnStatesManager = __webpack_require__(572); -/***/ }), -/* 465 */ -/***/ (function(module, exports, __webpack_require__) { +var _utils = __webpack_require__(160); -"use strict"; +var _domHelpers = __webpack_require__(573); +var _rowsMapper = __webpack_require__(574); -exports.__esModule = true; -exports.HEADER_SPAN_CLASS = exports.DESC_SORT_STATE = exports.ASC_SORT_STATE = undefined; -exports.areValidSortStates = areValidSortStates; -exports.getNextSortOrder = getNextSortOrder; -exports.getFullSortConfiguration = getFullSortConfiguration; -exports.warnIfPluginsHaveConflict = warnIfPluginsHaveConflict; -exports.warnAboutNotValidatedConfig = warnAboutNotValidatedConfig; -exports.getHeaderSpanElement = getHeaderSpanElement; -exports.isFirstLevelColumnHeader = isFirstLevelColumnHeader; +var _rowsMapper2 = _interopRequireDefault(_rowsMapper); -var _mixed = __webpack_require__(8); +var _rootComparator = __webpack_require__(575); -var _object = __webpack_require__(1); +var _sortService = __webpack_require__(51); -var _console = __webpack_require__(20); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var ASC_SORT_STATE = exports.ASC_SORT_STATE = 'asc'; -var DESC_SORT_STATE = exports.DESC_SORT_STATE = 'desc'; -var HEADER_SPAN_CLASS = exports.HEADER_SPAN_CLASS = 'colHeader'; +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } -/** - * Get if column state is valid. - * - * @param {Number} columnState Particular column state. - * @returns {Boolean} - */ -function isValidColumnState(columnState) { - if ((0, _mixed.isUndefined)(columnState)) { - return false; - } +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - var column = columnState.column, - sortOrder = columnState.sortOrder; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - return Number.isInteger(column) && [ASC_SORT_STATE, DESC_SORT_STATE].includes(sortOrder); -} +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -/** - * Get if all sorted columns states are valid. - * - * @param {Array} sortStates - * @returns {Boolean} - */ -function areValidSortStates(sortStates) { - if (Array.isArray(sortStates) === false || sortStates.every(function (columnState) { - return (0, _object.isObject)(columnState); - }) === false) { - return false; - } +var APPEND_COLUMN_CONFIG_STRATEGY = 'append'; +var REPLACE_COLUMN_CONFIG_STRATEGY = 'replace'; +var PLUGIN_KEY = 'columnSorting'; - var sortedColumns = sortStates.map(function (_ref) { - var column = _ref.column; - return column; - }); - var indexOccursOnlyOnce = new Set(sortedColumns).size === sortedColumns.length; +(0, _sortService.registerRootComparator)(PLUGIN_KEY, _rootComparator.rootComparator); - return indexOccursOnlyOnce && sortStates.every(isValidColumnState); -} +_pluginHooks2.default.getSingleton().register('beforeColumnSort'); +_pluginHooks2.default.getSingleton().register('afterColumnSort'); +// DIFF - MultiColumnSorting & ColumnSorting: changed configuration documentation. /** - * Get next sort order for particular column. The order sequence looks as follows: 'asc' -> 'desc' -> undefined -> 'asc' + * @plugin ColumnSorting * - * @param {String|undefined} sortOrder sort order (`asc` for ascending, `desc` for descending and undefined for not sorted). - * @returns {String|undefined} Next sort order (`asc` for ascending, `desc` for descending and undefined for not sorted). - */ -function getNextSortOrder(sortOrder) { - if (sortOrder === DESC_SORT_STATE) { - return; - } else if (sortOrder === ASC_SORT_STATE) { - return DESC_SORT_STATE; - } - - return ASC_SORT_STATE; -} - -/** - * Get multiple sorted column configs from sort configs with different data types. + * @description + * This plugin sorts the view by columns (but does not sort the data source!). To enable the plugin, set the + * {@link Options#columnSorting} property to the correct value (see the examples below). * - * @param {undefined|Object|Array} sortConfig Single column sort configuration or full sort configuration (for all sorted columns). - * The configuration object contains `column` and `sortOrder` properties. First of them contains visual column index, the second one contains - * sort order (`asc` for ascending, `desc` for descending). - * @returns {Array} - */ -function getFullSortConfiguration(sortConfig) { - if ((0, _mixed.isUndefined)(sortConfig)) { - return []; - } - - if (Array.isArray(sortConfig)) { - return sortConfig; - } - - return [sortConfig]; -} - -/** - * Warn users about problems when using `columnSorting` and `columnSorting` plugins simultaneously. + * @example + * ```js + * // as boolean + * columnSorting: true * - * @param {undefined|Boolean|Object} columnSortingSettings - */ -function warnIfPluginsHaveConflict(columnSortingSettings) { - if (columnSortingSettings) { - // DIFF - MultiColumnSorting & ColumnSorting: Warn will be called from the MultiColumnSorting plugin. - } -} - -/** - * Warn users about problems with validating sort config. - */ -function warnAboutNotValidatedConfig() { - (0, _console.warn)('Sort configuration failed to validate properly.'); -} - -/** - * Get `span` DOM element inside `th` DOM element. + * // as an object with initial sort config (sort ascending for column at index 1) + * columnSorting: { + * initialConfig: { + * column: 1, + * sortOrder: 'asc' + * } + * } * - * @param {Element} TH th HTML element. - * @returns {Element | null} - */ -function getHeaderSpanElement(TH) { - var headerSpanElement = TH.querySelector('.' + HEADER_SPAN_CLASS); - - return headerSpanElement; -} - -/** + * // as an object which define specific sorting options for all columns + * columnSorting: { + * sortEmptyCells: true, // true = the table sorts empty cells, false = the table moves all empty cells to the end of the table (by default) + * indicator: true, // true = shows indicator for all columns (by default), false = don't show indicator for columns + * headerAction: true, // true = allow to click on the headers to sort (by default), false = turn off possibility to click on the headers to sort + * compareFunctionFactory: function(sortOrder, columnMeta) { + * return function(value, nextValue) { + * // Some value comparisons which will return -1, 0 or 1... + * } + * } + * } * - * Get if handled header is first level column header. + * // as an object passed to the `column` property, allows specifying a custom options for the desired column. + * // please take a look at documentation of `column` property: https://docs.handsontable.com/pro/Options.html#columns + * columns: [{ + * columnSorting: { + * indicator: false, // disable indicator for the first column, + * sortEmptyCells: true, + * headerAction: false, // clicks on the first column won't sort + * compareFunctionFactory: function(sortOrder, columnMeta) { + * return function(value, nextValue) { + * return 0; // Custom compare function for the first column (don't sort) + * } + * } + * } + * }]``` * - * @param {Number} column Visual column index. - * @param {Element} TH th HTML element. - * @returns {Boolean} + * @dependencies ObserveChanges */ -function isFirstLevelColumnHeader(column, TH) { - if (column < 0 || !TH.parentNode) { - return false; - } - - var TRs = TH.parentNode.parentNode.childNodes; - var headerLevel = Array.from(TRs).indexOf(TH.parentNode) - TRs.length; - - if (headerLevel !== -1) { - return false; - } - - return true; -} - -/***/ }), -/* 466 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _array = __webpack_require__(0); -var _object = __webpack_require__(1); +var ColumnSorting = function (_BasePlugin) { + _inherits(ColumnSorting, _BasePlugin); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function ColumnSorting(hotInstance) { + _classCallCheck(this, ColumnSorting); -/** - * Command executor for ContextMenu. - * - * @class CommandExecutor - * @plugin ContextMenu - */ -var CommandExecutor = function () { - function CommandExecutor(hotInstance) { - _classCallCheck(this, CommandExecutor); + /** + * Instance of column state manager. + * + * @private + * @type {ColumnStatesManager} + */ + var _this2 = _possibleConstructorReturn(this, (ColumnSorting.__proto__ || Object.getPrototypeOf(ColumnSorting)).call(this, hotInstance)); - this.hot = hotInstance; - this.commands = {}; - this.commonCallback = null; + _this2.columnStatesManager = new _columnStatesManager.ColumnStatesManager(); + /** + * Object containing visual row indexes mapped to data source indexes. + * + * @private + * @type {RowsMapper} + */ + _this2.rowsMapper = new _rowsMapper2.default(_this2); + /** + * It blocks the plugin translation, this flag is checked inside `onModifyRow` callback. + * + * @private + * @type {Boolean} + */ + _this2.blockPluginTranslation = true; + /** + * Cached column properties from plugin like i.e. `indicator`, `headerAction`. + * + * @private + * @type {Map} + */ + _this2.columnMetaCache = new Map(); + /** + * Main settings key designed for the plugin. + * + * @private + * @type {String} + */ + _this2.pluginKey = PLUGIN_KEY; + return _this2; } /** - * Register command. + * Checks if the plugin is enabled in the Handsontable settings. This method is executed in {@link Hooks#beforeInit} + * hook and if it returns `true` than the {@link ColumnSorting#enablePlugin} method is called. * - * @param {String} name Command name. - * @param {Object} commandDescriptor Command descriptor object with properties like `key` (command id), - * `callback` (task to execute), `name` (command name), `disabled` (command availability). + * @returns {Boolean} */ - _createClass(CommandExecutor, [{ - key: 'registerCommand', - value: function registerCommand(name, commandDescriptor) { - this.commands[name] = commandDescriptor; + _createClass(ColumnSorting, [{ + key: 'isEnabled', + value: function isEnabled() { + return !!this.hot.getSettings()[this.pluginKey]; } /** - * Set common callback which will be trigger on every executed command. - * - * @param {Function} callback Function which will be fired on every command execute. + * Enables the plugin functionality for this Handsontable instance. */ }, { - key: 'setCommonCallback', - value: function setCommonCallback(callback) { - this.commonCallback = callback; - } + key: 'enablePlugin', + value: function enablePlugin() { + var _this3 = this; - /** - * Execute command by its name. - * - * @param {String} commandName Command id. - * @param {*} params Arguments passed to command task. - */ + if (this.enabled) { + return; + } - }, { - key: 'execute', - value: function execute(commandName) { - var _this = this; - - for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - params[_key - 1] = arguments[_key]; - } - - var commandSplit = commandName.split(':'); - var commandNamePrimary = commandSplit[0]; - - var subCommandName = commandSplit.length === 2 ? commandSplit[1] : null; - var command = this.commands[commandNamePrimary]; - - if (!command) { - throw new Error('Menu command \'' + commandNamePrimary + '\' not exists.'); - } - if (subCommandName && command.submenu) { - command = findSubCommand(subCommandName, command.submenu.items); - } - if (command.disabled === true) { - return; - } - if (typeof command.disabled === 'function' && command.disabled.call(this.hot) === true) { - return; - } - if ((0, _object.hasOwnProperty)(command, 'submenu')) { - return; + if ((0, _mixed.isUndefined)(this.hot.getSettings().observeChanges)) { + this.enableObserveChangesPlugin(); } - var callbacks = []; - if (typeof command.callback === 'function') { - callbacks.push(command.callback); - } - if (typeof this.commonCallback === 'function') { - callbacks.push(this.commonCallback); - } - params.unshift(commandSplit.join(':')); - (0, _array.arrayEach)(callbacks, function (callback) { - return callback.apply(_this.hot, params); + this.addHook('afterTrimRow', function () { + return _this3.sortByPresetSortStates(); + }); + this.addHook('afterUntrimRow', function () { + return _this3.sortByPresetSortStates(); + }); + this.addHook('modifyRow', function (row, source) { + return _this3.onModifyRow(row, source); + }); + this.addHook('unmodifyRow', function (row, source) { + return _this3.onUnmodifyRow(row, source); + }); + this.addHook('afterGetColHeader', function (column, TH) { + return _this3.onAfterGetColHeader(column, TH); + }); + this.addHook('beforeOnCellMouseDown', function (event, coords, TD, controller) { + return _this3.onBeforeOnCellMouseDown(event, coords, TD, controller); + }); + this.addHook('afterOnCellMouseDown', function (event, target) { + return _this3.onAfterOnCellMouseDown(event, target); + }); + this.addHook('afterCreateRow', function (index, amount) { + return _this3.onAfterCreateRow(index, amount); + }); + this.addHook('afterRemoveRow', function (index, amount) { + return _this3.onAfterRemoveRow(index, amount); + }); + this.addHook('afterInit', function () { + return _this3.loadOrSortBySettings(); + }); + this.addHook('afterLoadData', function (initialLoad) { + return _this3.onAfterLoadData(initialLoad); + }); + this.addHook('afterCreateCol', function () { + return _this3.onAfterCreateCol(); + }); + this.addHook('afterRemoveCol', function () { + return _this3.onAfterRemoveCol(); }); - } - }]); - - return CommandExecutor; -}(); - -function findSubCommand(subCommandName, subCommands) { - var command = void 0; - - (0, _array.arrayEach)(subCommands, function (cmd) { - var cmds = cmd.key ? cmd.key.split(':') : null; - if (Array.isArray(cmds) && cmds[1] === subCommandName) { - command = cmd; + // TODO: Workaround? It should be refactored / described. + if (this.hot.view) { + this.loadOrSortBySettings(); + } - return false; + _get(ColumnSorting.prototype.__proto__ || Object.getPrototypeOf(ColumnSorting.prototype), 'enablePlugin', this).call(this); } - }); - - return command; -} -exports.default = CommandExecutor; + /** + * Disables the plugin functionality for this Handsontable instance. + */ -/***/ }), -/* 467 */ -/***/ (function(module, exports, __webpack_require__) { + }, { + key: 'disablePlugin', + value: function disablePlugin() { + var _this4 = this; -"use strict"; + var clearColHeader = function clearColHeader(column, TH) { + var headerSpanElement = (0, _utils.getHeaderSpanElement)(TH); + if ((0, _utils.isFirstLevelColumnHeader)(column, TH) === false || headerSpanElement === null) { + return; + } -exports.__esModule = true; + _this4.updateHeaderClasses(headerSpanElement); + }; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + // Changing header width and removing indicator. + this.hot.addHook('afterGetColHeader', clearColHeader); + this.hot.addHookOnce('afterRender', function () { + _this4.hot.removeHook('afterGetColHeader', clearColHeader); + }); -var _object = __webpack_require__(1); + this.rowsMapper.clearMap(); -var _array = __webpack_require__(0); + _get(ColumnSorting.prototype.__proto__ || Object.getPrototypeOf(ColumnSorting.prototype), 'disablePlugin', this).call(this); + } -var _predefinedItems = __webpack_require__(43); + // DIFF - MultiColumnSorting & ColumnSorting: changed function documentation. + /** + * Sorts the table by chosen columns and orders. + * + * @param {undefined|Object} sortConfig Single column sort configuration. The configuration object contains `column` and `sortOrder` properties. + * First of them contains visual column index, the second one contains sort order (`asc` for ascending, `desc` for descending). + * + * **Note**: Please keep in mind that every call of `sort` function set an entirely new sort order. Previous sort configs aren't preserved. + * + * @example + * ```js + * // sort ascending first visual column + * hot.getPlugin('columnSorting').sort({ column: 0, sortOrder: 'asc' }); + * ``` + * + * @fires Hooks#beforeColumnSort + * @fires Hooks#afterColumnSort + */ -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + }, { + key: 'sort', + value: function sort(sortConfig) { + var _this5 = this; -/** - * Predefined items class factory for menu items. - * - * @class ItemsFactory - * @plugin ContextMenu - */ -var ItemsFactory = function () { - function ItemsFactory(hotInstance) { - var orderPattern = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + var currentSortConfig = this.getSortConfig(); - _classCallCheck(this, ItemsFactory); + // We always pass configs defined as an array to `beforeColumnSort` and `afterColumnSort` hooks. + var destinationSortConfigs = this.getNormalizedSortConfigs(sortConfig); - this.hot = hotInstance; - this.predefinedItems = (0, _predefinedItems.predefinedItems)(); - this.defaultOrderPattern = orderPattern; - } + var sortPossible = this.areValidSortConfigs(destinationSortConfigs); + var allowSort = this.hot.runHooks('beforeColumnSort', currentSortConfig, destinationSortConfigs, sortPossible); - /** - * Set predefined items. - * - * @param {Array} predefinedItemsCollection Array of predefined items. - */ + if (allowSort === false) { + return; + } + if (sortPossible) { + var translateColumnToPhysical = function translateColumnToPhysical(_ref) { + var visualColumn = _ref.column, + restOfProperties = _objectWithoutProperties(_ref, ['column']); - _createClass(ItemsFactory, [{ - key: 'setPredefinedItems', - value: function setPredefinedItems(predefinedItemsCollection) { - var _this = this; + return Object.assign({ column: _this5.hot.toPhysicalColumn(visualColumn) }, restOfProperties); + }; + var internalSortStates = (0, _array.arrayMap)(destinationSortConfigs, function (columnSortConfig) { + return translateColumnToPhysical(columnSortConfig); + }); - var items = {}; + this.columnStatesManager.setSortStates(internalSortStates); + this.sortByPresetSortStates(); + this.saveAllSortSettings(); - this.defaultOrderPattern.length = 0; + this.hot.render(); + this.hot.view.wt.draw(true); // TODO: Workaround? One test won't pass after removal. It should be refactored / described. + } - (0, _object.objectEach)(predefinedItemsCollection, function (value, key) { - var menuItemKey = ''; + this.hot.runHooks('afterColumnSort', currentSortConfig, this.getSortConfig(), sortPossible); + } - if (value.name === _predefinedItems.SEPARATOR) { - items[_predefinedItems.SEPARATOR] = value; - menuItemKey = _predefinedItems.SEPARATOR; + /** + * Clear the sort performed on the table. + */ - // Menu item added as a property to array - } else if (isNaN(parseInt(key, 10))) { - value.key = value.key === void 0 ? key : value.key; - items[key] = value; - menuItemKey = value.key; - } else { - items[value.key] = value; - menuItemKey = value.key; - } - _this.defaultOrderPattern.push(menuItemKey); - }); - this.predefinedItems = items; + }, { + key: 'clearSort', + value: function clearSort() { + this.sort([]); } /** - * Get all menu items based on pattern. + * Checks if the table is sorted (any column have to be sorted). * - * @param {Array|Object|Boolean} pattern Pattern which you can define by displaying menu items order. If `true` default - * pattern will be used. - * @returns {Array} + * @returns {Boolean} */ }, { - key: 'getItems', - value: function getItems() { - var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - return _getItems(pattern, this.defaultOrderPattern, this.predefinedItems); + key: 'isSorted', + value: function isSorted() { + return this.enabled && !this.columnStatesManager.isListOfSortedColumnsEmpty(); } - }]); - return ItemsFactory; -}(); + /** + * Get sort configuration for particular column or for all sorted columns. Objects contain `column` and `sortOrder` properties. + * + * **Note**: Please keep in mind that returned objects expose **visual** column index under the `column` key. They are handled by the `sort` function. + * + * @param {Number} [column] Visual column index. + * @returns {undefined|Object|Array} + */ -function _getItems() { - var itemsPattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var defaultPattern = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - var items = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + }, { + key: 'getSortConfig', + value: function getSortConfig(column) { + var _this6 = this; - var result = []; - var pattern = itemsPattern; + var translateColumnToVisual = function translateColumnToVisual(_ref2) { + var physicalColumn = _ref2.column, + restOfProperties = _objectWithoutProperties(_ref2, ['column']); - if (pattern && pattern.items) { - pattern = pattern.items; - } else if (!Array.isArray(pattern)) { - pattern = defaultPattern; - } - if ((0, _object.isObject)(pattern)) { - (0, _object.objectEach)(pattern, function (value, key) { - var item = items[typeof value === 'string' ? value : key]; + return Object.assign({ column: _this6.hot.toVisualColumn(physicalColumn) }, restOfProperties); + }; - if (!item) { - item = value; - } - if ((0, _object.isObject)(value)) { - (0, _object.extend)(item, value); - } else if (typeof item === 'string') { - item = { name: item }; - } - if (item.key === void 0) { - item.key = key; - } - result.push(item); - }); - } else { - (0, _array.arrayEach)(pattern, function (name, key) { - var item = items[name]; + if ((0, _mixed.isDefined)(column)) { + var physicalColumn = this.hot.toPhysicalColumn(column); + var columnSortState = this.columnStatesManager.getColumnSortState(physicalColumn); + + if ((0, _mixed.isDefined)(columnSortState)) { + return translateColumnToVisual(columnSortState); + } - // Item deleted from settings `allowInsertRow: false` etc. - if (!item && _predefinedItems.ITEMS.indexOf(name) >= 0) { return; } - if (!item) { - item = { name: name, key: '' + key }; - } - if ((0, _object.isObject)(name)) { - (0, _object.extend)(item, name); - } - if (item.key === void 0) { - item.key = key; - } - result.push(item); - }); - } - - return result; -} - -exports.default = ItemsFactory; - -/***/ }), -/* 468 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -exports.__esModule = true; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _number = __webpack_require__(4); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var STATE_INITIALIZED = 0; -var STATE_BUILT = 1; -var STATE_APPENDED = 2; -var UNIT = 'px'; - -/** - * @class - * @private - */ + var sortStates = this.columnStatesManager.getSortStates(); -var BaseUI = function () { - function BaseUI(hotInstance) { - _classCallCheck(this, BaseUI); + return (0, _array.arrayMap)(sortStates, function (columnState) { + return translateColumnToVisual(columnState); + }); + } /** - * Instance of Handsontable. + * @description + * Warn: Useful mainly for providing server side sort implementation (see in the example below). It doesn't sort the data set. It just sets sort configuration for all sorted columns. * - * @type {Core} - */ - this.hot = hotInstance; - /** - * DOM element representing the ui element. + * @example + * ```js + * beforeColumnSort: function(currentSortConfig, destinationSortConfigs) { + * const columnSortPlugin = this.getPlugin('columnSorting'); * - * @type {HTMLElement} - * @private - */ - this._element = null; - /** - * Flag which determines build state of element. + * columnSortPlugin.setSortConfig(destinationSortConfigs); * - * @type {Boolean} + * // const newData = ... // Calculated data set, ie. from an AJAX call. + * + * // this.loadData(newData); // Load new data set. + * + * return false; // The blockade for the default sort action. + * }``` + * + * @param {undefined|Object|Array} sortConfig Single column sort configuration or full sort configuration (for all sorted columns). + * The configuration object contains `column` and `sortOrder` properties. First of them contains visual column index, the second one contains + * sort order (`asc` for ascending, `desc` for descending). */ - this.state = STATE_INITIALIZED; - } - - /** - * Add created UI elements to table. - * - * @param {HTMLElement} wrapper Element which are parent for our UI element. - */ + }, { + key: 'setSortConfig', + value: function setSortConfig(sortConfig) { + var _this7 = this; - _createClass(BaseUI, [{ - key: 'appendTo', - value: function appendTo(wrapper) { - wrapper.appendChild(this._element); + // We always set configs defined as an array. + var destinationSortConfigs = this.getNormalizedSortConfigs(sortConfig); - this.state = STATE_APPENDED; - } + if (this.areValidSortConfigs(destinationSortConfigs)) { + var translateColumnToPhysical = function translateColumnToPhysical(_ref3) { + var visualColumn = _ref3.column, + restOfProperties = _objectWithoutProperties(_ref3, ['column']); - /** - * Method for create UI element. Only create, without append to table. - */ + return Object.assign({ column: _this7.hot.toPhysicalColumn(visualColumn) }, restOfProperties); + }; + var internalSortStates = (0, _array.arrayMap)(destinationSortConfigs, function (columnSortConfig) { + return translateColumnToPhysical(columnSortConfig); + }); - }, { - key: 'build', - value: function build() { - this._element = document.createElement('div'); - this.state = STATE_BUILT; + this.columnStatesManager.setSortStates(internalSortStates); + } } /** - * Method for remove UI element. + * Get normalized sort configs. + * + * @private + * @param {Object|Array} [sortConfig=[]] Single column sort configuration or full sort configuration (for all sorted columns). + * The configuration object contains `column` and `sortOrder` properties. First of them contains visual column index, the second one contains + * sort order (`asc` for ascending, `desc` for descending). + * @returns {Array} */ }, { - key: 'destroy', - value: function destroy() { - if (this.isAppended()) { - this._element.parentElement.removeChild(this._element); + key: 'getNormalizedSortConfigs', + value: function getNormalizedSortConfigs() { + var sortConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + if (Array.isArray(sortConfig)) { + return sortConfig.slice(0, 1); } - this._element = null; - this.state = STATE_INITIALIZED; + return [sortConfig].slice(0, 1); } /** - * Check if UI element are appended. + * Get if sort configs are valid. * + * @private + * @param {Array} sortConfigs Sort configuration for all sorted columns. Objects contain `column` and `sortOrder` properties. * @returns {Boolean} */ }, { - key: 'isAppended', - value: function isAppended() { - return this.state === STATE_APPENDED; + key: 'areValidSortConfigs', + value: function areValidSortConfigs(sortConfigs) { + if (Array.isArray(sortConfigs) === false) { + return false; + } + + var sortedColumns = sortConfigs.map(function (_ref4) { + var column = _ref4.column; + return column; + }); + var numberOfColumns = this.hot.countCols(); + var onlyExistingVisualIndexes = sortedColumns.every(function (visualColumn) { + return visualColumn <= numberOfColumns && visualColumn >= 0; + }); + + return (0, _utils.areValidSortStates)(sortConfigs) && onlyExistingVisualIndexes; // We don't translate visual indexes to physical indexes. } /** - * Check if UI element are built. + * Saves all sorting settings. Saving works only when {@link Options#persistentState} option is enabled. * - * @returns {Boolean} + * @private + * @fires Hooks#persistentStateSave */ }, { - key: 'isBuilt', - value: function isBuilt() { - return this.state >= STATE_BUILT; + key: 'saveAllSortSettings', + value: function saveAllSortSettings() { + var allSortSettings = this.columnStatesManager.getAllColumnsProperties(); + + allSortSettings.initialConfig = this.columnStatesManager.getSortStates(); + + this.hot.runHooks('persistentStateSave', 'columnSorting', allSortSettings); } /** - * Setter for position. + * Get all saved sorting settings. Loading works only when {@link Options#persistentState} option is enabled. * - * @param {Number} top New top position of the element. - * @param {Number} left New left position of the element. + * @private + * @returns {Object} Previously saved sort settings. + * + * @fires Hooks#persistentStateLoad */ }, { - key: 'setPosition', - value: function setPosition(top, left) { - if ((0, _number.isNumeric)(top)) { - this._element.style.top = top + UNIT; - } - if ((0, _number.isNumeric)(left)) { - this._element.style.left = left + UNIT; + key: 'getAllSavedSortSettings', + value: function getAllSavedSortSettings() { + var _this8 = this; + + var storedAllSortSettings = {}; + + this.hot.runHooks('persistentStateLoad', 'columnSorting', storedAllSortSettings); + + var allSortSettings = storedAllSortSettings.value; + var translateColumnToVisual = function translateColumnToVisual(_ref5) { + var physicalColumn = _ref5.column, + restOfProperties = _objectWithoutProperties(_ref5, ['column']); + + return Object.assign({ column: _this8.hot.toVisualColumn(physicalColumn) }, restOfProperties); + }; + + if ((0, _mixed.isDefined)(allSortSettings) && Array.isArray(allSortSettings.initialConfig)) { + allSortSettings.initialConfig = (0, _array.arrayMap)(allSortSettings.initialConfig, translateColumnToVisual); } + + return allSortSettings; } /** - * Getter for the element position. + * Get next sort configuration for particular column. Object contain `column` and `sortOrder` properties. * - * @returns {Object} Object contains left and top position of the element. + * **Note**: Please keep in mind that returned object expose **visual** column index under the `column` key. + * + * @private + * @param {Number} column Visual column index. + * @returns {undefined|Object} */ }, { - key: 'getPosition', - value: function getPosition() { - return { - top: this._element.style.top ? parseInt(this._element.style.top, 10) : 0, - left: this._element.style.left ? parseInt(this._element.style.left, 10) : 0 - }; + key: 'getColumnNextConfig', + value: function getColumnNextConfig(column) { + var physicalColumn = this.hot.toPhysicalColumn(column); + + if (this.columnStatesManager.isColumnSorted(physicalColumn)) { + var columnSortConfig = this.getSortConfig(column); + var sortOrder = (0, _utils.getNextSortOrder)(columnSortConfig.sortOrder); + + if ((0, _mixed.isDefined)(sortOrder)) { + columnSortConfig.sortOrder = sortOrder; + + return columnSortConfig; + } + + return; + } + + var nrOfColumns = this.hot.countCols(); + + if (Number.isInteger(column) && column >= 0 && column < nrOfColumns) { + return { + column: column, + sortOrder: (0, _utils.getNextSortOrder)() + }; + } } /** - * Setter for the element size. + * Get sort configuration with "next order" for particular column. * - * @param {Number} width New width of the element. - * @param {Number} height New height of the element. + * @private + * @param {Number} columnToChange Visual column index of column which order will be changed. + * @param {String} strategyId ID of strategy. Possible values: 'append' and 'replace'. The first one + * change order of particular column and change it's position in the sort queue to the last one. The second one + * just change order of particular column. + * + * **Note**: Please keep in mind that returned objects expose **visual** column index under the `column` key. + * + * @returns {Array} */ }, { - key: 'setSize', - value: function setSize(width, height) { - if ((0, _number.isNumeric)(width)) { - this._element.style.width = width + UNIT; + key: 'getNextSortConfig', + value: function getNextSortConfig(columnToChange) { + var strategyId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : APPEND_COLUMN_CONFIG_STRATEGY; + + var physicalColumn = this.hot.toPhysicalColumn(columnToChange); + var indexOfColumnToChange = this.columnStatesManager.getIndexOfColumnInSortQueue(physicalColumn); + var isColumnSorted = this.columnStatesManager.isColumnSorted(physicalColumn); + var currentSortConfig = this.getSortConfig(); + var nextColumnConfig = this.getColumnNextConfig(columnToChange); + + if (isColumnSorted) { + if ((0, _mixed.isUndefined)(nextColumnConfig)) { + return [].concat(_toConsumableArray(currentSortConfig.slice(0, indexOfColumnToChange)), _toConsumableArray(currentSortConfig.slice(indexOfColumnToChange + 1))); + } + + if (strategyId === APPEND_COLUMN_CONFIG_STRATEGY) { + return [].concat(_toConsumableArray(currentSortConfig.slice(0, indexOfColumnToChange)), _toConsumableArray(currentSortConfig.slice(indexOfColumnToChange + 1)), [nextColumnConfig]); + } else if (strategyId === REPLACE_COLUMN_CONFIG_STRATEGY) { + return [].concat(_toConsumableArray(currentSortConfig.slice(0, indexOfColumnToChange)), [nextColumnConfig], _toConsumableArray(currentSortConfig.slice(indexOfColumnToChange + 1))); + } } - if ((0, _number.isNumeric)(height)) { - this._element.style.height = height + UNIT; + + if ((0, _mixed.isDefined)(nextColumnConfig)) { + return currentSortConfig.concat(nextColumnConfig); } + + return currentSortConfig; } /** - * Getter for the element position. + * Saves to cache part of plugins related properties, properly merged from cascade settings. * - * @returns {Object} Object contains height and width of the element. + * @private + * @param {Number} column Visual column index. + * @returns {Object} */ + // TODO: Workaround. Inheriting of non-primitive cell meta values doesn't work. Using this function we don't count + // merged properties few times. }, { - key: 'getSize', - value: function getSize() { - return { - width: this._element.style.width ? parseInt(this._element.style.width, 10) : 0, - height: this._element.style.height ? parseInt(this._element.style.height, 10) : 0 - }; + key: 'setMergedPluginSettings', + value: function setMergedPluginSettings(column) { + var physicalColumnIndex = this.hot.toPhysicalColumn(column); + var pluginMainSettings = this.hot.getSettings()[this.pluginKey]; + var storedColumnProperties = this.columnStatesManager.getAllColumnsProperties(); + var cellMeta = this.hot.getCellMeta(0, column); + var columnMeta = Object.getPrototypeOf(cellMeta); + var columnMetaHasPluginSettings = Object.hasOwnProperty.call(columnMeta, this.pluginKey); + var pluginColumnConfig = columnMetaHasPluginSettings ? columnMeta[this.pluginKey] : {}; + + this.columnMetaCache.set(physicalColumnIndex, Object.assign(storedColumnProperties, pluginMainSettings, pluginColumnConfig)); } /** - * Setter for the element offset. Offset means marginTop and marginLeft of the element. + * Get copy of settings for first cell in the column. * - * @param {Number} top New margin top of the element. - * @param {Number} left New margin left of the element. + * @private + * @param {Number} column Visual column index. + * @returns {Object} */ + // TODO: Workaround. Inheriting of non-primitive cell meta values doesn't work. Instead of getting properties from + // column meta we call this function. }, { - key: 'setOffset', - value: function setOffset(top, left) { - if ((0, _number.isNumeric)(top)) { - this._element.style.marginTop = top + UNIT; - } - if ((0, _number.isNumeric)(left)) { - this._element.style.marginLeft = left + UNIT; + key: 'getFirstCellSettings', + value: function getFirstCellSettings(column) { + var _this9 = this; + + // TODO: Remove test named: "should not break the dataset when inserted new row" (#5431). + var actualBlockTranslationFlag = this.blockPluginTranslation; + + this.blockPluginTranslation = true; + + if (this.columnMetaCache.size === 0) { + var numberOfColumns = this.hot.countCols(); + + (0, _number.rangeEach)(numberOfColumns, function (visualColumnIndex) { + return _this9.setMergedPluginSettings(visualColumnIndex); + }); } + + var cellMeta = this.hot.getCellMeta(0, column); + + this.blockPluginTranslation = actualBlockTranslationFlag; + + var cellMetaCopy = Object.create(cellMeta); + cellMetaCopy[this.pluginKey] = this.columnMetaCache.get(this.hot.toPhysicalColumn(column)); + + return cellMetaCopy; } /** - * Getter for the element offset. + * Get number of rows which should be sorted. * - * @returns {Object} Object contains top and left offset of the element. + * @private + * @param {Number} numberOfRows Total number of displayed rows. + * @returns {Number} */ }, { - key: 'getOffset', - value: function getOffset() { - return { - top: this._element.style.marginTop ? parseInt(this._element.style.marginTop, 10) : 0, - left: this._element.style.marginLeft ? parseInt(this._element.style.marginLeft, 10) : 0 - }; + key: 'getNumberOfRowsToSort', + value: function getNumberOfRowsToSort(numberOfRows) { + var settings = this.hot.getSettings(); + + // `maxRows` option doesn't take into account `minSpareRows` option in this case. + if (settings.maxRows <= numberOfRows) { + return settings.maxRows; + } + + return numberOfRows - settings.minSpareRows; } - }]); - return BaseUI; -}(); + /** + * Performs the sorting using a stable sort function basing on internal state of sorting. + * + * @private + */ -exports.default = BaseUI; + }, { + key: 'sortByPresetSortStates', + value: function sortByPresetSortStates() { + var _this10 = this; -/***/ }), -/* 469 */ -/***/ (function(module, exports, __webpack_require__) { + if (this.columnStatesManager.isListOfSortedColumnsEmpty()) { + this.rowsMapper.clearMap(); -"use strict"; + return; + } + var indexesWithData = []; + var sortedColumnsList = this.columnStatesManager.getSortedColumns(); + var numberOfRows = this.hot.countRows(); -exports.__esModule = true; + // Function `getDataAtCell` won't call the indices translation inside `onModifyRow` callback - we check the `blockPluginTranslation` + // flag inside it (we just want to get data not already modified by `columnSorting` plugin translation). + this.blockPluginTranslation = true; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var getDataForSortedColumns = function getDataForSortedColumns(visualRowIndex) { + return (0, _array.arrayMap)(sortedColumnsList, function (physicalColumn) { + return _this10.hot.getDataAtCell(visualRowIndex, _this10.hot.toVisualColumn(physicalColumn)); + }); + }; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + for (var visualRowIndex = 0; visualRowIndex < this.getNumberOfRowsToSort(numberOfRows); visualRowIndex += 1) { + indexesWithData.push([visualRowIndex].concat(getDataForSortedColumns(visualRowIndex))); + } -var STATE_INITIALIZED = 0; -var STATE_BUILT = 1; -var STATE_APPENDED = 2; -var UNIT = 'px'; + (0, _sortService.sort)(indexesWithData, this.pluginKey, (0, _array.arrayMap)(sortedColumnsList, function (physicalColumn) { + return _this10.columnStatesManager.getSortOrderOfColumn(physicalColumn); + }), (0, _array.arrayMap)(sortedColumnsList, function (physicalColumn) { + return _this10.getFirstCellSettings(_this10.hot.toVisualColumn(physicalColumn)); + })); -/** - * @class - * @private - */ + // Append spareRows + for (var _visualRowIndex = indexesWithData.length; _visualRowIndex < numberOfRows; _visualRowIndex += 1) { + indexesWithData.push([_visualRowIndex].concat(getDataForSortedColumns(_visualRowIndex))); + } -var BaseUI = function () { - function BaseUI(hotInstance) { - _classCallCheck(this, BaseUI); + // The blockade of the indices translation is released. + this.blockPluginTranslation = false; + + // Save all indexes to arrayMapper, a completely new sequence is set by the plugin + this.rowsMapper._arrayMap = (0, _array.arrayMap)(indexesWithData, function (indexWithData) { + return indexWithData[0]; + }); + } /** - * Instance of Handsontable. + * Load saved settings or sort by predefined plugin configuration. * - * @type {Core} + * @private */ - this.hot = hotInstance; + + }, { + key: 'loadOrSortBySettings', + value: function loadOrSortBySettings() { + this.columnMetaCache.clear(); + + var storedAllSortSettings = this.getAllSavedSortSettings(); + + if ((0, _object.isObject)(storedAllSortSettings)) { + this.sortBySettings(storedAllSortSettings); + } else { + var allSortSettings = this.hot.getSettings()[this.pluginKey]; + + this.sortBySettings(allSortSettings); + } + } + /** - * DOM element representing the ui element. + * Sort the table by provided configuration. * - * @type {HTMLElement} * @private + * @param {Object} allSortSettings All sort config settings. Object may contain `initialConfig`, `indicator`, + * `sortEmptyCells`, `headerAction` and `compareFunctionFactory` properties. */ - this._element = null; + + }, { + key: 'sortBySettings', + value: function sortBySettings(allSortSettings) { + if ((0, _object.isObject)(allSortSettings)) { + this.columnStatesManager.updateAllColumnsProperties(allSortSettings); + + var initialConfig = allSortSettings.initialConfig; + + if (Array.isArray(initialConfig) || (0, _object.isObject)(initialConfig)) { + this.sort(initialConfig); + } + } else { + // Extra render for headers. Their width may change. + this.hot.render(); + } + } + /** - * Flag which determines build state of element. + * Enables the ObserveChanges plugin. * - * @type {Boolean} + * @private */ - this.state = STATE_INITIALIZED; - } - /** - * Add created UI elements to table. - * - * @param {HTMLElement} wrapper Element which are parent for our UI element. - */ + }, { + key: 'enableObserveChangesPlugin', + value: function enableObserveChangesPlugin() { + var _this = this; + this.hot._registerTimeout(setTimeout(function () { + _this.hot.updateSettings({ + observeChanges: true + }); + }, 0)); + } - _createClass(BaseUI, [{ - key: 'appendTo', - value: function appendTo(wrapper) { - wrapper.appendChild(this._element); + /** + * Callback for `modifyRow` hook. Translates visual row index to the sorted row index. + * + * @private + * @param {Number} row Visual row index. + * @returns {Number} Physical row index. + */ - this.state = STATE_APPENDED; + }, { + key: 'onModifyRow', + value: function onModifyRow(row, source) { + if (this.blockPluginTranslation === false && source !== this.pluginName && this.isSorted()) { + var rowInMapper = this.rowsMapper.getValueByIndex(row); + row = rowInMapper === null ? row : rowInMapper; + } + + return row; } /** - * Method for create UI element. Only create, without append to table. + * Callback for `unmodifyRow` hook. Translates sorted row index to visual row index. + * + * @private + * @param {Number} row Physical row index. + * @returns {Number} Visual row index. */ }, { - key: 'build', - value: function build() { - this._element = document.createElement('div'); - this.state = STATE_BUILT; + key: 'onUnmodifyRow', + value: function onUnmodifyRow(row, source) { + if (this.blockPluginTranslation === false && source !== this.pluginName && this.isSorted()) { + row = this.rowsMapper.getIndexByValue(row); + } + + return row; } /** - * Method for remove UI element. + * Callback for the `onAfterGetColHeader` hook. Adds column sorting CSS classes. + * + * @private + * @param {Number} column Visual column index. + * @param {Element} TH TH HTML element. */ }, { - key: 'destroy', - value: function destroy() { - if (this.isAppended()) { - this._element.parentElement.removeChild(this._element); + key: 'onAfterGetColHeader', + value: function onAfterGetColHeader(column, TH) { + var headerSpanElement = (0, _utils.getHeaderSpanElement)(TH); + + if ((0, _utils.isFirstLevelColumnHeader)(column, TH) === false || headerSpanElement === null) { + return; } - this._element = null; - this.state = STATE_INITIALIZED; + var physicalColumn = this.hot.toPhysicalColumn(column); + var pluginSettingsForColumn = this.getFirstCellSettings(column)[this.pluginKey]; + var showSortIndicator = pluginSettingsForColumn.indicator; + var headerActionEnabled = pluginSettingsForColumn.headerAction; + + this.updateHeaderClasses(headerSpanElement, this.columnStatesManager, physicalColumn, showSortIndicator, headerActionEnabled); } /** - * Check if UI element are appended. + * Update header classes. * - * @returns {Boolean} + * @private + * @param {HTMLElement} headerSpanElement Header span element. + * @param {...*} args Extra arguments for helpers. */ }, { - key: 'isAppended', - value: function isAppended() { - return this.state === STATE_APPENDED; + key: 'updateHeaderClasses', + value: function updateHeaderClasses(headerSpanElement) { + (0, _element.removeClass)(headerSpanElement, (0, _domHelpers.getClassedToRemove)(headerSpanElement)); + + if (this.enabled !== false) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + (0, _element.addClass)(headerSpanElement, _domHelpers.getClassesToAdd.apply(undefined, args)); + } } /** - * Check if UI element are built. + * Overwriting base plugin's `onUpdateSettings` method. Please keep in mind that `onAfterUpdateSettings` isn't called + * for `updateSettings` in specific situations. * - * @returns {Boolean} + * @private + * @param {Object} newSettings New settings object. */ }, { - key: 'isBuilt', - value: function isBuilt() { - return this.state >= STATE_BUILT; + key: 'onUpdateSettings', + value: function onUpdateSettings(newSettings) { + _get(ColumnSorting.prototype.__proto__ || Object.getPrototypeOf(ColumnSorting.prototype), 'onUpdateSettings', this).call(this); + + this.columnMetaCache.clear(); + + if ((0, _mixed.isDefined)(newSettings[this.pluginKey])) { + this.sortBySettings(newSettings[this.pluginKey]); + } } /** - * Setter for position. + * Callback for the `afterLoadData` hook. * - * @param {Number} top New top position of the element. - * @param {Number} left New left position of the element. + * @private + * @param {Boolean} initialLoad flag that determines whether the data has been loaded during the initialization. */ }, { - key: 'setPosition', - value: function setPosition(top, left) { - if (top !== void 0) { - this._element.style.top = top + UNIT; - } - if (left !== void 0) { - this._element.style.left = left + UNIT; + key: 'onAfterLoadData', + value: function onAfterLoadData(initialLoad) { + this.rowsMapper.clearMap(); + + if (initialLoad === true) { + // TODO: Workaround? It should be refactored / described. + if (this.hot.view) { + this.loadOrSortBySettings(); + } } } /** - * Getter for the element position. + * Callback for the `afterCreateRow` hook. * - * @returns {Object} Object contains left and top position of the element. + * @private + * @param {Number} index Visual index of the created row. + * @param {Number} amount Amount of created rows. */ }, { - key: 'getPosition', - value: function getPosition() { - return { - top: this._element.style.top ? parseInt(this._element.style.top, 10) : 0, - left: this._element.style.left ? parseInt(this._element.style.left, 10) : 0 - }; + key: 'onAfterCreateRow', + value: function onAfterCreateRow(index, amount) { + this.rowsMapper.shiftItems(index, amount); } /** - * Setter for the element size. + * Callback for the `afterRemoveRow` hook. * - * @param {Number} width New width of the element. - * @param {Number} height New height of the element. + * @private + * @param {Number} removedRows Visual indexes of the removed row. + * @param {Number} amount Amount of removed rows. */ }, { - key: 'setSize', - value: function setSize(width, height) { - if (width) { - this._element.style.width = width + UNIT; - } - if (height) { - this._element.style.height = height + UNIT; - } + key: 'onAfterRemoveRow', + value: function onAfterRemoveRow(removedRows, amount) { + this.rowsMapper.unshiftItems(removedRows, amount); } + // TODO: Workaround. Inheriting of non-primitive cell meta values doesn't work. We clear the cache after action which reorganize sequence of columns. + // TODO: Remove test named: "should add new columns properly when the `columnSorting` plugin is enabled (inheriting of non-primitive cell meta values)". /** - * Getter for the element position. + * Callback for the `afterCreateCol` hook. * - * @returns {Object} Object contains height and width of the element. + * @private */ }, { - key: 'getSize', - value: function getSize() { - return { - width: this._element.style.width ? parseInt(this._element.style.width, 10) : 0, - height: this._element.style.height ? parseInt(this._element.style.height, 10) : 0 - }; + key: 'onAfterCreateCol', + value: function onAfterCreateCol() { + this.columnMetaCache.clear(); } + // TODO: Workaround. Inheriting of non-primitive cell meta values doesn't work. We clear the cache after action which reorganize sequence of columns. + // TODO: Remove test named: "should add new columns properly when the `columnSorting` plugin is enabled (inheriting of non-primitive cell meta values)". /** - * Setter for the element offset. Offset means marginTop and marginLeft of the element. + * Callback for the `afterRemoveCol` hook. * - * @param {Number} top New margin top of the element. - * @param {Number} left New margin left of the element. + * @private */ }, { - key: 'setOffset', - value: function setOffset(top, left) { - if (top) { - this._element.style.marginTop = top + UNIT; - } - if (left) { - this._element.style.marginLeft = left + UNIT; - } + key: 'onAfterRemoveCol', + value: function onAfterRemoveCol() { + this.columnMetaCache.clear(); } /** - * Getter for the element offset. + * Indicates if clickable header was clicked. * - * @returns {Object} Object contains top and left offset of the element. + * @private + * @param {MouseEvent} event The `mousedown` event. + * @param {Number} column Visual column index. + * @returns {Boolean} */ }, { - key: 'getOffset', - value: function getOffset() { - return { - top: this._element.style.marginTop ? parseInt(this._element.style.marginTop, 10) : 0, - left: this._element.style.marginLeft ? parseInt(this._element.style.marginLeft, 10) : 0 - }; - } - }]); + key: 'wasClickableHeaderClicked', + value: function wasClickableHeaderClicked(event, column) { + var pluginSettingsForColumn = this.getFirstCellSettings(column)[this.pluginKey]; + var headerActionEnabled = pluginSettingsForColumn.headerAction; - return BaseUI; -}(); + return headerActionEnabled && event.realTarget.nodeName === 'SPAN'; + } -exports.default = BaseUI; + /** + * Changes the behavior of selection / dragging. + * + * @private + * @param {MouseEvent} event The `mousedown` event. + * @param {CellCoords} coords Visual coordinates. + * @param {HTMLElement} TD + * @param {Object} blockCalculations + */ -/***/ }), -/* 470 */ -/***/ (function(module, exports, __webpack_require__) { + }, { + key: 'onBeforeOnCellMouseDown', + value: function onBeforeOnCellMouseDown(event, coords, TD, blockCalculations) { + if ((0, _utils.wasHeaderClickedProperly)(coords.row, coords.col, event) === false) { + return; + } -"use strict"; + if (this.wasClickableHeaderClicked(event, coords.col) && (0, _keyStateObserver.isPressedCtrlKey)()) { + blockCalculations.column = true; + } + } + /** + * Callback for the `onAfterOnCellMouseDown` hook. + * + * @private + * @param {Event} event Event which are provided by hook. + * @param {CellCoords} coords Visual coords of the selected cell. + */ -exports.__esModule = true; -exports.applySpanProperties = applySpanProperties; -/** - * Apply the `colspan`/`rowspan` properties. - * - * @param {HTMLElement} TD The soon-to-be-modified cell. - * @param {MergedCellCoords} merged cellInfo The merged cell in question. - * @param {Number} row Row index. - * @param {Number} col Column index. - */ -// eslint-disable-next-line import/prefer-default-export -function applySpanProperties(TD, mergedCellInfo, row, col) { - if (mergedCellInfo) { - if (mergedCellInfo.row === row && mergedCellInfo.col === col) { - TD.setAttribute('rowspan', mergedCellInfo.rowspan.toString()); - TD.setAttribute('colspan', mergedCellInfo.colspan.toString()); - } else { - TD.removeAttribute('rowspan'); - TD.removeAttribute('colspan'); + }, { + key: 'onAfterOnCellMouseDown', + value: function onAfterOnCellMouseDown(event, coords) { + if ((0, _utils.wasHeaderClickedProperly)(coords.row, coords.col, event) === false) { + return; + } - TD.style.display = 'none'; + if (this.wasClickableHeaderClicked(event, coords.col)) { + if ((0, _keyStateObserver.isPressedCtrlKey)()) { + this.hot.deselectCell(); + this.hot.selectColumns(coords.col); + } + + this.sort(this.getColumnNextConfig(coords.col)); + } } - } else { - TD.removeAttribute('rowspan'); - TD.removeAttribute('colspan'); - TD.style.display = ''; - } -} + /** + * Destroys the plugin instance. + */ -/***/ }), -/* 471 */ -/***/ (function(module, exports, __webpack_require__) { + }, { + key: 'destroy', + value: function destroy() { + this.rowsMapper.destroy(); + this.columnStatesManager.destroy(); -"use strict"; + _get(ColumnSorting.prototype.__proto__ || Object.getPrototypeOf(ColumnSorting.prototype), 'destroy', this).call(this); + } + }]); + return ColumnSorting; +}(_base2.default); -exports.__esModule = true; -exports.HEADER_SPAN_CLASS = exports.DESC_SORT_STATE = exports.ASC_SORT_STATE = undefined; -exports.areValidSortStates = areValidSortStates; -exports.getNextSortOrder = getNextSortOrder; -exports.getFullSortConfiguration = getFullSortConfiguration; -exports.warnIfPluginsHaveConflict = warnIfPluginsHaveConflict; -exports.warnAboutNotValidatedConfig = warnAboutNotValidatedConfig; -exports.getHeaderSpanElement = getHeaderSpanElement; -exports.isFirstLevelColumnHeader = isFirstLevelColumnHeader; +(0, _plugins.registerPlugin)(PLUGIN_KEY, ColumnSorting); -var _mixed = __webpack_require__(8); +exports.default = ColumnSorting; -var _object = __webpack_require__(1); +/***/ }), +/* 465 */ +/***/ (function(module, exports, __webpack_require__) { -var _console = __webpack_require__(20); +"use strict"; -var ASC_SORT_STATE = exports.ASC_SORT_STATE = 'asc'; -var DESC_SORT_STATE = exports.DESC_SORT_STATE = 'desc'; -var HEADER_SPAN_CLASS = exports.HEADER_SPAN_CLASS = 'colHeader'; -/** - * Get if column state is valid. - * - * @param {Number} columnState Particular column state. - * @returns {Boolean} - */ -function isValidColumnState(columnState) { - if ((0, _mixed.isUndefined)(columnState)) { - return false; - } +exports.__esModule = true; +exports.getRootComparator = exports.registerRootComparator = undefined; +exports.getCompareFunctionFactory = getCompareFunctionFactory; - var column = columnState.column, - sortOrder = columnState.sortOrder; +var _default = __webpack_require__(576); +var _numeric = __webpack_require__(577); - return Number.isInteger(column) && [ASC_SORT_STATE, DESC_SORT_STATE].includes(sortOrder); -} +var _date = __webpack_require__(578); -/** - * Get if all sorted columns states are valid. - * - * @param {Array} sortStates - * @returns {Boolean} - */ -function areValidSortStates(sortStates) { - if (Array.isArray(sortStates) === false || sortStates.every(function (columnState) { - return (0, _object.isObject)(columnState); - }) === false) { - return false; - } +var _staticRegister3 = __webpack_require__(41); - var sortedColumns = sortStates.map(function (_ref) { - var column = _ref.column; - return column; - }); - var indexOccursOnlyOnce = new Set(sortedColumns).size === sortedColumns.length; +var _staticRegister4 = _interopRequireDefault(_staticRegister3); - return indexOccursOnlyOnce && sortStates.every(isValidColumnState); -} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** - * Get next sort order for particular column. The order sequence looks as follows: 'asc' -> 'desc' -> undefined -> 'asc' - * - * @param {String|undefined} sortOrder sort order (`asc` for ascending, `desc` for descending and undefined for not sorted). - * @returns {String|undefined} Next sort order (`asc` for ascending, `desc` for descending and undefined for not sorted). - */ -function getNextSortOrder(sortOrder) { - if (sortOrder === DESC_SORT_STATE) { - return; - } else if (sortOrder === ASC_SORT_STATE) { - return DESC_SORT_STATE; - } +var _staticRegister = (0, _staticRegister4.default)('sorting.compareFunctionFactory'), + registerCompareFunctionFactory = _staticRegister.register, + getGloballyCompareFunctionFactory = _staticRegister.getItem, + hasGloballyCompareFunctionFactory = _staticRegister.hasItem; - return ASC_SORT_STATE; -} +var _staticRegister2 = (0, _staticRegister4.default)('sorting.mainSortComparator'), + registerRootComparator = _staticRegister2.register, + getRootComparator = _staticRegister2.getItem; /** - * Get multiple sorted column configs from sort configs with different data types. + * Gets sort function for the particular column basing on it's data type. * - * @param {undefined|Object|Array} sortConfig Single column sort configuration or full sort configuration (for all sorted columns). - * The configuration object contains `column` and `sortOrder` properties. First of them contains visual column index, the second one contains - * sort order (`asc` for ascending, `desc` for descending). - * @returns {Array} + * @param {String} dataType Data type for the particular column. + * @returns {Function} */ -function getFullSortConfiguration(sortConfig) { - if ((0, _mixed.isUndefined)(sortConfig)) { - return []; - } - - if (Array.isArray(sortConfig)) { - return sortConfig; - } - return [sortConfig]; -} -/** - * Warn users about problems when using `multiColumnSorting` and `columnSorting` plugins simultaneously. - * - * @param {undefined|Boolean|Object} columnSortingSettings - */ -function warnIfPluginsHaveConflict(columnSortingSettings) { - if (columnSortingSettings) { - (0, _console.warn)('Plugins `columnSorting` and `multiColumnSorting` should not be enabled simultaneously.'); +function getCompareFunctionFactory(type) { + if (hasGloballyCompareFunctionFactory(type)) { + return getGloballyCompareFunctionFactory(type); } -} - -/** - * Warn users about problems with validating sort config. - */ -function warnAboutNotValidatedConfig() { - (0, _console.warn)('Sort configuration failed to validate properly.'); -} - -/** - * Get `span` DOM element inside `th` DOM element. - * - * @param {Element} TH th HTML element. - * @returns {Element | null} - */ -function getHeaderSpanElement(TH) { - var headerSpanElement = TH.querySelector('.' + HEADER_SPAN_CLASS); - return headerSpanElement; + return getGloballyCompareFunctionFactory(_default.COLUMN_DATA_TYPE); } -/** - * - * Get if handled header is first level column header. - * - * @param {Number} column Visual column index. - * @param {Element} TH th HTML element. - * @returns {Boolean} - */ -function isFirstLevelColumnHeader(column, TH) { - if (column < 0 || !TH.parentNode) { - return false; - } - - var TRs = TH.parentNode.parentNode.childNodes; - var headerLevel = Array.from(TRs).indexOf(TH.parentNode) - TRs.length; - - if (headerLevel !== -1) { - return false; - } +registerCompareFunctionFactory(_numeric.COLUMN_DATA_TYPE, _numeric.compareFunctionFactory); +registerCompareFunctionFactory(_date.COLUMN_DATA_TYPE, _date.compareFunctionFactory); +registerCompareFunctionFactory(_default.COLUMN_DATA_TYPE, _default.compareFunctionFactory); - return true; -} +exports.registerRootComparator = registerRootComparator; +exports.getRootComparator = getRootComparator; /***/ }), -/* 472 */ +/* 466 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.CONDITION_NAME = undefined; -exports.condition = condition; -var _constants = __webpack_require__(3); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var C = _interopRequireWildcard(_constants); +var _array = __webpack_require__(0); -var _conditionRegisterer = __webpack_require__(11); +var _object = __webpack_require__(1); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var CONDITION_NAME = exports.CONDITION_NAME = 'empty'; +/** + * Command executor for ContextMenu. + * + * @class CommandExecutor + * @plugin ContextMenu + */ +var CommandExecutor = function () { + function CommandExecutor(hotInstance) { + _classCallCheck(this, CommandExecutor); -function condition(dataRow) { - return dataRow.value === '' || dataRow.value === null || dataRow.value === void 0; -} + this.hot = hotInstance; + this.commands = {}; + this.commonCallback = null; + } -(0, _conditionRegisterer.registerCondition)(CONDITION_NAME, condition, { - name: C.FILTERS_CONDITIONS_EMPTY, - inputsCount: 0, - showOperators: true -}); + /** + * Register command. + * + * @param {String} name Command name. + * @param {Object} commandDescriptor Command descriptor object with properties like `key` (command id), + * `callback` (task to execute), `name` (command name), `disabled` (command availability). + */ -/***/ }), -/* 473 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; + _createClass(CommandExecutor, [{ + key: 'registerCommand', + value: function registerCommand(name, commandDescriptor) { + this.commands[name] = commandDescriptor; + } + /** + * Set common callback which will be trigger on every executed command. + * + * @param {Function} callback Function which will be fired on every command execute. + */ -exports.__esModule = true; -exports.CONDITION_NAME = undefined; + }, { + key: 'setCommonCallback', + value: function setCommonCallback(callback) { + this.commonCallback = callback; + } -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + /** + * Execute command by its name. + * + * @param {String} commandName Command id. + * @param {*} params Arguments passed to command task. + */ -exports.condition = condition; + }, { + key: 'execute', + value: function execute(commandName) { + var _this = this; -var _constants = __webpack_require__(3); + for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + params[_key - 1] = arguments[_key]; + } -var C = _interopRequireWildcard(_constants); + var commandSplit = commandName.split(':'); + var commandNamePrimary = commandSplit[0]; -var _mixed = __webpack_require__(8); + var subCommandName = commandSplit.length === 2 ? commandSplit[1] : null; + var command = this.commands[commandNamePrimary]; -var _conditionRegisterer = __webpack_require__(11); + if (!command) { + throw new Error('Menu command \'' + commandNamePrimary + '\' not exists.'); + } + if (subCommandName && command.submenu) { + command = findSubCommand(subCommandName, command.submenu.items); + } + if (command.disabled === true) { + return; + } + if (typeof command.disabled === 'function' && command.disabled.call(this.hot) === true) { + return; + } + if ((0, _object.hasOwnProperty)(command, 'submenu')) { + return; + } + var callbacks = []; -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + if (typeof command.callback === 'function') { + callbacks.push(command.callback); + } + if (typeof this.commonCallback === 'function') { + callbacks.push(this.commonCallback); + } + params.unshift(commandSplit.join(':')); + (0, _array.arrayEach)(callbacks, function (callback) { + return callback.apply(_this.hot, params); + }); + } + }]); -var CONDITION_NAME = exports.CONDITION_NAME = 'eq'; + return CommandExecutor; +}(); -function condition(dataRow, _ref) { - var _ref2 = _slicedToArray(_ref, 1), - value = _ref2[0]; +function findSubCommand(subCommandName, subCommands) { + var command = void 0; - return (0, _mixed.stringify)(dataRow.value).toLowerCase() === (0, _mixed.stringify)(value); + (0, _array.arrayEach)(subCommands, function (cmd) { + var cmds = cmd.key ? cmd.key.split(':') : null; + + if (Array.isArray(cmds) && cmds[1] === subCommandName) { + command = cmd; + + return false; + } + }); + + return command; } -(0, _conditionRegisterer.registerCondition)(CONDITION_NAME, condition, { - name: C.FILTERS_CONDITIONS_EQUAL, - inputsCount: 1, - showOperators: true -}); +exports.default = CommandExecutor; /***/ }), -/* 474 */ +/* 467 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.CONDITION_NAME = undefined; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -exports.condition = condition; - -var _constants = __webpack_require__(3); - -var C = _interopRequireWildcard(_constants); - -var _conditionRegisterer = __webpack_require__(11); - -var _after = __webpack_require__(475); -var _before = __webpack_require__(476); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +var _object = __webpack_require__(1); -var CONDITION_NAME = exports.CONDITION_NAME = 'between'; +var _array = __webpack_require__(0); -function condition(dataRow, _ref) { - var _ref2 = _slicedToArray(_ref, 2), - from = _ref2[0], - to = _ref2[1]; +var _predefinedItems = __webpack_require__(45); - var fromValue = from; - var toValue = to; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - if (dataRow.meta.type === 'numeric') { - var _from = parseFloat(fromValue, 10); - var _to = parseFloat(toValue, 10); +/** + * Predefined items class factory for menu items. + * + * @class ItemsFactory + * @plugin ContextMenu + */ +var ItemsFactory = function () { + function ItemsFactory(hotInstance) { + var orderPattern = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - fromValue = Math.min(_from, _to); - toValue = Math.max(_from, _to); - } else if (dataRow.meta.type === 'date') { - var dateBefore = (0, _conditionRegisterer.getCondition)(_before.CONDITION_NAME, [toValue]); - var dateAfter = (0, _conditionRegisterer.getCondition)(_after.CONDITION_NAME, [fromValue]); + _classCallCheck(this, ItemsFactory); - return dateBefore(dataRow) && dateAfter(dataRow); + this.hot = hotInstance; + this.predefinedItems = (0, _predefinedItems.predefinedItems)(); + this.defaultOrderPattern = orderPattern; } - return dataRow.value >= fromValue && dataRow.value <= toValue; -} - -(0, _conditionRegisterer.registerCondition)(CONDITION_NAME, condition, { - name: C.FILTERS_CONDITIONS_BETWEEN, - inputsCount: 2, - showOperators: true -}); - -/***/ }), -/* 475 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Set predefined items. + * + * @param {Array} predefinedItemsCollection Array of predefined items. + */ -"use strict"; + _createClass(ItemsFactory, [{ + key: 'setPredefinedItems', + value: function setPredefinedItems(predefinedItemsCollection) { + var _this = this; -exports.__esModule = true; -exports.CONDITION_NAME = undefined; + var items = {}; -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + this.defaultOrderPattern.length = 0; -exports.condition = condition; + (0, _object.objectEach)(predefinedItemsCollection, function (value, key) { + var menuItemKey = ''; -var _moment = __webpack_require__(23); + if (value.name === _predefinedItems.SEPARATOR) { + items[_predefinedItems.SEPARATOR] = value; + menuItemKey = _predefinedItems.SEPARATOR; -var _moment2 = _interopRequireDefault(_moment); + // Menu item added as a property to array + } else if (isNaN(parseInt(key, 10))) { + value.key = value.key === void 0 ? key : value.key; + items[key] = value; + menuItemKey = value.key; + } else { + items[value.key] = value; + menuItemKey = value.key; + } + _this.defaultOrderPattern.push(menuItemKey); + }); + this.predefinedItems = items; + } -var _constants = __webpack_require__(3); + /** + * Get all menu items based on pattern. + * + * @param {Array|Object|Boolean} pattern Pattern which you can define by displaying menu items order. If `true` default + * pattern will be used. + * @returns {Array} + */ -var C = _interopRequireWildcard(_constants); + }, { + key: 'getItems', + value: function getItems() { + var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; -var _conditionRegisterer = __webpack_require__(11); + return _getItems(pattern, this.defaultOrderPattern, this.predefinedItems); + } + }]); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + return ItemsFactory; +}(); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _getItems() { + var itemsPattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + var defaultPattern = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var items = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; -var CONDITION_NAME = exports.CONDITION_NAME = 'date_after'; + var result = []; + var pattern = itemsPattern; -function condition(dataRow, _ref) { - var _ref2 = _slicedToArray(_ref, 1), - value = _ref2[0]; + if (pattern && pattern.items) { + pattern = pattern.items; + } else if (!Array.isArray(pattern)) { + pattern = defaultPattern; + } + if ((0, _object.isObject)(pattern)) { + (0, _object.objectEach)(pattern, function (value, key) { + var item = items[typeof value === 'string' ? value : key]; - var date = (0, _moment2.default)(dataRow.value, dataRow.meta.dateFormat); - var inputDate = (0, _moment2.default)(value, dataRow.meta.dateFormat); + if (!item) { + item = value; + } + if ((0, _object.isObject)(value)) { + (0, _object.extend)(item, value); + } else if (typeof item === 'string') { + item = { name: item }; + } + if (item.key === void 0) { + item.key = key; + } + result.push(item); + }); + } else { + (0, _array.arrayEach)(pattern, function (name, key) { + var item = items[name]; - if (!date.isValid() || !inputDate.isValid()) { - return false; + // Item deleted from settings `allowInsertRow: false` etc. + if (!item && _predefinedItems.ITEMS.indexOf(name) >= 0) { + return; + } + if (!item) { + item = { name: name, key: '' + key }; + } + if ((0, _object.isObject)(name)) { + (0, _object.extend)(item, name); + } + if (item.key === void 0) { + item.key = key; + } + result.push(item); + }); } - return date.diff(inputDate) >= 0; + return result; } -(0, _conditionRegisterer.registerCondition)(CONDITION_NAME, condition, { - name: C.FILTERS_CONDITIONS_AFTER, - inputsCount: 1, - showOperators: true -}); +exports.default = ItemsFactory; /***/ }), -/* 476 */ +/* 468 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.CONDITION_NAME = undefined; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); -exports.condition = condition; - -var _moment = __webpack_require__(23); - -var _moment2 = _interopRequireDefault(_moment); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _constants = __webpack_require__(3); +var _number = __webpack_require__(4); -var C = _interopRequireWildcard(_constants); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var _conditionRegisterer = __webpack_require__(11); +var STATE_INITIALIZED = 0; +var STATE_BUILT = 1; +var STATE_APPENDED = 2; +var UNIT = 'px'; -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +/** + * @class + * @private + */ -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var BaseUI = function () { + function BaseUI(hotInstance) { + _classCallCheck(this, BaseUI); -var CONDITION_NAME = exports.CONDITION_NAME = 'date_before'; - -function condition(dataRow, _ref) { - var _ref2 = _slicedToArray(_ref, 1), - value = _ref2[0]; - - var date = (0, _moment2.default)(dataRow.value, dataRow.meta.dateFormat); - var inputDate = (0, _moment2.default)(value, dataRow.meta.dateFormat); - - if (!date.isValid() || !inputDate.isValid()) { - return false; + /** + * Instance of Handsontable. + * + * @type {Core} + */ + this.hot = hotInstance; + /** + * DOM element representing the ui element. + * + * @type {HTMLElement} + * @private + */ + this._element = null; + /** + * Flag which determines build state of element. + * + * @type {Boolean} + */ + this.state = STATE_INITIALIZED; } - return date.diff(inputDate) <= 0; -} - -(0, _conditionRegisterer.registerCondition)(CONDITION_NAME, condition, { - name: C.FILTERS_CONDITIONS_BEFORE, - inputsCount: 1, - showOperators: true -}); - -/***/ }), -/* 477 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.CONDITION_NAME = undefined; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -exports.condition = condition; - -var _constants = __webpack_require__(3); - -var C = _interopRequireWildcard(_constants); - -var _mixed = __webpack_require__(8); - -var _conditionRegisterer = __webpack_require__(11); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -var CONDITION_NAME = exports.CONDITION_NAME = 'contains'; + /** + * Add created UI elements to table. + * + * @param {HTMLElement} wrapper Element which are parent for our UI element. + */ -function condition(dataRow, _ref) { - var _ref2 = _slicedToArray(_ref, 1), - value = _ref2[0]; - return (0, _mixed.stringify)(dataRow.value).toLowerCase().indexOf((0, _mixed.stringify)(value)) >= 0; -} + _createClass(BaseUI, [{ + key: 'appendTo', + value: function appendTo(wrapper) { + wrapper.appendChild(this._element); -(0, _conditionRegisterer.registerCondition)(CONDITION_NAME, condition, { - name: C.FILTERS_CONDITIONS_CONTAINS, - inputsCount: 1, - showOperators: true -}); + this.state = STATE_APPENDED; + } -/***/ }), -/* 478 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Method for create UI element. Only create, without append to table. + */ -"use strict"; + }, { + key: 'build', + value: function build() { + this._element = document.createElement('div'); + this.state = STATE_BUILT; + } + /** + * Method for remove UI element. + */ -exports.__esModule = true; -exports.SHORT_NAME_FOR_COMPONENT = exports.OPERATION_ID = undefined; -exports.operationResult = operationResult; + }, { + key: 'destroy', + value: function destroy() { + if (this.isAppended()) { + this._element.parentElement.removeChild(this._element); + } -var _constants = __webpack_require__(3); + this._element = null; + this.state = STATE_INITIALIZED; + } -var C = _interopRequireWildcard(_constants); + /** + * Check if UI element are appended. + * + * @returns {Boolean} + */ -var _logicalOperationRegisterer = __webpack_require__(67); + }, { + key: 'isAppended', + value: function isAppended() { + return this.state === STATE_APPENDED; + } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + /** + * Check if UI element are built. + * + * @returns {Boolean} + */ -var OPERATION_ID = exports.OPERATION_ID = 'disjunction'; -var SHORT_NAME_FOR_COMPONENT = exports.SHORT_NAME_FOR_COMPONENT = C.FILTERS_LABELS_DISJUNCTION; -// (p OR q OR w OR x OR...) === TRUE? + }, { + key: 'isBuilt', + value: function isBuilt() { + return this.state >= STATE_BUILT; + } -function operationResult(conditions, value) { - return conditions.some(function (condition) { - return condition.func(value); - }); -} + /** + * Setter for position. + * + * @param {Number} top New top position of the element. + * @param {Number} left New left position of the element. + */ -(0, _logicalOperationRegisterer.registerOperation)(OPERATION_ID, SHORT_NAME_FOR_COMPONENT, operationResult); + }, { + key: 'setPosition', + value: function setPosition(top, left) { + if ((0, _number.isNumeric)(top)) { + this._element.style.top = top + UNIT; + } + if ((0, _number.isNumeric)(left)) { + this._element.style.left = left + UNIT; + } + } -/***/ }), -/* 479 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Getter for the element position. + * + * @returns {Object} Object contains left and top position of the element. + */ -"use strict"; + }, { + key: 'getPosition', + value: function getPosition() { + return { + top: this._element.style.top ? parseInt(this._element.style.top, 10) : 0, + left: this._element.style.left ? parseInt(this._element.style.left, 10) : 0 + }; + } + /** + * Setter for the element size. + * + * @param {Number} width New width of the element. + * @param {Number} height New height of the element. + */ -exports.__esModule = true; -exports.SHORT_NAME_FOR_COMPONENT = exports.OPERATION_ID = undefined; -exports.operationResult = operationResult; + }, { + key: 'setSize', + value: function setSize(width, height) { + if ((0, _number.isNumeric)(width)) { + this._element.style.width = width + UNIT; + } + if ((0, _number.isNumeric)(height)) { + this._element.style.height = height + UNIT; + } + } -var _constants = __webpack_require__(3); + /** + * Getter for the element position. + * + * @returns {Object} Object contains height and width of the element. + */ -var C = _interopRequireWildcard(_constants); + }, { + key: 'getSize', + value: function getSize() { + return { + width: this._element.style.width ? parseInt(this._element.style.width, 10) : 0, + height: this._element.style.height ? parseInt(this._element.style.height, 10) : 0 + }; + } -var _logicalOperationRegisterer = __webpack_require__(67); + /** + * Setter for the element offset. Offset means marginTop and marginLeft of the element. + * + * @param {Number} top New margin top of the element. + * @param {Number} left New margin left of the element. + */ -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + }, { + key: 'setOffset', + value: function setOffset(top, left) { + if ((0, _number.isNumeric)(top)) { + this._element.style.marginTop = top + UNIT; + } + if ((0, _number.isNumeric)(left)) { + this._element.style.marginLeft = left + UNIT; + } + } -var OPERATION_ID = exports.OPERATION_ID = 'disjunctionWithExtraCondition'; -var SHORT_NAME_FOR_COMPONENT = exports.SHORT_NAME_FOR_COMPONENT = C.FILTERS_LABELS_DISJUNCTION; -// ((p OR q OR w OR x OR...) AND z) === TRUE? + /** + * Getter for the element offset. + * + * @returns {Object} Object contains top and left offset of the element. + */ -function operationResult(conditions, value) { - if (conditions.length < 3) { - throw Error('Operation doesn\'t work on less then three conditions.'); - } + }, { + key: 'getOffset', + value: function getOffset() { + return { + top: this._element.style.marginTop ? parseInt(this._element.style.marginTop, 10) : 0, + left: this._element.style.marginLeft ? parseInt(this._element.style.marginLeft, 10) : 0 + }; + } + }]); - return conditions.slice(0, conditions.length - 1).some(function (condition) { - return condition.func(value); - }) && conditions[conditions.length - 1].func(value); -} + return BaseUI; +}(); -(0, _logicalOperationRegisterer.registerOperation)(OPERATION_ID, SHORT_NAME_FOR_COMPONENT, operationResult); +exports.default = BaseUI; /***/ }), -/* 480 */ +/* 469 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55884,794 +55986,585 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _templateObject = _taggedTemplateLiteral(['The column of index ', ' has been already applied with a `', '` \n filter operation. Use `removeConditions` to clear the current conditions and then add new ones. \n Mind that you cannot mix different types of operations (for instance, if you use `conjunction`, \n use it consequently for a particular column).'], ['The column of index ', ' has been already applied with a \\`', '\\` \n filter operation. Use \\`removeConditions\\` to clear the current conditions and then add new ones. \n Mind that you cannot mix different types of operations (for instance, if you use \\`conjunction\\`, \n use it consequently for a particular column).']); - -var _array = __webpack_require__(0); - -var _object = __webpack_require__(1); - -var _templateLiteralTag = __webpack_require__(26); - -var _localHooks = __webpack_require__(21); - -var _localHooks2 = _interopRequireDefault(_localHooks); - -var _conditionRegisterer = __webpack_require__(11); - -var _conjunction = __webpack_require__(165); - -var _logicalOperationRegisterer = __webpack_require__(67); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var STATE_INITIALIZED = 0; +var STATE_BUILT = 1; +var STATE_APPENDED = 2; +var UNIT = 'px'; + /** - * @class ConditionCollection - * @plugin Filters + * @class + * @private */ -var ConditionCollection = function () { - function ConditionCollection() { - _classCallCheck(this, ConditionCollection); + +var BaseUI = function () { + function BaseUI(hotInstance) { + _classCallCheck(this, BaseUI); /** - * Conditions collection grouped by operation type and then column index. + * Instance of Handsontable. * - * @type {Object} + * @type {Core} */ - this.conditions = this.initConditionsCollection(); - + this.hot = hotInstance; /** - * Types of operations grouped by column index. + * DOM element representing the ui element. * - * @type {Object} + * @type {HTMLElement} + * @private */ - this.columnTypes = {}; - + this._element = null; /** - * Order of added condition filters. + * Flag which determines build state of element. * - * @type {Array} + * @type {Boolean} */ - this.orderStack = []; + this.state = STATE_INITIALIZED; } /** - * Check if condition collection is empty (so no needed to filter data). + * Add created UI elements to table. * - * @returns {Boolean} + * @param {HTMLElement} wrapper Element which are parent for our UI element. */ - _createClass(ConditionCollection, [{ - key: 'isEmpty', - value: function isEmpty() { - return !this.orderStack.length; + _createClass(BaseUI, [{ + key: 'appendTo', + value: function appendTo(wrapper) { + wrapper.appendChild(this._element); + + this.state = STATE_APPENDED; } /** - * Check if value is matched to the criteria of conditions chain. - * - * @param {Object} value Object with `value` and `meta` keys. - * @param {Number} [column] Column index. - * @returns {Boolean} + * Method for create UI element. Only create, without append to table. */ }, { - key: 'isMatch', - value: function isMatch(value, column) { - var _this = this; + key: 'build', + value: function build() { + this._element = document.createElement('div'); + this.state = STATE_BUILT; + } - var result = true; + /** + * Method for remove UI element. + */ - if (column === void 0) { - (0, _object.objectEach)(this.columnTypes, function (columnType, columnIndex) { - result = _this.isMatchInConditions(_this.conditions[columnType][columnIndex], value, columnType); + }, { + key: 'destroy', + value: function destroy() { + if (this.isAppended()) { + this._element.parentElement.removeChild(this._element); + } - return result; - }); - } else { - var columnType = this.columnTypes[column]; + this._element = null; + this.state = STATE_INITIALIZED; + } - result = this.isMatchInConditions(this.getConditions(column), value, columnType); - } + /** + * Check if UI element are appended. + * + * @returns {Boolean} + */ - return result; + }, { + key: 'isAppended', + value: function isAppended() { + return this.state === STATE_APPENDED; } /** - * Check if the value is matches the conditions. + * Check if UI element are built. * - * @param {Array} conditions List of conditions. - * @param {Object} value Object with `value` and `meta` keys. - * @param {String} [operationType='conjunction'] Type of conditions operation * @returns {Boolean} */ }, { - key: 'isMatchInConditions', - value: function isMatchInConditions(conditions, value) { - var operationType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _conjunction.OPERATION_ID; + key: 'isBuilt', + value: function isBuilt() { + return this.state >= STATE_BUILT; + } - var result = false; + /** + * Setter for position. + * + * @param {Number} top New top position of the element. + * @param {Number} left New left position of the element. + */ - if (conditions.length) { - result = (0, _logicalOperationRegisterer.getOperationFunc)(operationType)(conditions, value); - } else { - result = true; + }, { + key: 'setPosition', + value: function setPosition(top, left) { + if (top !== void 0) { + this._element.style.top = top + UNIT; + } + if (left !== void 0) { + this._element.style.left = left + UNIT; } - - return result; } /** - * Add condition to the collection. + * Getter for the element position. * - * @param {Number} column Column index. - * @param {Object} conditionDefinition Object with keys: - * * `command` Object, Command object with condition name as `key` property. - * * `args` Array, Condition arguments. - * @param {String} [operation='conjunction'] Type of conditions operation - * @fires ConditionCollection#beforeAdd - * @fires ConditionCollection#afterAdd + * @returns {Object} Object contains left and top position of the element. */ }, { - key: 'addCondition', - value: function addCondition(column, conditionDefinition) { - var operation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _conjunction.OPERATION_ID; - - var args = (0, _array.arrayMap)(conditionDefinition.args, function (v) { - return typeof v === 'string' ? v.toLowerCase() : v; - }); - var name = conditionDefinition.name || conditionDefinition.command.key; + key: 'getPosition', + value: function getPosition() { + return { + top: this._element.style.top ? parseInt(this._element.style.top, 10) : 0, + left: this._element.style.left ? parseInt(this._element.style.left, 10) : 0 + }; + } - this.runLocalHooks('beforeAdd', column); + /** + * Setter for the element size. + * + * @param {Number} width New width of the element. + * @param {Number} height New height of the element. + */ - if (this.orderStack.indexOf(column) === -1) { - this.orderStack.push(column); + }, { + key: 'setSize', + value: function setSize(width, height) { + if (width) { + this._element.style.width = width + UNIT; } - - var columnType = this.columnTypes[column]; - - if (columnType) { - if (columnType !== operation) { - throw Error((0, _templateLiteralTag.toSingleLine)(_templateObject, column, columnType)); - } - } else { - if (!this.conditions[operation]) { - throw new Error('Unexpected operation named `' + operation + '`. Possible ones are `disjunction` and `conjunction`.'); - } - - this.columnTypes[column] = operation; + if (height) { + this._element.style.height = height + UNIT; } + } - // Add condition - this.getConditions(column).push({ - name: name, - args: args, - func: (0, _conditionRegisterer.getCondition)(name, args) - }); + /** + * Getter for the element position. + * + * @returns {Object} Object contains height and width of the element. + */ - this.runLocalHooks('afterAdd', column); + }, { + key: 'getSize', + value: function getSize() { + return { + width: this._element.style.width ? parseInt(this._element.style.width, 10) : 0, + height: this._element.style.height ? parseInt(this._element.style.height, 10) : 0 + }; } /** - * Get all added conditions from the collection at specified column index. + * Setter for the element offset. Offset means marginTop and marginLeft of the element. * - * @param {Number} column Column index. - * @returns {Array} Returns conditions collection as an array. + * @param {Number} top New margin top of the element. + * @param {Number} left New margin left of the element. */ }, { - key: 'getConditions', - value: function getConditions(column) { - var columnType = this.columnTypes[column]; - - if (!columnType) { - return []; + key: 'setOffset', + value: function setOffset(top, left) { + if (top) { + this._element.style.marginTop = top + UNIT; } - - if (!this.conditions[columnType][column]) { - this.conditions[columnType][column] = []; + if (left) { + this._element.style.marginLeft = left + UNIT; } - - return this.conditions[columnType][column]; } /** - * Export all previously added conditions. + * Getter for the element offset. * - * @returns {Array} + * @returns {Object} Object contains top and left offset of the element. */ }, { - key: 'exportAllConditions', - value: function exportAllConditions() { - var _this2 = this; + key: 'getOffset', + value: function getOffset() { + return { + top: this._element.style.marginTop ? parseInt(this._element.style.marginTop, 10) : 0, + left: this._element.style.marginLeft ? parseInt(this._element.style.marginLeft, 10) : 0 + }; + } + }]); - var result = []; + return BaseUI; +}(); - (0, _array.arrayEach)(this.orderStack, function (column) { - var conditions = (0, _array.arrayMap)(_this2.getConditions(column), function (_ref) { - var name = _ref.name, - args = _ref.args; - return { name: name, args: args }; - }); - var operation = _this2.columnTypes[column]; +exports.default = BaseUI; - result.push({ - column: column, - operation: operation, - conditions: conditions - }); - }); +/***/ }), +/* 470 */ +/***/ (function(module, exports, __webpack_require__) { - return result; +"use strict"; + + +exports.__esModule = true; +exports.applySpanProperties = applySpanProperties; +/** + * Apply the `colspan`/`rowspan` properties. + * + * @param {HTMLElement} TD The soon-to-be-modified cell. + * @param {MergedCellCoords} merged cellInfo The merged cell in question. + * @param {Number} row Row index. + * @param {Number} col Column index. + */ +// eslint-disable-next-line import/prefer-default-export +function applySpanProperties(TD, mergedCellInfo, row, col) { + if (mergedCellInfo) { + if (mergedCellInfo.row === row && mergedCellInfo.col === col) { + TD.setAttribute('rowspan', mergedCellInfo.rowspan.toString()); + TD.setAttribute('colspan', mergedCellInfo.colspan.toString()); + } else { + TD.removeAttribute('rowspan'); + TD.removeAttribute('colspan'); + + TD.style.display = 'none'; } + } else { + TD.removeAttribute('rowspan'); + TD.removeAttribute('colspan'); - /** - * Import conditions to the collection. - */ + TD.style.display = ''; + } +} - }, { - key: 'importAllConditions', - value: function importAllConditions(conditions) { - var _this3 = this; +/***/ }), +/* 471 */ +/***/ (function(module, exports, __webpack_require__) { - this.clean(); +"use strict"; - (0, _array.arrayEach)(conditions, function (stack) { - _this3.orderStack.push(stack.column); - (0, _array.arrayEach)(stack.conditions, function (condition) { - return _this3.addCondition(stack.column, condition); - }); - }); - } +exports.__esModule = true; +exports.CONDITION_NAME = undefined; +exports.condition = condition; - /** - * Remove conditions at given column index. - * - * @param {Number} column Column index. - * @fires ConditionCollection#beforeRemove - * @fires ConditionCollection#afterRemove - */ +var _constants = __webpack_require__(3); - }, { - key: 'removeConditions', - value: function removeConditions(column) { - this.runLocalHooks('beforeRemove', column); +var C = _interopRequireWildcard(_constants); - if (this.orderStack.indexOf(column) >= 0) { - this.orderStack.splice(this.orderStack.indexOf(column), 1); - } - this.clearConditions(column); - this.runLocalHooks('afterRemove', column); - } +var _conditionRegisterer = __webpack_require__(11); - /** - * Clear conditions at specified column index but without clearing stack order. - * - * @param {Number }column Column index. - * @fires ConditionCollection#beforeClear - * @fires ConditionCollection#afterClear - */ +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - }, { - key: 'clearConditions', - value: function clearConditions(column) { - this.runLocalHooks('beforeClear', column); - this.getConditions(column).length = 0; - delete this.columnTypes[column]; - this.runLocalHooks('afterClear', column); - } +var CONDITION_NAME = exports.CONDITION_NAME = 'empty'; - /** - * Check if at least one condition was added at specified column index. And if second parameter is passed then additionally - * check if condition exists under its name. - * - * @param {Number} column Column index. - * @param {String} [name] Condition name. - * @returns {Boolean} - */ +function condition(dataRow) { + return dataRow.value === '' || dataRow.value === null || dataRow.value === void 0; +} - }, { - key: 'hasConditions', - value: function hasConditions(column, name) { - var columnType = this.columnTypes[column]; - var result = false; +(0, _conditionRegisterer.registerCondition)(CONDITION_NAME, condition, { + name: C.FILTERS_CONDITIONS_EMPTY, + inputsCount: 0, + showOperators: true +}); - if (!columnType) { - return false; - } +/***/ }), +/* 472 */ +/***/ (function(module, exports, __webpack_require__) { - var conditions = this.getConditions(column); +"use strict"; - if (name) { - result = (0, _array.arrayFilter)(conditions, function (condition) { - return condition.name === name; - }).length > 0; - } else { - result = conditions.length > 0; - } - return result; - } +exports.__esModule = true; +exports.CONDITION_NAME = undefined; - /** - * Clean all conditions collection and reset order stack. - * - * @fires ConditionCollection#beforeClean - * @fires ConditionCollection#afterClean - */ +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - }, { - key: 'clean', - value: function clean() { - this.runLocalHooks('beforeClean'); - this.columnTypes = Object.create(null); - this.orderStack.length = 0; - this.conditions = this.initConditionsCollection(); - this.runLocalHooks('afterClean'); - } +exports.condition = condition; - /** - * Destroy object. - */ +var _constants = __webpack_require__(3); - }, { - key: 'destroy', - value: function destroy() { - this.clearLocalHooks(); - this.conditions = null; - this.orderStack = null; - this.columnTypes = null; - } +var C = _interopRequireWildcard(_constants); - /** - * Init conditions collection - * - * @private - */ +var _mixed = __webpack_require__(10); - }, { - key: 'initConditionsCollection', - value: function initConditionsCollection() { - var conditions = Object.create(null); +var _conditionRegisterer = __webpack_require__(11); - (0, _object.objectEach)(_logicalOperationRegisterer.operations, function (_, operation) { - conditions[operation] = Object.create(null); - }); +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - return conditions; - } - }]); +var CONDITION_NAME = exports.CONDITION_NAME = 'eq'; - return ConditionCollection; -}(); +function condition(dataRow, _ref) { + var _ref2 = _slicedToArray(_ref, 1), + value = _ref2[0]; -(0, _object.mixin)(ConditionCollection, _localHooks2.default); + return (0, _mixed.stringify)(dataRow.value).toLowerCase() === (0, _mixed.stringify)(value); +} -exports.default = ConditionCollection; +(0, _conditionRegisterer.registerCondition)(CONDITION_NAME, condition, { + name: C.FILTERS_CONDITIONS_EQUAL, + inputsCount: 1, + showOperators: true +}); /***/ }), -/* 481 */ +/* 473 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; +exports.CONDITION_NAME = undefined; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); -var _array = __webpack_require__(0); +exports.condition = condition; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _constants = __webpack_require__(3); -/** - * @class DataFilter - * @plugin Filters - * @pro - */ -var DataFilter = function () { - function DataFilter(conditionCollection) { - var columnDataFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () { - return []; - }; +var C = _interopRequireWildcard(_constants); - _classCallCheck(this, DataFilter); +var _conditionRegisterer = __webpack_require__(11); - /** - * Reference to the instance of {ConditionCollection}. - * - * @type {ConditionCollection} - */ - this.conditionCollection = conditionCollection; - /** - * Function which provide source data factory for specified column. - * - * @type {Function} - */ - this.columnDataFactory = columnDataFactory; +var _after = __webpack_require__(474); + +var _before = __webpack_require__(475); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +var CONDITION_NAME = exports.CONDITION_NAME = 'between'; + +function condition(dataRow, _ref) { + var _ref2 = _slicedToArray(_ref, 2), + from = _ref2[0], + to = _ref2[1]; + + var fromValue = from; + var toValue = to; + + if (dataRow.meta.type === 'numeric') { + var _from = parseFloat(fromValue, 10); + var _to = parseFloat(toValue, 10); + + fromValue = Math.min(_from, _to); + toValue = Math.max(_from, _to); + } else if (dataRow.meta.type === 'date') { + var dateBefore = (0, _conditionRegisterer.getCondition)(_before.CONDITION_NAME, [toValue]); + var dateAfter = (0, _conditionRegisterer.getCondition)(_after.CONDITION_NAME, [fromValue]); + + return dateBefore(dataRow) && dateAfter(dataRow); } - /** - * Filter data based on the conditions collection. - * - * @returns {Array} - */ + return dataRow.value >= fromValue && dataRow.value <= toValue; +} +(0, _conditionRegisterer.registerCondition)(CONDITION_NAME, condition, { + name: C.FILTERS_CONDITIONS_BETWEEN, + inputsCount: 2, + showOperators: true +}); - _createClass(DataFilter, [{ - key: 'filter', - value: function filter() { - var _this = this; +/***/ }), +/* 474 */ +/***/ (function(module, exports, __webpack_require__) { - var filteredData = []; +"use strict"; - if (!this.conditionCollection.isEmpty()) { - (0, _array.arrayEach)(this.conditionCollection.orderStack, function (column, index) { - var columnData = _this.columnDataFactory(column); - if (index) { - columnData = _this._getIntersectData(columnData, filteredData); - } +exports.__esModule = true; +exports.CONDITION_NAME = undefined; - filteredData = _this.filterByColumn(column, columnData); - }); - } +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - return filteredData; - } +exports.condition = condition; - /** - * Filter data based on specified column index. - * - * @param {Number} column Column index. - * @param {Array} [dataSource] Data source as array of objects with `value` and `meta` keys (e.g. `{value: 'foo', meta: {}}`). - * @returns {Array} Returns filtered data. - */ +var _moment = __webpack_require__(25); - }, { - key: 'filterByColumn', - value: function filterByColumn(column) { - var _this2 = this; +var _moment2 = _interopRequireDefault(_moment); - var dataSource = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; +var _constants = __webpack_require__(3); - var filteredData = []; +var C = _interopRequireWildcard(_constants); - (0, _array.arrayEach)(dataSource, function (dataRow) { - if (dataRow !== void 0 && _this2.conditionCollection.isMatch(dataRow, column)) { - filteredData.push(dataRow); - } - }); +var _conditionRegisterer = __webpack_require__(11); - return filteredData; - } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - /** - * Intersect data. - * - * @private - * @param {Array} data - * @param {Array} needles - * @returns {Array} - */ +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - }, { - key: '_getIntersectData', - value: function _getIntersectData(data, needles) { - var result = []; +var CONDITION_NAME = exports.CONDITION_NAME = 'date_after'; - (0, _array.arrayEach)(needles, function (needleRow) { - var row = needleRow.meta.visualRow; +function condition(dataRow, _ref) { + var _ref2 = _slicedToArray(_ref, 1), + value = _ref2[0]; - if (data[row] !== void 0) { - result[row] = data[row]; - } - }); + var date = (0, _moment2.default)(dataRow.value, dataRow.meta.dateFormat); + var inputDate = (0, _moment2.default)(value, dataRow.meta.dateFormat); - return result; - } - }]); + if (!date.isValid() || !inputDate.isValid()) { + return false; + } - return DataFilter; -}(); + return date.diff(inputDate) >= 0; +} -exports.default = DataFilter; +(0, _conditionRegisterer.registerCondition)(CONDITION_NAME, condition, { + name: C.FILTERS_CONDITIONS_AFTER, + inputsCount: 1, + showOperators: true +}); /***/ }), -/* 482 */ +/* 475 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; +exports.CONDITION_NAME = undefined; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _object = __webpack_require__(1); - -var _hotFormulaParser = __webpack_require__(69); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * @class BaseCell - * @util - */ -var BaseCell = function () { - function BaseCell(row, column) { - _classCallCheck(this, BaseCell); +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - var rowObject = (0, _object.isObject)(row); - var columnObject = (0, _object.isObject)(column); +exports.condition = condition; - this._row = rowObject ? row.index : row; - this.rowAbsolute = rowObject ? row.isAbsolute : true; - this._column = columnObject ? column.index : column; - this.columnAbsolute = columnObject ? column.isAbsolute : true; - this.rowOffset = 0; - this.columnOffset = 0; +var _moment = __webpack_require__(25); - // TODO: Change syntax to es6 after upgrade tests to newer version of phantom and jasmine. - Object.defineProperty(this, 'row', { - get: function get() { - return this.rowOffset + this._row; - }, - set: function set(rowIndex) { - this._row = rowIndex; - }, +var _moment2 = _interopRequireDefault(_moment); - enumerable: true, - configurable: true - }); - Object.defineProperty(this, 'column', { - get: function get() { - return this.columnOffset + this._column; - }, - set: function set(columnIndex) { - this._column = columnIndex; - }, +var _constants = __webpack_require__(3); - enumerable: true, - configurable: true - }); - } +var C = _interopRequireWildcard(_constants); - /** - * Translate cell coordinates. - * - * @param {Number} rowOffset Row offset to move. - * @param {Number} columnOffset Column offset to move. - */ +var _conditionRegisterer = __webpack_require__(11); +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - _createClass(BaseCell, [{ - key: 'translateTo', - value: function translateTo(rowOffset, columnOffset) { - this.row = this.row + rowOffset; - this.column = this.column + columnOffset; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * Check if cell is equal to provided one. - * - * @param {BaseCell} cell Cell object. - * @returns {Boolean} - */ +var CONDITION_NAME = exports.CONDITION_NAME = 'date_before'; - }, { - key: 'isEqual', - value: function isEqual(cell) { - return cell.row === this.row && cell.column === this.column; - } +function condition(dataRow, _ref) { + var _ref2 = _slicedToArray(_ref, 1), + value = _ref2[0]; - /** - * Stringify object. - * - * @returns {String} - */ + var date = (0, _moment2.default)(dataRow.value, dataRow.meta.dateFormat); + var inputDate = (0, _moment2.default)(value, dataRow.meta.dateFormat); - }, { - key: 'toString', - value: function toString() { - return (0, _hotFormulaParser.toLabel)({ index: this.row, isAbsolute: this.rowAbsolute }, { index: this.column, isAbsolute: this.columnAbsolute }); - } - }]); + if (!date.isValid() || !inputDate.isValid()) { + return false; + } - return BaseCell; -}(); + return date.diff(inputDate) <= 0; +} -exports.default = BaseCell; +(0, _conditionRegisterer.registerCondition)(CONDITION_NAME, condition, { + name: C.FILTERS_CONDITIONS_BEFORE, + inputsCount: 1, + showOperators: true +}); /***/ }), -/* 483 */ +/* 476 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; +exports.CONDITION_NAME = undefined; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); -var _array = __webpack_require__(0); +exports.condition = condition; -var _number = __webpack_require__(4); +var _constants = __webpack_require__(3); -var _element = __webpack_require__(2); +var C = _interopRequireWildcard(_constants); -var _base = __webpack_require__(168); +var _mixed = __webpack_require__(10); -var _base2 = _interopRequireDefault(_base); +var _conditionRegisterer = __webpack_require__(11); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var CONDITION_NAME = exports.CONDITION_NAME = 'contains'; -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +function condition(dataRow, _ref) { + var _ref2 = _slicedToArray(_ref, 1), + value = _ref2[0]; -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + return (0, _mixed.stringify)(dataRow.value).toLowerCase().indexOf((0, _mixed.stringify)(value)) >= 0; +} -/** - * Class responsible for the UI in the Nested Rows' row headers. - * - * @class HeadersUI - * @util - * @extends BaseUI - */ -var HeadersUI = function (_BaseUI) { - _inherits(HeadersUI, _BaseUI); +(0, _conditionRegisterer.registerCondition)(CONDITION_NAME, condition, { + name: C.FILTERS_CONDITIONS_CONTAINS, + inputsCount: 1, + showOperators: true +}); - _createClass(HeadersUI, null, [{ - key: 'CSS_CLASSES', +/***/ }), +/* 477 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * CSS classes used in the row headers. - * - * @type {Object} - */ - get: function get() { - return { - indicatorContainer: 'ht_nestingLevels', - parent: 'ht_nestingParent', - indicator: 'ht_nestingLevel', - emptyIndicator: 'ht_nestingLevel_empty', - button: 'ht_nestingButton', - expandButton: 'ht_nestingExpand', - collapseButton: 'ht_nestingCollapse' - }; - } - }]); +"use strict"; - function HeadersUI(nestedRowsPlugin, hotInstance) { - _classCallCheck(this, HeadersUI); - /** - * Reference to the DataManager instance connected with the Nested Rows plugin. - * - * @type {DataManager} - */ - var _this = _possibleConstructorReturn(this, (HeadersUI.__proto__ || Object.getPrototypeOf(HeadersUI)).call(this, nestedRowsPlugin, hotInstance)); +exports.__esModule = true; +exports.SHORT_NAME_FOR_COMPONENT = exports.OPERATION_ID = undefined; +exports.operationResult = operationResult; - _this.dataManager = _this.plugin.dataManager; - // /** - // * Level cache array. - // * - // * @type {Array} - // */ - // this.levelCache = this.dataManager.cache.levels; - /** - * Reference to the CollapsingUI instance connected with the Nested Rows plugin. - * - * @type {CollapsingUI} - */ - _this.collapsingUI = _this.plugin.collapsingUI; - /** - * Cache for the row headers width. - * - * @type {null|Number} - */ - _this.rowHeaderWidthCache = null; - /** - * Reference to the TrimRows instance connected with the Nested Rows plugin. - * - * @type {TrimRows} - */ - _this.trimRowsPlugin = nestedRowsPlugin.trimRowsPlugin; - return _this; - } +var _constants = __webpack_require__(3); - /** - * Append nesting indicators and buttons to the row headers. - * - * @private - * @param {Number} row Row index. - * @param {HTMLElement} TH TH 3element. - */ +var C = _interopRequireWildcard(_constants); +var _logicalOperationRegisterer = __webpack_require__(68); - _createClass(HeadersUI, [{ - key: 'appendLevelIndicators', - value: function appendLevelIndicators(row, TH) { - var rowIndex = this.trimRowsPlugin.rowsMapper.getValueByIndex(row); - var rowLevel = this.dataManager.getRowLevel(rowIndex); - var rowObject = this.dataManager.getDataObject(rowIndex); - var innerDiv = TH.getElementsByTagName('DIV')[0]; - var innerSpan = innerDiv.querySelector('span.rowHeader'); - var previousIndicators = innerDiv.querySelectorAll('[class^="ht_nesting"]'); +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - (0, _array.arrayEach)(previousIndicators, function (elem) { - if (elem) { - innerDiv.removeChild(elem); - } - }); +var OPERATION_ID = exports.OPERATION_ID = 'disjunction'; +var SHORT_NAME_FOR_COMPONENT = exports.SHORT_NAME_FOR_COMPONENT = C.FILTERS_LABELS_DISJUNCTION; +// (p OR q OR w OR x OR...) === TRUE? - (0, _element.addClass)(TH, HeadersUI.CSS_CLASSES.indicatorContainer); +function operationResult(conditions, value) { + return conditions.some(function (condition) { + return condition.func(value); + }); +} - if (rowLevel) { - var initialContent = innerSpan.cloneNode(true); - innerDiv.innerHTML = ''; +(0, _logicalOperationRegisterer.registerOperation)(OPERATION_ID, SHORT_NAME_FOR_COMPONENT, operationResult); - (0, _number.rangeEach)(0, rowLevel - 1, function () { - var levelIndicator = document.createElement('SPAN'); - (0, _element.addClass)(levelIndicator, HeadersUI.CSS_CLASSES.emptyIndicator); - innerDiv.appendChild(levelIndicator); - }); +/***/ }), +/* 478 */ +/***/ (function(module, exports, __webpack_require__) { - innerDiv.appendChild(initialContent); - } +"use strict"; - if (this.dataManager.hasChildren(rowObject)) { - var buttonsContainer = document.createElement('DIV'); - (0, _element.addClass)(TH, HeadersUI.CSS_CLASSES.parent); - if (this.collapsingUI.areChildrenCollapsed(rowIndex)) { - (0, _element.addClass)(buttonsContainer, HeadersUI.CSS_CLASSES.button + ' ' + HeadersUI.CSS_CLASSES.expandButton); - } else { - (0, _element.addClass)(buttonsContainer, HeadersUI.CSS_CLASSES.button + ' ' + HeadersUI.CSS_CLASSES.collapseButton); - } +exports.__esModule = true; +exports.SHORT_NAME_FOR_COMPONENT = exports.OPERATION_ID = undefined; +exports.operationResult = operationResult; - innerDiv.appendChild(buttonsContainer); - } - } +var _constants = __webpack_require__(3); - /** - * Update the row header width according to number of levels in the dataset. - * - * @private - * @param {Number} deepestLevel Cached deepest level of nesting. - */ +var C = _interopRequireWildcard(_constants); - }, { - key: 'updateRowHeaderWidth', - value: function updateRowHeaderWidth(deepestLevel) { - var deepestLevelIndex = deepestLevel; +var _logicalOperationRegisterer = __webpack_require__(68); - if (!deepestLevelIndex) { - deepestLevelIndex = this.dataManager.cache.levelCount; - } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - this.rowHeaderWidthCache = Math.max(50, 11 + 10 * deepestLevelIndex + 25); +var OPERATION_ID = exports.OPERATION_ID = 'disjunctionWithExtraCondition'; +var SHORT_NAME_FOR_COMPONENT = exports.SHORT_NAME_FOR_COMPONENT = C.FILTERS_LABELS_DISJUNCTION; +// ((p OR q OR w OR x OR...) AND z) === TRUE? - this.hot.render(); - } - }]); +function operationResult(conditions, value) { + if (conditions.length < 3) { + throw Error('Operation doesn\'t work on less then three conditions.'); + } - return HeadersUI; -}(_base2.default); + return conditions.slice(0, conditions.length - 1).some(function (condition) { + return condition.func(value); + }) && conditions[conditions.length - 1].func(value); +} -exports.default = HeadersUI; +(0, _logicalOperationRegisterer.registerOperation)(OPERATION_ID, SHORT_NAME_FOR_COMPONENT, operationResult); /***/ }), -/* 484 */ +/* 479 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56679,527 +56572,617 @@ exports.default = HeadersUI; exports.__esModule = true; -__webpack_require__(90); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -__webpack_require__(99); +var _templateObject = _taggedTemplateLiteral(['The column of index ', ' has been already applied with a `', '` \n filter operation. Use `removeConditions` to clear the current conditions and then add new ones. \n Mind that you cannot mix different types of operations (for instance, if you use `conjunction`, \n use it consequently for a particular column).'], ['The column of index ', ' has been already applied with a \\`', '\\` \n filter operation. Use \\`removeConditions\\` to clear the current conditions and then add new ones. \n Mind that you cannot mix different types of operations (for instance, if you use \\`conjunction\\`, \n use it consequently for a particular column).']); -__webpack_require__(100); +var _array = __webpack_require__(0); -__webpack_require__(101); +var _object = __webpack_require__(1); -__webpack_require__(102); +var _templateLiteralTag = __webpack_require__(26); -__webpack_require__(105); +var _localHooks = __webpack_require__(20); -__webpack_require__(107); +var _localHooks2 = _interopRequireDefault(_localHooks); -__webpack_require__(108); +var _conditionRegisterer = __webpack_require__(11); -__webpack_require__(109); +var _conjunction = __webpack_require__(165); -__webpack_require__(110); +var _logicalOperationRegisterer = __webpack_require__(68); -__webpack_require__(111); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(112); +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } -__webpack_require__(113); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -__webpack_require__(114); +/** + * @class ConditionCollection + * @plugin Filters + */ +var ConditionCollection = function () { + function ConditionCollection() { + _classCallCheck(this, ConditionCollection); -__webpack_require__(115); + /** + * Conditions collection grouped by operation type and then column index. + * + * @type {Object} + */ + this.conditions = this.initConditionsCollection(); -__webpack_require__(116); + /** + * Types of operations grouped by column index. + * + * @type {Object} + */ + this.columnTypes = {}; -__webpack_require__(117); + /** + * Order of added condition filters. + * + * @type {Array} + */ + this.orderStack = []; + } -__webpack_require__(118); + /** + * Check if condition collection is empty (so no needed to filter data). + * + * @returns {Boolean} + */ -__webpack_require__(119); -__webpack_require__(120); + _createClass(ConditionCollection, [{ + key: 'isEmpty', + value: function isEmpty() { + return !this.orderStack.length; + } -__webpack_require__(121); + /** + * Check if value is matched to the criteria of conditions chain. + * + * @param {Object} value Object with `value` and `meta` keys. + * @param {Number} [column] Column index. + * @returns {Boolean} + */ -__webpack_require__(122); + }, { + key: 'isMatch', + value: function isMatch(value, column) { + var _this = this; -__webpack_require__(123); + var result = true; -__webpack_require__(124); + if (column === void 0) { + (0, _object.objectEach)(this.columnTypes, function (columnType, columnIndex) { + result = _this.isMatchInConditions(_this.conditions[columnType][columnIndex], value, columnType); -__webpack_require__(125); + return result; + }); + } else { + var columnType = this.columnTypes[column]; -__webpack_require__(128); + result = this.isMatchInConditions(this.getConditions(column), value, columnType); + } -__webpack_require__(129); + return result; + } -__webpack_require__(130); + /** + * Check if the value is matches the conditions. + * + * @param {Array} conditions List of conditions. + * @param {Object} value Object with `value` and `meta` keys. + * @param {String} [operationType='conjunction'] Type of conditions operation + * @returns {Boolean} + */ -__webpack_require__(131); + }, { + key: 'isMatchInConditions', + value: function isMatchInConditions(conditions, value) { + var operationType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _conjunction.OPERATION_ID; -__webpack_require__(132); + var result = false; -__webpack_require__(133); + if (conditions.length) { + result = (0, _logicalOperationRegisterer.getOperationFunc)(operationType)(conditions, value); + } else { + result = true; + } -__webpack_require__(134); + return result; + } -__webpack_require__(135); + /** + * Add condition to the collection. + * + * @param {Number} column Column index. + * @param {Object} conditionDefinition Object with keys: + * * `command` Object, Command object with condition name as `key` property. + * * `args` Array, Condition arguments. + * @param {String} [operation='conjunction'] Type of conditions operation + * @fires ConditionCollection#beforeAdd + * @fires ConditionCollection#afterAdd + */ -__webpack_require__(137); + }, { + key: 'addCondition', + value: function addCondition(column, conditionDefinition) { + var operation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _conjunction.OPERATION_ID; -__webpack_require__(138); + var args = (0, _array.arrayMap)(conditionDefinition.args, function (v) { + return typeof v === 'string' ? v.toLowerCase() : v; + }); + var name = conditionDefinition.name || conditionDefinition.command.key; -__webpack_require__(139); + this.runLocalHooks('beforeAdd', column); -__webpack_require__(140); + if (this.orderStack.indexOf(column) === -1) { + this.orderStack.push(column); + } -__webpack_require__(141); + var columnType = this.columnTypes[column]; -__webpack_require__(82); + if (columnType) { + if (columnType !== operation) { + throw Error((0, _templateLiteralTag.toSingleLine)(_templateObject, column, columnType)); + } + } else { + if (!this.conditions[operation]) { + throw new Error('Unexpected operation named `' + operation + '`. Possible ones are `disjunction` and `conjunction`.'); + } -__webpack_require__(142); + this.columnTypes[column] = operation; + } -__webpack_require__(143); + // Add condition + this.getConditions(column).push({ + name: name, + args: args, + func: (0, _conditionRegisterer.getCondition)(name, args) + }); -__webpack_require__(144); + this.runLocalHooks('afterAdd', column); + } -__webpack_require__(145); + /** + * Get all added conditions from the collection at specified column index. + * + * @param {Number} column Column index. + * @returns {Array} Returns conditions collection as an array. + */ -__webpack_require__(146); + }, { + key: 'getConditions', + value: function getConditions(column) { + var columnType = this.columnTypes[column]; -__webpack_require__(147); + if (!columnType) { + return []; + } -__webpack_require__(148); + if (!this.conditions[columnType][column]) { + this.conditions[columnType][column] = []; + } -__webpack_require__(149); + return this.conditions[columnType][column]; + } -__webpack_require__(150); + /** + * Export all previously added conditions. + * + * @returns {Array} + */ -__webpack_require__(151); + }, { + key: 'exportAllConditions', + value: function exportAllConditions() { + var _this2 = this; -__webpack_require__(152); + var result = []; -__webpack_require__(153); + (0, _array.arrayEach)(this.orderStack, function (column) { + var conditions = (0, _array.arrayMap)(_this2.getConditions(column), function (_ref) { + var name = _ref.name, + args = _ref.args; + return { name: name, args: args }; + }); + var operation = _this2.columnTypes[column]; -__webpack_require__(154); + result.push({ + column: column, + operation: operation, + conditions: conditions + }); + }); -__webpack_require__(155); + return result; + } -__webpack_require__(156); + /** + * Import conditions to the collection. + */ -var _handsontable = __webpack_require__(503); + }, { + key: 'importAllConditions', + value: function importAllConditions(conditions) { + var _this3 = this; -var _handsontable2 = _interopRequireDefault(_handsontable); + this.clean(); -var _index = __webpack_require__(645); + (0, _array.arrayEach)(conditions, function (stack) { + _this3.orderStack.push(stack.column); -var plugins = _interopRequireWildcard(_index); + (0, _array.arrayEach)(stack.conditions, function (condition) { + return _this3.addCondition(stack.column, condition); + }); + }); + } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + /** + * Remove conditions at given column index. + * + * @param {Number} column Column index. + * @fires ConditionCollection#beforeRemove + * @fires ConditionCollection#afterRemove + */ -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + }, { + key: 'removeConditions', + value: function removeConditions(column) { + this.runLocalHooks('beforeRemove', column); -/* eslint-enable no-unused-vars */ + if (this.orderStack.indexOf(column) >= 0) { + this.orderStack.splice(this.orderStack.indexOf(column), 1); + } + this.clearConditions(column); + this.runLocalHooks('afterRemove', column); + } -_handsontable2.default.baseVersion = '6.1.1'; + /** + * Clear conditions at specified column index but without clearing stack order. + * + * @param {Number }column Column index. + * @fires ConditionCollection#beforeClear + * @fires ConditionCollection#afterClear + */ -/* eslint-disable no-unused-vars */ -exports.default = _handsontable2.default; + }, { + key: 'clearConditions', + value: function clearConditions(column) { + this.runLocalHooks('beforeClear', column); + this.getConditions(column).length = 0; + delete this.columnTypes[column]; + this.runLocalHooks('afterClear', column); + } -/***/ }), -/* 485 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Check if at least one condition was added at specified column index. And if second parameter is passed then additionally + * check if condition exists under its name. + * + * @param {Number} column Column index. + * @param {String} [name] Condition name. + * @returns {Boolean} + */ -var dP = __webpack_require__(25); -var anObject = __webpack_require__(22); -var getKeys = __webpack_require__(46); + }, { + key: 'hasConditions', + value: function hasConditions(column, name) { + var columnType = this.columnTypes[column]; + var result = false; -module.exports = __webpack_require__(27) ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var keys = getKeys(Properties); - var length = keys.length; - var i = 0; - var P; - while (length > i) dP.f(O, P = keys[i++], Properties[P]); - return O; -}; + if (!columnType) { + return false; + } + var conditions = this.getConditions(column); -/***/ }), -/* 486 */ -/***/ (function(module, exports, __webpack_require__) { + if (name) { + result = (0, _array.arrayFilter)(conditions, function (condition) { + return condition.name === name; + }).length > 0; + } else { + result = conditions.length > 0; + } -"use strict"; + return result; + } -var create = __webpack_require__(93); -var descriptor = __webpack_require__(59); -var setToStringTag = __webpack_require__(61); -var IteratorPrototype = {}; + /** + * Clean all conditions collection and reset order stack. + * + * @fires ConditionCollection#beforeClean + * @fires ConditionCollection#afterClean + */ -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -__webpack_require__(37)(IteratorPrototype, __webpack_require__(14)('iterator'), function () { return this; }); + }, { + key: 'clean', + value: function clean() { + this.runLocalHooks('beforeClean'); + this.columnTypes = Object.create(null); + this.orderStack.length = 0; + this.conditions = this.initConditionsCollection(); + this.runLocalHooks('afterClean'); + } -module.exports = function (Constructor, NAME, next) { - Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); - setToStringTag(Constructor, NAME + ' Iterator'); -}; + /** + * Destroy object. + */ + }, { + key: 'destroy', + value: function destroy() { + this.clearLocalHooks(); + this.conditions = null; + this.orderStack = null; + this.columnTypes = null; + } -/***/ }), -/* 487 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Init conditions collection + * + * @private + */ -var isObject = __webpack_require__(13); -var setPrototypeOf = __webpack_require__(182).set; -module.exports = function (that, target, C) { - var S = target.constructor; - var P; - if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { - setPrototypeOf(that, P); - } return that; -}; + }, { + key: 'initConditionsCollection', + value: function initConditionsCollection() { + var conditions = Object.create(null); + (0, _object.objectEach)(_logicalOperationRegisterer.operations, function (_, operation) { + conditions[operation] = Object.create(null); + }); -/***/ }), -/* 488 */ -/***/ (function(module, exports, __webpack_require__) { + return conditions; + } + }]); -// 9.4.2.3 ArraySpeciesCreate(originalArray, length) -var speciesConstructor = __webpack_require__(489); + return ConditionCollection; +}(); -module.exports = function (original, length) { - return new (speciesConstructor(original))(length); -}; +(0, _object.mixin)(ConditionCollection, _localHooks2.default); +exports.default = ConditionCollection; /***/ }), -/* 489 */ +/* 480 */ /***/ (function(module, exports, __webpack_require__) { -var isObject = __webpack_require__(13); -var isArray = __webpack_require__(183); -var SPECIES = __webpack_require__(14)('species'); +"use strict"; -module.exports = function (original) { - var C; - if (isArray(original)) { - C = original.constructor; - // cross-realm fallback - if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; - if (isObject(C)) { - C = C[SPECIES]; - if (C === null) C = undefined; - } - } return C === undefined ? Array : C; -}; +exports.__esModule = true; -/***/ }), -/* 490 */ -/***/ (function(module, exports, __webpack_require__) { +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -// 7.3.20 SpeciesConstructor(O, defaultConstructor) -var anObject = __webpack_require__(22); -var aFunction = __webpack_require__(74); -var SPECIES = __webpack_require__(14)('species'); -module.exports = function (O, D) { - var C = anObject(O).constructor; - var S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); -}; +var _array = __webpack_require__(0); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -/***/ }), -/* 491 */ -/***/ (function(module, exports) { +/** + * @class DataFilter + * @plugin Filters + * @pro + */ +var DataFilter = function () { + function DataFilter(conditionCollection) { + var columnDataFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () { + return []; + }; -// fast apply, http://jsperf.lnkit.com/fast-apply/5 -module.exports = function (fn, args, that) { - var un = that === undefined; - switch (args.length) { - case 0: return un ? fn() - : fn.call(that); - case 1: return un ? fn(args[0]) - : fn.call(that, args[0]); - case 2: return un ? fn(args[0], args[1]) - : fn.call(that, args[0], args[1]); - case 3: return un ? fn(args[0], args[1], args[2]) - : fn.call(that, args[0], args[1], args[2]); - case 4: return un ? fn(args[0], args[1], args[2], args[3]) - : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); -}; + _classCallCheck(this, DataFilter); + /** + * Reference to the instance of {ConditionCollection}. + * + * @type {ConditionCollection} + */ + this.conditionCollection = conditionCollection; + /** + * Function which provide source data factory for specified column. + * + * @type {Function} + */ + this.columnDataFactory = columnDataFactory; + } -/***/ }), -/* 492 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Filter data based on the conditions collection. + * + * @returns {Array} + */ -var global = __webpack_require__(16); -var macrotask = __webpack_require__(103).set; -var Observer = global.MutationObserver || global.WebKitMutationObserver; -var process = global.process; -var Promise = global.Promise; -var isNode = __webpack_require__(52)(process) == 'process'; -module.exports = function () { - var head, last, notify; + _createClass(DataFilter, [{ + key: 'filter', + value: function filter() { + var _this = this; - var flush = function () { - var parent, fn; - if (isNode && (parent = process.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (e) { - if (head) notify(); - else last = undefined; - throw e; - } - } last = undefined; - if (parent) parent.enter(); - }; + var filteredData = []; - // Node.js - if (isNode) { - notify = function () { - process.nextTick(flush); - }; - // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 - } else if (Observer && !(global.navigator && global.navigator.standalone)) { - var toggle = true; - var node = document.createTextNode(''); - new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new - notify = function () { - node.data = toggle = !toggle; - }; - // environments with maybe non-completely correct, but existent Promise - } else if (Promise && Promise.resolve) { - // Promise.resolve without an argument throws an error in LG WebOS 2 - var promise = Promise.resolve(undefined); - notify = function () { - promise.then(flush); - }; - // for other environments - macrotask based on: - // - setImmediate - // - MessageChannel - // - window.postMessag - // - onreadystatechange - // - setTimeout - } else { - notify = function () { - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(global, flush); - }; - } + if (!this.conditionCollection.isEmpty()) { + (0, _array.arrayEach)(this.conditionCollection.orderStack, function (column, index) { + var columnData = _this.columnDataFactory(column); - return function (fn) { - var task = { fn: fn, next: undefined }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } last = task; - }; -}; + if (index) { + columnData = _this._getIntersectData(columnData, filteredData); + } + filteredData = _this.filterByColumn(column, columnData); + }); + } -/***/ }), -/* 493 */ -/***/ (function(module, exports) { + return filteredData; + } -module.exports = function (exec) { - try { - return { e: false, v: exec() }; - } catch (e) { - return { e: true, v: e }; - } -}; + /** + * Filter data based on specified column index. + * + * @param {Number} column Column index. + * @param {Array} [dataSource] Data source as array of objects with `value` and `meta` keys (e.g. `{value: 'foo', meta: {}}`). + * @returns {Array} Returns filtered data. + */ + }, { + key: 'filterByColumn', + value: function filterByColumn(column) { + var _this2 = this; -/***/ }), -/* 494 */ -/***/ (function(module, exports, __webpack_require__) { + var dataSource = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; -var anObject = __webpack_require__(22); -var isObject = __webpack_require__(13); -var newPromiseCapability = __webpack_require__(186); + var filteredData = []; -module.exports = function (C, x) { - anObject(C); - if (isObject(x) && x.constructor === C) return x; - var promiseCapability = newPromiseCapability.f(C); - var resolve = promiseCapability.resolve; - resolve(x); - return promiseCapability.promise; -}; + (0, _array.arrayEach)(dataSource, function (dataRow) { + if (dataRow !== void 0 && _this2.conditionCollection.isMatch(dataRow, column)) { + filteredData.push(dataRow); + } + }); + return filteredData; + } -/***/ }), -/* 495 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Intersect data. + * + * @private + * @param {Array} data + * @param {Array} needles + * @returns {Array} + */ -var global = __webpack_require__(16); -var core = __webpack_require__(48); -var LIBRARY = __webpack_require__(57); -var wksExt = __webpack_require__(187); -var defineProperty = __webpack_require__(25).f; -module.exports = function (name) { - var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); - if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); -}; + }, { + key: '_getIntersectData', + value: function _getIntersectData(data, needles) { + var result = []; + (0, _array.arrayEach)(needles, function (needleRow) { + var row = needleRow.meta.visualRow; -/***/ }), -/* 496 */ -/***/ (function(module, exports, __webpack_require__) { + if (data[row] !== void 0) { + result[row] = data[row]; + } + }); -// all enumerable object keys, includes symbols -var getKeys = __webpack_require__(46); -var gOPS = __webpack_require__(80); -var pIE = __webpack_require__(62); -module.exports = function (it) { - var result = getKeys(it); - var getSymbols = gOPS.f; - if (getSymbols) { - var symbols = getSymbols(it); - var isEnum = pIE.f; - var i = 0; - var key; - while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); - } return result; -}; + return result; + } + }]); + + return DataFilter; +}(); +exports.default = DataFilter; /***/ }), -/* 497 */ -/***/ (function(module, exports) { +/* 481 */ +/***/ (function(module, exports, __webpack_require__) { -// 7.2.9 SameValue(x, y) -module.exports = Object.is || function is(x, y) { - // eslint-disable-next-line no-self-compare - return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; -}; +"use strict"; -/***/ }), -/* 498 */ -/***/ (function(module, exports, __webpack_require__) { +exports.__esModule = true; -var toInteger = __webpack_require__(71); -var defined = __webpack_require__(47); -// true -> String#at -// false -> String#codePointAt -module.exports = function (TO_STRING) { - return function (that, pos) { - var s = String(defined(that)); - var i = toInteger(pos); - var l = s.length; - var a, b; - if (i < 0 || i >= l) return TO_STRING ? '' : undefined; - a = s.charCodeAt(i); - return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff - ? TO_STRING ? s.charAt(i) : a - : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; - }; -}; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _object = __webpack_require__(1); -/***/ }), -/* 499 */ -/***/ (function(module, exports, __webpack_require__) { +var _hotFormulaParser = __webpack_require__(70); -"use strict"; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -// 21.2.5.3 get RegExp.prototype.flags -var anObject = __webpack_require__(22); -module.exports = function () { - var that = anObject(this); - var result = ''; - if (that.global) result += 'g'; - if (that.ignoreCase) result += 'i'; - if (that.multiline) result += 'm'; - if (that.unicode) result += 'u'; - if (that.sticky) result += 'y'; - return result; -}; +/** + * @class BaseCell + * @util + */ +var BaseCell = function () { + function BaseCell(row, column) { + _classCallCheck(this, BaseCell); + var rowObject = (0, _object.isObject)(row); + var columnObject = (0, _object.isObject)(column); -/***/ }), -/* 500 */ -/***/ (function(module, exports, __webpack_require__) { + this._row = rowObject ? row.index : row; + this.rowAbsolute = rowObject ? row.isAbsolute : true; + this._column = columnObject ? column.index : column; + this.columnAbsolute = columnObject ? column.isAbsolute : true; + this.rowOffset = 0; + this.columnOffset = 0; -"use strict"; -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + // TODO: Change syntax to es6 after upgrade tests to newer version of phantom and jasmine. + Object.defineProperty(this, 'row', { + get: function get() { + return this.rowOffset + this._row; + }, + set: function set(rowIndex) { + this._row = rowIndex; + }, -var toObject = __webpack_require__(39); -var toAbsoluteIndex = __webpack_require__(72); -var toLength = __webpack_require__(30); + enumerable: true, + configurable: true + }); + Object.defineProperty(this, 'column', { + get: function get() { + return this.columnOffset + this._column; + }, + set: function set(columnIndex) { + this._column = columnIndex; + }, -module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { - var O = toObject(this); - var len = toLength(O.length); - var to = toAbsoluteIndex(target, len); - var from = toAbsoluteIndex(start, len); - var end = arguments.length > 2 ? arguments[2] : undefined; - var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); - var inc = 1; - if (from < to && to < from + count) { - inc = -1; - from += count - 1; - to += count - 1; + enumerable: true, + configurable: true + }); } - while (count-- > 0) { - if (from in O) O[to] = O[from]; - else delete O[to]; - to += inc; - from += inc; - } return O; -}; + /** + * Translate cell coordinates. + * + * @param {Number} rowOffset Row offset to move. + * @param {Number} columnOffset Column offset to move. + */ -/***/ }), -/* 501 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + _createClass(BaseCell, [{ + key: 'translateTo', + value: function translateTo(rowOffset, columnOffset) { + this.row = this.row + rowOffset; + this.column = this.column + columnOffset; + } -var toObject = __webpack_require__(39); -var toAbsoluteIndex = __webpack_require__(72); -var toLength = __webpack_require__(30); -module.exports = function fill(value /* , start = 0, end = @length */) { - var O = toObject(this); - var length = toLength(O.length); - var aLen = arguments.length; - var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); - var end = aLen > 2 ? arguments[2] : undefined; - var endPos = end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; -}; + /** + * Check if cell is equal to provided one. + * + * @param {BaseCell} cell Cell object. + * @returns {Boolean} + */ + }, { + key: 'isEqual', + value: function isEqual(cell) { + return cell.row === this.row && cell.column === this.column; + } -/***/ }), -/* 502 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Stringify object. + * + * @returns {String} + */ -// all object keys, includes non-enumerable and symbols -var gOPN = __webpack_require__(106); -var gOPS = __webpack_require__(80); -var anObject = __webpack_require__(22); -var Reflect = __webpack_require__(16).Reflect; -module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { - var keys = gOPN.f(anObject(it)); - var getSymbols = gOPS.f; - return getSymbols ? keys.concat(getSymbols(it)) : keys; -}; + }, { + key: 'toString', + value: function toString() { + return (0, _hotFormulaParser.toLabel)({ index: this.row, isAbsolute: this.rowAbsolute }, { index: this.column, isAbsolute: this.columnAbsolute }); + } + }]); + + return BaseCell; +}(); +exports.default = BaseCell; /***/ }), -/* 503 */ +/* 482 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57207,27 +57190,208 @@ module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { exports.__esModule = true; -__webpack_require__(90); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -__webpack_require__(99); +var _array = __webpack_require__(0); -__webpack_require__(100); +var _number = __webpack_require__(4); -__webpack_require__(101); +var _element = __webpack_require__(2); -__webpack_require__(102); +var _base = __webpack_require__(168); -__webpack_require__(105); +var _base2 = _interopRequireDefault(_base); -__webpack_require__(107); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -__webpack_require__(108); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -__webpack_require__(109); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -__webpack_require__(110); +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -__webpack_require__(111); +/** + * Class responsible for the UI in the Nested Rows' row headers. + * + * @class HeadersUI + * @util + * @extends BaseUI + */ +var HeadersUI = function (_BaseUI) { + _inherits(HeadersUI, _BaseUI); + + _createClass(HeadersUI, null, [{ + key: 'CSS_CLASSES', + + /** + * CSS classes used in the row headers. + * + * @type {Object} + */ + get: function get() { + return { + indicatorContainer: 'ht_nestingLevels', + parent: 'ht_nestingParent', + indicator: 'ht_nestingLevel', + emptyIndicator: 'ht_nestingLevel_empty', + button: 'ht_nestingButton', + expandButton: 'ht_nestingExpand', + collapseButton: 'ht_nestingCollapse' + }; + } + }]); + + function HeadersUI(nestedRowsPlugin, hotInstance) { + _classCallCheck(this, HeadersUI); + + /** + * Reference to the DataManager instance connected with the Nested Rows plugin. + * + * @type {DataManager} + */ + var _this = _possibleConstructorReturn(this, (HeadersUI.__proto__ || Object.getPrototypeOf(HeadersUI)).call(this, nestedRowsPlugin, hotInstance)); + + _this.dataManager = _this.plugin.dataManager; + // /** + // * Level cache array. + // * + // * @type {Array} + // */ + // this.levelCache = this.dataManager.cache.levels; + /** + * Reference to the CollapsingUI instance connected with the Nested Rows plugin. + * + * @type {CollapsingUI} + */ + _this.collapsingUI = _this.plugin.collapsingUI; + /** + * Cache for the row headers width. + * + * @type {null|Number} + */ + _this.rowHeaderWidthCache = null; + /** + * Reference to the TrimRows instance connected with the Nested Rows plugin. + * + * @type {TrimRows} + */ + _this.trimRowsPlugin = nestedRowsPlugin.trimRowsPlugin; + return _this; + } + + /** + * Append nesting indicators and buttons to the row headers. + * + * @private + * @param {Number} row Row index. + * @param {HTMLElement} TH TH 3element. + */ + + + _createClass(HeadersUI, [{ + key: 'appendLevelIndicators', + value: function appendLevelIndicators(row, TH) { + var rowIndex = this.trimRowsPlugin.rowsMapper.getValueByIndex(row); + var rowLevel = this.dataManager.getRowLevel(rowIndex); + var rowObject = this.dataManager.getDataObject(rowIndex); + var innerDiv = TH.getElementsByTagName('DIV')[0]; + var innerSpan = innerDiv.querySelector('span.rowHeader'); + var previousIndicators = innerDiv.querySelectorAll('[class^="ht_nesting"]'); + + (0, _array.arrayEach)(previousIndicators, function (elem) { + if (elem) { + innerDiv.removeChild(elem); + } + }); + + (0, _element.addClass)(TH, HeadersUI.CSS_CLASSES.indicatorContainer); + + if (rowLevel) { + var initialContent = innerSpan.cloneNode(true); + innerDiv.innerHTML = ''; + + (0, _number.rangeEach)(0, rowLevel - 1, function () { + var levelIndicator = document.createElement('SPAN'); + (0, _element.addClass)(levelIndicator, HeadersUI.CSS_CLASSES.emptyIndicator); + innerDiv.appendChild(levelIndicator); + }); + + innerDiv.appendChild(initialContent); + } + + if (this.dataManager.hasChildren(rowObject)) { + var buttonsContainer = document.createElement('DIV'); + (0, _element.addClass)(TH, HeadersUI.CSS_CLASSES.parent); + + if (this.collapsingUI.areChildrenCollapsed(rowIndex)) { + (0, _element.addClass)(buttonsContainer, HeadersUI.CSS_CLASSES.button + ' ' + HeadersUI.CSS_CLASSES.expandButton); + } else { + (0, _element.addClass)(buttonsContainer, HeadersUI.CSS_CLASSES.button + ' ' + HeadersUI.CSS_CLASSES.collapseButton); + } + + innerDiv.appendChild(buttonsContainer); + } + } + + /** + * Update the row header width according to number of levels in the dataset. + * + * @private + * @param {Number} deepestLevel Cached deepest level of nesting. + */ + + }, { + key: 'updateRowHeaderWidth', + value: function updateRowHeaderWidth(deepestLevel) { + var deepestLevelIndex = deepestLevel; + + if (!deepestLevelIndex) { + deepestLevelIndex = this.dataManager.cache.levelCount; + } + + this.rowHeaderWidthCache = Math.max(50, 11 + 10 * deepestLevelIndex + 25); + + this.hot.render(); + } + }]); + + return HeadersUI; +}(_base2.default); + +exports.default = HeadersUI; + +/***/ }), +/* 483 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +__webpack_require__(89); + +__webpack_require__(98); + +__webpack_require__(99); + +__webpack_require__(100); + +__webpack_require__(101); + +__webpack_require__(104); + +__webpack_require__(106); + +__webpack_require__(107); + +__webpack_require__(108); + +__webpack_require__(109); + +__webpack_require__(110); + +__webpack_require__(111); __webpack_require__(112); @@ -57255,7 +57419,7 @@ __webpack_require__(123); __webpack_require__(124); -__webpack_require__(125); +__webpack_require__(127); __webpack_require__(128); @@ -57271,7 +57435,7 @@ __webpack_require__(133); __webpack_require__(134); -__webpack_require__(135); +__webpack_require__(136); __webpack_require__(137); @@ -57281,9 +57445,9 @@ __webpack_require__(139); __webpack_require__(140); -__webpack_require__(141); +__webpack_require__(83); -__webpack_require__(82); +__webpack_require__(141); __webpack_require__(142); @@ -57313,176 +57477,702 @@ __webpack_require__(154); __webpack_require__(155); -__webpack_require__(156); - -__webpack_require__(504); - -__webpack_require__(505); +var _handsontable = __webpack_require__(502); -__webpack_require__(506); +var _handsontable2 = _interopRequireDefault(_handsontable); -var _editors = __webpack_require__(19); +var _index = __webpack_require__(646); -var _renderers = __webpack_require__(15); +var plugins = _interopRequireWildcard(_index); -var _validators = __webpack_require__(42); +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -var _cellTypes = __webpack_require__(157); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _core = __webpack_require__(158); +/* eslint-enable no-unused-vars */ -var _core2 = _interopRequireDefault(_core); +_handsontable2.default.baseVersion = '6.2.0'; -var _jquery = __webpack_require__(565); +/* eslint-disable no-unused-vars */ +exports.default = _handsontable2.default; -var _jquery2 = _interopRequireDefault(_jquery); +/***/ }), +/* 484 */ +/***/ (function(module, exports, __webpack_require__) { -var _eventManager = __webpack_require__(9); +var dP = __webpack_require__(24); +var anObject = __webpack_require__(21); +var getKeys = __webpack_require__(48); -var _eventManager2 = _interopRequireDefault(_eventManager); +module.exports = __webpack_require__(27) ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = getKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) dP.f(O, P = keys[i++], Properties[P]); + return O; +}; -var _pluginHooks = __webpack_require__(17); -var _pluginHooks2 = _interopRequireDefault(_pluginHooks); +/***/ }), +/* 485 */ +/***/ (function(module, exports, __webpack_require__) { -var _ghostTable = __webpack_require__(160); +"use strict"; -var _ghostTable2 = _interopRequireDefault(_ghostTable); +var create = __webpack_require__(92); +var descriptor = __webpack_require__(60); +var setToStringTag = __webpack_require__(62); +var IteratorPrototype = {}; -var _array = __webpack_require__(0); +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +__webpack_require__(37)(IteratorPrototype, __webpack_require__(14)('iterator'), function () { return this; }); -var arrayHelpers = _interopRequireWildcard(_array); +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); + setToStringTag(Constructor, NAME + ' Iterator'); +}; -var _browser = __webpack_require__(50); -var browserHelpers = _interopRequireWildcard(_browser); +/***/ }), +/* 486 */ +/***/ (function(module, exports, __webpack_require__) { -var _data = __webpack_require__(83); +var isObject = __webpack_require__(13); +var setPrototypeOf = __webpack_require__(182).set; +module.exports = function (that, target, C) { + var S = target.constructor; + var P; + if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { + setPrototypeOf(that, P); + } return that; +}; -var dataHelpers = _interopRequireWildcard(_data); -var _date = __webpack_require__(454); +/***/ }), +/* 487 */ +/***/ (function(module, exports, __webpack_require__) { -var dateHelpers = _interopRequireWildcard(_date); +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = __webpack_require__(488); -var _feature = __webpack_require__(41); +module.exports = function (original, length) { + return new (speciesConstructor(original))(length); +}; -var featureHelpers = _interopRequireWildcard(_feature); -var _function = __webpack_require__(34); +/***/ }), +/* 488 */ +/***/ (function(module, exports, __webpack_require__) { -var functionHelpers = _interopRequireWildcard(_function); +var isObject = __webpack_require__(13); +var isArray = __webpack_require__(183); +var SPECIES = __webpack_require__(14)('species'); -var _mixed = __webpack_require__(8); +module.exports = function (original) { + var C; + if (isArray(original)) { + C = original.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; + if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } return C === undefined ? Array : C; +}; -var mixedHelpers = _interopRequireWildcard(_mixed); -var _number = __webpack_require__(4); +/***/ }), +/* 489 */ +/***/ (function(module, exports, __webpack_require__) { -var numberHelpers = _interopRequireWildcard(_number); +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = __webpack_require__(21); +var aFunction = __webpack_require__(75); +var SPECIES = __webpack_require__(14)('species'); +module.exports = function (O, D) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; -var _object = __webpack_require__(1); -var objectHelpers = _interopRequireWildcard(_object); +/***/ }), +/* 490 */ +/***/ (function(module, exports) { -var _setting = __webpack_require__(159); +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; -var settingHelpers = _interopRequireWildcard(_setting); -var _string = __webpack_require__(32); +/***/ }), +/* 491 */ +/***/ (function(module, exports, __webpack_require__) { -var stringHelpers = _interopRequireWildcard(_string); +var global = __webpack_require__(16); +var macrotask = __webpack_require__(102).set; +var Observer = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var isNode = __webpack_require__(52)(process) == 'process'; -var _unicode = __webpack_require__(18); +module.exports = function () { + var head, last, notify; -var unicodeHelpers = _interopRequireWildcard(_unicode); + var flush = function () { + var parent, fn; + if (isNode && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; -var _element = __webpack_require__(2); + // Node.js + if (isNode) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 + } else if (Observer && !(global.navigator && global.navigator.standalone)) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + var promise = Promise.resolve(undefined); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } -var domHelpers = _interopRequireWildcard(_element); + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; +}; -var _event = __webpack_require__(12); -var domEventHelpers = _interopRequireWildcard(_event); +/***/ }), +/* 492 */ +/***/ (function(module, exports) { -var _index = __webpack_require__(566); +module.exports = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } +}; -var plugins = _interopRequireWildcard(_index); -var _plugins = __webpack_require__(5); +/***/ }), +/* 493 */ +/***/ (function(module, exports, __webpack_require__) { -var _defaultSettings = __webpack_require__(458); +var anObject = __webpack_require__(21); +var isObject = __webpack_require__(13); +var newPromiseCapability = __webpack_require__(186); -var _defaultSettings2 = _interopRequireDefault(_defaultSettings); +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; -var _rootInstance = __webpack_require__(457); -var _i18n = __webpack_require__(459); +/***/ }), +/* 494 */ +/***/ (function(module, exports, __webpack_require__) { -var _constants = __webpack_require__(3); +var global = __webpack_require__(16); +var core = __webpack_require__(50); +var LIBRARY = __webpack_require__(58); +var wksExt = __webpack_require__(187); +var defineProperty = __webpack_require__(24).f; +module.exports = function (name) { + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); +}; -var constants = _interopRequireWildcard(_constants); -var _dictionariesManager = __webpack_require__(84); +/***/ }), +/* 495 */ +/***/ (function(module, exports, __webpack_require__) { -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +// all enumerable object keys, includes symbols +var getKeys = __webpack_require__(48); +var gOPS = __webpack_require__(81); +var pIE = __webpack_require__(63); +module.exports = function (it) { + var result = getKeys(it); + var getSymbols = gOPS.f; + if (getSymbols) { + var symbols = getSymbols(it); + var isEnum = pIE.f; + var i = 0; + var key; + while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); + } return result; +}; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function Handsontable(rootElement, userSettings) { - var instance = new _core2.default(rootElement, userSettings || {}, _rootInstance.rootInstanceSymbol); +/***/ }), +/* 496 */ +/***/ (function(module, exports) { - instance.init(); +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; - return instance; -} -(0, _jquery2.default)(Handsontable); +/***/ }), +/* 497 */ +/***/ (function(module, exports, __webpack_require__) { -Handsontable.Core = _core2.default; -Handsontable.DefaultSettings = _defaultSettings2.default; -Handsontable.EventManager = _eventManager2.default; -Handsontable._getListenersCounter = _eventManager.getListenersCounter; // For MemoryLeak tests +var toInteger = __webpack_require__(72); +var defined = __webpack_require__(49); +// true -> String#at +// false -> String#codePointAt +module.exports = function (TO_STRING) { + return function (that, pos) { + var s = String(defined(that)); + var i = toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; -Handsontable.buildDate = '23/10/2018 12:28:31'; -Handsontable.packageName = 'handsontable-pro'; -Handsontable.version = '6.1.1'; -var baseVersion = '6.1.1'; +/***/ }), +/* 498 */ +/***/ (function(module, exports, __webpack_require__) { -if (baseVersion) { - Handsontable.baseVersion = baseVersion; -} +"use strict"; -// Export Hooks singleton -Handsontable.hooks = _pluginHooks2.default.getSingleton(); +// 21.2.5.3 get RegExp.prototype.flags +var anObject = __webpack_require__(21); +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; +}; -// TODO: Remove this exports after rewrite tests about this module -Handsontable.__GhostTable = _ghostTable2.default; -// -// Export all helpers to the Handsontable object -var HELPERS = [arrayHelpers, browserHelpers, dataHelpers, dateHelpers, featureHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers]; -var DOM = [domHelpers, domEventHelpers]; +/***/ }), +/* 499 */ +/***/ (function(module, exports, __webpack_require__) { -Handsontable.helper = {}; -Handsontable.dom = {}; +"use strict"; +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) -// Fill general helpers. -arrayHelpers.arrayEach(HELPERS, function (helper) { - arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), function (key) { - if (key.charAt(0) !== '_') { - Handsontable.helper[key] = helper[key]; - } - }); -}); +var toObject = __webpack_require__(39); +var toAbsoluteIndex = __webpack_require__(73); +var toLength = __webpack_require__(30); -// Fill DOM helpers. -arrayHelpers.arrayEach(DOM, function (helper) { - arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), function (key) { - if (key.charAt(0) !== '_') { - Handsontable.dom[key] = helper[key]; - } +module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; + + +/***/ }), +/* 500 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + +var toObject = __webpack_require__(39); +var toAbsoluteIndex = __webpack_require__(73); +var toLength = __webpack_require__(30); +module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = toLength(O.length); + var aLen = arguments.length; + var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); + var end = aLen > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; +}; + + +/***/ }), +/* 501 */ +/***/ (function(module, exports, __webpack_require__) { + +// all object keys, includes non-enumerable and symbols +var gOPN = __webpack_require__(105); +var gOPS = __webpack_require__(81); +var anObject = __webpack_require__(21); +var Reflect = __webpack_require__(16).Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { + var keys = gOPN.f(anObject(it)); + var getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; + + +/***/ }), +/* 502 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +__webpack_require__(89); + +__webpack_require__(98); + +__webpack_require__(99); + +__webpack_require__(100); + +__webpack_require__(101); + +__webpack_require__(104); + +__webpack_require__(106); + +__webpack_require__(107); + +__webpack_require__(108); + +__webpack_require__(109); + +__webpack_require__(110); + +__webpack_require__(111); + +__webpack_require__(112); + +__webpack_require__(113); + +__webpack_require__(114); + +__webpack_require__(115); + +__webpack_require__(116); + +__webpack_require__(117); + +__webpack_require__(118); + +__webpack_require__(119); + +__webpack_require__(120); + +__webpack_require__(121); + +__webpack_require__(122); + +__webpack_require__(123); + +__webpack_require__(124); + +__webpack_require__(127); + +__webpack_require__(128); + +__webpack_require__(129); + +__webpack_require__(130); + +__webpack_require__(131); + +__webpack_require__(132); + +__webpack_require__(133); + +__webpack_require__(134); + +__webpack_require__(136); + +__webpack_require__(137); + +__webpack_require__(138); + +__webpack_require__(139); + +__webpack_require__(140); + +__webpack_require__(83); + +__webpack_require__(141); + +__webpack_require__(142); + +__webpack_require__(143); + +__webpack_require__(144); + +__webpack_require__(145); + +__webpack_require__(146); + +__webpack_require__(147); + +__webpack_require__(148); + +__webpack_require__(149); + +__webpack_require__(150); + +__webpack_require__(151); + +__webpack_require__(152); + +__webpack_require__(153); + +__webpack_require__(154); + +__webpack_require__(155); + +__webpack_require__(503); + +__webpack_require__(504); + +__webpack_require__(505); + +var _editors = __webpack_require__(19); + +var _renderers = __webpack_require__(15); + +var _validators = __webpack_require__(44); + +var _cellTypes = __webpack_require__(156); + +var _core = __webpack_require__(157); + +var _core2 = _interopRequireDefault(_core); + +var _jquery = __webpack_require__(564); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _eventManager = __webpack_require__(8); + +var _eventManager2 = _interopRequireDefault(_eventManager); + +var _pluginHooks = __webpack_require__(17); + +var _pluginHooks2 = _interopRequireDefault(_pluginHooks); + +var _ghostTable = __webpack_require__(159); + +var _ghostTable2 = _interopRequireDefault(_ghostTable); + +var _array = __webpack_require__(0); + +var arrayHelpers = _interopRequireWildcard(_array); + +var _browser = __webpack_require__(42); + +var browserHelpers = _interopRequireWildcard(_browser); + +var _data = __webpack_require__(84); + +var dataHelpers = _interopRequireWildcard(_data); + +var _date = __webpack_require__(454); + +var dateHelpers = _interopRequireWildcard(_date); + +var _feature = __webpack_require__(43); + +var featureHelpers = _interopRequireWildcard(_feature); + +var _function = __webpack_require__(34); + +var functionHelpers = _interopRequireWildcard(_function); + +var _mixed = __webpack_require__(10); + +var mixedHelpers = _interopRequireWildcard(_mixed); + +var _number = __webpack_require__(4); + +var numberHelpers = _interopRequireWildcard(_number); + +var _object = __webpack_require__(1); + +var objectHelpers = _interopRequireWildcard(_object); + +var _setting = __webpack_require__(158); + +var settingHelpers = _interopRequireWildcard(_setting); + +var _string = __webpack_require__(32); + +var stringHelpers = _interopRequireWildcard(_string); + +var _unicode = __webpack_require__(18); + +var unicodeHelpers = _interopRequireWildcard(_unicode); + +var _element = __webpack_require__(2); + +var domHelpers = _interopRequireWildcard(_element); + +var _event = __webpack_require__(12); + +var domEventHelpers = _interopRequireWildcard(_event); + +var _index = __webpack_require__(565); + +var plugins = _interopRequireWildcard(_index); + +var _plugins = __webpack_require__(5); + +var _defaultSettings = __webpack_require__(458); + +var _defaultSettings2 = _interopRequireDefault(_defaultSettings); + +var _rootInstance = __webpack_require__(457); + +var _i18n = __webpack_require__(459); + +var _constants = __webpack_require__(3); + +var constants = _interopRequireWildcard(_constants); + +var _dictionariesManager = __webpack_require__(85); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function Handsontable(rootElement, userSettings) { + var instance = new _core2.default(rootElement, userSettings || {}, _rootInstance.rootInstanceSymbol); + + instance.init(); + + return instance; +} + +(0, _jquery2.default)(Handsontable); + +Handsontable.Core = _core2.default; +Handsontable.DefaultSettings = _defaultSettings2.default; +Handsontable.EventManager = _eventManager2.default; +Handsontable._getListenersCounter = _eventManager.getListenersCounter; // For MemoryLeak tests + +Handsontable.buildDate = '14/11/2018 12:28:46'; +Handsontable.packageName = 'handsontable-pro'; +Handsontable.version = '6.2.0'; + +var baseVersion = '6.2.0'; + +if (baseVersion) { + Handsontable.baseVersion = baseVersion; +} + +// Export Hooks singleton +Handsontable.hooks = _pluginHooks2.default.getSingleton(); + +// TODO: Remove this exports after rewrite tests about this module +Handsontable.__GhostTable = _ghostTable2.default; +// + +// Export all helpers to the Handsontable object +var HELPERS = [arrayHelpers, browserHelpers, dataHelpers, dateHelpers, featureHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers]; +var DOM = [domHelpers, domEventHelpers]; + +Handsontable.helper = {}; +Handsontable.dom = {}; + +// Fill general helpers. +arrayHelpers.arrayEach(HELPERS, function (helper) { + arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), function (key) { + if (key.charAt(0) !== '_') { + Handsontable.helper[key] = helper[key]; + } + }); +}); + +// Fill DOM helpers. +arrayHelpers.arrayEach(DOM, function (helper) { + arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), function (key) { + if (key.charAt(0) !== '_') { + Handsontable.dom[key] = helper[key]; + } }); }); @@ -57560,25 +58250,25 @@ Handsontable.languages.getTranslatedPhrase = function () { exports.default = Handsontable; /***/ }), -/* 504 */ +/* 503 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 505 */ +/* 504 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 506 */ +/* 505 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 507 */ +/* 506 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57633,7 +58323,7 @@ _base2.default.registerOverlay(_base2.default.CLONE_DEBUG, DebugOverlay); exports.default = DebugOverlay; /***/ }), -/* 508 */ +/* 507 */ /***/ (function(module, exports, __webpack_require__) { var map = { @@ -57890,10 +58580,10 @@ webpackContext.keys = function webpackContextKeys() { }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; -webpackContext.id = 508; +webpackContext.id = 507; /***/ }), -/* 509 */ +/* 508 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -58263,7 +58953,7 @@ _base2.default.registerOverlay(_base2.default.CLONE_LEFT, LeftOverlay); exports.default = LeftOverlay; /***/ }), -/* 510 */ +/* 509 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -58691,7 +59381,7 @@ _base2.default.registerOverlay(_base2.default.CLONE_TOP, TopOverlay); exports.default = TopOverlay; /***/ }), -/* 511 */ +/* 510 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -58801,7 +59491,7 @@ _base2.default.registerOverlay(_base2.default.CLONE_TOP_LEFT_CORNER, TopLeftCorn exports.default = TopLeftCornerOverlay; /***/ }), -/* 512 */ +/* 511 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59178,7 +59868,7 @@ _base2.default.registerOverlay(_base2.default.CLONE_BOTTOM, BottomOverlay); exports.default = BottomOverlay; /***/ }), -/* 513 */ +/* 512 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59313,7 +60003,7 @@ _base2.default.registerOverlay(_base2.default.CLONE_BOTTOM_LEFT_CORNER, BottomLe exports.default = BottomLeftCornerOverlay; /***/ }), -/* 514 */ +/* 513 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59333,7 +60023,7 @@ var _border = __webpack_require__(327); var _border2 = _interopRequireDefault(_border); -var _coords = __webpack_require__(64); +var _coords = __webpack_require__(65); var _coords2 = _interopRequireDefault(_coords); @@ -59657,7 +60347,7 @@ var Selection = function () { exports.default = Selection; /***/ }), -/* 515 */ +/* 514 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59840,7 +60530,7 @@ if (true) { } /***/ }), -/* 516 */ +/* 515 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59850,7 +60540,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _baseEditor = __webpack_require__(63); +var _baseEditor = __webpack_require__(64); var _baseEditor2 = _interopRequireDefault(_baseEditor); @@ -59922,7 +60612,7 @@ var CheckboxEditor = function (_BaseEditor) { exports.default = CheckboxEditor; /***/ }), -/* 517 */ +/* 516 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59934,21 +60624,21 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _moment = __webpack_require__(23); +var _moment = __webpack_require__(25); var _moment2 = _interopRequireDefault(_moment); -var _pikaday = __webpack_require__(518); +var _pikaday = __webpack_require__(517); var _pikaday2 = _interopRequireDefault(_pikaday); -__webpack_require__(521); +__webpack_require__(520); var _element = __webpack_require__(2); var _object = __webpack_require__(1); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -59956,7 +60646,7 @@ var _unicode = __webpack_require__(18); var _event = __webpack_require__(12); -var _textEditor = __webpack_require__(65); +var _textEditor = __webpack_require__(66); var _textEditor2 = _interopRequireDefault(_textEditor); @@ -59972,7 +60662,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * @private * @editor DateEditor * @class DateEditor - * @dependencies TextEditor moment pikaday + * @dependencies TextEditor */ var DateEditor = function (_TextEditor) { _inherits(DateEditor, _TextEditor); @@ -60067,7 +60757,6 @@ var DateEditor = function (_TextEditor) { }, { key: 'prepare', value: function prepare(row, col, prop, td, originalValue, cellProperties) { - this._opened = false; _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'prepare', this).call(this, row, col, prop, td, originalValue, cellProperties); } @@ -60257,7 +60946,7 @@ var DateEditor = function (_TextEditor) { exports.default = DateEditor; /***/ }), -/* 518 */ +/* 517 */ /***/ (function(module, exports, __webpack_require__) { /*! @@ -60274,7 +60963,7 @@ exports.default = DateEditor; if (true) { // CommonJS module // Load moment.js as an optional dependency - try { moment = __webpack_require__(519); } catch (e) {} + try { moment = __webpack_require__(518); } catch (e) {} module.exports = factory(moment); } else if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. @@ -61456,7 +62145,7 @@ exports.default = DateEditor; /***/ }), -/* 519 */ +/* 518 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js @@ -63294,7 +63983,7 @@ exports.default = DateEditor; try { oldLocale = globalLocale._abbr; var aliasedRequire = require; - __webpack_require__(520)("./" + name); + __webpack_require__(519)("./" + name); getSetGlobalLocale(oldLocale); } catch (e) {} } @@ -65969,7 +66658,7 @@ exports.default = DateEditor; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(200)(module))) /***/ }), -/* 520 */ +/* 519 */ /***/ (function(module, exports, __webpack_require__) { var map = { @@ -66234,16 +66923,16 @@ webpackContext.keys = function webpackContextKeys() { }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; -webpackContext.id = 520; +webpackContext.id = 519; /***/ }), -/* 521 */ +/* 520 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 522 */ +/* 521 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66312,7 +67001,7 @@ _pluginHooks2.default.getSingleton().add('beforeValidate', function (value, row, exports.default = DropdownEditor; /***/ }), -/* 523 */ +/* 522 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66320,7 +67009,7 @@ exports.default = DropdownEditor; exports.__esModule = true; -var _textEditor = __webpack_require__(65); +var _textEditor = __webpack_require__(66); var _textEditor2 = _interopRequireDefault(_textEditor); @@ -66352,7 +67041,7 @@ var NumericEditor = function (_TextEditor) { exports.default = NumericEditor; /***/ }), -/* 524 */ +/* 523 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66366,7 +67055,7 @@ var _get = function get(object, property, receiver) { if (object === null) objec var _element = __webpack_require__(2); -var _textEditor = __webpack_require__(65); +var _textEditor = __webpack_require__(66); var _textEditor2 = _interopRequireDefault(_textEditor); @@ -66416,7 +67105,7 @@ var PasswordEditor = function (_TextEditor) { exports.default = PasswordEditor; /***/ }), -/* 525 */ +/* 524 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66432,7 +67121,7 @@ var _event = __webpack_require__(12); var _unicode = __webpack_require__(18); -var _baseEditor = __webpack_require__(63); +var _baseEditor = __webpack_require__(64); var _baseEditor2 = _interopRequireDefault(_baseEditor); @@ -66687,7 +67376,7 @@ SelectEditor.prototype.getEditedCell = function () { exports.default = SelectEditor; /***/ }), -/* 526 */ +/* 525 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66735,7 +67424,7 @@ function cellDecorator(instance, TD, row, col, prop, value, cellProperties) { exports.default = cellDecorator; /***/ }), -/* 527 */ +/* 526 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66745,11 +67434,11 @@ exports.__esModule = true; var _element = __webpack_require__(2); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); var _index = __webpack_require__(15); @@ -66819,7 +67508,7 @@ function autocompleteRenderer(instance, TD, row, col, prop, value, cellPropertie exports.default = autocompleteRenderer; /***/ }), -/* 528 */ +/* 527 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66831,7 +67520,7 @@ var _element = __webpack_require__(2); var _string = __webpack_require__(32); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -67191,7 +67880,7 @@ function isCheckboxInput(element) { exports.default = checkboxRenderer; /***/ }), -/* 529 */ +/* 528 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67227,7 +67916,7 @@ function htmlRenderer(instance, TD, row, col, prop, value) { exports.default = htmlRenderer; /***/ }), -/* 530 */ +/* 529 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67250,7 +67939,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * * @private * @renderer NumericRenderer - * @dependencies numbro * @param {Object} instance Handsontable instance * @param {Element} TD Table cell where to render * @param {Number} row @@ -67299,7 +67987,7 @@ function numericRenderer(instance, TD, row, col, prop, value, cellProperties) { exports.default = numericRenderer; /***/ }), -/* 531 */ +/* 530 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67345,7 +68033,7 @@ function passwordRenderer(instance, TD, row, col, prop, value, cellProperties) { exports.default = passwordRenderer; /***/ }), -/* 532 */ +/* 531 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67355,7 +68043,7 @@ exports.__esModule = true; var _element = __webpack_require__(2); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); var _index = __webpack_require__(15); @@ -67407,7 +68095,7 @@ function textRenderer(instance, TD, row, col, prop, value, cellProperties) { exports.default = textRenderer; /***/ }), -/* 533 */ +/* 532 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67471,7 +68159,7 @@ function process(value, callback) { } /***/ }), -/* 534 */ +/* 533 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67481,7 +68169,7 @@ exports.__esModule = true; exports.default = dateValidator; exports.correctFormat = correctFormat; -var _moment = __webpack_require__(23); +var _moment = __webpack_require__(25); var _moment2 = _interopRequireDefault(_moment); @@ -67496,7 +68184,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * * @private * @validator DateValidator - * @dependencies moment * @param {*} value - Value of edited cell * @param {Function} callback - Callback called with validation result */ @@ -67563,7 +68250,7 @@ function correctFormat(value, dateFormat) { } /***/ }), -/* 535 */ +/* 534 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67595,7 +68282,7 @@ function numericValidator(value, callback) { } /***/ }), -/* 536 */ +/* 535 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67604,7 +68291,7 @@ function numericValidator(value, callback) { exports.__esModule = true; exports.default = timeValidator; -var _moment = __webpack_require__(23); +var _moment = __webpack_require__(25); var _moment2 = _interopRequireDefault(_moment); @@ -67620,7 +68307,6 @@ var STRICT_FORMATS = ['YYYY-MM-DDTHH:mm:ss.SSSZ', 'X', // Unix timestamp * * @private * @validator TimeValidator - * @dependencies moment * @param {*} value - Value of edited cell * @param {Function} callback - Callback called with validation result */ @@ -67675,7 +68361,7 @@ function timeValidator(value, callback) { } /***/ }), -/* 537 */ +/* 536 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67687,7 +68373,7 @@ var _editors = __webpack_require__(19); var _renderers = __webpack_require__(15); -var _validators = __webpack_require__(42); +var _validators = __webpack_require__(44); var CELL_TYPE = 'autocomplete'; @@ -67698,7 +68384,7 @@ exports.default = { }; /***/ }), -/* 538 */ +/* 537 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67718,7 +68404,7 @@ exports.default = { }; /***/ }), -/* 539 */ +/* 538 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67730,7 +68416,7 @@ var _editors = __webpack_require__(19); var _renderers = __webpack_require__(15); -var _validators = __webpack_require__(42); +var _validators = __webpack_require__(44); var CELL_TYPE = 'date'; @@ -67742,7 +68428,7 @@ exports.default = { }; /***/ }), -/* 540 */ +/* 539 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67754,7 +68440,7 @@ var _editors = __webpack_require__(19); var _renderers = __webpack_require__(15); -var _validators = __webpack_require__(42); +var _validators = __webpack_require__(44); var CELL_TYPE = 'dropdown'; @@ -67766,7 +68452,7 @@ exports.default = { }; /***/ }), -/* 541 */ +/* 540 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67787,7 +68473,7 @@ exports.default = { }; /***/ }), -/* 542 */ +/* 541 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67799,7 +68485,7 @@ var _editors = __webpack_require__(19); var _renderers = __webpack_require__(15); -var _validators = __webpack_require__(42); +var _validators = __webpack_require__(44); var CELL_TYPE = 'numeric'; @@ -67811,7 +68497,7 @@ exports.default = { }; /***/ }), -/* 543 */ +/* 542 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67832,7 +68518,7 @@ exports.default = { }; /***/ }), -/* 544 */ +/* 543 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67852,7 +68538,7 @@ exports.default = { }; /***/ }), -/* 545 */ +/* 544 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67864,7 +68550,7 @@ var _editors = __webpack_require__(19); var _renderers = __webpack_require__(15); -var _validators = __webpack_require__(42); +var _validators = __webpack_require__(44); var CELL_TYPE = 'time'; @@ -67876,7 +68562,7 @@ exports.default = { }; /***/ }), -/* 546 */ +/* 545 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67890,21 +68576,21 @@ var _SheetClip = __webpack_require__(455); var _SheetClip2 = _interopRequireDefault(_SheetClip); -var _data = __webpack_require__(83); +var _data = __webpack_require__(84); -var _setting = __webpack_require__(159); +var _setting = __webpack_require__(158); var _object = __webpack_require__(1); var _array = __webpack_require__(0); -var _interval = __webpack_require__(547); +var _interval = __webpack_require__(546); var _interval2 = _interopRequireDefault(_interval); var _number = __webpack_require__(4); -var _multiMap = __webpack_require__(548); +var _multiMap = __webpack_require__(547); var _multiMap2 = _interopRequireDefault(_multiMap); @@ -68786,7 +69472,7 @@ DataMap.prototype.destroy = function () { exports.default = DataMap; /***/ }), -/* 547 */ +/* 546 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -68798,7 +69484,7 @@ var _createClass = function () { function defineProperties(target, props) { for exports.parseDelay = parseDelay; -var _feature = __webpack_require__(41); +var _feature = __webpack_require__(43); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -68945,7 +69631,7 @@ function parseDelay(delay) { } /***/ }), -/* 548 */ +/* 547 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -69004,7 +69690,7 @@ function MultiMap() { exports.default = MultiMap; /***/ }), -/* 549 */ +/* 548 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -69012,7 +69698,7 @@ exports.default = MultiMap; exports.__esModule = true; -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); var _unicode = __webpack_require__(18); @@ -69020,11 +69706,11 @@ var _event = __webpack_require__(12); var _editors = __webpack_require__(19); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); -var _baseEditor = __webpack_require__(63); +var _baseEditor = __webpack_require__(64); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -69473,7 +70159,7 @@ EditorManager.getInstance = function (hotInstance, hotSettings, selection, datam exports.default = EditorManager; /***/ }), -/* 550 */ +/* 549 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -69485,13 +70171,13 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [ var _element = __webpack_require__(2); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); var _event = __webpack_require__(12); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); var _src2 = _interopRequireDefault(_src); @@ -70206,7 +70892,7 @@ TableView.prototype.destroy = function () { exports.default = TableView; /***/ }), -/* 551 */ +/* 550 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70471,7 +71157,7 @@ var DataSource = function () { exports.default = DataSource; /***/ }), -/* 552 */ +/* 551 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70503,7 +71189,7 @@ var dictionary = (_dictionary = { exports.default = dictionary; /***/ }), -/* 553 */ +/* 552 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70514,11 +71200,11 @@ exports.getPhraseFormatters = exports.registerPhraseFormatter = undefined; exports.register = register; exports.getAll = getAll; -var _staticRegister2 = __webpack_require__(49); +var _staticRegister2 = __webpack_require__(41); var _staticRegister3 = _interopRequireDefault(_staticRegister2); -var _pluralize = __webpack_require__(554); +var _pluralize = __webpack_require__(553); var _pluralize2 = _interopRequireDefault(_pluralize); @@ -70556,7 +71242,7 @@ exports.getPhraseFormatters = getAll; register('pluralize', _pluralize2.default); /***/ }), -/* 554 */ +/* 553 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70583,7 +71269,7 @@ function pluralize(phrasePropositions, pluralForm) { } /***/ }), -/* 555 */ +/* 554 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70592,31 +71278,31 @@ function pluralize(phrasePropositions, pluralForm) { exports.__esModule = true; exports.createHighlight = undefined; -var _staticRegister2 = __webpack_require__(49); +var _staticRegister2 = __webpack_require__(41); var _staticRegister3 = _interopRequireDefault(_staticRegister2); -var _activeHeader = __webpack_require__(556); +var _activeHeader = __webpack_require__(555); var _activeHeader2 = _interopRequireDefault(_activeHeader); -var _area = __webpack_require__(557); +var _area = __webpack_require__(556); var _area2 = _interopRequireDefault(_area); -var _cell = __webpack_require__(558); +var _cell = __webpack_require__(557); var _cell2 = _interopRequireDefault(_cell); -var _customSelection = __webpack_require__(559); +var _customSelection = __webpack_require__(558); var _customSelection2 = _interopRequireDefault(_customSelection); -var _fill = __webpack_require__(560); +var _fill = __webpack_require__(559); var _fill2 = _interopRequireDefault(_fill); -var _header = __webpack_require__(561); +var _header = __webpack_require__(560); var _header2 = _interopRequireDefault(_header); @@ -70641,7 +71327,7 @@ function createHighlight(highlightType, options) { exports.createHighlight = createHighlight; /***/ }), -/* 556 */ +/* 555 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70649,7 +71335,7 @@ exports.createHighlight = createHighlight; exports.__esModule = true; -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); /** * @return {Selection} @@ -70667,7 +71353,7 @@ function createHighlight(_ref) { exports.default = createHighlight; /***/ }), -/* 557 */ +/* 556 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70675,7 +71361,7 @@ exports.default = createHighlight; exports.__esModule = true; -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); /** * Creates the new instance of Selection responsible for highlighting area of the selected multiple cells. @@ -70703,7 +71389,7 @@ function createHighlight(_ref) { exports.default = createHighlight; /***/ }), -/* 558 */ +/* 557 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70711,7 +71397,7 @@ exports.default = createHighlight; exports.__esModule = true; -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); /** * Creates the new instance of Selection responsible for highlighting currently selected cell. This type of selection @@ -70737,7 +71423,7 @@ function createHighlight(_ref) { exports.default = createHighlight; /***/ }), -/* 559 */ +/* 558 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70745,7 +71431,7 @@ exports.default = createHighlight; exports.__esModule = true; -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); /** * Creates the new instance of Selection responsible for highlighting currently selected cell. This type of selection @@ -70765,7 +71451,7 @@ function createHighlight(_ref) { exports.default = createHighlight; /***/ }), -/* 560 */ +/* 559 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70773,7 +71459,7 @@ exports.default = createHighlight; exports.__esModule = true; -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); /** * Creates the new instance of Selection, responsible for highlighting cells which are covered by fill handle @@ -70796,7 +71482,7 @@ function createHighlight() { exports.default = createHighlight; /***/ }), -/* 561 */ +/* 560 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70804,7 +71490,7 @@ exports.default = createHighlight; exports.__esModule = true; -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); /** * Creates the new instance of Selection, responsible for highlighting row and column headers. This type of selection @@ -70830,7 +71516,7 @@ function createHighlight(_ref) { exports.default = createHighlight; /***/ }), -/* 562 */ +/* 561 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -70848,29 +71534,29 @@ var _highlight = __webpack_require__(462); var _highlight2 = _interopRequireDefault(_highlight); -var _range = __webpack_require__(563); +var _range = __webpack_require__(562); var _range2 = _interopRequireDefault(_range); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); -var _keyStateObserver = __webpack_require__(85); +var _keyStateObserver = __webpack_require__(86); var _object = __webpack_require__(1); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); var _array = __webpack_require__(0); -var _localHooks = __webpack_require__(21); +var _localHooks = __webpack_require__(20); var _localHooks2 = _interopRequireDefault(_localHooks); -var _transformation = __webpack_require__(564); +var _transformation = __webpack_require__(563); var _transformation2 = _interopRequireDefault(_transformation); -var _utils = __webpack_require__(86); +var _utils = __webpack_require__(87); var _templateLiteralTag = __webpack_require__(26); @@ -71576,7 +72262,7 @@ var Selection = function () { exports.default = Selection; /***/ }), -/* 563 */ +/* 562 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -71586,7 +72272,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -71754,7 +72440,7 @@ var SelectionRange = function () { exports.default = SelectionRange; /***/ }), -/* 564 */ +/* 563 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -71764,11 +72450,11 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); var _object = __webpack_require__(1); -var _localHooks = __webpack_require__(21); +var _localHooks = __webpack_require__(20); var _localHooks2 = _interopRequireDefault(_localHooks); @@ -71931,7 +72617,7 @@ var Transformation = function () { exports.default = Transformation; /***/ }), -/* 565 */ +/* 564 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -71991,7 +72677,7 @@ function jQueryWrapper(Handsontable) { } /***/ }), -/* 566 */ +/* 565 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -72000,91 +72686,91 @@ function jQueryWrapper(Handsontable) { exports.__esModule = true; exports.Base = exports.UndoRedo = exports.TouchScroll = exports.Search = exports.PersistentState = exports.ObserveChanges = exports.MultipleSelectionHandles = exports.MergeCells = exports.ManualRowResize = exports.ManualRowMove = exports.ManualColumnResize = exports.ManualColumnMove = exports.ManualColumnFreeze = exports.DragToScroll = exports.CustomBorders = exports.CopyPaste = exports.ContextMenu = exports.Comments = exports.ColumnSorting = exports.AutoRowSize = exports.AutoFill = exports.AutoColumnSize = undefined; -var _persistentState = __webpack_require__(567); +var _persistentState = __webpack_require__(566); var _persistentState2 = _interopRequireDefault(_persistentState); -var _autoColumnSize = __webpack_require__(569); +var _autoColumnSize = __webpack_require__(568); var _autoColumnSize2 = _interopRequireDefault(_autoColumnSize); -var _autofill = __webpack_require__(570); +var _autofill = __webpack_require__(569); var _autofill2 = _interopRequireDefault(_autofill); -var _autoRowSize = __webpack_require__(572); +var _autoRowSize = __webpack_require__(571); var _autoRowSize2 = _interopRequireDefault(_autoRowSize); -var _columnSorting = __webpack_require__(573); +var _columnSorting = __webpack_require__(464); var _columnSorting2 = _interopRequireDefault(_columnSorting); -var _comments = __webpack_require__(581); +var _comments = __webpack_require__(582); var _comments2 = _interopRequireDefault(_comments); -var _contextMenu = __webpack_require__(585); +var _contextMenu = __webpack_require__(586); var _contextMenu2 = _interopRequireDefault(_contextMenu); -var _copyPaste = __webpack_require__(599); +var _copyPaste = __webpack_require__(600); var _copyPaste2 = _interopRequireDefault(_copyPaste); -var _customBorders = __webpack_require__(607); +var _customBorders = __webpack_require__(608); var _customBorders2 = _interopRequireDefault(_customBorders); -var _dragToScroll = __webpack_require__(614); +var _dragToScroll = __webpack_require__(615); var _dragToScroll2 = _interopRequireDefault(_dragToScroll); -var _manualColumnFreeze = __webpack_require__(615); +var _manualColumnFreeze = __webpack_require__(616); var _manualColumnFreeze2 = _interopRequireDefault(_manualColumnFreeze); -var _manualColumnMove = __webpack_require__(619); +var _manualColumnMove = __webpack_require__(620); var _manualColumnMove2 = _interopRequireDefault(_manualColumnMove); -var _manualColumnResize = __webpack_require__(624); +var _manualColumnResize = __webpack_require__(625); var _manualColumnResize2 = _interopRequireDefault(_manualColumnResize); -var _manualRowMove = __webpack_require__(625); +var _manualRowMove = __webpack_require__(626); var _manualRowMove2 = _interopRequireDefault(_manualRowMove); -var _manualRowResize = __webpack_require__(630); +var _manualRowResize = __webpack_require__(631); var _manualRowResize2 = _interopRequireDefault(_manualRowResize); -var _mergeCells = __webpack_require__(631); +var _mergeCells = __webpack_require__(632); var _mergeCells2 = _interopRequireDefault(_mergeCells); -var _multipleSelectionHandles = __webpack_require__(637); +var _multipleSelectionHandles = __webpack_require__(638); var _multipleSelectionHandles2 = _interopRequireDefault(_multipleSelectionHandles); -var _observeChanges = __webpack_require__(638); +var _observeChanges = __webpack_require__(639); var _observeChanges2 = _interopRequireDefault(_observeChanges); -var _search = __webpack_require__(642); +var _search = __webpack_require__(643); var _search2 = _interopRequireDefault(_search); -var _touchScroll = __webpack_require__(643); +var _touchScroll = __webpack_require__(644); var _touchScroll2 = _interopRequireDefault(_touchScroll); -var _undoRedo = __webpack_require__(644); +var _undoRedo = __webpack_require__(645); var _undoRedo2 = _interopRequireDefault(_undoRedo); -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -72114,7 +72800,7 @@ exports.UndoRedo = _undoRedo2.default; exports.Base = _base2.default; /***/ }), -/* 567 */ +/* 566 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -72126,13 +72812,13 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); var _plugins = __webpack_require__(5); -var _storage = __webpack_require__(568); +var _storage = __webpack_require__(567); var _storage2 = _interopRequireDefault(_storage); @@ -72317,7 +73003,7 @@ var PersistentState = function (_BasePlugin) { exports.default = PersistentState; /***/ }), -/* 568 */ +/* 567 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -72468,7 +73154,7 @@ var Storage = function () { exports.default = Storage; /***/ }), -/* 569 */ +/* 568 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -72482,17 +73168,17 @@ var _get = function get(object, property, receiver) { if (object === null) objec var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); var _array = __webpack_require__(0); -var _feature = __webpack_require__(41); +var _feature = __webpack_require__(43); var _element = __webpack_require__(2); -var _ghostTable = __webpack_require__(160); +var _ghostTable = __webpack_require__(159); var _ghostTable2 = _interopRequireDefault(_ghostTable); @@ -72508,7 +73194,7 @@ var _samplesGenerator2 = _interopRequireDefault(_samplesGenerator); var _string = __webpack_require__(32); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -72702,7 +73388,6 @@ var AutoColumnSize = function (_BasePlugin) { this.addHook('beforeChange', function (changes) { return _this2.onBeforeChange(changes); }); - this.addHook('beforeRender', function (force) { return _this2.onBeforeRender(force); }); @@ -72833,11 +73518,14 @@ var AutoColumnSize = function (_BasePlugin) { } } }; + + var syncLimit = this.getSyncCalculationLimit(); + // sync - if (this.firstCalculation && this.getSyncCalculationLimit()) { - this.calculateColumnsWidth({ from: 0, to: this.getSyncCalculationLimit() }, rowRange); + if (this.firstCalculation && syncLimit >= 0) { + this.calculateColumnsWidth({ from: 0, to: syncLimit }, rowRange); this.firstCalculation = false; - current = this.getSyncCalculationLimit() + 1; + current = syncLimit + 1; } // async if (current < length) { @@ -73175,7 +73863,7 @@ var AutoColumnSize = function (_BasePlugin) { exports.default = AutoColumnSize; /***/ }), -/* 570 */ +/* 569 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -73187,7 +73875,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -73197,15 +73885,15 @@ var _pluginHooks2 = _interopRequireDefault(_pluginHooks); var _element = __webpack_require__(2); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); var _plugins = __webpack_require__(5); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); -var _utils = __webpack_require__(571); +var _utils = __webpack_require__(570); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -73860,7 +74548,7 @@ var Autofill = function (_BasePlugin) { exports.default = Autofill; /***/ }), -/* 571 */ +/* 570 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -73874,9 +74562,9 @@ exports.getMappedFillHandleSetting = getMappedFillHandleSetting; var _object = __webpack_require__(1); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); var DIRECTIONS = exports.DIRECTIONS = { horizontal: 'horizontal', @@ -74012,7 +74700,7 @@ function getMappedFillHandleSetting(fillHandle) { } /***/ }), -/* 572 */ +/* 571 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -74026,17 +74714,17 @@ var _get = function get(object, property, receiver) { if (object === null) objec var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); var _array = __webpack_require__(0); -var _feature = __webpack_require__(41); +var _feature = __webpack_require__(43); var _element = __webpack_require__(2); -var _ghostTable = __webpack_require__(160); +var _ghostTable = __webpack_require__(159); var _ghostTable2 = _interopRequireDefault(_ghostTable); @@ -74344,11 +75032,14 @@ var AutoRowSize = function (_BasePlugin) { } } }; + + var syncLimit = this.getSyncCalculationLimit(); + // sync - if (this.firstCalculation && this.getSyncCalculationLimit()) { - this.calculateRowsHeight({ from: 0, to: this.getSyncCalculationLimit() }, colRange); + if (this.firstCalculation && syncLimit >= 0) { + this.calculateRowsHeight({ from: 0, to: syncLimit }, colRange); this.firstCalculation = false; - current = this.getSyncCalculationLimit() + 1; + current = syncLimit + 1; } // async if (current < length) { @@ -74675,1072 +75366,853 @@ var AutoRowSize = function (_BasePlugin) { exports.default = AutoRowSize; /***/ }), -/* 573 */ +/* 572 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; +exports.ColumnStatesManager = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _element = __webpack_require__(2); - -var _mixed = __webpack_require__(8); - var _object = __webpack_require__(1); var _array = __webpack_require__(0); -var _number = __webpack_require__(4); - -var _base = __webpack_require__(6); - -var _base2 = _interopRequireDefault(_base); - -var _plugins = __webpack_require__(5); - -var _mergeSort = __webpack_require__(464); - -var _mergeSort2 = _interopRequireDefault(_mergeSort); - -var _pluginHooks = __webpack_require__(17); - -var _pluginHooks2 = _interopRequireDefault(_pluginHooks); - -var _keyStateObserver = __webpack_require__(85); - -var _comparatorEngine = __webpack_require__(87); - -var _columnStatesManager = __webpack_require__(578); - -var _utils = __webpack_require__(465); - -var _domHelper = __webpack_require__(579); - -var _rowsMapper = __webpack_require__(580); - -var _rowsMapper2 = _interopRequireDefault(_rowsMapper); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -_pluginHooks2.default.getSingleton().register('beforeColumnSort'); -_pluginHooks2.default.getSingleton().register('afterColumnSort'); - -var APPEND_COLUMN_CONFIG_STRATEGY = 'append'; -var REPLACE_COLUMN_CONFIG_STRATEGY = 'replace'; +var inheritedColumnProperties = ['sortEmptyCells', 'indicator', 'headerAction', 'compareFunctionFactory']; -// DIFF - MultiColumnSorting & ColumnSorting: changed configuration documentation. +var SORT_EMPTY_CELLS_DEFAULT = false; +var SHOW_SORT_INDICATOR_DEFAULT = true; +var HEADER_ACTION_DEFAULT = true; /** - * @plugin ColumnSorting - * - * @description - * This plugin sorts the view by columns (but does not sort the data source!). To enable the plugin, set the - * {@link Options#columnSorting} property to the correct value (see the examples below). - * - * @example - * ```js - * // as boolean - * columnSorting: true - * - * // as an object with initial sort config (sort ascending for column at index 1) - * columnSorting: { - * initialConfig: { - * column: 1, - * sortOrder: 'asc' - * } - * } - * - * // as an object which define specific sorting options for all columns - * columnSorting: { - * sortEmptyCells: true, // true = the table sorts empty cells, false = the table moves all empty cells to the end of the table (by default) - * indicator: true, // true = shows indicator for all columns (by default), false = don't show indicator for columns - * headerAction: true, // true = allow to click on the headers to sort (by default), false = turn off possibility to click on the headers to sort - * compareFunctionFactory: function(sortOrder, columnMeta) { - * return function(value, nextValue) { - * // Some value comparisons which will return -1, 0 or 1... - * } - * } - * } - * - * // as an object passed to the `column` property, allows specifying a custom options for the desired column. - * // please take a look at documentation of `column` property: https://docs.handsontable.com/pro/Options.html#columns - * columns: [{ - * columnSorting: { - * indicator: false, // disable indicator for the first column, - * sortEmptyCells: true, - * headerAction: false, // clicks on the first column won't sort - * compareFunctionFactory: function(sortOrder, columnMeta) { - * return function(value, nextValue) { - * return 0; // Custom compare function for the first column (don't sort) - * } - * } - * } - * }]``` + * Store and manages states of sorted columns. * - * @dependencies ObserveChanges moment + * @class ColumnStatesManager + * @plugin ColumnSorting */ +// eslint-disable-next-line import/prefer-default-export -var ColumnSorting = function (_BasePlugin) { - _inherits(ColumnSorting, _BasePlugin); - - function ColumnSorting(hotInstance) { - _classCallCheck(this, ColumnSorting); +var ColumnStatesManager = exports.ColumnStatesManager = function () { + function ColumnStatesManager() { + _classCallCheck(this, ColumnStatesManager); /** - * Instance of column state manager. + * Queue of sort states containing sorted columns and their orders (Array of objects containing `column` and `sortOrder` properties). * - * @private - * @type {ColumnStatesManager} + * @type {Array} */ - var _this2 = _possibleConstructorReturn(this, (ColumnSorting.__proto__ || Object.getPrototypeOf(ColumnSorting)).call(this, hotInstance)); - - _this2.columnStatesManager = new _columnStatesManager.ColumnStatesManager(); + this.sortedColumnsStates = []; /** - * Instance of DOM helper. + * Determines whether we should sort empty cells. * - * @private - * @type {DomHelper} + * @type {Boolean} */ - _this2.domHelper = new _domHelper.DomHelper(_this2.columnStatesManager); + this.sortEmptyCells = SORT_EMPTY_CELLS_DEFAULT; /** - * Object containing visual row indexes mapped to data source indexes. + * Determines whether indicator should be visible (for sorted columns). * - * @private - * @type {RowsMapper} + * @type {Boolean} */ - _this2.rowsMapper = new _rowsMapper2.default(_this2); + this.indicator = SHOW_SORT_INDICATOR_DEFAULT; /** - * It blocks the plugin translation, this flag is checked inside `onModifyRow` callback. + * Determines whether click on the header perform sorting. * - * @private * @type {Boolean} */ - _this2.blockPluginTranslation = true; + this.headerAction = HEADER_ACTION_DEFAULT; /** - * Cached column properties from plugin like i.e. `indicator`, `headerAction`. - * - * @private - * @type {Map} + * Determines compare function factory. Method get as parameters `sortOder` and `columnMeta` and return compare function. */ - _this2.columnMetaCache = new Map(); - return _this2; + this.compareFunctionFactory = void 0; } /** - * Checks if the plugin is enabled in the Handsontable settings. This method is executed in {@link Hooks#beforeInit} - * hook and if it returns `true` than the {@link ColumnSorting#enablePlugin} method is called. + * Update column properties which affect the sorting result. * - * @returns {Boolean} + * **Note**: All column properties can be overwritten by [columns](https://docs.handsontable.com/pro/Options.html#columns) option. + * + * @param {Object} allSortSettings Column sorting plugin's configuration object. */ - _createClass(ColumnSorting, [{ - key: 'isEnabled', - value: function isEnabled() { - return !!this.hot.getSettings().columnSorting; + _createClass(ColumnStatesManager, [{ + key: 'updateAllColumnsProperties', + value: function updateAllColumnsProperties(allSortSettings) { + var _this = this; + + if (!(0, _object.isObject)(allSortSettings)) { + return; + } + + (0, _object.objectEach)(allSortSettings, function (newValue, propertyName) { + if (inheritedColumnProperties.includes(propertyName)) { + _this[propertyName] = newValue; + } + }); } /** - * Enables the plugin functionality for this Handsontable instance. + * Get all column properties which affect the sorting result. + * + * @returns {Object} */ }, { - key: 'enablePlugin', - value: function enablePlugin() { - var _this3 = this; + key: 'getAllColumnsProperties', + value: function getAllColumnsProperties() { + var columnProperties = { + sortEmptyCells: this.sortEmptyCells, + indicator: this.indicator, + headerAction: this.headerAction + }; - if (this.enabled) { - return; + if (typeof this.compareFunctionFactory === 'function') { + columnProperties.compareFunctionFactory = this.compareFunctionFactory; } - (0, _utils.warnIfPluginsHaveConflict)(this.hot.getSettings().columnSorting); + return columnProperties; + } - if ((0, _mixed.isUndefined)(this.hot.getSettings().observeChanges)) { - this.enableObserveChangesPlugin(); - } + /** + * Get index of first sorted column. + * + * @returns {Number|undefined} + */ - this.addHook('afterTrimRow', function () { - return _this3.sortByPresetSortStates(); - }); - this.addHook('afterUntrimRow', function () { - return _this3.sortByPresetSortStates(); - }); - this.addHook('modifyRow', function (row, source) { - return _this3.onModifyRow(row, source); - }); - this.addHook('unmodifyRow', function (row, source) { - return _this3.onUnmodifyRow(row, source); - }); - this.addHook('afterGetColHeader', function (column, TH) { - return _this3.onAfterGetColHeader(column, TH); - }); - this.addHook('beforeOnCellMouseDown', function (event, coords, TD, controller) { - return _this3.onBeforeOnCellMouseDown(event, coords, TD, controller); - }); - this.addHook('afterOnCellMouseDown', function (event, target) { - return _this3.onAfterOnCellMouseDown(event, target); - }); - this.addHook('afterCreateRow', function (index, amount) { - return _this3.onAfterCreateRow(index, amount); - }); - this.addHook('afterRemoveRow', function (index, amount) { - return _this3.onAfterRemoveRow(index, amount); - }); - this.addHook('afterInit', function () { - return _this3.loadOrSortBySettings(); - }); - this.addHook('afterLoadData', function (initialLoad) { - return _this3.onAfterLoadData(initialLoad); - }); - this.addHook('afterCreateCol', function () { - return _this3.onAfterCreateCol(); - }); - this.addHook('afterRemoveCol', function () { - return _this3.onAfterRemoveCol(); - }); + }, { + key: 'getFirstSortedColumn', + value: function getFirstSortedColumn() { + var firstSortedColumn = void 0; - // TODO: Workaround? It should be refactored / described. - if (this.hot.view) { - this.loadOrSortBySettings(); + if (this.getNumberOfSortedColumns() > 0) { + firstSortedColumn = this.sortedColumnsStates[0].column; } - _get(ColumnSorting.prototype.__proto__ || Object.getPrototypeOf(ColumnSorting.prototype), 'enablePlugin', this).call(this); + return firstSortedColumn; } /** - * Disables the plugin functionality for this Handsontable instance. + * Get sort order of column. + * + * @param {Number} searchedColumn Physical column index. + * @returns {String|undefined} Sort order (`asc` for ascending, `desc` for descending and undefined for not sorted). */ }, { - key: 'disablePlugin', - value: function disablePlugin() { - var _this4 = this; - - var clearColHeader = function clearColHeader(column, TH) { - var headerSpanElement = (0, _utils.getHeaderSpanElement)(TH); - - if ((0, _utils.isFirstLevelColumnHeader)(column, TH) === false || headerSpanElement === null) { - return; - } - - (0, _element.removeClass)(headerSpanElement, _this4.domHelper.getRemovedClasses(headerSpanElement)); - }; - - // Changing header width and removing indicator. - this.hot.addHook('afterGetColHeader', clearColHeader); - this.hot.addHookOnce('afterRender', function () { - _this4.hot.removeHook('afterGetColHeader', clearColHeader); + key: 'getSortOrderOfColumn', + value: function getSortOrderOfColumn(searchedColumn) { + var searchedState = this.sortedColumnsStates.find(function (_ref) { + var column = _ref.column; + return searchedColumn === column; }); + var sortOrder = void 0; - this.rowsMapper.clearMap(); + if ((0, _object.isObject)(searchedState)) { + sortOrder = searchedState.sortOrder; + } - _get(ColumnSorting.prototype.__proto__ || Object.getPrototypeOf(ColumnSorting.prototype), 'disablePlugin', this).call(this); + return sortOrder; } - // DIFF - MultiColumnSorting & ColumnSorting: changed function documentation. - /** - * Sorts the table by chosen columns and orders. - * - * @param {undefined|Object} sortConfig Single column sort configuration. The configuration object contains `column` and `sortOrder` properties. - * First of them contains visual column index, the second one contains sort order (`asc` for ascending, `desc` for descending). - * - * **Note**: Please keep in mind that every call of `sort` function set an entirely new sort order. Previous sort configs aren't preserved. - * - * @example - * ```js - * // sort ascending first visual column - * hot.getPlugin('columnSorting').sort({ column: 0, sortOrder: 'asc' }); - * ``` + * Get list of sorted columns. * - * @fires Hooks#beforeColumnSort - * @fires Hooks#afterColumnSort + * @returns {Array} */ }, { - key: 'sort', - value: function sort(sortConfig) { - var _this5 = this; - - var currentSortConfig = this.getSortConfig(); - - // We always pass to hook configs defined as an array to `beforeColumnSort` and `afterColumnSort` hooks. - // DIFF - MultiColumnSorting & ColumnSorting: extra `slice` method call. - var destinationSortConfigs = (0, _utils.getFullSortConfiguration)(sortConfig).slice(0, 1); - - var sortPossible = this.areValidSortConfigs(destinationSortConfigs); - var allowSort = this.hot.runHooks('beforeColumnSort', currentSortConfig, destinationSortConfigs, sortPossible); - - if (sortPossible === false) { - (0, _utils.warnAboutNotValidatedConfig)(); - } - - if (allowSort === false) { - return; - } - - if (sortPossible) { - var translateColumnToPhysical = function translateColumnToPhysical(_ref) { - var visualColumn = _ref.column, - restOfProperties = _objectWithoutProperties(_ref, ['column']); + key: 'getSortedColumns', + value: function getSortedColumns() { + return (0, _array.arrayMap)(this.sortedColumnsStates, function (_ref2) { + var column = _ref2.column; + return column; + }); + } - return Object.assign({ column: _this5.hot.toPhysicalColumn(visualColumn) }, restOfProperties); - }; - var internalSortStates = (0, _array.arrayMap)(destinationSortConfigs, function (columnSortConfig) { - return translateColumnToPhysical(columnSortConfig); - }); + /** + * Get order of particular column in the states queue. + * + * @param {Number} column Physical column index. + * @returns {Number} + */ - this.columnStatesManager.setSortStates(internalSortStates); - this.sortByPresetSortStates(); - this.saveAllSortSettings(); + }, { + key: 'getIndexOfColumnInSortQueue', + value: function getIndexOfColumnInSortQueue(column) { + return this.getSortedColumns().indexOf(column); + } - this.hot.render(); - this.hot.view.wt.draw(true); // TODO: Workaround? One test won't pass after removal. It should be refactored / described. - } + /** + * Get number of sorted columns. + * + * @returns {Number} + */ - this.hot.runHooks('afterColumnSort', currentSortConfig, this.getSortConfig(), sortPossible); + }, { + key: 'getNumberOfSortedColumns', + value: function getNumberOfSortedColumns() { + return this.sortedColumnsStates.length; } /** - * Clear the sort performed on the table. + * Get if list of sorted columns is empty. + * + * @returns {Boolean} */ }, { - key: 'clearSort', - value: function clearSort() { - this.sort([]); + key: 'isListOfSortedColumnsEmpty', + value: function isListOfSortedColumnsEmpty() { + return this.getNumberOfSortedColumns() === 0; } /** - * Checks if the table is sorted (any column have to be sorted). + * Get if particular column is sorted. * + * @param {Number} column Physical column index. * @returns {Boolean} */ }, { - key: 'isSorted', - value: function isSorted() { - return this.enabled && !this.columnStatesManager.isListOfSortedColumnsEmpty(); + key: 'isColumnSorted', + value: function isColumnSorted(column) { + return this.getSortedColumns().includes(column); } /** - * Get sort configuration for particular column or for all sorted columns. Objects contain `column` and `sortOrder` properties. - * - * **Note**: Please keep in mind that returned objects expose **visual** column index under the `column` key. They are handled by the `sort` function. + * Get states for all sorted columns. * - * @param {Number} [column] Visual column index. - * @returns {undefined|Object|Array} + * @returns {Array} */ }, { - key: 'getSortConfig', - value: function getSortConfig(column) { - var _this6 = this; - - var translateColumnToVisual = function translateColumnToVisual(_ref2) { - var physicalColumn = _ref2.column, - restOfProperties = _objectWithoutProperties(_ref2, ['column']); - - return Object.assign({ column: _this6.hot.toVisualColumn(physicalColumn) }, restOfProperties); - }; - - if ((0, _mixed.isDefined)(column)) { - var physicalColumn = this.hot.toPhysicalColumn(column); - var columnSortState = this.columnStatesManager.getColumnSortState(physicalColumn); - - if ((0, _mixed.isDefined)(columnSortState)) { - return translateColumnToVisual(columnSortState); - } - - return; - } - - var sortStates = this.columnStatesManager.getSortStates(); - - return (0, _array.arrayMap)(sortStates, function (columnState) { - return translateColumnToVisual(columnState); - }); + key: 'getSortStates', + value: function getSortStates() { + return (0, _object.deepClone)(this.sortedColumnsStates); } /** - * @description - * Warn: Useful mainly for providing server side sort implementation (see in the example below). It doesn't sort the data set. It just sets sort configuration for all sorted columns. - * - * @example - * ```js - * beforeColumnSort: function(currentSortConfig, destinationSortConfigs) { - * const columnSortPlugin = this.getPlugin('columnSorting'); - * - * columnSortPlugin.setSortConfig(destinationSortConfigs); - * - * // const newData = ... // Calculated data set, ie. from an AJAX call. - * - * // this.loadData(newData); // Load new data set. + * Get sort state for particular column. Object contains `column` and `sortOrder` properties. * - * return false; // The blockade for the default sort action. - * }``` + * **Note**: Please keep in mind that returned objects expose **physical** column index under the `column` key. * - * @param {undefined|Object|Array} sortConfig Single column sort configuration or full sort configuration (for all sorted columns). - * The configuration object contains `column` and `sortOrder` properties. First of them contains visual column index, the second one contains - * sort order (`asc` for ascending, `desc` for descending). + * @param {Number} column Physical column index. + * @returns {Object|undefined} */ }, { - key: 'setSortConfig', - value: function setSortConfig(sortConfig) { - var _this7 = this; - - // DIFF - MultiColumnSorting & ColumnSorting: extra `slice` method call. - var destinationSortConfigs = (0, _utils.getFullSortConfiguration)(sortConfig).slice(0, 1); - - if (this.areValidSortConfigs(destinationSortConfigs)) { - var translateColumnToPhysical = function translateColumnToPhysical(_ref3) { - var visualColumn = _ref3.column, - restOfProperties = _objectWithoutProperties(_ref3, ['column']); - - return Object.assign({ column: _this7.hot.toPhysicalColumn(visualColumn) }, restOfProperties); - }; - var internalSortStates = (0, _array.arrayMap)(destinationSortConfigs, function (columnSortConfig) { - return translateColumnToPhysical(columnSortConfig); - }); - - this.columnStatesManager.setSortStates(internalSortStates); - } else { - (0, _utils.warnAboutNotValidatedConfig)(); + key: 'getColumnSortState', + value: function getColumnSortState(column) { + if (this.isColumnSorted(column)) { + return (0, _object.deepClone)(this.sortedColumnsStates[this.getIndexOfColumnInSortQueue(column)]); } } /** - * Get if sort configs are valid. + * Set all sorted columns states. * - * @private - * @param {Array} sortConfigs Sort configuration for all sorted columns. Objects contain `column` and `sortOrder` properties. - * @returns {Boolean} + * @param {Array} sortStates */ }, { - key: 'areValidSortConfigs', - value: function areValidSortConfigs(sortConfigs) { - if (Array.isArray(sortConfigs) === false) { - return false; - } - - var sortedColumns = sortConfigs.map(function (_ref4) { - var column = _ref4.column; - return column; - }); - var numberOfColumns = this.hot.countCols(); - var onlyExistingVisualIndexes = sortedColumns.every(function (visualColumn) { - return visualColumn <= numberOfColumns && visualColumn >= 0; - }); - - return (0, _utils.areValidSortStates)(sortConfigs) && onlyExistingVisualIndexes; // We don't translate visual indexes to physical indexes. + key: 'setSortStates', + value: function setSortStates(sortStates) { + this.sortedColumnsStates = sortStates; } /** - * Saves all sorting settings. Saving works only when {@link Options#persistentState} option is enabled. - * - * @private - * @fires Hooks#persistentStateSave + * Destroy the state manager. */ }, { - key: 'saveAllSortSettings', - value: function saveAllSortSettings() { - var allSortSettings = this.columnStatesManager.getAllColumnsProperties(); + key: 'destroy', + value: function destroy() { + this.sortedColumnsStates.length = 0; + this.sortedColumnsStates = null; + } + }]); - allSortSettings.initialConfig = this.columnStatesManager.getSortStates(); + return ColumnStatesManager; +}(); - this.hot.runHooks('persistentStateSave', 'columnSorting', allSortSettings); - } +/***/ }), +/* 573 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Get all saved sorting settings. Loading works only when {@link Options#persistentState} option is enabled. - * - * @private - * @returns {Object} Previously saved sort settings. - * - * @fires Hooks#persistentStateLoad - */ +"use strict"; - }, { - key: 'getAllSavedSortSettings', - value: function getAllSavedSortSettings() { - var _this8 = this; - var storedAllSortSettings = {}; +exports.__esModule = true; +exports.getClassesToAdd = getClassesToAdd; +exports.getClassedToRemove = getClassedToRemove; - this.hot.runHooks('persistentStateLoad', 'columnSorting', storedAllSortSettings); +var _utils = __webpack_require__(160); - var allSortSettings = storedAllSortSettings.value; - var translateColumnToVisual = function translateColumnToVisual(_ref5) { - var physicalColumn = _ref5.column, - restOfProperties = _objectWithoutProperties(_ref5, ['column']); +var HEADER_CLASS_ASC_SORT = 'ascending'; /* eslint-disable import/prefer-default-export */ - return Object.assign({ column: _this8.hot.toVisualColumn(physicalColumn) }, restOfProperties); - }; +var HEADER_CLASS_DESC_SORT = 'descending'; +var HEADER_CLASS_INDICATOR_DISABLED = 'indicatorDisabled'; +var HEADER_SORT_CLASS = 'columnSorting'; +var HEADER_ACTION_CLASS = 'sortAction'; - if ((0, _mixed.isDefined)(allSortSettings) && Array.isArray(allSortSettings.initialConfig)) { - allSortSettings.initialConfig = (0, _array.arrayMap)(allSortSettings.initialConfig, translateColumnToVisual); - } +var orderToCssClass = new Map([[_utils.ASC_SORT_STATE, HEADER_CLASS_ASC_SORT], [_utils.DESC_SORT_STATE, HEADER_CLASS_DESC_SORT]]); - return allSortSettings; - } +/** + * Get CSS classes which should be added to particular column header. + * @param {Object} columnStatesManager Instance of column state manager. + * @param {Number} column Physical column index. + * @param {Boolean} showSortIndicator Indicates if indicator should be shown for the particular column. + * @param {Boolean} headerAction Indicates if header click to sort should be possible. + * @returns {Array} Array of CSS classes. + */ +function getClassesToAdd(columnStatesManager, column, showSortIndicator, headerAction) { + var cssClasses = [HEADER_SORT_CLASS]; - /** - * Get next sort configuration for particular column. Object contain `column` and `sortOrder` properties. - * - * **Note**: Please keep in mind that returned object expose **visual** column index under the `column` key. - * - * @private - * @param {Number} column Visual column index. - * @returns {undefined|Object} - */ + if (headerAction) { + cssClasses.push(HEADER_ACTION_CLASS); + } - }, { - key: 'getColumnNextConfig', - value: function getColumnNextConfig(column) { - var physicalColumn = this.hot.toPhysicalColumn(column); + if (showSortIndicator === false) { + cssClasses.push(HEADER_CLASS_INDICATOR_DISABLED); + } else if (columnStatesManager.isColumnSorted(column)) { + var columnOrder = columnStatesManager.getSortOrderOfColumn(column); - if (this.columnStatesManager.isColumnSorted(physicalColumn)) { - var columnSortConfig = this.getSortConfig(column); - var sortOrder = (0, _utils.getNextSortOrder)(columnSortConfig.sortOrder); + cssClasses.push(orderToCssClass.get(columnOrder)); + } - if ((0, _mixed.isDefined)(sortOrder)) { - columnSortConfig.sortOrder = sortOrder; + return cssClasses; +} - return columnSortConfig; - } +/** + * Get CSS classes which should be removed from column header. + * + * @returns {Array} Array of CSS classes. + */ +function getClassedToRemove() { + return Array.from(orderToCssClass.values()).concat(HEADER_ACTION_CLASS, HEADER_CLASS_INDICATOR_DISABLED, HEADER_SORT_CLASS); +} - return; - } +/***/ }), +/* 574 */ +/***/ (function(module, exports, __webpack_require__) { - var nrOfColumns = this.hot.countCols(); +"use strict"; - if (Number.isInteger(column) && column >= 0 && column < nrOfColumns) { - return { - column: column, - sortOrder: (0, _utils.getNextSortOrder)() - }; - } - } - /** - * Get sort configuration with "next order" for particular column. - * - * @private - * @param {Number} columnToChange Visual column index of column which order will be changed. - * @param {String} strategyId ID of strategy. Possible values: 'append' and 'replace'. The first one - * change order of particular column and change it's position in the sort queue to the last one. The second one - * just change order of particular column. - * - * **Note**: Please keep in mind that returned objects expose **visual** column index under the `column` key. - * - * @returns {Array} - */ +exports.__esModule = true; - }, { - key: 'getNextSortConfig', - value: function getNextSortConfig(columnToChange) { - var strategyId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : APPEND_COLUMN_CONFIG_STRATEGY; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var physicalColumn = this.hot.toPhysicalColumn(columnToChange); - var indexOfColumnToChange = this.columnStatesManager.getIndexOfColumnInSortQueue(physicalColumn); - var isColumnSorted = this.columnStatesManager.isColumnSorted(physicalColumn); - var currentSortConfig = this.getSortConfig(); - var nextColumnConfig = this.getColumnNextConfig(columnToChange); +var _arrayMapper = __webpack_require__(56); - if (isColumnSorted) { - if ((0, _mixed.isUndefined)(nextColumnConfig)) { - return [].concat(_toConsumableArray(currentSortConfig.slice(0, indexOfColumnToChange)), _toConsumableArray(currentSortConfig.slice(indexOfColumnToChange + 1))); - } +var _arrayMapper2 = _interopRequireDefault(_arrayMapper); - if (strategyId === APPEND_COLUMN_CONFIG_STRATEGY) { - return [].concat(_toConsumableArray(currentSortConfig.slice(0, indexOfColumnToChange)), _toConsumableArray(currentSortConfig.slice(indexOfColumnToChange + 1)), [nextColumnConfig]); - } else if (strategyId === REPLACE_COLUMN_CONFIG_STRATEGY) { - return [].concat(_toConsumableArray(currentSortConfig.slice(0, indexOfColumnToChange)), [nextColumnConfig], _toConsumableArray(currentSortConfig.slice(indexOfColumnToChange + 1))); - } - } +var _object = __webpack_require__(1); - if ((0, _mixed.isDefined)(nextColumnConfig)) { - return currentSortConfig.concat(nextColumnConfig); - } +var _number = __webpack_require__(4); - return currentSortConfig; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * @class RowsMapper + */ +var RowsMapper = function () { + function RowsMapper() { + _classCallCheck(this, RowsMapper); + } + + _createClass(RowsMapper, [{ + key: 'createMap', /** - * Saves to cache part of plugins related properties, properly merged from cascade settings. + * Reset current map array and create new one. * - * @private - * @param {Number} column Visual column index. - * @returns {Object} + * @param {Number} [length] Custom generated map length. */ - // TODO: Workaround. Inheriting of non-primitive cell meta values doesn't work. Using this function we don't count - // merged properties few times. + value: function createMap(length) { + var _this = this; - }, { - key: 'setMergedPluginSettings', - value: function setMergedPluginSettings(column) { - var physicalColumnIndex = this.hot.toPhysicalColumn(column); - var pluginMainSettings = this.hot.getSettings().columnSorting; - var storedColumnProperties = this.columnStatesManager.getAllColumnsProperties(); - var cellMeta = this.hot.getCellMeta(0, column); - var columnMeta = Object.getPrototypeOf(cellMeta); - var columnMetaHasPluginSettings = Object.hasOwnProperty.call(columnMeta, 'columnSorting'); - var pluginColumnConfig = columnMetaHasPluginSettings ? columnMeta.columnSorting : {}; + var originLength = length === void 0 ? this._arrayMap.length : length; - this.columnMetaCache.set(physicalColumnIndex, Object.assign(storedColumnProperties, pluginMainSettings, pluginColumnConfig)); + this._arrayMap.length = 0; + + (0, _number.rangeEach)(originLength - 1, function (itemIndex) { + _this._arrayMap[itemIndex] = itemIndex; + }); } /** - * Get copy of settings for first cell in the column. - * - * @private - * @param {Number} column Visual column index. - * @returns {Object} + * Destroy class. */ - // TODO: Workaround. Inheriting of non-primitive cell meta values doesn't work. Instead of getting properties from - // column meta we call this function. }, { - key: 'getFirstCellSettings', - value: function getFirstCellSettings(column) { - var _this9 = this; + key: 'destroy', + value: function destroy() { + this._arrayMap = null; + } + }]); - // TODO: Remove test named: "should not break the dataset when inserted new row" (#5431). - var actualBlockTranslationFlag = this.blockPluginTranslation; + return RowsMapper; +}(); - this.blockPluginTranslation = true; +(0, _object.mixin)(RowsMapper, _arrayMapper2.default); - if (this.columnMetaCache.size === 0) { - var numberOfColumns = this.hot.countCols(); +exports.default = RowsMapper; - (0, _number.rangeEach)(numberOfColumns, function (visualColumnIndex) { - return _this9.setMergedPluginSettings(visualColumnIndex); - }); - } +/***/ }), +/* 575 */ +/***/ (function(module, exports, __webpack_require__) { - var cellMeta = this.hot.getCellMeta(0, column); +"use strict"; - this.blockPluginTranslation = actualBlockTranslationFlag; - var cellMetaCopy = Object.create(cellMeta); - cellMetaCopy.columnSorting = this.columnMetaCache.get(this.hot.toPhysicalColumn(column)); +exports.__esModule = true; +exports.rootComparator = rootComparator; - return cellMetaCopy; - } +var _sortService = __webpack_require__(51); - /** - * Get number of rows which should be sorted. - * - * @private - * @param {Number} numberOfRows Total number of displayed rows. - * @returns {Number} - */ +function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } /* eslint-disable import/prefer-default-export */ - }, { - key: 'getNumberOfRowsToSort', - value: function getNumberOfRowsToSort(numberOfRows) { - var settings = this.hot.getSettings(); +/** + * Sort comparator handled by conventional sort algorithm. + * + * @param {Array} sortOrders Sort orders (`asc` for ascending, `desc` for descending). + * @param {Array} columnMetas Column meta objects. + * @returns {Function} + */ +function rootComparator(sortingOrders, columnMetas) { + return function (rowIndexWithValues, nextRowIndexWithValues) { + // We sort array of arrays. Single array is in form [rowIndex, ...values]. + // We compare just values, stored at second index of array. + var _rowIndexWithValues = _toArray(rowIndexWithValues), + values = _rowIndexWithValues.slice(1); - // `maxRows` option doesn't take into account `minSpareRows` option in this case. - if (settings.maxRows <= numberOfRows) { - return settings.maxRows; - } + var _nextRowIndexWithValu = _toArray(nextRowIndexWithValues), + nextValues = _nextRowIndexWithValu.slice(1); - return numberOfRows - settings.minSpareRows; - } + return function getCompareResult(column) { + var sortingOrder = sortingOrders[column]; + var columnMeta = columnMetas[column]; + var value = values[column]; + var nextValue = nextValues[column]; + var pluginSettings = columnMeta.columnSorting; + var compareFunctionFactory = pluginSettings.compareFunctionFactory ? pluginSettings.compareFunctionFactory : (0, _sortService.getCompareFunctionFactory)(columnMeta.type); + var compareResult = compareFunctionFactory(sortingOrder, columnMeta, pluginSettings)(value, nextValue); - /** - * Performs the sorting using a stable sort function basing on internal state of sorting. - * - * @private - */ + // DIFF - MultiColumnSorting & ColumnSorting: removed iteration through next sorted columns. - }, { - key: 'sortByPresetSortStates', - value: function sortByPresetSortStates() { - var _this10 = this; + return compareResult; + }(0); + }; +} - if (this.columnStatesManager.isListOfSortedColumnsEmpty()) { - this.rowsMapper.clearMap(); +/***/ }), +/* 576 */ +/***/ (function(module, exports, __webpack_require__) { - return; - } +"use strict"; - var indexesWithData = []; - var sortedColumnsList = this.columnStatesManager.getSortedColumns(); - var numberOfRows = this.hot.countRows(); - // Function `getDataAtCell` won't call the indices translation inside `onModifyRow` callback - we check the `blockPluginTranslation` - // flag inside it (we just want to get data not already modified by `columnSorting` plugin translation). - this.blockPluginTranslation = true; +exports.__esModule = true; +exports.COLUMN_DATA_TYPE = undefined; +exports.compareFunctionFactory = compareFunctionFactory; - var getDataForSortedColumns = function getDataForSortedColumns(visualRowIndex) { - return (0, _array.arrayMap)(sortedColumnsList, function (physicalColumn) { - return _this10.hot.getDataAtCell(visualRowIndex, _this10.hot.toVisualColumn(physicalColumn)); - }); - }; +var _mixed = __webpack_require__(10); - for (var visualRowIndex = 0; visualRowIndex < this.getNumberOfRowsToSort(numberOfRows); visualRowIndex += 1) { - indexesWithData.push([visualRowIndex].concat(getDataForSortedColumns(visualRowIndex))); - } +var _sortService = __webpack_require__(51); - (0, _mergeSort2.default)(indexesWithData, (0, _comparatorEngine.mainSortComparator)((0, _array.arrayMap)(sortedColumnsList, function (physicalColumn) { - return _this10.columnStatesManager.getSortOrderOfColumn(physicalColumn); - }), (0, _array.arrayMap)(sortedColumnsList, function (physicalColumn) { - return _this10.getFirstCellSettings(_this10.hot.toVisualColumn(physicalColumn)); - }))); +/** + * Default sorting compare function factory. Method get as parameters `sortOrder` and `columnMeta` and return compare function. + * + * @param {String} sortOrder Sort order (`asc` for ascending, `desc` for descending). + * @param {Object} columnMeta Column meta object. + * @param {Object} columnPluginSettings Plugin settings for the column. + * @returns {Function} The compare function. + */ +/* eslint-disable import/prefer-default-export */ - // Append spareRows - for (var _visualRowIndex = indexesWithData.length; _visualRowIndex < numberOfRows; _visualRowIndex += 1) { - indexesWithData.push([_visualRowIndex].concat(getDataForSortedColumns(_visualRowIndex))); - } +function compareFunctionFactory(sortOrder, columnMeta, columnPluginSettings) { + return function (value, nextValue) { + var sortEmptyCells = columnPluginSettings.sortEmptyCells; - // The blockade of the indices translation is released. - this.blockPluginTranslation = false; - // Save all indexes to arrayMapper, a completely new sequence is set by the plugin - this.rowsMapper._arrayMap = (0, _array.arrayMap)(indexesWithData, function (indexWithData) { - return indexWithData[0]; - }); + if (typeof value === 'string') { + value = value.toLowerCase(); } - /** - * Load saved settings or sort by predefined plugin configuration. - * - * @private - */ - - }, { - key: 'loadOrSortBySettings', - value: function loadOrSortBySettings() { - this.columnMetaCache.clear(); + if (typeof nextValue === 'string') { + nextValue = nextValue.toLowerCase(); + } - var storedAllSortSettings = this.getAllSavedSortSettings(); + if (value === nextValue) { + return _sortService.DO_NOT_SWAP; + } - if ((0, _object.isObject)(storedAllSortSettings)) { - this.sortBySettings(storedAllSortSettings); - } else { - var allSortSettings = this.hot.getSettings().columnSorting; + if ((0, _mixed.isEmpty)(value)) { + if ((0, _mixed.isEmpty)(nextValue)) { + return _sortService.DO_NOT_SWAP; + } - this.sortBySettings(allSortSettings); + // Just fist value is empty and `sortEmptyCells` option was set + if (sortEmptyCells) { + return sortOrder === 'asc' ? _sortService.FIRST_BEFORE_SECOND : _sortService.FIRST_AFTER_SECOND; } + + return _sortService.FIRST_AFTER_SECOND; } - /** - * Sort the table by provided configuration. - * - * @private - * @param {Object} allSortSettings All sort config settings. Object may contain `initialConfig`, `indicator`, - * `sortEmptyCells`, `headerAction` and `compareFunctionFactory` properties. - */ + if ((0, _mixed.isEmpty)(nextValue)) { + // Just second value is empty and `sortEmptyCells` option was set + if (sortEmptyCells) { + return sortOrder === 'asc' ? _sortService.FIRST_AFTER_SECOND : _sortService.FIRST_BEFORE_SECOND; + } - }, { - key: 'sortBySettings', - value: function sortBySettings(allSortSettings) { - if ((0, _object.isObject)(allSortSettings)) { - this.columnStatesManager.updateAllColumnsProperties(allSortSettings); + return _sortService.FIRST_BEFORE_SECOND; + } - var initialConfig = allSortSettings.initialConfig; + if (isNaN(value) && !isNaN(nextValue)) { + return sortOrder === 'asc' ? _sortService.FIRST_AFTER_SECOND : _sortService.FIRST_BEFORE_SECOND; + } else if (!isNaN(value) && isNaN(nextValue)) { + return sortOrder === 'asc' ? _sortService.FIRST_BEFORE_SECOND : _sortService.FIRST_AFTER_SECOND; + } else if (!(isNaN(value) || isNaN(nextValue))) { + value = parseFloat(value); + nextValue = parseFloat(nextValue); + } - if (Array.isArray(initialConfig) || (0, _object.isObject)(initialConfig)) { - this.sort(initialConfig); - } - } else { - // Extra render for headers. Their width may change. - this.hot.render(); - } + if (value < nextValue) { + return sortOrder === 'asc' ? _sortService.FIRST_BEFORE_SECOND : _sortService.FIRST_AFTER_SECOND; } - /** - * Enables the ObserveChanges plugin. - * - * @private - */ + if (value > nextValue) { + return sortOrder === 'asc' ? _sortService.FIRST_AFTER_SECOND : _sortService.FIRST_BEFORE_SECOND; + } - }, { - key: 'enableObserveChangesPlugin', - value: function enableObserveChangesPlugin() { - var _this = this; + return _sortService.DO_NOT_SWAP; + }; +} - this.hot._registerTimeout(setTimeout(function () { - _this.hot.updateSettings({ - observeChanges: true - }); - }, 0)); - } +var COLUMN_DATA_TYPE = exports.COLUMN_DATA_TYPE = 'default'; - /** - * Callback for `modifyRow` hook. Translates visual row index to the sorted row index. - * - * @private - * @param {Number} row Visual row index. - * @returns {Number} Physical row index. - */ +/***/ }), +/* 577 */ +/***/ (function(module, exports, __webpack_require__) { - }, { - key: 'onModifyRow', - value: function onModifyRow(row, source) { - if (this.blockPluginTranslation === false && source !== this.pluginName) { - var rowInMapper = this.rowsMapper.getValueByIndex(row); - row = rowInMapper === null ? row : rowInMapper; - } +"use strict"; - return row; - } - /** - * Callback for `unmodifyRow` hook. Translates sorted row index to visual row index. - * - * @private - * @param {Number} row Physical row index. - * @returns {Number} Visual row index. - */ +exports.__esModule = true; +exports.COLUMN_DATA_TYPE = undefined; +exports.compareFunctionFactory = compareFunctionFactory; - }, { - key: 'onUnmodifyRow', - value: function onUnmodifyRow(row, source) { - if (this.blockPluginTranslation === false && source !== this.pluginName) { - row = this.rowsMapper.getIndexByValue(row); - } +var _mixed = __webpack_require__(10); - return row; - } +var _sortService = __webpack_require__(51); - /** - * Callback for the `onAfterGetColHeader` hook. Adds column sorting CSS classes. - * - * @private - * @param {Number} column Visual column index. - * @param {Element} TH TH HTML element. - */ +/** + * Numeric sorting compare function factory. Method get as parameters `sortOrder` and `columnMeta` and return compare function. + * + * @param {String} sortOrder Sort order (`asc` for ascending, `desc` for descending). + * @param {Object} columnMeta Column meta object. + * @param {Object} columnPluginSettings Plugin settings for the column. + * @returns {Function} The compare function. + */ +/* eslint-disable import/prefer-default-export */ - }, { - key: 'onAfterGetColHeader', - value: function onAfterGetColHeader(column, TH) { - var headerSpanElement = (0, _utils.getHeaderSpanElement)(TH); +function compareFunctionFactory(sortOrder, columnMeta, columnPluginSettings) { + return function (value, nextValue) { + var parsedFirstValue = parseFloat(value); + var parsedSecondValue = parseFloat(nextValue); + var sortEmptyCells = columnPluginSettings.sortEmptyCells; - if ((0, _utils.isFirstLevelColumnHeader)(column, TH) === false || headerSpanElement === null) { - return; + // Watch out when changing this part of code! Check below returns 0 (as expected) when comparing empty string, null, undefined + + if (parsedFirstValue === parsedSecondValue || isNaN(parsedFirstValue) && isNaN(parsedSecondValue)) { + return _sortService.DO_NOT_SWAP; + } + + if (sortEmptyCells) { + if ((0, _mixed.isEmpty)(value)) { + return sortOrder === 'asc' ? _sortService.FIRST_BEFORE_SECOND : _sortService.FIRST_AFTER_SECOND; } - var physicalColumn = this.hot.toPhysicalColumn(column); - var pluginSettingsForColumn = this.getFirstCellSettings(column).columnSorting; - var showSortIndicator = pluginSettingsForColumn.indicator; - var headerActionEnabled = pluginSettingsForColumn.headerAction; + if ((0, _mixed.isEmpty)(nextValue)) { + return sortOrder === 'asc' ? _sortService.FIRST_AFTER_SECOND : _sortService.FIRST_BEFORE_SECOND; + } + } - (0, _element.removeClass)(headerSpanElement, this.domHelper.getRemovedClasses(headerSpanElement)); - (0, _element.addClass)(headerSpanElement, this.domHelper.getAddedClasses(physicalColumn, showSortIndicator, headerActionEnabled)); + if (isNaN(parsedFirstValue)) { + return _sortService.FIRST_AFTER_SECOND; } - /** - * Overwriting base plugin's `onUpdateSettings` method. Please keep in mind that `onAfterUpdateSettings` isn't called - * for `updateSettings` in specific situations. - * - * @private - * @param {Object} newSettings New settings object. - */ + if (isNaN(parsedSecondValue)) { + return _sortService.FIRST_BEFORE_SECOND; + } - }, { - key: 'onUpdateSettings', - value: function onUpdateSettings(newSettings) { - _get(ColumnSorting.prototype.__proto__ || Object.getPrototypeOf(ColumnSorting.prototype), 'onUpdateSettings', this).call(this); + if (parsedFirstValue < parsedSecondValue) { + return sortOrder === 'asc' ? _sortService.FIRST_BEFORE_SECOND : _sortService.FIRST_AFTER_SECOND; + } else if (parsedFirstValue > parsedSecondValue) { + return sortOrder === 'asc' ? _sortService.FIRST_AFTER_SECOND : _sortService.FIRST_BEFORE_SECOND; + } - (0, _utils.warnIfPluginsHaveConflict)(newSettings.columnSorting); + return _sortService.DO_NOT_SWAP; + }; +} - this.columnMetaCache.clear(); +var COLUMN_DATA_TYPE = exports.COLUMN_DATA_TYPE = 'numeric'; - if ((0, _mixed.isDefined)(newSettings.columnSorting)) { - this.sortBySettings(newSettings.columnSorting); - } - } +/***/ }), +/* 578 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Callback for the `afterLoadData` hook. - * - * @private - * @param {Boolean} initialLoad flag that determines whether the data has been loaded during the initialization. - */ +"use strict"; - }, { - key: 'onAfterLoadData', - value: function onAfterLoadData(initialLoad) { - this.rowsMapper.clearMap(); - if (initialLoad === true) { - // TODO: Workaround? It should be refactored / described. - if (this.hot.view) { - this.loadOrSortBySettings(); - } - } - } +exports.__esModule = true; +exports.COLUMN_DATA_TYPE = undefined; +exports.compareFunctionFactory = compareFunctionFactory; - /** - * Callback for the `afterCreateRow` hook. - * - * @private - * @param {Number} index Visual index of the created row. - * @param {Number} amount Amount of created rows. - */ +var _moment = __webpack_require__(25); - }, { - key: 'onAfterCreateRow', - value: function onAfterCreateRow(index, amount) { - this.rowsMapper.shiftItems(index, amount); +var _moment2 = _interopRequireDefault(_moment); + +var _mixed = __webpack_require__(10); + +var _sortService = __webpack_require__(51); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Date sorting compare function factory. Method get as parameters `sortOrder` and `columnMeta` and return compare function. + * + * @param {String} sortOrder Sort order (`asc` for ascending, `desc` for descending). + * @param {Object} columnMeta Column meta object. + * @param {Object} columnPluginSettings Plugin settings for the column. + * @returns {Function} The compare function. + */ +function compareFunctionFactory(sortOrder, columnMeta, columnPluginSettings) { + return function (value, nextValue) { + var sortEmptyCells = columnPluginSettings.sortEmptyCells; + + + if (value === nextValue) { + return _sortService.DO_NOT_SWAP; } - /** - * Callback for the `afterRemoveRow` hook. - * - * @private - * @param {Number} removedRows Visual indexes of the removed row. - * @param {Number} amount Amount of removed rows. - */ + if ((0, _mixed.isEmpty)(value)) { + if ((0, _mixed.isEmpty)(nextValue)) { + return _sortService.DO_NOT_SWAP; + } - }, { - key: 'onAfterRemoveRow', - value: function onAfterRemoveRow(removedRows, amount) { - this.rowsMapper.unshiftItems(removedRows, amount); + // Just fist value is empty and `sortEmptyCells` option was set + if (sortEmptyCells) { + return sortOrder === 'asc' ? _sortService.FIRST_BEFORE_SECOND : _sortService.FIRST_AFTER_SECOND; + } + + return _sortService.FIRST_AFTER_SECOND; } - // TODO: Workaround. Inheriting of non-primitive cell meta values doesn't work. We clear the cache after action which reorganize sequence of columns. - // TODO: Remove test named: "should add new columns properly when the `columnSorting` plugin is enabled (inheriting of non-primitive cell meta values)". - /** - * Callback for the `afterCreateCol` hook. - * - * @private - */ + if ((0, _mixed.isEmpty)(nextValue)) { + // Just second value is empty and `sortEmptyCells` option was set + if (sortEmptyCells) { + return sortOrder === 'asc' ? _sortService.FIRST_AFTER_SECOND : _sortService.FIRST_BEFORE_SECOND; + } - }, { - key: 'onAfterCreateCol', - value: function onAfterCreateCol() { - this.columnMetaCache.clear(); + return _sortService.FIRST_BEFORE_SECOND; } - // TODO: Workaround. Inheriting of non-primitive cell meta values doesn't work. We clear the cache after action which reorganize sequence of columns. - // TODO: Remove test named: "should add new columns properly when the `columnSorting` plugin is enabled (inheriting of non-primitive cell meta values)". - /** - * Callback for the `afterRemoveCol` hook. - * - * @private - */ + var dateFormat = columnMeta.dateFormat; + var firstDate = (0, _moment2.default)(value, dateFormat); + var nextDate = (0, _moment2.default)(nextValue, dateFormat); - }, { - key: 'onAfterRemoveCol', - value: function onAfterRemoveCol() { - this.columnMetaCache.clear(); + if (!firstDate.isValid()) { + return _sortService.FIRST_AFTER_SECOND; } - /** - * Indicates if clickable header was clicked. - * - * @private - * @param {MouseEvent} event The `mousedown` event. - * @param {Number} column Visual column index. - * @returns {Boolean} - */ + if (!nextDate.isValid()) { + return _sortService.FIRST_BEFORE_SECOND; + } - }, { - key: 'wasClickableHeaderClicked', - value: function wasClickableHeaderClicked(event, column) { - var pluginSettingsForColumn = this.getFirstCellSettings(column).columnSorting; - var headerActionEnabled = pluginSettingsForColumn.headerAction; + if (nextDate.isAfter(firstDate)) { + return sortOrder === 'asc' ? _sortService.FIRST_BEFORE_SECOND : _sortService.FIRST_AFTER_SECOND; + } - return headerActionEnabled && event.realTarget.nodeName === 'SPAN'; + if (nextDate.isBefore(firstDate)) { + return sortOrder === 'asc' ? _sortService.FIRST_AFTER_SECOND : _sortService.FIRST_BEFORE_SECOND; } - /** - * Changes the behavior of selection / dragging. - * - * @private - * @param {MouseEvent} event The `mousedown` event. - * @param {CellCoords} coords Visual coordinates. - * @param {HTMLElement} TD - * @param {Object} blockCalculations - */ + return _sortService.DO_NOT_SWAP; + }; +} /* eslint-disable import/prefer-default-export */ - }, { - key: 'onBeforeOnCellMouseDown', - value: function onBeforeOnCellMouseDown(event, coords, TD, blockCalculations) { - // Click below the level of column headers - if (coords.row >= 0 || coords.col < 0) { - return; - } +var COLUMN_DATA_TYPE = exports.COLUMN_DATA_TYPE = 'date'; - if (this.wasClickableHeaderClicked(event, coords.col) && (0, _keyStateObserver.isPressedCtrlKey)()) { - blockCalculations.column = true; - } - } +/***/ }), +/* 579 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Callback for the `onAfterOnCellMouseDown` hook. - * - * @private - * @param {Event} event Event which are provided by hook. - * @param {CellCoords} coords Visual coords of the selected cell. - */ +"use strict"; - }, { - key: 'onAfterOnCellMouseDown', - value: function onAfterOnCellMouseDown(event, coords) { - // Click below the level of column headers - if (coords.row >= 0 || coords.col < 0) { - return; - } - if (this.wasClickableHeaderClicked(event, coords.col)) { - if ((0, _keyStateObserver.isPressedCtrlKey)()) { - this.hot.deselectCell(); - this.hot.selectColumns(coords.col); +exports.__esModule = true; +exports.FIRST_AFTER_SECOND = exports.FIRST_BEFORE_SECOND = exports.DO_NOT_SWAP = undefined; +exports.sort = sort; - // DIFF - MultiColumnSorting & ColumnSorting: removed selection of next column to sort. - } +var _mergeSort = __webpack_require__(580); - this.sort(this.getColumnNextConfig(coords.col)); - } - } +var _mergeSort2 = _interopRequireDefault(_mergeSort); - /** - * Destroys the plugin instance. - */ +var _registry = __webpack_require__(465); - }, { - key: 'destroy', - value: function destroy() { - this.rowsMapper.destroy(); - this.domHelper.destroy(); - this.columnStatesManager.destroy(); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - _get(ColumnSorting.prototype.__proto__ || Object.getPrototypeOf(ColumnSorting.prototype), 'destroy', this).call(this); +var DO_NOT_SWAP = exports.DO_NOT_SWAP = 0; +var FIRST_BEFORE_SECOND = exports.FIRST_BEFORE_SECOND = -1; +var FIRST_AFTER_SECOND = exports.FIRST_AFTER_SECOND = 1; + +function sort(indexesWithData, rootComparatorId) { + var rootComparator = (0, _registry.getRootComparator)(rootComparatorId); + + for (var _len = arguments.length, argsForRootComparator = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + argsForRootComparator[_key - 2] = arguments[_key]; + } + + (0, _mergeSort2.default)(indexesWithData, rootComparator.apply(undefined, argsForRootComparator)); +} + +/***/ }), +/* 580 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.default = mergeSort; + +var _linkedList = __webpack_require__(581); + +var _linkedList2 = _interopRequireDefault(_linkedList); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Refactored implementation of mergeSort (part of javascript-algorithms project) by Github users: + * mgechev, AndriiHeonia and lekkas (part of javascript-algorithms project - all project contributors + * at repository website) + * + * Link to repository: https://github.com/mgechev/javascript-algorithms + */ + +/** + * Specifies a function that defines the sort order. The array is sorted according to each + * character's Unicode code point value, according to the string conversion of each element. + * + * @param a {*} first compared element. + * @param b {*} second compared element. + * @returns {Number} + */ +var defaultCompareFunction = function defaultCompareFunction(a, b) { + // sort lexically + + var firstValue = a.toString(); + var secondValue = b.toString(); + + if (firstValue === secondValue) { + return 0; + } else if (firstValue < secondValue) { + return -1; + } + + return 1; +}; + +/** + * Mergesort method which is recursively called for sorting the input array. + * + * @param {Array} array The array which should be sorted. + * @param {Function} compareFunction Compares two items in an array. If compareFunction is not supplied, + * elements are sorted by converting them to strings and comparing strings in Unicode code point order. + * @param {Number} startIndex Left side of the subarray. + * @param {Number} endIndex Right side of the subarray. + * @returns {Array} Array with sorted subarray. + */ +function mergeSort(array) { + var compareFunction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultCompareFunction; + var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : array.length; + + if (Math.abs(endIndex - startIndex) <= 1) { + return []; + } + + var middleIndex = Math.ceil((startIndex + endIndex) / 2); + + mergeSort(array, compareFunction, startIndex, middleIndex); + mergeSort(array, compareFunction, middleIndex, endIndex); + + return merge(array, compareFunction, startIndex, middleIndex, endIndex); +} + +/** + * Devides and sort merges two subarrays of given array + * + * @param {Array} array The array which subarrays should be sorted. + * @param {Number} startIndex The start of the first subarray. + * This subarray is with end middle - 1. + * @param {Number} middleIndex The start of the second array. + * @param {Number} endIndex end - 1 is the end of the second array. + * @returns {Array} The array with sorted subarray. + */ +function merge(array, compareFunction, startIndex, middleIndex, endIndex) { + var leftElements = new _linkedList2.default(); + var rightElements = new _linkedList2.default(); + var leftSize = middleIndex - startIndex; + var rightSize = endIndex - middleIndex; + var maxSize = Math.max(leftSize, rightSize); + var size = endIndex - startIndex; + + for (var _i = 0; _i < maxSize; _i += 1) { + if (_i < leftSize) { + leftElements.push(array[startIndex + _i]); } - }]); - return ColumnSorting; -}(_base2.default); + if (_i < rightSize) { + rightElements.push(array[middleIndex + _i]); + } + } -(0, _plugins.registerPlugin)('columnSorting', ColumnSorting); + var i = 0; -exports.default = ColumnSorting; + while (i < size) { + if (leftElements.first && rightElements.first) { + if (compareFunction(leftElements.first.data, rightElements.first.data) > 0) { + array[startIndex + i] = rightElements.shift().data; + } else { + array[startIndex + i] = leftElements.shift().data; + } + } else if (leftElements.first) { + + array[startIndex + i] = leftElements.shift().data; + } else { + + array[startIndex + i] = rightElements.shift().data; + } + + i += 1; + } + + return array; +} /***/ }), -/* 574 */ +/* 581 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -76049,1491 +76521,809 @@ exports.NodeStructure = NodeStructure; exports.default = LinkedList; /***/ }), -/* 575 */ +/* 582 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.default = dateSort; -var _moment = __webpack_require__(23); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _moment2 = _interopRequireDefault(_moment); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _mixed = __webpack_require__(8); +var _element = __webpack_require__(2); -var _comparatorEngine = __webpack_require__(87); +var _object = __webpack_require__(1); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _eventManager = __webpack_require__(8); -/** - * Date sorting compare function factory. Method get as parameters `sortOrder` and `columnMeta` and return compare function. - * - * @param {String} sortOrder Sort order (`asc` for ascending, `desc` for descending). - * @param {Object} columnMeta Column meta object. - * @returns {Function} The compare function. - */ -function dateSort(sortOrder, columnMeta) { - return function (value, nextValue) { - var sortEmptyCells = columnMeta.columnSorting.sortEmptyCells; +var _eventManager2 = _interopRequireDefault(_eventManager); +var _src = __webpack_require__(9); - if (value === nextValue) { - return _comparatorEngine.DO_NOT_SWAP; - } +var _plugins = __webpack_require__(5); - if ((0, _mixed.isEmpty)(value)) { - if ((0, _mixed.isEmpty)(nextValue)) { - return _comparatorEngine.DO_NOT_SWAP; - } +var _base = __webpack_require__(7); - // Just fist value is empty and `sortEmptyCells` option was set - if (sortEmptyCells) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; - } +var _base2 = _interopRequireDefault(_base); - return _comparatorEngine.FIRST_AFTER_SECOND; - } +var _commentEditor = __webpack_require__(583); - if ((0, _mixed.isEmpty)(nextValue)) { - // Just second value is empty and `sortEmptyCells` option was set - if (sortEmptyCells) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; - } +var _commentEditor2 = _interopRequireDefault(_commentEditor); - return _comparatorEngine.FIRST_BEFORE_SECOND; - } +var _utils = __webpack_require__(23); - var dateFormat = columnMeta.dateFormat; - var firstDate = (0, _moment2.default)(value, dateFormat); - var nextDate = (0, _moment2.default)(nextValue, dateFormat); +var _displaySwitch = __webpack_require__(584); - if (!firstDate.isValid()) { - return _comparatorEngine.FIRST_AFTER_SECOND; - } +var _displaySwitch2 = _interopRequireDefault(_displaySwitch); - if (!nextDate.isValid()) { - return _comparatorEngine.FIRST_BEFORE_SECOND; - } +var _constants = __webpack_require__(3); - if (nextDate.isAfter(firstDate)) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; - } +var C = _interopRequireWildcard(_constants); - if (nextDate.isBefore(firstDate)) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; - } +__webpack_require__(585); - return _comparatorEngine.DO_NOT_SWAP; - }; -} +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -/***/ }), -/* 576 */ -/***/ (function(module, exports, __webpack_require__) { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -"use strict"; +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -exports.__esModule = true; -exports.default = defaultSort; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -var _mixed = __webpack_require__(8); +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var _comparatorEngine = __webpack_require__(87); +var privatePool = new WeakMap(); +var META_COMMENT = 'comment'; +var META_COMMENT_VALUE = 'value'; +var META_STYLE = 'style'; +var META_READONLY = 'readOnly'; /** - * Default sorting compare function factory. Method get as parameters `sortOrder` and `columnMeta` and return compare function. + * @plugin Comments * - * @param {String} sortOrder Sort order (`asc` for ascending, `desc` for descending). - * @param {Object} columnMeta Column meta object. - * @returns {Function} The compare function. + * @description + * This plugin allows setting and managing cell comments by either an option in the context menu or with the use of + * the API. + * + * To enable the plugin, you'll need to set the comments property of the config object to `true`: + * ```js + * comments: true + * ``` + * + * or an object with extra predefined plugin config: + * + * ```js + * comments: { + * displayDelay: 1000 + * } + * ``` + * + * To add comments at the table initialization, define the `comment` property in the `cell` config array as in an example below. + * + * @example + * + * ```js + * const hot = new Handsontable(document.getElementById('example'), { + * date: getData(), + * comments: true, + * cell: [ + * {row: 1, col: 1, comment: {value: 'Foo'}}, + * {row: 2, col: 2, comment: {value: 'Bar'}} + * ] + * }); + * + * // Access to the Comments plugin instance: + * const commentsPlugin = hot.getPlugin('comments'); + * + * // Manage comments programmatically: + * commentsPlugin.setCommentAtCell(1, 6, 'Comment contents'); + * commentsPlugin.showAtCell(1, 6); + * commentsPlugin.removeCommentAtCell(1, 6); + * + * // You can also set range once and use proper methods: + * commentsPlugin.setRange({from: {row: 1, col: 6}}); + * commentsPlugin.setComment('Comment contents'); + * commentsPlugin.show(); + * commentsPlugin.removeComment(); + * ``` */ -function defaultSort(sortOrder, columnMeta) { - return function (value, nextValue) { - var sortEmptyCells = columnMeta.columnSorting.sortEmptyCells; +var Comments = function (_BasePlugin) { + _inherits(Comments, _BasePlugin); - if (typeof value === 'string') { - value = value.toLowerCase(); - } - - if (typeof nextValue === 'string') { - nextValue = nextValue.toLowerCase(); - } + function Comments(hotInstance) { + _classCallCheck(this, Comments); - if (value === nextValue) { - return _comparatorEngine.DO_NOT_SWAP; - } - - if ((0, _mixed.isEmpty)(value)) { - if ((0, _mixed.isEmpty)(nextValue)) { - return _comparatorEngine.DO_NOT_SWAP; - } - - // Just fist value is empty and `sortEmptyCells` option was set - if (sortEmptyCells) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; - } - - return _comparatorEngine.FIRST_AFTER_SECOND; - } - - if ((0, _mixed.isEmpty)(nextValue)) { - // Just second value is empty and `sortEmptyCells` option was set - if (sortEmptyCells) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; - } - - return _comparatorEngine.FIRST_BEFORE_SECOND; - } - - if (isNaN(value) && !isNaN(nextValue)) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; - } else if (!isNaN(value) && isNaN(nextValue)) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; - } else if (!(isNaN(value) || isNaN(nextValue))) { - value = parseFloat(value); - nextValue = parseFloat(nextValue); - } - - if (value < nextValue) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; - } - - if (value > nextValue) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; - } - - return _comparatorEngine.DO_NOT_SWAP; - }; -} - -/***/ }), -/* 577 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.default = numericSort; - -var _mixed = __webpack_require__(8); - -var _comparatorEngine = __webpack_require__(87); - -/** - * Numeric sorting compare function factory. Method get as parameters `sortOrder` and `columnMeta` and return compare function. - * - * @param {String} sortOrder Sort order (`asc` for ascending, `desc` for descending). - * @param {Object} columnMeta Column meta object. - * @returns {Function} The compare function. - */ -function numericSort(sortOrder, columnMeta) { - return function (value, nextValue) { - var parsedFirstValue = parseFloat(value); - var parsedSecondValue = parseFloat(nextValue); - var sortEmptyCells = columnMeta.columnSorting.sortEmptyCells; - - // Watch out when changing this part of code! Check below returns 0 (as expected) when comparing empty string, null, undefined - - if (parsedFirstValue === parsedSecondValue || isNaN(parsedFirstValue) && isNaN(parsedSecondValue)) { - return _comparatorEngine.DO_NOT_SWAP; - } - - if (sortEmptyCells) { - if ((0, _mixed.isEmpty)(value)) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; - } - - if ((0, _mixed.isEmpty)(nextValue)) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; - } - } - - if (isNaN(parsedFirstValue)) { - return _comparatorEngine.FIRST_AFTER_SECOND; - } - - if (isNaN(parsedSecondValue)) { - return _comparatorEngine.FIRST_BEFORE_SECOND; - } - - if (parsedFirstValue < parsedSecondValue) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; - } else if (parsedFirstValue > parsedSecondValue) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; - } - - return _comparatorEngine.DO_NOT_SWAP; - }; -} - -/***/ }), -/* 578 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.ColumnStatesManager = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _object = __webpack_require__(1); - -var _array = __webpack_require__(0); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var inheritedColumnProperties = ['sortEmptyCells', 'indicator', 'headerAction', 'compareFunctionFactory']; - -var SORT_EMPTY_CELLS_DEFAULT = false; -var SHOW_SORT_INDICATOR_DEFAULT = true; -var HEADER_ACTION_DEFAULT = true; - -/** - * Store and manages states of sorted columns. - * - * @class ColumnStatesManager - * @plugin ColumnSorting - */ -// eslint-disable-next-line import/prefer-default-export - -var ColumnStatesManager = exports.ColumnStatesManager = function () { - function ColumnStatesManager() { - _classCallCheck(this, ColumnStatesManager); + /** + * Instance of {@link CommentEditor}. + * + * @private + * @type {CommentEditor} + */ + var _this = _possibleConstructorReturn(this, (Comments.__proto__ || Object.getPrototypeOf(Comments)).call(this, hotInstance)); + _this.editor = null; /** - * Queue of sort states containing sorted columns and their orders (Array of objects containing `column` and `sortOrder` properties). + * Instance of {@link DisplaySwitch}. * - * @type {Array} + * @private + * @type {DisplaySwitch} */ - this.sortedColumnsStates = []; + _this.displaySwitch = null; /** - * Determines whether we should sort empty cells. + * Instance of {@link EventManager}. * - * @type {Boolean} + * @private + * @type {EventManager} */ - this.sortEmptyCells = SORT_EMPTY_CELLS_DEFAULT; + _this.eventManager = null; /** - * Determines whether indicator should be visible (for sorted columns). + * Current cell range, an object with `from` property, with `row` and `col` properties (e.q. `{from: {row: 1, col: 6}}`). * + * @type {Object} + */ + _this.range = {}; + /** + * @private * @type {Boolean} */ - this.indicator = SHOW_SORT_INDICATOR_DEFAULT; + _this.mouseDown = false; /** - * Determines whether click on the header perform sorting. - * + * @private * @type {Boolean} */ - this.headerAction = HEADER_ACTION_DEFAULT; + _this.contextMenuEvent = false; /** - * Determines compare function factory. Method get as parameters `sortOder` and `columnMeta` and return compare function. + * @private + * @type {*} */ - this.compareFunctionFactory = void 0; + _this.timer = null; + + privatePool.set(_this, { + tempEditorDimensions: {}, + cellBelowCursor: null + }); + return _this; } /** - * Update column properties which affect the sorting result. - * - * **Note**: All column properties can be overwritten by [columns](https://docs.handsontable.com/pro/Options.html#columns) option. + * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit} + * hook and if it returns `true` than the {@link Comments#enablePlugin} method is called. * - * @param {Object} allSortSettings Column sorting plugin's configuration object. + * @returns {Boolean} */ - _createClass(ColumnStatesManager, [{ - key: 'updateAllColumnsProperties', - value: function updateAllColumnsProperties(allSortSettings) { - var _this = this; - - if (!(0, _object.isObject)(allSortSettings)) { - return; - } - - (0, _object.objectEach)(allSortSettings, function (newValue, propertyName) { - if (inheritedColumnProperties.includes(propertyName)) { - _this[propertyName] = newValue; - } - }); + _createClass(Comments, [{ + key: 'isEnabled', + value: function isEnabled() { + return !!this.hot.getSettings().comments; } /** - * Get all column properties which affect the sorting result. - * - * @returns {Object} + * Enables the plugin functionality for this Handsontable instance. */ }, { - key: 'getAllColumnsProperties', - value: function getAllColumnsProperties() { - var columnProperties = { - sortEmptyCells: this.sortEmptyCells, - indicator: this.indicator, - headerAction: this.headerAction - }; + key: 'enablePlugin', + value: function enablePlugin() { + var _this2 = this; - if (typeof this.compareFunctionFactory === 'function') { - columnProperties.compareFunctionFactory = this.compareFunctionFactory; + if (this.enabled) { + return; } - return columnProperties; - } - - /** - * Get index of first sorted column. - * - * @returns {Number|undefined} - */ + if (!this.editor) { + this.editor = new _commentEditor2.default(); + } - }, { - key: 'getFirstSortedColumn', - value: function getFirstSortedColumn() { - var firstSortedColumn = void 0; + if (!this.eventManager) { + this.eventManager = new _eventManager2.default(this); + } - if (this.getNumberOfSortedColumns() > 0) { - firstSortedColumn = this.sortedColumnsStates[0].column; + if (!this.displaySwitch) { + this.displaySwitch = new _displaySwitch2.default(this.getDisplayDelaySetting()); } - return firstSortedColumn; + this.addHook('afterContextMenuDefaultOptions', function (options) { + return _this2.addToContextMenu(options); + }); + this.addHook('afterRenderer', function (TD, row, col, prop, value, cellProperties) { + return _this2.onAfterRenderer(TD, cellProperties); + }); + this.addHook('afterScrollHorizontally', function () { + return _this2.hide(); + }); + this.addHook('afterScrollVertically', function () { + return _this2.hide(); + }); + this.addHook('afterBeginEditing', function () { + return _this2.onAfterBeginEditing(); + }); + + this.displaySwitch.addLocalHook('hide', function () { + return _this2.hide(); + }); + this.displaySwitch.addLocalHook('show', function (row, col) { + return _this2.showAtCell(row, col); + }); + + this.registerListeners(); + + _get(Comments.prototype.__proto__ || Object.getPrototypeOf(Comments.prototype), 'enablePlugin', this).call(this); } /** - * Get sort order of column. - * - * @param {Number} searchedColumn Physical column index. - * @returns {String|undefined} Sort order (`asc` for ascending, `desc` for descending and undefined for not sorted). + * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { - key: 'getSortOrderOfColumn', - value: function getSortOrderOfColumn(searchedColumn) { - var searchedState = this.sortedColumnsStates.find(function (_ref) { - var column = _ref.column; - return searchedColumn === column; - }); - var sortOrder = void 0; - - if ((0, _object.isObject)(searchedState)) { - sortOrder = searchedState.sortOrder; - } + key: 'updatePlugin', + value: function updatePlugin() { + this.disablePlugin(); + this.enablePlugin(); + _get(Comments.prototype.__proto__ || Object.getPrototypeOf(Comments.prototype), 'updatePlugin', this).call(this); - return sortOrder; + this.displaySwitch.updateDelay(this.getDisplayDelaySetting()); } /** - * Get list of sorted columns. - * - * @returns {Array} + * Disables the plugin functionality for this Handsontable instance. */ }, { - key: 'getSortedColumns', - value: function getSortedColumns() { - return (0, _array.arrayMap)(this.sortedColumnsStates, function (_ref2) { - var column = _ref2.column; - return column; - }); + key: 'disablePlugin', + value: function disablePlugin() { + _get(Comments.prototype.__proto__ || Object.getPrototypeOf(Comments.prototype), 'disablePlugin', this).call(this); } /** - * Get order of particular column in the states queue. + * Registers all necessary DOM listeners. * - * @param {Number} column Physical column index. - * @returns {Number} + * @private */ }, { - key: 'getIndexOfColumnInSortQueue', - value: function getIndexOfColumnInSortQueue(column) { - return this.getSortedColumns().indexOf(column); + key: 'registerListeners', + value: function registerListeners() { + var _this3 = this; + + this.eventManager.addEventListener(document, 'mouseover', function (event) { + return _this3.onMouseOver(event); + }); + this.eventManager.addEventListener(document, 'mousedown', function (event) { + return _this3.onMouseDown(event); + }); + this.eventManager.addEventListener(document, 'mouseup', function () { + return _this3.onMouseUp(); + }); + this.eventManager.addEventListener(this.editor.getInputElement(), 'blur', function () { + return _this3.onEditorBlur(); + }); + this.eventManager.addEventListener(this.editor.getInputElement(), 'mousedown', function (event) { + return _this3.onEditorMouseDown(event); + }); + this.eventManager.addEventListener(this.editor.getInputElement(), 'mouseup', function (event) { + return _this3.onEditorMouseUp(event); + }); } /** - * Get number of sorted columns. + * Sets the current cell range to be able to use general methods like {@link Comments#setComment}, {@link Comments#removeComment}, {@link Comments#show}. * - * @returns {Number} + * @param {Object} range Object with `from` property, each with `row` and `col` properties. */ }, { - key: 'getNumberOfSortedColumns', - value: function getNumberOfSortedColumns() { - return this.sortedColumnsStates.length; + key: 'setRange', + value: function setRange(range) { + this.range = range; } /** - * Get if list of sorted columns is empty. - * - * @returns {Boolean} + * Clears the currently selected cell. */ }, { - key: 'isListOfSortedColumnsEmpty', - value: function isListOfSortedColumnsEmpty() { - return this.getNumberOfSortedColumns() === 0; + key: 'clearRange', + value: function clearRange() { + this.range = {}; } /** - * Get if particular column is sorted. + * Checks if the event target is a cell containing a comment. * - * @param {Number} column Physical column index. + * @private + * @param {Event} event DOM event * @returns {Boolean} */ }, { - key: 'isColumnSorted', - value: function isColumnSorted(column) { - return this.getSortedColumns().includes(column); + key: 'targetIsCellWithComment', + value: function targetIsCellWithComment(event) { + var closestCell = (0, _element.closest)(event.target, 'TD', 'TBODY'); + + return !!(closestCell && (0, _element.hasClass)(closestCell, 'htCommentCell') && (0, _element.closest)(closestCell, [this.hot.rootElement])); } /** - * Get states for all sorted columns. + * Checks if the event target is a comment textarea. * - * @returns {Array} + * @private + * @param {Event} event DOM event. + * @returns {Boolean} */ }, { - key: 'getSortStates', - value: function getSortStates() { - return (0, _object.deepClone)(this.sortedColumnsStates); + key: 'targetIsCommentTextArea', + value: function targetIsCommentTextArea(event) { + return this.editor.getInputElement() === event.target; } /** - * Get sort state for particular column. Object contains `column` and `sortOrder` properties. - * - * **Note**: Please keep in mind that returned objects expose **physical** column index under the `column` key. + * Sets a comment for a cell according to the previously set range (see {@link Comments#setRange}). * - * @param {Number} column Physical column index. - * @returns {Object|undefined} + * @param {String} value Comment contents. */ }, { - key: 'getColumnSortState', - value: function getColumnSortState(column) { - if (this.isColumnSorted(column)) { - return (0, _object.deepClone)(this.sortedColumnsStates[this.getIndexOfColumnInSortQueue(column)]); + key: 'setComment', + value: function setComment(value) { + if (!this.range.from) { + throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())'); + } + var editorValue = this.editor.getValue(); + var comment = ''; + + if (value !== null && value !== void 0) { + comment = value; + } else if (editorValue !== null && editorValue !== void 0) { + comment = editorValue; } + + var row = this.range.from.row; + var col = this.range.from.col; + + this.updateCommentMeta(row, col, _defineProperty({}, META_COMMENT_VALUE, comment)); + this.hot.render(); } /** - * Set all sorted columns states. + * Sets a comment for a specified cell. * - * @param {Array} sortStates + * @param {Number} row Visual row index. + * @param {Number} column Visual column index. + * @param {String} value Comment contents. */ }, { - key: 'setSortStates', - value: function setSortStates(sortStates) { - this.sortedColumnsStates = sortStates; + key: 'setCommentAtCell', + value: function setCommentAtCell(row, column, value) { + this.setRange({ + from: new _src.CellCoords(row, column) + }); + this.setComment(value); } /** - * Destroy the state manager. + * Removes a comment from a cell according to previously set range (see {@link Comments#setRange}). + * + * @param {Boolean} [forceRender=true] If set to `true`, the table will be re-rendered at the end of the operation. */ }, { - key: 'destroy', - value: function destroy() { - this.sortedColumnsStates.length = 0; - this.sortedColumnsStates = null; - } - }]); - - return ColumnStatesManager; -}(); - -/***/ }), -/* 579 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; + key: 'removeComment', + value: function removeComment() { + var forceRender = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + if (!this.range.from) { + throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())'); + } -exports.__esModule = true; -exports.DomHelper = exports.HEADER_ACTION_CLASS = exports.HEADER_SORT_CLASS = undefined; + this.hot.setCellMeta(this.range.from.row, this.range.from.col, META_COMMENT, void 0); -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* eslint-disable import/prefer-default-export */ + if (forceRender) { + this.hot.render(); + } -var _utils = __webpack_require__(465); + this.hide(); + } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + /** + * Removes a comment from a specified cell. + * + * @param {Number} row Visual row index. + * @param {Number} column Visual column index. + * @param {Boolean} [forceRender=true] If `true`, the table will be re-rendered at the end of the operation. + */ -var HEADER_CLASS_ASC_SORT = 'ascending'; -var HEADER_CLASS_DESC_SORT = 'descending'; -var HEADER_CLASS_INDICATOR_DISABLED = 'indicatorDisabled'; -// DIFF - MultiColumnSorting & ColumnSorting: removed CSS class definition related to the number indicators. + }, { + key: 'removeCommentAtCell', + value: function removeCommentAtCell(row, column) { + var forceRender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; -var HEADER_SORT_CLASS = exports.HEADER_SORT_CLASS = 'columnSorting'; -var HEADER_ACTION_CLASS = exports.HEADER_ACTION_CLASS = 'sortAction'; + this.setRange({ + from: new _src.CellCoords(row, column) + }); + this.removeComment(forceRender); + } -var orderToCssClass = new Map([[_utils.ASC_SORT_STATE, HEADER_CLASS_ASC_SORT], [_utils.DESC_SORT_STATE, HEADER_CLASS_DESC_SORT]]); + /** + * Gets comment from a cell according to previously set range (see {@link Comments#setRange}). + * + * @returns {String|undefined} Returns a content of the comment. + */ -/** - * Helper for the column sorting plugin. Manages the added and removed classes to DOM elements basing on state of sorting. - * - * @class DomHelper - * @plugin ColumnSorting - */ + }, { + key: 'getComment', + value: function getComment() { + var row = this.range.from.row; + var column = this.range.from.col; -var DomHelper = exports.DomHelper = function () { - function DomHelper(columnStatesManager) { - _classCallCheck(this, DomHelper); + return this.getCommentMeta(row, column, META_COMMENT_VALUE); + } /** - * Instance of column states manager. + * Gets comment from a cell at the provided coordinates. * - * @private + * @param {Number} row Visual row index. + * @param {Number} column Visual column index. + * @returns {String|undefined} Returns a content of the comment. */ - this.columnStatesManager = columnStatesManager; - } - - /** - * Get CSS classes which should be added to particular column header. - * - * @param {Number} column Physical column index. - * @param {Boolean} showSortIndicator Indicates if indicator should be shown for the particular column. - * @param {Boolean} headerAction Indicates if header click to sort should be possible. - * @returns {Array} Array of CSS classes. - */ + }, { + key: 'getCommentAtCell', + value: function getCommentAtCell(row, column) { + return this.getCommentMeta(row, column, META_COMMENT_VALUE); + } - _createClass(DomHelper, [{ - key: 'getAddedClasses', - value: function getAddedClasses(column, showSortIndicator, headerAction) { - var cssClasses = [HEADER_SORT_CLASS]; + /** + * Shows the comment editor accordingly to the previously set range (see {@link Comments#setRange}). + * + * @returns {Boolean} Returns `true` if comment editor was shown. + */ - if (headerAction) { - cssClasses.push(HEADER_ACTION_CLASS); + }, { + key: 'show', + value: function show() { + if (!this.range.from) { + throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())'); } + var meta = this.hot.getCellMeta(this.range.from.row, this.range.from.col); - if (showSortIndicator === false) { - cssClasses.push(HEADER_CLASS_INDICATOR_DISABLED); - } else if (this.columnStatesManager.isColumnSorted(column)) { - var columnOrder = this.columnStatesManager.getSortOrderOfColumn(column); - - cssClasses.push(orderToCssClass.get(columnOrder)); + this.refreshEditor(true); + this.editor.setValue(meta[META_COMMENT] ? meta[META_COMMENT][META_COMMENT_VALUE] : null || ''); - // DIFF - MultiColumnSorting & ColumnSorting: removed manipulation on CSS classes related to the number indicators. + if (this.editor.hidden) { + this.editor.show(); } - return cssClasses; + return true; } /** - * Get CSS classes which should be removed from column header. + * Shows comment editor according to cell coordinates. * - * @returns {Array} Array of CSS classes. + * @param {Number} row Visual row index. + * @param {Number} column Visual column index. + * @returns {Boolean} Returns `true` if comment editor was shown. */ }, { - key: 'getRemovedClasses', - value: function getRemovedClasses() { - // DIFF - MultiColumnSorting & ColumnSorting: removed manipulation on CSS classes related to the number indicators, removed function argument. + key: 'showAtCell', + value: function showAtCell(row, column) { + this.setRange({ + from: new _src.CellCoords(row, column) + }); - return Array.from(orderToCssClass.values()).concat(HEADER_ACTION_CLASS, HEADER_CLASS_INDICATOR_DISABLED, HEADER_SORT_CLASS); + return this.show(); } /** - * Destroy the helper. + * Hides the comment editor. */ }, { - key: 'destroy', - value: function destroy() { - this.columnStatesManager = null; + key: 'hide', + value: function hide() { + if (!this.editor.hidden) { + this.editor.hide(); + } } - }]); - - return DomHelper; -}(); - -/***/ }), -/* 580 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; + /** + * Refreshes comment editor position and styling. + * + * @param {Boolean} [force=false] If `true` then recalculation will be forced. + */ -exports.__esModule = true; + }, { + key: 'refreshEditor', + value: function refreshEditor() { + var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + if (!force && (!this.range.from || !this.editor.isVisible())) { + return; + } + var scrollableElement = (0, _element.getScrollableElement)(this.hot.view.wt.wtTable.TABLE); + var TD = this.hot.view.wt.wtTable.getCell(this.range.from); + var row = this.range.from.row; + var column = this.range.from.col; + var cellOffset = (0, _element.offset)(TD); + var lastColWidth = this.hot.view.wt.wtTable.getStretchedColumnWidth(column); + var cellTopOffset = cellOffset.top < 0 ? 0 : cellOffset.top; + var cellLeftOffset = cellOffset.left; -var _arrayMapper = __webpack_require__(51); + if (this.hot.view.wt.wtViewport.hasVerticalScroll() && scrollableElement !== window) { + cellTopOffset -= this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(); + } -var _arrayMapper2 = _interopRequireDefault(_arrayMapper); + if (this.hot.view.wt.wtViewport.hasHorizontalScroll() && scrollableElement !== window) { + cellLeftOffset -= this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(); + } -var _object = __webpack_require__(1); + var x = cellLeftOffset + lastColWidth; + var y = cellTopOffset; -var _number = __webpack_require__(4); + var commentStyle = this.getCommentMeta(row, column, META_STYLE); + var readOnly = this.getCommentMeta(row, column, META_READONLY); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (commentStyle) { + this.editor.setSize(commentStyle.width, commentStyle.height); + } else { + this.editor.resetSize(); + } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + this.editor.setReadOnlyState(readOnly); -/** - * @class RowsMapper - * @plugin ColumnSorting - */ -var RowsMapper = function () { - function RowsMapper(columnSorting) { - _classCallCheck(this, RowsMapper); + this.editor.setPosition(x, y); + } /** - * Instance of ColumnSorting plugin. + * Checks if there is a comment for selected range. * - * @type {ColumnSorting} + * @private + * @returns {Boolean} */ - this.columnSorting = columnSorting; - } - - /** - * Reset current map array and create new one. - * - * @param {Number} [length] Custom generated map length. - */ - - _createClass(RowsMapper, [{ - key: 'createMap', - value: function createMap(length) { - var _this = this; + }, { + key: 'checkSelectionCommentsConsistency', + value: function checkSelectionCommentsConsistency() { + var selected = this.hot.getSelectedRangeLast(); - var originLength = length === void 0 ? this._arrayMap.length : length; + if (!selected) { + return false; + } + var hasComment = false; + var cell = selected.from; // IN EXCEL THERE IS COMMENT ONLY FOR TOP LEFT CELL IN SELECTION - this._arrayMap.length = 0; + if (this.getCommentMeta(cell.row, cell.col, META_COMMENT_VALUE)) { + hasComment = true; + } - (0, _number.rangeEach)(originLength - 1, function (itemIndex) { - _this._arrayMap[itemIndex] = itemIndex; - }); + return hasComment; } /** - * Destroy class. + * Sets or update the comment-related cell meta. + * + * @param {Number} row Visual row index. + * @param {Number} column Visual column index. + * @param {Object} metaObject Object defining all the comment-related meta information. */ }, { - key: 'destroy', - value: function destroy() { - this._arrayMap = null; - } - }]); - - return RowsMapper; -}(); - -(0, _object.mixin)(RowsMapper, _arrayMapper2.default); - -exports.default = RowsMapper; - -/***/ }), -/* 581 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _element = __webpack_require__(2); - -var _object = __webpack_require__(1); - -var _eventManager = __webpack_require__(9); - -var _eventManager2 = _interopRequireDefault(_eventManager); - -var _src = __webpack_require__(10); - -var _plugins = __webpack_require__(5); - -var _base = __webpack_require__(6); - -var _base2 = _interopRequireDefault(_base); - -var _commentEditor = __webpack_require__(582); - -var _commentEditor2 = _interopRequireDefault(_commentEditor); - -var _utils = __webpack_require__(24); - -var _displaySwitch = __webpack_require__(583); - -var _displaySwitch2 = _interopRequireDefault(_displaySwitch); - -var _constants = __webpack_require__(3); - -var C = _interopRequireWildcard(_constants); - -__webpack_require__(584); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + key: 'updateCommentMeta', + value: function updateCommentMeta(row, column, metaObject) { + var oldComment = this.hot.getCellMeta(row, column)[META_COMMENT]; + var newComment = void 0; -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + if (oldComment) { + newComment = (0, _object.deepClone)(oldComment); + (0, _object.deepExtend)(newComment, metaObject); + } else { + newComment = metaObject; + } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + this.hot.setCellMeta(row, column, META_COMMENT, newComment); + } -var privatePool = new WeakMap(); -var META_COMMENT = 'comment'; -var META_COMMENT_VALUE = 'value'; -var META_STYLE = 'style'; -var META_READONLY = 'readOnly'; + /** + * Gets the comment related meta information. + * + * @param {Number} row Visual row index. + * @param {Number} column Visual column index. + * @param {String} property Cell meta property. + * @returns {Mixed} + */ -/** - * @plugin Comments - * - * @description - * This plugin allows setting and managing cell comments by either an option in the context menu or with the use of - * the API. - * - * To enable the plugin, you'll need to set the comments property of the config object to `true`: - * ```js - * comments: true - * ``` - * - * or an object with extra predefined plugin config: - * - * ```js - * comments: { - * displayDelay: 1000 - * } - * ``` - * - * To add comments at the table initialization, define the `comment` property in the `cell` config array as in an example below. - * - * @example - * - * ```js - * const hot = new Handsontable(document.getElementById('example'), { - * date: getData(), - * comments: true, - * cell: [ - * {row: 1, col: 1, comment: {value: 'Foo'}}, - * {row: 2, col: 2, comment: {value: 'Bar'}} - * ] - * }); - * - * // Access to the Comments plugin instance: - * const commentsPlugin = hot.getPlugin('comments'); - * - * // Manage comments programmatically: - * commentsPlugin.setCommentAtCell(1, 6, 'Comment contents'); - * commentsPlugin.showAtCell(1, 6); - * commentsPlugin.removeCommentAtCell(1, 6); - * - * // You can also set range once and use proper methods: - * commentsPlugin.setRange({from: {row: 1, col: 6}}); - * commentsPlugin.setComment('Comment contents'); - * commentsPlugin.show(); - * commentsPlugin.removeComment(); - * ``` - */ + }, { + key: 'getCommentMeta', + value: function getCommentMeta(row, column, property) { + var cellMeta = this.hot.getCellMeta(row, column); -var Comments = function (_BasePlugin) { - _inherits(Comments, _BasePlugin); + if (!cellMeta[META_COMMENT]) { + return void 0; + } - function Comments(hotInstance) { - _classCallCheck(this, Comments); + return cellMeta[META_COMMENT][property]; + } /** - * Instance of {@link CommentEditor}. + * `mousedown` event callback. * * @private - * @type {CommentEditor} + * @param {MouseEvent} event The `mousedown` event. */ - var _this = _possibleConstructorReturn(this, (Comments.__proto__ || Object.getPrototypeOf(Comments)).call(this, hotInstance)); - _this.editor = null; - /** - * Instance of {@link DisplaySwitch}. - * - * @private - * @type {DisplaySwitch} - */ - _this.displaySwitch = null; - /** - * Instance of {@link EventManager}. - * - * @private - * @type {EventManager} - */ - _this.eventManager = null; - /** - * Current cell range, an object with `from` property, with `row` and `col` properties (e.q. `{from: {row: 1, col: 6}}`). - * - * @type {Object} - */ - _this.range = {}; - /** - * @private - * @type {Boolean} - */ - _this.mouseDown = false; - /** - * @private - * @type {Boolean} - */ - _this.contextMenuEvent = false; - /** - * @private - * @type {*} - */ - _this.timer = null; + }, { + key: 'onMouseDown', + value: function onMouseDown(event) { + this.mouseDown = true; - privatePool.set(_this, { - tempEditorDimensions: {}, - cellBelowCursor: null - }); - return _this; - } + if (!this.hot.view || !this.hot.view.wt) { + return; + } - /** - * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit} - * hook and if it returns `true` than the {@link Comments#enablePlugin} method is called. - * - * @returns {Boolean} - */ + if (!this.contextMenuEvent && !this.targetIsCommentTextArea(event)) { + var eventCell = (0, _element.closest)(event.target, 'TD', 'TBODY'); + var coordinates = null; + if (eventCell) { + coordinates = this.hot.view.wt.wtTable.getCoords(eventCell); + } - _createClass(Comments, [{ - key: 'isEnabled', - value: function isEnabled() { - return !!this.hot.getSettings().comments; + if (!eventCell || this.range.from && coordinates && (this.range.from.row !== coordinates.row || this.range.from.col !== coordinates.col)) { + this.hide(); + } + } + this.contextMenuEvent = false; } /** - * Enables the plugin functionality for this Handsontable instance. + * `mouseover` event callback. + * + * @private + * @param {MouseEvent} event The `mouseover` event. */ }, { - key: 'enablePlugin', - value: function enablePlugin() { - var _this2 = this; + key: 'onMouseOver', + value: function onMouseOver(event) { + var priv = privatePool.get(this); - if (this.enabled) { - return; - } + priv.cellBelowCursor = document.elementFromPoint(event.clientX, event.clientY); - if (!this.editor) { - this.editor = new _commentEditor2.default(); + if (this.mouseDown || this.editor.isFocused() || (0, _element.hasClass)(event.target, 'wtBorder') || priv.cellBelowCursor !== event.target || !this.editor) { + return; } - if (!this.eventManager) { - this.eventManager = new _eventManager2.default(this); - } + if (this.targetIsCellWithComment(event)) { + var coordinates = this.hot.view.wt.wtTable.getCoords(event.target); + var range = { + from: new _src.CellCoords(coordinates.row, coordinates.col) + }; - if (!this.displaySwitch) { - this.displaySwitch = new _displaySwitch2.default(this.getDisplayDelaySetting()); + this.displaySwitch.show(range); + } else if ((0, _element.isChildOf)(event.target, document) && !this.targetIsCommentTextArea(event)) { + this.displaySwitch.hide(); } - - this.addHook('afterContextMenuDefaultOptions', function (options) { - return _this2.addToContextMenu(options); - }); - this.addHook('afterRenderer', function (TD, row, col, prop, value, cellProperties) { - return _this2.onAfterRenderer(TD, cellProperties); - }); - this.addHook('afterScrollHorizontally', function () { - return _this2.hide(); - }); - this.addHook('afterScrollVertically', function () { - return _this2.hide(); - }); - this.addHook('afterBeginEditing', function () { - return _this2.onAfterBeginEditing(); - }); - - this.displaySwitch.addLocalHook('hide', function () { - return _this2.hide(); - }); - this.displaySwitch.addLocalHook('show', function (row, col) { - return _this2.showAtCell(row, col); - }); - - this.registerListeners(); - - _get(Comments.prototype.__proto__ || Object.getPrototypeOf(Comments.prototype), 'enablePlugin', this).call(this); } /** - * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. + * `mouseup` event callback. + * + * @private */ }, { - key: 'updatePlugin', - value: function updatePlugin() { - this.disablePlugin(); - this.enablePlugin(); - _get(Comments.prototype.__proto__ || Object.getPrototypeOf(Comments.prototype), 'updatePlugin', this).call(this); - - this.displaySwitch.updateDelay(this.getDisplayDelaySetting()); + key: 'onMouseUp', + value: function onMouseUp() { + this.mouseDown = false; } - /** - * Disables the plugin functionality for this Handsontable instance. + /** * + * The `afterRenderer` hook callback.. + * + * @private + * @param {HTMLTableCellElement} TD The rendered `TD` element. + * @param {Object} cellProperties The rendered cell's property object. */ }, { - key: 'disablePlugin', - value: function disablePlugin() { - _get(Comments.prototype.__proto__ || Object.getPrototypeOf(Comments.prototype), 'disablePlugin', this).call(this); + key: 'onAfterRenderer', + value: function onAfterRenderer(TD, cellProperties) { + if (cellProperties[META_COMMENT] && cellProperties[META_COMMENT][META_COMMENT_VALUE]) { + (0, _element.addClass)(TD, cellProperties.commentedCellClassName); + } } /** - * Registers all necessary DOM listeners. + * `blur` event callback for the comment editor. * * @private */ }, { - key: 'registerListeners', - value: function registerListeners() { - var _this3 = this; - - this.eventManager.addEventListener(document, 'mouseover', function (event) { - return _this3.onMouseOver(event); - }); - this.eventManager.addEventListener(document, 'mousedown', function (event) { - return _this3.onMouseDown(event); - }); - this.eventManager.addEventListener(document, 'mouseup', function () { - return _this3.onMouseUp(); - }); - this.eventManager.addEventListener(this.editor.getInputElement(), 'blur', function () { - return _this3.onEditorBlur(); - }); - this.eventManager.addEventListener(this.editor.getInputElement(), 'mousedown', function (event) { - return _this3.onEditorMouseDown(event); - }); - this.eventManager.addEventListener(this.editor.getInputElement(), 'mouseup', function (event) { - return _this3.onEditorMouseUp(event); - }); + key: 'onEditorBlur', + value: function onEditorBlur() { + this.setComment(); } /** - * Sets the current cell range to be able to use general methods like {@link Comments#setComment}, {@link Comments#removeComment}, {@link Comments#show}. + * `mousedown` hook. Along with `onEditorMouseUp` used to simulate the textarea resizing event. * - * @param {Object} range Object with `from` property, each with `row` and `col` properties. + * @private + * @param {MouseEvent} event The `mousedown` event. */ }, { - key: 'setRange', - value: function setRange(range) { - this.range = range; + key: 'onEditorMouseDown', + value: function onEditorMouseDown(event) { + var priv = privatePool.get(this); + + priv.tempEditorDimensions = { + width: (0, _element.outerWidth)(event.target), + height: (0, _element.outerHeight)(event.target) + }; } /** - * Clears the currently selected cell. + * `mouseup` hook. Along with `onEditorMouseDown` used to simulate the textarea resizing event. + * + * @private + * @param {MouseEvent} event The `mouseup` event. */ }, { - key: 'clearRange', - value: function clearRange() { - this.range = {}; + key: 'onEditorMouseUp', + value: function onEditorMouseUp(event) { + var priv = privatePool.get(this); + var currentWidth = (0, _element.outerWidth)(event.target); + var currentHeight = (0, _element.outerHeight)(event.target); + + if (currentWidth !== priv.tempEditorDimensions.width + 1 || currentHeight !== priv.tempEditorDimensions.height + 2) { + this.updateCommentMeta(this.range.from.row, this.range.from.col, _defineProperty({}, META_STYLE, { + width: currentWidth, + height: currentHeight + })); + } } /** - * Checks if the event target is a cell containing a comment. + * Context Menu's "Add comment" callback. Results in showing the comment editor. * * @private - * @param {Event} event DOM event - * @returns {Boolean} */ }, { - key: 'targetIsCellWithComment', - value: function targetIsCellWithComment(event) { - var closestCell = (0, _element.closest)(event.target, 'TD', 'TBODY'); + key: 'onContextMenuAddComment', + value: function onContextMenuAddComment() { + var _this4 = this; - return !!(closestCell && (0, _element.hasClass)(closestCell, 'htCommentCell') && (0, _element.closest)(closestCell, [this.hot.rootElement])); + this.displaySwitch.cancelHiding(); + var coords = this.hot.getSelectedRangeLast(); + + this.contextMenuEvent = true; + this.setRange({ + from: coords.from + }); + this.show(); + setTimeout(function () { + if (_this4.hot) { + _this4.hot.deselectCell(); + _this4.editor.focus(); + } + }, 10); } /** - * Checks if the event target is a comment textarea. - * - * @private - * @param {Event} event DOM event. - * @returns {Boolean} - */ - - }, { - key: 'targetIsCommentTextArea', - value: function targetIsCommentTextArea(event) { - return this.editor.getInputElement() === event.target; - } - - /** - * Sets a comment for a cell according to the previously set range (see {@link Comments#setRange}). - * - * @param {String} value Comment contents. - */ - - }, { - key: 'setComment', - value: function setComment(value) { - if (!this.range.from) { - throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())'); - } - var editorValue = this.editor.getValue(); - var comment = ''; - - if (value !== null && value !== void 0) { - comment = value; - } else if (editorValue !== null && editorValue !== void 0) { - comment = editorValue; - } - - var row = this.range.from.row; - var col = this.range.from.col; - - this.updateCommentMeta(row, col, _defineProperty({}, META_COMMENT_VALUE, comment)); - this.hot.render(); - } - - /** - * Sets a comment for a specified cell. - * - * @param {Number} row Visual row index. - * @param {Number} column Visual column index. - * @param {String} value Comment contents. - */ - - }, { - key: 'setCommentAtCell', - value: function setCommentAtCell(row, column, value) { - this.setRange({ - from: new _src.CellCoords(row, column) - }); - this.setComment(value); - } - - /** - * Removes a comment from a cell according to previously set range (see {@link Comments#setRange}). - * - * @param {Boolean} [forceRender=true] If set to `true`, the table will be re-rendered at the end of the operation. - */ - - }, { - key: 'removeComment', - value: function removeComment() { - var forceRender = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - - if (!this.range.from) { - throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())'); - } - - this.hot.setCellMeta(this.range.from.row, this.range.from.col, META_COMMENT, void 0); - - if (forceRender) { - this.hot.render(); - } - - this.hide(); - } - - /** - * Removes a comment from a specified cell. - * - * @param {Number} row Visual row index. - * @param {Number} column Visual column index. - * @param {Boolean} [forceRender=true] If `true`, the table will be re-rendered at the end of the operation. - */ - - }, { - key: 'removeCommentAtCell', - value: function removeCommentAtCell(row, column) { - var forceRender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - - this.setRange({ - from: new _src.CellCoords(row, column) - }); - this.removeComment(forceRender); - } - - /** - * Gets comment from a cell according to previously set range (see {@link Comments#setRange}). - * - * @returns {String|undefined} Returns a content of the comment. - */ - - }, { - key: 'getComment', - value: function getComment() { - var row = this.range.from.row; - var column = this.range.from.col; - - return this.getCommentMeta(row, column, META_COMMENT_VALUE); - } - - /** - * Gets comment from a cell at the provided coordinates. - * - * @param {Number} row Visual row index. - * @param {Number} column Visual column index. - * @returns {String|undefined} Returns a content of the comment. - */ - - }, { - key: 'getCommentAtCell', - value: function getCommentAtCell(row, column) { - return this.getCommentMeta(row, column, META_COMMENT_VALUE); - } - - /** - * Shows the comment editor accordingly to the previously set range (see {@link Comments#setRange}). - * - * @returns {Boolean} Returns `true` if comment editor was shown. - */ - - }, { - key: 'show', - value: function show() { - if (!this.range.from) { - throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())'); - } - var meta = this.hot.getCellMeta(this.range.from.row, this.range.from.col); - - this.refreshEditor(true); - this.editor.setValue(meta[META_COMMENT] ? meta[META_COMMENT][META_COMMENT_VALUE] : null || ''); - - if (this.editor.hidden) { - this.editor.show(); - } - - return true; - } - - /** - * Shows comment editor according to cell coordinates. - * - * @param {Number} row Visual row index. - * @param {Number} column Visual column index. - * @returns {Boolean} Returns `true` if comment editor was shown. - */ - - }, { - key: 'showAtCell', - value: function showAtCell(row, column) { - this.setRange({ - from: new _src.CellCoords(row, column) - }); - - return this.show(); - } - - /** - * Hides the comment editor. - */ - - }, { - key: 'hide', - value: function hide() { - if (!this.editor.hidden) { - this.editor.hide(); - } - } - - /** - * Refreshes comment editor position and styling. - * - * @param {Boolean} [force=false] If `true` then recalculation will be forced. - */ - - }, { - key: 'refreshEditor', - value: function refreshEditor() { - var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - - if (!force && (!this.range.from || !this.editor.isVisible())) { - return; - } - var scrollableElement = (0, _element.getScrollableElement)(this.hot.view.wt.wtTable.TABLE); - var TD = this.hot.view.wt.wtTable.getCell(this.range.from); - var row = this.range.from.row; - var column = this.range.from.col; - var cellOffset = (0, _element.offset)(TD); - var lastColWidth = this.hot.view.wt.wtTable.getStretchedColumnWidth(column); - var cellTopOffset = cellOffset.top < 0 ? 0 : cellOffset.top; - var cellLeftOffset = cellOffset.left; - - if (this.hot.view.wt.wtViewport.hasVerticalScroll() && scrollableElement !== window) { - cellTopOffset -= this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(); - } - - if (this.hot.view.wt.wtViewport.hasHorizontalScroll() && scrollableElement !== window) { - cellLeftOffset -= this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(); - } - - var x = cellLeftOffset + lastColWidth; - var y = cellTopOffset; - - var commentStyle = this.getCommentMeta(row, column, META_STYLE); - var readOnly = this.getCommentMeta(row, column, META_READONLY); - - if (commentStyle) { - this.editor.setSize(commentStyle.width, commentStyle.height); - } else { - this.editor.resetSize(); - } - - this.editor.setReadOnlyState(readOnly); - - this.editor.setPosition(x, y); - } - - /** - * Checks if there is a comment for selected range. - * - * @private - * @returns {Boolean} - */ - - }, { - key: 'checkSelectionCommentsConsistency', - value: function checkSelectionCommentsConsistency() { - var selected = this.hot.getSelectedRangeLast(); - - if (!selected) { - return false; - } - var hasComment = false; - var cell = selected.from; // IN EXCEL THERE IS COMMENT ONLY FOR TOP LEFT CELL IN SELECTION - - if (this.getCommentMeta(cell.row, cell.col, META_COMMENT_VALUE)) { - hasComment = true; - } - - return hasComment; - } - - /** - * Sets or update the comment-related cell meta. - * - * @param {Number} row Visual row index. - * @param {Number} column Visual column index. - * @param {Object} metaObject Object defining all the comment-related meta information. - */ - - }, { - key: 'updateCommentMeta', - value: function updateCommentMeta(row, column, metaObject) { - var oldComment = this.hot.getCellMeta(row, column)[META_COMMENT]; - var newComment = void 0; - - if (oldComment) { - newComment = (0, _object.deepClone)(oldComment); - (0, _object.deepExtend)(newComment, metaObject); - } else { - newComment = metaObject; - } - - this.hot.setCellMeta(row, column, META_COMMENT, newComment); - } - - /** - * Gets the comment related meta information. - * - * @param {Number} row Visual row index. - * @param {Number} column Visual column index. - * @param {String} property Cell meta property. - * @returns {Mixed} - */ - - }, { - key: 'getCommentMeta', - value: function getCommentMeta(row, column, property) { - var cellMeta = this.hot.getCellMeta(row, column); - - if (!cellMeta[META_COMMENT]) { - return void 0; - } - - return cellMeta[META_COMMENT][property]; - } - - /** - * `mousedown` event callback. - * - * @private - * @param {MouseEvent} event The `mousedown` event. - */ - - }, { - key: 'onMouseDown', - value: function onMouseDown(event) { - this.mouseDown = true; - - if (!this.hot.view || !this.hot.view.wt) { - return; - } - - if (!this.contextMenuEvent && !this.targetIsCommentTextArea(event)) { - var eventCell = (0, _element.closest)(event.target, 'TD', 'TBODY'); - var coordinates = null; - - if (eventCell) { - coordinates = this.hot.view.wt.wtTable.getCoords(eventCell); - } - - if (!eventCell || this.range.from && coordinates && (this.range.from.row !== coordinates.row || this.range.from.col !== coordinates.col)) { - this.hide(); - } - } - this.contextMenuEvent = false; - } - - /** - * `mouseover` event callback. - * - * @private - * @param {MouseEvent} event The `mouseover` event. - */ - - }, { - key: 'onMouseOver', - value: function onMouseOver(event) { - var priv = privatePool.get(this); - - priv.cellBelowCursor = document.elementFromPoint(event.clientX, event.clientY); - - if (this.mouseDown || this.editor.isFocused() || (0, _element.hasClass)(event.target, 'wtBorder') || priv.cellBelowCursor !== event.target || !this.editor) { - return; - } - - if (this.targetIsCellWithComment(event)) { - var coordinates = this.hot.view.wt.wtTable.getCoords(event.target); - var range = { - from: new _src.CellCoords(coordinates.row, coordinates.col) - }; - - this.displaySwitch.show(range); - } else if ((0, _element.isChildOf)(event.target, document) && !this.targetIsCommentTextArea(event)) { - this.displaySwitch.hide(); - } - } - - /** - * `mouseup` event callback. - * - * @private - */ - - }, { - key: 'onMouseUp', - value: function onMouseUp() { - this.mouseDown = false; - } - - /** * - * The `afterRenderer` hook callback.. - * - * @private - * @param {HTMLTableCellElement} TD The rendered `TD` element. - * @param {Object} cellProperties The rendered cell's property object. - */ - - }, { - key: 'onAfterRenderer', - value: function onAfterRenderer(TD, cellProperties) { - if (cellProperties[META_COMMENT] && cellProperties[META_COMMENT][META_COMMENT_VALUE]) { - (0, _element.addClass)(TD, cellProperties.commentedCellClassName); - } - } - - /** - * `blur` event callback for the comment editor. - * - * @private - */ - - }, { - key: 'onEditorBlur', - value: function onEditorBlur() { - this.setComment(); - } - - /** - * `mousedown` hook. Along with `onEditorMouseUp` used to simulate the textarea resizing event. - * - * @private - * @param {MouseEvent} event The `mousedown` event. - */ - - }, { - key: 'onEditorMouseDown', - value: function onEditorMouseDown(event) { - var priv = privatePool.get(this); - - priv.tempEditorDimensions = { - width: (0, _element.outerWidth)(event.target), - height: (0, _element.outerHeight)(event.target) - }; - } - - /** - * `mouseup` hook. Along with `onEditorMouseDown` used to simulate the textarea resizing event. - * - * @private - * @param {MouseEvent} event The `mouseup` event. - */ - - }, { - key: 'onEditorMouseUp', - value: function onEditorMouseUp(event) { - var priv = privatePool.get(this); - var currentWidth = (0, _element.outerWidth)(event.target); - var currentHeight = (0, _element.outerHeight)(event.target); - - if (currentWidth !== priv.tempEditorDimensions.width + 1 || currentHeight !== priv.tempEditorDimensions.height + 2) { - this.updateCommentMeta(this.range.from.row, this.range.from.col, _defineProperty({}, META_STYLE, { - width: currentWidth, - height: currentHeight - })); - } - } - - /** - * Context Menu's "Add comment" callback. Results in showing the comment editor. - * - * @private - */ - - }, { - key: 'onContextMenuAddComment', - value: function onContextMenuAddComment() { - var _this4 = this; - - this.displaySwitch.cancelHiding(); - var coords = this.hot.getSelectedRangeLast(); - - this.contextMenuEvent = true; - this.setRange({ - from: coords.from - }); - this.show(); - setTimeout(function () { - if (_this4.hot) { - _this4.hot.deselectCell(); - _this4.editor.focus(); - } - }, 10); - } - - /** - * Context Menu's "remove comment" callback. + * Context Menu's "remove comment" callback. * * @private */ @@ -77712,7 +77502,7 @@ var Comments = function (_BasePlugin) { exports.default = Comments; /***/ }), -/* 582 */ +/* 583 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77969,7 +77759,7 @@ var CommentEditor = function () { exports.default = CommentEditor; /***/ }), -/* 583 */ +/* 584 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77983,7 +77773,7 @@ var _function = __webpack_require__(34); var _object = __webpack_require__(1); -var _localHooks = __webpack_require__(21); +var _localHooks = __webpack_require__(20); var _localHooks2 = _interopRequireDefault(_localHooks); @@ -78112,13 +77902,13 @@ var DisplaySwitch = function () { exports.default = DisplaySwitch; /***/ }), -/* 584 */ +/* 585 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 585 */ +/* 586 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -78130,7 +77920,7 @@ var _get = function get(object, property, receiver) { if (object === null) objec var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -78144,7 +77934,7 @@ var _commandExecutor2 = __webpack_require__(466); var _commandExecutor3 = _interopRequireDefault(_commandExecutor2); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -78162,9 +77952,9 @@ var _event = __webpack_require__(12); var _element = __webpack_require__(2); -var _predefinedItems = __webpack_require__(43); +var _predefinedItems = __webpack_require__(45); -__webpack_require__(598); +__webpack_require__(599); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -78573,7 +78363,7 @@ ContextMenu.SEPARATOR = { exports.default = ContextMenu; /***/ }), -/* 586 */ +/* 587 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -78583,7 +78373,7 @@ exports.__esModule = true; exports.KEY = undefined; exports.default = alignmentItem; -var _utils = __webpack_require__(24); +var _utils = __webpack_require__(23); var _separator = __webpack_require__(161); @@ -78893,7 +78683,7 @@ function alignmentItem() { } /***/ }), -/* 587 */ +/* 588 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -78906,7 +78696,7 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [ exports.default = clearColumnItem; -var _utils = __webpack_require__(24); +var _utils = __webpack_require__(23); var _constants = __webpack_require__(3); @@ -78950,7 +78740,7 @@ function clearColumnItem() { } /***/ }), -/* 588 */ +/* 589 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -78963,7 +78753,7 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [ exports.default = columnLeftItem; -var _utils = __webpack_require__(24); +var _utils = __webpack_require__(23); var _constants = __webpack_require__(3); @@ -79012,7 +78802,7 @@ function columnLeftItem() { } /***/ }), -/* 589 */ +/* 590 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79025,7 +78815,7 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [ exports.default = columnRightItem; -var _utils = __webpack_require__(24); +var _utils = __webpack_require__(23); var _constants = __webpack_require__(3); @@ -79074,7 +78864,7 @@ function columnRightItem() { } /***/ }), -/* 590 */ +/* 591 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79084,7 +78874,7 @@ exports.__esModule = true; exports.KEY = undefined; exports.default = readOnlyItem; -var _utils = __webpack_require__(24); +var _utils = __webpack_require__(23); var _array = __webpack_require__(0); @@ -79136,7 +78926,7 @@ function readOnlyItem() { } /***/ }), -/* 591 */ +/* 592 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79170,7 +78960,7 @@ function redoItem() { } /***/ }), -/* 592 */ +/* 593 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79183,9 +78973,9 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [ exports.default = removeColumnItem; -var _utils = __webpack_require__(24); +var _utils = __webpack_require__(23); -var _utils2 = __webpack_require__(86); +var _utils2 = __webpack_require__(87); var _constants = __webpack_require__(3); @@ -79238,7 +79028,7 @@ function removeColumnItem() { } /***/ }), -/* 593 */ +/* 594 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79251,9 +79041,9 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [ exports.default = removeRowItem; -var _utils = __webpack_require__(24); +var _utils = __webpack_require__(23); -var _utils2 = __webpack_require__(86); +var _utils2 = __webpack_require__(87); var _constants = __webpack_require__(3); @@ -79306,7 +79096,7 @@ function removeRowItem() { } /***/ }), -/* 594 */ +/* 595 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79316,7 +79106,7 @@ exports.__esModule = true; exports.KEY = undefined; exports.default = rowAboveItem; -var _utils = __webpack_require__(24); +var _utils = __webpack_require__(23); var _constants = __webpack_require__(3); @@ -79353,7 +79143,7 @@ function rowAboveItem() { } /***/ }), -/* 595 */ +/* 596 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79363,7 +79153,7 @@ exports.__esModule = true; exports.KEY = undefined; exports.default = rowBelowItem; -var _utils = __webpack_require__(24); +var _utils = __webpack_require__(23); var _constants = __webpack_require__(3); @@ -79400,7 +79190,7 @@ function rowBelowItem() { } /***/ }), -/* 596 */ +/* 597 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79434,7 +79224,7 @@ function undoItem() { } /***/ }), -/* 597 */ +/* 598 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79584,13 +79374,13 @@ var Cursor = function () { exports.default = Cursor; /***/ }), -/* 598 */ +/* 599 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 599 */ +/* 600 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79606,7 +79396,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -79626,23 +79416,23 @@ var _element = __webpack_require__(2); var _plugins = __webpack_require__(5); -var _copy = __webpack_require__(600); +var _copy = __webpack_require__(601); var _copy2 = _interopRequireDefault(_copy); -var _cut = __webpack_require__(601); +var _cut = __webpack_require__(602); var _cut2 = _interopRequireDefault(_cut); -var _pasteEvent = __webpack_require__(602); +var _pasteEvent = __webpack_require__(603); var _pasteEvent2 = _interopRequireDefault(_pasteEvent); -var _focusableElement = __webpack_require__(604); +var _focusableElement = __webpack_require__(605); -var _utils = __webpack_require__(605); +var _utils = __webpack_require__(606); -__webpack_require__(606); +__webpack_require__(607); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -80336,7 +80126,7 @@ var CopyPaste = function (_BasePlugin) { exports.default = CopyPaste; /***/ }), -/* 600 */ +/* 601 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80375,7 +80165,7 @@ function copyItem(copyPastePlugin) { } /***/ }), -/* 601 */ +/* 602 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80414,7 +80204,7 @@ function cutItem(copyPastePlugin) { } /***/ }), -/* 602 */ +/* 603 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80422,7 +80212,7 @@ function cutItem(copyPastePlugin) { exports.__esModule = true; -var _clipboardData = __webpack_require__(603); +var _clipboardData = __webpack_require__(604); var _clipboardData2 = _interopRequireDefault(_clipboardData); @@ -80439,7 +80229,7 @@ var PasteEvent = function PasteEvent() { exports.default = PasteEvent; /***/ }), -/* 603 */ +/* 604 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80476,7 +80266,7 @@ var ClipboardData = function () { exports.default = ClipboardData; /***/ }), -/* 604 */ +/* 605 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80487,16 +80277,18 @@ exports.destroyElement = exports.deactivateElement = exports.createElement = und var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); -var _localHooks = __webpack_require__(21); +var _localHooks = __webpack_require__(20); var _localHooks2 = _interopRequireDefault(_localHooks); var _object = __webpack_require__(1); +var _browser = __webpack_require__(42); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -80584,7 +80376,10 @@ var FocusableWrapper = function () { value: function focus() { // Add an empty space to texarea. It is necessary for safari to enable "copy" command from menu bar. this.mainElement.value = ' '; - this.mainElement.select(); + + if (!(0, _browser.isMobileBrowser)()) { + this.mainElement.select(); + } } }]); @@ -80700,7 +80495,7 @@ exports.deactivateElement = deactivateElement; exports.destroyElement = destroyElement; /***/ }), -/* 605 */ +/* 606 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80709,6 +80504,9 @@ exports.destroyElement = destroyElement; exports.__esModule = true; exports.arrayToTable = arrayToTable; exports.tableToArray = tableToArray; + +var _mixed = __webpack_require__(10); + /** * Converts javascript array into HTMLTable. * @@ -80731,7 +80529,7 @@ function arrayToTable(input) { } for (var column = 0; column < columnsLen; column += 1) { - tempElement.innerText = '' + (rowData[column] || ''); + tempElement.innerText = '' + ((0, _mixed.isEmpty)(rowData[column]) ? '' : rowData[column]); columnsResult.push('' + tempElement.innerHTML + ''); } @@ -80802,13 +80600,13 @@ function tableToArray(element) { } /***/ }), -/* 606 */ +/* 607 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 607 */ +/* 608 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80822,7 +80620,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -80834,15 +80632,15 @@ var _number = __webpack_require__(4); var _array = __webpack_require__(0); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _contextMenuItem = __webpack_require__(608); +var _contextMenuItem = __webpack_require__(609); -var _utils = __webpack_require__(56); +var _utils = __webpack_require__(57); var _selection = __webpack_require__(461); @@ -81711,7 +81509,7 @@ var CustomBorders = function (_BasePlugin) { exports.default = CustomBorders; /***/ }), -/* 608 */ +/* 609 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81720,23 +81518,23 @@ exports.default = CustomBorders; exports.__esModule = true; exports.top = exports.right = exports.noBorders = exports.left = exports.bottom = undefined; -var _bottom = __webpack_require__(609); +var _bottom = __webpack_require__(610); var _bottom2 = _interopRequireDefault(_bottom); -var _left = __webpack_require__(610); +var _left = __webpack_require__(611); var _left2 = _interopRequireDefault(_left); -var _noBorders = __webpack_require__(611); +var _noBorders = __webpack_require__(612); var _noBorders2 = _interopRequireDefault(_noBorders); -var _right = __webpack_require__(612); +var _right = __webpack_require__(613); var _right2 = _interopRequireDefault(_right); -var _top = __webpack_require__(613); +var _top = __webpack_require__(614); var _top2 = _interopRequireDefault(_top); @@ -81749,7 +81547,7 @@ exports.right = _right2.default; exports.top = _top2.default; /***/ }), -/* 609 */ +/* 610 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81762,7 +81560,7 @@ var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _utils = __webpack_require__(56); +var _utils = __webpack_require__(57); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -81785,7 +81583,7 @@ function bottom(customBordersPlugin) { } /***/ }), -/* 610 */ +/* 611 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81798,7 +81596,7 @@ var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _utils = __webpack_require__(56); +var _utils = __webpack_require__(57); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -81822,7 +81620,7 @@ function left(customBordersPlugin) { } /***/ }), -/* 611 */ +/* 612 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81835,7 +81633,7 @@ var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _utils = __webpack_require__(56); +var _utils = __webpack_require__(57); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -81855,7 +81653,7 @@ function noBorders(customBordersPlugin) { } /***/ }), -/* 612 */ +/* 613 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81868,7 +81666,7 @@ var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _utils = __webpack_require__(56); +var _utils = __webpack_require__(57); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -81891,7 +81689,7 @@ function right(customBordersPlugin) { } /***/ }), -/* 613 */ +/* 614 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81904,7 +81702,7 @@ var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _utils = __webpack_require__(56); +var _utils = __webpack_require__(57); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -81928,7 +81726,7 @@ function top(customBordersPlugin) { } /***/ }), -/* 614 */ +/* 615 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81940,11 +81738,11 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -82237,7 +82035,7 @@ var DragToScroll = function (_BasePlugin) { exports.default = DragToScroll; /***/ }), -/* 615 */ +/* 616 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -82249,7 +82047,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -82257,15 +82055,15 @@ var _plugins = __webpack_require__(5); var _array = __webpack_require__(0); -var _freezeColumn = __webpack_require__(616); +var _freezeColumn = __webpack_require__(617); var _freezeColumn2 = _interopRequireDefault(_freezeColumn); -var _unfreezeColumn = __webpack_require__(617); +var _unfreezeColumn = __webpack_require__(618); var _unfreezeColumn2 = _interopRequireDefault(_unfreezeColumn); -__webpack_require__(618); +__webpack_require__(619); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -82582,7 +82380,7 @@ var ManualColumnFreeze = function (_BasePlugin) { exports.default = ManualColumnFreeze; /***/ }), -/* 616 */ +/* 617 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -82633,7 +82431,7 @@ function freezeColumnItem(manualColumnFreezePlugin) { } /***/ }), -/* 617 */ +/* 618 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -82684,13 +82482,13 @@ function unfreezeColumnItem(manualColumnFreezePlugin) { } /***/ }), -/* 618 */ +/* 619 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 619 */ +/* 620 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -82702,7 +82500,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -82716,25 +82514,25 @@ var _element = __webpack_require__(2); var _number = __webpack_require__(4); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); var _plugins = __webpack_require__(5); -var _columnsMapper = __webpack_require__(620); +var _columnsMapper = __webpack_require__(621); var _columnsMapper2 = _interopRequireDefault(_columnsMapper); -var _backlight = __webpack_require__(621); +var _backlight = __webpack_require__(622); var _backlight2 = _interopRequireDefault(_backlight); -var _guideline = __webpack_require__(622); +var _guideline = __webpack_require__(623); var _guideline2 = _interopRequireDefault(_guideline); -__webpack_require__(623); +__webpack_require__(624); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -83603,7 +83401,7 @@ var ManualColumnMove = function (_BasePlugin) { exports.default = ManualColumnMove; /***/ }), -/* 620 */ +/* 621 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83613,7 +83411,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _arrayMapper = __webpack_require__(51); +var _arrayMapper = __webpack_require__(56); var _arrayMapper2 = _interopRequireDefault(_arrayMapper); @@ -83710,7 +83508,7 @@ var ColumnsMapper = function () { exports.default = ColumnsMapper; /***/ }), -/* 621 */ +/* 622 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83771,7 +83569,7 @@ var BacklightUI = function (_BaseUI) { exports.default = BacklightUI; /***/ }), -/* 622 */ +/* 623 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83832,13 +83630,13 @@ var GuidelineUI = function (_BaseUI) { exports.default = GuidelineUI; /***/ }), -/* 623 */ +/* 624 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 624 */ +/* 625 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83850,13 +83648,13 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); var _element = __webpack_require__(2); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -84521,7 +84319,7 @@ var ManualColumnResize = function (_BasePlugin) { exports.default = ManualColumnResize; /***/ }), -/* 625 */ +/* 626 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -84533,7 +84331,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -84547,25 +84345,25 @@ var _element = __webpack_require__(2); var _number = __webpack_require__(4); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); var _plugins = __webpack_require__(5); -var _rowsMapper = __webpack_require__(626); +var _rowsMapper = __webpack_require__(627); var _rowsMapper2 = _interopRequireDefault(_rowsMapper); -var _backlight = __webpack_require__(627); +var _backlight = __webpack_require__(628); var _backlight2 = _interopRequireDefault(_backlight); -var _guideline = __webpack_require__(628); +var _guideline = __webpack_require__(629); var _guideline2 = _interopRequireDefault(_guideline); -__webpack_require__(629); +__webpack_require__(630); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -85462,7 +85260,7 @@ var ManualRowMove = function (_BasePlugin) { exports.default = ManualRowMove; /***/ }), -/* 626 */ +/* 627 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85472,7 +85270,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _arrayMapper = __webpack_require__(51); +var _arrayMapper = __webpack_require__(56); var _arrayMapper2 = _interopRequireDefault(_arrayMapper); @@ -85569,7 +85367,7 @@ var RowsMapper = function () { exports.default = RowsMapper; /***/ }), -/* 627 */ +/* 628 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85630,7 +85428,7 @@ var BacklightUI = function (_BaseUI) { exports.default = BacklightUI; /***/ }), -/* 628 */ +/* 629 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85691,13 +85489,13 @@ var GuidelineUI = function (_BaseUI) { exports.default = GuidelineUI; /***/ }), -/* 629 */ +/* 630 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 630 */ +/* 631 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -85709,13 +85507,13 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); var _element = __webpack_require__(2); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -86306,7 +86104,7 @@ var ManualRowResize = function (_BasePlugin) { exports.default = ManualRowResize; /***/ }), -/* 631 */ +/* 632 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -86320,7 +86118,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -86332,9 +86130,9 @@ var _plugins = __webpack_require__(5); var _event = __webpack_require__(12); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); -var _cellsCollection = __webpack_require__(632); +var _cellsCollection = __webpack_require__(633); var _cellsCollection2 = _interopRequireDefault(_cellsCollection); @@ -86342,15 +86140,15 @@ var _cellCoords = __webpack_require__(163); var _cellCoords2 = _interopRequireDefault(_cellCoords); -var _autofill = __webpack_require__(633); +var _autofill = __webpack_require__(634); var _autofill2 = _interopRequireDefault(_autofill); -var _selection = __webpack_require__(634); +var _selection = __webpack_require__(635); var _selection2 = _interopRequireDefault(_selection); -var _toggleMerge = __webpack_require__(635); +var _toggleMerge = __webpack_require__(636); var _toggleMerge2 = _interopRequireDefault(_toggleMerge); @@ -86358,13 +86156,13 @@ var _array = __webpack_require__(0); var _object = __webpack_require__(1); -var _console = __webpack_require__(20); +var _console = __webpack_require__(22); var _number = __webpack_require__(4); var _utils = __webpack_require__(470); -__webpack_require__(636); +__webpack_require__(637); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -87549,7 +87347,7 @@ var MergeCells = function (_BasePlugin) { exports.default = MergeCells; /***/ }), -/* 632 */ +/* 633 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87565,11 +87363,11 @@ var _cellCoords = __webpack_require__(163); var _cellCoords2 = _interopRequireDefault(_cellCoords); -var _index = __webpack_require__(10); +var _index = __webpack_require__(9); var _number = __webpack_require__(4); -var _console = __webpack_require__(20); +var _console = __webpack_require__(22); var _array = __webpack_require__(0); @@ -87935,7 +87733,7 @@ var MergedCellsCollection = function () { exports.default = MergedCellsCollection; /***/ }), -/* 633 */ +/* 634 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87949,7 +87747,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _object = __webpack_require__(1); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); var _array = __webpack_require__(0); @@ -88442,7 +88240,7 @@ var AutofillCalculations = function () { exports.default = AutofillCalculations; /***/ }), -/* 634 */ +/* 635 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88454,7 +88252,7 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -88675,7 +88473,7 @@ var SelectionCalculations = function () { exports.default = SelectionCalculations; /***/ }), -/* 635 */ +/* 636 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88737,13 +88535,13 @@ function toggleMergeItem(plugin) { } /***/ }), -/* 636 */ +/* 637 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 637 */ +/* 638 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88757,19 +88555,19 @@ var _get = function get(object, property, receiver) { if (object === null) objec var _element = __webpack_require__(2); -var _browser = __webpack_require__(50); +var _browser = __webpack_require__(42); -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); var _plugins = __webpack_require__(5); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -89158,7 +88956,7 @@ var MultipleSelectionHandles = function (_BasePlugin) { exports.default = MultipleSelectionHandles; /***/ }), -/* 638 */ +/* 639 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89170,11 +88968,11 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); -var _dataObserver = __webpack_require__(639); +var _dataObserver = __webpack_require__(640); var _dataObserver2 = _interopRequireDefault(_dataObserver); @@ -89441,7 +89239,7 @@ exports.default = ObserveChanges; (0, _plugins.registerPlugin)('observeChanges', ObserveChanges); /***/ }), -/* 639 */ +/* 640 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89451,17 +89249,17 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _jsonPatchDuplex = __webpack_require__(640); +var _jsonPatchDuplex = __webpack_require__(641); var _jsonPatchDuplex2 = _interopRequireDefault(_jsonPatchDuplex); -var _localHooks = __webpack_require__(21); +var _localHooks = __webpack_require__(20); var _localHooks2 = _interopRequireDefault(_localHooks); var _object = __webpack_require__(1); -var _utils = __webpack_require__(641); +var _utils = __webpack_require__(642); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -89585,7 +89383,7 @@ var DataObserver = function () { exports.default = DataObserver; /***/ }), -/* 640 */ +/* 641 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90190,7 +89988,7 @@ if (true) { } /***/ }), -/* 641 */ +/* 642 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90282,7 +90080,7 @@ function parsePath(path) { } /***/ }), -/* 642 */ +/* 643 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90294,7 +90092,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -90304,7 +90102,7 @@ var _object = __webpack_require__(1); var _number = __webpack_require__(4); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -90670,7 +90468,7 @@ var Search = function (_BasePlugin) { exports.default = Search; /***/ }), -/* 643 */ +/* 644 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90686,13 +90484,13 @@ var _element = __webpack_require__(2); var _array = __webpack_require__(0); -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); var _plugins = __webpack_require__(5); -var _feature = __webpack_require__(41); +var _feature = __webpack_require__(43); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -90932,7 +90730,7 @@ var TouchScroll = function (_BasePlugin) { exports.default = TouchScroll; /***/ }), -/* 644 */ +/* 645 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90954,7 +90752,7 @@ var _object = __webpack_require__(1); var _event = __webpack_require__(12); -var _utils = __webpack_require__(24); +var _utils = __webpack_require__(23); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -91715,7 +91513,7 @@ hook.register('afterRedo'); exports.default = UndoRedo; /***/ }), -/* 645 */ +/* 646 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -91724,1352 +91522,88 @@ exports.default = UndoRedo; exports.__esModule = true; exports.TrimRows = exports.NestedRows = exports.NestedHeaders = exports.HiddenRows = exports.HiddenColumns = exports.HeaderTooltips = exports.GanttChart = exports.Formulas = exports.Filters = exports.MultiColumnSorting = exports.ExportFile = exports.DropdownMenu = exports.ColumnSummary = exports.CollapsibleColumns = exports.BindRowsWithHeaders = undefined; -var _bindRowsWithHeaders = __webpack_require__(646); +var _bindRowsWithHeaders = __webpack_require__(647); var _bindRowsWithHeaders2 = _interopRequireDefault(_bindRowsWithHeaders); -var _collapsibleColumns = __webpack_require__(651); +var _collapsibleColumns = __webpack_require__(652); var _collapsibleColumns2 = _interopRequireDefault(_collapsibleColumns); -var _columnSummary = __webpack_require__(652); +var _columnSummary = __webpack_require__(653); var _columnSummary2 = _interopRequireDefault(_columnSummary); -var _dropdownMenu = __webpack_require__(654); +var _dropdownMenu = __webpack_require__(655); var _dropdownMenu2 = _interopRequireDefault(_dropdownMenu); -var _exportFile = __webpack_require__(656); +var _exportFile = __webpack_require__(657); var _exportFile2 = _interopRequireDefault(_exportFile); -var _multiColumnSorting = __webpack_require__(661); +var _multiColumnSorting = __webpack_require__(662); var _multiColumnSorting2 = _interopRequireDefault(_multiColumnSorting); -var _filters = __webpack_require__(669); - -var _filters2 = _interopRequireDefault(_filters); - -var _formulas = __webpack_require__(698); - -var _formulas2 = _interopRequireDefault(_formulas); - -var _ganttChart = __webpack_require__(711); - -var _ganttChart2 = _interopRequireDefault(_ganttChart); - -var _headerTooltips = __webpack_require__(715); - -var _headerTooltips2 = _interopRequireDefault(_headerTooltips); - -var _nestedHeaders = __webpack_require__(716); - -var _nestedHeaders2 = _interopRequireDefault(_nestedHeaders); - -var _nestedRows = __webpack_require__(719); - -var _nestedRows2 = _interopRequireDefault(_nestedRows); - -var _hiddenColumns = __webpack_require__(724); - -var _hiddenColumns2 = _interopRequireDefault(_hiddenColumns); - -var _hiddenRows = __webpack_require__(728); - -var _hiddenRows2 = _interopRequireDefault(_hiddenRows); - -var _trimRows = __webpack_require__(732); - -var _trimRows2 = _interopRequireDefault(_trimRows); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// MultiColumnSorting must be initialized before Filters. Bug releated with "wrong listeners order" attached to 'modifyRow' and 'unmodifyRow' hooks. -exports.BindRowsWithHeaders = _bindRowsWithHeaders2.default; -exports.CollapsibleColumns = _collapsibleColumns2.default; -exports.ColumnSummary = _columnSummary2.default; -exports.DropdownMenu = _dropdownMenu2.default; -exports.ExportFile = _exportFile2.default; -exports.MultiColumnSorting = _multiColumnSorting2.default; -exports.Filters = _filters2.default; -exports.Formulas = _formulas2.default; -exports.GanttChart = _ganttChart2.default; -exports.HeaderTooltips = _headerTooltips2.default; -exports.HiddenColumns = _hiddenColumns2.default; -exports.HiddenRows = _hiddenRows2.default; -exports.NestedHeaders = _nestedHeaders2.default; -exports.NestedRows = _nestedRows2.default; -exports.TrimRows = _trimRows2.default; -// HiddenColumns must be initialized after NestedHeaders. Bug releated with wrong listeners order attached to 'modifyColWidth' hook. - -/***/ }), -/* 646 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _base = __webpack_require__(6); - -var _base2 = _interopRequireDefault(_base); - -var _number = __webpack_require__(4); - -var _plugins = __webpack_require__(5); - -var _bindStrategy = __webpack_require__(647); - -var _bindStrategy2 = _interopRequireDefault(_bindStrategy); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -/** - * @plugin BindRowsWithHeaders - * @pro - * - * @description - * Plugin allows binding the table rows with their headers. - * - * If the plugin is enabled, the table row headers will "stick" to the rows, when they are hidden/moved. Basically, if - * at the initialization row 0 has a header titled "A", it will have it no matter what you do with the table. - * - * @example - * ```js - * const container = document.getElementById('example'); - * const hot = new Handsontable(container, { - * date: getData(), - * // enable plugin - * bindRowsWithHeaders: true - * }); - * ``` - */ -var BindRowsWithHeaders = function (_BasePlugin) { - _inherits(BindRowsWithHeaders, _BasePlugin); - - function BindRowsWithHeaders(hotInstance) { - _classCallCheck(this, BindRowsWithHeaders); - - /** - * Strategy object for binding rows with headers. - * - * @private - * @type {BindStrategy} - */ - var _this = _possibleConstructorReturn(this, (BindRowsWithHeaders.__proto__ || Object.getPrototypeOf(BindRowsWithHeaders)).call(this, hotInstance)); - - _this.bindStrategy = new _bindStrategy2.default(); - /** - * List of last removed row indexes. - * - * @private - * @type {Array} - */ - _this.removedRows = []; - return _this; - } - - /** - * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit} - * hook and if it returns `true` than the {@link BindRowsWithHeaders#enablePlugin} method is called. - * - * @returns {Boolean} - */ - - - _createClass(BindRowsWithHeaders, [{ - key: 'isEnabled', - value: function isEnabled() { - return !!this.hot.getSettings().bindRowsWithHeaders; - } - - /** - * Enables the plugin functionality for this Handsontable instance. - */ - - }, { - key: 'enablePlugin', - value: function enablePlugin() { - var _this2 = this; - - if (this.enabled) { - return; - } - var bindStrategy = this.hot.getSettings().bindRowsWithHeaders; - - if (typeof bindStrategy !== 'string') { - bindStrategy = _bindStrategy2.default.DEFAULT_STRATEGY; - } - this.bindStrategy.setStrategy(bindStrategy); - this.bindStrategy.createMap(this.hot.countSourceRows()); - - this.addHook('modifyRowHeader', function (row) { - return _this2.onModifyRowHeader(row); - }); - this.addHook('afterCreateRow', function (index, amount) { - return _this2.onAfterCreateRow(index, amount); - }); - this.addHook('beforeRemoveRow', function (index, amount) { - return _this2.onBeforeRemoveRow(index, amount); - }); - this.addHook('afterRemoveRow', function () { - return _this2.onAfterRemoveRow(); - }); - this.addHook('afterLoadData', function (firstRun) { - return _this2.onAfterLoadData(firstRun); - }); - - _get(BindRowsWithHeaders.prototype.__proto__ || Object.getPrototypeOf(BindRowsWithHeaders.prototype), 'enablePlugin', this).call(this); - } - - /** - * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. - */ - - }, { - key: 'updatePlugin', - value: function updatePlugin() { - _get(BindRowsWithHeaders.prototype.__proto__ || Object.getPrototypeOf(BindRowsWithHeaders.prototype), 'updatePlugin', this).call(this); - } - - /** - * Disables the plugin functionality for this Handsontable instance. - */ - - }, { - key: 'disablePlugin', - value: function disablePlugin() { - this.removedRows.length = 0; - this.bindStrategy.clearMap(); - _get(BindRowsWithHeaders.prototype.__proto__ || Object.getPrototypeOf(BindRowsWithHeaders.prototype), 'disablePlugin', this).call(this); - } - - /** - * On modify row header listener. - * - * @private - * @param {Number} row Row index. - * @returns {Number} - * - * @fires Hooks#modifyRow - */ - - }, { - key: 'onModifyRowHeader', - value: function onModifyRowHeader(row) { - return this.bindStrategy.translate(this.hot.runHooks('modifyRow', row)); - } - - /** - * On after create row listener. - * - * @private - * @param {Number} index Row index. - * @param {Number} amount Defines how many rows removed. - */ - - }, { - key: 'onAfterCreateRow', - value: function onAfterCreateRow(index, amount) { - this.bindStrategy.createRow(index, amount); - } - - /** - * On before remove row listener. - * - * @private - * @param {Number} index Row index. - * @param {Number} amount Defines how many rows removed. - * - * @fires Hooks#modifyRow - */ - - }, { - key: 'onBeforeRemoveRow', - value: function onBeforeRemoveRow(index, amount) { - var _this3 = this; - - this.removedRows.length = 0; - - if (index !== false) { - // Collect physical row index. - (0, _number.rangeEach)(index, index + amount - 1, function (removedIndex) { - _this3.removedRows.push(_this3.hot.runHooks('modifyRow', removedIndex)); - }); - } - } - - /** - * On after remove row listener. - * - * @private - */ - - }, { - key: 'onAfterRemoveRow', - value: function onAfterRemoveRow() { - this.bindStrategy.removeRow(this.removedRows); - } - - /** - * On after load data listener. - * - * @private - * @param {Boolean} firstRun Indicates if hook was fired while Handsontable initialization. - */ - - }, { - key: 'onAfterLoadData', - value: function onAfterLoadData(firstRun) { - if (!firstRun) { - this.bindStrategy.createMap(this.hot.countSourceRows()); - } - } - - /** - * Destroys the plugin instance. - */ - - }, { - key: 'destroy', - value: function destroy() { - this.bindStrategy.destroy(); - _get(BindRowsWithHeaders.prototype.__proto__ || Object.getPrototypeOf(BindRowsWithHeaders.prototype), 'destroy', this).call(this); - } - }]); - - return BindRowsWithHeaders; -}(_base2.default); - -(0, _plugins.registerPlugin)('bindRowsWithHeaders', BindRowsWithHeaders); - -exports.default = BindRowsWithHeaders; - -/***/ }), -/* 647 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _number = __webpack_require__(4); - -var _string = __webpack_require__(32); - -var _bindStrategies = __webpack_require__(648); - -var strategies = _interopRequireWildcard(_bindStrategies); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * @class BindStrategy - * @plugin BindRowsWithHeaders - * @pro - */ -var BindStrategy = function () { - _createClass(BindStrategy, null, [{ - key: 'DEFAULT_STRATEGY', - - /** - * Loose bind mode. - * - * @returns {String} - */ - get: function get() { - return 'loose'; - } - }]); - - function BindStrategy() { - _classCallCheck(this, BindStrategy); - - this.strategy = null; - } - - /** - * Set strategy behaviors for binding rows with headers. - * - * @param name - */ - - - _createClass(BindStrategy, [{ - key: 'setStrategy', - value: function setStrategy(name) { - var Strategy = strategies[(0, _string.toUpperCaseFirst)(name)]; - - if (!Strategy) { - throw new Error('Bind strategy "' + name + '" does not exist.'); - } - this.strategy = new Strategy(); - } - - /** - * Reset current map array and create a new one. - * - * @param {Number} [length] Custom generated map length. - */ - - }, { - key: 'createMap', - value: function createMap(length) { - var strategy = this.strategy; - var originLength = length === void 0 ? strategy._arrayMap.length : length; - - strategy._arrayMap.length = 0; - - (0, _number.rangeEach)(originLength - 1, function (itemIndex) { - strategy._arrayMap.push(itemIndex); - }); - } - - /** - * Alias for createRow of strategy class. - * - * @param {*} params - */ - - }, { - key: 'createRow', - value: function createRow() { - var _strategy; - - (_strategy = this.strategy).createRow.apply(_strategy, arguments); - } - - /** - * Alias for removeRow of strategy class. - * - * @param {*} params - */ - - }, { - key: 'removeRow', - value: function removeRow() { - var _strategy2; - - (_strategy2 = this.strategy).removeRow.apply(_strategy2, arguments); - } - - /** - * Alias for getValueByIndex of strategy class. - * - * @param {*} params - */ - - }, { - key: 'translate', - value: function translate() { - var _strategy3; - - return (_strategy3 = this.strategy).getValueByIndex.apply(_strategy3, arguments); - } - - /** - * Clear array map. - */ - - }, { - key: 'clearMap', - value: function clearMap() { - this.strategy.clearMap(); - } - - /** - * Destroy class. - */ - - }, { - key: 'destroy', - value: function destroy() { - if (this.strategy) { - this.strategy.destroy(); - } - this.strategy = null; - } - }]); - - return BindStrategy; -}(); - -exports.default = BindStrategy; - -/***/ }), -/* 648 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.Strict = exports.Loose = undefined; - -var _loose = __webpack_require__(649); - -var _loose2 = _interopRequireDefault(_loose); - -var _strict = __webpack_require__(650); - -var _strict2 = _interopRequireDefault(_strict); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.Loose = _loose2.default; -exports.Strict = _strict2.default; - -/***/ }), -/* 649 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _arrayMapper = __webpack_require__(51); - -var _arrayMapper2 = _interopRequireDefault(_arrayMapper); - -var _object = __webpack_require__(1); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * @private - * @class LooseBindStrategy - */ -var LooseBindStrategy = function () { - function LooseBindStrategy() { - _classCallCheck(this, LooseBindStrategy); - } - - _createClass(LooseBindStrategy, [{ - key: 'createRow', - - - /** - * Strategy for the create row action. - * - * @param {Number} index Row index. - * @param {Number} amount - */ - value: function createRow(index, amount) { - this.shiftItems(index, amount); - } - - /** - * Strategy for the remove row action. - * - * @param {Number|Array} index Row index or Array of row indexes. - * @param {Number} amount - */ - - }, { - key: 'removeRow', - value: function removeRow(index, amount) { - this.unshiftItems(index, amount); - } - - /** - * Destroy strategy class. - */ - - }, { - key: 'destroy', - value: function destroy() { - this._arrayMap = null; - } - }], [{ - key: 'STRATEGY_NAME', - - /** - * Loose bind mode. - * - * @returns {String} - */ - get: function get() { - return 'loose'; - } - }]); - - return LooseBindStrategy; -}(); - -(0, _object.mixin)(LooseBindStrategy, _arrayMapper2.default); - -exports.default = LooseBindStrategy; - -/***/ }), -/* 650 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _arrayMapper = __webpack_require__(51); - -var _arrayMapper2 = _interopRequireDefault(_arrayMapper); - -var _object = __webpack_require__(1); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * @private - * @class StrictBindStrategy - */ -var StrictBindStrategy = function () { - function StrictBindStrategy() { - _classCallCheck(this, StrictBindStrategy); - } - - _createClass(StrictBindStrategy, [{ - key: 'createRow', - - - /** - * Strategy for the create row action. - * - * @param {Number} index Row index. - * @param {Number} amount - */ - value: function createRow(index, amount) { - this.insertItems(index, amount); - } - - /** - * Strategy for the remove row action. - * - * @param {Number|Array} index Row index or Array of row indexes. - * @param {Number} amount - */ - - }, { - key: 'removeRow', - value: function removeRow(index, amount) { - this.removeItems(index, amount); - } - - /** - * Destroy strategy class. - */ - - }, { - key: 'destroy', - value: function destroy() { - this._arrayMap = null; - } - }], [{ - key: 'STRATEGY_NAME', - - /** - * Loose bind mode. - * - * @returns {String} - */ - get: function get() { - return 'strict'; - } - }]); - - return StrictBindStrategy; -}(); - -(0, _object.mixin)(StrictBindStrategy, _arrayMapper2.default); - -exports.default = StrictBindStrategy; - -/***/ }), -/* 651 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _object = __webpack_require__(1); - -var _array = __webpack_require__(0); - -var _number = __webpack_require__(4); - -var _console = __webpack_require__(20); - -var _element = __webpack_require__(2); - -var _eventManager = __webpack_require__(9); - -var _eventManager2 = _interopRequireDefault(_eventManager); - -var _plugins = __webpack_require__(5); - -var _event = __webpack_require__(12); - -var _base = __webpack_require__(6); - -var _base2 = _interopRequireDefault(_base); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -/** - * @plugin CollapsibleColumns - * @pro - * @dependencies NestedHeaders HiddenColumns - * - * @description - * The {@link CollapsibleColumns} plugin allows collapsing of columns, covered by a header with the `colspan` property defined. - * - * Clicking the "collapse/expand" button collapses (or expands) all "child" headers except the first one. - * - * Setting the {@link Options#collapsibleColumns} property to `true` will display a "collapse/expand" button in every header - * with a defined `colspan` property. - * - * To limit this functionality to a smaller group of headers, define the `collapsibleColumns` property as an array - * of objects, as in the example below. - * - * @example - * ```js - * const container = document.getElementById('example'); - * const hot = new Handsontable(container, { - * data: generateDataObj(), - * colHeaders: true, - * rowHeaders: true, - * // enable plugin - * collapsibleColumns: true, - * }); - * - * // or - * const hot = new Handsontable(container, { - * data: generateDataObj(), - * colHeaders: true, - * rowHeaders: true, - * // enable and configure which columns can be collapsed - * collapsibleColumns: [ - * {row: -4, col: 1, collapsible: true}, - * {row: -3, col: 5, collapsible: true} - * ], - * }); - * ``` - */ -var CollapsibleColumns = function (_BasePlugin) { - _inherits(CollapsibleColumns, _BasePlugin); - - function CollapsibleColumns(hotInstance) { - _classCallCheck(this, CollapsibleColumns); - - /** - * Cached plugin settings. - * - * @private - * @type {Boolean|Array} - */ - var _this = _possibleConstructorReturn(this, (CollapsibleColumns.__proto__ || Object.getPrototypeOf(CollapsibleColumns)).call(this, hotInstance)); - - _this.settings = null; - /** - * Object listing headers with buttons enabled. - * - * @private - * @type {Object} - */ - _this.buttonEnabledList = {}; - /** - * Cached reference to the HiddenColumns plugin. - * - * @private - * @type {Object} - */ - _this.hiddenColumnsPlugin = null; - /** - * Cached reference to the NestedHeaders plugin. - * - * @private - * @type {Object} - */ - _this.nestedHeadersPlugin = null; - /** - * Object listing the currently collapsed sections. - * - * @private - * @type {Object} - */ - _this.collapsedSections = {}; - /** - * Number of column header levels. - * - * @private - * @type {Number} - */ - _this.columnHeaderLevelCount = null; - /** - * Event manager instance reference. - * - * @private - * @type {EventManager} - */ - _this.eventManager = null; - return _this; - } - - /** - * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit} - * hook and if it returns `true` than the {@link CollapsibleColumns#enablePlugin} method is called. - * - * @returns {Boolean} - */ - - - _createClass(CollapsibleColumns, [{ - key: 'isEnabled', - value: function isEnabled() { - return !!this.hot.getSettings().collapsibleColumns; - } - - /** - * Enables the plugin functionality for this Handsontable instance. - */ - - }, { - key: 'enablePlugin', - value: function enablePlugin() { - var _this2 = this; - - if (this.enabled) { - return; - } - - this.settings = this.hot.getSettings().collapsibleColumns; - - if (typeof this.settings !== 'boolean') { - this.parseSettings(); - } - - this.hiddenColumnsPlugin = this.hot.getPlugin('hiddenColumns'); - this.nestedHeadersPlugin = this.hot.getPlugin('nestedHeaders'); - - this.checkDependencies(); - - this.addHook('afterRender', function () { - return _this2.onAfterRender(); - }); - this.addHook('afterInit', function () { - return _this2.onAfterInit(); - }); - this.addHook('afterGetColHeader', function (col, TH) { - return _this2.onAfterGetColHeader(col, TH); - }); - this.addHook('beforeOnCellMouseDown', function (event, coords, TD) { - return _this2.onBeforeOnCellMouseDown(event, coords, TD); - }); - - this.eventManager = new _eventManager2.default(this.hot); - - _get(CollapsibleColumns.prototype.__proto__ || Object.getPrototypeOf(CollapsibleColumns.prototype), 'enablePlugin', this).call(this); - } - - /** - * Disables the plugin functionality for this Handsontable instance. - */ - - }, { - key: 'disablePlugin', - value: function disablePlugin() { - this.settings = null; - this.buttonEnabledList = {}; - this.hiddenColumnsPlugin = null; - this.collapsedSections = {}; - - this.clearButtons(); - - _get(CollapsibleColumns.prototype.__proto__ || Object.getPrototypeOf(CollapsibleColumns.prototype), 'disablePlugin', this).call(this); - } - - /** - * Clears the expand/collapse buttons. - * - * @private - */ - - }, { - key: 'clearButtons', - value: function clearButtons() { - if (!this.hot.view) { - return; - } - - var headerLevels = this.hot.view.wt.getSetting('columnHeaders').length; - var mainHeaders = this.hot.view.wt.wtTable.THEAD; - var topHeaders = this.hot.view.wt.wtOverlays.topOverlay.clone.wtTable.THEAD; - var topLeftCornerHeaders = this.hot.view.wt.wtOverlays.topLeftCornerOverlay ? this.hot.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.THEAD : null; - - var removeButton = function removeButton(button) { - if (button) { - button.parentNode.removeChild(button); - } - }; - - (0, _number.rangeEach)(0, headerLevels - 1, function (i) { - var masterLevel = mainHeaders.childNodes[i]; - var topLevel = topHeaders.childNodes[i]; - var topLeftCornerLevel = topLeftCornerHeaders ? topLeftCornerHeaders.childNodes[i] : null; - - (0, _number.rangeEach)(0, masterLevel.childNodes.length - 1, function (j) { - var button = masterLevel.childNodes[j].querySelector('.collapsibleIndicator'); - - removeButton(button); - - if (topLevel && topLevel.childNodes[j]) { - button = topLevel.childNodes[j].querySelector('.collapsibleIndicator'); - - removeButton(button); - } - - if (topLeftCornerHeaders && topLeftCornerLevel && topLeftCornerLevel.childNodes[j]) { - button = topLeftCornerLevel.childNodes[j].querySelector('.collapsibleIndicator'); - - removeButton(button); - } - }); - }, true); - } - - /** - * Parses the plugin settings and create a button configuration array. - * - * @private - */ - - }, { - key: 'parseSettings', - value: function parseSettings() { - var _this3 = this; - - (0, _object.objectEach)(this.settings, function (val) { - - if (!_this3.buttonEnabledList[val.row]) { - _this3.buttonEnabledList[val.row] = {}; - } - - _this3.buttonEnabledList[val.row][val.col] = val.collapsible; - }); - } - - /** - * Checks if plugin dependencies are met. - * - * @private - * @returns {Boolean} - */ - - }, { - key: 'meetsDependencies', - value: function meetsDependencies() { - var settings = this.hot.getSettings(); - - return settings.nestedHeaders && settings.hiddenColumns; - } - - /** - * Checks if all the required dependencies are enabled. - * - * @private - */ - - }, { - key: 'checkDependencies', - value: function checkDependencies() { - var settings = this.hot.getSettings(); - - if (this.meetsDependencies()) { - return; - } - - if (!settings.nestedHeaders) { - (0, _console.warn)('You need to configure the Nested Headers plugin in order to use collapsible headers.'); - } - - if (!settings.hiddenColumns) { - (0, _console.warn)('You need to configure the Hidden Columns plugin in order to use collapsible headers.'); - } - } - - /** - * Generates the indicator element. - * - * @private - * @param {Number} column Column index. - * @param {HTMLElement} TH TH Element. - * @returns {HTMLElement} - */ - - }, { - key: 'generateIndicator', - value: function generateIndicator(column, TH) { - var TR = TH.parentNode; - var THEAD = TR.parentNode; - var row = -1 * THEAD.childNodes.length + Array.prototype.indexOf.call(THEAD.childNodes, TR); - - if (Object.keys(this.buttonEnabledList).length > 0 && (!this.buttonEnabledList[row] || !this.buttonEnabledList[row][column])) { - return null; - } - - var divEl = document.createElement('DIV'); - - (0, _element.addClass)(divEl, 'collapsibleIndicator'); - - if (this.collapsedSections[row] && this.collapsedSections[row][column] === true) { - (0, _element.addClass)(divEl, 'collapsed'); - (0, _element.fastInnerText)(divEl, '+'); - } else { - (0, _element.addClass)(divEl, 'expanded'); - (0, _element.fastInnerText)(divEl, '-'); - } - - return divEl; - } - - /** - * Marks (internally) a section as 'collapsed' or 'expanded' (optionally, also mark the 'child' headers). - * - * @private - * @param {String} state State ('collapsed' or 'expanded'). - * @param {Number} row Row index. - * @param {Number} column Column index. - * @param {Boolean} recursive If `true`, it will also attempt to mark the child sections. - */ - - }, { - key: 'markSectionAs', - value: function markSectionAs(state, row, column, recursive) { - if (!this.collapsedSections[row]) { - this.collapsedSections[row] = {}; - } - - switch (state) { - case 'collapsed': - this.collapsedSections[row][column] = true; - - break; - case 'expanded': - this.collapsedSections[row][column] = void 0; - - break; - default: - break; - } - - if (recursive) { - var nestedHeadersColspans = this.nestedHeadersPlugin.colspanArray; - var level = this.nestedHeadersPlugin.rowCoordsToLevel(row); - var childHeaders = this.nestedHeadersPlugin.getChildHeaders(row, column); - var childColspanLevel = nestedHeadersColspans[level + 1]; - - for (var i = 1; i < childHeaders.length; i++) { - if (childColspanLevel && childColspanLevel[childHeaders[i]].colspan > 1) { - this.markSectionAs(state, row + 1, childHeaders[i], true); - } - } - } - } - - /** - * Expands section at the provided coords. - * - * @param {Object} coords Contains coordinates information. (`coords.row`, `coords.col`) - */ - - }, { - key: 'expandSection', - value: function expandSection(coords) { - this.markSectionAs('expanded', coords.row, coords.col, true); - this.toggleCollapsibleSection(coords, 'expand'); - } - - /** - * Collapses section at the provided coords. - * - * @param {Object} coords Contains coordinates information. (`coords.row`, `coords.col`) - */ - - }, { - key: 'collapseSection', - value: function collapseSection(coords) { - this.markSectionAs('collapsed', coords.row, coords.col, true); - this.toggleCollapsibleSection(coords, 'collapse'); - } - - /** - * Collapses or expand all collapsible sections, depending on the action parameter. - * - * @param {String} action 'collapse' or 'expand'. - */ - - }, { - key: 'toggleAllCollapsibleSections', - value: function toggleAllCollapsibleSections(action) { - var _this4 = this; - - var nestedHeadersColspanArray = this.nestedHeadersPlugin.colspanArray; - - if (this.settings === true) { - - (0, _array.arrayEach)(nestedHeadersColspanArray, function (headerLevel, i) { - (0, _array.arrayEach)(headerLevel, function (header, j) { - if (header.colspan > 1) { - var row = _this4.nestedHeadersPlugin.levelToRowCoords(parseInt(i, 10)); - var col = parseInt(j, 10); - - _this4.markSectionAs(action === 'collapse' ? 'collapsed' : 'expanded', row, col, true); - _this4.toggleCollapsibleSection({ - row: row, - col: col - }, action); - } - }); - }); - } else { - (0, _object.objectEach)(this.buttonEnabledList, function (headerRow, i) { - (0, _object.objectEach)(headerRow, function (header, j) { - var rowIndex = parseInt(i, 10); - var columnIndex = parseInt(j, 10); - - _this4.markSectionAs(action === 'collapse' ? 'collapsed' : 'expanded', rowIndex, columnIndex, true); - _this4.toggleCollapsibleSection({ - row: rowIndex, - col: columnIndex - }, action); - }); - }); - } - } - - /** - * Collapses all collapsible sections. - */ - - }, { - key: 'collapseAll', - value: function collapseAll() { - this.toggleAllCollapsibleSections('collapse'); - } - - /** - * Expands all collapsible sections. - */ - - }, { - key: 'expandAll', - value: function expandAll() { - this.toggleAllCollapsibleSections('expand'); - } - - /** - * Collapses/Expands a section. - * - * @param {Object} coords Section coordinates. - * @param {String} action Action definition ('collapse' or 'expand'). - */ - - }, { - key: 'toggleCollapsibleSection', - value: function toggleCollapsibleSection(coords, action) { - var _this5 = this; - - if (coords.row) { - coords.row = parseInt(coords.row, 10); - } - if (coords.col) { - coords.col = parseInt(coords.col, 10); - } - - var hiddenColumns = this.hiddenColumnsPlugin.hiddenColumns; - var colspanArray = this.nestedHeadersPlugin.colspanArray; - var level = this.nestedHeadersPlugin.rowCoordsToLevel(coords.row); - var currentHeaderColspan = colspanArray[level][coords.col].colspan; - var childHeaders = this.nestedHeadersPlugin.getChildHeaders(coords.row, coords.col); - var nextLevel = level + 1; - var childColspanLevel = colspanArray[nextLevel]; - var firstChildColspan = childColspanLevel ? childColspanLevel[childHeaders[0]].colspan || 1 : 1; - - while (firstChildColspan === currentHeaderColspan && nextLevel < this.columnHeaderLevelCount) { - nextLevel += 1; - childColspanLevel = colspanArray[nextLevel]; - firstChildColspan = childColspanLevel ? childColspanLevel[childHeaders[0]].colspan || 1 : 1; - } - - (0, _number.rangeEach)(firstChildColspan, currentHeaderColspan - 1, function (i) { - var colToHide = coords.col + i; - - switch (action) { - case 'collapse': - if (!_this5.hiddenColumnsPlugin.isHidden(colToHide)) { - hiddenColumns.push(colToHide); - } - - break; - case 'expand': - if (_this5.hiddenColumnsPlugin.isHidden(colToHide)) { - hiddenColumns.splice(hiddenColumns.indexOf(colToHide), 1); - } - - break; - default: - break; - } - }); - - this.hot.render(); - this.hot.view.wt.wtOverlays.adjustElementsSize(true); - } - - /** - * Adds the indicator to the headers. - * - * @private - * @param {Number} column Column index. - * @param {HTMLElement} TH TH element. - */ - - }, { - key: 'onAfterGetColHeader', - value: function onAfterGetColHeader(column, TH) { - if (TH.hasAttribute('colspan') && TH.getAttribute('colspan') > 1 && column >= this.hot.getSettings().fixedColumnsLeft) { - var button = this.generateIndicator(column, TH); +var _filters = __webpack_require__(667); - if (button !== null) { - TH.querySelector('div:first-child').appendChild(button); - } - } - } +var _filters2 = _interopRequireDefault(_filters); - /** - * Indicator mouse event callback. - * - * @private - * @param {Object} event Mouse event. - * @param {Object} coords Event coordinates. - */ +var _formulas = __webpack_require__(696); - }, { - key: 'onBeforeOnCellMouseDown', - value: function onBeforeOnCellMouseDown(event, coords) { - if ((0, _element.hasClass)(event.target, 'collapsibleIndicator')) { - if ((0, _element.hasClass)(event.target, 'expanded')) { +var _formulas2 = _interopRequireDefault(_formulas); - // mark section as collapsed - if (!this.collapsedSections[coords.row]) { - this.collapsedSections[coords.row] = []; - } +var _ganttChart = __webpack_require__(709); - this.markSectionAs('collapsed', coords.row, coords.col, true); - this.eventManager.fireEvent(event.target, 'mouseup'); - this.toggleCollapsibleSection(coords, 'collapse'); - } else if ((0, _element.hasClass)(event.target, 'collapsed')) { +var _ganttChart2 = _interopRequireDefault(_ganttChart); - this.markSectionAs('expanded', coords.row, coords.col, true); - this.eventManager.fireEvent(event.target, 'mouseup'); - this.toggleCollapsibleSection(coords, 'expand'); - } +var _headerTooltips = __webpack_require__(713); - (0, _event.stopImmediatePropagation)(event); - return false; - } - } +var _headerTooltips2 = _interopRequireDefault(_headerTooltips); - /** - * AfterInit hook callback. - * - * @private - */ +var _nestedHeaders = __webpack_require__(714); - }, { - key: 'onAfterInit', - value: function onAfterInit() { - this.columnHeaderLevelCount = this.hot.view.wt.getSetting('columnHeaders').length; - } +var _nestedHeaders2 = _interopRequireDefault(_nestedHeaders); - /** - * AfterRender hook callback. - * - * @private - */ +var _nestedRows = __webpack_require__(717); - }, { - key: 'onAfterRender', - value: function onAfterRender() { - if (!this.nestedHeadersPlugin.enabled || !this.hiddenColumnsPlugin.enabled) { - this.disablePlugin(); - } - } +var _nestedRows2 = _interopRequireDefault(_nestedRows); - /** - * Destroys the plugin instance. - */ +var _hiddenColumns = __webpack_require__(722); - }, { - key: 'destroy', - value: function destroy() { - this.settings = null; - this.buttonEnabledList = null; - this.hiddenColumnsPlugin = null; - this.nestedHeadersPlugin = null; - this.collapsedSections = null; - this.columnHeaderLevelCount = null; +var _hiddenColumns2 = _interopRequireDefault(_hiddenColumns); - _get(CollapsibleColumns.prototype.__proto__ || Object.getPrototypeOf(CollapsibleColumns.prototype), 'destroy', this).call(this); - } - }]); +var _hiddenRows = __webpack_require__(726); - return CollapsibleColumns; -}(_base2.default); +var _hiddenRows2 = _interopRequireDefault(_hiddenRows); -(0, _plugins.registerPlugin)('collapsibleColumns', CollapsibleColumns); +var _trimRows = __webpack_require__(730); -exports.default = CollapsibleColumns; +var _trimRows2 = _interopRequireDefault(_trimRows); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// MultiColumnSorting must be initialized before Filters. Bug releated with "wrong listeners order" attached to 'modifyRow' and 'unmodifyRow' hooks. +exports.BindRowsWithHeaders = _bindRowsWithHeaders2.default; +exports.CollapsibleColumns = _collapsibleColumns2.default; +exports.ColumnSummary = _columnSummary2.default; +exports.DropdownMenu = _dropdownMenu2.default; +exports.ExportFile = _exportFile2.default; +exports.MultiColumnSorting = _multiColumnSorting2.default; +exports.Filters = _filters2.default; +exports.Formulas = _formulas2.default; +exports.GanttChart = _ganttChart2.default; +exports.HeaderTooltips = _headerTooltips2.default; +exports.HiddenColumns = _hiddenColumns2.default; +exports.HiddenRows = _hiddenRows2.default; +exports.NestedHeaders = _nestedHeaders2.default; +exports.NestedRows = _nestedRows2.default; +exports.TrimRows = _trimRows2.default; +// HiddenColumns must be initialized after NestedHeaders. Bug releated with wrong listeners order attached to 'modifyColWidth' hook. /***/ }), -/* 652 */ +/* 647 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -93081,17 +91615,17 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); -var _object = __webpack_require__(1); +var _number = __webpack_require__(4); var _plugins = __webpack_require__(5); -var _endpoints5 = __webpack_require__(653); +var _bindStrategy = __webpack_require__(648); -var _endpoints6 = _interopRequireDefault(_endpoints5); +var _bindStrategy2 = _interopRequireDefault(_bindStrategy); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -93102,70 +91636,62 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * @plugin ColumnSummary + * @plugin BindRowsWithHeaders * @pro * * @description - * Allows making pre-defined calculations on the cell values and display the results within Handsontable. - * [See the demo for more information](https://docs.handsontable.com/pro/demo-summary-calculations.html). - *s + * Plugin allows binding the table rows with their headers. + * + * If the plugin is enabled, the table row headers will "stick" to the rows, when they are hidden/moved. Basically, if + * at the initialization row 0 has a header titled "A", it will have it no matter what you do with the table. + * * @example + * ```js * const container = document.getElementById('example'); * const hot = new Handsontable(container, { - * data: getData(), - * colHeaders: true, - * rowHeaders: true, - * columnSummary: [ - * { - * destinationRow: 4, - * destinationColumn: 1, - * type: 'min' - * }, - * { - * destinationRow: 0, - * destinationColumn: 3, - * reversedRowCoords: true, - * type: 'max' - * }, - * { - * destinationRow: 4, - * destinationColumn: 5, - * type: 'sum', - * forceNumeric: true - * } - * ] + * date: getData(), + * // enable plugin + * bindRowsWithHeaders: true * }); + * ``` */ -var ColumnSummary = function (_BasePlugin) { - _inherits(ColumnSummary, _BasePlugin); +var BindRowsWithHeaders = function (_BasePlugin) { + _inherits(BindRowsWithHeaders, _BasePlugin); - function ColumnSummary(hotInstance) { - _classCallCheck(this, ColumnSummary); + function BindRowsWithHeaders(hotInstance) { + _classCallCheck(this, BindRowsWithHeaders); /** - * The Endpoints class instance. Used to make all endpoint-related operations. + * Strategy object for binding rows with headers. * * @private - * @type {null|Endpoints} + * @type {BindStrategy} */ - var _this = _possibleConstructorReturn(this, (ColumnSummary.__proto__ || Object.getPrototypeOf(ColumnSummary)).call(this, hotInstance)); + var _this = _possibleConstructorReturn(this, (BindRowsWithHeaders.__proto__ || Object.getPrototypeOf(BindRowsWithHeaders)).call(this, hotInstance)); - _this.endpoints = null; + _this.bindStrategy = new _bindStrategy2.default(); + /** + * List of last removed row indexes. + * + * @private + * @type {Array} + */ + _this.removedRows = []; return _this; } /** * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit} - * hook and if it returns `true` than the {@link ColumnSummary#enablePlugin} method is called. + * hook and if it returns `true` than the {@link BindRowsWithHeaders#enablePlugin} method is called. * * @returns {Boolean} */ - _createClass(ColumnSummary, [{ + _createClass(BindRowsWithHeaders, [{ key: 'isEnabled', value: function isEnabled() { - return !!this.hot.getSettings().columnSummary; + return !!this.hot.getSettings().bindRowsWithHeaders; } /** @@ -93180,74 +91706,41 @@ var ColumnSummary = function (_BasePlugin) { if (this.enabled) { return; } + var bindStrategy = this.hot.getSettings().bindRowsWithHeaders; - this.settings = this.hot.getSettings().columnSummary; - this.endpoints = new _endpoints6.default(this, this.settings); - - this.addHook('afterInit', function () { - return _this2.onAfterInit.apply(_this2, arguments); - }); - this.addHook('afterChange', function () { - return _this2.onAfterChange.apply(_this2, arguments); - }); - - this.addHook('beforeCreateRow', function (index, amount, source) { - return _this2.endpoints.resetSetupBeforeStructureAlteration('insert_row', index, amount, null, source); - }); - this.addHook('beforeCreateCol', function (index, amount, source) { - return _this2.endpoints.resetSetupBeforeStructureAlteration('insert_col', index, amount, null, source); - }); - this.addHook('beforeRemoveRow', function () { - var _endpoints; - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return (_endpoints = _this2.endpoints).resetSetupBeforeStructureAlteration.apply(_endpoints, ['remove_row'].concat(args)); - }); - this.addHook('beforeRemoveCol', function () { - var _endpoints2; - - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + if (typeof bindStrategy !== 'string') { + bindStrategy = _bindStrategy2.default.DEFAULT_STRATEGY; + } + this.bindStrategy.setStrategy(bindStrategy); + this.bindStrategy.createMap(this.hot.countSourceRows()); - return (_endpoints2 = _this2.endpoints).resetSetupBeforeStructureAlteration.apply(_endpoints2, ['remove_col'].concat(args)); - }); - this.addHook('beforeRowMove', function () { - return _this2.onBeforeRowMove.apply(_this2, arguments); + this.addHook('modifyRowHeader', function (row) { + return _this2.onModifyRowHeader(row); }); - - this.addHook('afterCreateRow', function (index, amount, source) { - return _this2.endpoints.resetSetupAfterStructureAlteration('insert_row', index, amount, null, source); + this.addHook('afterCreateRow', function (index, amount) { + return _this2.onAfterCreateRow(index, amount); }); - this.addHook('afterCreateCol', function (index, amount, source) { - return _this2.endpoints.resetSetupAfterStructureAlteration('insert_col', index, amount, null, source); + this.addHook('beforeRemoveRow', function (index, amount) { + return _this2.onBeforeRemoveRow(index, amount); }); this.addHook('afterRemoveRow', function () { - var _endpoints3; - - for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - - return (_endpoints3 = _this2.endpoints).resetSetupAfterStructureAlteration.apply(_endpoints3, ['remove_row'].concat(args)); + return _this2.onAfterRemoveRow(); + }); + this.addHook('afterLoadData', function (firstRun) { + return _this2.onAfterLoadData(firstRun); }); - this.addHook('afterRemoveCol', function () { - var _endpoints4; - for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } + _get(BindRowsWithHeaders.prototype.__proto__ || Object.getPrototypeOf(BindRowsWithHeaders.prototype), 'enablePlugin', this).call(this); + } - return (_endpoints4 = _this2.endpoints).resetSetupAfterStructureAlteration.apply(_endpoints4, ['remove_col'].concat(args)); - }); - this.addHook('afterRowMove', function () { - return _this2.onAfterRowMove.apply(_this2, arguments); - }); + /** + * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. + */ - _get(ColumnSummary.prototype.__proto__ || Object.getPrototypeOf(ColumnSummary.prototype), 'enablePlugin', this).call(this); + }, { + key: 'updatePlugin', + value: function updatePlugin() { + _get(BindRowsWithHeaders.prototype.__proto__ || Object.getPrototypeOf(BindRowsWithHeaders.prototype), 'updatePlugin', this).call(this); } /** @@ -93257,358 +91750,465 @@ var ColumnSummary = function (_BasePlugin) { }, { key: 'disablePlugin', value: function disablePlugin() { - this.endpoints = null; - this.settings = null; - this.currentEndpoint = null; + this.removedRows.length = 0; + this.bindStrategy.clearMap(); + _get(BindRowsWithHeaders.prototype.__proto__ || Object.getPrototypeOf(BindRowsWithHeaders.prototype), 'disablePlugin', this).call(this); } /** - * Calculates math for a single endpoint. + * On modify row header listener. * * @private - * @param {Object} endpoint Contains information about the endpoint. + * @param {Number} row Row index. + * @returns {Number} + * + * @fires Hooks#modifyRow */ }, { - key: 'calculate', - value: function calculate(endpoint) { - switch (endpoint.type.toLowerCase()) { - case 'sum': - endpoint.result = this.calculateSum(endpoint); - break; - case 'min': - endpoint.result = this.calculateMinMax(endpoint, endpoint.type); - break; - case 'max': - endpoint.result = this.calculateMinMax(endpoint, endpoint.type); - break; - case 'count': - endpoint.result = this.countEntries(endpoint); - break; - case 'average': - endpoint.result = this.calculateAverage(endpoint); - break; - case 'custom': - endpoint.result = endpoint.customFunction.call(this, endpoint); - break; - default: - break; - } + key: 'onModifyRowHeader', + value: function onModifyRowHeader(row) { + return this.bindStrategy.translate(this.hot.runHooks('modifyRow', row)); } /** - * Calculates sum of the values contained in ranges provided in the plugin config. + * On after create row listener. * * @private - * @param {Object} endpoint Contains the endpoint information. - * @returns {Number} Sum for the selected range + * @param {Number} index Row index. + * @param {Number} amount Defines how many rows removed. */ }, { - key: 'calculateSum', - value: function calculateSum(endpoint) { + key: 'onAfterCreateRow', + value: function onAfterCreateRow(index, amount) { + this.bindStrategy.createRow(index, amount); + } + + /** + * On before remove row listener. + * + * @private + * @param {Number} index Row index. + * @param {Number} amount Defines how many rows removed. + * + * @fires Hooks#modifyRow + */ + + }, { + key: 'onBeforeRemoveRow', + value: function onBeforeRemoveRow(index, amount) { var _this3 = this; - var sum = 0; + this.removedRows.length = 0; - (0, _object.objectEach)(endpoint.ranges, function (range) { - sum += _this3.getPartialSum(range, endpoint.sourceColumn); - }); + if (index !== false) { + // Collect physical row index. + (0, _number.rangeEach)(index, index + amount - 1, function (removedIndex) { + _this3.removedRows.push(_this3.hot.runHooks('modifyRow', removedIndex)); + }); + } + } - return sum; + /** + * On after remove row listener. + * + * @private + */ + + }, { + key: 'onAfterRemoveRow', + value: function onAfterRemoveRow() { + this.bindStrategy.removeRow(this.removedRows); } /** - * Returns partial sum of values from a single row range + * On after load data listener. * * @private - * @param {Array} rowRange Range for the sum. - * @param {Number} col Column index. - * @returns {Number} The partial sum. + * @param {Boolean} firstRun Indicates if hook was fired while Handsontable initialization. */ }, { - key: 'getPartialSum', - value: function getPartialSum(rowRange, col) { - var sum = 0; - var i = rowRange[1] || rowRange[0]; - var cellValue = null; - var biggestDecimalPlacesCount = 0; + key: 'onAfterLoadData', + value: function onAfterLoadData(firstRun) { + if (!firstRun) { + this.bindStrategy.createMap(this.hot.countSourceRows()); + } + } - do { - cellValue = this.getCellValue(i, col) || 0; - var decimalPlaces = (('' + cellValue).split('.')[1] || []).length || 1; - if (decimalPlaces > biggestDecimalPlacesCount) { - biggestDecimalPlacesCount = decimalPlaces; - } + /** + * Destroys the plugin instance. + */ - sum += cellValue || 0; - i -= 1; - } while (i >= rowRange[0]); + }, { + key: 'destroy', + value: function destroy() { + this.bindStrategy.destroy(); + _get(BindRowsWithHeaders.prototype.__proto__ || Object.getPrototypeOf(BindRowsWithHeaders.prototype), 'destroy', this).call(this); + } + }]); - // Workaround for e.g. 802.2 + 1.1 = 803.3000000000001 - return Math.round(sum * Math.pow(10, biggestDecimalPlacesCount)) / Math.pow(10, biggestDecimalPlacesCount); + return BindRowsWithHeaders; +}(_base2.default); + +(0, _plugins.registerPlugin)('bindRowsWithHeaders', BindRowsWithHeaders); + +exports.default = BindRowsWithHeaders; + +/***/ }), +/* 648 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _number = __webpack_require__(4); + +var _string = __webpack_require__(32); + +var _bindStrategies = __webpack_require__(649); + +var strategies = _interopRequireWildcard(_bindStrategies); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * @class BindStrategy + * @plugin BindRowsWithHeaders + * @pro + */ +var BindStrategy = function () { + _createClass(BindStrategy, null, [{ + key: 'DEFAULT_STRATEGY', + + /** + * Loose bind mode. + * + * @returns {String} + */ + get: function get() { + return 'loose'; + } + }]); + + function BindStrategy() { + _classCallCheck(this, BindStrategy); + + this.strategy = null; + } + + /** + * Set strategy behaviors for binding rows with headers. + * + * @param name + */ + + + _createClass(BindStrategy, [{ + key: 'setStrategy', + value: function setStrategy(name) { + var Strategy = strategies[(0, _string.toUpperCaseFirst)(name)]; + + if (!Strategy) { + throw new Error('Bind strategy "' + name + '" does not exist.'); + } + this.strategy = new Strategy(); } /** - * Calculates the minimal value for the selected ranges + * Reset current map array and create a new one. * - * @private - * @param {Object} endpoint Contains the endpoint information. - * @param {String} type `'min'` or `'max'`. - * @returns {Number} Min or Max value. + * @param {Number} [length] Custom generated map length. */ }, { - key: 'calculateMinMax', - value: function calculateMinMax(endpoint, type) { - var _this4 = this; + key: 'createMap', + value: function createMap(length) { + var strategy = this.strategy; + var originLength = length === void 0 ? strategy._arrayMap.length : length; - var result = null; + strategy._arrayMap.length = 0; - (0, _object.objectEach)(endpoint.ranges, function (range) { - var partialResult = _this4.getPartialMinMax(range, endpoint.sourceColumn, type); + (0, _number.rangeEach)(originLength - 1, function (itemIndex) { + strategy._arrayMap.push(itemIndex); + }); + } - if (result === null && partialResult !== null) { - result = partialResult; - } + /** + * Alias for createRow of strategy class. + * + * @param {*} params + */ - if (partialResult !== null) { - switch (type) { - case 'min': - result = Math.min(result, partialResult); - break; - case 'max': - result = Math.max(result, partialResult); - break; - default: - break; - } - } - }); + }, { + key: 'createRow', + value: function createRow() { + var _strategy; + + (_strategy = this.strategy).createRow.apply(_strategy, arguments); + } + + /** + * Alias for removeRow of strategy class. + * + * @param {*} params + */ - return result === null ? 'Not enough data' : result; + }, { + key: 'removeRow', + value: function removeRow() { + var _strategy2; + + (_strategy2 = this.strategy).removeRow.apply(_strategy2, arguments); } /** - * Returns a local minimum of the provided sub-range + * Alias for getValueByIndex of strategy class. * - * @private - * @param {Array} rowRange Range for the calculation. - * @param {Number} col Column index. - * @param {String} type `'min'` or `'max'` - * @returns {Number} Min or max value. + * @param {*} params */ }, { - key: 'getPartialMinMax', - value: function getPartialMinMax(rowRange, col, type) { - var result = null; - var i = rowRange[1] || rowRange[0]; - var cellValue = void 0; - - do { - cellValue = this.getCellValue(i, col) || null; + key: 'translate', + value: function translate() { + var _strategy3; - if (result === null) { - result = cellValue; - } else if (cellValue !== null) { - switch (type) { - case 'min': - result = Math.min(result, cellValue); - break; - case 'max': - result = Math.max(result, cellValue); - break; - default: - break; - } - } + return (_strategy3 = this.strategy).getValueByIndex.apply(_strategy3, arguments); + } - i -= 1; - } while (i >= rowRange[0]); + /** + * Clear array map. + */ - return result; + }, { + key: 'clearMap', + value: function clearMap() { + this.strategy.clearMap(); } /** - * Counts empty cells in the provided row range. - * - * @private - * @param {Array} rowRange Row range for the calculation. - * @param {Number} col Column index. - * @returns {Number} Empty cells count. + * Destroy class. */ }, { - key: 'countEmpty', - value: function countEmpty(rowRange, col) { - var cellValue = void 0; - var counter = 0; - var i = rowRange[1] || rowRange[0]; + key: 'destroy', + value: function destroy() { + if (this.strategy) { + this.strategy.destroy(); + } + this.strategy = null; + } + }]); - do { - cellValue = this.getCellValue(i, col); + return BindStrategy; +}(); - if (!cellValue) { - counter += 1; - } +exports.default = BindStrategy; - i -= 1; - } while (i >= rowRange[0]); +/***/ }), +/* 649 */ +/***/ (function(module, exports, __webpack_require__) { - return counter; - } +"use strict"; - /** - * Counts non-empty cells in the provided row range. - * - * @private - * @param {Object} endpoint Contains the endpoint information. - * @returns {Number} Entry count. - */ - }, { - key: 'countEntries', - value: function countEntries(endpoint) { - var _this5 = this; +exports.__esModule = true; +exports.Strict = exports.Loose = undefined; - var result = 0; - var ranges = endpoint.ranges; +var _loose = __webpack_require__(650); - (0, _object.objectEach)(ranges, function (range) { - var partial = range[1] === void 0 ? 1 : range[1] - range[0] + 1; - var emptyCount = _this5.countEmpty(range, endpoint.sourceColumn); +var _loose2 = _interopRequireDefault(_loose); - result += partial; - result -= emptyCount; - }); +var _strict = __webpack_require__(651); - return result; +var _strict2 = _interopRequireDefault(_strict); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.Loose = _loose2.default; +exports.Strict = _strict2.default; + +/***/ }), +/* 650 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _arrayMapper = __webpack_require__(56); + +var _arrayMapper2 = _interopRequireDefault(_arrayMapper); + +var _object = __webpack_require__(1); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * @private + * @class LooseBindStrategy + */ +var LooseBindStrategy = function () { + function LooseBindStrategy() { + _classCallCheck(this, LooseBindStrategy); + } + + _createClass(LooseBindStrategy, [{ + key: 'createRow', + + + /** + * Strategy for the create row action. + * + * @param {Number} index Row index. + * @param {Number} amount + */ + value: function createRow(index, amount) { + this.shiftItems(index, amount); } /** - * Calculates the average value from the cells in the range. + * Strategy for the remove row action. * - * @private - * @param {Object} endpoint Contains the endpoint information. - * @returns {Number} Avarage value. + * @param {Number|Array} index Row index or Array of row indexes. + * @param {Number} amount */ }, { - key: 'calculateAverage', - value: function calculateAverage(endpoint) { - var sum = this.calculateSum(endpoint); - var entriesCount = this.countEntries(endpoint); + key: 'removeRow', + value: function removeRow(index, amount) { + this.unshiftItems(index, amount); + } - return sum / entriesCount; + /** + * Destroy strategy class. + */ + + }, { + key: 'destroy', + value: function destroy() { + this._arrayMap = null; } + }], [{ + key: 'STRATEGY_NAME', /** - * Returns a cell value, taking into consideration a basic validation. + * Loose bind mode. * - * @private - * @param {Number} row Row index. - * @param {Number} col Column index. - * @returns {String} The cell value. + * @returns {String} */ + get: function get() { + return 'loose'; + } + }]); - }, { - key: 'getCellValue', - value: function getCellValue(row, col) { - var visualRowIndex = this.endpoints.getVisualRowIndex(row); - var visualColumnIndex = this.endpoints.getVisualColumnIndex(col); + return LooseBindStrategy; +}(); - var cellValue = this.hot.getSourceDataAtCell(row, col); - var cellClassName = this.hot.getCellMeta(visualRowIndex, visualColumnIndex).className || ''; +(0, _object.mixin)(LooseBindStrategy, _arrayMapper2.default); - if (cellClassName.indexOf('columnSummaryResult') > -1) { - return null; - } +exports.default = LooseBindStrategy; - if (this.endpoints.currentEndpoint.forceNumeric) { - if (typeof cellValue === 'string') { - cellValue = cellValue.replace(/,/, '.'); - } +/***/ }), +/* 651 */ +/***/ (function(module, exports, __webpack_require__) { - cellValue = parseFloat(cellValue); - } +"use strict"; - if (isNaN(cellValue)) { - if (!this.endpoints.currentEndpoint.suppressDataTypeErrors) { - throw new Error('ColumnSummary plugin: cell at (' + row + ', ' + col + ') is not in a numeric format. Cannot do the calculation.'); - } - } - return cellValue; - } +exports.__esModule = true; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _arrayMapper = __webpack_require__(56); + +var _arrayMapper2 = _interopRequireDefault(_arrayMapper); + +var _object = __webpack_require__(1); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * @private + * @class StrictBindStrategy + */ +var StrictBindStrategy = function () { + function StrictBindStrategy() { + _classCallCheck(this, StrictBindStrategy); + } + + _createClass(StrictBindStrategy, [{ + key: 'createRow', + /** - * `afterInit` hook callback. + * Strategy for the create row action. * - * @private + * @param {Number} index Row index. + * @param {Number} amount */ - - }, { - key: 'onAfterInit', - value: function onAfterInit() { - this.endpoints.endpoints = this.endpoints.parseSettings(); - this.endpoints.refreshAllEndpoints(true); + value: function createRow(index, amount) { + this.insertItems(index, amount); } /** - * `afterChange` hook callback. + * Strategy for the remove row action. * - * @private - * @param {Array} changes - * @param {String} source + * @param {Number|Array} index Row index or Array of row indexes. + * @param {Number} amount */ }, { - key: 'onAfterChange', - value: function onAfterChange(changes, source) { - if (changes && source !== 'ColumnSummary.reset' && source !== 'ColumnSummary.set' && source !== 'loadData') { - this.endpoints.refreshChangedEndpoints(changes); - } + key: 'removeRow', + value: function removeRow(index, amount) { + this.removeItems(index, amount); } /** - * `beforeRowMove` hook callback. - * - * @private - * @param {Array} rows Array of logical rows to be moved. + * Destroy strategy class. */ }, { - key: 'onBeforeRowMove', - value: function onBeforeRowMove(rows) { - this.endpoints.resetSetupBeforeStructureAlteration('move_row', rows[0], rows.length, rows, this.pluginName); + key: 'destroy', + value: function destroy() { + this._arrayMap = null; } + }], [{ + key: 'STRATEGY_NAME', /** - * `afterRowMove` hook callback. + * Loose bind mode. * - * @private - * @param {Array} rows Array of logical rows that were moved. - * @param {Number} target Index of the destination row. + * @returns {String} */ - - }, { - key: 'onAfterRowMove', - value: function onAfterRowMove(rows, target) { - this.endpoints.resetSetupAfterStructureAlteration('move_row', target, rows.length, rows, this.pluginName); + get: function get() { + return 'strict'; } }]); - return ColumnSummary; -}(_base2.default); + return StrictBindStrategy; +}(); -(0, _plugins.registerPlugin)('columnSummary', ColumnSummary); +(0, _object.mixin)(StrictBindStrategy, _arrayMapper2.default); -exports.default = ColumnSummary; +exports.default = StrictBindStrategy; /***/ }), -/* 653 */ +/* 652 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -93616,671 +92216,658 @@ exports.default = ColumnSummary; exports.__esModule = true; -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _object = __webpack_require__(1); + var _array = __webpack_require__(0); -var _console = __webpack_require__(20); +var _number = __webpack_require__(4); -var _recordTranslator = __webpack_require__(55); +var _console = __webpack_require__(22); + +var _element = __webpack_require__(2); + +var _eventManager = __webpack_require__(8); + +var _eventManager2 = _interopRequireDefault(_eventManager); + +var _plugins = __webpack_require__(5); + +var _event = __webpack_require__(12); + +var _base = __webpack_require__(7); + +var _base2 = _interopRequireDefault(_base); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + /** - * Class used to make all endpoint-related operations. - * - * @class Endpoints - * @plugin ColumnSummary + * @plugin CollapsibleColumns * @pro + * @dependencies NestedHeaders HiddenColumns + * + * @description + * The {@link CollapsibleColumns} plugin allows collapsing of columns, covered by a header with the `colspan` property defined. + * + * Clicking the "collapse/expand" button collapses (or expands) all "child" headers except the first one. + * + * Setting the {@link Options#collapsibleColumns} property to `true` will display a "collapse/expand" button in every header + * with a defined `colspan` property. + * + * To limit this functionality to a smaller group of headers, define the `collapsibleColumns` property as an array + * of objects, as in the example below. + * + * @example + * ```js + * const container = document.getElementById('example'); + * const hot = new Handsontable(container, { + * data: generateDataObj(), + * colHeaders: true, + * rowHeaders: true, + * // enable plugin + * collapsibleColumns: true, + * }); + * + * // or + * const hot = new Handsontable(container, { + * data: generateDataObj(), + * colHeaders: true, + * rowHeaders: true, + * // enable and configure which columns can be collapsed + * collapsibleColumns: [ + * {row: -4, col: 1, collapsible: true}, + * {row: -3, col: 5, collapsible: true} + * ], + * }); + * ``` */ -var Endpoints = function () { - function Endpoints(plugin, settings) { - _classCallCheck(this, Endpoints); +var CollapsibleColumns = function (_BasePlugin) { + _inherits(CollapsibleColumns, _BasePlugin); + + function CollapsibleColumns(hotInstance) { + _classCallCheck(this, CollapsibleColumns); /** - * The main plugin instance. - */ - this.plugin = plugin; - /** - * Handsontable instance. + * Cached plugin settings. * - * @type {Object} + * @private + * @type {Boolean|Array} */ - this.hot = this.plugin.hot; + var _this = _possibleConstructorReturn(this, (CollapsibleColumns.__proto__ || Object.getPrototypeOf(CollapsibleColumns)).call(this, hotInstance)); + + _this.settings = null; /** - * Array of declared plugin endpoints (calculation destination points). + * Object listing headers with buttons enabled. * - * @type {Array} - * @default {Array} Empty array. + * @private + * @type {Object} */ - this.endpoints = []; + _this.buttonEnabledList = {}; /** - * The plugin settings, taken from Handsontable configuration. + * Cached reference to the HiddenColumns plugin. * - * @type {Object|Function} - * @default null + * @private + * @type {Object} */ - this.settings = settings; + _this.hiddenColumnsPlugin = null; /** - * Settings type. Can be either 'array' or 'function. + * Cached reference to the NestedHeaders plugin. * - * @type {string} - * @default {'array'} + * @private + * @type {Object} */ - this.settingsType = 'array'; + _this.nestedHeadersPlugin = null; /** - * The current endpoint (calculation destination point) in question. + * Object listing the currently collapsed sections. * + * @private * @type {Object} - * @default null */ - this.currentEndpoint = null; + _this.collapsedSections = {}; /** - * Array containing a list of changes to be applied. + * Number of column header levels. * * @private - * @type {Array} - * @default {[]} + * @type {Number} */ - this.cellsToSetCache = []; + _this.columnHeaderLevelCount = null; /** - * A `recordTranslator` instance. + * Event manager instance reference. + * * @private - * @type {Object} + * @type {EventManager} */ - this.recordTranslator = (0, _recordTranslator.getTranslator)(this.hot); + _this.eventManager = null; + return _this; } /** - * Get a single endpoint object. + * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit} + * hook and if it returns `true` than the {@link CollapsibleColumns#enablePlugin} method is called. * - * @param {Number} index Index of the endpoint. - * @returns {Object} + * @returns {Boolean} */ - _createClass(Endpoints, [{ - key: 'getEndpoint', - value: function getEndpoint(index) { - if (this.settingsType === 'function') { - return this.fillMissingEndpointData(this.settings)[index]; - } - - return this.endpoints[index]; - } - - /** - * Get an array with all the endpoints. - * - * @returns {Array} - */ - - }, { - key: 'getAllEndpoints', - value: function getAllEndpoints() { - if (this.settingsType === 'function') { - return this.fillMissingEndpointData(this.settings); - } - - return this.endpoints; - } - - /** - * Used to fill the blanks in the endpoint data provided by a settings function. - * - * @private - * @param {Function} func Function provided in the HOT settings. - * @returns {Array} An array of endpoints. - */ - - }, { - key: 'fillMissingEndpointData', - value: function fillMissingEndpointData(func) { - return this.parseSettings(func.call(this)); + _createClass(CollapsibleColumns, [{ + key: 'isEnabled', + value: function isEnabled() { + return !!this.hot.getSettings().collapsibleColumns; } /** - * Parse plugin's settings. - * - * @param {Array} settings The settings array. + * Enables the plugin functionality for this Handsontable instance. */ - }, { - key: 'parseSettings', - value: function parseSettings(settings) { - var _this = this; - - var endpointsArray = []; - var settingsArray = settings; - - if (!settingsArray && typeof this.settings === 'function') { - this.settingsType = 'function'; - + }, { + key: 'enablePlugin', + value: function enablePlugin() { + var _this2 = this; + + if (this.enabled) { return; } - if (!settingsArray) { - settingsArray = this.settings; + this.settings = this.hot.getSettings().collapsibleColumns; + + if (typeof this.settings !== 'boolean') { + this.parseSettings(); } - (0, _array.arrayEach)(settingsArray, function (val) { - var newEndpoint = {}; + this.hiddenColumnsPlugin = this.hot.getPlugin('hiddenColumns'); + this.nestedHeadersPlugin = this.hot.getPlugin('nestedHeaders'); - _this.assignSetting(val, newEndpoint, 'ranges', [[0, _this.hot.countRows() - 1]]); - _this.assignSetting(val, newEndpoint, 'reversedRowCoords', false); - _this.assignSetting(val, newEndpoint, 'destinationRow', new Error('\n You must provide a destination row for the Column Summary plugin in order to work properly!\n ')); - _this.assignSetting(val, newEndpoint, 'destinationColumn', new Error('\n You must provide a destination column for the Column Summary plugin in order to work properly!\n ')); - _this.assignSetting(val, newEndpoint, 'sourceColumn', val.destinationColumn); - _this.assignSetting(val, newEndpoint, 'type', 'sum'); - _this.assignSetting(val, newEndpoint, 'forceNumeric', false); - _this.assignSetting(val, newEndpoint, 'suppressDataTypeErrors', true); - _this.assignSetting(val, newEndpoint, 'suppressDataTypeErrors', true); - _this.assignSetting(val, newEndpoint, 'customFunction', null); - _this.assignSetting(val, newEndpoint, 'readOnly', true); - _this.assignSetting(val, newEndpoint, 'roundFloat', false); + this.checkDependencies(); - endpointsArray.push(newEndpoint); + this.addHook('afterRender', function () { + return _this2.onAfterRender(); + }); + this.addHook('afterInit', function () { + return _this2.onAfterInit(); + }); + this.addHook('afterGetColHeader', function (col, TH) { + return _this2.onAfterGetColHeader(col, TH); + }); + this.addHook('beforeOnCellMouseDown', function (event, coords, TD) { + return _this2.onBeforeOnCellMouseDown(event, coords, TD); }); - return endpointsArray; + this.eventManager = new _eventManager2.default(this.hot); + + _get(CollapsibleColumns.prototype.__proto__ || Object.getPrototypeOf(CollapsibleColumns.prototype), 'enablePlugin', this).call(this); } /** - * Setter for the internal setting objects. - * - * @param {Object} settings Object with the settings. - * @param {Object} endpoint Contains information about the endpoint for the the calculation. - * @param {String} name Settings name. - * @param defaultValue Default value for the settings. + * Disables the plugin functionality for this Handsontable instance. */ }, { - key: 'assignSetting', - value: function assignSetting(settings, endpoint, name, defaultValue) { - if (name === 'ranges' && settings[name] === void 0) { - endpoint[name] = defaultValue; - return; - } else if (name === 'ranges' && settings[name].length === 0) { - return; - } + key: 'disablePlugin', + value: function disablePlugin() { + this.settings = null; + this.buttonEnabledList = {}; + this.hiddenColumnsPlugin = null; + this.collapsedSections = {}; - if (settings[name] === void 0) { - if (defaultValue instanceof Error) { - throw defaultValue; - } + this.clearButtons(); - endpoint[name] = defaultValue; - } else { - /* eslint-disable no-lonely-if */ - if (name === 'destinationRow' && endpoint.reversedRowCoords) { - endpoint[name] = this.hot.countRows() - settings[name] - 1; - } else { - endpoint[name] = settings[name]; - } - } + _get(CollapsibleColumns.prototype.__proto__ || Object.getPrototypeOf(CollapsibleColumns.prototype), 'disablePlugin', this).call(this); } /** - * Resets the endpoint setup before the structure alteration (like inserting or removing rows/columns). Used for settings provided as a function. + * Clears the expand/collapse buttons. * * @private - * @param {String} action Type of the action performed. - * @param {Number} index Row/column index. - * @param {Number} number Number of rows/columns added/removed. */ }, { - key: 'resetSetupBeforeStructureAlteration', - value: function resetSetupBeforeStructureAlteration(action, index, number) { - if (this.settingsType !== 'function') { + key: 'clearButtons', + value: function clearButtons() { + if (!this.hot.view) { return; } - var type = action.indexOf('row') > -1 ? 'row' : 'col'; - var endpoints = this.getAllEndpoints(); + var headerLevels = this.hot.view.wt.getSetting('columnHeaders').length; + var mainHeaders = this.hot.view.wt.wtTable.THEAD; + var topHeaders = this.hot.view.wt.wtOverlays.topOverlay.clone.wtTable.THEAD; + var topLeftCornerHeaders = this.hot.view.wt.wtOverlays.topLeftCornerOverlay ? this.hot.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.THEAD : null; - (0, _array.arrayEach)(endpoints, function (val) { - if (type === 'row' && val.destinationRow >= index) { - if (action === 'insert_row') { - val.alterRowOffset = number; - } else if (action === 'remove_row') { - val.alterRowOffset = -1 * number; - } + var removeButton = function removeButton(button) { + if (button) { + button.parentNode.removeChild(button); } + }; - if (type === 'col' && val.destinationColumn >= index) { - if (action === 'insert_col') { - val.alterColumnOffset = number; - } else if (action === 'remove_col') { - val.alterColumnOffset = -1 * number; + (0, _number.rangeEach)(0, headerLevels - 1, function (i) { + var masterLevel = mainHeaders.childNodes[i]; + var topLevel = topHeaders.childNodes[i]; + var topLeftCornerLevel = topLeftCornerHeaders ? topLeftCornerHeaders.childNodes[i] : null; + + (0, _number.rangeEach)(0, masterLevel.childNodes.length - 1, function (j) { + var button = masterLevel.childNodes[j].querySelector('.collapsibleIndicator'); + + removeButton(button); + + if (topLevel && topLevel.childNodes[j]) { + button = topLevel.childNodes[j].querySelector('.collapsibleIndicator'); + + removeButton(button); } - } - }); - this.resetAllEndpoints(endpoints, false); + if (topLeftCornerHeaders && topLeftCornerLevel && topLeftCornerLevel.childNodes[j]) { + button = topLeftCornerLevel.childNodes[j].querySelector('.collapsibleIndicator'); + + removeButton(button); + } + }); + }, true); } /** - * afterCreateRow/afterCreateRow/afterRemoveRow/afterRemoveCol hook callback. Reset and reenables the summary functionality - * after changing the table structure. + * Parses the plugin settings and create a button configuration array. * * @private - * @param {String} action Type of the action performed. - * @param {Number} index Row/column index. - * @param {Number} number Number of rows/columns added/removed. - * @param {Array} [logicRows] Array of the logical indexes. - * @param {String} [source] Source of change. - * @param {Boolean} [forceRefresh] `true` of the endpoints should refresh after completing the function. */ }, { - key: 'resetSetupAfterStructureAlteration', - value: function resetSetupAfterStructureAlteration(action, index, number, logicRows, source) { - var _this2 = this; - - var forceRefresh = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true; - - if (this.settingsType === 'function') { - - // We need to run it on a next avaiable hook, because the TrimRows' `afterCreateRow` hook triggers after this one, - // and it needs to be run to properly calculate the endpoint value. - var beforeRenderCallback = function beforeRenderCallback() { - _this2.hot.removeHook('beforeRender', beforeRenderCallback); - return _this2.refreshAllEndpoints(); - }; - this.hot.addHookOnce('beforeRender', beforeRenderCallback); - return; - } + key: 'parseSettings', + value: function parseSettings() { + var _this3 = this; - var type = action.indexOf('row') > -1 ? 'row' : 'col'; - var multiplier = action.indexOf('remove') > -1 ? -1 : 1; - var endpoints = this.getAllEndpoints(); - var rowMoving = action.indexOf('move_row') === 0; - var placeOfAlteration = index; + (0, _object.objectEach)(this.settings, function (val) { - (0, _array.arrayEach)(endpoints, function (val) { - if (type === 'row' && val.destinationRow >= placeOfAlteration) { - val.alterRowOffset = multiplier * number; + if (!_this3.buttonEnabledList[val.row]) { + _this3.buttonEnabledList[val.row] = {}; } - if (type === 'col' && val.destinationColumn >= placeOfAlteration) { - val.alterColumnOffset = multiplier * number; - } + _this3.buttonEnabledList[val.row][val.col] = val.collapsible; }); + } - this.resetAllEndpoints(endpoints, !rowMoving); + /** + * Checks if plugin dependencies are met. + * + * @private + * @returns {Boolean} + */ - if (rowMoving) { - (0, _array.arrayEach)(endpoints, function (endpoint) { - _this2.extendEndpointRanges(endpoint, placeOfAlteration, logicRows[0], logicRows.length); - _this2.recreatePhysicalRanges(endpoint); - _this2.clearOffsetInformation(endpoint); - }); - } else { - (0, _array.arrayEach)(endpoints, function (endpoint) { - _this2.shiftEndpointCoordinates(endpoint, placeOfAlteration); - }); - } + }, { + key: 'meetsDependencies', + value: function meetsDependencies() { + var settings = this.hot.getSettings(); - if (forceRefresh) { - this.refreshAllEndpoints(); - } + return settings.nestedHeaders && settings.hiddenColumns; } /** - * Clear the offset information from the endpoint object. + * Checks if all the required dependencies are enabled. * * @private - * @param {Object} endpoint And endpoint object. */ }, { - key: 'clearOffsetInformation', - value: function clearOffsetInformation(endpoint) { - endpoint.alterRowOffset = void 0; - endpoint.alterColumnOffset = void 0; + key: 'checkDependencies', + value: function checkDependencies() { + var settings = this.hot.getSettings(); + + if (this.meetsDependencies()) { + return; + } + + if (!settings.nestedHeaders) { + (0, _console.warn)('You need to configure the Nested Headers plugin in order to use collapsible headers.'); + } + + if (!settings.hiddenColumns) { + (0, _console.warn)('You need to configure the Hidden Columns plugin in order to use collapsible headers.'); + } } /** - * Extend the row ranges for the provided endpoint. + * Generates the indicator element. * * @private - * @param {Object} endpoint The endpoint object. - * @param {Number} placeOfAlteration Index of the row where the alteration takes place. - * @param {Number} previousPosition Previous endpoint result position. - * @param {Number} offset Offset generated by the alteration. + * @param {Number} column Column index. + * @param {HTMLElement} TH TH Element. + * @returns {HTMLElement} */ }, { - key: 'extendEndpointRanges', - value: function extendEndpointRanges(endpoint, placeOfAlteration, previousPosition, offset) { - (0, _array.arrayEach)(endpoint.ranges, function (range) { - // is a range, not a single row - if (range[1]) { + key: 'generateIndicator', + value: function generateIndicator(column, TH) { + var TR = TH.parentNode; + var THEAD = TR.parentNode; + var row = -1 * THEAD.childNodes.length + Array.prototype.indexOf.call(THEAD.childNodes, TR); - if (placeOfAlteration >= range[0] && placeOfAlteration <= range[1]) { - if (previousPosition > range[1]) { - range[1] += offset; - } else if (previousPosition < range[0]) { - range[0] -= offset; - } - } else if (previousPosition >= range[0] && previousPosition <= range[1]) { - range[1] -= offset; + if (Object.keys(this.buttonEnabledList).length > 0 && (!this.buttonEnabledList[row] || !this.buttonEnabledList[row][column])) { + return null; + } - if (placeOfAlteration <= range[0]) { - range[0] += 1; - range[1] += 1; - } - } - } - }); + var divEl = document.createElement('DIV'); + + (0, _element.addClass)(divEl, 'collapsibleIndicator'); + + if (this.collapsedSections[row] && this.collapsedSections[row][column] === true) { + (0, _element.addClass)(divEl, 'collapsed'); + (0, _element.fastInnerText)(divEl, '+'); + } else { + (0, _element.addClass)(divEl, 'expanded'); + (0, _element.fastInnerText)(divEl, '-'); + } + + return divEl; } /** - * Recreate the physical ranges for the provided endpoint. Used (for example) when a row gets moved and extends an existing range. + * Marks (internally) a section as 'collapsed' or 'expanded' (optionally, also mark the 'child' headers). * * @private - * @param {Object} endpoint An endpoint object. + * @param {String} state State ('collapsed' or 'expanded'). + * @param {Number} row Row index. + * @param {Number} column Column index. + * @param {Boolean} recursive If `true`, it will also attempt to mark the child sections. */ }, { - key: 'recreatePhysicalRanges', - value: function recreatePhysicalRanges(endpoint) { - var _this3 = this; + key: 'markSectionAs', + value: function markSectionAs(state, row, column, recursive) { + if (!this.collapsedSections[row]) { + this.collapsedSections[row] = {}; + } - var ranges = endpoint.ranges; - var newRanges = []; - var allIndexes = []; + switch (state) { + case 'collapsed': + this.collapsedSections[row][column] = true; - (0, _array.arrayEach)(ranges, function (range) { - var newRange = []; - if (range[1]) { - for (var i = range[0]; i <= range[1]; i++) { - newRange.push(_this3.recordTranslator.toPhysicalRow(i)); - } - } else { - newRange.push(_this3.recordTranslator.toPhysicalRow(range[0])); - } + break; + case 'expanded': + this.collapsedSections[row][column] = void 0; - allIndexes.push(newRange); - }); + break; + default: + break; + } - (0, _array.arrayEach)(allIndexes, function (range) { - var newRange = []; - (0, _array.arrayEach)(range, function (coord, index) { - if (index === 0) { - newRange.push(coord); - } else if (range[index] !== range[index - 1] + 1) { - newRange.push(range[index - 1]); - newRanges.push(newRange); - newRange = []; - newRange.push(coord); - } + if (recursive) { + var nestedHeadersColspans = this.nestedHeadersPlugin.colspanArray; + var level = this.nestedHeadersPlugin.rowCoordsToLevel(row); + var childHeaders = this.nestedHeadersPlugin.getChildHeaders(row, column); + var childColspanLevel = nestedHeadersColspans[level + 1]; - if (index === range.length - 1) { - newRange.push(coord); - newRanges.push(newRange); + for (var i = 1; i < childHeaders.length; i++) { + if (childColspanLevel && childColspanLevel[childHeaders[i]].colspan > 1) { + this.markSectionAs(state, row + 1, childHeaders[i], true); } - }); - }); - - endpoint.ranges = newRanges; + } + } } /** - * Shifts the endpoint coordinates by the defined offset. + * Expands section at the provided coords. * - * @private - * @param {Object} endpoint Endpoint object. - * @param {Number} offsetStartIndex Index of the performed change (if the change is located after the endpoint, nothing about the endpoint has to be changed. + * @param {Object} coords Contains coordinates information. (`coords.row`, `coords.col`) */ }, { - key: 'shiftEndpointCoordinates', - value: function shiftEndpointCoordinates(endpoint, offsetStartIndex) { - if (endpoint.alterRowOffset && endpoint.alterRowOffset !== 0) { - endpoint.destinationRow += endpoint.alterRowOffset || 0; + key: 'expandSection', + value: function expandSection(coords) { + this.markSectionAs('expanded', coords.row, coords.col, true); + this.toggleCollapsibleSection(coords, 'expand'); + } - (0, _array.arrayEach)(endpoint.ranges, function (element) { - (0, _array.arrayEach)(element, function (subElement, j) { - if (subElement >= offsetStartIndex) { - element[j] += endpoint.alterRowOffset || 0; - } - }); - }); - } else if (endpoint.alterColumnOffset && endpoint.alterColumnOffset !== 0) { - endpoint.destinationColumn += endpoint.alterColumnOffset || 0; - endpoint.sourceColumn += endpoint.alterColumnOffset || 0; - } + /** + * Collapses section at the provided coords. + * + * @param {Object} coords Contains coordinates information. (`coords.row`, `coords.col`) + */ + + }, { + key: 'collapseSection', + value: function collapseSection(coords) { + this.markSectionAs('collapsed', coords.row, coords.col, true); + this.toggleCollapsibleSection(coords, 'collapse'); } /** - * Resets (removes) the endpoints from the table. + * Collapses or expand all collapsible sections, depending on the action parameter. * - * @param {Array} endpoints Array containing the endpoints. - * @param {Boolean} [useOffset=true] Use the cell offset value. + * @param {String} action 'collapse' or 'expand'. */ }, { - key: 'resetAllEndpoints', - value: function resetAllEndpoints(endpoints) { + key: 'toggleAllCollapsibleSections', + value: function toggleAllCollapsibleSections(action) { var _this4 = this; - var useOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - var endpointsArray = endpoints; - this.cellsToSetCache = []; + var nestedHeadersColspanArray = this.nestedHeadersPlugin.colspanArray; - if (!endpointsArray) { - endpointsArray = this.getAllEndpoints(); - } + if (this.settings === true) { - (0, _array.arrayEach)(endpointsArray, function (value) { - _this4.resetEndpointValue(value, useOffset); - }); + (0, _array.arrayEach)(nestedHeadersColspanArray, function (headerLevel, i) { + (0, _array.arrayEach)(headerLevel, function (header, j) { + if (header.colspan > 1) { + var row = _this4.nestedHeadersPlugin.levelToRowCoords(parseInt(i, 10)); + var col = parseInt(j, 10); - this.hot.setDataAtCell(this.cellsToSetCache, 'ColumnSummary.reset'); + _this4.markSectionAs(action === 'collapse' ? 'collapsed' : 'expanded', row, col, true); + _this4.toggleCollapsibleSection({ + row: row, + col: col + }, action); + } + }); + }); + } else { + (0, _object.objectEach)(this.buttonEnabledList, function (headerRow, i) { + (0, _object.objectEach)(headerRow, function (header, j) { + var rowIndex = parseInt(i, 10); + var columnIndex = parseInt(j, 10); - this.cellsToSetCache = []; + _this4.markSectionAs(action === 'collapse' ? 'collapsed' : 'expanded', rowIndex, columnIndex, true); + _this4.toggleCollapsibleSection({ + row: rowIndex, + col: columnIndex + }, action); + }); + }); + } } /** - * Calculate and refresh all defined endpoints. + * Collapses all collapsible sections. */ }, { - key: 'refreshAllEndpoints', - value: function refreshAllEndpoints() { - var _this5 = this; - - this.cellsToSetCache = []; - - (0, _array.arrayEach)(this.getAllEndpoints(), function (value) { - _this5.currentEndpoint = value; - _this5.plugin.calculate(value); - _this5.setEndpointValue(value, 'init'); - }); - this.currentEndpoint = null; + key: 'collapseAll', + value: function collapseAll() { + this.toggleAllCollapsibleSections('collapse'); + } - this.hot.setDataAtCell(this.cellsToSetCache, 'ColumnSummary.reset'); + /** + * Expands all collapsible sections. + */ - this.cellsToSetCache = []; + }, { + key: 'expandAll', + value: function expandAll() { + this.toggleAllCollapsibleSections('expand'); } /** - * Calculate and refresh endpoints only in the changed columns. + * Collapses/Expands a section. * - * @param {Array} changes Array of changes from the `afterChange` hook. + * @param {Object} coords Section coordinates. + * @param {String} action Action definition ('collapse' or 'expand'). */ }, { - key: 'refreshChangedEndpoints', - value: function refreshChangedEndpoints(changes) { - var _this6 = this; + key: 'toggleCollapsibleSection', + value: function toggleCollapsibleSection(coords, action) { + var _this5 = this; - var needToRefresh = []; - this.cellsToSetCache = []; + if (coords.row) { + coords.row = parseInt(coords.row, 10); + } + if (coords.col) { + coords.col = parseInt(coords.col, 10); + } - (0, _array.arrayEach)(changes, function (value, key, changesObj) { - // if nothing changed, dont update anything - if ('' + (value[2] || '') === '' + value[3]) { - return; - } + var hiddenColumns = this.hiddenColumnsPlugin.hiddenColumns; + var colspanArray = this.nestedHeadersPlugin.colspanArray; + var level = this.nestedHeadersPlugin.rowCoordsToLevel(coords.row); + var currentHeaderColspan = colspanArray[level][coords.col].colspan; + var childHeaders = this.nestedHeadersPlugin.getChildHeaders(coords.row, coords.col); + var nextLevel = level + 1; + var childColspanLevel = colspanArray[nextLevel]; + var firstChildColspan = childColspanLevel ? childColspanLevel[childHeaders[0]].colspan || 1 : 1; - (0, _array.arrayEach)(_this6.getAllEndpoints(), function (endpoint, j) { - if (_this6.hot.propToCol(changesObj[key][1]) === endpoint.sourceColumn && needToRefresh.indexOf(j) === -1) { - needToRefresh.push(j); - } - }); - }); + while (firstChildColspan === currentHeaderColspan && nextLevel < this.columnHeaderLevelCount) { + nextLevel += 1; + childColspanLevel = colspanArray[nextLevel]; + firstChildColspan = childColspanLevel ? childColspanLevel[childHeaders[0]].colspan || 1 : 1; + } - (0, _array.arrayEach)(needToRefresh, function (value) { - _this6.refreshEndpoint(_this6.getEndpoint(value)); - }); + (0, _number.rangeEach)(firstChildColspan, currentHeaderColspan - 1, function (i) { + var colToHide = coords.col + i; + + switch (action) { + case 'collapse': + if (!_this5.hiddenColumnsPlugin.isHidden(colToHide)) { + hiddenColumns.push(colToHide); + } - this.hot.setDataAtCell(this.cellsToSetCache, 'ColumnSummary.reset'); - this.cellsToSetCache = []; - } + break; + case 'expand': + if (_this5.hiddenColumnsPlugin.isHidden(colToHide)) { + hiddenColumns.splice(hiddenColumns.indexOf(colToHide), 1); + } - /** - * Calculate and refresh a single endpoint. - * - * @param {Object} endpoint Contains the endpoint information. - */ + break; + default: + break; + } + }); - }, { - key: 'refreshEndpoint', - value: function refreshEndpoint(endpoint) { - this.currentEndpoint = endpoint; - this.plugin.calculate(endpoint); - this.setEndpointValue(endpoint); - this.currentEndpoint = null; + this.hot.render(); + this.hot.view.wt.wtOverlays.adjustElementsSize(true); } /** - * Reset the endpoint value. + * Adds the indicator to the headers. * - * @param {Object} endpoint Contains the endpoint information. - * @param {Boolean} [useOffset=true] Use the cell offset value. + * @private + * @param {Number} column Column index. + * @param {HTMLElement} TH TH element. */ }, { - key: 'resetEndpointValue', - value: function resetEndpointValue(endpoint) { - var useOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - var alterRowOffset = endpoint.alterRowOffset || 0; - var alterColOffset = endpoint.alterColumnOffset || 0; - - var _recordTranslator$toV = this.recordTranslator.toVisual(endpoint.destinationRow, endpoint.destinationColumn), - _recordTranslator$toV2 = _slicedToArray(_recordTranslator$toV, 2), - visualRowIndex = _recordTranslator$toV2[0], - visualColumnIndex = _recordTranslator$toV2[1]; - - // Clear the meta on the "old" indexes - - - var cellMeta = this.hot.getCellMeta(visualRowIndex, visualColumnIndex); - cellMeta.readOnly = false; - cellMeta.className = ''; + key: 'onAfterGetColHeader', + value: function onAfterGetColHeader(column, TH) { + if (TH.hasAttribute('colspan') && TH.getAttribute('colspan') > 1 && column >= this.hot.getSettings().fixedColumnsLeft) { + var button = this.generateIndicator(column, TH); - this.cellsToSetCache.push([this.recordTranslator.toVisualRow(endpoint.destinationRow + (useOffset ? alterRowOffset : 0)), this.recordTranslator.toVisualColumn(endpoint.destinationColumn + (useOffset ? alterColOffset : 0)), '']); + if (button !== null) { + TH.querySelector('div:first-child').appendChild(button); + } + } } /** - * Set the endpoint value. + * Indicator mouse event callback. * - * @param {Object} endpoint Contains the endpoint information. - * @param {String} [source] Source of the call information. - * @param {Boolean} [render=false] `true` if it needs to render the table afterwards. + * @private + * @param {Object} event Mouse event. + * @param {Object} coords Event coordinates. */ }, { - key: 'setEndpointValue', - value: function setEndpointValue(endpoint, source) { - var render = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - // We'll need the reversed offset values, because cellMeta will be shifted AGAIN afterwards. - var reverseRowOffset = -1 * endpoint.alterRowOffset || 0; - var reverseColOffset = -1 * endpoint.alterColumnOffset || 0; - var visualEndpointRowIndex = this.getVisualRowIndex(endpoint.destinationRow); - - var cellMeta = this.hot.getCellMeta(this.getVisualRowIndex(endpoint.destinationRow + reverseRowOffset), endpoint.destinationColumn + reverseColOffset); + key: 'onBeforeOnCellMouseDown', + value: function onBeforeOnCellMouseDown(event, coords) { + if ((0, _element.hasClass)(event.target, 'collapsibleIndicator')) { + if ((0, _element.hasClass)(event.target, 'expanded')) { - if (visualEndpointRowIndex > this.hot.countRows() || endpoint.destinationColumn > this.hot.countCols()) { - this.throwOutOfBoundsWarning(); - return; - } + // mark section as collapsed + if (!this.collapsedSections[coords.row]) { + this.collapsedSections[coords.row] = []; + } - if (source === 'init' || cellMeta.readOnly !== endpoint.readOnly) { - cellMeta.readOnly = endpoint.readOnly; - cellMeta.className = 'columnSummaryResult'; - } + this.markSectionAs('collapsed', coords.row, coords.col, true); + this.eventManager.fireEvent(event.target, 'mouseup'); + this.toggleCollapsibleSection(coords, 'collapse'); + } else if ((0, _element.hasClass)(event.target, 'collapsed')) { - if (endpoint.roundFloat && !isNaN(endpoint.result)) { - endpoint.result = endpoint.result.toFixed(endpoint.roundFloat); - } + this.markSectionAs('expanded', coords.row, coords.col, true); + this.eventManager.fireEvent(event.target, 'mouseup'); + this.toggleCollapsibleSection(coords, 'expand'); + } - if (render) { - this.hot.setDataAtCell(visualEndpointRowIndex, endpoint.destinationColumn, endpoint.result, 'ColumnSummary.set'); - } else { - this.cellsToSetCache.push([visualEndpointRowIndex, endpoint.destinationColumn, endpoint.result]); + (0, _event.stopImmediatePropagation)(event); + return false; } - - endpoint.alterRowOffset = void 0; - endpoint.alterColumnOffset = void 0; } /** - * Get the visual row index for the provided row. Uses the `umodifyRow` hook. + * AfterInit hook callback. * * @private - * @param {Number} row Row index. - * @returns {Number} */ }, { - key: 'getVisualRowIndex', - value: function getVisualRowIndex(row) { - return this.hot.runHooks('unmodifyRow', row, 'columnSummary'); + key: 'onAfterInit', + value: function onAfterInit() { + this.columnHeaderLevelCount = this.hot.view.wt.getSetting('columnHeaders').length; } /** - * Get the visual column index for the provided column. Uses the `umodifyColumn` hook. + * AfterRender hook callback. * * @private - * @param {Number} column Column index. - * @returns {Number} */ }, { - key: 'getVisualColumnIndex', - value: function getVisualColumnIndex(column) { - return this.hot.runHooks('unmodifyCol', column, 'columnSummary'); + key: 'onAfterRender', + value: function onAfterRender() { + if (!this.nestedHeadersPlugin.enabled || !this.hiddenColumnsPlugin.enabled) { + this.disablePlugin(); + } } /** - * Throw an error for the calculation range being out of boundaries. - * - * @private + * Destroys the plugin instance. */ }, { - key: 'throwOutOfBoundsWarning', - value: function throwOutOfBoundsWarning() { - (0, _console.warn)('One of the Column Summary plugins\' destination points you provided is beyond the table boundaries!'); + key: 'destroy', + value: function destroy() { + this.settings = null; + this.buttonEnabledList = null; + this.hiddenColumnsPlugin = null; + this.nestedHeadersPlugin = null; + this.collapsedSections = null; + this.columnHeaderLevelCount = null; + + _get(CollapsibleColumns.prototype.__proto__ || Object.getPrototypeOf(CollapsibleColumns.prototype), 'destroy', this).call(this); } }]); - return Endpoints; -}(); + return CollapsibleColumns; +}(_base2.default); -exports.default = Endpoints; +(0, _plugins.registerPlugin)('collapsibleColumns', CollapsibleColumns); + +exports.default = CollapsibleColumns; /***/ }), -/* 654 */ +/* 653 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -94288,45 +92875,21 @@ exports.default = Endpoints; exports.__esModule = true; -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _base = __webpack_require__(6); - -var _base2 = _interopRequireDefault(_base); - -var _array = __webpack_require__(0); - -var _commandExecutor2 = __webpack_require__(466); - -var _commandExecutor3 = _interopRequireDefault(_commandExecutor2); - -var _eventManager = __webpack_require__(9); - -var _eventManager2 = _interopRequireDefault(_eventManager); - -var _element = __webpack_require__(2); - -var _itemsFactory = __webpack_require__(467); +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _itemsFactory2 = _interopRequireDefault(_itemsFactory); +var _base = __webpack_require__(7); -var _menu = __webpack_require__(162); +var _base2 = _interopRequireDefault(_base); -var _menu2 = _interopRequireDefault(_menu); +var _object = __webpack_require__(1); var _plugins = __webpack_require__(5); -var _pluginHooks = __webpack_require__(17); - -var _pluginHooks2 = _interopRequireDefault(_pluginHooks); - -var _event = __webpack_require__(12); - -var _predefinedItems = __webpack_require__(43); +var _endpoints5 = __webpack_require__(654); -__webpack_require__(655); +var _endpoints6 = _interopRequireDefault(_endpoints5); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -94336,128 +92899,75 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -_pluginHooks2.default.getSingleton().register('afterDropdownMenuDefaultOptions'); -_pluginHooks2.default.getSingleton().register('beforeDropdownMenuShow'); -_pluginHooks2.default.getSingleton().register('afterDropdownMenuShow'); -_pluginHooks2.default.getSingleton().register('afterDropdownMenuHide'); -_pluginHooks2.default.getSingleton().register('afterDropdownMenuExecute'); - -var BUTTON_CLASS_NAME = 'changeType'; - /** - * @plugin DropdownMenu + * @plugin ColumnSummary * @pro - * @dependencies ContextMenu * * @description - * This plugin creates the Handsontable Dropdown Menu. It allows to create a new row or column at any place in the grid - * among [other features](http://docs.handsontable.com/demo-context-menu.html). - * Possible values: - * * `true` (to enable default options), - * * `false` (to disable completely) - * - * or array of any available strings: - * * `["row_above", "row_below", "col_left", "col_right", - * "remove_row", "remove_col", "---------", "undo", "redo"]`. - * - * See [the dropdown menu demo](http://docs.handsontable.com/demo-dropdown-menu.html) for examples. - * + * Allows making pre-defined calculations on the cell values and display the results within Handsontable. + * [See the demo for more information](https://docs.handsontable.com/pro/demo-summary-calculations.html). + *s * @example - * ``` * const container = document.getElementById('example'); * const hot = new Handsontable(container, { - * data: data, - * colHeaders: true, - * // enable dropdown menu - * dropdownMenu: true - * }); - * - * // or - * const hot = new Handsontable(container, { - * data: data, + * data: getData(), * colHeaders: true, - * // enable and configure dropdown menu - * dropdownMenu: ['remove_col', '---------', 'make_read_only', 'alignment'] + * rowHeaders: true, + * columnSummary: [ + * { + * destinationRow: 4, + * destinationColumn: 1, + * type: 'min' + * }, + * { + * destinationRow: 0, + * destinationColumn: 3, + * reversedRowCoords: true, + * type: 'max' + * }, + * { + * destinationRow: 4, + * destinationColumn: 5, + * type: 'sum', + * forceNumeric: true + * } + * ] * }); - * ``` */ +var ColumnSummary = function (_BasePlugin) { + _inherits(ColumnSummary, _BasePlugin); -var DropdownMenu = function (_BasePlugin) { - _inherits(DropdownMenu, _BasePlugin); - - _createClass(DropdownMenu, null, [{ - key: 'DEFAULT_ITEMS', - - /** - * Default menu items order when `dropdownMenu` is enabled by setting the config item to `true`. - * - * @returns {Array} - */ - get: function get() { - return [_predefinedItems.COLUMN_LEFT, _predefinedItems.COLUMN_RIGHT, _predefinedItems.SEPARATOR, _predefinedItems.REMOVE_COLUMN, _predefinedItems.SEPARATOR, _predefinedItems.CLEAR_COLUMN, _predefinedItems.SEPARATOR, _predefinedItems.READ_ONLY, _predefinedItems.SEPARATOR, _predefinedItems.ALIGNMENT]; - } - }]); - - function DropdownMenu(hotInstance) { - _classCallCheck(this, DropdownMenu); - - /** - * Instance of {@link EventManager}. - * - * @private - * @type {EventManager} - */ - var _this = _possibleConstructorReturn(this, (DropdownMenu.__proto__ || Object.getPrototypeOf(DropdownMenu)).call(this, hotInstance)); + function ColumnSummary(hotInstance) { + _classCallCheck(this, ColumnSummary); - _this.eventManager = new _eventManager2.default(_this); /** - * Instance of {@link CommandExecutor}. - * - * @private - * @type {CommandExecutor} - */ - _this.commandExecutor = new _commandExecutor3.default(_this.hot); - /** - * Instance of {@link ItemsFactory}. - * - * @private - * @type {ItemsFactory} - */ - _this.itemsFactory = null; - /** - * Instance of {@link Menu}. + * The Endpoints class instance. Used to make all endpoint-related operations. * * @private - * @type {Menu} + * @type {null|Endpoints} */ - _this.menu = null; + var _this = _possibleConstructorReturn(this, (ColumnSummary.__proto__ || Object.getPrototypeOf(ColumnSummary)).call(this, hotInstance)); - // One listener for enable/disable functionality - _this.hot.addHook('afterGetColHeader', function (col, TH) { - return _this.onAfterGetColHeader(col, TH); - }); + _this.endpoints = null; return _this; } /** * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit} - * hook and if it returns `true` than the {@link DropdownMenu#enablePlugin} method is called. + * hook and if it returns `true` than the {@link ColumnSummary#enablePlugin} method is called. * * @returns {Boolean} */ - _createClass(DropdownMenu, [{ + _createClass(ColumnSummary, [{ key: 'isEnabled', value: function isEnabled() { - return this.hot.getSettings().dropdownMenu; + return !!this.hot.getSettings().columnSummary; } /** * Enables the plugin functionality for this Handsontable instance. - * - * @fires Hooks#afterDropdownMenuDefaultOptions - * @fires Hooks#beforeDropdownMenuSetItems */ }, { @@ -94468,357 +92978,435 @@ var DropdownMenu = function (_BasePlugin) { if (this.enabled) { return; } - this.itemsFactory = new _itemsFactory2.default(this.hot, DropdownMenu.DEFAULT_ITEMS); - var settings = this.hot.getSettings().dropdownMenu; - var predefinedItems = { - items: this.itemsFactory.getItems(settings) - }; - this.registerEvents(); + this.settings = this.hot.getSettings().columnSummary; + this.endpoints = new _endpoints6.default(this, this.settings); - if (typeof settings.callback === 'function') { - this.commandExecutor.setCommonCallback(settings.callback); - } - _get(DropdownMenu.prototype.__proto__ || Object.getPrototypeOf(DropdownMenu.prototype), 'enablePlugin', this).call(this); + this.addHook('afterInit', function () { + return _this2.onAfterInit.apply(_this2, arguments); + }); + this.addHook('afterChange', function () { + return _this2.onAfterChange.apply(_this2, arguments); + }); - this.callOnPluginsReady(function () { - _this2.hot.runHooks('afterDropdownMenuDefaultOptions', predefinedItems); + this.addHook('beforeCreateRow', function (index, amount, source) { + return _this2.endpoints.resetSetupBeforeStructureAlteration('insert_row', index, amount, null, source); + }); + this.addHook('beforeCreateCol', function (index, amount, source) { + return _this2.endpoints.resetSetupBeforeStructureAlteration('insert_col', index, amount, null, source); + }); + this.addHook('beforeRemoveRow', function () { + var _endpoints; - _this2.itemsFactory.setPredefinedItems(predefinedItems.items); - var menuItems = _this2.itemsFactory.getItems(settings); + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - if (_this2.menu) { - _this2.menu.destroy(); + return (_endpoints = _this2.endpoints).resetSetupBeforeStructureAlteration.apply(_endpoints, ['remove_row'].concat(args)); + }); + this.addHook('beforeRemoveCol', function () { + var _endpoints2; + + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; } - _this2.menu = new _menu2.default(_this2.hot, { - className: 'htDropdownMenu', - keepInViewport: true - }); - _this2.hot.runHooks('beforeDropdownMenuSetItems', menuItems); - _this2.menu.setMenuItems(menuItems); + return (_endpoints2 = _this2.endpoints).resetSetupBeforeStructureAlteration.apply(_endpoints2, ['remove_col'].concat(args)); + }); + this.addHook('beforeRowMove', function () { + return _this2.onBeforeRowMove.apply(_this2, arguments); + }); - _this2.menu.addLocalHook('beforeOpen', function () { - return _this2.onMenuBeforeOpen(); - }); - _this2.menu.addLocalHook('afterOpen', function () { - return _this2.onMenuAfterOpen(); - }); - _this2.menu.addLocalHook('afterClose', function () { - return _this2.onMenuAfterClose(); - }); - _this2.menu.addLocalHook('executeCommand', function () { - var _executeCommand; + this.addHook('afterCreateRow', function (index, amount, source) { + return _this2.endpoints.resetSetupAfterStructureAlteration('insert_row', index, amount, null, source); + }); + this.addHook('afterCreateCol', function (index, amount, source) { + return _this2.endpoints.resetSetupAfterStructureAlteration('insert_col', index, amount, null, source); + }); + this.addHook('afterRemoveRow', function () { + var _endpoints3; - for (var _len = arguments.length, params = Array(_len), _key = 0; _key < _len; _key++) { - params[_key] = arguments[_key]; - } + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } - return (_executeCommand = _this2.executeCommand).call.apply(_executeCommand, [_this2].concat(params)); - }); + return (_endpoints3 = _this2.endpoints).resetSetupAfterStructureAlteration.apply(_endpoints3, ['remove_row'].concat(args)); + }); + this.addHook('afterRemoveCol', function () { + var _endpoints4; - // Register all commands. Predefined and added by user or by plugins - (0, _array.arrayEach)(menuItems, function (command) { - return _this2.commandExecutor.registerCommand(command.key, command); - }); + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + + return (_endpoints4 = _this2.endpoints).resetSetupAfterStructureAlteration.apply(_endpoints4, ['remove_col'].concat(args)); + }); + this.addHook('afterRowMove', function () { + return _this2.onAfterRowMove.apply(_this2, arguments); }); + + _get(ColumnSummary.prototype.__proto__ || Object.getPrototypeOf(ColumnSummary.prototype), 'enablePlugin', this).call(this); } /** - * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. + * Disables the plugin functionality for this Handsontable instance. */ }, { - key: 'updatePlugin', - value: function updatePlugin() { - this.disablePlugin(); - this.enablePlugin(); - _get(DropdownMenu.prototype.__proto__ || Object.getPrototypeOf(DropdownMenu.prototype), 'updatePlugin', this).call(this); + key: 'disablePlugin', + value: function disablePlugin() { + this.endpoints = null; + this.settings = null; + this.currentEndpoint = null; } /** - * Disables the plugin functionality for this Handsontable instance. + * Calculates math for a single endpoint. + * + * @private + * @param {Object} endpoint Contains information about the endpoint. */ }, { - key: 'disablePlugin', - value: function disablePlugin() { - this.close(); + key: 'calculate', + value: function calculate(endpoint) { + switch (endpoint.type.toLowerCase()) { + case 'sum': + endpoint.result = this.calculateSum(endpoint); + break; + case 'min': + endpoint.result = this.calculateMinMax(endpoint, endpoint.type); + break; + case 'max': + endpoint.result = this.calculateMinMax(endpoint, endpoint.type); + break; + case 'count': + endpoint.result = this.countEntries(endpoint); + break; + case 'average': + endpoint.result = this.calculateAverage(endpoint); + break; + case 'custom': + endpoint.result = endpoint.customFunction.call(this, endpoint); + break; + default: + break; + } + } + + /** + * Calculates sum of the values contained in ranges provided in the plugin config. + * + * @private + * @param {Object} endpoint Contains the endpoint information. + * @returns {Number} Sum for the selected range + */ + + }, { + key: 'calculateSum', + value: function calculateSum(endpoint) { + var _this3 = this; + + var sum = 0; + + (0, _object.objectEach)(endpoint.ranges, function (range) { + sum += _this3.getPartialSum(range, endpoint.sourceColumn); + }); + + return sum; + } + + /** + * Returns partial sum of values from a single row range + * + * @private + * @param {Array} rowRange Range for the sum. + * @param {Number} col Column index. + * @returns {Number} The partial sum. + */ + + }, { + key: 'getPartialSum', + value: function getPartialSum(rowRange, col) { + var sum = 0; + var i = rowRange[1] || rowRange[0]; + var cellValue = null; + var biggestDecimalPlacesCount = 0; + + do { + cellValue = this.getCellValue(i, col) || 0; + var decimalPlaces = (('' + cellValue).split('.')[1] || []).length || 1; + if (decimalPlaces > biggestDecimalPlacesCount) { + biggestDecimalPlacesCount = decimalPlaces; + } + + sum += cellValue || 0; + i -= 1; + } while (i >= rowRange[0]); - if (this.menu) { - this.menu.destroy(); - } - _get(DropdownMenu.prototype.__proto__ || Object.getPrototypeOf(DropdownMenu.prototype), 'disablePlugin', this).call(this); + // Workaround for e.g. 802.2 + 1.1 = 803.3000000000001 + return Math.round(sum * Math.pow(10, biggestDecimalPlacesCount)) / Math.pow(10, biggestDecimalPlacesCount); } /** - * Registers the DOM listeners. + * Calculates the minimal value for the selected ranges * * @private + * @param {Object} endpoint Contains the endpoint information. + * @param {String} type `'min'` or `'max'`. + * @returns {Number} Min or Max value. */ }, { - key: 'registerEvents', - value: function registerEvents() { - var _this3 = this; + key: 'calculateMinMax', + value: function calculateMinMax(endpoint, type) { + var _this4 = this; - this.eventManager.addEventListener(this.hot.rootElement, 'click', function (event) { - return _this3.onTableClick(event); + var result = null; + + (0, _object.objectEach)(endpoint.ranges, function (range) { + var partialResult = _this4.getPartialMinMax(range, endpoint.sourceColumn, type); + + if (result === null && partialResult !== null) { + result = partialResult; + } + + if (partialResult !== null) { + switch (type) { + case 'min': + result = Math.min(result, partialResult); + break; + case 'max': + result = Math.max(result, partialResult); + break; + default: + break; + } + } }); + + return result === null ? 'Not enough data' : result; } /** - * Opens menu and re-position it based on the passed coordinates. + * Returns a local minimum of the provided sub-range * - * @param {Object|Event} position An object with `pageX` and `pageY` properties which contains values relative to - * the top left of the fully rendered content area in the browser or with `clientX` - * and `clientY` properties which contains values relative to the upper left edge - * of the content area (the viewport) of the browser window. This object is structurally - * compatible with native mouse event so it can be used either. - * @fires Hooks#beforeDropdownMenuShow - * @fires Hooks#afterDropdownMenuShow + * @private + * @param {Array} rowRange Range for the calculation. + * @param {Number} col Column index. + * @param {String} type `'min'` or `'max'` + * @returns {Number} Min or max value. */ }, { - key: 'open', - value: function open(position) { - if (!this.menu) { - return; - } - this.menu.open(); + key: 'getPartialMinMax', + value: function getPartialMinMax(rowRange, col, type) { + var result = null; + var i = rowRange[1] || rowRange[0]; + var cellValue = void 0; - if (position.width) { - this.menu.setOffset('left', position.width); - } - this.menu.setPosition(position); + do { + cellValue = this.getCellValue(i, col) || null; - // ContextMenu is not detected HotTableEnv correctly because is injected outside hot-table - this.menu.hotMenu.isHotTableEnv = this.hot.isHotTableEnv; - // Handsontable.eventManager.isHotTableEnv = this.hot.isHotTableEnv; - } + if (result === null) { + result = cellValue; + } else if (cellValue !== null) { + switch (type) { + case 'min': + result = Math.min(result, cellValue); + break; + case 'max': + result = Math.max(result, cellValue); + break; + default: + break; + } + } - /** - * Closes dropdown menu. - */ + i -= 1; + } while (i >= rowRange[0]); - }, { - key: 'close', - value: function close() { - if (!this.menu) { - return; - } - this.menu.close(); + return result; } /** - * Executes context menu command. - * - * You can execute all predefined commands: - * * `'row_above'` - Insert row above - * * `'row_below'` - Insert row below - * * `'col_left'` - Insert column left - * * `'col_right'` - Insert column right - * * `'clear_column'` - Clear selected column - * * `'remove_row'` - Remove row - * * `'remove_col'` - Remove column - * * `'undo'` - Undo last action - * * `'redo'` - Redo last action - * * `'make_read_only'` - Make cell read only - * * `'alignment:left'` - Alignment to the left - * * `'alignment:top'` - Alignment to the top - * * `'alignment:right'` - Alignment to the right - * * `'alignment:bottom'` - Alignment to the bottom - * * `'alignment:middle'` - Alignment to the middle - * * `'alignment:center'` - Alignment to the center (justify) - * - * Or you can execute command registered in settings where `key` is your command name. + * Counts empty cells in the provided row range. * - * @param {String} commandName Command name to execute. - * @param {*} params + * @private + * @param {Array} rowRange Row range for the calculation. + * @param {Number} col Column index. + * @returns {Number} Empty cells count. */ }, { - key: 'executeCommand', - value: function executeCommand(commandName) { - var _commandExecutor; + key: 'countEmpty', + value: function countEmpty(rowRange, col) { + var cellValue = void 0; + var counter = 0; + var i = rowRange[1] || rowRange[0]; - for (var _len2 = arguments.length, params = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - params[_key2 - 1] = arguments[_key2]; - } + do { + cellValue = this.getCellValue(i, col); - (_commandExecutor = this.commandExecutor).execute.apply(_commandExecutor, [commandName].concat(params)); + if (!cellValue) { + counter += 1; + } + + i -= 1; + } while (i >= rowRange[0]); + + return counter; } /** - * Turns on / off listening on dropdown menu + * Counts non-empty cells in the provided row range. * * @private - * @param {Boolean} listen Turn on listening when value is set to true, otherwise turn it off. + * @param {Object} endpoint Contains the endpoint information. + * @returns {Number} Entry count. */ }, { - key: 'setListening', - value: function setListening() { - var listen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + key: 'countEntries', + value: function countEntries(endpoint) { + var _this5 = this; - if (this.menu.isOpened()) { - if (listen) { - this.menu.hotMenu.listen(); - } else { - this.menu.hotMenu.unlisten(); - } - } + var result = 0; + var ranges = endpoint.ranges; + + (0, _object.objectEach)(ranges, function (range) { + var partial = range[1] === void 0 ? 1 : range[1] - range[0] + 1; + var emptyCount = _this5.countEmpty(range, endpoint.sourceColumn); + + result += partial; + result -= emptyCount; + }); + + return result; } /** - * Table click listener. + * Calculates the average value from the cells in the range. * * @private - * @param {Event} event + * @param {Object} endpoint Contains the endpoint information. + * @returns {Number} Avarage value. */ }, { - key: 'onTableClick', - value: function onTableClick(event) { - (0, _event.stopPropagation)(event); - - if ((0, _element.hasClass)(event.target, BUTTON_CLASS_NAME) && !this.menu.isOpened()) { - var rect = event.target.getBoundingClientRect(); + key: 'calculateAverage', + value: function calculateAverage(endpoint) { + var sum = this.calculateSum(endpoint); + var entriesCount = this.countEntries(endpoint); - this.open({ - left: rect.left, - top: rect.top + event.target.offsetHeight + 3, - width: rect.width, - height: rect.height - }); - } + return sum / entriesCount; } /** - * On after get column header listener. + * Returns a cell value, taking into consideration a basic validation. * * @private - * @param {Number} col - * @param {HTMLTableCellElement} TH + * @param {Number} row Row index. + * @param {Number} col Column index. + * @returns {String} The cell value. */ }, { - key: 'onAfterGetColHeader', - value: function onAfterGetColHeader(col, TH) { - // Corner or a higher-level header - var headerRow = TH.parentNode; - if (!headerRow) { - return; - } + key: 'getCellValue', + value: function getCellValue(row, col) { + var visualRowIndex = this.endpoints.getVisualRowIndex(row); + var visualColumnIndex = this.endpoints.getVisualColumnIndex(col); - var headerRowList = headerRow.parentNode.childNodes; - var level = Array.prototype.indexOf.call(headerRowList, headerRow); + var cellValue = this.hot.getSourceDataAtCell(row, col); + var cellClassName = this.hot.getCellMeta(visualRowIndex, visualColumnIndex).className || ''; - if (col < 0 || level !== headerRowList.length - 1) { - return; + if (cellClassName.indexOf('columnSummaryResult') > -1) { + return null; } - var existingButton = TH.querySelector('.' + BUTTON_CLASS_NAME); - - // Plugin enabled and buttons already exists, return. - if (this.enabled && existingButton) { - return; - } - // Plugin disabled and buttons still exists, so remove them. - if (!this.enabled) { - if (existingButton) { - existingButton.parentNode.removeChild(existingButton); + if (this.endpoints.currentEndpoint.forceNumeric) { + if (typeof cellValue === 'string') { + cellValue = cellValue.replace(/,/, '.'); } - return; + cellValue = parseFloat(cellValue); } - var button = document.createElement('button'); - button.className = BUTTON_CLASS_NAME; - - // prevent page reload on button click - button.onclick = function () { - return false; - }; + if (isNaN(cellValue)) { + if (!this.endpoints.currentEndpoint.suppressDataTypeErrors) { + throw new Error('ColumnSummary plugin: cell at (' + row + ', ' + col + ') is not in a numeric format. Cannot do the calculation.'); + } + } - TH.firstChild.insertBefore(button, TH.firstChild.firstChild); + return cellValue; } /** - * On menu before open listener. + * `afterInit` hook callback. * * @private - * @fires Hooks#beforeDropdownMenuShow */ }, { - key: 'onMenuBeforeOpen', - value: function onMenuBeforeOpen() { - this.hot.runHooks('beforeDropdownMenuShow', this); + key: 'onAfterInit', + value: function onAfterInit() { + this.endpoints.endpoints = this.endpoints.parseSettings(); + this.endpoints.refreshAllEndpoints(true); } /** - * On menu after open listener. + * `afterChange` hook callback. * * @private - * @fires Hooks#afterDropdownMenuShow + * @param {Array} changes + * @param {String} source */ }, { - key: 'onMenuAfterOpen', - value: function onMenuAfterOpen() { - this.hot.runHooks('afterDropdownMenuShow', this); + key: 'onAfterChange', + value: function onAfterChange(changes, source) { + if (changes && source !== 'ColumnSummary.reset' && source !== 'ColumnSummary.set' && source !== 'loadData') { + this.endpoints.refreshChangedEndpoints(changes); + } } /** - * On menu after close listener. + * `beforeRowMove` hook callback. * * @private - * @fires Hooks#afterDropdownMenuHide + * @param {Array} rows Array of logical rows to be moved. */ }, { - key: 'onMenuAfterClose', - value: function onMenuAfterClose() { - this.hot.listen(); - this.hot.runHooks('afterDropdownMenuHide', this); + key: 'onBeforeRowMove', + value: function onBeforeRowMove(rows) { + this.endpoints.resetSetupBeforeStructureAlteration('move_row', rows[0], rows.length, rows, this.pluginName); } /** - * Destroys the plugin instance. + * `afterRowMove` hook callback. + * + * @private + * @param {Array} rows Array of logical rows that were moved. + * @param {Number} target Index of the destination row. */ }, { - key: 'destroy', - value: function destroy() { - this.close(); - - if (this.menu) { - this.menu.destroy(); - } - _get(DropdownMenu.prototype.__proto__ || Object.getPrototypeOf(DropdownMenu.prototype), 'destroy', this).call(this); + key: 'onAfterRowMove', + value: function onAfterRowMove(rows, target) { + this.endpoints.resetSetupAfterStructureAlteration('move_row', target, rows.length, rows, this.pluginName); } }]); - return DropdownMenu; + return ColumnSummary; }(_base2.default); -DropdownMenu.SEPARATOR = { - name: _predefinedItems.SEPARATOR -}; - -(0, _plugins.registerPlugin)('dropdownMenu', DropdownMenu); - -exports.default = DropdownMenu; - -/***/ }), -/* 655 */ -/***/ (function(module, exports) { +(0, _plugins.registerPlugin)('columnSummary', ColumnSummary); -// removed by extract-text-webpack-plugin +exports.default = ColumnSummary; /***/ }), -/* 656 */ +/* 654 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -94826,713 +93414,671 @@ exports.default = DropdownMenu; exports.__esModule = true; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _base = __webpack_require__(6); - -var _base2 = _interopRequireDefault(_base); - -var _plugins = __webpack_require__(5); - -var _dataProvider = __webpack_require__(657); +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); -var _dataProvider2 = _interopRequireDefault(_dataProvider); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _typeFactory = __webpack_require__(658); +var _array = __webpack_require__(0); -var _typeFactory2 = _interopRequireDefault(_typeFactory); +var _console = __webpack_require__(22); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _recordTranslator = __webpack_require__(55); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - /** - * @plugin ExportFile - * @pro - * - * @description - * The plugin enables exporting table data to file. It allows to export data as a string, blob or a downloadable file in - * CSV format. - * - * See [the export file demo](https://docs.handsontable.com/demo-export-file.html) for examples. - * - * @example - * ```js - * const container = document.getElementById('example'); - * const hot = new Handsontable(container, { - * data: getData() - * }); - * - * // access to exportFile plugin instance - * const exportPlugin = hot.getPlugin('exportFile'); - * - * // export as a string - * exportPlugin.exportAsString('csv'); - * - * // export as a blob object - * exportPlugin.exportAsBlob('csv'); - * - * // export to downloadable file (named: MyFile.csv) - * exportPlugin.downloadFile('csv', {filename: 'MyFile'}); + * Class used to make all endpoint-related operations. * - * // export as a string (with specified data range): - * exportPlugin.exportAsString('csv', { - * exportHiddenRows: true, // default false - * exportHiddenColumns: true, // default false - * columnHeaders: true, // default false - * rowHeaders: true, // default false - * columnDelimiter: ';', // default ',' - * range: [1, 1, 6, 6] // [startRow, endRow, startColumn, endColumn] - * }); - * ``` + * @class Endpoints + * @plugin ColumnSummary + * @pro */ -var ExportFile = function (_BasePlugin) { - _inherits(ExportFile, _BasePlugin); - - function ExportFile() { - _classCallCheck(this, ExportFile); - - return _possibleConstructorReturn(this, (ExportFile.__proto__ || Object.getPrototypeOf(ExportFile)).apply(this, arguments)); - } - - _createClass(ExportFile, [{ - key: 'isEnabled', +var Endpoints = function () { + function Endpoints(plugin, settings) { + _classCallCheck(this, Endpoints); /** - * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit} - * hook and if it returns `true` than the {@link ExportFile#enablePlugin} method is called. + * The main plugin instance. + */ + this.plugin = plugin; + /** + * Handsontable instance. * - * @returns {Boolean} + * @type {Object} */ - value: function isEnabled() { - return true; - } - + this.hot = this.plugin.hot; /** - * @typedef ExportOptions - * @memberof ExportFile - * @type {object} - * @property {boolean} [exportHiddenRows=false] Include hidden rows in the exported file. - * @property {boolean} [exportHiddenColumns=false] Include hidden columns in the exported file. - * @property {boolean} [columnHeaders=false] Include column headers in the exported file. - * @property {boolean} [rowHeaders=false] Include row headers in the exported file. - * @property {string} [columnDelimiter=','] Column delimiter. - * @property {string} [range=[]] Cell range that will be exported to file. + * Array of declared plugin endpoints (calculation destination points). + * + * @type {Array} + * @default {Array} Empty array. */ - + this.endpoints = []; /** - * Exports table data as a string. + * The plugin settings, taken from Handsontable configuration. * - * @param {String} format Export format type eq. `'csv'`. - * @param {ExportOptions} options Export options. - */ - - }, { - key: 'exportAsString', - value: function exportAsString(format) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - return this._createTypeFormatter(format, options).export(); - } - + * @type {Object|Function} + * @default null + */ + this.settings = settings; /** - * Exports table data as a blob object. + * Settings type. Can be either 'array' or 'function. * - * @param {String} format Export format type eq. `'csv'`. - * @param {ExportOptions} options Export options. - */ - - }, { - key: 'exportAsBlob', - value: function exportAsBlob(format) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - return this._createBlob(this._createTypeFormatter(format, options)); - } - + * @type {string} + * @default {'array'} + */ + this.settingsType = 'array'; /** - * Exports table data as a downloadable file. + * The current endpoint (calculation destination point) in question. * - * @param {String} format Export format type eq. `'csv'`. - * @param {ExportOptions} options Export options. + * @type {Object} + * @default null */ + this.currentEndpoint = null; + /** + * Array containing a list of changes to be applied. + * + * @private + * @type {Array} + * @default {[]} + */ + this.cellsToSetCache = []; + /** + * A `recordTranslator` instance. + * @private + * @type {Object} + */ + this.recordTranslator = (0, _recordTranslator.getTranslator)(this.hot); + } - }, { - key: 'downloadFile', - value: function downloadFile(format) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var formatter = this._createTypeFormatter(format, options); - var blob = this._createBlob(formatter); - var URL = window.URL || window.webkitURL; - - var a = document.createElement('a'); - var name = formatter.options.filename + '.' + formatter.options.fileExtension; - - if (a.download !== void 0) { - var url = URL.createObjectURL(blob); + /** + * Get a single endpoint object. + * + * @param {Number} index Index of the endpoint. + * @returns {Object} + */ - a.style.display = 'none'; - a.setAttribute('href', url); - a.setAttribute('download', name); - document.body.appendChild(a); - a.dispatchEvent(new MouseEvent('click')); - document.body.removeChild(a); - setTimeout(function () { - URL.revokeObjectURL(url); - }, 100); - } else if (navigator.msSaveOrOpenBlob) { - // IE10+ - navigator.msSaveOrOpenBlob(blob, name); + _createClass(Endpoints, [{ + key: 'getEndpoint', + value: function getEndpoint(index) { + if (this.settingsType === 'function') { + return this.fillMissingEndpointData(this.settings)[index]; } + + return this.endpoints[index]; } /** - * Creates and returns class formatter for specified export type. + * Get an array with all the endpoints. * - * @private - * @param {String} format Export format type eq. `'csv'`. - * @param {ExportOptions} options Export options. + * @returns {Array} */ }, { - key: '_createTypeFormatter', - value: function _createTypeFormatter(format) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (!_typeFactory.EXPORT_TYPES[format]) { - throw new Error('Export format type "' + format + '" is not supported.'); + key: 'getAllEndpoints', + value: function getAllEndpoints() { + if (this.settingsType === 'function') { + return this.fillMissingEndpointData(this.settings); } - return (0, _typeFactory2.default)(format, new _dataProvider2.default(this.hot), options); + return this.endpoints; } /** - * Creates blob object based on provided type formatter class. + * Used to fill the blanks in the endpoint data provided by a settings function. * * @private - * @param {BaseType} typeFormatter - * @returns {Blob} + * @param {Function} func Function provided in the HOT settings. + * @returns {Array} An array of endpoints. */ }, { - key: '_createBlob', - value: function _createBlob(typeFormatter) { - var formatter = null; - - if (typeof Blob !== 'undefined') { - formatter = new Blob([typeFormatter.export()], { - type: typeFormatter.options.mimeType + ';charset=' + typeFormatter.options.encoding - }); - } - - return formatter; + key: 'fillMissingEndpointData', + value: function fillMissingEndpointData(func) { + return this.parseSettings(func.call(this)); } - }]); - - return ExportFile; -}(_base2.default); - -(0, _plugins.registerPlugin)('exportFile', ExportFile); - -exports.default = ExportFile; -/***/ }), -/* 657 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Parse plugin's settings. + * + * @param {Array} settings The settings array. + */ -"use strict"; + }, { + key: 'parseSettings', + value: function parseSettings(settings) { + var _this = this; + var endpointsArray = []; + var settingsArray = settings; -exports.__esModule = true; + if (!settingsArray && typeof this.settings === 'function') { + this.settingsType = 'function'; -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + return; + } -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + if (!settingsArray) { + settingsArray = this.settings; + } -var _number = __webpack_require__(4); + (0, _array.arrayEach)(settingsArray, function (val) { + var newEndpoint = {}; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + _this.assignSetting(val, newEndpoint, 'ranges', [[0, _this.hot.countRows() - 1]]); + _this.assignSetting(val, newEndpoint, 'reversedRowCoords', false); + _this.assignSetting(val, newEndpoint, 'destinationRow', new Error('\n You must provide a destination row for the Column Summary plugin in order to work properly!\n ')); + _this.assignSetting(val, newEndpoint, 'destinationColumn', new Error('\n You must provide a destination column for the Column Summary plugin in order to work properly!\n ')); + _this.assignSetting(val, newEndpoint, 'sourceColumn', val.destinationColumn); + _this.assignSetting(val, newEndpoint, 'type', 'sum'); + _this.assignSetting(val, newEndpoint, 'forceNumeric', false); + _this.assignSetting(val, newEndpoint, 'suppressDataTypeErrors', true); + _this.assignSetting(val, newEndpoint, 'suppressDataTypeErrors', true); + _this.assignSetting(val, newEndpoint, 'customFunction', null); + _this.assignSetting(val, newEndpoint, 'readOnly', true); + _this.assignSetting(val, newEndpoint, 'roundFloat', false); -// Waiting for jshint >=2.9.0 where they added support for destructing -// jshint ignore: start + endpointsArray.push(newEndpoint); + }); -/** - * @plugin ExportFile - * @private - */ -var DataProvider = function () { - function DataProvider(hotInstance) { - _classCallCheck(this, DataProvider); + return endpointsArray; + } /** - * Handsontable instance. - * - * @type {Core} - */ - this.hot = hotInstance; - /** - * Format type class options. + * Setter for the internal setting objects. * - * @type {Object} + * @param {Object} settings Object with the settings. + * @param {Object} endpoint Contains information about the endpoint for the the calculation. + * @param {String} name Settings name. + * @param defaultValue Default value for the settings. */ - this.options = {}; - } - /** - * Set options for data provider. - * - * @param {Object} options Object with specified options. - */ + }, { + key: 'assignSetting', + value: function assignSetting(settings, endpoint, name, defaultValue) { + if (name === 'ranges' && settings[name] === void 0) { + endpoint[name] = defaultValue; + return; + } else if (name === 'ranges' && settings[name].length === 0) { + return; + } + if (settings[name] === void 0) { + if (defaultValue instanceof Error) { + throw defaultValue; + } - _createClass(DataProvider, [{ - key: 'setOptions', - value: function setOptions(options) { - this.options = options; + endpoint[name] = defaultValue; + } else { + /* eslint-disable no-lonely-if */ + if (name === 'destinationRow' && endpoint.reversedRowCoords) { + endpoint[name] = this.hot.countRows() - settings[name] - 1; + } else { + endpoint[name] = settings[name]; + } + } } /** - * Get table data based on provided settings to the class constructor. + * Resets the endpoint setup before the structure alteration (like inserting or removing rows/columns). Used for settings provided as a function. * - * @returns {Array} + * @private + * @param {String} action Type of the action performed. + * @param {Number} index Row/column index. + * @param {Number} number Number of rows/columns added/removed. */ }, { - key: 'getData', - value: function getData() { - var _this = this; - - var _getDataRange2 = this._getDataRange(), - startRow = _getDataRange2.startRow, - startCol = _getDataRange2.startCol, - endRow = _getDataRange2.endRow, - endCol = _getDataRange2.endCol; - - var options = this.options; - var data = []; + key: 'resetSetupBeforeStructureAlteration', + value: function resetSetupBeforeStructureAlteration(action, index, number) { + if (this.settingsType !== 'function') { + return; + } - (0, _number.rangeEach)(startRow, endRow, function (rowIndex) { - var row = []; + var type = action.indexOf('row') > -1 ? 'row' : 'col'; + var endpoints = this.getAllEndpoints(); - if (!options.exportHiddenRows && _this._isHiddenRow(rowIndex)) { - return; - } - (0, _number.rangeEach)(startCol, endCol, function (colIndex) { - if (!options.exportHiddenColumns && _this._isHiddenColumn(colIndex)) { - return; + (0, _array.arrayEach)(endpoints, function (val) { + if (type === 'row' && val.destinationRow >= index) { + if (action === 'insert_row') { + val.alterRowOffset = number; + } else if (action === 'remove_row') { + val.alterRowOffset = -1 * number; } - row.push(_this.hot.getDataAtCell(rowIndex, colIndex)); - }); + } - data.push(row); + if (type === 'col' && val.destinationColumn >= index) { + if (action === 'insert_col') { + val.alterColumnOffset = number; + } else if (action === 'remove_col') { + val.alterColumnOffset = -1 * number; + } + } }); - return data; + this.resetAllEndpoints(endpoints, false); } /** - * Gets list of row headers. + * afterCreateRow/afterCreateRow/afterRemoveRow/afterRemoveCol hook callback. Reset and reenables the summary functionality + * after changing the table structure. * - * @return {Array} + * @private + * @param {String} action Type of the action performed. + * @param {Number} index Row/column index. + * @param {Number} number Number of rows/columns added/removed. + * @param {Array} [logicRows] Array of the logical indexes. + * @param {String} [source] Source of change. + * @param {Boolean} [forceRefresh] `true` of the endpoints should refresh after completing the function. */ }, { - key: 'getRowHeaders', - value: function getRowHeaders() { + key: 'resetSetupAfterStructureAlteration', + value: function resetSetupAfterStructureAlteration(action, index, number, logicRows, source) { var _this2 = this; - var headers = []; - - if (this.options.rowHeaders) { - var _getDataRange3 = this._getDataRange(), - startRow = _getDataRange3.startRow, - endRow = _getDataRange3.endRow; + var forceRefresh = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true; - var rowHeaders = this.hot.getRowHeader(); + if (this.settingsType === 'function') { - (0, _number.rangeEach)(startRow, endRow, function (row) { - if (!_this2.options.exportHiddenRows && _this2._isHiddenRow(row)) { - return; - } - headers.push(rowHeaders[row]); - }); + // We need to run it on a next avaiable hook, because the TrimRows' `afterCreateRow` hook triggers after this one, + // and it needs to be run to properly calculate the endpoint value. + var beforeRenderCallback = function beforeRenderCallback() { + _this2.hot.removeHook('beforeRender', beforeRenderCallback); + return _this2.refreshAllEndpoints(); + }; + this.hot.addHookOnce('beforeRender', beforeRenderCallback); + return; } - return headers; - } - - /** - * Gets list of columns headers. - * - * @return {Array} - */ - - }, { - key: 'getColumnHeaders', - value: function getColumnHeaders() { - var _this3 = this; + var type = action.indexOf('row') > -1 ? 'row' : 'col'; + var multiplier = action.indexOf('remove') > -1 ? -1 : 1; + var endpoints = this.getAllEndpoints(); + var rowMoving = action.indexOf('move_row') === 0; + var placeOfAlteration = index; - var headers = []; + (0, _array.arrayEach)(endpoints, function (val) { + if (type === 'row' && val.destinationRow >= placeOfAlteration) { + val.alterRowOffset = multiplier * number; + } - if (this.options.columnHeaders) { - var _getDataRange4 = this._getDataRange(), - startCol = _getDataRange4.startCol, - endCol = _getDataRange4.endCol; + if (type === 'col' && val.destinationColumn >= placeOfAlteration) { + val.alterColumnOffset = multiplier * number; + } + }); - var colHeaders = this.hot.getColHeader(); + this.resetAllEndpoints(endpoints, !rowMoving); - (0, _number.rangeEach)(startCol, endCol, function (column) { - if (!_this3.options.exportHiddenColumns && _this3._isHiddenColumn(column)) { - return; - } - headers.push(colHeaders[column]); + if (rowMoving) { + (0, _array.arrayEach)(endpoints, function (endpoint) { + _this2.extendEndpointRanges(endpoint, placeOfAlteration, logicRows[0], logicRows.length); + _this2.recreatePhysicalRanges(endpoint); + _this2.clearOffsetInformation(endpoint); + }); + } else { + (0, _array.arrayEach)(endpoints, function (endpoint) { + _this2.shiftEndpointCoordinates(endpoint, placeOfAlteration); }); } - return headers; + if (forceRefresh) { + this.refreshAllEndpoints(); + } } /** - * Get data range object based on settings provided in the class constructor. + * Clear the offset information from the endpoint object. * * @private - * @returns {Object} Returns object with keys `startRow`, `startCol`, `endRow` and `endCol`. + * @param {Object} endpoint And endpoint object. */ }, { - key: '_getDataRange', - value: function _getDataRange() { - var cols = this.hot.countCols() - 1; - var rows = this.hot.countRows() - 1; - - var _options$range = _slicedToArray(this.options.range, 4), - _options$range$ = _options$range[0], - startRow = _options$range$ === undefined ? 0 : _options$range$, - _options$range$2 = _options$range[1], - startCol = _options$range$2 === undefined ? 0 : _options$range$2, - _options$range$3 = _options$range[2], - endRow = _options$range$3 === undefined ? rows : _options$range$3, - _options$range$4 = _options$range[3], - endCol = _options$range$4 === undefined ? cols : _options$range$4; - - startRow = Math.max(startRow, 0); - startCol = Math.max(startCol, 0); - endRow = Math.min(endRow, rows); - endCol = Math.min(endCol, cols); - - return { startRow: startRow, startCol: startCol, endRow: endRow, endCol: endCol }; + key: 'clearOffsetInformation', + value: function clearOffsetInformation(endpoint) { + endpoint.alterRowOffset = void 0; + endpoint.alterColumnOffset = void 0; } /** - * Check if row at specified row index is hidden. + * Extend the row ranges for the provided endpoint. * * @private - * @param {Number} row Row index. - * @returns {Boolean} + * @param {Object} endpoint The endpoint object. + * @param {Number} placeOfAlteration Index of the row where the alteration takes place. + * @param {Number} previousPosition Previous endpoint result position. + * @param {Number} offset Offset generated by the alteration. */ }, { - key: '_isHiddenRow', - value: function _isHiddenRow(row) { - return this.hot.hasHook('hiddenRow') && this.hot.runHooks('hiddenRow', row); + key: 'extendEndpointRanges', + value: function extendEndpointRanges(endpoint, placeOfAlteration, previousPosition, offset) { + (0, _array.arrayEach)(endpoint.ranges, function (range) { + // is a range, not a single row + if (range[1]) { + + if (placeOfAlteration >= range[0] && placeOfAlteration <= range[1]) { + if (previousPosition > range[1]) { + range[1] += offset; + } else if (previousPosition < range[0]) { + range[0] -= offset; + } + } else if (previousPosition >= range[0] && previousPosition <= range[1]) { + range[1] -= offset; + + if (placeOfAlteration <= range[0]) { + range[0] += 1; + range[1] += 1; + } + } + } + }); } /** - * Check if column at specified column index is hidden. + * Recreate the physical ranges for the provided endpoint. Used (for example) when a row gets moved and extends an existing range. * * @private - * @param {Number} column Column index. - * @returns {Boolean} + * @param {Object} endpoint An endpoint object. */ }, { - key: '_isHiddenColumn', - value: function _isHiddenColumn(column) { - return this.hot.hasHook('hiddenColumn') && this.hot.runHooks('hiddenColumn', column); - } - }]); - - return DataProvider; -}(); - -exports.default = DataProvider; - -/***/ }), -/* 658 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.EXPORT_TYPES = exports.TYPE_PDF = exports.TYPE_EXCEL = exports.TYPE_CSV = undefined; -exports.default = typeFactory; - -var _csv = __webpack_require__(659); - -var _csv2 = _interopRequireDefault(_csv); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var TYPE_CSV = exports.TYPE_CSV = 'csv'; -var TYPE_EXCEL = exports.TYPE_EXCEL = 'excel'; // TODO -var TYPE_PDF = exports.TYPE_PDF = 'pdf'; // TODO + key: 'recreatePhysicalRanges', + value: function recreatePhysicalRanges(endpoint) { + var _this3 = this; -var EXPORT_TYPES = exports.EXPORT_TYPES = _defineProperty({}, TYPE_CSV, _csv2.default); + var ranges = endpoint.ranges; + var newRanges = []; + var allIndexes = []; -function typeFactory(type, dataProvider, options) { - if (typeof EXPORT_TYPES[type] === 'function') { - return new EXPORT_TYPES[type](dataProvider, options); - } + (0, _array.arrayEach)(ranges, function (range) { + var newRange = []; + if (range[1]) { + for (var i = range[0]; i <= range[1]; i++) { + newRange.push(_this3.recordTranslator.toPhysicalRow(i)); + } + } else { + newRange.push(_this3.recordTranslator.toPhysicalRow(range[0])); + } - return null; -} + allIndexes.push(newRange); + }); -/***/ }), -/* 659 */ -/***/ (function(module, exports, __webpack_require__) { + (0, _array.arrayEach)(allIndexes, function (range) { + var newRange = []; + (0, _array.arrayEach)(range, function (coord, index) { + if (index === 0) { + newRange.push(coord); + } else if (range[index] !== range[index - 1] + 1) { + newRange.push(range[index - 1]); + newRanges.push(newRange); + newRange = []; + newRange.push(coord); + } -"use strict"; + if (index === range.length - 1) { + newRange.push(coord); + newRanges.push(newRange); + } + }); + }); + endpoint.ranges = newRanges; + } -exports.__esModule = true; + /** + * Shifts the endpoint coordinates by the defined offset. + * + * @private + * @param {Object} endpoint Endpoint object. + * @param {Number} offsetStartIndex Index of the performed change (if the change is located after the endpoint, nothing about the endpoint has to be changed. + */ -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + }, { + key: 'shiftEndpointCoordinates', + value: function shiftEndpointCoordinates(endpoint, offsetStartIndex) { + if (endpoint.alterRowOffset && endpoint.alterRowOffset !== 0) { + endpoint.destinationRow += endpoint.alterRowOffset || 0; -var _array = __webpack_require__(0); + (0, _array.arrayEach)(endpoint.ranges, function (element) { + (0, _array.arrayEach)(element, function (subElement, j) { + if (subElement >= offsetStartIndex) { + element[j] += endpoint.alterRowOffset || 0; + } + }); + }); + } else if (endpoint.alterColumnOffset && endpoint.alterColumnOffset !== 0) { + endpoint.destinationColumn += endpoint.alterColumnOffset || 0; + endpoint.sourceColumn += endpoint.alterColumnOffset || 0; + } + } -var _mixed = __webpack_require__(8); + /** + * Resets (removes) the endpoints from the table. + * + * @param {Array} endpoints Array containing the endpoints. + * @param {Boolean} [useOffset=true] Use the cell offset value. + */ -var _base = __webpack_require__(660); + }, { + key: 'resetAllEndpoints', + value: function resetAllEndpoints(endpoints) { + var _this4 = this; -var _base2 = _interopRequireDefault(_base); + var useOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var endpointsArray = endpoints; + this.cellsToSetCache = []; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + if (!endpointsArray) { + endpointsArray = this.getAllEndpoints(); + } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + (0, _array.arrayEach)(endpointsArray, function (value) { + _this4.resetEndpointValue(value, useOffset); + }); -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + this.hot.setDataAtCell(this.cellsToSetCache, 'ColumnSummary.reset'); -var CHAR_CARRIAGE_RETURN = String.fromCharCode(13); -var CHAR_DOUBLE_QUOTES = String.fromCharCode(34); -var CHAR_LINE_FEED = String.fromCharCode(10); + this.cellsToSetCache = []; + } -/** - * @plugin ExportFile - * @private - */ + /** + * Calculate and refresh all defined endpoints. + */ -var Csv = function (_BaseType) { - _inherits(Csv, _BaseType); + }, { + key: 'refreshAllEndpoints', + value: function refreshAllEndpoints() { + var _this5 = this; - function Csv() { - _classCallCheck(this, Csv); + this.cellsToSetCache = []; - return _possibleConstructorReturn(this, (Csv.__proto__ || Object.getPrototypeOf(Csv)).apply(this, arguments)); - } + (0, _array.arrayEach)(this.getAllEndpoints(), function (value) { + _this5.currentEndpoint = value; + _this5.plugin.calculate(value); + _this5.setEndpointValue(value, 'init'); + }); + this.currentEndpoint = null; - _createClass(Csv, [{ - key: 'export', + this.hot.setDataAtCell(this.cellsToSetCache, 'ColumnSummary.reset'); + this.cellsToSetCache = []; + } /** - * Create string body in desired format. + * Calculate and refresh endpoints only in the changed columns. * - * @return {String} - */ - value: function _export() { - var _this2 = this; + * @param {Array} changes Array of changes from the `afterChange` hook. + */ - var options = this.options; - var data = this.dataProvider.getData(); - var columnHeaders = this.dataProvider.getColumnHeaders(); - var hasColumnHeaders = columnHeaders.length > 0; - var rowHeaders = this.dataProvider.getRowHeaders(); - var hasRowHeaders = rowHeaders.length > 0; - var result = options.bom ? String.fromCharCode(0xFEFF) : ''; + }, { + key: 'refreshChangedEndpoints', + value: function refreshChangedEndpoints(changes) { + var _this6 = this; - if (hasColumnHeaders) { - columnHeaders = (0, _array.arrayMap)(columnHeaders, function (value) { - return _this2._escapeCell(value, true); - }); + var needToRefresh = []; + this.cellsToSetCache = []; - if (hasRowHeaders) { - result += options.columnDelimiter; + (0, _array.arrayEach)(changes, function (value, key, changesObj) { + // if nothing changed, dont update anything + if ('' + (value[2] || '') === '' + value[3]) { + return; } - result += columnHeaders.join(options.columnDelimiter); - result += options.rowDelimiter; - } - (0, _array.arrayEach)(data, function (value, index) { - if (index > 0) { - result += options.rowDelimiter; - } - if (hasRowHeaders) { - result += _this2._escapeCell(rowHeaders[index]) + options.columnDelimiter; - } - result += value.map(function (cellValue) { - return _this2._escapeCell(cellValue); - }).join(options.columnDelimiter); + (0, _array.arrayEach)(_this6.getAllEndpoints(), function (endpoint, j) { + if (_this6.hot.propToCol(changesObj[key][1]) === endpoint.sourceColumn && needToRefresh.indexOf(j) === -1) { + needToRefresh.push(j); + } + }); }); - return result; + (0, _array.arrayEach)(needToRefresh, function (value) { + _this6.refreshEndpoint(_this6.getEndpoint(value)); + }); + + this.hot.setDataAtCell(this.cellsToSetCache, 'ColumnSummary.reset'); + this.cellsToSetCache = []; } /** - * Escape cell value. + * Calculate and refresh a single endpoint. * - * @param {*} value Cell value. - * @param {Boolean} [force=false] Indicates if cell value will be escaped forcefully. - * @return {String} + * @param {Object} endpoint Contains the endpoint information. */ }, { - key: '_escapeCell', - value: function _escapeCell(value) { - var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + key: 'refreshEndpoint', + value: function refreshEndpoint(endpoint) { + this.currentEndpoint = endpoint; + this.plugin.calculate(endpoint); + this.setEndpointValue(endpoint); + this.currentEndpoint = null; + } - var escapedValue = (0, _mixed.stringify)(value); + /** + * Reset the endpoint value. + * + * @param {Object} endpoint Contains the endpoint information. + * @param {Boolean} [useOffset=true] Use the cell offset value. + */ - if (escapedValue !== '' && (force || escapedValue.indexOf(CHAR_CARRIAGE_RETURN) >= 0 || escapedValue.indexOf(CHAR_DOUBLE_QUOTES) >= 0 || escapedValue.indexOf(CHAR_LINE_FEED) >= 0 || escapedValue.indexOf(this.options.columnDelimiter) >= 0)) { + }, { + key: 'resetEndpointValue', + value: function resetEndpointValue(endpoint) { + var useOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - escapedValue = escapedValue.replace(new RegExp('"', 'g'), '""'); - escapedValue = '"' + escapedValue + '"'; - } + var alterRowOffset = endpoint.alterRowOffset || 0; + var alterColOffset = endpoint.alterColumnOffset || 0; - return escapedValue; + var _recordTranslator$toV = this.recordTranslator.toVisual(endpoint.destinationRow, endpoint.destinationColumn), + _recordTranslator$toV2 = _slicedToArray(_recordTranslator$toV, 2), + visualRowIndex = _recordTranslator$toV2[0], + visualColumnIndex = _recordTranslator$toV2[1]; + + // Clear the meta on the "old" indexes + + + var cellMeta = this.hot.getCellMeta(visualRowIndex, visualColumnIndex); + cellMeta.readOnly = false; + cellMeta.className = ''; + + this.cellsToSetCache.push([this.recordTranslator.toVisualRow(endpoint.destinationRow + (useOffset ? alterRowOffset : 0)), this.recordTranslator.toVisualColumn(endpoint.destinationColumn + (useOffset ? alterColOffset : 0)), '']); } - }], [{ - key: 'DEFAULT_OPTIONS', /** - * Default options for exporting CSV format. + * Set the endpoint value. * - * @returns {Object} + * @param {Object} endpoint Contains the endpoint information. + * @param {String} [source] Source of the call information. + * @param {Boolean} [render=false] `true` if it needs to render the table afterwards. */ - get: function get() { - return { - mimeType: 'text/csv', - fileExtension: 'csv', - bom: true, - columnDelimiter: ',', - rowDelimiter: '\r\n' - }; - } - }]); - - return Csv; -}(_base2.default); - -exports.default = Csv; - -/***/ }), -/* 660 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; + }, { + key: 'setEndpointValue', + value: function setEndpointValue(endpoint, source) { + var render = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + // We'll need the reversed offset values, because cellMeta will be shifted AGAIN afterwards. + var reverseRowOffset = -1 * endpoint.alterRowOffset || 0; + var reverseColOffset = -1 * endpoint.alterColumnOffset || 0; + var visualEndpointRowIndex = this.getVisualRowIndex(endpoint.destinationRow); -exports.__esModule = true; + var cellMeta = this.hot.getCellMeta(this.getVisualRowIndex(endpoint.destinationRow + reverseRowOffset), endpoint.destinationColumn + reverseColOffset); -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + if (visualEndpointRowIndex > this.hot.countRows() || endpoint.destinationColumn > this.hot.countCols()) { + this.throwOutOfBoundsWarning(); + return; + } -var _object = __webpack_require__(1); + if (source === 'init' || cellMeta.readOnly !== endpoint.readOnly) { + cellMeta.readOnly = endpoint.readOnly; + cellMeta.className = 'columnSummaryResult'; + } -var _string = __webpack_require__(32); + if (endpoint.roundFloat && !isNaN(endpoint.result)) { + endpoint.result = endpoint.result.toFixed(endpoint.roundFloat); + } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + if (render) { + this.hot.setDataAtCell(visualEndpointRowIndex, endpoint.destinationColumn, endpoint.result, 'ColumnSummary.set'); + } else { + this.cellsToSetCache.push([visualEndpointRowIndex, endpoint.destinationColumn, endpoint.result]); + } -/** - * @plugin ExportFile - * @private - */ -var BaseType = function () { - _createClass(BaseType, null, [{ - key: 'DEFAULT_OPTIONS', + endpoint.alterRowOffset = void 0; + endpoint.alterColumnOffset = void 0; + } /** - * Default options. + * Get the visual row index for the provided row. Uses the `umodifyRow` hook. * - * @returns {Object} + * @private + * @param {Number} row Row index. + * @returns {Number} */ - get: function get() { - return { - mimeType: 'text/plain', - fileExtension: 'txt', - filename: 'Handsontable [YYYY]-[MM]-[DD]', - encoding: 'utf-8', - bom: false, - columnHeaders: false, - rowHeaders: false, - exportHiddenColumns: false, - exportHiddenRows: false, - range: [] - }; - } - }]); - function BaseType(dataProvider, options) { - _classCallCheck(this, BaseType); + }, { + key: 'getVisualRowIndex', + value: function getVisualRowIndex(row) { + return this.hot.runHooks('unmodifyRow', row, 'columnSummary'); + } /** - * Data provider. + * Get the visual column index for the provided column. Uses the `umodifyColumn` hook. * - * @type {DataProvider} + * @private + * @param {Number} column Column index. + * @returns {Number} */ - this.dataProvider = dataProvider; + + }, { + key: 'getVisualColumnIndex', + value: function getVisualColumnIndex(column) { + return this.hot.runHooks('unmodifyCol', column, 'columnSummary'); + } + /** - * Format type class options. + * Throw an error for the calculation range being out of boundaries. * - * @type {Object} + * @private */ - this.options = this._mergeOptions(options); - - this.dataProvider.setOptions(this.options); - } - - /** - * Merge options provided by users with defaults. - * - * @return {Object} Returns new options object. - */ - - _createClass(BaseType, [{ - key: '_mergeOptions', - value: function _mergeOptions(options) { - var _options = (0, _object.clone)(this.constructor.DEFAULT_OPTIONS); - var date = new Date(); - - _options = (0, _object.extend)((0, _object.clone)(BaseType.DEFAULT_OPTIONS), _options); - _options = (0, _object.extend)(_options, options); - - _options.filename = (0, _string.substitute)(_options.filename, { - YYYY: date.getFullYear(), - MM: ('' + (date.getMonth() + 1)).padStart(2, '0'), - DD: ('' + date.getDate()).padStart(2, '0') - }); - - return _options; + }, { + key: 'throwOutOfBoundsWarning', + value: function throwOutOfBoundsWarning() { + (0, _console.warn)('One of the Column Summary plugins\' destination points you provided is beyond the table boundaries!'); } }]); - return BaseType; + return Endpoints; }(); -exports.default = BaseType; +exports.default = Endpoints; /***/ }), -/* 661 */ +/* 655 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -95540,247 +94086,252 @@ exports.default = BaseType; exports.__esModule = true; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _element = __webpack_require__(2); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _mixed = __webpack_require__(8); +var _base = __webpack_require__(7); -var _object = __webpack_require__(1); +var _base2 = _interopRequireDefault(_base); var _array = __webpack_require__(0); -var _number = __webpack_require__(4); - -var _base = __webpack_require__(6); +var _commandExecutor2 = __webpack_require__(466); -var _base2 = _interopRequireDefault(_base); +var _commandExecutor3 = _interopRequireDefault(_commandExecutor2); -var _plugins = __webpack_require__(5); +var _eventManager = __webpack_require__(8); -var _mergeSort = __webpack_require__(464); +var _eventManager2 = _interopRequireDefault(_eventManager); -var _mergeSort2 = _interopRequireDefault(_mergeSort); +var _element = __webpack_require__(2); -var _pluginHooks = __webpack_require__(17); +var _itemsFactory = __webpack_require__(467); -var _pluginHooks2 = _interopRequireDefault(_pluginHooks); +var _itemsFactory2 = _interopRequireDefault(_itemsFactory); -var _keyStateObserver = __webpack_require__(85); +var _menu = __webpack_require__(162); -var _comparatorEngine = __webpack_require__(88); +var _menu2 = _interopRequireDefault(_menu); -var _columnStatesManager = __webpack_require__(665); +var _plugins = __webpack_require__(5); -var _utils = __webpack_require__(471); +var _pluginHooks = __webpack_require__(17); -var _domHelper = __webpack_require__(666); +var _pluginHooks2 = _interopRequireDefault(_pluginHooks); -var _rowsMapper = __webpack_require__(667); +var _event = __webpack_require__(12); -var _rowsMapper2 = _interopRequireDefault(_rowsMapper); +var _predefinedItems = __webpack_require__(45); -__webpack_require__(668); +__webpack_require__(656); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -_pluginHooks2.default.getSingleton().register('beforeColumnSort'); -_pluginHooks2.default.getSingleton().register('afterColumnSort'); +_pluginHooks2.default.getSingleton().register('afterDropdownMenuDefaultOptions'); +_pluginHooks2.default.getSingleton().register('beforeDropdownMenuShow'); +_pluginHooks2.default.getSingleton().register('afterDropdownMenuShow'); +_pluginHooks2.default.getSingleton().register('afterDropdownMenuHide'); +_pluginHooks2.default.getSingleton().register('afterDropdownMenuExecute'); -var APPEND_COLUMN_CONFIG_STRATEGY = 'append'; -var REPLACE_COLUMN_CONFIG_STRATEGY = 'replace'; +var BUTTON_CLASS_NAME = 'changeType'; /** - * @plugin MultiColumnSorting + * @plugin DropdownMenu * @pro + * @dependencies ContextMenu * * @description - * This plugin sorts the view by columns (but does not sort the data source!). To enable the plugin, set the - * {@link Options#multiColumnSorting} property to the correct value (see the examples below). - * - * @example - * ```js - * // as boolean - * multiColumnSorting: true + * This plugin creates the Handsontable Dropdown Menu. It allows to create a new row or column at any place in the grid + * among [other features](http://docs.handsontable.com/demo-context-menu.html). + * Possible values: + * * `true` (to enable default options), + * * `false` (to disable completely) * - * // as an object with initial sort config (sort ascending for column at index 1 and then sort descending for column at index 0) - * multiColumnSorting: { - * initialConfig: [{ - * column: 1, - * sortOrder: 'asc' - * }, { - * column: 0, - * sortOrder: 'desc' - * }] - * } + * or array of any available strings: + * * `["row_above", "row_below", "col_left", "col_right", + * "remove_row", "remove_col", "---------", "undo", "redo"]`. * - * // as an object which define specific sorting options for all columns - * multiColumnSorting: { - * sortEmptyCells: true, // true = the table sorts empty cells, false = the table moves all empty cells to the end of the table (by default) - * indicator: true, // true = shows indicator for all columns (by default), false = don't show indicator for columns - * headerAction: true, // true = allow to click on the headers to sort (by default), false = turn off possibility to click on the headers to sort - * compareFunctionFactory: function(sortOrder, columnMeta) { - * return function(value, nextValue) { - * // Some value comparisons which will return -1, 0 or 1... - * } - * } - * } + * See [the dropdown menu demo](http://docs.handsontable.com/demo-dropdown-menu.html) for examples. * - * // as an object passed to the `column` property, allows specifying a custom options for the desired column. - * // please take a look at documentation of `column` property: https://docs.handsontable.com/pro/Options.html#columns - * columns: [{ - * multiColumnSorting: { - * indicator: false, // disable indicator for the first column, - * sortEmptyCells: true, - * headerAction: false, // clicks on the first column won't sort - * compareFunctionFactory: function(sortOrder, columnMeta) { - * return function(value, nextValue) { - * return 0; // Custom compare function for the first column (don't sort) - * } - * } - * } - * }]``` + * @example + * ``` + * const container = document.getElementById('example'); + * const hot = new Handsontable(container, { + * data: data, + * colHeaders: true, + * // enable dropdown menu + * dropdownMenu: true + * }); * - * @dependencies ObserveChanges moment + * // or + * const hot = new Handsontable(container, { + * data: data, + * colHeaders: true, + * // enable and configure dropdown menu + * dropdownMenu: ['remove_col', '---------', 'make_read_only', 'alignment'] + * }); + * ``` */ -var MultiColumnSorting = function (_BasePlugin) { - _inherits(MultiColumnSorting, _BasePlugin); +var DropdownMenu = function (_BasePlugin) { + _inherits(DropdownMenu, _BasePlugin); - function MultiColumnSorting(hotInstance) { - _classCallCheck(this, MultiColumnSorting); + _createClass(DropdownMenu, null, [{ + key: 'DEFAULT_ITEMS', /** - * Instance of column state manager. + * Default menu items order when `dropdownMenu` is enabled by setting the config item to `true`. * - * @private - * @type {ColumnStatesManager} + * @returns {Array} */ - var _this2 = _possibleConstructorReturn(this, (MultiColumnSorting.__proto__ || Object.getPrototypeOf(MultiColumnSorting)).call(this, hotInstance)); + get: function get() { + return [_predefinedItems.COLUMN_LEFT, _predefinedItems.COLUMN_RIGHT, _predefinedItems.SEPARATOR, _predefinedItems.REMOVE_COLUMN, _predefinedItems.SEPARATOR, _predefinedItems.CLEAR_COLUMN, _predefinedItems.SEPARATOR, _predefinedItems.READ_ONLY, _predefinedItems.SEPARATOR, _predefinedItems.ALIGNMENT]; + } + }]); + + function DropdownMenu(hotInstance) { + _classCallCheck(this, DropdownMenu); - _this2.columnStatesManager = new _columnStatesManager.ColumnStatesManager(); /** - * Instance of DOM helper. + * Instance of {@link EventManager}. * * @private - * @type {DomHelper} + * @type {EventManager} */ - _this2.domHelper = new _domHelper.DomHelper(_this2.columnStatesManager); + var _this = _possibleConstructorReturn(this, (DropdownMenu.__proto__ || Object.getPrototypeOf(DropdownMenu)).call(this, hotInstance)); + + _this.eventManager = new _eventManager2.default(_this); /** - * Object containing visual row indexes mapped to data source indexes. + * Instance of {@link CommandExecutor}. * * @private - * @type {RowsMapper} + * @type {CommandExecutor} */ - _this2.rowsMapper = new _rowsMapper2.default(_this2); + _this.commandExecutor = new _commandExecutor3.default(_this.hot); /** - * It blocks the plugin translation, this flag is checked inside `onModifyRow` callback. + * Instance of {@link ItemsFactory}. * * @private - * @type {Boolean} + * @type {ItemsFactory} */ - _this2.blockPluginTranslation = true; + _this.itemsFactory = null; /** - * Cached column properties from plugin like i.e. `indicator`, `headerAction`. + * Instance of {@link Menu}. * * @private - * @type {Map} + * @type {Menu} */ - _this2.columnMetaCache = new Map(); - return _this2; + _this.menu = null; + + // One listener for enable/disable functionality + _this.hot.addHook('afterGetColHeader', function (col, TH) { + return _this.onAfterGetColHeader(col, TH); + }); + return _this; } - /** - * Checks if the plugin is enabled in the Handsontable settings. This method is executed in {@link Hooks#beforeInit} - * hook and if it returns `true` than the {@link MultiColumnSorting#enablePlugin} method is called. - * - * @returns {Boolean} - */ + /** + * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit} + * hook and if it returns `true` than the {@link DropdownMenu#enablePlugin} method is called. + * + * @returns {Boolean} + */ + + + _createClass(DropdownMenu, [{ + key: 'isEnabled', + value: function isEnabled() { + return this.hot.getSettings().dropdownMenu; + } + + /** + * Enables the plugin functionality for this Handsontable instance. + * + * @fires Hooks#afterDropdownMenuDefaultOptions + * @fires Hooks#beforeDropdownMenuSetItems + */ + + }, { + key: 'enablePlugin', + value: function enablePlugin() { + var _this2 = this; + + if (this.enabled) { + return; + } + this.itemsFactory = new _itemsFactory2.default(this.hot, DropdownMenu.DEFAULT_ITEMS); + + var settings = this.hot.getSettings().dropdownMenu; + var predefinedItems = { + items: this.itemsFactory.getItems(settings) + }; + this.registerEvents(); + + if (typeof settings.callback === 'function') { + this.commandExecutor.setCommonCallback(settings.callback); + } + _get(DropdownMenu.prototype.__proto__ || Object.getPrototypeOf(DropdownMenu.prototype), 'enablePlugin', this).call(this); + + this.callOnPluginsReady(function () { + _this2.hot.runHooks('afterDropdownMenuDefaultOptions', predefinedItems); + + _this2.itemsFactory.setPredefinedItems(predefinedItems.items); + var menuItems = _this2.itemsFactory.getItems(settings); + + if (_this2.menu) { + _this2.menu.destroy(); + } + _this2.menu = new _menu2.default(_this2.hot, { + className: 'htDropdownMenu', + keepInViewport: true + }); + _this2.hot.runHooks('beforeDropdownMenuSetItems', menuItems); + + _this2.menu.setMenuItems(menuItems); + + _this2.menu.addLocalHook('beforeOpen', function () { + return _this2.onMenuBeforeOpen(); + }); + _this2.menu.addLocalHook('afterOpen', function () { + return _this2.onMenuAfterOpen(); + }); + _this2.menu.addLocalHook('afterClose', function () { + return _this2.onMenuAfterClose(); + }); + _this2.menu.addLocalHook('executeCommand', function () { + var _executeCommand; + + for (var _len = arguments.length, params = Array(_len), _key = 0; _key < _len; _key++) { + params[_key] = arguments[_key]; + } + return (_executeCommand = _this2.executeCommand).call.apply(_executeCommand, [_this2].concat(params)); + }); - _createClass(MultiColumnSorting, [{ - key: 'isEnabled', - value: function isEnabled() { - return !!this.hot.getSettings().multiColumnSorting; + // Register all commands. Predefined and added by user or by plugins + (0, _array.arrayEach)(menuItems, function (command) { + return _this2.commandExecutor.registerCommand(command.key, command); + }); + }); } /** - * Enables the plugin functionality for this Handsontable instance. + * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { - key: 'enablePlugin', - value: function enablePlugin() { - var _this3 = this; - - if (this.enabled) { - return; - } - - (0, _utils.warnIfPluginsHaveConflict)(this.hot.getSettings().columnSorting); - - if ((0, _mixed.isUndefined)(this.hot.getSettings().observeChanges)) { - this.enableObserveChangesPlugin(); - } - - this.addHook('afterTrimRow', function () { - return _this3.sortByPresetSortStates(); - }); - this.addHook('afterUntrimRow', function () { - return _this3.sortByPresetSortStates(); - }); - this.addHook('modifyRow', function (row, source) { - return _this3.onModifyRow(row, source); - }); - this.addHook('unmodifyRow', function (row, source) { - return _this3.onUnmodifyRow(row, source); - }); - this.addHook('afterGetColHeader', function (column, TH) { - return _this3.onAfterGetColHeader(column, TH); - }); - this.addHook('beforeOnCellMouseDown', function (event, coords, TD, controller) { - return _this3.onBeforeOnCellMouseDown(event, coords, TD, controller); - }); - this.addHook('afterOnCellMouseDown', function (event, target) { - return _this3.onAfterOnCellMouseDown(event, target); - }); - this.addHook('afterCreateRow', function (index, amount) { - return _this3.onAfterCreateRow(index, amount); - }); - this.addHook('afterRemoveRow', function (index, amount) { - return _this3.onAfterRemoveRow(index, amount); - }); - this.addHook('afterInit', function () { - return _this3.loadOrSortBySettings(); - }); - this.addHook('afterLoadData', function (initialLoad) { - return _this3.onAfterLoadData(initialLoad); - }); - this.addHook('afterCreateCol', function () { - return _this3.onAfterCreateCol(); - }); - this.addHook('afterRemoveCol', function () { - return _this3.onAfterRemoveCol(); - }); - - // TODO: Workaround? It should be refactored / described. - if (this.hot.view) { - this.loadOrSortBySettings(); - } - - _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'enablePlugin', this).call(this); + key: 'updatePlugin', + value: function updatePlugin() { + this.disablePlugin(); + this.enablePlugin(); + _get(DropdownMenu.prototype.__proto__ || Object.getPrototypeOf(DropdownMenu.prototype), 'updatePlugin', this).call(this); } /** @@ -95790,1517 +94341,1483 @@ var MultiColumnSorting = function (_BasePlugin) { }, { key: 'disablePlugin', value: function disablePlugin() { - var _this4 = this; + this.close(); - var clearColHeader = function clearColHeader(column, TH) { - var headerSpanElement = (0, _utils.getHeaderSpanElement)(TH); + if (this.menu) { + this.menu.destroy(); + } + _get(DropdownMenu.prototype.__proto__ || Object.getPrototypeOf(DropdownMenu.prototype), 'disablePlugin', this).call(this); + } - if ((0, _utils.isFirstLevelColumnHeader)(column, TH) === false || headerSpanElement === null) { - return; - } + /** + * Registers the DOM listeners. + * + * @private + */ - (0, _element.removeClass)(headerSpanElement, _this4.domHelper.getRemovedClasses(headerSpanElement)); - }; + }, { + key: 'registerEvents', + value: function registerEvents() { + var _this3 = this; - // Changing header width and removing indicator. - this.hot.addHook('afterGetColHeader', clearColHeader); - this.hot.addHookOnce('afterRender', function () { - _this4.hot.removeHook('afterGetColHeader', clearColHeader); + this.eventManager.addEventListener(this.hot.rootElement, 'click', function (event) { + return _this3.onTableClick(event); }); - - this.rowsMapper.clearMap(); - - _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'disablePlugin', this).call(this); } /** - * Sorts the table by chosen columns and orders. - * - * @param {undefined|Object|Array} sortConfig Single column sort configuration or full sort configuration (for all sorted columns). - * The configuration object contains `column` and `sortOrder` properties. First of them contains visual column index, the second one contains - * sort order (`asc` for ascending, `desc` for descending). - * - * **Note**: Please keep in mind that every call of `sort` function set an entirely new sort order. Previous sort configs aren't preserved. - * - * @example - * ```js - * // sort ascending first visual column - * hot.getPlugin('multiColumnSorting').sort({ column: 0, sortOrder: 'asc' }); - * - * // sort first two visual column in the defined sequence - * hot.getPlugin('multiColumnSorting').sort([{ - * column: 1, sortOrder: 'asc' - * }, { - * column: 0, sortOrder: 'desc' - * }]); - * ``` + * Opens menu and re-position it based on the passed coordinates. * - * @fires Hooks#beforeColumnSort - * @fires Hooks#afterColumnSort + * @param {Object|Event} position An object with `pageX` and `pageY` properties which contains values relative to + * the top left of the fully rendered content area in the browser or with `clientX` + * and `clientY` properties which contains values relative to the upper left edge + * of the content area (the viewport) of the browser window. This object is structurally + * compatible with native mouse event so it can be used either. + * @fires Hooks#beforeDropdownMenuShow + * @fires Hooks#afterDropdownMenuShow */ }, { - key: 'sort', - value: function sort(sortConfig) { - var _this5 = this; - - var currentSortConfig = this.getSortConfig(); + key: 'open', + value: function open(position) { + if (!this.menu) { + return; + } + this.menu.open(); - // We always pass to hook configs defined as an array to `beforeColumnSort` and `afterColumnSort` hooks. - var destinationSortConfigs = (0, _utils.getFullSortConfiguration)(sortConfig); + if (position.width) { + this.menu.setOffset('left', position.width); + } + this.menu.setPosition(position); - var sortPossible = this.areValidSortConfigs(destinationSortConfigs); - var allowSort = this.hot.runHooks('beforeColumnSort', currentSortConfig, destinationSortConfigs, sortPossible); + // ContextMenu is not detected HotTableEnv correctly because is injected outside hot-table + this.menu.hotMenu.isHotTableEnv = this.hot.isHotTableEnv; + // Handsontable.eventManager.isHotTableEnv = this.hot.isHotTableEnv; + } - if (sortPossible === false) { - (0, _utils.warnAboutNotValidatedConfig)(); - } + /** + * Closes dropdown menu. + */ - if (allowSort === false) { + }, { + key: 'close', + value: function close() { + if (!this.menu) { return; } + this.menu.close(); + } - if (sortPossible) { - var translateColumnToPhysical = function translateColumnToPhysical(_ref) { - var visualColumn = _ref.column, - restOfProperties = _objectWithoutProperties(_ref, ['column']); - - return Object.assign({ column: _this5.hot.toPhysicalColumn(visualColumn) }, restOfProperties); - }; - var internalSortStates = (0, _array.arrayMap)(destinationSortConfigs, function (columnSortConfig) { - return translateColumnToPhysical(columnSortConfig); - }); + /** + * Executes context menu command. + * + * You can execute all predefined commands: + * * `'row_above'` - Insert row above + * * `'row_below'` - Insert row below + * * `'col_left'` - Insert column left + * * `'col_right'` - Insert column right + * * `'clear_column'` - Clear selected column + * * `'remove_row'` - Remove row + * * `'remove_col'` - Remove column + * * `'undo'` - Undo last action + * * `'redo'` - Redo last action + * * `'make_read_only'` - Make cell read only + * * `'alignment:left'` - Alignment to the left + * * `'alignment:top'` - Alignment to the top + * * `'alignment:right'` - Alignment to the right + * * `'alignment:bottom'` - Alignment to the bottom + * * `'alignment:middle'` - Alignment to the middle + * * `'alignment:center'` - Alignment to the center (justify) + * + * Or you can execute command registered in settings where `key` is your command name. + * + * @param {String} commandName Command name to execute. + * @param {*} params + */ - this.columnStatesManager.setSortStates(internalSortStates); - this.sortByPresetSortStates(); - this.saveAllSortSettings(); + }, { + key: 'executeCommand', + value: function executeCommand(commandName) { + var _commandExecutor; - this.hot.render(); - this.hot.view.wt.draw(true); // TODO: Workaround? One test won't pass after removal. It should be refactored / described. + for (var _len2 = arguments.length, params = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + params[_key2 - 1] = arguments[_key2]; } - this.hot.runHooks('afterColumnSort', currentSortConfig, this.getSortConfig(), sortPossible); + (_commandExecutor = this.commandExecutor).execute.apply(_commandExecutor, [commandName].concat(params)); } /** - * Clear the sort performed on the table. + * Turns on / off listening on dropdown menu + * + * @private + * @param {Boolean} listen Turn on listening when value is set to true, otherwise turn it off. */ }, { - key: 'clearSort', - value: function clearSort() { - this.sort([]); + key: 'setListening', + value: function setListening() { + var listen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + if (this.menu.isOpened()) { + if (listen) { + this.menu.hotMenu.listen(); + } else { + this.menu.hotMenu.unlisten(); + } + } } /** - * Checks if the table is sorted (any column have to be sorted). + * Table click listener. * - * @returns {Boolean} + * @private + * @param {Event} event */ }, { - key: 'isSorted', - value: function isSorted() { - return this.enabled && !this.columnStatesManager.isListOfSortedColumnsEmpty(); + key: 'onTableClick', + value: function onTableClick(event) { + (0, _event.stopPropagation)(event); + + if ((0, _element.hasClass)(event.target, BUTTON_CLASS_NAME) && !this.menu.isOpened()) { + var rect = event.target.getBoundingClientRect(); + + this.open({ + left: rect.left, + top: rect.top + event.target.offsetHeight + 3, + width: rect.width, + height: rect.height + }); + } } /** - * Get sort configuration for particular column or for all sorted columns. Objects contain `column` and `sortOrder` properties. - * - * **Note**: Please keep in mind that returned objects expose **visual** column index under the `column` key. They are handled by the `sort` function. + * On after get column header listener. * - * @param {Number} [column] Visual column index. - * @returns {undefined|Object|Array} + * @private + * @param {Number} col + * @param {HTMLTableCellElement} TH */ }, { - key: 'getSortConfig', - value: function getSortConfig(column) { - var _this6 = this; + key: 'onAfterGetColHeader', + value: function onAfterGetColHeader(col, TH) { + // Corner or a higher-level header + var headerRow = TH.parentNode; + if (!headerRow) { + return; + } - var translateColumnToVisual = function translateColumnToVisual(_ref2) { - var physicalColumn = _ref2.column, - restOfProperties = _objectWithoutProperties(_ref2, ['column']); + var headerRowList = headerRow.parentNode.childNodes; + var level = Array.prototype.indexOf.call(headerRowList, headerRow); - return Object.assign({ column: _this6.hot.toVisualColumn(physicalColumn) }, restOfProperties); - }; + if (col < 0 || level !== headerRowList.length - 1) { + return; + } - if ((0, _mixed.isDefined)(column)) { - var physicalColumn = this.hot.toPhysicalColumn(column); - var columnSortState = this.columnStatesManager.getColumnSortState(physicalColumn); + var existingButton = TH.querySelector('.' + BUTTON_CLASS_NAME); - if ((0, _mixed.isDefined)(columnSortState)) { - return translateColumnToVisual(columnSortState); + // Plugin enabled and buttons already exists, return. + if (this.enabled && existingButton) { + return; + } + // Plugin disabled and buttons still exists, so remove them. + if (!this.enabled) { + if (existingButton) { + existingButton.parentNode.removeChild(existingButton); } return; } + var button = document.createElement('button'); - var sortStates = this.columnStatesManager.getSortStates(); + button.className = BUTTON_CLASS_NAME; - return (0, _array.arrayMap)(sortStates, function (columnState) { - return translateColumnToVisual(columnState); - }); + // prevent page reload on button click + button.onclick = function () { + return false; + }; + + TH.firstChild.insertBefore(button, TH.firstChild.firstChild); } /** - * @description - * Warn: Useful mainly for providing server side sort implementation (see in the example below). It doesn't sort the data set. It just sets sort configuration for all sorted columns. - * - * @example - * ```js - * beforeColumnSort: function(currentSortConfig, destinationSortConfigs) { - * const columnSortPlugin = this.getPlugin('multiColumnSorting'); - * - * columnSortPlugin.setSortConfig(destinationSortConfigs); - * - * // const newData = ... // Calculated data set, ie. from an AJAX call. - * - * // this.loadData(newData); // Load new data set. - * - * return false; // The blockade for the default sort action. - * }``` + * On menu before open listener. * - * @param {undefined|Object|Array} sortConfig Single column sort configuration or full sort configuration (for all sorted columns). - * The configuration object contains `column` and `sortOrder` properties. First of them contains visual column index, the second one contains - * sort order (`asc` for ascending, `desc` for descending). + * @private + * @fires Hooks#beforeDropdownMenuShow */ }, { - key: 'setSortConfig', - value: function setSortConfig(sortConfig) { - var _this7 = this; - - var destinationSortConfigs = (0, _utils.getFullSortConfiguration)(sortConfig); - - if (this.areValidSortConfigs(destinationSortConfigs)) { - var translateColumnToPhysical = function translateColumnToPhysical(_ref3) { - var visualColumn = _ref3.column, - restOfProperties = _objectWithoutProperties(_ref3, ['column']); - - return Object.assign({ column: _this7.hot.toPhysicalColumn(visualColumn) }, restOfProperties); - }; - var internalSortStates = (0, _array.arrayMap)(destinationSortConfigs, function (columnSortConfig) { - return translateColumnToPhysical(columnSortConfig); - }); - - this.columnStatesManager.setSortStates(internalSortStates); - } else { - (0, _utils.warnAboutNotValidatedConfig)(); - } + key: 'onMenuBeforeOpen', + value: function onMenuBeforeOpen() { + this.hot.runHooks('beforeDropdownMenuShow', this); } /** - * Get if sort configs are valid. + * On menu after open listener. * * @private - * @param {Array} sortConfigs Sort configuration for all sorted columns. Objects contain `column` and `sortOrder` properties. - * @returns {Boolean} + * @fires Hooks#afterDropdownMenuShow */ }, { - key: 'areValidSortConfigs', - value: function areValidSortConfigs(sortConfigs) { - if (Array.isArray(sortConfigs) === false) { - return false; - } - - var sortedColumns = sortConfigs.map(function (_ref4) { - var column = _ref4.column; - return column; - }); - var numberOfColumns = this.hot.countCols(); - var onlyExistingVisualIndexes = sortedColumns.every(function (visualColumn) { - return visualColumn <= numberOfColumns && visualColumn >= 0; - }); - - return (0, _utils.areValidSortStates)(sortConfigs) && onlyExistingVisualIndexes; // We don't translate visual indexes to physical indexes. + key: 'onMenuAfterOpen', + value: function onMenuAfterOpen() { + this.hot.runHooks('afterDropdownMenuShow', this); } /** - * Saves all sorting settings. Saving works only when {@link Options#persistentState} option is enabled. + * On menu after close listener. * * @private - * @fires Hooks#persistentStateSave + * @fires Hooks#afterDropdownMenuHide */ }, { - key: 'saveAllSortSettings', - value: function saveAllSortSettings() { - var allSortSettings = this.columnStatesManager.getAllColumnsProperties(); - - allSortSettings.initialConfig = this.columnStatesManager.getSortStates(); - - this.hot.runHooks('persistentStateSave', 'multiColumnSorting', allSortSettings); + key: 'onMenuAfterClose', + value: function onMenuAfterClose() { + this.hot.listen(); + this.hot.runHooks('afterDropdownMenuHide', this); } /** - * Get all saved sorting settings. Loading works only when {@link Options#persistentState} option is enabled. - * - * @private - * @returns {Object} Previously saved sort settings. - * - * @fires Hooks#persistentStateLoad + * Destroys the plugin instance. */ }, { - key: 'getAllSavedSortSettings', - value: function getAllSavedSortSettings() { - var _this8 = this; + key: 'destroy', + value: function destroy() { + this.close(); - var storedAllSortSettings = {}; + if (this.menu) { + this.menu.destroy(); + } + _get(DropdownMenu.prototype.__proto__ || Object.getPrototypeOf(DropdownMenu.prototype), 'destroy', this).call(this); + } + }]); - this.hot.runHooks('persistentStateLoad', 'multiColumnSorting', storedAllSortSettings); + return DropdownMenu; +}(_base2.default); - var allSortSettings = storedAllSortSettings.value; - var translateColumnToVisual = function translateColumnToVisual(_ref5) { - var physicalColumn = _ref5.column, - restOfProperties = _objectWithoutProperties(_ref5, ['column']); +DropdownMenu.SEPARATOR = { + name: _predefinedItems.SEPARATOR +}; + +(0, _plugins.registerPlugin)('dropdownMenu', DropdownMenu); + +exports.default = DropdownMenu; + +/***/ }), +/* 656 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 657 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _base = __webpack_require__(7); + +var _base2 = _interopRequireDefault(_base); + +var _plugins = __webpack_require__(5); + +var _dataProvider = __webpack_require__(658); + +var _dataProvider2 = _interopRequireDefault(_dataProvider); + +var _typeFactory = __webpack_require__(659); + +var _typeFactory2 = _interopRequireDefault(_typeFactory); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @plugin ExportFile + * @pro + * + * @description + * The plugin enables exporting table data to file. It allows to export data as a string, blob or a downloadable file in + * CSV format. + * + * See [the export file demo](https://docs.handsontable.com/demo-export-file.html) for examples. + * + * @example + * ```js + * const container = document.getElementById('example'); + * const hot = new Handsontable(container, { + * data: getData() + * }); + * + * // access to exportFile plugin instance + * const exportPlugin = hot.getPlugin('exportFile'); + * + * // export as a string + * exportPlugin.exportAsString('csv'); + * + * // export as a blob object + * exportPlugin.exportAsBlob('csv'); + * + * // export to downloadable file (named: MyFile.csv) + * exportPlugin.downloadFile('csv', {filename: 'MyFile'}); + * + * // export as a string (with specified data range): + * exportPlugin.exportAsString('csv', { + * exportHiddenRows: true, // default false + * exportHiddenColumns: true, // default false + * columnHeaders: true, // default false + * rowHeaders: true, // default false + * columnDelimiter: ';', // default ',' + * range: [1, 1, 6, 6] // [startRow, endRow, startColumn, endColumn] + * }); + * ``` + */ +var ExportFile = function (_BasePlugin) { + _inherits(ExportFile, _BasePlugin); - return Object.assign({ column: _this8.hot.toVisualColumn(physicalColumn) }, restOfProperties); - }; + function ExportFile() { + _classCallCheck(this, ExportFile); - if ((0, _mixed.isDefined)(allSortSettings) && Array.isArray(allSortSettings.initialConfig)) { - allSortSettings.initialConfig = (0, _array.arrayMap)(allSortSettings.initialConfig, translateColumnToVisual); - } + return _possibleConstructorReturn(this, (ExportFile.__proto__ || Object.getPrototypeOf(ExportFile)).apply(this, arguments)); + } - return allSortSettings; - } + _createClass(ExportFile, [{ + key: 'isEnabled', /** - * Get next sort configuration for particular column. Object contain `column` and `sortOrder` properties. - * - * **Note**: Please keep in mind that returned object expose **visual** column index under the `column` key. + * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit} + * hook and if it returns `true` than the {@link ExportFile#enablePlugin} method is called. * - * @private - * @param {Number} column Visual column index. - * @returns {undefined|Object} + * @returns {Boolean} */ - - }, { - key: 'getColumnNextConfig', - value: function getColumnNextConfig(column) { - var physicalColumn = this.hot.toPhysicalColumn(column); - - if (this.columnStatesManager.isColumnSorted(physicalColumn)) { - var columnSortConfig = this.getSortConfig(column); - var sortOrder = (0, _utils.getNextSortOrder)(columnSortConfig.sortOrder); - - if ((0, _mixed.isDefined)(sortOrder)) { - columnSortConfig.sortOrder = sortOrder; - - return columnSortConfig; - } - - return; - } - - var nrOfColumns = this.hot.countCols(); - - if (Number.isInteger(column) && column >= 0 && column < nrOfColumns) { - return { - column: column, - sortOrder: (0, _utils.getNextSortOrder)() - }; - } + value: function isEnabled() { + return true; } /** - * Get sort configuration with "next order" for particular column. - * - * @private - * @param {Number} columnToChange Visual column index of column which order will be changed. - * @param {String} strategyId ID of strategy. Possible values: 'append' and 'replace'. The first one - * change order of particular column and change it's position in the sort queue to the last one. The second one - * just change order of particular column. - * - * **Note**: Please keep in mind that returned objects expose **visual** column index under the `column` key. - * - * @returns {Array} + * @typedef ExportOptions + * @memberof ExportFile + * @type {object} + * @property {boolean} [exportHiddenRows=false] Include hidden rows in the exported file. + * @property {boolean} [exportHiddenColumns=false] Include hidden columns in the exported file. + * @property {boolean} [columnHeaders=false] Include column headers in the exported file. + * @property {boolean} [rowHeaders=false] Include row headers in the exported file. + * @property {string} [columnDelimiter=','] Column delimiter. + * @property {string} [range=[]] Cell range that will be exported to file. */ - }, { - key: 'getNextSortConfig', - value: function getNextSortConfig(columnToChange) { - var strategyId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : APPEND_COLUMN_CONFIG_STRATEGY; - - var physicalColumn = this.hot.toPhysicalColumn(columnToChange); - var indexOfColumnToChange = this.columnStatesManager.getIndexOfColumnInSortQueue(physicalColumn); - var isColumnSorted = this.columnStatesManager.isColumnSorted(physicalColumn); - var currentSortConfig = this.getSortConfig(); - var nextColumnConfig = this.getColumnNextConfig(columnToChange); - - if (isColumnSorted) { - if ((0, _mixed.isUndefined)(nextColumnConfig)) { - return [].concat(_toConsumableArray(currentSortConfig.slice(0, indexOfColumnToChange)), _toConsumableArray(currentSortConfig.slice(indexOfColumnToChange + 1))); - } - - if (strategyId === APPEND_COLUMN_CONFIG_STRATEGY) { - return [].concat(_toConsumableArray(currentSortConfig.slice(0, indexOfColumnToChange)), _toConsumableArray(currentSortConfig.slice(indexOfColumnToChange + 1)), [nextColumnConfig]); - } else if (strategyId === REPLACE_COLUMN_CONFIG_STRATEGY) { - return [].concat(_toConsumableArray(currentSortConfig.slice(0, indexOfColumnToChange)), [nextColumnConfig], _toConsumableArray(currentSortConfig.slice(indexOfColumnToChange + 1))); - } - } + /** + * Exports table data as a string. + * + * @param {String} format Export format type eq. `'csv'`. + * @param {ExportOptions} options Export options. + */ - if ((0, _mixed.isDefined)(nextColumnConfig)) { - return currentSortConfig.concat(nextColumnConfig); - } + }, { + key: 'exportAsString', + value: function exportAsString(format) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - return currentSortConfig; + return this._createTypeFormatter(format, options).export(); } /** - * Saves to cache part of plugins related properties, properly merged from cascade settings. + * Exports table data as a blob object. * - * @private - * @param {Number} column Visual column index. - * @returns {Object} - */ - // TODO: Workaround. Inheriting of non-primitive cell meta values doesn't work. Using this function we don't count - // merged properties few times. + * @param {String} format Export format type eq. `'csv'`. + * @param {ExportOptions} options Export options. + */ }, { - key: 'setMergedPluginSettings', - value: function setMergedPluginSettings(column) { - var physicalColumnIndex = this.hot.toPhysicalColumn(column); - var pluginMainSettings = this.hot.getSettings().multiColumnSorting; - var storedColumnProperties = this.columnStatesManager.getAllColumnsProperties(); - var cellMeta = this.hot.getCellMeta(0, column); - var columnMeta = Object.getPrototypeOf(cellMeta); - var columnMetaHasPluginSettings = Object.hasOwnProperty.call(columnMeta, 'multiColumnSorting'); - var pluginColumnConfig = columnMetaHasPluginSettings ? columnMeta.multiColumnSorting : {}; + key: 'exportAsBlob', + value: function exportAsBlob(format) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - this.columnMetaCache.set(physicalColumnIndex, Object.assign(storedColumnProperties, pluginMainSettings, pluginColumnConfig)); + return this._createBlob(this._createTypeFormatter(format, options)); } /** - * Get copy of settings for first cell in the column. + * Exports table data as a downloadable file. * - * @private - * @param {Number} column Visual column index. - * @returns {Object} + * @param {String} format Export format type eq. `'csv'`. + * @param {ExportOptions} options Export options. */ - // TODO: Workaround. Inheriting of non-primitive cell meta values doesn't work. Instead of getting properties from - // column meta we call this function. }, { - key: 'getFirstCellSettings', - value: function getFirstCellSettings(column) { - var _this9 = this; - - // TODO: Remove test named: "should not break the dataset when inserted new row" (#142). - var actualBlockTranslationFlag = this.blockPluginTranslation; - - this.blockPluginTranslation = true; - - if (this.columnMetaCache.size === 0) { - var numberOfColumns = this.hot.countCols(); + key: 'downloadFile', + value: function downloadFile(format) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - (0, _number.rangeEach)(numberOfColumns, function (visualColumnIndex) { - return _this9.setMergedPluginSettings(visualColumnIndex); - }); - } + var formatter = this._createTypeFormatter(format, options); + var blob = this._createBlob(formatter); + var URL = window.URL || window.webkitURL; - var cellMeta = this.hot.getCellMeta(0, column); + var a = document.createElement('a'); + var name = formatter.options.filename + '.' + formatter.options.fileExtension; - this.blockPluginTranslation = actualBlockTranslationFlag; + if (a.download !== void 0) { + var url = URL.createObjectURL(blob); - var cellMetaCopy = Object.create(cellMeta); - cellMetaCopy.multiColumnSorting = this.columnMetaCache.get(this.hot.toPhysicalColumn(column)); + a.style.display = 'none'; + a.setAttribute('href', url); + a.setAttribute('download', name); + document.body.appendChild(a); + a.dispatchEvent(new MouseEvent('click')); + document.body.removeChild(a); - return cellMetaCopy; + setTimeout(function () { + URL.revokeObjectURL(url); + }, 100); + } else if (navigator.msSaveOrOpenBlob) { + // IE10+ + navigator.msSaveOrOpenBlob(blob, name); + } } /** - * Get number of rows which should be sorted. + * Creates and returns class formatter for specified export type. * * @private - * @param {Number} numberOfRows Total number of displayed rows. - * @returns {Number} + * @param {String} format Export format type eq. `'csv'`. + * @param {ExportOptions} options Export options. */ }, { - key: 'getNumberOfRowsToSort', - value: function getNumberOfRowsToSort(numberOfRows) { - var settings = this.hot.getSettings(); + key: '_createTypeFormatter', + value: function _createTypeFormatter(format) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - // `maxRows` option doesn't take into account `minSpareRows` option in this case. - if (settings.maxRows <= numberOfRows) { - return settings.maxRows; + if (!_typeFactory.EXPORT_TYPES[format]) { + throw new Error('Export format type "' + format + '" is not supported.'); } - return numberOfRows - settings.minSpareRows; + return (0, _typeFactory2.default)(format, new _dataProvider2.default(this.hot), options); } /** - * Performs the sorting using a stable sort function basing on internal state of sorting. + * Creates blob object based on provided type formatter class. * * @private + * @param {BaseType} typeFormatter + * @returns {Blob} */ }, { - key: 'sortByPresetSortStates', - value: function sortByPresetSortStates() { - var _this10 = this; - - if (this.columnStatesManager.isListOfSortedColumnsEmpty()) { - this.rowsMapper.clearMap(); + key: '_createBlob', + value: function _createBlob(typeFormatter) { + var formatter = null; - return; + if (typeof Blob !== 'undefined') { + formatter = new Blob([typeFormatter.export()], { + type: typeFormatter.options.mimeType + ';charset=' + typeFormatter.options.encoding + }); } - var indexesWithData = []; - var sortedColumnsList = this.columnStatesManager.getSortedColumns(); - var numberOfRows = this.hot.countRows(); + return formatter; + } + }]); - // Function `getDataAtCell` won't call the indices translation inside `onModifyRow` callback - we check the `blockPluginTranslation` - // flag inside it (we just want to get data not already modified by `multiColumnSorting` plugin translation). - this.blockPluginTranslation = true; + return ExportFile; +}(_base2.default); - var getDataForSortedColumns = function getDataForSortedColumns(visualRowIndex) { - return (0, _array.arrayMap)(sortedColumnsList, function (physicalColumn) { - return _this10.hot.getDataAtCell(visualRowIndex, _this10.hot.toVisualColumn(physicalColumn)); - }); - }; +(0, _plugins.registerPlugin)('exportFile', ExportFile); - for (var visualRowIndex = 0; visualRowIndex < this.getNumberOfRowsToSort(numberOfRows); visualRowIndex += 1) { - indexesWithData.push([visualRowIndex].concat(getDataForSortedColumns(visualRowIndex))); - } +exports.default = ExportFile; - (0, _mergeSort2.default)(indexesWithData, (0, _comparatorEngine.mainSortComparator)((0, _array.arrayMap)(sortedColumnsList, function (physicalColumn) { - return _this10.columnStatesManager.getSortOrderOfColumn(physicalColumn); - }), (0, _array.arrayMap)(sortedColumnsList, function (physicalColumn) { - return _this10.getFirstCellSettings(_this10.hot.toVisualColumn(physicalColumn)); - }))); +/***/ }), +/* 658 */ +/***/ (function(module, exports, __webpack_require__) { - // Append spareRows - for (var _visualRowIndex = indexesWithData.length; _visualRowIndex < numberOfRows; _visualRowIndex += 1) { - indexesWithData.push([_visualRowIndex].concat(getDataForSortedColumns(_visualRowIndex))); - } +"use strict"; - // The blockade of the indices translation is released. - this.blockPluginTranslation = false; - // Save all indexes to arrayMapper, a completely new sequence is set by the plugin - this.rowsMapper._arrayMap = (0, _array.arrayMap)(indexesWithData, function (indexWithData) { - return indexWithData[0]; - }); - } +exports.__esModule = true; - /** - * Load saved settings or sort by predefined plugin configuration. - * - * @private - */ +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - }, { - key: 'loadOrSortBySettings', - value: function loadOrSortBySettings() { - this.columnMetaCache.clear(); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var storedAllSortSettings = this.getAllSavedSortSettings(); +var _number = __webpack_require__(4); - if ((0, _object.isObject)(storedAllSortSettings)) { - this.sortBySettings(storedAllSortSettings); - } else { - var allSortSettings = this.hot.getSettings().multiColumnSorting; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - this.sortBySettings(allSortSettings); - } - } +// Waiting for jshint >=2.9.0 where they added support for destructing +// jshint ignore: start + +/** + * @plugin ExportFile + * @private + */ +var DataProvider = function () { + function DataProvider(hotInstance) { + _classCallCheck(this, DataProvider); /** - * Sort the table by provided configuration. + * Handsontable instance. * - * @private - * @param {Object} allSortSettings All sort config settings. Object may contain `initialConfig`, `indicator`, - * `sortEmptyCells`, `headerAction` and `compareFunctionFactory` properties. + * @type {Core} + */ + this.hot = hotInstance; + /** + * Format type class options. + * + * @type {Object} */ + this.options = {}; + } - }, { - key: 'sortBySettings', - value: function sortBySettings(allSortSettings) { - if ((0, _object.isObject)(allSortSettings)) { - this.columnStatesManager.updateAllColumnsProperties(allSortSettings); + /** + * Set options for data provider. + * + * @param {Object} options Object with specified options. + */ - var initialConfig = allSortSettings.initialConfig; - if (Array.isArray(initialConfig) || (0, _object.isObject)(initialConfig)) { - this.sort(initialConfig); - } - } else { - // Extra render for headers. Their width may change. - this.hot.render(); - } + _createClass(DataProvider, [{ + key: 'setOptions', + value: function setOptions(options) { + this.options = options; } /** - * Enables the ObserveChanges plugin. + * Get table data based on provided settings to the class constructor. * - * @private + * @returns {Array} */ }, { - key: 'enableObserveChangesPlugin', - value: function enableObserveChangesPlugin() { + key: 'getData', + value: function getData() { var _this = this; - this.hot._registerTimeout(setTimeout(function () { - _this.hot.updateSettings({ - observeChanges: true - }); - }, 0)); - } + var _getDataRange2 = this._getDataRange(), + startRow = _getDataRange2.startRow, + startCol = _getDataRange2.startCol, + endRow = _getDataRange2.endRow, + endCol = _getDataRange2.endCol; - /** - * Callback for `modifyRow` hook. Translates visual row index to the sorted row index. - * - * @private - * @param {Number} row Visual row index. - * @returns {Number} Physical row index. - */ + var options = this.options; + var data = []; - }, { - key: 'onModifyRow', - value: function onModifyRow(row, source) { - if (this.blockPluginTranslation === false && source !== this.pluginName) { - var rowInMapper = this.rowsMapper.getValueByIndex(row); - row = rowInMapper === null ? row : rowInMapper; - } + (0, _number.rangeEach)(startRow, endRow, function (rowIndex) { + var row = []; - return row; + if (!options.exportHiddenRows && _this._isHiddenRow(rowIndex)) { + return; + } + (0, _number.rangeEach)(startCol, endCol, function (colIndex) { + if (!options.exportHiddenColumns && _this._isHiddenColumn(colIndex)) { + return; + } + row.push(_this.hot.getDataAtCell(rowIndex, colIndex)); + }); + + data.push(row); + }); + + return data; } /** - * Callback for `unmodifyRow` hook. Translates sorted row index to visual row index. + * Gets list of row headers. * - * @private - * @param {Number} row Physical row index. - * @returns {Number} Visual row index. + * @return {Array} */ }, { - key: 'onUnmodifyRow', - value: function onUnmodifyRow(row, source) { - if (this.blockPluginTranslation === false && source !== this.pluginName) { - row = this.rowsMapper.getIndexByValue(row); - } + key: 'getRowHeaders', + value: function getRowHeaders() { + var _this2 = this; - return row; - } + var headers = []; - /** - * Callback for the `onAfterGetColHeader` hook. Adds column sorting CSS classes. - * - * @private - * @param {Number} column Visual column index. - * @param {Element} TH TH HTML element. - */ + if (this.options.rowHeaders) { + var _getDataRange3 = this._getDataRange(), + startRow = _getDataRange3.startRow, + endRow = _getDataRange3.endRow; - }, { - key: 'onAfterGetColHeader', - value: function onAfterGetColHeader(column, TH) { - var headerSpanElement = (0, _utils.getHeaderSpanElement)(TH); + var rowHeaders = this.hot.getRowHeader(); - if ((0, _utils.isFirstLevelColumnHeader)(column, TH) === false || headerSpanElement === null) { - return; + (0, _number.rangeEach)(startRow, endRow, function (row) { + if (!_this2.options.exportHiddenRows && _this2._isHiddenRow(row)) { + return; + } + headers.push(rowHeaders[row]); + }); } - var physicalColumn = this.hot.toPhysicalColumn(column); - var pluginSettingsForColumn = this.getFirstCellSettings(column).multiColumnSorting; - var showSortIndicator = pluginSettingsForColumn.indicator; - var headerActionEnabled = pluginSettingsForColumn.headerAction; - - (0, _element.removeClass)(headerSpanElement, this.domHelper.getRemovedClasses(headerSpanElement)); - (0, _element.addClass)(headerSpanElement, this.domHelper.getAddedClasses(physicalColumn, showSortIndicator, headerActionEnabled)); + return headers; } /** - * Overwriting base plugin's `onUpdateSettings` method. Please keep in mind that `onAfterUpdateSettings` isn't called - * for `updateSettings` in specific situations. + * Gets list of columns headers. * - * @private - * @param {Object} newSettings New settings object. + * @return {Array} */ }, { - key: 'onUpdateSettings', - value: function onUpdateSettings(newSettings) { - _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'onUpdateSettings', this).call(this); - - (0, _utils.warnIfPluginsHaveConflict)(newSettings.columnSorting); - - this.columnMetaCache.clear(); + key: 'getColumnHeaders', + value: function getColumnHeaders() { + var _this3 = this; - if ((0, _mixed.isDefined)(newSettings.multiColumnSorting)) { - this.sortBySettings(newSettings.multiColumnSorting); - } - } + var headers = []; - /** - * Callback for the `afterLoadData` hook. - * - * @private - * @param {Boolean} initialLoad flag that determines whether the data has been loaded during the initialization. - */ + if (this.options.columnHeaders) { + var _getDataRange4 = this._getDataRange(), + startCol = _getDataRange4.startCol, + endCol = _getDataRange4.endCol; - }, { - key: 'onAfterLoadData', - value: function onAfterLoadData(initialLoad) { - this.rowsMapper.clearMap(); + var colHeaders = this.hot.getColHeader(); - if (initialLoad === true) { - // TODO: Workaround? It should be refactored / described. - if (this.hot.view) { - this.loadOrSortBySettings(); - } + (0, _number.rangeEach)(startCol, endCol, function (column) { + if (!_this3.options.exportHiddenColumns && _this3._isHiddenColumn(column)) { + return; + } + headers.push(colHeaders[column]); + }); } - } - - /** - * Callback for the `afterCreateRow` hook. - * - * @private - * @param {Number} index Visual index of the created row. - * @param {Number} amount Amount of created rows. - */ - }, { - key: 'onAfterCreateRow', - value: function onAfterCreateRow(index, amount) { - this.rowsMapper.shiftItems(index, amount); + return headers; } /** - * Callback for the `afterRemoveRow` hook. + * Get data range object based on settings provided in the class constructor. * * @private - * @param {Number} removedRows Visual indexes of the removed row. - * @param {Number} amount Amount of removed rows. + * @returns {Object} Returns object with keys `startRow`, `startCol`, `endRow` and `endCol`. */ }, { - key: 'onAfterRemoveRow', - value: function onAfterRemoveRow(removedRows, amount) { - this.rowsMapper.unshiftItems(removedRows, amount); - } + key: '_getDataRange', + value: function _getDataRange() { + var cols = this.hot.countCols() - 1; + var rows = this.hot.countRows() - 1; - // TODO: Workaround. Inheriting of non-primitive cell meta values doesn't work. We clear the cache after action which reorganize sequence of columns. - // TODO: Remove test named: "should add new columns properly when the `columnSorting` plugin is enabled (inheriting of non-primitive cell meta values)". - /** - * Callback for the `afterCreateCol` hook. - * - * @private - */ + var _options$range = _slicedToArray(this.options.range, 4), + _options$range$ = _options$range[0], + startRow = _options$range$ === undefined ? 0 : _options$range$, + _options$range$2 = _options$range[1], + startCol = _options$range$2 === undefined ? 0 : _options$range$2, + _options$range$3 = _options$range[2], + endRow = _options$range$3 === undefined ? rows : _options$range$3, + _options$range$4 = _options$range[3], + endCol = _options$range$4 === undefined ? cols : _options$range$4; + + startRow = Math.max(startRow, 0); + startCol = Math.max(startCol, 0); + endRow = Math.min(endRow, rows); + endCol = Math.min(endCol, cols); - }, { - key: 'onAfterCreateCol', - value: function onAfterCreateCol() { - this.columnMetaCache.clear(); + return { startRow: startRow, startCol: startCol, endRow: endRow, endCol: endCol }; } - // TODO: Workaround. Inheriting of non-primitive cell meta values doesn't work. We clear the cache after action which reorganize sequence of columns. - // TODO: Remove test named: "should add new columns properly when the `columnSorting` plugin is enabled (inheriting of non-primitive cell meta values)". /** - * Callback for the `afterRemoveCol` hook. + * Check if row at specified row index is hidden. * * @private + * @param {Number} row Row index. + * @returns {Boolean} */ }, { - key: 'onAfterRemoveCol', - value: function onAfterRemoveCol() { - this.columnMetaCache.clear(); + key: '_isHiddenRow', + value: function _isHiddenRow(row) { + return this.hot.hasHook('hiddenRow') && this.hot.runHooks('hiddenRow', row); } /** - * Indicates if clickable header was clicked. + * Check if column at specified column index is hidden. * * @private - * @param {MouseEvent} event The `mousedown` event. - * @param {Number} column Visual column index. + * @param {Number} column Column index. * @returns {Boolean} */ }, { - key: 'wasClickableHeaderClicked', - value: function wasClickableHeaderClicked(event, column) { - var pluginSettingsForColumn = this.getFirstCellSettings(column).multiColumnSorting; - var headerActionEnabled = pluginSettingsForColumn.headerAction; - - return headerActionEnabled && event.realTarget.nodeName === 'SPAN'; + key: '_isHiddenColumn', + value: function _isHiddenColumn(column) { + return this.hot.hasHook('hiddenColumn') && this.hot.runHooks('hiddenColumn', column); } + }]); - /** - * Changes the behavior of selection / dragging. - * - * @private - * @param {MouseEvent} event The `mousedown` event. - * @param {CellCoords} coords Visual coordinates. - * @param {HTMLElement} TD - * @param {Object} blockCalculations - */ + return DataProvider; +}(); - }, { - key: 'onBeforeOnCellMouseDown', - value: function onBeforeOnCellMouseDown(event, coords, TD, blockCalculations) { - // Click below the level of column headers - if (coords.row >= 0 || coords.col < 0) { - return; - } +exports.default = DataProvider; - if (this.wasClickableHeaderClicked(event, coords.col) && (0, _keyStateObserver.isPressedCtrlKey)()) { - blockCalculations.column = true; - } - } +/***/ }), +/* 659 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Callback for the `onAfterOnCellMouseDown` hook. - * - * @private - * @param {Event} event Event which are provided by hook. - * @param {CellCoords} coords Visual coords of the selected cell. - */ +"use strict"; - }, { - key: 'onAfterOnCellMouseDown', - value: function onAfterOnCellMouseDown(event, coords) { - // Click below the level of column headers - if (coords.row >= 0 || coords.col < 0) { - return; - } - if (this.wasClickableHeaderClicked(event, coords.col)) { - if ((0, _keyStateObserver.isPressedCtrlKey)()) { - this.hot.deselectCell(); - this.hot.selectColumns(coords.col); +exports.__esModule = true; +exports.EXPORT_TYPES = exports.TYPE_PDF = exports.TYPE_EXCEL = exports.TYPE_CSV = undefined; +exports.default = typeFactory; - this.sort(this.getNextSortConfig(coords.col, APPEND_COLUMN_CONFIG_STRATEGY)); - } else { - this.sort(this.getColumnNextConfig(coords.col)); - } - } - } +var _csv = __webpack_require__(660); - /** - * Destroys the plugin instance. - */ +var _csv2 = _interopRequireDefault(_csv); - }, { - key: 'destroy', - value: function destroy() { - this.rowsMapper.destroy(); - this.domHelper.destroy(); - this.columnStatesManager.destroy(); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'destroy', this).call(this); - } - }]); +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - return MultiColumnSorting; -}(_base2.default); +var TYPE_CSV = exports.TYPE_CSV = 'csv'; +var TYPE_EXCEL = exports.TYPE_EXCEL = 'excel'; // TODO +var TYPE_PDF = exports.TYPE_PDF = 'pdf'; // TODO -(0, _plugins.registerPlugin)('multiColumnSorting', MultiColumnSorting); +var EXPORT_TYPES = exports.EXPORT_TYPES = _defineProperty({}, TYPE_CSV, _csv2.default); -exports.default = MultiColumnSorting; +function typeFactory(type, dataProvider, options) { + if (typeof EXPORT_TYPES[type] === 'function') { + return new EXPORT_TYPES[type](dataProvider, options); + } + + return null; +} /***/ }), -/* 662 */ +/* 660 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.default = dateSort; -var _moment = __webpack_require__(23); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _moment2 = _interopRequireDefault(_moment); +var _array = __webpack_require__(0); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); -var _comparatorEngine = __webpack_require__(88); +var _base = __webpack_require__(661); + +var _base2 = _interopRequireDefault(_base); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var CHAR_CARRIAGE_RETURN = String.fromCharCode(13); +var CHAR_DOUBLE_QUOTES = String.fromCharCode(34); +var CHAR_LINE_FEED = String.fromCharCode(10); + /** - * Date sorting compare function factory. Method get as parameters `sortOrder` and `columnMeta` and return compare function. - * - * @param {String} sortOrder Sort order (`asc` for ascending, `desc` for descending). - * @param {Object} columnMeta Column meta object. - * @returns {Function} The compare function. + * @plugin ExportFile + * @private */ -function dateSort(sortOrder, columnMeta) { - return function (value, nextValue) { - var sortEmptyCells = columnMeta.multiColumnSorting.sortEmptyCells; +var Csv = function (_BaseType) { + _inherits(Csv, _BaseType); - if (value === nextValue) { - return _comparatorEngine.DO_NOT_SWAP; - } + function Csv() { + _classCallCheck(this, Csv); - if ((0, _mixed.isEmpty)(value)) { - if ((0, _mixed.isEmpty)(nextValue)) { - return _comparatorEngine.DO_NOT_SWAP; - } + return _possibleConstructorReturn(this, (Csv.__proto__ || Object.getPrototypeOf(Csv)).apply(this, arguments)); + } - // Just fist value is empty and `sortEmptyCells` option was set - if (sortEmptyCells) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; - } + _createClass(Csv, [{ + key: 'export', - return _comparatorEngine.FIRST_AFTER_SECOND; - } - if ((0, _mixed.isEmpty)(nextValue)) { - // Just second value is empty and `sortEmptyCells` option was set - if (sortEmptyCells) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; + /** + * Create string body in desired format. + * + * @return {String} + */ + value: function _export() { + var _this2 = this; + + var options = this.options; + var data = this.dataProvider.getData(); + var columnHeaders = this.dataProvider.getColumnHeaders(); + var hasColumnHeaders = columnHeaders.length > 0; + var rowHeaders = this.dataProvider.getRowHeaders(); + var hasRowHeaders = rowHeaders.length > 0; + var result = options.bom ? String.fromCharCode(0xFEFF) : ''; + + if (hasColumnHeaders) { + columnHeaders = (0, _array.arrayMap)(columnHeaders, function (value) { + return _this2._escapeCell(value, true); + }); + + if (hasRowHeaders) { + result += options.columnDelimiter; + } + result += columnHeaders.join(options.columnDelimiter); + result += options.rowDelimiter; } - return _comparatorEngine.FIRST_BEFORE_SECOND; + (0, _array.arrayEach)(data, function (value, index) { + if (index > 0) { + result += options.rowDelimiter; + } + if (hasRowHeaders) { + result += _this2._escapeCell(rowHeaders[index]) + options.columnDelimiter; + } + result += value.map(function (cellValue) { + return _this2._escapeCell(cellValue); + }).join(options.columnDelimiter); + }); + + return result; } - var dateFormat = columnMeta.dateFormat; - var firstDate = (0, _moment2.default)(value, dateFormat); - var nextDate = (0, _moment2.default)(nextValue, dateFormat); + /** + * Escape cell value. + * + * @param {*} value Cell value. + * @param {Boolean} [force=false] Indicates if cell value will be escaped forcefully. + * @return {String} + */ - if (!firstDate.isValid()) { - return _comparatorEngine.FIRST_AFTER_SECOND; - } + }, { + key: '_escapeCell', + value: function _escapeCell(value) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - if (!nextDate.isValid()) { - return _comparatorEngine.FIRST_BEFORE_SECOND; - } + var escapedValue = (0, _mixed.stringify)(value); - if (nextDate.isAfter(firstDate)) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; + if (escapedValue !== '' && (force || escapedValue.indexOf(CHAR_CARRIAGE_RETURN) >= 0 || escapedValue.indexOf(CHAR_DOUBLE_QUOTES) >= 0 || escapedValue.indexOf(CHAR_LINE_FEED) >= 0 || escapedValue.indexOf(this.options.columnDelimiter) >= 0)) { + + escapedValue = escapedValue.replace(new RegExp('"', 'g'), '""'); + escapedValue = '"' + escapedValue + '"'; + } + + return escapedValue; } + }], [{ + key: 'DEFAULT_OPTIONS', - if (nextDate.isBefore(firstDate)) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; + /** + * Default options for exporting CSV format. + * + * @returns {Object} + */ + get: function get() { + return { + mimeType: 'text/csv', + fileExtension: 'csv', + bom: true, + columnDelimiter: ',', + rowDelimiter: '\r\n' + }; } + }]); - return _comparatorEngine.DO_NOT_SWAP; - }; -} + return Csv; +}(_base2.default); + +exports.default = Csv; /***/ }), -/* 663 */ +/* 661 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.default = defaultSort; -var _mixed = __webpack_require__(8); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _object = __webpack_require__(1); + +var _string = __webpack_require__(32); -var _comparatorEngine = __webpack_require__(88); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** - * Default sorting compare function factory. Method get as parameters `sortOrder` and `columnMeta` and return compare function. - * - * @param {String} sortOrder Sort order (`asc` for ascending, `desc` for descending). - * @param {Object} columnMeta Column meta object. - * @returns {Function} The compare function. + * @plugin ExportFile + * @private */ -function defaultSort(sortOrder, columnMeta) { - return function (value, nextValue) { - var sortEmptyCells = columnMeta.multiColumnSorting.sortEmptyCells; - +var BaseType = function () { + _createClass(BaseType, null, [{ + key: 'DEFAULT_OPTIONS', - if (typeof value === 'string') { - value = value.toLowerCase(); + /** + * Default options. + * + * @returns {Object} + */ + get: function get() { + return { + mimeType: 'text/plain', + fileExtension: 'txt', + filename: 'Handsontable [YYYY]-[MM]-[DD]', + encoding: 'utf-8', + bom: false, + columnHeaders: false, + rowHeaders: false, + exportHiddenColumns: false, + exportHiddenRows: false, + range: [] + }; } + }]); - if (typeof nextValue === 'string') { - nextValue = nextValue.toLowerCase(); - } + function BaseType(dataProvider, options) { + _classCallCheck(this, BaseType); - if (value === nextValue) { - return _comparatorEngine.DO_NOT_SWAP; - } + /** + * Data provider. + * + * @type {DataProvider} + */ + this.dataProvider = dataProvider; + /** + * Format type class options. + * + * @type {Object} + */ + this.options = this._mergeOptions(options); - if ((0, _mixed.isEmpty)(value)) { - if ((0, _mixed.isEmpty)(nextValue)) { - return _comparatorEngine.DO_NOT_SWAP; - } + this.dataProvider.setOptions(this.options); + } - // Just fist value is empty and `sortEmptyCells` option was set - if (sortEmptyCells) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; - } + /** + * Merge options provided by users with defaults. + * + * @return {Object} Returns new options object. + */ - return _comparatorEngine.FIRST_AFTER_SECOND; - } - if ((0, _mixed.isEmpty)(nextValue)) { - // Just second value is empty and `sortEmptyCells` option was set - if (sortEmptyCells) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; - } + _createClass(BaseType, [{ + key: '_mergeOptions', + value: function _mergeOptions(options) { + var _options = (0, _object.clone)(this.constructor.DEFAULT_OPTIONS); + var date = new Date(); - return _comparatorEngine.FIRST_BEFORE_SECOND; - } + _options = (0, _object.extend)((0, _object.clone)(BaseType.DEFAULT_OPTIONS), _options); + _options = (0, _object.extend)(_options, options); - if (isNaN(value) && !isNaN(nextValue)) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; - } else if (!isNaN(value) && isNaN(nextValue)) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; - } else if (!(isNaN(value) || isNaN(nextValue))) { - value = parseFloat(value); - nextValue = parseFloat(nextValue); - } + _options.filename = (0, _string.substitute)(_options.filename, { + YYYY: date.getFullYear(), + MM: ('' + (date.getMonth() + 1)).padStart(2, '0'), + DD: ('' + date.getDate()).padStart(2, '0') + }); - if (value < nextValue) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; + return _options; } + }]); - if (value > nextValue) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; - } + return BaseType; +}(); - return _comparatorEngine.DO_NOT_SWAP; - }; -} +exports.default = BaseType; /***/ }), -/* 664 */ +/* 662 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.default = numericSort; - -var _mixed = __webpack_require__(8); - -var _comparatorEngine = __webpack_require__(88); -/** - * Numeric sorting compare function factory. Method get as parameters `sortOrder` and `columnMeta` and return compare function. - * - * @param {String} sortOrder Sort order (`asc` for ascending, `desc` for descending). - * @param {Object} columnMeta Column meta object. - * @returns {Function} The compare function. - */ -function numericSort(sortOrder, columnMeta) { - return function (value, nextValue) { - var parsedFirstValue = parseFloat(value); - var parsedSecondValue = parseFloat(nextValue); - var sortEmptyCells = columnMeta.multiColumnSorting.sortEmptyCells; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - // Watch out when changing this part of code! Check below returns 0 (as expected) when comparing empty string, null, undefined +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - if (parsedFirstValue === parsedSecondValue || isNaN(parsedFirstValue) && isNaN(parsedSecondValue)) { - return _comparatorEngine.DO_NOT_SWAP; - } +var _columnSorting = __webpack_require__(464); - if (sortEmptyCells) { - if ((0, _mixed.isEmpty)(value)) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; - } +var _columnSorting2 = _interopRequireDefault(_columnSorting); - if ((0, _mixed.isEmpty)(nextValue)) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; - } - } +var _sortService = __webpack_require__(51); - if (isNaN(parsedFirstValue)) { - return _comparatorEngine.FIRST_AFTER_SECOND; - } +var _utils = __webpack_require__(160); - if (isNaN(parsedSecondValue)) { - return _comparatorEngine.FIRST_BEFORE_SECOND; - } +var _plugins = __webpack_require__(5); - if (parsedFirstValue < parsedSecondValue) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_BEFORE_SECOND : _comparatorEngine.FIRST_AFTER_SECOND; - } else if (parsedFirstValue > parsedSecondValue) { - return sortOrder === 'asc' ? _comparatorEngine.FIRST_AFTER_SECOND : _comparatorEngine.FIRST_BEFORE_SECOND; - } +var _keyStateObserver = __webpack_require__(86); - return _comparatorEngine.DO_NOT_SWAP; - }; -} +var _element = __webpack_require__(2); -/***/ }), -/* 665 */ -/***/ (function(module, exports, __webpack_require__) { +var _rootComparator = __webpack_require__(663); -"use strict"; +var _utils2 = __webpack_require__(664); +var _domHelpers = __webpack_require__(665); -exports.__esModule = true; -exports.ColumnStatesManager = undefined; +__webpack_require__(666); -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _object = __webpack_require__(1); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var _array = __webpack_require__(0); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var inheritedColumnProperties = ['sortEmptyCells', 'indicator', 'headerAction', 'compareFunctionFactory']; +var APPEND_COLUMN_CONFIG_STRATEGY = 'append'; +var PLUGIN_KEY = 'multiColumnSorting'; +var CONFLICTED_PLUGIN_KEY = 'columnSorting'; -var SORT_EMPTY_CELLS_DEFAULT = false; -var SHOW_SORT_INDICATOR_DEFAULT = true; -var HEADER_ACTION_DEFAULT = true; +(0, _sortService.registerRootComparator)(PLUGIN_KEY, _rootComparator.rootComparator); /** - * Store and manages states of sorted columns. - * - * @class ColumnStatesManager * @plugin MultiColumnSorting + * @pro + * + * @description + * This plugin sorts the view by columns (but does not sort the data source!). To enable the plugin, set the + * {@link Options#multiColumnSorting} property to the correct value (see the examples below). + * + * @example + * ```js + * // as boolean + * multiColumnSorting: true + * + * // as an object with initial sort config (sort ascending for column at index 1 and then sort descending for column at index 0) + * multiColumnSorting: { + * initialConfig: [{ + * column: 1, + * sortOrder: 'asc' + * }, { + * column: 0, + * sortOrder: 'desc' + * }] + * } + * + * // as an object which define specific sorting options for all columns + * multiColumnSorting: { + * sortEmptyCells: true, // true = the table sorts empty cells, false = the table moves all empty cells to the end of the table (by default) + * indicator: true, // true = shows indicator for all columns (by default), false = don't show indicator for columns + * headerAction: true, // true = allow to click on the headers to sort (by default), false = turn off possibility to click on the headers to sort + * compareFunctionFactory: function(sortOrder, columnMeta) { + * return function(value, nextValue) { + * // Some value comparisons which will return -1, 0 or 1... + * } + * } + * } + * + * // as an object passed to the `column` property, allows specifying a custom options for the desired column. + * // please take a look at documentation of `column` property: https://docs.handsontable.com/pro/Options.html#columns + * columns: [{ + * multiColumnSorting: { + * indicator: false, // disable indicator for the first column, + * sortEmptyCells: true, + * headerAction: false, // clicks on the first column won't sort + * compareFunctionFactory: function(sortOrder, columnMeta) { + * return function(value, nextValue) { + * return 0; // Custom compare function for the first column (don't sort) + * } + * } + * } + * }]``` + * + * @dependencies ObserveChanges */ -// eslint-disable-next-line import/prefer-default-export - -var ColumnStatesManager = exports.ColumnStatesManager = function () { - function ColumnStatesManager() { - _classCallCheck(this, ColumnStatesManager); - - /** - * Queue of sort states containing sorted columns and their orders (Array of objects containing `column` and `sortOrder` properties). - * - * @type {Array} - */ - this.sortedColumnsStates = []; - /** - * Determines whether we should sort empty cells. - * - * @type {Boolean} - */ - this.sortEmptyCells = SORT_EMPTY_CELLS_DEFAULT; - /** - * Determines whether indicator should be visible (for sorted columns). - * - * @type {Boolean} - */ - this.indicator = SHOW_SORT_INDICATOR_DEFAULT; - /** - * Determines whether click on the header perform sorting. - * - * @type {Boolean} - */ - this.headerAction = HEADER_ACTION_DEFAULT; - /** - * Determines compare function factory. Method get as parameters `sortOder` and `columnMeta` and return compare function. - */ - this.compareFunctionFactory = void 0; - } - - /** - * Update column properties which affect the sorting result. - * - * **Note**: All column properties can be overwritten by [columns](https://docs.handsontable.com/pro/Options.html#columns) option. - * - * @param {Object} allSortSettings Column sorting plugin's configuration object. - */ - - _createClass(ColumnStatesManager, [{ - key: 'updateAllColumnsProperties', - value: function updateAllColumnsProperties(allSortSettings) { - var _this = this; - - if (!(0, _object.isObject)(allSortSettings)) { - return; - } +var MultiColumnSorting = function (_ColumnSorting) { + _inherits(MultiColumnSorting, _ColumnSorting); - (0, _object.objectEach)(allSortSettings, function (newValue, propertyName) { - if (inheritedColumnProperties.includes(propertyName)) { - _this[propertyName] = newValue; - } - }); - } + function MultiColumnSorting(hotInstance) { + _classCallCheck(this, MultiColumnSorting); /** - * Get all column properties which affect the sorting result. + * Main settings key designed for the plugin. * - * @returns {Object} + * @private + * @type {String} */ + var _this = _possibleConstructorReturn(this, (MultiColumnSorting.__proto__ || Object.getPrototypeOf(MultiColumnSorting)).call(this, hotInstance)); - }, { - key: 'getAllColumnsProperties', - value: function getAllColumnsProperties() { - var columnProperties = { - sortEmptyCells: this.sortEmptyCells, - indicator: this.indicator, - headerAction: this.headerAction - }; + _this.pluginKey = PLUGIN_KEY; + return _this; + } - if (typeof this.compareFunctionFactory !== 'undefined') { - columnProperties.compareFunctionFactory = this.compareFunctionFactory; - } + /** + * Checks if the plugin is enabled in the Handsontable settings. This method is executed in {@link Hooks#beforeInit} + * hook and if it returns `true` than the {@link MultiColumnSorting#enablePlugin} method is called. + * + * @returns {Boolean} + */ - return columnProperties; + + _createClass(MultiColumnSorting, [{ + key: 'isEnabled', + value: function isEnabled() { + return _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'isEnabled', this).call(this); } /** - * Get index of first sorted column. - * - * @returns {Number|undefined} + * Enables the plugin functionality for this Handsontable instance. */ }, { - key: 'getFirstSortedColumn', - value: function getFirstSortedColumn() { - var firstSortedColumn = void 0; - - if (this.getNumberOfSortedColumns() > 0) { - firstSortedColumn = this.sortedColumnsStates[0].column; + key: 'enablePlugin', + value: function enablePlugin() { + if (!this.enabled && this.hot.getSettings()[this.pluginKey] && this.hot.getSettings()[CONFLICTED_PLUGIN_KEY]) { + (0, _utils2.warnAboutPluginsConflict)(); } - return firstSortedColumn; + return _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'enablePlugin', this).call(this); } /** - * Get sort order of column. - * - * @param {Number} searchedColumn Physical column index. - * @returns {String|undefined} Sort order (`asc` for ascending, `desc` for descending and undefined for not sorted). + * Disables the plugin functionality for this Handsontable instance. */ }, { - key: 'getSortOrderOfColumn', - value: function getSortOrderOfColumn(searchedColumn) { - var searchedState = this.sortedColumnsStates.find(function (_ref) { - var column = _ref.column; - return searchedColumn === column; - }); - var sortOrder = void 0; - - if ((0, _object.isObject)(searchedState)) { - sortOrder = searchedState.sortOrder; - } - - return sortOrder; + key: 'disablePlugin', + value: function disablePlugin() { + return _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'disablePlugin', this).call(this); } /** - * Get list of sorted columns. + * Sorts the table by chosen columns and orders. * - * @returns {Array} + * @param {undefined|Object|Array} sortConfig Single column sort configuration or full sort configuration (for all sorted columns). + * The configuration object contains `column` and `sortOrder` properties. First of them contains visual column index, the second one contains + * sort order (`asc` for ascending, `desc` for descending). + * + * **Note**: Please keep in mind that every call of `sort` function set an entirely new sort order. Previous sort configs aren't preserved. + * + * @example + * ```js + * // sort ascending first visual column + * hot.getPlugin('multiColumnSorting').sort({ column: 0, sortOrder: 'asc' }); + * + * // sort first two visual column in the defined sequence + * hot.getPlugin('multiColumnSorting').sort([{ + * column: 1, sortOrder: 'asc' + * }, { + * column: 0, sortOrder: 'desc' + * }]); + * ``` + * + * @fires Hooks#beforeColumnSort + * @fires Hooks#afterColumnSort */ }, { - key: 'getSortedColumns', - value: function getSortedColumns() { - return (0, _array.arrayMap)(this.sortedColumnsStates, function (_ref2) { - var column = _ref2.column; - return column; - }); + key: 'sort', + value: function sort(sortConfig) { + return _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'sort', this).call(this, sortConfig); } /** - * Get order of particular column in the states queue. - * - * @param {Number} column Physical column index. - * @returns {Number} + * Clear the sort performed on the table. */ }, { - key: 'getIndexOfColumnInSortQueue', - value: function getIndexOfColumnInSortQueue(column) { - return this.getSortedColumns().indexOf(column); + key: 'clearSort', + value: function clearSort() { + return _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'clearSort', this).call(this); } /** - * Get number of sorted columns. + * Checks if the table is sorted (any column have to be sorted). * - * @returns {Number} + * @returns {Boolean} */ }, { - key: 'getNumberOfSortedColumns', - value: function getNumberOfSortedColumns() { - return this.sortedColumnsStates.length; + key: 'isSorted', + value: function isSorted() { + return _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'isSorted', this).call(this); } /** - * Get if list of sorted columns is empty. + * Get sort configuration for particular column or for all sorted columns. Objects contain `column` and `sortOrder` properties. * - * @returns {Boolean} + * **Note**: Please keep in mind that returned objects expose **visual** column index under the `column` key. They are handled by the `sort` function. + * + * @param {Number} [column] Visual column index. + * @returns {undefined|Object|Array} */ }, { - key: 'isListOfSortedColumnsEmpty', - value: function isListOfSortedColumnsEmpty() { - return this.getNumberOfSortedColumns() === 0; + key: 'getSortConfig', + value: function getSortConfig(column) { + return _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'getSortConfig', this).call(this, column); } /** - * Get if particular column is sorted. + * @description + * Warn: Useful mainly for providing server side sort implementation (see in the example below). It doesn't sort the data set. It just sets sort configuration for all sorted columns. * - * @param {Number} column Physical column index. - * @returns {Boolean} + * @example + * ```js + * beforeColumnSort: function(currentSortConfig, destinationSortConfigs) { + * const columnSortPlugin = this.getPlugin('multiColumnSorting'); + * + * columnSortPlugin.setSortConfig(destinationSortConfigs); + * + * // const newData = ... // Calculated data set, ie. from an AJAX call. + * + * // this.loadData(newData); // Load new data set. + * + * return false; // The blockade for the default sort action. + * }``` + * + * @param {undefined|Object|Array} sortConfig Single column sort configuration or full sort configuration (for all sorted columns). + * The configuration object contains `column` and `sortOrder` properties. First of them contains visual column index, the second one contains + * sort order (`asc` for ascending, `desc` for descending). */ }, { - key: 'isColumnSorted', - value: function isColumnSorted(column) { - return this.getSortedColumns().includes(column); + key: 'setSortConfig', + value: function setSortConfig(sortConfig) { + return _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'setSortConfig', this).call(this, sortConfig); } /** - * Get states for all sorted columns. + * Get normalized sort configs. * + * @private + * @param {Object|Array} [sortConfig=[]] Single column sort configuration or full sort configuration (for all sorted columns). + * The configuration object contains `column` and `sortOrder` properties. First of them contains visual column index, the second one contains + * sort order (`asc` for ascending, `desc` for descending). * @returns {Array} */ }, { - key: 'getSortStates', - value: function getSortStates() { - return (0, _object.deepClone)(this.sortedColumnsStates); + key: 'getNormalizedSortConfigs', + value: function getNormalizedSortConfigs() { + var sortConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + if (Array.isArray(sortConfig)) { + return sortConfig; + } + + return [sortConfig]; } /** - * Get sort state for particular column. Object contains `column` and `sortOrder` properties. - * - * **Note**: Please keep in mind that returned objects expose **physical** column index under the `column` key. + * Update header classes. * - * @param {Number} column Physical column index. - * @returns {Object|undefined} + * @private + * @param {HTMLElement} headerSpanElement Header span element. + * @param {...*} args Extra arguments for helpers. */ }, { - key: 'getColumnSortState', - value: function getColumnSortState(column) { - if (this.isColumnSorted(column)) { - return (0, _object.deepClone)(this.sortedColumnsStates[this.getIndexOfColumnInSortQueue(column)]); + key: 'updateHeaderClasses', + value: function updateHeaderClasses(headerSpanElement) { + var _get2; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + (_get2 = _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'updateHeaderClasses', this)).call.apply(_get2, [this, headerSpanElement].concat(args)); + + (0, _element.removeClass)(headerSpanElement, (0, _domHelpers.getClassedToRemove)(headerSpanElement)); + + if (this.enabled !== false) { + (0, _element.addClass)(headerSpanElement, _domHelpers.getClassesToAdd.apply(undefined, args)); } } /** - * Set all sorted columns states. + * Overwriting base plugin's `onUpdateSettings` method. Please keep in mind that `onAfterUpdateSettings` isn't called + * for `updateSettings` in specific situations. * - * @param {Array} sortStates + * @private + * @param {Object} newSettings New settings object. */ }, { - key: 'setSortStates', - value: function setSortStates(sortStates) { - this.sortedColumnsStates = sortStates; + key: 'onUpdateSettings', + value: function onUpdateSettings(newSettings) { + if (this.hot.getSettings()[this.pluginKey] && this.hot.getSettings()[CONFLICTED_PLUGIN_KEY]) { + (0, _utils2.warnAboutPluginsConflict)(); + } + + return _get(MultiColumnSorting.prototype.__proto__ || Object.getPrototypeOf(MultiColumnSorting.prototype), 'onUpdateSettings', this).call(this, newSettings); } /** - * Destroy the state manager. + * Callback for the `onAfterOnCellMouseDown` hook. + * + * @private + * @param {Event} event Event which are provided by hook. + * @param {CellCoords} coords Visual coords of the selected cell. */ }, { - key: 'destroy', - value: function destroy() { - this.sortedColumnsStates.length = 0; - this.sortedColumnsStates = null; + key: 'onAfterOnCellMouseDown', + value: function onAfterOnCellMouseDown(event, coords) { + if ((0, _utils.wasHeaderClickedProperly)(coords.row, coords.col, event) === false) { + return; + } + + if (this.wasClickableHeaderClicked(event, coords.col)) { + if ((0, _keyStateObserver.isPressedCtrlKey)()) { + this.hot.deselectCell(); + this.hot.selectColumns(coords.col); + + this.sort(this.getNextSortConfig(coords.col, APPEND_COLUMN_CONFIG_STRATEGY)); + } else { + this.sort(this.getColumnNextConfig(coords.col)); + } + } } }]); - return ColumnStatesManager; -}(); + return MultiColumnSorting; +}(_columnSorting2.default); + +(0, _plugins.registerPlugin)(PLUGIN_KEY, MultiColumnSorting); + +exports.default = MultiColumnSorting; /***/ }), -/* 666 */ +/* 663 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.DomHelper = exports.HEADER_ACTION_CLASS = exports.HEADER_SORT_CLASS = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* eslint-disable import/prefer-default-export */ +exports.rootComparator = rootComparator; -var _utils = __webpack_require__(471); +var _sortService = __webpack_require__(51); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var HEADER_CLASS_ASC_SORT = 'ascending'; -var HEADER_CLASS_DESC_SORT = 'descending'; -var HEADER_CLASS_INDICATOR_DISABLED = 'indicatorDisabled'; -var COLUMN_ORDER_PREFIX = 'sort'; - -var HEADER_SORT_CLASS = exports.HEADER_SORT_CLASS = 'columnSorting'; -var HEADER_ACTION_CLASS = exports.HEADER_ACTION_CLASS = 'sortAction'; - -var orderToCssClass = new Map([[_utils.ASC_SORT_STATE, HEADER_CLASS_ASC_SORT], [_utils.DESC_SORT_STATE, HEADER_CLASS_DESC_SORT]]); +function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } /* eslint-disable import/prefer-default-export */ /** - * Helper for the column sorting plugin. Manages the added and removed classes to DOM elements basing on state of sorting. + * Sort comparator handled by conventional sort algorithm. * - * @class DomHelper - * @plugin MultiColumnSorting + * @param {Array} sortOrders Sort orders (`asc` for ascending, `desc` for descending). + * @param {Array} columnMetas Column meta objects. + * @returns {Function} */ +function rootComparator(sortingOrders, columnMetas) { + return function (rowIndexWithValues, nextRowIndexWithValues) { + // We sort array of arrays. Single array is in form [rowIndex, ...values]. + // We compare just values, stored at second index of array. + var _rowIndexWithValues = _toArray(rowIndexWithValues), + values = _rowIndexWithValues.slice(1); -var DomHelper = exports.DomHelper = function () { - function DomHelper(columnStatesManager) { - _classCallCheck(this, DomHelper); - - /** - * Instance of column states manager. - * - * @private - */ - this.columnStatesManager = columnStatesManager; - } - - /** - * Get CSS classes which should be added to particular column header. - * - * @param {Number} column Physical column index. - * @param {Boolean} showSortIndicator Indicates if indicator should be shown for the particular column. - * @param {Boolean} headerAction Indicates if header click to sort should be possible. - * @returns {Array} Array of CSS classes. - */ - - - _createClass(DomHelper, [{ - key: 'getAddedClasses', - value: function getAddedClasses(column, showSortIndicator, headerAction) { - var cssClasses = [HEADER_SORT_CLASS]; - - if (headerAction) { - cssClasses.push(HEADER_ACTION_CLASS); - } + var _nextRowIndexWithValu = _toArray(nextRowIndexWithValues), + nextValues = _nextRowIndexWithValu.slice(1); - if (showSortIndicator === false) { - cssClasses.push(HEADER_CLASS_INDICATOR_DISABLED); - } else if (this.columnStatesManager.isColumnSorted(column)) { - var columnOrder = this.columnStatesManager.getSortOrderOfColumn(column); + return function getCompareResult(column) { + var sortingOrder = sortingOrders[column]; + var columnMeta = columnMetas[column]; + var value = values[column]; + var nextValue = nextValues[column]; + var pluginSettings = columnMeta.multiColumnSorting; + var compareFunctionFactory = pluginSettings.compareFunctionFactory ? pluginSettings.compareFunctionFactory : (0, _sortService.getCompareFunctionFactory)(columnMeta.type); + var compareResult = compareFunctionFactory(sortingOrder, columnMeta, pluginSettings)(value, nextValue); - cssClasses.push(orderToCssClass.get(columnOrder)); + if (compareResult === _sortService.DO_NOT_SWAP) { + var nextSortedColumn = column + 1; - if (this.columnStatesManager.getNumberOfSortedColumns() > 1) { - cssClasses.push(COLUMN_ORDER_PREFIX + '-' + (this.columnStatesManager.getIndexOfColumnInSortQueue(column) + 1)); + if (typeof columnMetas[nextSortedColumn] !== 'undefined') { + return getCompareResult(nextSortedColumn); } } - return cssClasses; - } - - /** - * Get CSS classes which should be removed from column header. - * - * @param {HTMLElement} htmlElement - * @returns {Array} Array of CSS classes. - */ - - }, { - key: 'getRemovedClasses', - value: function getRemovedClasses(htmlElement) { - var cssClasses = htmlElement.className.split(' '); - var sortSequenceRegExp = new RegExp('^' + COLUMN_ORDER_PREFIX + '-[0-9]{1,2}$'); - var someCssClassesToRemove = cssClasses.filter(function (cssClass) { - return sortSequenceRegExp.test(cssClass); - }); - - return Array.from(orderToCssClass.values()).concat(someCssClassesToRemove, HEADER_ACTION_CLASS, HEADER_CLASS_INDICATOR_DISABLED, HEADER_SORT_CLASS); - } - - /** - * Destroy the helper. - */ - - }, { - key: 'destroy', - value: function destroy() { - this.columnStatesManager = null; - } - }]); - - return DomHelper; -}(); + return compareResult; + }(0); + }; +} /***/ }), -/* 667 */ +/* 664 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; +exports.warnAboutPluginsConflict = warnAboutPluginsConflict; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _console = __webpack_require__(22); -var _arrayMapper = __webpack_require__(51); +/** + * Warn users about problems when using `columnSorting` and `multiColumnSorting` plugins simultaneously. + */ +function warnAboutPluginsConflict() { + (0, _console.warn)('Plugins `columnSorting` and `multiColumnSorting` should not be enabled simultaneously.'); +} /* eslint-disable import/prefer-default-export */ -var _arrayMapper2 = _interopRequireDefault(_arrayMapper); +/***/ }), +/* 665 */ +/***/ (function(module, exports, __webpack_require__) { -var _object = __webpack_require__(1); +"use strict"; -var _number = __webpack_require__(4); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +exports.__esModule = true; +exports.getClassesToAdd = getClassesToAdd; +exports.getClassedToRemove = getClassedToRemove; +/* eslint-disable import/prefer-default-export */ -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var COLUMN_ORDER_PREFIX = 'sort'; /** - * @class RowsMapper - * @plugin MultiColumnSorting + * Get CSS classes which should be added to particular column header. + * + * @param {Object} columnStatesManager Instance of column state manager. + * @param {Number} column Physical column index. + * @param {Boolean} showSortIndicator Indicates if indicator should be shown for the particular column. + * @returns {Array} Array of CSS classes. */ -var RowsMapper = function () { - function RowsMapper(multiColumnSorting) { - _classCallCheck(this, RowsMapper); +function getClassesToAdd(columnStatesManager, column, showSortIndicator) { + var cssClasses = []; - /** - * Instance of MultiColumnSorting plugin. - * - * @type {MultiColumnSorting} - */ - this.multiColumnSorting = multiColumnSorting; + if (showSortIndicator === false) { + return cssClasses; } - /** - * Reset current map array and create new one. - * - * @param {Number} [length] Custom generated map length. - */ - - - _createClass(RowsMapper, [{ - key: 'createMap', - value: function createMap(length) { - var _this = this; - - var originLength = length === void 0 ? this._arrayMap.length : length; - - this._arrayMap.length = 0; - - (0, _number.rangeEach)(originLength - 1, function (itemIndex) { - _this._arrayMap[itemIndex] = itemIndex; - }); - } - - /** - * Destroy class. - */ - - }, { - key: 'destroy', - value: function destroy() { - this._arrayMap = null; - } - }]); + if (columnStatesManager.isColumnSorted(column) && columnStatesManager.getNumberOfSortedColumns() > 1) { + cssClasses.push(COLUMN_ORDER_PREFIX + '-' + (columnStatesManager.getIndexOfColumnInSortQueue(column) + 1)); + } - return RowsMapper; -}(); + return cssClasses; +} -(0, _object.mixin)(RowsMapper, _arrayMapper2.default); +/** + * Get CSS classes which should be removed from column header. + * + * @param {HTMLElement} htmlElement + * @returns {Array} Array of CSS classes. + */ +function getClassedToRemove(htmlElement) { + var cssClasses = htmlElement.className.split(' '); + var sortSequenceRegExp = new RegExp('^' + COLUMN_ORDER_PREFIX + '-[0-9]{1,2}$'); -exports.default = RowsMapper; + return cssClasses.filter(function (cssClass) { + return sortSequenceRegExp.test(cssClass); + }); +} /***/ }), -/* 668 */ +/* 666 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 669 */ +/* 667 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -97316,7 +95833,7 @@ var _get = function get(object, property, receiver) { if (object === null) objec var _templateObject = _taggedTemplateLiteral(['The filter conditions have been applied properly, but couldn\u2019t be displayed visually.\n The overall amount of conditions exceed the capability of the dropdown menu.\n For more details see the documentation.'], ['The filter conditions have been applied properly, but couldn\u2019t be displayed visually.\n The overall amount of conditions exceed the capability of the dropdown menu.\n For more details see the documentation.']); -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -97324,11 +95841,11 @@ var _array = __webpack_require__(0); var _templateLiteralTag = __webpack_require__(26); -var _console = __webpack_require__(20); +var _console = __webpack_require__(22); var _number = __webpack_require__(4); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); @@ -97336,45 +95853,45 @@ var _element = __webpack_require__(2); var _plugins = __webpack_require__(5); -var _predefinedItems = __webpack_require__(43); +var _predefinedItems = __webpack_require__(45); var _constants = __webpack_require__(3); var constants = _interopRequireWildcard(_constants); -var _condition = __webpack_require__(670); +var _condition = __webpack_require__(668); var _condition2 = _interopRequireDefault(_condition); -var _operators = __webpack_require__(690); +var _operators = __webpack_require__(688); var _operators2 = _interopRequireDefault(_operators); -var _value = __webpack_require__(692); +var _value = __webpack_require__(690); var _value2 = _interopRequireDefault(_value); -var _actionBar = __webpack_require__(695); +var _actionBar = __webpack_require__(693); var _actionBar2 = _interopRequireDefault(_actionBar); -var _conditionCollection = __webpack_require__(480); +var _conditionCollection = __webpack_require__(479); var _conditionCollection2 = _interopRequireDefault(_conditionCollection); -var _dataFilter = __webpack_require__(481); +var _dataFilter = __webpack_require__(480); var _dataFilter2 = _interopRequireDefault(_dataFilter); -var _conditionUpdateObserver = __webpack_require__(696); +var _conditionUpdateObserver = __webpack_require__(694); var _conditionUpdateObserver2 = _interopRequireDefault(_conditionUpdateObserver); -var _utils = __webpack_require__(66); +var _utils = __webpack_require__(67); var _constants2 = __webpack_require__(164); -__webpack_require__(697); +__webpack_require__(695); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -98422,7 +96939,7 @@ var Filters = function (_BasePlugin) { exports.default = Filters; /***/ }), -/* 670 */ +/* 668 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -98448,7 +96965,7 @@ var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _base = __webpack_require__(89); +var _base = __webpack_require__(88); var _base2 = _interopRequireDefault(_base); @@ -98460,7 +96977,7 @@ var _input = __webpack_require__(166); var _input2 = _interopRequireDefault(_input); -var _select = __webpack_require__(689); +var _select = __webpack_require__(687); var _select2 = _interopRequireDefault(_select); @@ -98692,9 +97209,12 @@ var ConditionComponent = function (_BaseComponent) { label.textContent = value; wrapper.appendChild(label); - (0, _array.arrayEach)(_this4.elements, function (ui) { - return wrapper.appendChild(ui.element); - }); + + if (!wrapper.parentNode.hasAttribute('ghost-table')) { + (0, _array.arrayEach)(_this4.elements, function (ui) { + return wrapper.appendChild(ui.element); + }); + } return wrapper; } @@ -98785,7 +97305,7 @@ var ConditionComponent = function (_BaseComponent) { exports.default = ConditionComponent; /***/ }), -/* 671 */ +/* 669 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -98840,7 +97360,7 @@ var stateSaver = (_stateSaver = {}, _defineProperty(_stateSaver, PROP_PREFIX, {} exports.default = stateSaver; /***/ }), -/* 672 */ +/* 670 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -98871,7 +97391,7 @@ function condition() { }); /***/ }), -/* 673 */ +/* 671 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -98887,7 +97407,7 @@ var C = _interopRequireWildcard(_constants); var _conditionRegisterer = __webpack_require__(11); -var _empty = __webpack_require__(472); +var _empty = __webpack_require__(471); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -98904,7 +97424,7 @@ function condition(dataRow, inputValues) { }); /***/ }), -/* 674 */ +/* 672 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -98920,7 +97440,7 @@ var C = _interopRequireWildcard(_constants); var _conditionRegisterer = __webpack_require__(11); -var _equal = __webpack_require__(473); +var _equal = __webpack_require__(472); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -98937,7 +97457,7 @@ function condition(dataRow, inputValues) { }); /***/ }), -/* 675 */ +/* 673 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -98980,7 +97500,7 @@ function condition(dataRow, _ref) { }); /***/ }), -/* 676 */ +/* 674 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99023,7 +97543,7 @@ function condition(dataRow, _ref) { }); /***/ }), -/* 677 */ +/* 675 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99066,7 +97586,7 @@ function condition(dataRow, _ref) { }); /***/ }), -/* 678 */ +/* 676 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99109,7 +97629,7 @@ function condition(dataRow, _ref) { }); /***/ }), -/* 679 */ +/* 677 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99125,7 +97645,7 @@ var C = _interopRequireWildcard(_constants); var _conditionRegisterer = __webpack_require__(11); -var _between = __webpack_require__(474); +var _between = __webpack_require__(473); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -99142,7 +97662,7 @@ function condition(dataRow, inputValues) { }); /***/ }), -/* 680 */ +/* 678 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99159,7 +97679,7 @@ var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); var _conditionRegisterer = __webpack_require__(11); @@ -99181,7 +97701,7 @@ function condition(dataRow, _ref) { }); /***/ }), -/* 681 */ +/* 679 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99198,7 +97718,7 @@ var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _mixed = __webpack_require__(8); +var _mixed = __webpack_require__(10); var _conditionRegisterer = __webpack_require__(11); @@ -99220,7 +97740,7 @@ function condition(dataRow, _ref) { }); /***/ }), -/* 682 */ +/* 680 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99236,7 +97756,7 @@ var C = _interopRequireWildcard(_constants); var _conditionRegisterer = __webpack_require__(11); -var _contains = __webpack_require__(477); +var _contains = __webpack_require__(476); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -99253,7 +97773,7 @@ function condition(dataRow, inputValues) { }); /***/ }), -/* 683 */ +/* 681 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99263,7 +97783,7 @@ exports.__esModule = true; exports.CONDITION_NAME = undefined; exports.condition = condition; -var _moment = __webpack_require__(23); +var _moment = __webpack_require__(25); var _moment2 = _interopRequireDefault(_moment); @@ -99295,7 +97815,7 @@ function condition(dataRow) { }); /***/ }), -/* 684 */ +/* 682 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99305,7 +97825,7 @@ exports.__esModule = true; exports.CONDITION_NAME = undefined; exports.condition = condition; -var _moment = __webpack_require__(23); +var _moment = __webpack_require__(25); var _moment2 = _interopRequireDefault(_moment); @@ -99337,7 +97857,7 @@ function condition(dataRow) { }); /***/ }), -/* 685 */ +/* 683 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99347,7 +97867,7 @@ exports.__esModule = true; exports.CONDITION_NAME = undefined; exports.condition = condition; -var _moment = __webpack_require__(23); +var _moment = __webpack_require__(25); var _moment2 = _interopRequireDefault(_moment); @@ -99379,7 +97899,7 @@ function condition(dataRow) { }); /***/ }), -/* 686 */ +/* 684 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99394,7 +97914,7 @@ exports.condition = condition; var _conditionRegisterer = __webpack_require__(11); -var _utils = __webpack_require__(66); +var _utils = __webpack_require__(67); var CONDITION_NAME = exports.CONDITION_NAME = 'by_value'; @@ -99419,7 +97939,7 @@ function condition(dataRow, _ref) { }); /***/ }), -/* 687 */ +/* 685 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99442,7 +97962,7 @@ function condition() { }); /***/ }), -/* 688 */ +/* 686 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99465,7 +97985,7 @@ function condition() { }); /***/ }), -/* 689 */ +/* 687 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99489,9 +98009,9 @@ var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _predefinedItems = __webpack_require__(43); +var _predefinedItems = __webpack_require__(45); -var _base = __webpack_require__(68); +var _base = __webpack_require__(69); var _base2 = _interopRequireDefault(_base); @@ -99770,7 +98290,7 @@ var SelectUI = function (_BaseUI) { exports.default = SelectUI; /***/ }), -/* 690 */ +/* 688 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -99788,19 +98308,19 @@ var _array = __webpack_require__(0); var _templateLiteralTag = __webpack_require__(26); -var _base = __webpack_require__(89); +var _base = __webpack_require__(88); var _base2 = _interopRequireDefault(_base); -var _logicalOperationRegisterer = __webpack_require__(67); +var _logicalOperationRegisterer = __webpack_require__(68); var _conjunction = __webpack_require__(165); -var _disjunction = __webpack_require__(478); +var _disjunction = __webpack_require__(477); -var _disjunctionWithExtraCondition = __webpack_require__(479); +var _disjunctionWithExtraCondition = __webpack_require__(478); -var _radioInput = __webpack_require__(691); +var _radioInput = __webpack_require__(689); var _radioInput2 = _interopRequireDefault(_radioInput); @@ -99859,9 +98379,11 @@ var OperatorsComponent = function (_BaseComponent) { renderer: function renderer(hot, wrapper) { (0, _element.addClass)(wrapper.parentNode, 'htFiltersMenuOperators'); - (0, _array.arrayEach)(_this2.elements, function (ui) { - return wrapper.appendChild(ui.element); - }); + if (!wrapper.parentNode.hasAttribute('ghost-table')) { + (0, _array.arrayEach)(_this2.elements, function (ui) { + return wrapper.appendChild(ui.element); + }); + } return wrapper; } @@ -100019,7 +98541,7 @@ var OperatorsComponent = function (_BaseComponent) { exports.default = OperatorsComponent; /***/ }), -/* 691 */ +/* 689 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -100033,7 +98555,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _object = __webpack_require__(1); -var _base = __webpack_require__(68); +var _base = __webpack_require__(69); var _base2 = _interopRequireDefault(_base); @@ -100161,7 +98683,7 @@ var RadioInputUI = function (_BaseUI) { exports.default = RadioInputUI; /***/ }), -/* 692 */ +/* 690 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -100187,13 +98709,13 @@ var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _utils = __webpack_require__(66); +var _utils = __webpack_require__(67); -var _base = __webpack_require__(89); +var _base = __webpack_require__(88); var _base2 = _interopRequireDefault(_base); -var _multipleSelect = __webpack_require__(693); +var _multipleSelect = __webpack_require__(691); var _multipleSelect2 = _interopRequireDefault(_multipleSelect); @@ -100389,9 +98911,12 @@ var ValueComponent = function (_BaseComponent) { label.textContent = value; wrapper.appendChild(label); - (0, _array.arrayEach)(_this4.elements, function (ui) { - return wrapper.appendChild(ui.element); - }); + + if (!wrapper.parentNode.hasAttribute('ghost-table')) { + (0, _array.arrayEach)(_this4.elements, function (ui) { + return wrapper.appendChild(ui.element); + }); + } return wrapper; } @@ -100455,7 +98980,7 @@ var ValueComponent = function (_BaseComponent) { exports.default = ValueComponent; /***/ }), -/* 693 */ +/* 691 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -100483,7 +99008,7 @@ var C = _interopRequireWildcard(_constants); var _event = __webpack_require__(12); -var _base = __webpack_require__(68); +var _base = __webpack_require__(69); var _base2 = _interopRequireDefault(_base); @@ -100491,11 +99016,11 @@ var _input = __webpack_require__(166); var _input2 = _interopRequireDefault(_input); -var _link = __webpack_require__(694); +var _link = __webpack_require__(692); var _link2 = _interopRequireDefault(_link); -var _utils = __webpack_require__(66); +var _utils = __webpack_require__(67); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -100909,7 +99434,7 @@ function itemsToValue(availableItems) { } /***/ }), -/* 694 */ +/* 692 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -100923,7 +99448,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _object = __webpack_require__(1); -var _base = __webpack_require__(68); +var _base = __webpack_require__(69); var _base2 = _interopRequireDefault(_base); @@ -101000,7 +99525,7 @@ var LinkUI = function (_BaseUI) { exports.default = LinkUI; /***/ }), -/* 695 */ +/* 693 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -101018,7 +99543,7 @@ var _constants = __webpack_require__(3); var C = _interopRequireWildcard(_constants); -var _base = __webpack_require__(89); +var _base = __webpack_require__(88); var _base2 = _interopRequireDefault(_base); @@ -101120,9 +99645,11 @@ var ActionBarComponent = function (_BaseComponent) { renderer: function renderer(hot, wrapper) { (0, _element.addClass)(wrapper.parentNode, 'htFiltersMenuActionBar'); - (0, _array.arrayEach)(_this3.elements, function (ui) { - return wrapper.appendChild(ui.element); - }); + if (!wrapper.parentNode.hasAttribute('ghost-table')) { + (0, _array.arrayEach)(_this3.elements, function (ui) { + return wrapper.appendChild(ui.element); + }); + } return wrapper; } @@ -101174,7 +99701,7 @@ var ActionBarComponent = function (_BaseComponent) { exports.default = ActionBarComponent; /***/ }), -/* 696 */ +/* 694 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -101190,19 +99717,19 @@ var _object = __webpack_require__(1); var _function = __webpack_require__(34); -var _localHooks = __webpack_require__(21); +var _localHooks = __webpack_require__(20); var _localHooks2 = _interopRequireDefault(_localHooks); -var _conditionCollection = __webpack_require__(480); +var _conditionCollection = __webpack_require__(479); var _conditionCollection2 = _interopRequireDefault(_conditionCollection); -var _dataFilter = __webpack_require__(481); +var _dataFilter = __webpack_require__(480); var _dataFilter2 = _interopRequireDefault(_dataFilter); -var _utils = __webpack_require__(66); +var _utils = __webpack_require__(67); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -101458,13 +99985,13 @@ var ConditionUpdateObserver = function () { exports.default = ConditionUpdateObserver; /***/ }), -/* 697 */ +/* 695 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 698 */ +/* 696 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -101478,7 +100005,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -101486,23 +100013,23 @@ var _array = __webpack_require__(0); var _object = __webpack_require__(1); -var _eventManager = __webpack_require__(9); +var _eventManager = __webpack_require__(8); var _eventManager2 = _interopRequireDefault(_eventManager); var _plugins = __webpack_require__(5); -var _utils = __webpack_require__(44); +var _utils = __webpack_require__(46); -var _sheet = __webpack_require__(699); +var _sheet = __webpack_require__(697); var _sheet2 = _interopRequireDefault(_sheet); -var _dataProvider = __webpack_require__(708); +var _dataProvider = __webpack_require__(706); var _dataProvider2 = _interopRequireDefault(_dataProvider); -var _undoRedoSnapshot = __webpack_require__(709); +var _undoRedoSnapshot = __webpack_require__(707); var _undoRedoSnapshot2 = _interopRequireDefault(_undoRedoSnapshot); @@ -102074,7 +100601,7 @@ var Formulas = function (_BasePlugin) { exports.default = Formulas; /***/ }), -/* 699 */ +/* 697 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -102084,11 +100611,11 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _hotFormulaParser = __webpack_require__(69); +var _hotFormulaParser = __webpack_require__(70); var _array = __webpack_require__(0); -var _localHooks = __webpack_require__(21); +var _localHooks = __webpack_require__(20); var _localHooks2 = _interopRequireDefault(_localHooks); @@ -102096,21 +100623,21 @@ var _recordTranslator = __webpack_require__(55); var _object = __webpack_require__(1); -var _value = __webpack_require__(45); +var _value = __webpack_require__(47); var _value2 = _interopRequireDefault(_value); -var _reference = __webpack_require__(700); +var _reference = __webpack_require__(698); var _reference2 = _interopRequireDefault(_reference); -var _utils = __webpack_require__(44); +var _utils = __webpack_require__(46); -var _matrix = __webpack_require__(701); +var _matrix = __webpack_require__(699); var _matrix2 = _interopRequireDefault(_matrix); -var _alterManager = __webpack_require__(702); +var _alterManager = __webpack_require__(700); var _alterManager2 = _interopRequireDefault(_alterManager); @@ -102535,7 +101062,7 @@ var Sheet = function () { exports.default = Sheet; /***/ }), -/* 700 */ +/* 698 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -102545,9 +101072,9 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _hotFormulaParser = __webpack_require__(69); +var _hotFormulaParser = __webpack_require__(70); -var _base = __webpack_require__(482); +var _base = __webpack_require__(481); var _base2 = _interopRequireDefault(_base); @@ -102594,7 +101121,7 @@ var CellReference = function (_BaseCell) { exports.default = CellReference; /***/ }), -/* 701 */ +/* 699 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -102606,7 +101133,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _array = __webpack_require__(0); -var _value = __webpack_require__(45); +var _value = __webpack_require__(47); var _value2 = _interopRequireDefault(_value); @@ -102850,7 +101377,7 @@ var Matrix = function () { exports.default = Matrix; /***/ }), -/* 702 */ +/* 700 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -102864,27 +101391,27 @@ exports.registerOperation = registerOperation; var _object = __webpack_require__(1); -var _localHooks = __webpack_require__(21); +var _localHooks = __webpack_require__(20); var _localHooks2 = _interopRequireDefault(_localHooks); -var _columnSorting = __webpack_require__(703); +var _columnSorting = __webpack_require__(701); var columnSorting = _interopRequireWildcard(_columnSorting); -var _insertColumn = __webpack_require__(704); +var _insertColumn = __webpack_require__(702); var insertColumn = _interopRequireWildcard(_insertColumn); -var _insertRow = __webpack_require__(705); +var _insertRow = __webpack_require__(703); var insertRow = _interopRequireWildcard(_insertRow); -var _removeColumn = __webpack_require__(706); +var _removeColumn = __webpack_require__(704); var removeColumn = _interopRequireWildcard(_removeColumn); -var _removeRow = __webpack_require__(707); +var _removeRow = __webpack_require__(705); var removeRow = _interopRequireWildcard(_removeRow); @@ -103024,7 +101551,7 @@ function registerOperation(name, descriptor) { } /***/ }), -/* 703 */ +/* 701 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -103037,13 +101564,13 @@ exports.operate = operate; var _array = __webpack_require__(0); -var _utils = __webpack_require__(44); +var _utils = __webpack_require__(46); -var _value = __webpack_require__(45); +var _value = __webpack_require__(47); var _value2 = _interopRequireDefault(_value); -var _expressionModifier = __webpack_require__(70); +var _expressionModifier = __webpack_require__(71); var _expressionModifier2 = _interopRequireDefault(_expressionModifier); @@ -103108,7 +101635,7 @@ function operate() { } /***/ }), -/* 704 */ +/* 702 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -103120,13 +101647,13 @@ exports.operate = operate; var _array = __webpack_require__(0); -var _utils = __webpack_require__(44); +var _utils = __webpack_require__(46); -var _value = __webpack_require__(45); +var _value = __webpack_require__(47); var _value2 = _interopRequireDefault(_value); -var _expressionModifier = __webpack_require__(70); +var _expressionModifier = __webpack_require__(71); var _expressionModifier2 = _interopRequireDefault(_expressionModifier); @@ -103213,7 +101740,7 @@ function customTranslateModifier(cell, axis, delta, startFromIndex) { } /***/ }), -/* 705 */ +/* 703 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -103225,13 +101752,13 @@ exports.operate = operate; var _array = __webpack_require__(0); -var _utils = __webpack_require__(44); +var _utils = __webpack_require__(46); -var _value = __webpack_require__(45); +var _value = __webpack_require__(47); var _value2 = _interopRequireDefault(_value); -var _expressionModifier = __webpack_require__(70); +var _expressionModifier = __webpack_require__(71); var _expressionModifier2 = _interopRequireDefault(_expressionModifier); @@ -103318,7 +101845,7 @@ function customTranslateModifier(cell, axis, delta, startFromIndex) { } /***/ }), -/* 706 */ +/* 704 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -103330,13 +101857,13 @@ exports.operate = operate; var _array = __webpack_require__(0); -var _utils = __webpack_require__(44); +var _utils = __webpack_require__(46); -var _value = __webpack_require__(45); +var _value = __webpack_require__(47); var _value2 = _interopRequireDefault(_value); -var _expressionModifier = __webpack_require__(70); +var _expressionModifier = __webpack_require__(71); var _expressionModifier2 = _interopRequireDefault(_expressionModifier); @@ -103475,7 +102002,7 @@ function customTranslateModifier(cell, axis, delta, startFromIndex) { } /***/ }), -/* 707 */ +/* 705 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -103487,13 +102014,13 @@ exports.operate = operate; var _array = __webpack_require__(0); -var _utils = __webpack_require__(44); +var _utils = __webpack_require__(46); -var _value = __webpack_require__(45); +var _value = __webpack_require__(47); var _value2 = _interopRequireDefault(_value); -var _expressionModifier = __webpack_require__(70); +var _expressionModifier = __webpack_require__(71); var _expressionModifier2 = _interopRequireDefault(_expressionModifier); @@ -103632,7 +102159,7 @@ function customTranslateModifier(cell, axis, delta, startFromIndex) { } /***/ }), -/* 708 */ +/* 706 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -103924,7 +102451,7 @@ var DataProvider = function () { exports.default = DataProvider; /***/ }), -/* 709 */ +/* 707 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -103936,11 +102463,11 @@ var _createClass = function () { function defineProperties(target, props) { for var _array = __webpack_require__(0); -var _stack = __webpack_require__(710); +var _stack = __webpack_require__(708); var _stack2 = _interopRequireDefault(_stack); -var _value = __webpack_require__(45); +var _value = __webpack_require__(47); var _value2 = _interopRequireDefault(_value); @@ -104059,7 +102586,7 @@ var UndoRedoSnapshot = function () { exports.default = UndoRedoSnapshot; /***/ }), -/* 710 */ +/* 708 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -104159,7 +102686,7 @@ var Stack = function () { exports.default = Stack; /***/ }), -/* 711 */ +/* 709 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -104171,7 +102698,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -104179,23 +102706,23 @@ var _element = __webpack_require__(2); var _object = __webpack_require__(1); -var _console = __webpack_require__(20); +var _console = __webpack_require__(22); -var _data = __webpack_require__(83); +var _data = __webpack_require__(84); var _plugins = __webpack_require__(5); var _utils = __webpack_require__(167); -var _dateCalculator = __webpack_require__(712); +var _dateCalculator = __webpack_require__(710); var _dateCalculator2 = _interopRequireDefault(_dateCalculator); -var _ganttChartDataFeed = __webpack_require__(713); +var _ganttChartDataFeed = __webpack_require__(711); var _ganttChartDataFeed2 = _interopRequireDefault(_ganttChartDataFeed); -__webpack_require__(714); +__webpack_require__(712); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -105175,7 +103702,7 @@ var GanttChart = function (_BasePlugin) { exports.default = GanttChart; /***/ }), -/* 712 */ +/* 710 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -105191,7 +103718,7 @@ var _array = __webpack_require__(0); var _object = __webpack_require__(1); -var _console = __webpack_require__(20); +var _console = __webpack_require__(22); var _utils = __webpack_require__(167); @@ -105943,7 +104470,7 @@ var DateCalculator = function () { exports.default = DateCalculator; /***/ }), -/* 713 */ +/* 711 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -106374,13 +104901,13 @@ var GanttChartDataFeed = function () { exports.default = GanttChartDataFeed; /***/ }), -/* 714 */ +/* 712 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 715 */ +/* 713 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -106398,7 +104925,7 @@ var _plugins = __webpack_require__(5); var _number = __webpack_require__(4); -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -106607,7 +105134,7 @@ var HeaderTooltips = function (_BasePlugin) { exports.default = HeaderTooltips; /***/ }), -/* 716 */ +/* 714 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -106632,21 +105159,21 @@ var _object = __webpack_require__(1); var _templateLiteralTag = __webpack_require__(26); -var _console = __webpack_require__(20); +var _console = __webpack_require__(22); var _plugins = __webpack_require__(5); -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); -var _ghostTable = __webpack_require__(717); +var _ghostTable = __webpack_require__(715); var _ghostTable2 = _interopRequireDefault(_ghostTable); -__webpack_require__(718); +__webpack_require__(716); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -107435,7 +105962,7 @@ var NestedHeaders = function (_BasePlugin) { exports.default = NestedHeaders; /***/ }), -/* 717 */ +/* 715 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -107586,13 +106113,13 @@ var GhostTable = function () { exports.default = GhostTable; /***/ }), -/* 718 */ +/* 716 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 719 */ +/* 717 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -107604,7 +106131,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -107614,25 +106141,25 @@ var _number = __webpack_require__(4); var _array = __webpack_require__(0); -var _src = __webpack_require__(10); +var _src = __webpack_require__(9); -var _dataManager = __webpack_require__(720); +var _dataManager = __webpack_require__(718); var _dataManager2 = _interopRequireDefault(_dataManager); -var _collapsing = __webpack_require__(721); +var _collapsing = __webpack_require__(719); var _collapsing2 = _interopRequireDefault(_collapsing); -var _headers = __webpack_require__(483); +var _headers = __webpack_require__(482); var _headers2 = _interopRequireDefault(_headers); -var _contextMenu = __webpack_require__(722); +var _contextMenu = __webpack_require__(720); var _contextMenu2 = _interopRequireDefault(_contextMenu); -__webpack_require__(723); +__webpack_require__(721); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -108332,7 +106859,7 @@ var NestedRows = function (_BasePlugin) { exports.default = NestedRows; /***/ }), -/* 720 */ +/* 718 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -109116,7 +107643,7 @@ var DataManager = function () { exports.default = DataManager; /***/ }), -/* 721 */ +/* 719 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -109138,7 +107665,7 @@ var _base = __webpack_require__(168); var _base2 = _interopRequireDefault(_base); -var _headers = __webpack_require__(483); +var _headers = __webpack_require__(482); var _headers2 = _interopRequireDefault(_headers); @@ -109708,7 +108235,7 @@ var CollapsingUI = function (_BaseUI) { exports.default = CollapsingUI; /***/ }), -/* 722 */ +/* 720 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -109868,13 +108395,13 @@ var ContextMenuUI = function (_BaseUI) { exports.default = ContextMenuUI; /***/ }), -/* 723 */ +/* 721 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 724 */ +/* 722 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -109888,7 +108415,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -109900,17 +108427,17 @@ var _array = __webpack_require__(0); var _plugins = __webpack_require__(5); -var _predefinedItems = __webpack_require__(43); +var _predefinedItems = __webpack_require__(45); -var _hideColumn = __webpack_require__(725); +var _hideColumn = __webpack_require__(723); var _hideColumn2 = _interopRequireDefault(_hideColumn); -var _showColumn = __webpack_require__(726); +var _showColumn = __webpack_require__(724); var _showColumn2 = _interopRequireDefault(_showColumn); -__webpack_require__(727); +__webpack_require__(725); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -110636,7 +109163,7 @@ function hiddenRenderer(hotInstance, td) { exports.default = HiddenColumns; /***/ }), -/* 725 */ +/* 723 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -110699,7 +109226,7 @@ function hideColumnItem(hiddenColumnsPlugin) { } /***/ }), -/* 726 */ +/* 724 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -110839,13 +109366,13 @@ function showColumnItem(hiddenColumnsPlugin) { } /***/ }), -/* 727 */ +/* 725 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 728 */ +/* 726 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -110859,7 +109386,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -110871,15 +109398,15 @@ var _array = __webpack_require__(0); var _plugins = __webpack_require__(5); -var _hideRow = __webpack_require__(729); +var _hideRow = __webpack_require__(727); var _hideRow2 = _interopRequireDefault(_hideRow); -var _showRow = __webpack_require__(730); +var _showRow = __webpack_require__(728); var _showRow2 = _interopRequireDefault(_showRow); -__webpack_require__(731); +__webpack_require__(729); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -111605,7 +110132,7 @@ var HiddenRows = function (_BasePlugin) { exports.default = HiddenRows; /***/ }), -/* 729 */ +/* 727 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -111668,7 +110195,7 @@ function hideRowItem(hiddenRowsPlugin) { } /***/ }), -/* 730 */ +/* 728 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -111811,13 +110338,13 @@ function showRowItem(hiddenRowsPlugin) { } /***/ }), -/* 731 */ +/* 729 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 732 */ +/* 730 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -111829,7 +110356,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _base = __webpack_require__(6); +var _base = __webpack_require__(7); var _base2 = _interopRequireDefault(_base); @@ -111839,7 +110366,7 @@ var _number = __webpack_require__(4); var _plugins = __webpack_require__(5); -var _rowsMapper = __webpack_require__(733); +var _rowsMapper = __webpack_require__(731); var _rowsMapper2 = _interopRequireDefault(_rowsMapper); @@ -112263,7 +110790,7 @@ var TrimRows = function (_BasePlugin) { exports.default = TrimRows; /***/ }), -/* 733 */ +/* 731 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -112273,7 +110800,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _arrayMapper = __webpack_require__(51); +var _arrayMapper = __webpack_require__(56); var _arrayMapper2 = _interopRequireDefault(_arrayMapper); diff --git a/dist/handsontable.full.min.css b/dist/handsontable.full.min.css index d6d63645..d6686fd4 100644 --- a/dist/handsontable.full.min.css +++ b/dist/handsontable.full.min.css @@ -21,8 +21,8 @@ * RELIABILITY AND PERFORMANCE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SOFTWARE WILL BE * UNINTERRUPTED OR ERROR FREE. * - * Version: 6.1.1 - * Release date: 23/10/2018 (built at 23/10/2018 12:22:42) + * Version: 6.2.0 + * Release date: 14/11/2018 (built at 14/11/2018 12:23:10) */.handsontable .table td,.handsontable .table th{border-top:none}.handsontable tr{background:#fff}.handsontable td{background-color:inherit}.handsontable .table caption+thead tr:first-child td,.handsontable .table caption+thead tr:first-child th,.handsontable .table colgroup+thead tr:first-child td,.handsontable .table colgroup+thead tr:first-child th,.handsontable .table thead:first-child tr:first-child td,.handsontable .table thead:first-child tr:first-child th{border-top:1px solid #ccc}.handsontable .table-bordered{border:0;border-collapse:separate}.handsontable .table-bordered td,.handsontable .table-bordered th{border-left:none}.handsontable .table-bordered td:first-child,.handsontable .table-bordered th:first-child{border-left:1px solid #ccc}.handsontable .table>tbody>tr>td,.handsontable .table>tbody>tr>th,.handsontable .table>tfoot>tr>td,.handsontable .table>tfoot>tr>th,.handsontable .table>thead>tr>td,.handsontable .table>thead>tr>th{line-height:21px;padding:0 4px}.col-lg-1.handsontable,.col-lg-2.handsontable,.col-lg-3.handsontable,.col-lg-4.handsontable,.col-lg-5.handsontable,.col-lg-6.handsontable,.col-lg-7.handsontable,.col-lg-8.handsontable,.col-lg-9.handsontable,.col-lg-10.handsontable,.col-lg-11.handsontable,.col-lg-12.handsontable,.col-md-1.handsontable,.col-md-2.handsontable,.col-md-3.handsontable,.col-md-4.handsontable,.col-md-5.handsontable,.col-md-6.handsontable,.col-md-7.handsontable,.col-md-8.handsontable,.col-md-9.handsontable .col-sm-1.handsontable,.col-md-10.handsontable,.col-md-11.handsontable,.col-md-12.handsontable,.col-sm-2.handsontable,.col-sm-3.handsontable,.col-sm-4.handsontable,.col-sm-5.handsontable,.col-sm-6.handsontable,.col-sm-7.handsontable,.col-sm-8.handsontable,.col-sm-9.handsontable .col-xs-1.handsontable,.col-sm-10.handsontable,.col-sm-11.handsontable,.col-sm-12.handsontable,.col-xs-2.handsontable,.col-xs-3.handsontable,.col-xs-4.handsontable,.col-xs-5.handsontable,.col-xs-6.handsontable,.col-xs-7.handsontable,.col-xs-8.handsontable,.col-xs-9.handsontable,.col-xs-10.handsontable,.col-xs-11.handsontable,.col-xs-12.handsontable{padding-left:0;padding-right:0}.handsontable .table-striped>tbody>tr:nth-of-type(2n){background-color:#fff}.handsontable{position:relative}.handsontable .hide{display:none}.handsontable .relative{position:relative}.handsontable.htAutoSize{visibility:hidden;left:-99000px;position:absolute;top:-99000px}.handsontable .wtHider{width:0}.handsontable .wtSpreader{position:relative;width:0;height:auto}.handsontable div,.handsontable input,.handsontable table,.handsontable tbody,.handsontable td,.handsontable textarea,.handsontable th,.handsontable thead{box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box}.handsontable input,.handsontable textarea{min-height:0}.handsontable table.htCore{border-collapse:separate;border-spacing:0;margin:0;border-width:0;table-layout:fixed;width:0;outline-width:0;cursor:default;max-width:none;max-height:none}.handsontable col,.handsontable col.rowHeader{width:50px}.handsontable td,.handsontable th{border-top-width:0;border-left-width:0;border-right:1px solid #ccc;border-bottom:1px solid #ccc;height:22px;empty-cells:show;line-height:21px;padding:0 4px;background-color:#fff;vertical-align:top;overflow:hidden;outline-width:0;white-space:pre-line;background-clip:padding-box}.handsontable td.htInvalid{background-color:#ff4c42!important}.handsontable td.htNoWrap{white-space:nowrap}.handsontable th:last-child{border-right:1px solid #ccc;border-bottom:1px solid #ccc}.handsontable th.htNoFrame,.handsontable th:first-child.htNoFrame,.handsontable tr:first-child th.htNoFrame{border-left-width:0;background-color:#fff;border-color:#fff}.handsontable .htNoFrame+td,.handsontable .htNoFrame+th,.handsontable.htRowHeaders thead tr th:nth-child(2),.handsontable td:first-of-type,.handsontable th:first-child,.handsontable th:nth-child(2){border-left:1px solid #ccc}.handsontable tr:first-child td,.handsontable tr:first-child th{border-top:1px solid #ccc}.ht_master:not(.innerBorderLeft):not(.emptyColumns)~.handsontable:not(.ht_clone_top) thead tr th:first-child,.ht_master:not(.innerBorderLeft):not(.emptyColumns)~.handsontable tbody tr th{border-right-width:0}.ht_master:not(.innerBorderTop) thead tr.lastChild th,.ht_master:not(.innerBorderTop) thead tr:last-child th,.ht_master:not(.innerBorderTop)~.handsontable thead tr.lastChild th,.ht_master:not(.innerBorderTop)~.handsontable thead tr:last-child th{border-bottom-width:0}.handsontable th{background-color:#f0f0f0;color:#222;text-align:center;font-weight:400;white-space:nowrap}.handsontable thead th{padding:0}.handsontable th.active{background-color:#ccc}.handsontable thead th .relative{padding:2px 4px}#hot-display-license-info{font-size:10px;color:#323232;padding:5px 0 3px;font-family:Helvetica,Arial,sans-serif;text-align:left}.handsontable .manualColumnResizer{position:fixed;top:0;cursor:col-resize;z-index:110;width:5px;height:25px}.handsontable .manualRowResizer{position:fixed;left:0;cursor:row-resize;z-index:110;height:5px;width:50px}.handsontable .manualColumnResizer.active,.handsontable .manualColumnResizer:hover,.handsontable .manualRowResizer.active,.handsontable .manualRowResizer:hover{background-color:#34a9db}.handsontable .manualColumnResizerGuide{position:fixed;right:0;top:0;background-color:#34a9db;display:none;width:0;border-right:1px dashed #777;margin-left:5px}.handsontable .manualRowResizerGuide{position:fixed;left:0;bottom:0;background-color:#34a9db;display:none;height:0;border-bottom:1px dashed #777;margin-top:5px}.handsontable .manualColumnResizerGuide.active,.handsontable .manualRowResizerGuide.active{display:block;z-index:199}.handsontable .columnSorting{position:relative}.handsontable .columnSorting.sortAction:hover{text-decoration:underline;cursor:pointer}.handsontable span.colHeader{display:inline-block;line-height:1.1}.handsontable span.colHeader.columnSorting:before{top:50%;margin-top:-6px;padding-left:8px;position:absolute;right:-9px;content:"";height:10px;width:5px;background-size:contain;background-repeat:no-repeat;background-position-x:right}.handsontable span.colHeader.columnSorting.ascending:before{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAMAAADJ7yrpAAAAKlBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKE86IAAAADXRSTlMABBEmRGprlJW72e77tTkTKwAAAFNJREFUeAHtzjkSgCAUBNHPgsoy97+ulGXRqJE5L+xkxoYt2UdsLb5bqFINz+aLuuLn5rIu2RkO3fZpWENimNgiw6iBYRTPMLJjGFxQZ1hxxb/xBI1qC8k39CdKAAAAAElFTkSuQmCC")}.handsontable span.colHeader.columnSorting.descending:before{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAMAAADJ7yrpAAAAKlBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKE86IAAAADXRSTlMABBEmRGprlJW72e77tTkTKwAAAFJJREFUeAHtzjkSgCAQRNFmQYUZ7n9dKUvru0TmvPAn3br0QfgdZ5xx6x+rQn23GqTYnq1FDcnuzZIO2WmedVqIRVxgGKEyjNgYRjKGkZ1hFIZ3I70LyM0VtU8AAAAASUVORK5CYII=")}.htGhostTable .htCore span.colHeader.columnSorting:not(.indicatorDisabled):after{content:"*";display:inline-block;position:relative;padding-right:20px}.handsontable .wtBorder{position:absolute;font-size:0}.handsontable .wtBorder.hidden{display:none!important}.handsontable .wtBorder.current{z-index:10}.handsontable .wtBorder.area{z-index:8}.handsontable .wtBorder.fill{z-index:6}.handsontable td.area,.handsontable td.area-1,.handsontable td.area-2,.handsontable td.area-3,.handsontable td.area-4,.handsontable td.area-5,.handsontable td.area-6,.handsontable td.area-7{position:relative}.handsontable td.area-1:before,.handsontable td.area-2:before,.handsontable td.area-3:before,.handsontable td.area-4:before,.handsontable td.area-5:before,.handsontable td.area-6:before,.handsontable td.area-7:before,.handsontable td.area:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;bottom:-100%\9;background:#005eff}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.handsontable td.area-1:before,.handsontable td.area-2:before,.handsontable td.area-3:before,.handsontable td.area-4:before,.handsontable td.area-5:before,.handsontable td.area-6:before,.handsontable td.area-7:before,.handsontable td.area:before{bottom:-100%}}.handsontable td.area:before{opacity:.1}.handsontable td.area-1:before{opacity:.2}.handsontable td.area-2:before{opacity:.27}.handsontable td.area-3:before{opacity:.35}.handsontable td.area-4:before{opacity:.41}.handsontable td.area-5:before{opacity:.47}.handsontable td.area-6:before{opacity:.54}.handsontable td.area-7:before{opacity:.58}.handsontable tbody th.ht__highlight,.handsontable thead th.ht__highlight{background-color:#dcdcdc}.handsontable tbody th.ht__active_highlight,.handsontable thead th.ht__active_highlight{background-color:#8eb0e7;color:#000}.handsontable .wtBorder.corner{font-size:0;cursor:crosshair}.handsontable .htBorder.htFillBorder{background:red;width:1px;height:1px}.handsontableInput{border:none;outline-width:0;margin:0;padding:1px 5px 0;font-family:inherit;line-height:21px;font-size:inherit;box-shadow:inset 0 0 0 2px #5292f7;resize:none;display:block;color:#000;border-radius:0;background-color:#fff}.handsontableInputHolder{position:absolute;top:0;left:0;z-index:104}.htSelectEditor{-webkit-appearance:menulist-button!important;position:absolute;width:auto}.handsontable .htDimmed{color:#777}.handsontable .htSubmenu{position:relative}.handsontable .htSubmenu :after{content:"\25B6";color:#777;position:absolute;right:5px;font-size:9px}.handsontable .htLeft{text-align:left}.handsontable .htCenter{text-align:center}.handsontable .htRight{text-align:right}.handsontable .htJustify{text-align:justify}.handsontable .htTop{vertical-align:top}.handsontable .htMiddle{vertical-align:middle}.handsontable .htBottom{vertical-align:bottom}.handsontable .htPlaceholder{color:#999}.handsontable .htAutocompleteArrow{float:right;font-size:10px;color:#eee;cursor:default;width:16px;text-align:center}.handsontable td .htAutocompleteArrow:hover{color:#777}.handsontable td.area .htAutocompleteArrow{color:#d3d3d3}.handsontable .htCheckboxRendererInput{display:inline-block}.handsontable .htCheckboxRendererInput.noValue{opacity:.5}.handsontable .htCheckboxRendererLabel{cursor:pointer;display:inline-block;width:100%}.handsontable .handsontable.ht_clone_top .wtHider{padding:0 0 5px}.handsontable .autocompleteEditor.handsontable{padding-right:17px}.handsontable .autocompleteEditor.handsontable.htMacScroll{padding-right:15px}.handsontable.listbox{margin:0}.handsontable.listbox .ht_master table{border:1px solid #ccc;border-collapse:separate;background:#fff}.handsontable.listbox td,.handsontable.listbox th,.handsontable.listbox tr:first-child td,.handsontable.listbox tr:first-child th,.handsontable.listbox tr:last-child th{border-color:transparent}.handsontable.listbox td,.handsontable.listbox th{white-space:nowrap;text-overflow:ellipsis}.handsontable.listbox td.htDimmed{cursor:default;color:inherit;font-style:inherit}.handsontable.listbox .wtBorder{visibility:hidden}.handsontable.listbox tr:hover td,.handsontable.listbox tr td.current{background:#eee}.ht_clone_top{z-index:101}.ht_clone_left{z-index:102}.ht_clone_bottom_left_corner,.ht_clone_debug,.ht_clone_top_left_corner{z-index:103}.handsontable td.htSearchResult{background:#fcedd9;color:#583707}.htBordered{border-width:1px}.htBordered.htTopBorderSolid{border-top-style:solid;border-top-color:#000}.htBordered.htRightBorderSolid{border-right-style:solid;border-right-color:#000}.htBordered.htBottomBorderSolid{border-bottom-style:solid;border-bottom-color:#000}.htBordered.htLeftBorderSolid{border-left-style:solid;border-left-color:#000}.handsontable tbody tr th:nth-last-child(2){border-right:1px solid #ccc}.handsontable thead tr:nth-last-child(2) th.htGroupIndicatorContainer{border-bottom:1px solid #ccc;padding-bottom:5px}.ht_clone_top_left_corner thead tr th:nth-last-child(2){border-right:1px solid #ccc}.htCollapseButton{width:10px;height:10px;line-height:10px;text-align:center;border-radius:5px;border:1px solid #f3f3f3;box-shadow:1px 1px 3px rgba(0,0,0,.4);cursor:pointer;margin-bottom:3px;position:relative}.htCollapseButton:after{content:"";height:300%;width:1px;display:block;background:#ccc;margin-left:4px;position:absolute;bottom:10px}thead .htCollapseButton{right:5px;position:absolute;top:5px;background:#fff}thead .htCollapseButton:after{height:1px;width:700%;right:10px;top:4px}.handsontable tr th .htExpandButton{position:absolute;width:10px;height:10px;line-height:10px;text-align:center;border-radius:5px;border:1px solid #f3f3f3;box-shadow:1px 1px 3px rgba(0,0,0,.4);cursor:pointer;top:0;display:none}.handsontable thead tr th .htExpandButton{top:5px}.handsontable tr th .htExpandButton.clickable{display:block}.collapsibleIndicator{position:absolute;top:50%;transform:translateY(-50%);right:5px;border:1px solid #a6a6a6;line-height:10px;color:#222;border-radius:10px;font-size:10px;width:10px;height:10px;cursor:pointer;box-shadow:0 0 0 6px #eee;background:#eee}.handsontable col.hidden{width:0!important}.handsontable table tr th.lightRightBorder{border-right:1px solid #e6e6e6}.handsontable tr.hidden,.handsontable tr.hidden td,.handsontable tr.hidden th{display:none}.ht_clone_bottom,.ht_clone_left,.ht_clone_top,.ht_master{overflow:hidden}.ht_master .wtHolder{overflow:auto}.handsontable .ht_clone_left thead,.handsontable .ht_master thead,.handsontable .ht_master tr th{visibility:hidden}.ht_clone_bottom .wtHolder,.ht_clone_left .wtHolder,.ht_clone_top .wtHolder{overflow:hidden}.handsontable.mobile,.handsontable.mobile .wtHolder{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-overflow-scrolling:touch}.htMobileEditorContainer{display:none;position:absolute;top:0;width:70%;height:54pt;background:#f8f8f8;border-radius:20px;border:1px solid #ebebeb;z-index:999;box-sizing:border-box;-webkit-box-sizing:border-box;-webkit-text-size-adjust:none}.topLeftSelectionHandle-HitArea:not(.ht_master .topLeftSelectionHandle-HitArea),.topLeftSelectionHandle:not(.ht_master .topLeftSelectionHandle){z-index:9999}.bottomRightSelectionHandle,.bottomRightSelectionHandle-HitArea,.topLeftSelectionHandle,.topLeftSelectionHandle-HitArea{left:-10000px;top:-10000px}.htMobileEditorContainer.active{display:block}.htMobileEditorContainer .inputs{position:absolute;right:210pt;bottom:10pt;top:10pt;left:14px;height:34pt}.htMobileEditorContainer .inputs textarea{font-size:13pt;border:1px solid #a1a1a1;-webkit-appearance:none;box-shadow:none;position:absolute;left:14px;right:14px;top:0;bottom:0;padding:7pt}.htMobileEditorContainer .cellPointer{position:absolute;top:-13pt;height:0;width:0;left:30px;border-left:13pt solid transparent;border-right:13pt solid transparent;border-bottom:13pt solid #ebebeb}.htMobileEditorContainer .cellPointer.hidden{display:none}.htMobileEditorContainer .cellPointer:before{content:"";display:block;position:absolute;top:2px;height:0;width:0;left:-13pt;border-left:13pt solid transparent;border-right:13pt solid transparent;border-bottom:13pt solid #f8f8f8}.htMobileEditorContainer .moveHandle{position:absolute;top:10pt;left:5px;width:30px;bottom:0;cursor:move;z-index:9999}.htMobileEditorContainer .moveHandle:after{content:"..\A..\A..\A..";white-space:pre;line-height:10px;font-size:20pt;display:inline-block;margin-top:-8px;color:#ebebeb}.htMobileEditorContainer .positionControls{width:205pt;position:absolute;right:5pt;top:0;bottom:0}.htMobileEditorContainer .positionControls>div{width:50pt;height:100%;float:left}.htMobileEditorContainer .positionControls>div:after{content:" ";display:block;width:15pt;height:15pt;text-align:center;line-height:50pt}.htMobileEditorContainer .downButton:after,.htMobileEditorContainer .leftButton:after,.htMobileEditorContainer .rightButton:after,.htMobileEditorContainer .upButton:after{transform-origin:5pt 5pt;-webkit-transform-origin:5pt 5pt;margin:21pt 0 0 21pt}.htMobileEditorContainer .leftButton:after{border-top:2px solid #288ffe;border-left:2px solid #288ffe;-webkit-transform:rotate(-45deg)}.htMobileEditorContainer .leftButton:active:after{border-color:#cfcfcf}.htMobileEditorContainer .rightButton:after{border-top:2px solid #288ffe;border-left:2px solid #288ffe;-webkit-transform:rotate(135deg)}.htMobileEditorContainer .rightButton:active:after{border-color:#cfcfcf}.htMobileEditorContainer .upButton:after{border-top:2px solid #288ffe;border-left:2px solid #288ffe;-webkit-transform:rotate(45deg)}.htMobileEditorContainer .upButton:active:after{border-color:#cfcfcf}.htMobileEditorContainer .downButton:after{border-top:2px solid #288ffe;border-left:2px solid #288ffe;-webkit-transform:rotate(225deg)}.htMobileEditorContainer .downButton:active:after{border-color:#cfcfcf}.handsontable.hide-tween{animation:opacity-hide .3s;animation-fill-mode:forwards;-webkit-animation-fill-mode:forwards}.handsontable.show-tween{animation:opacity-show .3s;animation-fill-mode:forwards;-webkit-animation-fill-mode:forwards} /*! @@ -37,7 +37,7 @@ */.handsontable .changeType{background:#eee;border-radius:2px;border:1px solid #bbb;color:#bbb;font-size:9px;line-height:9px;padding:2px;margin:3px 1px 0 5px;float:right}.handsontable .changeType:before{content:"\25BC "}.handsontable .changeType:hover{border:1px solid #777;color:#777;cursor:pointer}.htDropdownMenu:not(.htGhostTable){display:none;position:absolute;z-index:1060}.htDropdownMenu .ht_clone_corner,.htDropdownMenu .ht_clone_debug,.htDropdownMenu .ht_clone_left,.htDropdownMenu .ht_clone_top{display:none}.htDropdownMenu table.htCore{border:1px solid #bbb;border-bottom-width:2px;border-right-width:2px}.htDropdownMenu .wtBorder{visibility:hidden}.htDropdownMenu table tbody tr td{background:#fff;border-width:0;padding:4px 6px 0;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.htDropdownMenu table tbody tr td:first-child{border:0}.htDropdownMenu table tbody tr td.htDimmed{font-style:normal;color:#323232}.htDropdownMenu table tbody tr td.current,.htDropdownMenu table tbody tr td.zeroclipboard-is-hover{background:#e9e9e9}.htDropdownMenu table tbody tr td.htSeparator{border-top:1px solid #e6e6e6;height:0;padding:0;cursor:default}.htDropdownMenu table tbody tr td.htDisabled{color:#999}.htDropdownMenu table tbody tr td.htDisabled:hover{background:#fff;color:#999;cursor:default}.htDropdownMenu:not(.htGhostTable) table tbody tr.htHidden{display:none}.htDropdownMenu table tbody tr td .htItemWrapper{margin-left:10px;margin-right:10px}.htDropdownMenu table tbody tr td div span.selected{margin-top:-2px;position:absolute;left:4px}.htDropdownMenu .ht_master .wtHolder{overflow:hidden}.handsontable span.colHeader.columnSorting:after{top:50%;margin-top:-2px;position:absolute;right:-15px;padding-left:5px;font-size:8px;height:8px;line-height:1.1;text-decoration:underline;text-decoration:none}.handsontable span.colHeader.columnSorting[class*=" sort-"]:after,.handsontable span.colHeader.columnSorting[class^=sort-]:after{content:"+"}.handsontable span.colHeader.columnSorting.sort-1:after{content:"1"}.handsontable span.colHeader.columnSorting.sort-2:after{content:"2"}.handsontable span.colHeader.columnSorting.sort-3:after{content:"3"}.handsontable span.colHeader.columnSorting.sort-4:after{content:"4"}.handsontable span.colHeader.columnSorting.sort-5:after{content:"5"}.handsontable span.colHeader.columnSorting.sort-6:after{content:"6"}.handsontable span.colHeader.columnSorting.sort-7:after{content:"7"}.htGhostTable th div button.changeType+span.colHeader.columnSorting:not(.indicatorDisabled){padding-right:5px} /*! * Handsontable Filters - */.htFiltersConditionsMenu:not(.htGhostTable){display:none;position:absolute;z-index:1070}.htFiltersConditionsMenu .ht_clone_corner,.htFiltersConditionsMenu .ht_clone_debug,.htFiltersConditionsMenu .ht_clone_left,.htFiltersConditionsMenu .ht_clone_top,.htGhostTable .htUIMultipleSelectHot,.htGhostTable .htUISelect{display:none}.htFiltersConditionsMenu table.htCore{border:1px solid #bbb;border-bottom-width:2px;border-right-width:2px}.htFiltersConditionsMenu .wtBorder{visibility:hidden}.htFiltersConditionsMenu table tbody tr td{background:#fff;border-width:0;padding:4px 6px 0;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.htFiltersConditionsMenu table tbody tr td:first-child{border:0}.htFiltersConditionsMenu table tbody tr td.htDimmed{font-style:normal;color:#323232}.htFiltersConditionsMenu table tbody tr td.current,.htFiltersConditionsMenu table tbody tr td.zeroclipboard-is-hover{background:#e9e9e9}.htFiltersConditionsMenu table tbody tr td.htSeparator{border-top:1px solid #e6e6e6;height:0;padding:0}.htFiltersConditionsMenu table tbody tr td.htDisabled{color:#999}.htFiltersConditionsMenu table tbody tr td.htDisabled:hover{background:#fff;color:#999;cursor:default}.htFiltersConditionsMenu table tbody tr td .htItemWrapper{margin-left:10px;margin-right:10px}.htFiltersConditionsMenu table tbody tr td div span.selected{margin-top:-2px;position:absolute;left:4px}.htFiltersConditionsMenu .ht_master .wtHolder{overflow:hidden}.handsontable .htMenuFiltering{border-bottom:1px dotted #ccc;height:135px;overflow:hidden}.handsontable .ht_master table td.htCustomMenuRenderer{background-color:#fff;cursor:auto}.handsontable .htFiltersMenuLabel{font-size:12px}.handsontable .htFiltersMenuActionBar{text-align:center;padding-top:10px;padding-bottom:3px}.handsontable .htFiltersMenuCondition.border{border-bottom:1px dotted #ccc!important}.handsontable .htFiltersMenuCondition .htUIInput{padding:0 0 5px}.handsontable .htFiltersMenuValue{border-bottom:1px dotted #ccc!important}.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch{padding:0}.handsontable .htFiltersMenuCondition .htUIInput input,.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input{padding:4px;box-sizing:border-box;width:100%}.htUIMultipleSelect .ht_master .wtHolder{overflow-y:scroll}.handsontable .htFiltersActive .changeType{border:1px solid #509272;color:#18804e;background-color:#d2e0d9}.handsontable .htUISelectAll{margin-right:10px}.handsontable .htUIClearAll,.handsontable .htUISelectAll{display:inline-block}.handsontable .htUIClearAll a,.handsontable .htUISelectAll a{color:#3283d8;font-size:12px}.handsontable .htUISelectionControls{text-align:right}.handsontable .htCheckboxRendererInput{margin:0 5px 0 0;vertical-align:middle;height:1em}.handsontable .htUIInput{padding:3px 0 7px;position:relative;text-align:center}.handsontable .htUIInput input{border-radius:2px;border:1px solid #d2d1d1}.handsontable .htUIInput input:focus{outline:0}.handsontable .htUIInputIcon{position:absolute}.handsontable .htUIInput.htUIButton{cursor:pointer;display:inline-block}.handsontable .htUIInput.htUIButton input{background-color:#eee;color:#000;cursor:pointer;font-family:arial,sans-serif;font-size:11px;font-weight:700;height:19px;min-width:64px}.handsontable .htUIInput.htUIButton input:hover{border-color:#b9b9b9}.handsontable .htUIInput.htUIButtonOK{margin-right:10px}.handsontable .htUIInput.htUIButtonOK input{background-color:#0f9d58;border-color:#18804e;color:#fff}.handsontable .htUIInput.htUIButtonOK input:hover{border-color:#1a6f46}.handsontable .htUISelect{cursor:pointer;margin-bottom:7px;position:relative}.handsontable .htUISelectCaption{background-color:#e8e8e8;border-radius:2px;border:1px solid #d2d1d1;font-family:arial,sans-serif;font-size:11px;font-weight:700;padding:3px 20px 3px 10px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.handsontable .htUISelectCaption:hover{background-color:#e8e8e8;border:1px solid #b9b9b9}.handsontable .htUISelectDropdown:after{content:"\25B2";font-size:7px;position:absolute;right:10px;top:0}.handsontable .htUISelectDropdown:before{content:"\25BC";font-size:7px;position:absolute;right:10px;top:8px}.handsontable .htUIMultipleSelect .handsontable .htCore{border:none}.handsontable .htUIMultipleSelect .handsontable .htCore td:hover{background-color:#f5f5f5}.handsontable .htUIMultipleSelectSearch input{border-radius:2px;border:1px solid #d2d1d1;padding:3px}.handsontable .htUIRadio{display:inline-block;margin-right:5px;height:100%}.handsontable .htUIRadio:last-child{margin-right:0}.handsontable .htUIRadio>input[type=radio]{margin-right:.5ex}.handsontable .htFiltersMenuOperators{padding-bottom:5px}.handsontable.ganttChart tr:first-child th div.relative{padding-right:21px}.handsontable.ganttChart .colHeader{display:block}.handsontable.ganttChart td.rangeBar{background:#48b703;border-right-width:0;position:relative;box-shadow:inset 0 3px 0 #fff}.handsontable.ganttChart td.rangeBar.last{border-right-width:1px}.handsontable.ganttChart td.rangeBar.area{background:#7ec481}.handsontable.ganttChart td.rangeBar.partial{background:#8edf5a}.handsontable.ganttChart td.rangeBar.area.partial{background:#a1d8ad}.handsontable thead th.hiddenHeader:not(:first-of-type){display:none}.handsontable th.ht_nestingLevels{text-align:left;padding-left:7px}.handsontable th div.ht_nestingLevels{display:inline-block;position:absolute;left:11px}.handsontable.innerBorderLeft th div.ht_nestingLevels,.handsontable.innerBorderLeft~.handsontable th div.ht_nestingLevels{right:10px}.handsontable th span.ht_nestingLevel{display:inline-block}.handsontable th span.ht_nestingLevel_empty{display:inline-block;width:10px;height:1px;float:left}.handsontable th span.ht_nestingLevel:after{content:"\2510";font-size:9px;display:inline-block;position:relative;bottom:3px}.handsontable th div.ht_nestingButton{display:inline-block;position:absolute;right:-2px;cursor:pointer}.handsontable th div.ht_nestingButton.ht_nestingExpand:after{content:"+"}.handsontable th div.ht_nestingButton.ht_nestingCollapse:after{content:"-"}.handsontable.innerBorderLeft th div.ht_nestingButton,.handsontable.innerBorderLeft~.handsontable th div.ht_nestingButton{right:0}.handsontable th.beforeHiddenColumn{position:relative}.handsontable th.afterHiddenColumn:before,.handsontable th.beforeHiddenColumn:after{color:#bbb;position:absolute;top:50%;font-size:5pt;transform:translateY(-50%)}.handsontable th.afterHiddenColumn{position:relative}.handsontable th.beforeHiddenColumn:after{right:1px;content:"\25C0"}.handsontable th.afterHiddenColumn:before{left:1px;content:"\25B6"}.handsontable td.firstVisibleColumn,.handsontable th.firstVisibleColumn{border-left:1px solid #ccc} + */.htFiltersConditionsMenu:not(.htGhostTable){display:none;position:absolute;z-index:1070}.htFiltersConditionsMenu .ht_clone_corner,.htFiltersConditionsMenu .ht_clone_debug,.htFiltersConditionsMenu .ht_clone_left,.htFiltersConditionsMenu .ht_clone_top{display:none}.htFiltersConditionsMenu table.htCore{border:1px solid #bbb;border-bottom-width:2px;border-right-width:2px}.htFiltersConditionsMenu .wtBorder{visibility:hidden}.htFiltersConditionsMenu table tbody tr td{background:#fff;border-width:0;padding:4px 6px 0;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.htFiltersConditionsMenu table tbody tr td:first-child{border:0}.htFiltersConditionsMenu table tbody tr td.htDimmed{font-style:normal;color:#323232}.htFiltersConditionsMenu table tbody tr td.current,.htFiltersConditionsMenu table tbody tr td.zeroclipboard-is-hover{background:#e9e9e9}.htFiltersConditionsMenu table tbody tr td.htSeparator{border-top:1px solid #e6e6e6;height:0;padding:0}.htFiltersConditionsMenu table tbody tr td.htDisabled{color:#999}.htFiltersConditionsMenu table tbody tr td.htDisabled:hover{background:#fff;color:#999;cursor:default}.htFiltersConditionsMenu table tbody tr td .htItemWrapper{margin-left:10px;margin-right:10px}.htFiltersConditionsMenu table tbody tr td div span.selected{margin-top:-2px;position:absolute;left:4px}.htFiltersConditionsMenu .ht_master .wtHolder{overflow:hidden}.handsontable .htMenuFiltering{border-bottom:1px dotted #ccc;height:135px;overflow:hidden}.handsontable .ht_master table td.htCustomMenuRenderer{background-color:#fff;cursor:auto}.handsontable .htFiltersMenuLabel{font-size:12px}.handsontable .htFiltersMenuActionBar{text-align:center;padding-top:10px;padding-bottom:3px}.handsontable .htFiltersMenuCondition.border{border-bottom:1px dotted #ccc!important}.handsontable .htFiltersMenuCondition .htUIInput{padding:0 0 5px}.handsontable .htFiltersMenuValue{border-bottom:1px dotted #ccc!important}.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch{padding:0}.handsontable .htFiltersMenuCondition .htUIInput input,.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input{padding:4px;box-sizing:border-box;width:100%}.htUIMultipleSelect .ht_master .wtHolder{overflow-y:scroll}.handsontable .htFiltersActive .changeType{border:1px solid #509272;color:#18804e;background-color:#d2e0d9}.handsontable .htUISelectAll{margin-right:10px}.handsontable .htUIClearAll,.handsontable .htUISelectAll{display:inline-block}.handsontable .htUIClearAll a,.handsontable .htUISelectAll a{color:#3283d8;font-size:12px}.handsontable .htUISelectionControls{text-align:right}.handsontable .htCheckboxRendererInput{margin:0 5px 0 0;vertical-align:middle;height:1em}.handsontable .htUIInput{padding:3px 0 7px;position:relative;text-align:center}.handsontable .htUIInput input{border-radius:2px;border:1px solid #d2d1d1}.handsontable .htUIInput input:focus{outline:0}.handsontable .htUIInputIcon{position:absolute}.handsontable .htUIInput.htUIButton{cursor:pointer;display:inline-block}.handsontable .htUIInput.htUIButton input{background-color:#eee;color:#000;cursor:pointer;font-family:arial,sans-serif;font-size:11px;font-weight:700;height:19px;min-width:64px}.handsontable .htUIInput.htUIButton input:hover{border-color:#b9b9b9}.handsontable .htUIInput.htUIButtonOK{margin-right:10px}.handsontable .htUIInput.htUIButtonOK input{background-color:#0f9d58;border-color:#18804e;color:#fff}.handsontable .htUIInput.htUIButtonOK input:hover{border-color:#1a6f46}.handsontable .htUISelect{cursor:pointer;margin-bottom:7px;position:relative}.handsontable .htUISelectCaption{background-color:#e8e8e8;border-radius:2px;border:1px solid #d2d1d1;font-family:arial,sans-serif;font-size:11px;font-weight:700;padding:3px 20px 3px 10px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.handsontable .htUISelectCaption:hover{background-color:#e8e8e8;border:1px solid #b9b9b9}.handsontable .htUISelectDropdown:after{content:"\25B2";font-size:7px;position:absolute;right:10px;top:0}.handsontable .htUISelectDropdown:before{content:"\25BC";font-size:7px;position:absolute;right:10px;top:8px}.handsontable .htUIMultipleSelect .handsontable .htCore{border:none}.handsontable .htUIMultipleSelect .handsontable .htCore td:hover{background-color:#f5f5f5}.handsontable .htUIMultipleSelectSearch input{border-radius:2px;border:1px solid #d2d1d1;padding:3px}.handsontable .htUIRadio{display:inline-block;margin-right:5px;height:100%}.handsontable .htUIRadio:last-child{margin-right:0}.handsontable .htUIRadio>input[type=radio]{margin-right:.5ex}.handsontable .htFiltersMenuOperators{padding-bottom:5px}.handsontable.ganttChart tr:first-child th div.relative{padding-right:21px}.handsontable.ganttChart .colHeader{display:block}.handsontable.ganttChart td.rangeBar{background:#48b703;border-right-width:0;position:relative;box-shadow:inset 0 3px 0 #fff}.handsontable.ganttChart td.rangeBar.last{border-right-width:1px}.handsontable.ganttChart td.rangeBar.area{background:#7ec481}.handsontable.ganttChart td.rangeBar.partial{background:#8edf5a}.handsontable.ganttChart td.rangeBar.area.partial{background:#a1d8ad}.handsontable thead th.hiddenHeader:not(:first-of-type){display:none}.handsontable th.ht_nestingLevels{text-align:left;padding-left:7px}.handsontable th div.ht_nestingLevels{display:inline-block;position:absolute;left:11px}.handsontable.innerBorderLeft th div.ht_nestingLevels,.handsontable.innerBorderLeft~.handsontable th div.ht_nestingLevels{right:10px}.handsontable th span.ht_nestingLevel{display:inline-block}.handsontable th span.ht_nestingLevel_empty{display:inline-block;width:10px;height:1px;float:left}.handsontable th span.ht_nestingLevel:after{content:"\2510";font-size:9px;display:inline-block;position:relative;bottom:3px}.handsontable th div.ht_nestingButton{display:inline-block;position:absolute;right:-2px;cursor:pointer}.handsontable th div.ht_nestingButton.ht_nestingExpand:after{content:"+"}.handsontable th div.ht_nestingButton.ht_nestingCollapse:after{content:"-"}.handsontable.innerBorderLeft th div.ht_nestingButton,.handsontable.innerBorderLeft~.handsontable th div.ht_nestingButton{right:0}.handsontable th.beforeHiddenColumn{position:relative}.handsontable th.afterHiddenColumn:before,.handsontable th.beforeHiddenColumn:after{color:#bbb;position:absolute;top:50%;font-size:5pt;transform:translateY(-50%)}.handsontable th.afterHiddenColumn{position:relative}.handsontable th.beforeHiddenColumn:after{right:1px;content:"\25C0"}.handsontable th.afterHiddenColumn:before{left:1px;content:"\25B6"}.handsontable td.firstVisibleColumn,.handsontable th.firstVisibleColumn{border-left:1px solid #ccc} /*! * Handsontable HiddenRows */.handsontable th.afterHiddenRow:after,.handsontable th.beforeHiddenRow:before{color:#bbb;font-size:6pt;line-height:6pt;position:absolute;left:2px}.handsontable th.afterHiddenRow,.handsontable th.beforeHiddenRow{position:relative}.handsontable th.beforeHiddenRow:before{content:"\25B2";bottom:2px}.handsontable th.afterHiddenRow:after{content:"\25BC";top:2px}.handsontable.ht__selection--rows tbody th.afterHiddenRow.ht__highlight:after,.handsontable.ht__selection--rows tbody th.beforeHiddenRow.ht__highlight:before{color:#eee}.handsontable td.afterHiddenRow.firstVisibleRow,.handsontable th.afterHiddenRow.firstVisibleRow{border-top:1px solid #ccc} \ No newline at end of file diff --git a/dist/handsontable.full.min.js b/dist/handsontable.full.min.js index 220ce267..136765b6 100644 --- a/dist/handsontable.full.min.js +++ b/dist/handsontable.full.min.js @@ -20,19 +20,19 @@ * RELIABILITY AND PERFORMANCE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SOFTWARE WILL BE * UNINTERRUPTED OR ERROR FREE. * - * Version: 6.1.1 - * Release date: 23/10/2018 (built at 23/10/2018 12:22:42) + * Version: 6.2.0 + * Release date: 14/11/2018 (built at 14/11/2018 12:23:10) */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Handsontable",[],t):"object"==typeof exports?exports.Handsontable=t():e.Handsontable=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=484)}([function(e,t,n){"use strict";function r(e){for(var t=e.length,n=0;nt?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return a(e,function(e,t){return e1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:"value",o="_"+n,i=(t={_touched:!1},r(t,o,e),r(t,"isTouched",function(){return this._touched}),t);return Object.defineProperty(i,n,{get:function(){return this[o]},set:function(e){this._touched=!0,this[o]=e},enumerable:!0,configurable:!0}),i}function y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.__esModule=!0;var w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.duckSchema=o,t.inherit=i,t.extend=a,t.deepExtend=s,t.deepClone=l,t.clone=u,t.mixin=c,t.isObjectEqual=f,t.isObject=h,t.defineGetter=d,t.objectEach=p,t.getProperty=g,t.deepObjectSize=v,t.createObjectPropListener=m,t.hasOwnProperty=y;var b=n(0)},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:0,n=-1,r=null,o=e;null!==o;){if(n===t){r=o;break}o.host&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE?o=o.host:(n+=1,o=o.parentNode)}return r}function i(e,t,n){for(var r=e;null!==r&&r!==n;){if(r.nodeType===Node.ELEMENT_NODE&&(t.indexOf(r.nodeName)>-1||t.indexOf(r)>-1))return r;r=r.host&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE?r.host:r.parentNode}return null}function a(e,t,n){for(var r=[],o=e;o&&(o=i(o,t,n))&&(!n||n.contains(o));)r.push(o),o=o.host&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE?o.host:o.parentNode;var a=r.length;return a?r[a-1]:null}function s(e,t){var n=e.parentNode,r=[];for("string"==typeof t?r=Array.prototype.slice.call(document.querySelectorAll(t),0):r.push(t);null!==n;){if(r.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function l(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===n.toUpperCase()}for(var n="hot-table",r=!1,o=u(e);null!==o;){if(t(o)){r=!0;break}if(o.host&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r=t(o.host))break;o=o.host}o=o.parentNode}return r}function u(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function c(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function f(e){var t=0,n=e;if(n.previousSibling)for(;n=n.previousSibling;)t+=1;return t}function h(e,t){var n=document.querySelector(".ht_clone_"+e);return n?n.contains(t):null}function d(e){var t=[];if(!e||!e.length)return t;for(var n=0;e[n];)t.push(e[n]),n+=1;return t}function p(e,t){return J(e,t)}function g(e,t){return ee(e,t)}function v(e,t){return te(e,t)}function m(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var n=e.childNodes,r=n.length-1;r>=0;r--)m(n[r],e)}function y(e){for(var t=void 0;t=e.lastChild;)e.removeChild(t)}function w(e,t){ie.test(t)?e.innerHTML=t:b(e,t)}function b(e,t){var n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?ae?n.textContent=t:n.data=t:(y(e),e.appendChild(document.createTextNode(t)))}function C(e){for(var t=e;c(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return C(t.host.impl);if(t.host)return C(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function _(e){var t=document.documentElement,n=e,r=void 0,o=void 0,i=void 0,a=void 0;if((0,Z.hasCaptionProblem)()&&n.firstChild&&"CAPTION"===n.firstChild.nodeName)return a=n.getBoundingClientRect(),{top:a.top+(window.pageYOffset||t.scrollTop)-(t.clientTop||0),left:a.left+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)};for(r=n.offsetLeft,o=n.offsetTop,i=n;(n=n.offsetParent)&&n!==document.body;)r+=n.offsetLeft,o+=n.offsetTop,i=n;return i&&"fixed"===i.style.position&&(r+=window.pageXOffset||t.scrollLeft,o+=window.pageYOffset||t.scrollTop),{left:r,top:o}}function E(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function O(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function S(e){return e===window?E():e.scrollTop}function T(e){return e===window?O():e.scrollLeft}function R(e){for(var t=["auto","scroll"],n=e.parentNode,r=void 0,o=void 0,i=void 0,a="",s="",l="",u="";n&&n.style&&document.body!==n;){if(r=n.style.overflow,o=n.style.overflowX,i=n.style.overflowY,"scroll"===r||"scroll"===o||"scroll"===i)return n;if(window.getComputedStyle&&(a=window.getComputedStyle(n),s=a.getPropertyValue("overflow"),l=a.getPropertyValue("overflow-y"),u=a.getPropertyValue("overflow-x"),"scroll"===s||"scroll"===u||"scroll"===l))return n;if(n.clientHeight<=n.scrollHeight+1&&(-1!==t.indexOf(i)||-1!==t.indexOf(r)||-1!==t.indexOf(s)||-1!==t.indexOf(l)))return n;if(n.clientWidth<=n.scrollWidth+1&&(-1!==t.indexOf(o)||-1!==t.indexOf(r)||-1!==t.indexOf(s)||-1!==t.indexOf(u)))return n;n=n.parentNode}return window}function M(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;var n=N(t),r=["scroll","hidden","auto"],o=n.getPropertyValue("overflow"),i=n.getPropertyValue("overflow-y"),a=n.getPropertyValue("overflow-x");if(r.includes(o)||r.includes(i)||r.includes(a))return t;t=t.parentNode}return window}function k(e,t){if(e){if(e!==window){var n,r=e.style[t];return""!==r&&void 0!==r?r:(n=N(e),""!==n[t]&&void 0!==n[t]?n[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function N(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function A(e){return e.offsetWidth}function I(e){return(0,Z.hasCaptionProblem)()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function D(e){return e.clientHeight||e.innerHeight}function P(e){return e.clientWidth||e.innerWidth}function x(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function L(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function H(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange(),r=n.duplicate();return n.moveToBookmark(t.getBookmark()),r.setEndPoint("EndToStart",n),r.text.length}return 0}function j(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;return e.createTextRange().text.indexOf(t.text)+t.text.length}return 0}function F(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function V(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(i){var r=e.parentNode,o=r.style.display;r.style.display="block",e.setSelectionRange(t,n),r.style.display=o}}else if(e.createTextRange){var i=e.createTextRange();i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i.select()}}function B(){var e=document.createElement("div");e.style.height="200px",e.style.width="100%";var t=document.createElement("div");t.style.boxSizing="content-box",t.style.height="150px",t.style.left="0px",t.style.overflow="hidden",t.style.position="absolute",t.style.top="0px",t.style.width="200px",t.style.visibility="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var r=e.offsetWidth;return n==r&&(r=t.clientWidth),(document.body||document.documentElement).removeChild(t),n-r}function W(){return void 0===oe&&(oe=B()),oe}function U(e){return e.offsetWidth!==e.clientWidth}function Y(e){return e.offsetHeight!==e.clientHeight}function $(e,t,n){(0,q.isIE8)()||(0,q.isIE9)()?(e.style.top=n,e.style.left=t):(0,q.isSafari)()?e.style["-webkit-transform"]="translate3d("+t+","+n+",0)":e.style.transform="translate3d("+t+","+n+",0)"}function G(e){var t=void 0;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function z(e){e.style.transform&&""!==e.style.transform?e.style.transform="":e.style["-webkit-transform"]&&""!==e.style["-webkit-transform"]&&(e.style["-webkit-transform"]="")}function X(e){var t=["INPUT","SELECT","TEXTAREA"];return e&&(t.indexOf(e.nodeName)>-1||"true"===e.contentEditable)}function K(e){return X(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}t.__esModule=!0,t.HTML_CHARACTERS=void 0,t.getParent=o,t.closest=i,t.closestDown=a,t.isChildOf=s,t.isChildOfWebComponentTable=l,t.polymerWrap=u,t.polymerUnwrap=c,t.index=f,t.overlayContainsElement=h,t.hasClass=p,t.addClass=g,t.removeClass=v,t.removeTextNodes=m,t.empty=y,t.fastInnerHTML=w,t.fastInnerText=b,t.isVisible=C,t.offset=_,t.getWindowScrollTop=E,t.getWindowScrollLeft=O,t.getScrollTop=S,t.getScrollLeft=T,t.getScrollableElement=R,t.getTrimmingContainer=M,t.getStyle=k,t.getComputedStyle=N,t.outerWidth=A,t.outerHeight=I,t.innerHeight=D,t.innerWidth=P,t.addEvent=x,t.removeEvent=L,t.getCaretPosition=H,t.getSelectionEndPosition=j,t.getSelectionText=F,t.setCaretPosition=V,t.getScrollbarWidth=W,t.hasVerticalScrollbar=U,t.hasHorizontalScrollbar=Y,t.setOverlayPosition=$,t.getCssTransform=G,t.resetCssTransform=z,t.isInput=X,t.isOutsideInput=K;var q=n(50),Z=n(41),Q=!!document.documentElement.classList,J=void 0,ee=void 0,te=void 0;if(Q){var ne=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();J=function(e,t){return void 0!==e.classList&&"string"==typeof t&&""!==t&&e.classList.contains(t)},ee=function(e,t){var n=t;if("string"==typeof n&&(n=n.split(" ")),n=d(n),n.length>0)if(ne){var o;(o=e.classList).add.apply(o,r(n))}else for(var i=0;n&&n[i];)e.classList.add(n[i]),i+=1},te=function(e,t){var n=t;if("string"==typeof n&&(n=n.split(" ")),n=d(n),n.length>0)if(ne){var o;(o=e.classList).remove.apply(o,r(n))}else for(var i=0;n&&n[i];)e.classList.remove(n[i]),i+=1}}else{var re=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};J=function(e,t){return void 0!==e.className&&re(t).test(e.className)},ee=function(e,t){var n=0,r=e.className,o=t;if("string"==typeof o&&(o=o.split(" ")),""===r)r=o.join(" ");else for(;o&&o[n];)re(o[n]).test(r)||(r+=" "+o[n]),n+=1;e.className=r},te=function(e,t){var n=0,r=e.className,o=t;for("string"==typeof o&&(o=o.split(" "));o&&o[n];)r=r.replace(re(o[n])," ").trim(),n+=1;e.className!==r&&(e.className=r)}}var oe,ie=t.HTML_CHARACTERS=/(<(.*)>|&(.*);)/,ae=!!document.createTextNode("test").textContent},function(e,t,n){"use strict";t.__esModule=!0;var r=t.CONTEXT_MENU_ITEMS_NAMESPACE="ContextMenu:items",o=(t.CONTEXTMENU_ITEMS_ROW_ABOVE=r+".insertRowAbove",t.CONTEXTMENU_ITEMS_ROW_BELOW=r+".insertRowBelow",t.CONTEXTMENU_ITEMS_INSERT_LEFT=r+".insertColumnOnTheLeft",t.CONTEXTMENU_ITEMS_INSERT_RIGHT=r+".insertColumnOnTheRight",t.CONTEXTMENU_ITEMS_REMOVE_ROW=r+".removeRow",t.CONTEXTMENU_ITEMS_REMOVE_COLUMN=r+".removeColumn",t.CONTEXTMENU_ITEMS_UNDO=r+".undo",t.CONTEXTMENU_ITEMS_REDO=r+".redo",t.CONTEXTMENU_ITEMS_READ_ONLY=r+".readOnly",t.CONTEXTMENU_ITEMS_CLEAR_COLUMN=r+".clearColumn",t.CONTEXTMENU_ITEMS_COPY=r+".copy",t.CONTEXTMENU_ITEMS_CUT=r+".cut",t.CONTEXTMENU_ITEMS_FREEZE_COLUMN=r+".freezeColumn",t.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN=r+".unfreezeColumn",t.CONTEXTMENU_ITEMS_MERGE_CELLS=r+".mergeCells",t.CONTEXTMENU_ITEMS_UNMERGE_CELLS=r+".unmergeCells",t.CONTEXTMENU_ITEMS_ADD_COMMENT=r+".addComment",t.CONTEXTMENU_ITEMS_EDIT_COMMENT=r+".editComment",t.CONTEXTMENU_ITEMS_REMOVE_COMMENT=r+".removeComment",t.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT=r+".readOnlyComment",t.CONTEXTMENU_ITEMS_ALIGNMENT=r+".align",t.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT=r+".align.left",t.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER=r+".align.center",t.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT=r+".align.right",t.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY=r+".align.justify",t.CONTEXTMENU_ITEMS_ALIGNMENT_TOP=r+".align.top",t.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE=r+".align.middle",t.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM=r+".align.bottom",t.CONTEXTMENU_ITEMS_BORDERS=r+".borders",t.CONTEXTMENU_ITEMS_BORDERS_TOP=r+".borders.top",t.CONTEXTMENU_ITEMS_BORDERS_RIGHT=r+".borders.right",t.CONTEXTMENU_ITEMS_BORDERS_BOTTOM=r+".borders.bottom",t.CONTEXTMENU_ITEMS_BORDERS_LEFT=r+".borders.left",t.CONTEXTMENU_ITEMS_REMOVE_BORDERS=r+".borders.remove",t.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD=r+".nestedHeaders.insertChildRow",t.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD=r+".nestedHeaders.detachFromParent",t.CONTEXTMENU_ITEMS_HIDE_COLUMN=r+".hideColumn",t.CONTEXTMENU_ITEMS_SHOW_COLUMN=r+".showColumn",t.CONTEXTMENU_ITEMS_HIDE_ROW=r+".hideRow",t.CONTEXTMENU_ITEMS_SHOW_ROW=r+".showRow",t.FILTERS_NAMESPACE="Filters:"),i=t.FILTERS_CONDITIONS_NAMESPACE=o+"conditions";t.FILTERS_CONDITIONS_NONE=i+".none",t.FILTERS_CONDITIONS_EMPTY=i+".isEmpty",t.FILTERS_CONDITIONS_NOT_EMPTY=i+".isNotEmpty",t.FILTERS_CONDITIONS_EQUAL=i+".isEqualTo",t.FILTERS_CONDITIONS_NOT_EQUAL=i+".isNotEqualTo",t.FILTERS_CONDITIONS_BEGINS_WITH=i+".beginsWith",t.FILTERS_CONDITIONS_ENDS_WITH=i+".endsWith",t.FILTERS_CONDITIONS_CONTAINS=i+".contains",t.FILTERS_CONDITIONS_NOT_CONTAIN=i+".doesNotContain",t.FILTERS_CONDITIONS_BY_VALUE=i+".byValue",t.FILTERS_CONDITIONS_GREATER_THAN=i+".greaterThan",t.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL=i+".greaterThanOrEqualTo",t.FILTERS_CONDITIONS_LESS_THAN=i+".lessThan",t.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL=i+".lessThanOrEqualTo",t.FILTERS_CONDITIONS_BETWEEN=i+".isBetween",t.FILTERS_CONDITIONS_NOT_BETWEEN=i+".isNotBetween",t.FILTERS_CONDITIONS_AFTER=i+".after",t.FILTERS_CONDITIONS_BEFORE=i+".before",t.FILTERS_CONDITIONS_TODAY=i+".today",t.FILTERS_CONDITIONS_TOMORROW=i+".tomorrow",t.FILTERS_CONDITIONS_YESTERDAY=i+".yesterday",t.FILTERS_DIVS_FILTER_BY_CONDITION=o+"labels.filterByCondition",t.FILTERS_DIVS_FILTER_BY_VALUE=o+"labels.filterByValue",t.FILTERS_LABELS_CONJUNCTION=o+"labels.conjunction",t.FILTERS_LABELS_DISJUNCTION=o+"labels.disjunction",t.FILTERS_VALUES_BLANK_CELLS=o+"values.blankCells",t.FILTERS_BUTTONS_SELECT_ALL=o+"buttons.selectAll",t.FILTERS_BUTTONS_CLEAR=o+"buttons.clear",t.FILTERS_BUTTONS_OK=o+"buttons.ok",t.FILTERS_BUTTONS_CANCEL=o+"buttons.cancel",t.FILTERS_BUTTONS_PLACEHOLDER_SEARCH=o+"buttons.placeholder.search",t.FILTERS_BUTTONS_PLACEHOLDER_VALUE=o+"buttons.placeholder.value",t.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE=o+"buttons.placeholder.secondValue"},function(e,t,n){"use strict";function r(e){var t=void 0===e?"undefined":s(e);return"number"==t?!isNaN(e)&&isFinite(e):"string"==t?!!e.length&&(1==e.length?/\d/.test(e):/^\s*[+-]?\s*(?:(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?)|(?:0x[a-f\d]+))\s*$/i.test(e)):"object"==t&&!(!e||"number"!=typeof e.valueOf()||e instanceof Date)}function o(e,t,n){var r=-1;for("function"==typeof t?(n=t,t=e):r=e-1;++r<=t&&!1!==n(r););}function i(e,t,n){var r=e+1;for("function"==typeof t&&(n=t,t=0);--r>=t&&!1!==n(r););}function a(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100,10)}t.__esModule=!0;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.isNumeric=r,t.rangeEach=o,t.rangeEachReverse=i,t.valueAccordingPercent=a},function(e,t,n){"use strict";function r(e,t){var n=(0,c.toUpperCaseFirst)(e);l.default.getSingleton().add("construct",function(){f.has(this)||f.set(this,{});var e=f.get(this);e[n]||(e[n]=new t(this))}),l.default.getSingleton().add("afterDestroy",function(){if(f.has(this)){var e=f.get(this);(0,u.objectEach)(e,function(e){return e.destroy()}),f.delete(this)}})}function o(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var n=(0,c.toUpperCaseFirst)(t);if(f.has(e)&&f.get(e)[n])return f.get(e)[n]}function i(e){return f.has(e)?Object.keys(f.get(e)):[]}function a(e,t){var n=null;return f.has(e)&&(0,u.objectEach)(f.get(e),function(e,r){e===t&&(n=r)}),n}t.__esModule=!0,t.getPluginName=t.getRegistredPluginNames=t.getPlugin=t.registerPlugin=void 0;var s=n(17),l=function(e){return e&&e.__esModule?e:{default:e}}(s),u=n(1),c=n(32),f=new WeakMap;t.registerPlugin=r,t.getPlugin=o,t.getRegistredPluginNames=i,t.getPluginName=a},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=function(){function e(e,t){for(var n=0;n=0&&c.splice(c.indexOf(this.pluginName),1),c.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0}},{key:"enablePlugin",value:function(){this.enabled=!0}},{key:"disablePlugin",value:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1}},{key:"addHook",value:function(e,t){u.get(this).hooks[e]=u.get(this).hooks[e]||[];var n=u.get(this).hooks[e];this.hot.addHook(e,t),n.push(t),u.get(this).hooks[e]=n}},{key:"removeHooks",value:function(e){var t=this;(0,a.arrayEach)(u.get(this).hooks[e]||[],function(n){t.hot.removeHook(e,n)})}},{key:"clearHooks",value:function(){var e=this,t=u.get(this).hooks;(0,i.objectEach)(t,function(t,n){return e.removeHooks(n)}),t.length=0}},{key:"callOnPluginsReady",value:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}},{key:"onAfterPluginsInitialized",value:function(){(0,a.arrayEach)(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}},{key:"onUpdateSettings",value:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())}},{key:"updatePlugin",value:function(){}},{key:"destroy",value:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),(0,i.objectEach)(this,function(t,n){"hot"!==n&&"t"!==n&&(e[n]=null)}),delete this.t,delete this.hot}}]),e}()},function(e,t,n){var r=n(16),o=n(48),i=n(37),a=n(36),s=n(38),l=function(e,t,n){var u,c,f,h,d=e&l.F,p=e&l.G,g=e&l.S,v=e&l.P,m=e&l.B,y=p?r:g?r[t]||(r[t]={}):(r[t]||{}).prototype,w=p?o:o[t]||(o[t]={}),b=w.prototype||(w.prototype={});p&&(n=t);for(u in n)c=!d&&y&&void 0!==y[u],f=(c?y:n)[u],h=m&&c?s(f,r):v&&"function"==typeof f?s(Function.call,f):f,y&&a(y,u,f,e&l.U),w[u]!=f&&i(w,u,h),v&&b[u]!=f&&(b[u]=f)};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){"use strict";function r(e){var t=void 0;switch(void 0===e?"undefined":c(e)){case"string":case"number":t=""+e;break;case"object":t=null===e?"":e.toString();break;case"undefined":t="";break;default:t=e.toString()}return t}function o(e){return void 0!==e}function i(e){return void 0===e}function a(e){return null===e||""===e||i(e)}function s(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function l(e,t){e=b(e||"");var n="",r=!0,o=u(e),i=_(),s=a(e)||"trial"===e;if(s||o)if(o){var l=Math.floor((0,d.default)("23/10/2018","DD/MM/YYYY").toDate().getTime()/864e5),c=C(e);(c>45e3||c!==parseInt(c,10))&&(n="The license key provided to Handsontable Pro is invalid. Make sure you pass it correctly."),n||(l>c+1&&(n=(0,p.toSingleLine)(f)),r=l>c+15)}else n="Evaluation version of Handsontable Pro. Not licensed for use in a production environment.";else n="The license key provided to Handsontable Pro is invalid. Make sure you pass it correctly.";if(i&&(n=!1,r=!1),n&&!E&&(console[s?"info":"warn"](n),E=!0),r&&t.parentNode){var h=document.createElement("div");h.id="hot-display-license-info",h.appendChild(document.createTextNode("Evaluation version of Handsontable Pro.")),h.appendChild(document.createElement("br")),h.appendChild(document.createTextNode("Not licensed for production use.")),t.parentNode.insertBefore(h,t.nextSibling)}}function u(e){var t=[][g],n=t;if(e[g]!==w("Z"))return!1;for(var r="",o="B>1:r=y(e,i,i?1===o[g]?9:8:6);return n===t}t.__esModule=!0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f=function(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n Your license key of Handsontable Pro has expired.‌‌‌‌ \n Renew your maintenance plan at https://handsontable.com or downgrade to the previous version of the software.\n "],["\n Your license key of Handsontable Pro has expired.‌‌‌‌ \n Renew your maintenance plan at https://handsontable.com or downgrade to the previous version of the software.\n "]);t.stringify=r,t.isDefined=o,t.isUndefined=i,t.isEmpty=a,t.isRegExp=s,t._injectProductInfo=l;var h=n(23),d=function(e){return e&&e.__esModule?e:{default:e}}(h),p=n(26),g="length",v=function(e){return parseInt(e,16)},m=function(e){return parseInt(e,10)},y=function(e,t,n){return e.substr(t,n)},w=function(e){return e.codePointAt(0)-65},b=function(e){return(""+e).replace(/\-/g,"")},C=function(e){return v(y(b(e),v("12"),w("F")))/(v(y(b(e),w("B"),~~![][g]))||9)},_=function(){return"undefined"!=typeof location&&/^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host)},E=!1},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){var n=void 0,r=void 0,o=void 0,i=void 0,a=void 0;t.isTargetWebComponent=!1,t.realTarget=t.target;var f=t.stopImmediatePropagation;if(t.stopImmediatePropagation=function(){f.apply(this),(0,c.stopImmediatePropagation)(this)},!h.isHotTableEnv)return t;for(t=(0,s.polymerWrap)(t),a=t.path?t.path.length:0;a;){if(a-=1,"HOT-TABLE"===t.path[a].nodeName)n=!0;else if(n&&t.path[a].shadowRoot){i=t.path[a];break}0!==a||i||(i=t.path[a])}return i||(i=t.target),t.isTargetWebComponent=!0,(0,u.isWebComponentSupportedNatively)()?t.realTarget=t.srcElement||t.toElement:((0,l.hasOwnProperty)(e,"hot")||e.isHotTableEnv||e.wtTable)&&((0,l.hasOwnProperty)(e,"hot")?r=e.hot?e.hot.view.wt.wtTable.TABLE:null:e.isHotTableEnv?r=e.view.activeWt.wtTable.TABLE.parentNode.parentNode:e.wtTable&&(r=e.wtTable.TABLE.parentNode.parentNode),o=(0,s.closest)(t.target,["HOT-TABLE"],r),t.realTarget=o?r.querySelector("HOT-TABLE")||t.target:t.target),Object.defineProperty(t,"target",{get:function(){return(0,s.polymerWrap)(i)},enumerable:!0,configurable:!0}),t}function i(){return f}t.__esModule=!0;var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;r(this,e),this.context=t||this,this.context.eventListeners||(this.context.eventListeners=[])}return a(e,[{key:"addEventListener",value:function(e,t,n){function r(e){n.call(this,o(a,e))}var i=this,a=this.context;return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:r}),window.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r),f+=1,function(){i.removeEventListener(e,t,n)}}},{key:"removeEventListener",value:function(e,t,n){for(var r=this.context.eventListeners.length,o=void 0;r;)if(r-=1,o=this.context.eventListeners[r],o.event===t&&o.element===e){if(n&&n!==o.callback)continue;this.context.eventListeners.splice(r,1),o.element.removeEventListener?o.element.removeEventListener(o.event,o.callbackProxy,!1):o.element.detachEvent("on"+o.event,o.callbackProxy),f-=1}}},{key:"clearEvents",value:function(){if(this.context)for(var e=this.context.eventListeners.length;e;){e-=1;var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}}},{key:"clear",value:function(){this.clearEvents()}},{key:"destroy",value:function(){this.clearEvents(),this.context=null}},{key:"fireEvent",value:function(e,t){var n={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0},r=void 0;document.createEvent?(r=document.createEvent("MouseEvents"),r.initMouseEvent(t,n.bubbles,n.cancelable,n.view,n.detail,n.screenX,n.screenY,n.clientX,n.clientY,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,n.button,n.relatedTarget||document.body.parentNode)):r=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(r):e.fireEvent("on"+t,r)}}]),e}();t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.Viewport=t.TableRenderer=t.Table=t.Settings=t.Selection=t.Scroll=t.Overlays=t.Event=t.Core=t.default=t.Border=t.BottomLeftCornerOverlay=t.BottomOverlay=t.TopLeftCornerOverlay=t.TopOverlay=t.LeftOverlay=t.DebugOverlay=t.RowFilter=t.ColumnFilter=t.CellRange=t.CellCoords=t.ViewportRowsCalculator=t.ViewportColumnsCalculator=void 0,n(90),n(99),n(100),n(101),n(102),n(105),n(107),n(108),n(109),n(110),n(111),n(112),n(113),n(114),n(115),n(116),n(117),n(118),n(119),n(120),n(121),n(122),n(123),n(124),n(125),n(128),n(129),n(130),n(131),n(132),n(133),n(134),n(135),n(137),n(138),n(139),n(140),n(141),n(82),n(142),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156);var o=n(194),i=r(o),a=n(195),s=r(a),l=n(64),u=r(l),c=n(196),f=r(c),h=n(197),d=r(h),p=n(198),g=r(p),v=n(507),m=r(v),y=n(509),w=r(y),b=n(510),C=r(b),_=n(511),E=r(_),O=n(512),S=r(O),T=n(513),R=r(T),M=n(327),k=r(M),N=n(199),A=r(N),I=n(320),D=r(I),P=n(321),x=r(P),L=n(322),H=r(L),j=n(514),F=r(j),V=n(323),B=r(V),W=n(324),U=r(W),Y=n(325),$=r(Y),G=n(326),z=r(G);t.ViewportColumnsCalculator=i.default,t.ViewportRowsCalculator=s.default,t.CellCoords=u.default,t.CellRange=f.default,t.ColumnFilter=d.default,t.RowFilter=g.default,t.DebugOverlay=m.default,t.LeftOverlay=w.default,t.TopOverlay=C.default,t.TopLeftCornerOverlay=E.default,t.BottomOverlay=S.default,t.BottomLeftCornerOverlay=R.default,t.Border=k.default,t.default=A.default,t.Core=A.default,t.Event=D.default,t.Overlays=x.default,t.Scroll=H.default,t.Selection=F.default,t.Settings=B.default,t.Table=U.default,t.TableRenderer=$.default,t.Viewport=z.default},function(e,t,n){"use strict";function r(e,t){if(!a[e])throw Error('Filter condition "'+e+'" does not exist.');var n=a[e],r=n.condition,o=n.descriptor,i=t;return o.inputValuesDecorator&&(i=o.inputValuesDecorator(i)),function(e){return r.apply(e.meta.instance,[].concat([e],[i]))}}function o(e){if(!a[e])throw Error('Filter condition "'+e+'" does not exist.');return a[e].descriptor}function i(e,t,n){n.key=e,a[e]={condition:t,descriptor:n}}t.__esModule=!0,t.getCondition=r,t.getConditionDescriptor=o,t.registerCondition=i;var a=t.conditions={}},function(e,t,n){"use strict";function r(e){e.isImmediatePropagationEnabled=!1,e.cancelBubble=!0}function o(e){return!1===e.isImmediatePropagationEnabled}function i(e){"function"==typeof e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function a(e){return e.pageX?e.pageX:e.clientX+(0,c.getWindowScrollLeft)()}function s(e){return e.pageY?e.pageY:e.clientY+(0,c.getWindowScrollTop)()}function l(e){return 2===e.button}function u(e){return 0===e.button}t.__esModule=!0,t.stopImmediatePropagation=r,t.isImmediatePropagationStopped=o,t.stopPropagation=i,t.pageX=a,t.pageY=s,t.isRightClick=l,t.isLeftClick=u;var c=n(2)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(96)("wks"),o=n(58),i=n(16).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"==typeof e)return e;if(!O(e))throw Error('No registered renderer found under "'+e+'" name');return E(e)}t.__esModule=!0,t.getRegisteredRenderers=t.getRegisteredRendererNames=t.hasRenderer=t.getRenderer=t.registerRenderer=void 0;var i=n(49),a=r(i),s=n(526),l=r(s),u=n(527),c=r(u),f=n(528),h=r(f),d=n(529),p=r(d),g=n(530),v=r(g),m=n(531),y=r(m),w=n(532),b=r(w),C=(0,a.default)("renderers"),_=C.register,E=C.getItem,O=C.hasItem,S=C.getNames,T=C.getValues;_("base",l.default),_("autocomplete",c.default),_("checkbox",h.default),_("html",p.default),_("numeric",v.default),_("password",y.default),_("text",b.default),t.registerRenderer=_,t.getRenderer=o,t.hasRenderer=O,t.getRegisteredRendererNames=S,t.getRegisteredRenderers=T},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return c}t.__esModule=!0;var i=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=this.createEmptyBucket()),e.pluginHookBucket):this.globalBucket}},{key:"add",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(Array.isArray(t))(0,a.arrayEach)(t,function(t){return n.add(e,t,r)});else{var o=this.getBucket(r);if(void 0===o[e]&&(this.register(e),o[e]=[]),t.skip=!1,-1===o[e].indexOf(t)){var i=!1;t.initialHook&&(0,a.arrayEach)(o[e],function(n,r){if(n.initialHook)return o[e][r]=t,i=!0,!1}),i||o[e].push(t)}}return this}},{key:"once",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Array.isArray(t)?(0,a.arrayEach)(t,function(t){return n.once(e,t,r)}):(t.runOnce=!0,this.add(e,t,r))}},{key:"remove",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.getBucket(n);return void 0!==r[e]&&r[e].indexOf(t)>=0&&(t.skip=!0,!0)}},{key:"has",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getBucket(t);return!(void 0===n[e]||!n[e].length)}},{key:"run",value:function(e,t,n,r,o,i,a,s){var l=this.globalBucket[t],u=l?l.length:0,c=0;if(u)for(;c0&&void 0!==arguments[0]?arguments[0]:null),function(e,t,n){return n[t].length=0})}},{key:"register",value:function(e){this.isRegistered(e)||l.push(e)}},{key:"deregister",value:function(e){this.isRegistered(e)&&l.splice(l.indexOf(e),1)}},{key:"isRegistered",value:function(e){return l.indexOf(e)>=0}},{key:"getRegistered",value:function(){return l}}]),e}(),c=new u;t.default=u},function(e,t,n){"use strict";function r(e){return 32===e||e>=48&&e<=57||e>=96&&e<=111||e>=186&&e<=192||e>=219&&e<=222||e>=226||e>=65&&e<=90}function o(e){return-1!==[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT].indexOf(e)}function i(e){var t=[];return window.navigator.platform.includes("Mac")?t.push(u.COMMAND_LEFT,u.COMMAND_RIGHT,u.COMMAND_FIREFOX):t.push(u.CONTROL),t.includes(e)}function a(e){return[u.CONTROL,u.COMMAND_LEFT,u.COMMAND_RIGHT,u.COMMAND_FIREFOX].includes(e)}function s(e,t){var n=t.split("|"),r=!1;return(0,l.arrayEach)(n,function(t){if(e===u[t])return r=!0,!1}),r}t.__esModule=!0,t.KEY_CODES=void 0,t.isPrintableChar=r,t.isMetaKey=o,t.isCtrlKey=i,t.isCtrlMetaKey=a,t.isKey=s;var l=n(0),u=t.KEY_CODES={MOUSE_LEFT:1,MOUSE_RIGHT:3,MOUSE_MIDDLE:2,BACKSPACE:8,COMMA:188,INSERT:45,DELETE:46,END:35,ENTER:13,ESCAPE:27,CONTROL:17,COMMAND_LEFT:91,COMMAND_RIGHT:93,COMMAND_FIREFOX:224,ALT:18,HOME:36,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,SPACE:32,SHIFT:16,CAPS_LOCK:20,TAB:9,ARROW_RIGHT:39,ARROW_LEFT:37,ARROW_UP:38,ARROW_DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,A:65,C:67,D:68,F:70,L:76,O:79,P:80,S:83,V:86,X:88}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t={},n=e;this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in t||(t[e.guid]=new n(e)),t[e.guid]},f.default.getSingleton().add("afterDestroy",function(){t[this.guid]=null})}function i(e,t){var n=void 0;if("function"==typeof e)I.get(e)||s(null,e),n=I.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter');n=x(e)}if(!n)throw Error('No editor registered under name "'+e+'"');return n.getInstance(t)}function a(e){if(!L(e))throw Error('No registered editor found under "'+e+'" name');return x(e).getConstructor()}function s(e,t){var n=new o(t);"string"==typeof e&&P(e,n),I.set(t,n)}t.__esModule=!0,t.getRegisteredEditors=t.getRegisteredEditorNames=t.hasEditor=t.getEditorInstance=t.getEditor=t.registerEditor=void 0,t.RegisteredEditor=o,t._getEditorInstance=i;var l=n(49),u=r(l),c=n(17),f=r(c),h=n(63),d=r(h),p=n(328),g=r(p),v=n(516),m=r(v),y=n(517),w=r(y),b=n(522),C=r(b),_=n(329),E=r(_),O=n(523),S=r(O),T=n(524),R=r(T),M=n(525),k=r(M),N=n(65),A=r(N),I=new WeakMap,D=(0,u.default)("editors"),P=D.register,x=D.getItem,L=D.hasItem,H=D.getNames,j=D.getValues;s("base",d.default),s("autocomplete",g.default),s("checkbox",m.default),s("date",w.default),s("dropdown",C.default),s("handsontable",E.default),s("numeric",S.default),s("password",R.default),s("select",k.default),s("text",A.default),t.registerEditor=s,t.getEditor=a,t.getEditorInstance=i,t.hasEditor=L,t.getRegisteredEditorNames=H,t.getRegisteredEditors=j},function(e,t,n){"use strict";function r(){if((0,s.isDefined)(console)){var e;(e=console).log.apply(e,arguments)}}function o(){if((0,s.isDefined)(console)){var e;(e=console).warn.apply(e,arguments)}}function i(){if((0,s.isDefined)(console)){var e;(e=console).info.apply(e,arguments)}}function a(){if((0,s.isDefined)(console)){var e;(e=console).error.apply(e,arguments)}}t.__esModule=!0,t.log=r,t.warn=o,t.info=i,t.error=a;var s=n(8)},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0),o=n(1),i={_localHooks:Object.create(null),addLocalHook:function(e,t){return this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t),this},runLocalHooks:function(e){for(var t=this,n=arguments.length,o=Array(n>1?n-1:0),i=1;i0)for(n=0;n0?"future":"past"];return T(n)?n(t):n.replace(/%s/i,t)}function L(e,t){var n=e.toLowerCase();jr[n]=jr[n+"s"]=jr[t]=e}function H(e){return"string"==typeof e?jr[e]||jr[e.toLowerCase()]:void 0}function j(e){var t,n,r={};for(n in e)c(e,n)&&(t=H(n))&&(r[t]=e[n]);return r}function F(e,t){Fr[e]=t}function V(e){var t=[];for(var n in e)t.push({unit:n,priority:Fr[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}function B(e,t,n){var r=""+Math.abs(e),o=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+r}function W(e,t,n,r){var o=r;"string"==typeof r&&(o=function(){return this[r]()}),e&&(Ur[e]=o),t&&(Ur[t[0]]=function(){return B(o.apply(this,arguments),t[1],t[2])}),n&&(Ur[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function U(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Y(e){var t,n,r=e.match(Vr);for(t=0,n=r.length;t=0&&Br.test(e);)e=e.replace(Br,n),Br.lastIndex=0,r-=1;return e}function z(e,t,n){so[e]=T(t)?t:function(e,r){return e&&n?n:t}}function X(e,t){return c(so,e)?so[e](t._strict,t._locale):new RegExp(K(e))}function K(e){return q(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,o){return t||n||r||o}))}function q(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),s(t)&&(r=function(e,n){n[t]=C(e)}),n=0;n=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}function Ce(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function _e(e,t,n){var r=7+t-n;return-(7+Ce(e,0,r).getUTCDay()-t)%7+r-1}function Ee(e,t,n,r,o){var i,a,s=(7+n-r)%7,l=_e(e,r,o),u=1+7*(t-1)+s+l;return u<=0?(i=e-1,a=ee(i)+u):u>ee(e)?(i=e+1,a=u-ee(e)):(i=e,a=u),{year:i,dayOfYear:a}}function Oe(e,t,n){var r,o,i=_e(e.year(),t,n),a=Math.floor((e.dayOfYear()-i-1)/7)+1;return a<1?(o=e.year()-1,r=a+Se(o,t,n)):a>Se(e.year(),t,n)?(r=a-Se(e.year(),t,n),o=e.year()+1):(o=e.year(),r=a),{week:r,year:o}}function Se(e,t,n){var r=_e(e,t,n),o=_e(e+1,t,n);return(ee(e)-r+o)/7}function Te(e){return Oe(e,this._week.dow,this._week.doy).week}function Re(){return this._week.dow}function Me(){return this._week.doy}function ke(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Ne(e){var t=Oe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Ae(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function Ie(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function De(e,t){return e?r(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:r(this._weekdays)?this._weekdays:this._weekdays.standalone}function Pe(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort}function xe(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Le(e,t,n){var r,o,i,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=h([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?(o=wo.call(this._weekdaysParse,a),-1!==o?o:null):"ddd"===t?(o=wo.call(this._shortWeekdaysParse,a),-1!==o?o:null):(o=wo.call(this._minWeekdaysParse,a),-1!==o?o:null):"dddd"===t?-1!==(o=wo.call(this._weekdaysParse,a))?o:-1!==(o=wo.call(this._shortWeekdaysParse,a))?o:(o=wo.call(this._minWeekdaysParse,a),-1!==o?o:null):"ddd"===t?-1!==(o=wo.call(this._shortWeekdaysParse,a))?o:-1!==(o=wo.call(this._weekdaysParse,a))?o:(o=wo.call(this._minWeekdaysParse,a),-1!==o?o:null):-1!==(o=wo.call(this._minWeekdaysParse,a))?o:-1!==(o=wo.call(this._weekdaysParse,a))?o:(o=wo.call(this._shortWeekdaysParse,a),-1!==o?o:null)}function He(e,t,n){var r,o,i;if(this._weekdaysParseExact)return Le.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(o=h([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(o,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(o,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(o,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function je(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Ae(e,this.localeData()),this.add(e-t,"d")):t}function Fe(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Ve(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Ie(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Be(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Ye.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=No),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function We(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Ye.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ao),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ue(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Ye.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Io),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ye(){function e(e,t){return t.length-e.length}var t,n,r,o,i,a=[],s=[],l=[],u=[];for(t=0;t<7;t++)n=h([2e3,1]).day(t),r=this.weekdaysMin(n,""),o=this.weekdaysShort(n,""),i=this.weekdays(n,""),a.push(r),s.push(o),l.push(i),u.push(r),u.push(o),u.push(i);for(a.sort(e),s.sort(e),l.sort(e),u.sort(e),t=0;t<7;t++)s[t]=q(s[t]),l[t]=q(l[t]),u[t]=q(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function $e(){return this.hours()%12||12}function Ge(){return this.hours()||24}function ze(e,t){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Xe(e,t){return t._meridiemParse}function Ke(e){return"p"===(e+"").toLowerCase().charAt(0)}function qe(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function Ze(e){return e?e.toLowerCase().replace("_","-"):e}function Qe(e){for(var t,n,r,o,i=0;i0;){if(r=Je(o.slice(0,t).join("-")))return r;if(n&&n.length>=t&&_(o,n,!0)>=t-1)break;t--}i++}return null}function Je(t){var r=null;if(!Ho[t]&&void 0!==e&&e&&e.exports)try{r=Do._abbr;n(508)("./"+t),et(r)}catch(e){}return Ho[t]}function et(e,t){var n;return e&&(n=a(t)?rt(e):tt(e,t))&&(Do=n),Do._abbr}function tt(e,t){if(null!==t){var n=Lo;if(t.abbr=e,null!=Ho[e])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Ho[e]._config;else if(null!=t.parentLocale){if(null==Ho[t.parentLocale])return jo[t.parentLocale]||(jo[t.parentLocale]=[]),jo[t.parentLocale].push({name:e,config:t}),null;n=Ho[t.parentLocale]._config}return Ho[e]=new k(M(n,t)),jo[e]&&jo[e].forEach(function(e){tt(e.name,e.config)}),et(e),Ho[e]}return delete Ho[e],null}function nt(e,t){if(null!=t){var n,r,o=Lo;r=Je(e),null!=r&&(o=r._config),t=M(o,t),n=new k(t),n.parentLocale=Ho[e],Ho[e]=n,et(e)}else null!=Ho[e]&&(null!=Ho[e].parentLocale?Ho[e]=Ho[e].parentLocale:null!=Ho[e]&&delete Ho[e]);return Ho[e]}function rt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Do;if(!r(e)){if(t=Je(e))return t;e=[e]}return Qe(e)}function ot(){return Dr(Ho)}function it(e){var t,n=e._a;return n&&-2===p(e).overflow&&(t=n[co]<0||n[co]>11?co:n[fo]<1||n[fo]>ue(n[uo],n[co])?fo:n[ho]<0||n[ho]>24||24===n[ho]&&(0!==n[po]||0!==n[go]||0!==n[vo])?ho:n[po]<0||n[po]>59?po:n[go]<0||n[go]>59?go:n[vo]<0||n[vo]>999?vo:-1,p(e)._overflowDayOfYear&&(tfo)&&(t=fo),p(e)._overflowWeeks&&-1===t&&(t=mo),p(e)._overflowWeekday&&-1===t&&(t=yo),p(e).overflow=t),e}function at(e,t,n){return null!=e?e:null!=t?t:n}function st(e){var n=new Date(t.now());return e._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function lt(e){var t,n,r,o,i,a=[];if(!e._d){for(r=st(e),e._w&&null==e._a[fo]&&null==e._a[co]&&ut(e),null!=e._dayOfYear&&(i=at(e._a[uo],r[uo]),(e._dayOfYear>ee(i)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),n=Ce(i,0,e._dayOfYear),e._a[co]=n.getUTCMonth(),e._a[fo]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=r[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ho]&&0===e._a[po]&&0===e._a[go]&&0===e._a[vo]&&(e._nextDay=!0,e._a[ho]=0),e._d=(e._useUTC?Ce:be).apply(null,a),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ho]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(p(e).weekdayMismatch=!0)}}function ut(e){var t,n,r,o,i,a,s,l;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)i=1,a=4,n=at(t.GG,e._a[uo],Oe(Tt(),1,4).year),r=at(t.W,1),((o=at(t.E,1))<1||o>7)&&(l=!0);else{i=e._locale._week.dow,a=e._locale._week.doy;var u=Oe(Tt(),i,a);n=at(t.gg,e._a[uo],u.year),r=at(t.w,u.week),null!=t.d?((o=t.d)<0||o>6)&&(l=!0):null!=t.e?(o=t.e+i,(t.e<0||t.e>6)&&(l=!0)):o=i}r<1||r>Se(n,i,a)?p(e)._overflowWeeks=!0:null!=l?p(e)._overflowWeekday=!0:(s=Ee(n,r,o,i,a),e._a[uo]=s.year,e._dayOfYear=s.dayOfYear)}function ct(e){var t,n,r,o,i,a,s=e._i,l=Fo.exec(s)||Vo.exec(s);if(l){for(p(e).iso=!0,t=0,n=Wo.length;t0&&p(e).unusedInput.push(a),s=s.slice(s.indexOf(r)+r.length),u+=r.length),Ur[i]?(r?p(e).empty=!1:p(e).unusedTokens.push(i),J(i,r,e)):e._strict&&!r&&p(e).unusedTokens.push(i);p(e).charsLeftOver=l-u,s.length>0&&p(e).unusedInput.push(s),e._a[ho]<=12&&!0===p(e).bigHour&&e._a[ho]>0&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[ho]=wt(e._locale,e._a[ho],e._meridiem),lt(e),it(e)}function wt(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(r=e.isPM(n),r&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function bt(e){var t,n,r,o,i;if(0===e._f.length)return p(e).invalidFormat=!0,void(e._d=new Date(NaN));for(o=0;othis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function zt(){if(!a(this._isDSTShifted))return this._isDSTShifted;var e={};if(m(e,this),e=Et(e),e._a){var t=e._isUTC?h(e._a):Tt(e._a);this._isDSTShifted=this.isValid()&&_(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Xt(){return!!this.isValid()&&!this._isUTC}function Kt(){return!!this.isValid()&&this._isUTC}function qt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Zt(e,t){var n,r,o,i=e,a=null;return Pt(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:s(e)?(i={},t?i[t]=e:i.milliseconds=e):(a=Qo.exec(e))?(n="-"===a[1]?-1:1,i={y:0,d:C(a[fo])*n,h:C(a[ho])*n,m:C(a[po])*n,s:C(a[go])*n,ms:C(xt(1e3*a[vo]))*n}):(a=Jo.exec(e))?(n="-"===a[1]?-1:1,i={y:Qt(a[2],n),M:Qt(a[3],n),w:Qt(a[4],n),d:Qt(a[5],n),h:Qt(a[6],n),m:Qt(a[7],n),s:Qt(a[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(o=en(Tt(i.from),Tt(i.to)),i={},i.ms=o.milliseconds,i.M=o.months),r=new Dt(i),Pt(e)&&c(e,"_locale")&&(r._locale=e._locale),r}function Qt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Jt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function en(e,t){var n;return e.isValid()&&t.isValid()?(t=jt(t,e),e.isBefore(t)?n=Jt(e,t):(n=Jt(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function tn(e,t){return function(n,r){var o,i;return null===r||isNaN(+r)||(S(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),n="string"==typeof n?+n:n,o=Zt(n,r),nn(this,o,e),this}}function nn(e,n,r,o){var i=n._milliseconds,a=xt(n._days),s=xt(n._months);e.isValid()&&(o=null==o||o,s&&pe(e,oe(e,"Month")+s*r),a&&ie(e,"Date",oe(e,"Date")+a*r),i&&e._d.setTime(e._d.valueOf()+i*r),o&&t.updateOffset(e,a||s))}function rn(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function on(e,n){var r=e||Tt(),o=jt(r,this).startOf("day"),i=t.calendarFormat(this,o)||"sameElse";return this.format(n&&(T(n[i])?n[i].call(this,r):n[i])||this.localeData().calendar(i,this,Tt(r)))}function an(){return new y(this)}function sn(e,t){var n=w(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&(t=H(a(t)?"millisecond":t),"millisecond"===t?this.valueOf()>n.valueOf():n.valueOf()9999?$(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this._d.valueOf()).toISOString().replace("Z",$(n,"Z")):$(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function mn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");return this.format("["+e+'("]'+(0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY")+"-MM-DD[T]HH:mm:ss.SSS"+t+'[")]')}function yn(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var n=$(this,e);return this.localeData().postformat(n)}function wn(e,t){return this.isValid()&&(w(e)&&e.isValid()||Tt(e).isValid())?Zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function bn(e){return this.from(Tt(),e)}function Cn(e,t){return this.isValid()&&(w(e)&&e.isValid()||Tt(e).isValid())?Zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function _n(e){return this.to(Tt(),e)}function En(e){var t;return void 0===e?this._locale._abbr:(t=rt(e),null!=t&&(this._locale=t),this)}function On(){return this._locale}function Sn(e){switch(e=H(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function Tn(e){return void 0===(e=H(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))}function Rn(){return this._d.valueOf()-6e4*(this._offset||0)}function Mn(){return Math.floor(this.valueOf()/1e3)}function kn(){return new Date(this.valueOf())}function Nn(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function An(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function In(){return this.isValid()?this.toISOString():null}function Dn(){return g(this)}function Pn(){return f({},p(this))}function xn(){return p(this).overflow}function Ln(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Hn(e,t){W(0,[e,e.length],0,t)}function jn(e){return Wn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Fn(e){return Wn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Vn(){return Se(this.year(),1,4)}function Bn(){var e=this.localeData()._week;return Se(this.year(),e.dow,e.doy)}function Wn(e,t,n,r,o){var i;return null==e?Oe(this,r,o).year:(i=Se(e,r,o),t>i&&(t=i),Un.call(this,e,t,n,r,o))}function Un(e,t,n,r,o){var i=Ee(e,t,n,r,o),a=Ce(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Yn(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function $n(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function Gn(e,t){t[vo]=C(1e3*("0."+e))}function zn(){return this._isUTC?"UTC":""}function Xn(){return this._isUTC?"Coordinated Universal Time":""}function Kn(e){return Tt(1e3*e)}function qn(){return Tt.apply(null,arguments).parseZone()}function Zn(e){return e}function Qn(e,t,n,r){return rt()[n](h().set(r,t),e)}function Jn(e,t,n){if(s(e)&&(t=e,e=void 0),e=e||"",null!=t)return Qn(e,t,n,"month");var r,o=[];for(r=0;r<12;r++)o[r]=Qn(e,r,n,"month");return o}function er(e,t,n,r){"boolean"==typeof e?(s(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,s(t)&&(n=t,t=void 0),t=t||"");var o=rt(),i=e?o._week.dow:0;if(null!=n)return Qn(t,(n+i)%7,r,"day");var a,l=[];for(a=0;a<7;a++)l[a]=Qn(t,(a+i)%7,r,"day");return l}function tr(e,t){return Jn(e,t,"months")}function nr(e,t){return Jn(e,t,"monthsShort")}function rr(e,t,n){return er(e,t,n,"weekdays")}function or(e,t,n){return er(e,t,n,"weekdaysShort")}function ir(e,t,n){return er(e,t,n,"weekdaysMin")}function ar(){var e=this._data;return this._milliseconds=ci(this._milliseconds),this._days=ci(this._days),this._months=ci(this._months),e.milliseconds=ci(e.milliseconds),e.seconds=ci(e.seconds),e.minutes=ci(e.minutes),e.hours=ci(e.hours),e.months=ci(e.months),e.years=ci(e.years),this}function sr(e,t,n,r){var o=Zt(t,n);return e._milliseconds+=r*o._milliseconds,e._days+=r*o._days,e._months+=r*o._months,e._bubble()}function lr(e,t){return sr(this,e,t,1)}function ur(e,t){return sr(this,e,t,-1)}function cr(e){return e<0?Math.floor(e):Math.ceil(e)}function fr(){var e,t,n,r,o,i=this._milliseconds,a=this._days,s=this._months,l=this._data;return i>=0&&a>=0&&s>=0||i<=0&&a<=0&&s<=0||(i+=864e5*cr(dr(s)+a),a=0,s=0),l.milliseconds=i%1e3,e=b(i/1e3),l.seconds=e%60,t=b(e/60),l.minutes=t%60,n=b(t/60),l.hours=n%24,a+=b(n/24),o=b(hr(a)),s+=o,a-=cr(dr(o)),r=b(s/12),s%=12,l.days=a,l.months=s,l.years=r,this}function hr(e){return 4800*e/146097}function dr(e){return 146097*e/4800}function pr(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=H(e))||"year"===e)return t=this._days+r/864e5,n=this._months+hr(t),"month"===e?n:n/12;switch(t=this._days+Math.round(dr(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function gr(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*C(this._months/12):NaN}function vr(e){return function(){return this.as(e)}}function mr(){return Zt(this)}function yr(e){return e=H(e),this.isValid()?this[e+"s"]():NaN}function wr(e){return function(){return this.isValid()?this._data[e]:NaN}}function br(){return b(this.days()/7)}function Cr(e,t,n,r,o){return o.relativeTime(t||1,!!n,e,r)}function _r(e,t,n){var r=Zt(e).abs(),o=Ti(r.as("s")),i=Ti(r.as("m")),a=Ti(r.as("h")),s=Ti(r.as("d")),l=Ti(r.as("M")),u=Ti(r.as("y")),c=o<=Ri.ss&&["s",o]||o0,c[4]=n,Cr.apply(null,c)}function Er(e){return void 0===e?Ti:"function"==typeof e&&(Ti=e,!0)}function Or(e,t){return void 0!==Ri[e]&&(void 0===t?Ri[e]:(Ri[e]=t,"s"===e&&(Ri.ss=t-1),!0))}function Sr(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=_r(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function Tr(e){return(e>0)-(e<0)||+e}function Rr(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r=Mi(this._milliseconds)/1e3,o=Mi(this._days),i=Mi(this._months);e=b(r/60),t=b(e/60),r%=60,e%=60,n=b(i/12),i%=12;var a=n,s=i,l=o,u=t,c=e,f=r?r.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var d=h<0?"-":"",p=Tr(this._months)!==Tr(h)?"-":"",g=Tr(this._days)!==Tr(h)?"-":"",v=Tr(this._milliseconds)!==Tr(h)?"-":"";return d+"P"+(a?p+a+"Y":"")+(s?p+s+"M":"")+(l?g+l+"D":"")+(u||c||f?"T":"")+(u?v+u+"H":"")+(c?v+c+"M":"")+(f?v+f+"S":"")}var Mr,kr;kr=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,r=0;r68?1900:2e3)};var wo,bo=re("FullYear",!0);wo=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;tthis?this:e:v()}),Ko=function(){return Date.now?Date.now():+new Date},qo=["year","quarter","month","week","day","hour","minute","second","millisecond"];Lt("Z",":"),Lt("ZZ",""),z("Z",oo),z("ZZ",oo),Z(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ht(oo,e)});var Zo=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var Qo=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Jo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;Zt.fn=Dt.prototype,Zt.invalid=It;var ei=tn(1,"add"),ti=tn(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ni=O("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Hn("gggg","weekYear"),Hn("ggggg","weekYear"),Hn("GGGG","isoWeekYear"),Hn("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),z("G",no),z("g",no),z("GG",Kr,$r),z("gg",Kr,$r),z("GGGG",Jr,zr),z("gggg",Jr,zr),z("GGGGG",eo,Xr),z("ggggg",eo,Xr),Q(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=C(e)}),Q(["gg","GG"],function(e,n,r,o){n[o]=t.parseTwoDigitYear(e)}),W("Q",0,"Qo","quarter"),L("quarter","Q"),F("quarter",7),z("Q",Yr),Z("Q",function(e,t){t[co]=3*(C(e)-1)}),W("D",["DD",2],"Do","date"),L("date","D"),F("date",9),z("D",Kr),z("DD",Kr,$r),z("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Z(["D","DD"],fo),Z("Do",function(e,t){t[fo]=C(e.match(Kr)[0])});var ri=re("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),F("dayOfYear",4),z("DDD",Qr),z("DDDD",Gr),Z(["DDD","DDDD"],function(e,t,n){n._dayOfYear=C(e)}),W("m",["mm",2],0,"minute"),L("minute","m"),F("minute",14),z("m",Kr),z("mm",Kr,$r),Z(["m","mm"],po);var oi=re("Minutes",!1);W("s",["ss",2],0,"second"),L("second","s"),F("second",15),z("s",Kr),z("ss",Kr,$r),Z(["s","ss"],go);var ii=re("Seconds",!1);W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return 10*this.millisecond()}),W(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),W(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),W(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),W(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),W(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),L("millisecond","ms"),F("millisecond",16),z("S",Qr,Yr),z("SS",Qr,$r),z("SSS",Qr,Gr);var ai;for(ai="SSSS";ai.length<=9;ai+="S")z(ai,to);for(ai="S";ai.length<=9;ai+="S")Z(ai,Gn);var si=re("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var li=y.prototype;li.add=ei,li.calendar=on,li.clone=an,li.diff=dn,li.endOf=Tn,li.format=yn,li.from=wn,li.fromNow=bn,li.to=Cn,li.toNow=_n,li.get=ae,li.invalidAt=xn,li.isAfter=sn,li.isBefore=ln,li.isBetween=un,li.isSame=cn,li.isSameOrAfter=fn,li.isSameOrBefore=hn,li.isValid=Dn,li.lang=ni,li.locale=En,li.localeData=On,li.max=Xo,li.min=zo,li.parsingFlags=Pn,li.set=se,li.startOf=Sn,li.subtract=ti,li.toArray=Nn,li.toObject=An,li.toDate=kn,li.toISOString=vn,li.inspect=mn,li.toJSON=In,li.toString=gn,li.unix=Mn,li.valueOf=Rn,li.creationData=Ln,li.year=bo,li.isLeapYear=ne,li.weekYear=jn,li.isoWeekYear=Fn,li.quarter=li.quarters=Yn,li.month=ge,li.daysInMonth=ve,li.week=li.weeks=ke,li.isoWeek=li.isoWeeks=Ne,li.weeksInYear=Bn,li.isoWeeksInYear=Vn,li.date=ri,li.day=li.days=je,li.weekday=Fe,li.isoWeekday=Ve,li.dayOfYear=$n,li.hour=li.hours=xo,li.minute=li.minutes=oi,li.second=li.seconds=ii,li.millisecond=li.milliseconds=si,li.utcOffset=Vt,li.utc=Wt,li.local=Ut,li.parseZone=Yt,li.hasAlignedHourOffset=$t,li.isDST=Gt,li.isLocal=Xt,li.isUtcOffset=Kt,li.isUtc=qt,li.isUTC=qt,li.zoneAbbr=zn,li.zoneName=Xn,li.dates=O("dates accessor is deprecated. Use date instead.",ri),li.months=O("months accessor is deprecated. Use month instead",ge),li.years=O("years accessor is deprecated. Use year instead",bo),li.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Bt),li.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",zt);var ui=k.prototype;ui.calendar=N,ui.longDateFormat=A,ui.invalidDate=I,ui.ordinal=D,ui.preparse=Zn,ui.postformat=Zn,ui.relativeTime=P,ui.pastFuture=x,ui.set=R,ui.months=ce,ui.monthsShort=fe,ui.monthsParse=de,ui.monthsRegex=ye,ui.monthsShortRegex=me,ui.week=Te,ui.firstDayOfYear=Me,ui.firstDayOfWeek=Re,ui.weekdays=De,ui.weekdaysMin=xe,ui.weekdaysShort=Pe,ui.weekdaysParse=He,ui.weekdaysRegex=Be,ui.weekdaysShortRegex=We,ui.weekdaysMinRegex=Ue,ui.isPM=Ke,ui.meridiem=qe,et("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===C(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),t.lang=O("moment.lang is deprecated. Use moment.locale instead.",et),t.langData=O("moment.langData is deprecated. Use moment.localeData instead.",rt);var ci=Math.abs,fi=vr("ms"),hi=vr("s"),di=vr("m"),pi=vr("h"),gi=vr("d"),vi=vr("w"),mi=vr("M"),yi=vr("y"),wi=wr("milliseconds"),bi=wr("seconds"),Ci=wr("minutes"),_i=wr("hours"),Ei=wr("days"),Oi=wr("months"),Si=wr("years"),Ti=Math.round,Ri={ss:44,s:45,m:45,h:22,d:26,M:11},Mi=Math.abs,ki=Dt.prototype;return ki.isValid=At,ki.abs=ar,ki.add=lr,ki.subtract=ur,ki.as=pr,ki.asMilliseconds=fi,ki.asSeconds=hi,ki.asMinutes=di,ki.asHours=pi,ki.asDays=gi,ki.asWeeks=vi,ki.asMonths=mi,ki.asYears=yi,ki.valueOf=gr,ki._bubble=fr,ki.clone=mr,ki.get=yr,ki.milliseconds=wi,ki.seconds=bi,ki.minutes=Ci,ki.hours=_i,ki.days=Ei,ki.weeks=br,ki.months=Oi,ki.years=Si,ki.humanize=Sr,ki.toISOString=Rr,ki.toString=Rr,ki.toJSON=Rr,ki.locale=En,ki.localeData=On,ki.toIsoString=O("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Rr),ki.lang=ni,W("X",0,0,"unix"),W("x",0,0,"valueOf"),z("x",no),z("X",io),Z("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),Z("x",function(e,t,n){n._d=new Date(C(e))}),t.version="2.20.1",function(e){Mr=e}(Tt),t.fn=li,t.min=Mt,t.max=kt,t.now=Ko,t.utc=h,t.unix=Kn,t.months=tr,t.isDate=l,t.locale=et,t.invalid=v,t.duration=Zt,t.isMoment=w,t.weekdays=rr,t.parseZone=qn,t.localeData=rt,t.isDuration=Pt,t.monthsShort=nr,t.weekdaysMin=ir,t.defineLocale=tt,t.updateLocale=nt,t.locales=ot,t.weekdaysShort=or,t.normalizeUnits=H,t.relativeTimeRounding=Er,t.relativeTimeThreshold=Or,t.calendarFormat=rn,t.prototype=li,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},t}),window.moment=n(23)}).call(t,n(200)(e))},function(e,t,n){"use strict";function r(e){return(0,C.arrayMap)(e,function(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}})}function o(e){return(0,_.hasClass)(e,"htSeparator")}function i(e){return(0,_.hasClass)(e,"htSubmenu")}function a(e){return(0,_.hasClass)(e,"htDisabled")}function s(e){return(0,_.hasClass)(e,"htSelectionDisabled")}function l(e){var t=e.getSelected();return t?t[0]<0?null:t:null}function u(e,t){return-1!==e.indexOf(t)?e:e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")+" "+t}function c(e,t){return-1!==e.indexOf(t)?e:e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")+" "+t}function f(e,t){var n={};return(0,C.arrayEach)(e,function(e){for(var r=e.from,o=e.to,i=r.row;i<=o.row;i++)for(var a=r.col;a<=o.col;a++)n[i]||(n[i]=[]),n[i][a]=t(i,a)}),n}function h(e,t,n,r,o){(0,C.arrayEach)(e,function(e){var i=e.from,a=e.to;if(i.row===a.row&&i.col===a.col)d(i.row,i.col,t,n,r,o);else for(var s=i.row;s<=a.row;s++)for(var l=i.col;l<=a.col;l++)d(s,l,t,n,r,o)})}function d(e,t,n,r,o,i){var a=o(e,t),s=r;a.className&&(s="vertical"===n?u(a.className,r):c(a.className,r)),i(e,t,"className",s)}function p(e,t){var n=!1;return Array.isArray(e)&&(0,C.arrayEach)(e,function(e){return e.forAll(function(e,r){if(t(e,r))return n=!0,!1}),n}),n}function g(e){return''+String.fromCharCode(10003)+""+e}function v(e,t){return!e.hidden||!("function"==typeof e.hidden&&e.hidden.call(t))}function m(e,t){for(var n=e.slice(0);00?t[t.length-1].name!==e.name&&t.push(e):t.push(e)}),t}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E.KEY,n=e.slice(0);return n=m(n,t),n=y(n,t),n=w(n)}t.__esModule=!0,t.normalizeSelection=r,t.isSeparator=o,t.hasSubMenu=i,t.isDisabled=a,t.isSelectionDisabled=s,t.getValidSelection=l,t.prepareVerticalAlignClass=u,t.prepareHorizontalAlignClass=c,t.getAlignmentClasses=f,t.align=h,t.checkSelectionConsistency=p,t.markLabelAsSelected=g,t.isItemHidden=v,t.filterSeparators=b;var C=n(0),_=n(2),E=n(161)},function(e,t,n){var r=n(22),o=n(170),i=n(92),a=Object.defineProperty;t.f=n(27)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){"use strict";function r(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(7),o=n(48),i=n(28);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",a)}},function(e,t,n){"use strict";function r(e){return e[0].toUpperCase()+e.substr(1)}function o(){for(var e=[],t=arguments.length,n=Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return(""+e).replace(/(?:\\)?\[([^[\]]+)]/g,function(e,n){return"\\"===e.charAt(0)?e.substr(1,e.length-1):void 0===t[n]?"":t[n]})}function l(e){return(""+e).replace(c,"")}t.__esModule=!0,t.toUpperCaseFirst=r,t.equalsIgnoreCase=o,t.randomString=i,t.isPercentValue=a,t.substitute=s,t.stripTags=l;var u=n(8),c=/<\/?\w+\/?>|<\w+[\s|\/][^>]*>/gi},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t}},{key:"reset",value:function(){if(this.clone){var e=this.clone.wtTable.holder;(0,l.arrayEach)([e.style,this.clone.wtTable.hider.style,e.parentNode.style],function(e){e.width="",e.height=""})}}},{key:"destroy",value:function(){new c.default(this.clone).destroy()}}]),e}()},function(e,t,n){"use strict";function r(e){return"function"==typeof e}function o(e){function t(){for(var t=this,a=arguments.length,s=Array(a),l=0;l1&&void 0!==arguments[1]?arguments[1]:200,r=0,o={lastCallThrottled:!0},i=null;return t}function i(e){function t(){s=i}function n(){for(var t=arguments.length,n=Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:200,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=o(e,r),s=i;return n.clearHits=t,n}function a(e){function t(){for(var t=this,i=arguments.length,a=Array(i),s=0;s1&&void 0!==arguments[1]?arguments[1]:200,r=null,o=void 0;return t}function s(){for(var e=arguments.length,t=Array(e),n=0;n1?t-1:0),r=1;r=n?e.apply(this,s):t(s)}}var n=e.length;return t([])}function c(e){function t(r){return function(){for(var o=arguments.length,i=Array(o),a=0;a=n?e.apply(this,s):t(s)}}var n=e.length;return t([])}t.__esModule=!0,t.isFunction=r,t.throttle=o,t.throttleAfterHits=i,t.debounce=a,t.pipe=s,t.partial=l,t.curry=u,t.curryRight=c;var f=n(0)},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(16),o=n(37),i=n(35),a=n(58)("src"),s=Function.toString,l=(""+s).split("toString");n(48).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var u="function"==typeof n;u&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(u&&(i(n,a)||o(n,a,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t,n){var r=n(25),o=n(59);e.exports=n(27)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(74);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(47);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(58)("meta"),o=n(13),i=n(35),a=n(25).f,s=0,l=Object.isExtensible||function(){return!0},u=!n(28)(function(){return l(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},f=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!l(e))return"F";if(!t)return"E";c(e)}return e[r].i},h=function(e,t){if(!i(e,r)){if(!l(e))return!0;if(!t)return!1;c(e)}return e[r].w},d=function(e){return u&&p.NEED&&l(e)&&!i(e,r)&&c(e),e},p=e.exports={KEY:r,NEED:!1,fastKey:f,getWeak:h,onFreeze:d}},function(e,t,n){"use strict";function r(e){return d.call(window,e)}function o(e){p.call(window,e)}function i(){return"ontouchstart"in window}function a(){var e=document.createElement("div");return!(!e.createShadowRoot||!e.createShadowRoot.toString().match(/\[native code\]/))}function s(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var n=document.createElement("CAPTION");n.innerHTML="c
c
c
c",n.style.padding=0,n.style.margin=0,e.insertBefore(n,t),document.body.appendChild(e),v=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function l(){return void 0===v&&s(),v}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m||(m="object"===("undefined"==typeof Intl?"undefined":c(Intl))?new Intl.Collator(e,t).compare:"function"==typeof String.prototype.localeCompare?function(e,t){return(""+e).localeCompare(t)}:function(e,t){return e===t?0:e>t?-1:1})}t.__esModule=!0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.requestAnimationFrame=r,t.cancelAnimationFrame=o,t.isTouchSupported=i,t.isWebComponentSupportedNatively=a,t.hasCaptionProblem=l,t.getComparisonFunction=u;for(var f=0,h=["ms","moz","webkit","o"],d=window.requestAnimationFrame,p=window.cancelAnimationFrame,g=0;g=2&&"="===e.charAt(0)}function o(e){return"string"==typeof e&&"'"===e.charAt(0)&&"="===e.charAt(1)}function i(e){return o(e)?e.substr(1):e}function a(e){var t=/(\\"|"(?:\\"|[^"])*"|(\+))|(\\'|'(?:\\'|[^'])*'|(\+))/g,n=e.match(t)||[],r=-1;return e.toUpperCase().replace(t,function(){return r+=1,n[r]})}function s(e,t){return function(n){return{row:"row"===e?t:n.row,column:"column"===e?t:n.column}}}t.__esModule=!0,t.isFormulaExpression=r,t.isFormulaExpressionEscaped=o,t.unescapeFormulaExpression=i,t.toUpperCaseFormula=a,t.cellCoordFactory=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=function(){function e(e,t){for(var n=0;n0}},{key:"hasPrecedent",value:function(e){return(0,l.arrayFilter)(this.precedents,function(t){return t.isEqual(e)}).length>0}}]),t}(c.default)},function(e,t,n){var r=n(171),o=n(97);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:"common";i.has(s)||i.set(s,new Map);var l=i.get(s);return{register:e,getItem:t,hasItem:n,getNames:o,getValues:a}}t.__esModule=!0,t.default=o;var i=t.collection=new Map},function(e,t,n){"use strict";function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.userAgent,n=void 0===t?navigator.userAgent:t,r=e.vendor,o=void 0===r?navigator.vendor:r;(0,h.objectEach)(p,function(e){return void(0,e.test)(n,o)})}function o(){return p.chrome.value}function i(){return p.edge.value}function a(){return p.ie.value}function s(){return p.ie8.value}function l(){return p.ie9.value}function u(){return p.ie.value||p.edge.value}function c(){return p.mobile.value}function f(){return p.safari.value}t.__esModule=!0,t.setBrowserMeta=r,t.isChrome=o,t.isEdge=i,t.isIE=a,t.isIE8=s,t.isIE9=l,t.isMSBrowser=u,t.isMobileBrowser=c,t.isSafari=f;var h=n(1),d=function(e){var t={value:!1};return t.test=function(n,r){t.value=e(n,r)},t},p={chrome:d(function(e,t){return/Chrome/.test(e)&&/Google/.test(t)}),edge:d(function(e){return/Edge/.test(e)}),ie:d(function(e){return/Trident/.test(e)}),ie8:d(function(){return!document.createTextNode("test").textContent}),ie9:d(function(){return!!document.documentMode}),mobile:d(function(e){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}),safari:d(function(e,t){return/Safari/.test(e)&&/Apple Computer/.test(t)})};r()},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:1,r=(0,o.arrayMax)(this._arrayMap)+1,i=[];return(0,a.rangeEach)(n-1,function(n){i.push(t._arrayMap.splice(e+n,0,r+n))}),i},removeItems:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[];if(Array.isArray(e)){var i=[].concat(this._arrayMap);e.sort(function(e,t){return t-e}),r=(0,o.arrayReduce)(e,function(e,n){return t._arrayMap.splice(n,1),e.concat(i.slice(n,n+1))},[])}else r=this._arrayMap.splice(e,n);return r},unshiftItems:function(e){function t(e){return(0,o.arrayReduce)(r,function(t,n){var r=t;return e>n&&(r+=1),r},0)}var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this.removeItems(e,n);this._arrayMap=(0,o.arrayMap)(this._arrayMap,function(e){var n=e,r=t(n);return r&&(n-=r),n})},shiftItems:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this._arrayMap=(0,o.arrayMap)(this._arrayMap,function(t){var r=t;return r>=e&&(r+=n),r}),(0,a.rangeEach)(n-1,function(n){t._arrayMap.splice(e+n,0,e+n)})},swapIndexes:function(e,t){var n;(n=this._arrayMap).splice.apply(n,[t,0].concat(r(this._arrayMap.splice(e,1))))},clearMap:function(){this._arrayMap.length=0}};(0,i.defineGetter)(s,"MIXIN_NAME","arrayMapper",{writable:!1,enumerable:!1}),t.default=s},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(13);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){var r=n(14)("unscopables"),o=Array.prototype;void 0==o[r]&&n(37)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){h.set(e,t)}function i(e){var t=e instanceof u.default?e:a(e),n=void 0;return d.has(t)?n=d.get(t):(n=new f(t),d.set(t,n)),n}function a(e){if(!h.has(e))throw Error("Record translator was not registered for this object identity");return h.get(e)}t.__esModule=!0,t.RecordTranslator=void 0;var s=function(){function e(e,t){for(var n=0;n'+String.fromCharCode(10003)+""+e}t.__esModule=!0,t.createId=r,t.createDefaultCustomBorder=o,t.createSingleEmptyBorder=i,t.createDefaultHtBorder=a,t.createEmptyBorders=s,t.extendDefaultBorder=l,t.checkSelectionBorders=u,t.markSelected=c;var f=n(1),h=n(0)},function(e,t){e.exports=!1},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports={}},function(e,t,n){var r=n(25).f,o=n(35),i=n(14)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){"use strict";function r(e){this.instance=e,this.state=a.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}t.__esModule=!0,t.EditorState=void 0;var o=n(10),i=n(8),a=t.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"};r.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},r.prototype.init=function(){},r.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},r.prototype.setValue=function(){throw Error("Editor setValue() method unimplemented")},r.prototype.open=function(){throw Error("Editor open() method unimplemented")},r.prototype.close=function(){throw Error("Editor close() method unimplemented")},r.prototype.prepare=function(e,t,n,r,o,i){this.TD=r,this.row=e,this.col=t,this.prop=n,this.originalValue=o,this.cellProperties=i,this.state=a.VIRGIN},r.prototype.extend=function(){function e(){for(var e=arguments.length,n=Array(e),r=0;rn[2]&&(r=n[0],n[0]=n[2],n[2]=r),n[1]>n[3]&&(r=n[1],n[1]=n[3],n[3]=r)):n=[this.row,this.col,null,null],this.instance.populateFromArray(n[0],n[1],e,n[2],n[3],"edit")},r.prototype.beginEditing=function(e,t){if(this.state===a.VIRGIN){if(this.instance.view.scrollViewport(new o.CellCoords(this.row,this.col)),this.state=a.EDITING,this.isInFullEditMode()){this.setValue("string"==typeof e?e:(0,i.stringify)(this.originalValue))}this.open(t),this._opened=!0,this.focus(),this.instance.view.render(),this.instance.runHooks("afterBeginEditing",this.row,this.col)}},r.prototype.finishEditing=function(e,t,n){var r=this,o=void 0;if(n){var i=this._closeCallback;this._closeCallback=function(e){i&&i(e),n(e),r.instance.view.render()}}if(!this.isWaiting()){if(this.state===a.VIRGIN)return void this.instance._registerTimeout(function(){r._fireCallbacks(!0)});if(this.state===a.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();var s=this.getValue();o=this.instance.getSettings().trimWhitespace?[["string"==typeof s?String.prototype.trim.call(s||""):s]]:[[s]],this.state=a.WAITING,this.saveValue(o,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){r.state=a.FINISHED,r.discardEditor(e)}):(this.state=a.FINISHED,this.discardEditor(!0))}}},r.prototype.cancelChanges=function(){this.state=a.FINISHED,this.discardEditor()},r.prototype.discardEditor=function(e){this.state===a.FINISHED&&(!1===e&&!0!==this.cellProperties.allowInvalid?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=a.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=a.VIRGIN,this._fireCallbacks(!0)))},r.prototype.enableFullEditMode=function(){this._fullEditMode=!0},r.prototype.isInFullEditMode=function(){return this._fullEditMode},r.prototype.isOpened=function(){return this._opened},r.prototype.isWaiting=function(){return this.state===a.WAITING},r.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns"))}},{key:"isEqual",value:function(e){return e===this||this.row===e.row&&this.col===e.col}},{key:"isSouthEastOf",value:function(e){return this.row>=e.row&&this.col>=e.col}},{key:"isNorthWestOf",value:function(e){return this.row<=e.row&&this.col<=e.col}},{key:"isSouthWestOf",value:function(e){return this.row>=e.row&&this.col<=e.col}},{key:"isNorthEastOf",value:function(e){return this.row<=e.row&&this.col>=e.col}},{key:"toObject",value:function(){return{row:this.row,col:this.col}}}]),e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(2),i=n(515),a=r(i),s=n(63),l=r(s),u=n(9),c=r(u),f=n(18),h=n(12),d=l.default.prototype.extend();d.prototype.init=function(){var e=this;this.createElements(),this.eventManager=new c.default(this),this.bindEvents(),this.autoResize=(0,a.default)(),this.holderZIndex=-1,this.instance.addHook("afterDestroy",function(){e.destroy()})},d.prototype.prepare=function(e,t,n,r,o,i){for(var a=this,u=this.state,c=arguments.length,f=Array(c>6?c-6:0),h=6;h=0?this.holderZIndex:"",this.textareaParentStyle.position=""},d.prototype.getValue=function(){return this.TEXTAREA.value},d.prototype.setValue=function(e){this.TEXTAREA.value=e},d.prototype.beginEditing=function(){if(this.state===s.EditorState.VIRGIN){this.TEXTAREA.value="";for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]&&arguments[0];if(this.state===s.EditorState.EDITING||e){if(!(this.TD=this.getEditedCell()))return void(e||this.close(!0));var t=(0,o.offset)(this.TD),n=(0,o.offset)(this.instance.rootElement),r=this.instance.view.wt.wtOverlays.topOverlay.mainTableScrollableElement,i=this.instance.view.wt.wtOverlays.leftOverlay.mainTableScrollableElement,a=this.instance.countRows(),l=r!==window?r.scrollTop:0,u=i!==window?i.scrollLeft:0,c=this.checkEditorSection(),f=["","left"].includes(c)?l:0,h=["","top","bottom"].includes(c)?u:0,d=t.top===n.top?0:1,p=this.instance.getSettings(),g=this.instance.hasColHeaders(),v=this.TD.style.backgroundColor,m=t.top-n.top-d-f,y=t.left-n.left-1-h,w=void 0;switch(c){case"top":w=(0,o.getCssTransform)(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":w=(0,o.getCssTransform)(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":w=(0,o.getCssTransform)(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":w=(0,o.getCssTransform)(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":w=(0,o.getCssTransform)(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(g&&0===this.instance.getSelectedLast()[0]||p.fixedRowsBottom&&this.instance.getSelectedLast()[0]===a-p.fixedRowsBottom)&&(m+=1),0===this.instance.getSelectedLast()[1]&&(y+=1),w&&-1!==w?this.textareaParentStyle[w[0]]=w[1]:(0,o.resetCssTransform)(this.TEXTAREA_PARENT),this.textareaParentStyle.top=m+"px",this.textareaParentStyle.left=y+"px",this.showEditableElement();var b=this.instance.view.wt.wtViewport.rowsRenderCalculator.startPosition,C=this.instance.view.wt.wtViewport.columnsRenderCalculator.startPosition,_=this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),E=this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),O=(0,o.getScrollbarWidth)(),S=this.TD.offsetTop+b-E,T=this.TD.offsetLeft+C-_,R=(0,o.innerWidth)(this.TD)-8,M=(0,o.hasVerticalScrollbar)(r)?O:0,k=(0,o.hasHorizontalScrollbar)(i)?O:0,N=this.instance.view.maximumVisibleElementWidth(T)-9-M,A=this.TD.scrollHeight+1,I=Math.max(this.instance.view.maximumVisibleElementHeight(S)-k,23),D=(0,o.getComputedStyle)(this.TD);this.TEXTAREA.style.fontSize=D.fontSize,this.TEXTAREA.style.fontFamily=D.fontFamily,this.TEXTAREA.style.backgroundColor=v,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(A,I),maxHeight:I,minWidth:Math.min(R,N),maxWidth:N},!0)}},d.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){(0,h.stopPropagation)(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){(0,h.stopPropagation)(e)}),this.instance.addHook("afterScrollHorizontally",function(){e.refreshDimensions()}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},d.prototype.destroy=function(){this.eventManager.destroy()},t.default=d},function(e,t,n){"use strict";function r(e,t){return"number"==typeof e&&"number"==typeof t?e-t:f(e,t)}function o(e,t){var n=e;return""===n&&(n="("+t+")"),n}function i(e){var t=e;return h&&(t=new Set(t)),function(e){return h?t.has(e):!!~t.indexOf(e)}}function a(e){return null===e||void 0===e?"":e}function s(e){var t=e;return t=d?Array.from(new Set(t)):(0,c.arrayUnique)(t),t=t.sort(function(e,t){return"number"==typeof e&&"number"==typeof t?e-t:e===t?0:e>t?1:-1})}function l(e,t,n,r){var a=[],s=e===t,l=void 0;return s||(l=i(t)),(0,c.arrayEach)(e,function(e){var t=!1;(s||l(e))&&(t=!0);var i={checked:t,value:e,visualValue:o(e,n)};r&&r(i),a.push(i)}),a}t.__esModule=!0,t.sortComparison=r,t.toVisualValue=o,t.createArrayAssertion=i,t.toEmptyString=a,t.unifyColumnValues=s,t.intersectValues=l;var u=n(41),c=n(0),f=(0,u.getComparisonFunction)(),h=new Set([1]).has(1),d=h&&"function"==typeof Array.from},function(e,t,n){"use strict";function r(e){if(!a[e])throw Error('Operation with id "'+e+'" does not exist.');var t=a[e].func;return function(e,n){return t(e,n)}}function o(e){return a[e].name}function i(e,t,n){a[e]={name:t,func:n}}t.__esModule=!0,t.getOperationFunc=r,t.getOperationName=o,t.registerOperation=i;var a=t.operations={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=function(){function e(e,t){for(var n=0;n-1?parseFloat(e):parseInt(e,10)),t}function o(e){return-1*r(e)}t.__esModule=!0,t.toNumber=r,t.invertNumber=o},function(module,exports,__webpack_require__){var utils=__webpack_require__(1),error=__webpack_require__(0),statistical=__webpack_require__(5),information=__webpack_require__(7);exports.ABS=function(e){return(e=utils.parseNumber(e))instanceof Error?e:Math.abs(e)},exports.ACOS=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.acos(e);return isNaN(t)&&(t=error.num),t},exports.ACOSH=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.log(e+Math.sqrt(e*e-1));return isNaN(t)&&(t=error.num),t},exports.ACOT=function(e){return(e=utils.parseNumber(e))instanceof Error?e:Math.atan(1/e)},exports.ACOTH=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=.5*Math.log((e+1)/(e-1));return isNaN(t)&&(t=error.num),t},exports.AGGREGATE=function(e,t,n,r){if(e=utils.parseNumber(e),t=utils.parseNumber(e),utils.anyIsError(e,t))return error.value;switch(e){case 1:return statistical.AVERAGE(n);case 2:return statistical.COUNT(n);case 3:return statistical.COUNTA(n);case 4:return statistical.MAX(n);case 5:return statistical.MIN(n);case 6:return exports.PRODUCT(n);case 7:return statistical.STDEV.S(n);case 8:return statistical.STDEV.P(n);case 9:return exports.SUM(n);case 10:return statistical.VAR.S(n);case 11:return statistical.VAR.P(n);case 12:return statistical.MEDIAN(n);case 13:return statistical.MODE.SNGL(n);case 14:return statistical.LARGE(n,r);case 15:return statistical.SMALL(n,r);case 16:return statistical.PERCENTILE.INC(n,r);case 17:return statistical.QUARTILE.INC(n,r);case 18:return statistical.PERCENTILE.EXC(n,r);case 19:return statistical.QUARTILE.EXC(n,r)}},exports.ARABIC=function(e){if(!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(e))return error.value;var t=0;return e.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,function(e){t+={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1}[e]}),t},exports.ASIN=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.asin(e);return isNaN(t)&&(t=error.num),t},exports.ASINH=function(e){return e=utils.parseNumber(e),e instanceof Error?e:Math.log(e+Math.sqrt(e*e+1))},exports.ATAN=function(e){return e=utils.parseNumber(e),e instanceof Error?e:Math.atan(e)},exports.ATAN2=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:Math.atan2(e,t)},exports.ATANH=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.log((1+e)/(1-e))/2;return isNaN(t)&&(t=error.num),t},exports.BASE=function(e,t,n){if(n=n||0,e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n))return error.value;n=void 0===n?0:n;var r=e.toString(t);return new Array(Math.max(n+1-r.length,0)).join("0")+r},exports.CEILING=function(e,t,n){if(t=void 0===t?1:Math.abs(t),n=n||0,e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n))return error.value;if(0===t)return 0;var r=-Math.floor(Math.log(t)/Math.log(10));return e>=0?exports.ROUND(Math.ceil(e/t)*t,r):0===n?-exports.ROUND(Math.floor(Math.abs(e)/t)*t,r):-exports.ROUND(Math.ceil(Math.abs(e)/t)*t,r)},exports.CEILING.MATH=exports.CEILING,exports.CEILING.PRECISE=exports.CEILING,exports.COMBIN=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:exports.FACT(e)/(exports.FACT(t)*exports.FACT(e-t))},exports.COMBINA=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:0===e&&0===t?1:exports.COMBIN(e+t-1,e-1)},exports.COS=function(e){return e=utils.parseNumber(e),e instanceof Error?e:Math.cos(e)},exports.COSH=function(e){return e=utils.parseNumber(e),e instanceof Error?e:(Math.exp(e)+Math.exp(-e))/2},exports.COT=function(e){return e=utils.parseNumber(e),e instanceof Error?e:1/Math.tan(e)},exports.COTH=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.exp(2*e);return(t+1)/(t-1)},exports.CSC=function(e){return e=utils.parseNumber(e),e instanceof Error?e:1/Math.sin(e)},exports.CSCH=function(e){return e=utils.parseNumber(e),e instanceof Error?e:2/(Math.exp(e)-Math.exp(-e))},exports.DECIMAL=function(e,t){return arguments.length<1?error.value:parseInt(e,t)},exports.DEGREES=function(e){return e=utils.parseNumber(e),e instanceof Error?e:180*e/Math.PI},exports.EVEN=function(e){return e=utils.parseNumber(e),e instanceof Error?e:exports.CEILING(e,-2,-1)},exports.EXP=function(e){return arguments.length<1?error.na:"number"!=typeof e||arguments.length>1?error.error:e=Math.exp(e)};var MEMOIZED_FACT=[];exports.FACT=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.floor(e);return 0===t||1===t?1:MEMOIZED_FACT[t]>0?MEMOIZED_FACT[t]:MEMOIZED_FACT[t]=exports.FACT(t-1)*t},exports.FACTDOUBLE=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.floor(e);return t<=0?1:t*exports.FACTDOUBLE(t-2)},exports.FLOOR=function(e,t){if(e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t))return error.value;if(0===t)return 0;if(!(e>0&&t>0||e<0&&t<0))return error.num;t=Math.abs(t);var n=-Math.floor(Math.log(t)/Math.log(10));return e>=0?exports.ROUND(Math.floor(e/t)*t,n):-exports.ROUND(Math.ceil(Math.abs(e)/t),n)},exports.FLOOR.MATH=function(e,t,n){if(t=void 0===t?1:t,n=void 0===n?0:n,e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n))return error.value;if(0===t)return 0;t=t?Math.abs(t):1;var r=-Math.floor(Math.log(t)/Math.log(10));return e>=0?exports.ROUND(Math.floor(e/t)*t,r):0===n||void 0===n?-exports.ROUND(Math.ceil(Math.abs(e)/t)*t,r):-exports.ROUND(Math.floor(Math.abs(e)/t)*t,r)},exports.FLOOR.PRECISE=exports.FLOOR.MATH,exports.GCD=function(){var e=utils.parseNumberArray(utils.flatten(arguments));if(e instanceof Error)return e;for(var t=e.length,n=e[0],r=n<0?-n:n,o=1;oa?r%=a:a%=r;r+=a}return r},exports.INT=function(e){return e=utils.parseNumber(e),e instanceof Error?e:Math.floor(e)},exports.ISO={CEILING:exports.CEILING},exports.LCM=function(){var e=utils.parseNumberArray(utils.flatten(arguments));if(e instanceof Error)return e;for(var t,n,r,o,i=1;void 0!==(r=e.pop());)for(;r>1;){if(r%2){for(t=3,n=Math.floor(Math.sqrt(r));t<=n&&r%t;t+=2);o=t<=n?t:r}else o=2;for(r/=o,i*=o,t=e.length;t;e[--t]%o==0&&1==(e[t]/=o)&&e.splice(t,1));}return i},exports.LN=function(e){return e=utils.parseNumber(e),e instanceof Error?e:Math.log(e)},exports.LN10=function(){return Math.log(10)},exports.LN2=function(){return Math.log(2)},exports.LOG10E=function(){return Math.LOG10E},exports.LOG2E=function(){return Math.LOG2E},exports.LOG=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:(t=void 0===t?10:t,Math.log(e)/Math.log(t))},exports.LOG10=function(e){return e=utils.parseNumber(e),e instanceof Error?e:Math.log(e)/Math.log(10)},exports.MOD=function(e,t){if(e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t))return error.value;if(0===t)return error.div0;var n=Math.abs(e%t);return t>0?n:-n},exports.MROUND=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:e*t<0?error.num:Math.round(e/t)*t},exports.MULTINOMIAL=function(){var e=utils.parseNumberArray(utils.flatten(arguments));if(e instanceof Error)return e;for(var t=0,n=1,r=0;r0?t:-t},exports.PI=function(){return Math.PI},exports.E=function(){return Math.E},exports.POWER=function(e,t){if(e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t))return error.value;var n=Math.pow(e,t);return isNaN(n)?error.num:n},exports.PRODUCT=function(){var e=utils.parseNumberArray(utils.flatten(arguments));if(e instanceof Error)return e;for(var t=1,n=0;n0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)},exports.ROUNDUP=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:(e>0?1:-1)*Math.ceil(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)},exports.SEC=function(e){return e=utils.parseNumber(e),e instanceof Error?e:1/Math.cos(e)},exports.SECH=function(e){return e=utils.parseNumber(e),e instanceof Error?e:2/(Math.exp(e)+Math.exp(-e))},exports.SERIESSUM=function(e,t,n,r){if(e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),r=utils.parseNumberArray(r),utils.anyIsError(e,t,n,r))return error.value;for(var o=r[0]*Math.pow(e,t),i=1;i=t)},exports.LT=function(e,t){return 2!==arguments.length?error.na:(e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.error:e0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}},function(module,exports,__webpack_require__){var mathTrig=__webpack_require__(4),text=__webpack_require__(6),jStat=__webpack_require__(11).jStat,utils=__webpack_require__(1),error=__webpack_require__(0),misc=__webpack_require__(12);exports.AVEDEV=function(){var e=utils.parseNumberArray(utils.flatten(arguments));return e instanceof Error?e:jStat.sum(jStat(e).subtract(jStat.mean(e)).abs()[0])/e.length},exports.AVERAGE=function(){for(var e,t=utils.numbers(utils.flatten(arguments)),n=t.length,r=0,o=0,i=0;i=n)return r;r++}},exports.CHISQ={},exports.CHISQ.DIST=function(e,t,n){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:n?jStat.chisquare.cdf(e,t):jStat.chisquare.pdf(e,t)},exports.CHISQ.DIST.RT=function(e,t){return!e|!t?error.na:e<1||t>Math.pow(10,10)?error.num:"number"!=typeof e||"number"!=typeof t?error.value:1-jStat.chisquare.cdf(e,t)},exports.CHISQ.INV=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:jStat.chisquare.inv(e,t)},exports.CHISQ.INV.RT=function(e,t){return!e|!t?error.na:e<0||e>1||t<1||t>Math.pow(10,10)?error.num:"number"!=typeof e||"number"!=typeof t?error.value:jStat.chisquare.inv(1-e,t)},exports.CHISQ.TEST=function(e,t){if(2!==arguments.length)return error.na;if(!(e instanceof Array&&t instanceof Array))return error.value;if(e.length!==t.length)return error.value;if(e[0]&&t[0]&&e[0].length!==t[0].length)return error.value;var n,r,o,i=e.length;for(r=0;r=2;)n=n*e/r,r-=2;for(var o=n,i=t;o>1e-10*n;)i+=2,o=o*e/i,n+=o;return 1-n}(l,s))/1e6},exports.COLUMN=function(e,t){return 2!==arguments.length?error.na:t<0?error.num:e instanceof Array&&"number"==typeof t?0!==e.length?jStat.col(e,t):void 0:error.value},exports.COLUMNS=function(e){return 1!==arguments.length?error.na:e instanceof Array?0===e.length?0:jStat.cols(e):error.value},exports.CONFIDENCE={},exports.CONFIDENCE.NORM=function(e,t,n){return e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n)?error.value:jStat.normalci(1,e,t,n)[1]-1},exports.CONFIDENCE.T=function(e,t,n){return e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n)?error.value:jStat.tci(1,e,t,n)[1]-1},exports.CORREL=function(e,t){return e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(e,t)?error.value:jStat.corrcoeff(e,t)},exports.COUNT=function(){return utils.numbers(utils.flatten(arguments)).length},exports.COUNTA=function(){var e=utils.flatten(arguments);return e.length-exports.COUNTBLANK(e)},exports.COUNTIN=function(e,t){var n=0;e=utils.flatten(e);for(var r=0;r=!]/.test(criteria)||(criteria='=="'+criteria+'"');for(var matches=0,i=0;i=!]/.test(criteria)||(criteria='=="'+criteria+'"');for(var j=0;j1?error.num:jStat.centralF.inv(e,t,n)},exports.F.INV.RT=function(e,t,n){return 3!==arguments.length?error.na:e<0||e>1||t<1||t>Math.pow(10,10)||n<1||n>Math.pow(10,10)?error.num:"number"!=typeof e||"number"!=typeof t||"number"!=typeof n?error.value:jStat.centralF.inv(1-e,t,n)},exports.F.TEST=function(e,t){if(!e||!t)return error.na;if(!(e instanceof Array&&t instanceof Array))return error.na;if(e.length<2||t.length<2)return error.div0;var n=function(e,t){for(var n=0,r=0;rt[i-1]&&e[a]<=t[i]&&(o[i]+=1):i===r&&e[a]>t[r-1]&&(o[r]+=1)}return o},exports.GAMMA=function(e){return e=utils.parseNumber(e),e instanceof Error?e:0===e?error.num:parseInt(e,10)===e&&e<0?error.num:jStat.gammafn(e)},exports.GAMMA.DIST=function(e,t,n,r){return 4!==arguments.length?error.na:e<0||t<=0||n<=0?error.value:"number"!=typeof e||"number"!=typeof t||"number"!=typeof n?error.value:r?jStat.gamma.cdf(e,t,n,!0):jStat.gamma.pdf(e,t,n,!1)},exports.GAMMA.INV=function(e,t,n){return 3!==arguments.length?error.na:e<0||e>1||t<=0||n<=0?error.num:"number"!=typeof e||"number"!=typeof t||"number"!=typeof n?error.value:jStat.gamma.inv(e,t,n)},exports.GAMMALN=function(e){return e=utils.parseNumber(e),e instanceof Error?e:jStat.gammaln(e)},exports.GAMMALN.PRECISE=function(e){return 1!==arguments.length?error.na:e<=0?error.num:"number"!=typeof e?error.value:jStat.gammaln(e)},exports.GAUSS=function(e){return e=utils.parseNumber(e),e instanceof Error?e:jStat.normal.cdf(e,0,1)-.5},exports.GEOMEAN=function(){var e=utils.parseNumberArray(utils.flatten(arguments));return e instanceof Error?e:jStat.geomean(e)},exports.GROWTH=function(e,t,n,r){if((e=utils.parseNumberArray(e))instanceof Error)return e;var o;if(void 0===t)for(t=[],o=1;o<=e.length;o++)t.push(o);if(void 0===n)for(n=[],o=1;o<=e.length;o++)n.push(o);if(t=utils.parseNumberArray(t),n=utils.parseNumberArray(n),utils.anyIsError(t,n))return error.value;void 0===r&&(r=!0);var i=e.length,a=0,s=0,l=0,u=0;for(o=0;oi&&(i=r[t],o=[]),r[t]===i&&(o[o.length]=t);return o},exports.MODE.SNGL=function(){var e=utils.parseNumberArray(utils.flatten(arguments));return e instanceof Error?e:exports.MODE.MULT(e).sort(function(e,t){return e-t})[0]},exports.NEGBINOM={},exports.NEGBINOM.DIST=function(e,t,n,r){return e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n)?error.value:r?jStat.negbin.cdf(e,t,n):jStat.negbin.pdf(e,t,n)},exports.NORM={},exports.NORM.DIST=function(e,t,n,r){return e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n)?error.value:n<=0?error.num:r?jStat.normal.cdf(e,t,n):jStat.normal.pdf(e,t,n)},exports.NORM.INV=function(e,t,n){return e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n)?error.value:jStat.normal.inv(e,t,n)},exports.NORM.S={},exports.NORM.S.DIST=function(e,t){return e=utils.parseNumber(e),e instanceof Error?error.value:t?jStat.normal.cdf(e,0,1):jStat.normal.pdf(e,0,1)},exports.NORM.S.INV=function(e){return e=utils.parseNumber(e),e instanceof Error?error.value:jStat.normal.inv(e,0,1)},exports.PEARSON=function(e,t){if(t=utils.parseNumberArray(utils.flatten(t)),e=utils.parseNumberArray(utils.flatten(e)),utils.anyIsError(t,e))return error.value;for(var n=jStat.mean(e),r=jStat.mean(t),o=e.length,i=0,a=0,s=0,l=0;l1-1/(n+1))return error.num;var r=t*(n+1)-1,o=Math.floor(r);return utils.cleanFloat(r===o?e[r]:e[o]+(r-o)*(e[o+1]-e[o]))},exports.PERCENTILE.INC=function(e,t){if(e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumber(t),utils.anyIsError(e,t))return error.value;e=e.sort(function(e,t){return e-t});var n=e.length,r=t*(n-1),o=Math.floor(r);return utils.cleanFloat(r===o?e[r]:e[o]+(r-o)*(e[o+1]-e[o]))},exports.PERCENTRANK={},exports.PERCENTRANK.EXC=function(e,t,n){if(n=void 0===n?3:n,e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n))return error.value;e=e.sort(function(e,t){return e-t});for(var r=misc.UNIQUE.apply(null,e),o=e.length,i=r.length,a=Math.pow(10,n),s=0,l=!1,u=0;!l&&u=r[u]&&(t=r[u]&&(t=0?t[e.indexOf(n)]:0;for(var o=e.sort(function(e,t){return e-t}),i=o.length,a=0,s=0;s=n&&o[s]<=r&&(a+=t[e.indexOf(o[s])]);return a},exports.QUARTILE={},exports.QUARTILE.EXC=function(e,t){if(e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumber(t),utils.anyIsError(e,t))return error.value;switch(t){case 1:return exports.PERCENTILE.EXC(e,.25);case 2:return exports.PERCENTILE.EXC(e,.5);case 3:return exports.PERCENTILE.EXC(e,.75);default:return error.num}},exports.QUARTILE.INC=function(e,t){if(e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumber(t),utils.anyIsError(e,t))return error.value;switch(t){case 1:return exports.PERCENTILE.INC(e,.25);case 2:return exports.PERCENTILE.INC(e,.5);case 3:return exports.PERCENTILE.INC(e,.75);default:return error.num}},exports.RANK={},exports.RANK.AVG=function(e,t,n){if(e=utils.parseNumber(e),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(e,t))return error.value;t=utils.flatten(t),n=n||!1,t=t.sort(n?function(e,t){return e-t}:function(e,t){return t-e});for(var r=t.length,o=0,i=0;i1?(2*t.indexOf(e)+o+1)/2:t.indexOf(e)+1},exports.RANK.EQ=function(e,t,n){return e=utils.parseNumber(e),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(e,t)?error.value:(n=n||!1,t=t.sort(n?function(e,t){return e-t}:function(e,t){return t-e}),t.indexOf(e)+1)},exports.ROW=function(e,t){return 2!==arguments.length?error.na:t<0?error.num:e instanceof Array&&"number"==typeof t?0!==e.length?jStat.row(e,t):void 0:error.value},exports.ROWS=function(e){return 1!==arguments.length?error.na:e instanceof Array?0===e.length?0:jStat.rows(e):error.value},exports.RSQ=function(e,t){return e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(e,t)?error.value:Math.pow(exports.PEARSON(e,t),2)},exports.SKEW=function(){var e=utils.parseNumberArray(utils.flatten(arguments));if(e instanceof Error)return e;for(var t=jStat.mean(e),n=e.length,r=0,o=0;o1||t<1?error.num:utils.anyIsError(e,t)?error.value:Math.abs(jStat.studentt.inv(e/2,t))},exports.T.TEST=function(e,t){if(e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(e,t))return error.value;var n,r=jStat.mean(e),o=jStat.mean(t),i=0,a=0;for(n=0;n-1;)e[t]="TRUE";for(var n=0;(n=e.indexOf(!1))>-1;)e[n]="FALSE";return e.join("")},t.DBCS=function(){throw new Error("DBCS is not implemented")},t.DOLLAR=function(e,t){if(t=void 0===t?2:t,e=r.parseNumber(e),t=r.parseNumber(t),r.anyIsError(e,t))return o.value;var n="";return t<=0?(e=Math.round(e*Math.pow(10,t))/Math.pow(10,t),n="($0,0)"):t>0&&(n="($0,0."+new Array(t+1).join("0")+")"),i(e).format(n)},t.EXACT=function(e,t){return 2!==arguments.length?o.na:e===t},t.FIND=function(e,t,n){return arguments.length<2?o.na:(n=void 0===n?0:n,t?t.indexOf(e,n-1)+1:null)},t.FIXED=function(e,t,n){if(t=void 0===t?2:t,n=void 0!==n&&n,e=r.parseNumber(e),t=r.parseNumber(t),r.anyIsError(e,t))return o.value;var a=n?"0":"0,0";return t<=0?e=Math.round(e*Math.pow(10,t))/Math.pow(10,t):t>0&&(a+="."+new Array(t+1).join("0")),i(e).format(a)},t.HTML2TEXT=function(e){var t="";return e&&(e instanceof Array?e.forEach(function(e){""!==t&&(t+="\n"),t+=e.replace(/<(?:.|\n)*?>/gm,"")}):t=e.replace(/<(?:.|\n)*?>/gm,"")),t},t.LEFT=function(e,t){return t=void 0===t?1:t,t=r.parseNumber(t),t instanceof Error||"string"!=typeof e?o.value:e?e.substring(0,t):null},t.LEN=function(e){return 0===arguments.length?o.error:"string"==typeof e?e?e.length:0:e.length?e.length:o.value},t.LOWER=function(e){return"string"!=typeof e?o.value:e?e.toLowerCase():e},t.MID=function(e,t,n){if(t=r.parseNumber(t),n=r.parseNumber(n),r.anyIsError(t,n)||"string"!=typeof e)return n;var o=t-1;return e.substring(o,o+n)},t.NUMBERVALUE=function(e,t,n){return t=void 0===t?".":t,n=void 0===n?",":n,Number(e.replace(t,".").replace(n,""))},t.PRONETIC=function(){throw new Error("PRONETIC is not implemented")},t.PROPER=function(e){return void 0===e||0===e.length?o.value:(!0===e&&(e="TRUE"),!1===e&&(e="FALSE"),isNaN(e)&&"number"==typeof e?o.value:("number"==typeof e&&(e=""+e),e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})))},t.REGEXEXTRACT=function(e,t){if(arguments.length<2)return o.na;var n=e.match(new RegExp(t));return n?n[n.length>1?n.length-1:0]:null},t.REGEXMATCH=function(e,t,n){if(arguments.length<2)return o.na;var r=e.match(new RegExp(t));return n?r:!!r},t.REGEXREPLACE=function(e,t,n){return arguments.length<3?o.na:e.replace(new RegExp(t),n)},t.REPLACE=function(e,t,n,i){return t=r.parseNumber(t),n=r.parseNumber(n),r.anyIsError(t,n)||"string"!=typeof e||"string"!=typeof i?o.value:e.substr(0,t-1)+i+e.substr(t-1+n)},t.REPT=function(e,t){return t=r.parseNumber(t),t instanceof Error?t:new Array(t+1).join(e)},t.RIGHT=function(e,t){return t=void 0===t?1:t,t=r.parseNumber(t),t instanceof Error?t:e?e.substring(e.length-t):o.na},t.SEARCH=function(e,t,n){var r;return"string"!=typeof e||"string"!=typeof t?o.value:(n=void 0===n?0:n,r=t.toLowerCase().indexOf(e.toLowerCase(),n-1)+1,0===r?o.value:r)},t.SPLIT=function(e,t){return e.split(t)},t.SUBSTITUTE=function(e,t,n,r){if(arguments.length<2)return o.na;if(!(e&&t&&n))return e;if(void 0===r)return e.replace(new RegExp(t,"g"),n);for(var i=0,a=0;e.indexOf(t,i)>0;)if(i=e.indexOf(t,i+1),++a===r)return e.substring(0,i)+n+e.substring(i+t.length)},t.T=function(e){return"string"==typeof e?e:""},t.TEXT=function(e,t){return e=r.parseNumber(e),r.anyIsError(e)?o.na:i(e).format(t)},t.TRIM=function(e){return"string"!=typeof e?o.value:e.replace(/ +/g," ").trim()},t.UNICHAR=t.CHAR,t.UNICODE=t.CODE,t.UPPER=function(e){return"string"!=typeof e?o.value:e.toUpperCase()},t.VALUE=function(e){if("string"!=typeof e)return o.value;var t=i().unformat(e);return void 0===t?0:t}},function(e,t,n){var r=n(0);t.CELL=function(){throw new Error("CELL is not implemented")},t.ERROR={},t.ERROR.TYPE=function(e){switch(e){case r.nil:return 1;case r.div0:return 2;case r.value:return 3;case r.ref:return 4;case r.name:return 5;case r.num:return 6;case r.na:return 7;case r.data:return 8}return r.na},t.INFO=function(){throw new Error("INFO is not implemented")},t.ISBLANK=function(e){return null===e},t.ISBINARY=function(e){return/^[01]{1,10}$/.test(e)},t.ISERR=function(e){return[r.value,r.ref,r.div0,r.num,r.name,r.nil].indexOf(e)>=0||"number"==typeof e&&(isNaN(e)||!isFinite(e))},t.ISERROR=function(e){return t.ISERR(e)||e===r.na},t.ISEVEN=function(e){return!(1&Math.floor(Math.abs(e)))},t.ISFORMULA=function(){throw new Error("ISFORMULA is not implemented")},t.ISLOGICAL=function(e){return!0===e||!1===e},t.ISNA=function(e){return e===r.na},t.ISNONTEXT=function(e){return"string"!=typeof e},t.ISNUMBER=function(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)},t.ISODD=function(e){return!!(1&Math.floor(Math.abs(e)))},t.ISREF=function(){throw new Error("ISREF is not implemented")},t.ISTEXT=function(e){return"string"==typeof e},t.N=function(e){return this.ISNUMBER(e)?e:e instanceof Date?e.getTime():!0===e?1:!1===e?0:this.ISERROR(e)?e:0},t.NA=function(){return r.na},t.SHEET=function(){throw new Error("SHEET is not implemented")},t.SHEETS=function(){throw new Error("SHEETS is not implemented")},t.TYPE=function(e){return this.ISNUMBER(e)?1:this.ISTEXT(e)?2:this.ISLOGICAL(e)?4:this.ISERROR(e)?16:Array.isArray(e)?64:void 0}},function(e,t,n){function r(e){return 1===new Date(e,1,29).getMonth()}function o(e,t){return Math.ceil((t-e)/1e3/60/60/24)}function i(e){return(e-l)/864e5+(e>-22038912e5?2:1)}var a=n(0),s=n(1),l=new Date(1900,0,1),u=[void 0,0,1,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,1,2,3,4,5,6,0],c=[[],[1,2,3,4,5,6,7],[7,1,2,3,4,5,6],[6,0,1,2,3,4,5],[],[],[],[],[],[],[],[7,1,2,3,4,5,6],[6,7,1,2,3,4,5],[5,6,7,1,2,3,4],[4,5,6,7,1,2,3],[3,4,5,6,7,1,2],[2,3,4,5,6,7,1],[1,2,3,4,5,6,7]],f=[[],[6,0],[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],void 0,void 0,void 0,[0,0],[1,1],[2,2],[3,3],[4,4],[5,5],[6,6]];t.DATE=function(e,t,n){return e=s.parseNumber(e),t=s.parseNumber(t),n=s.parseNumber(n),s.anyIsError(e,t,n)?a.value:e<0||t<0||n<0?a.num:new Date(e,t-1,n)},t.DATEVALUE=function(e){if("string"!=typeof e)return a.value;var t=Date.parse(e);return isNaN(t)?a.value:t<=-22038912e5?(t-l)/864e5+1:(t-l)/864e5+2},t.DAY=function(e){var t=s.parseDate(e);return t instanceof Error?t:t.getDate()},t.DAYS=function(e,t){return e=s.parseDate(e),t=s.parseDate(t),e instanceof Error?e:t instanceof Error?t:i(e)-i(t)},t.DAYS360=function(e,t,n){if(n=s.parseBool(n),e=s.parseDate(e),t=s.parseDate(t),e instanceof Error)return e;if(t instanceof Error)return t;if(n instanceof Error)return n;var r,o,i=e.getMonth(),a=t.getMonth();if(n)r=31===e.getDate()?30:e.getDate(),o=31===t.getDate()?30:t.getDate();else{var l=new Date(e.getFullYear(),i+1,0).getDate(),u=new Date(t.getFullYear(),a+1,0).getDate();r=e.getDate()===l?30:e.getDate(),t.getDate()===u?r<30?(a++,o=1):o=30:o=t.getDate()}return 360*(t.getFullYear()-e.getFullYear())+30*(a-i)+(o-r)},t.EDATE=function(e,t){return(e=s.parseDate(e))instanceof Error?e:isNaN(t)?a.value:(t=parseInt(t,10),e.setMonth(e.getMonth()+t),i(e))},t.EOMONTH=function(e,t){return(e=s.parseDate(e))instanceof Error?e:isNaN(t)?a.value:(t=parseInt(t,10),i(new Date(e.getFullYear(),e.getMonth()+t+1,0)))},t.HOUR=function(e){return e=s.parseDate(e),e instanceof Error?e:e.getHours()},t.INTERVAL=function(e){if("number"!=typeof e&&"string"!=typeof e)return a.value;e=parseInt(e,10);var t=Math.floor(e/94608e4);e%=94608e4;var n=Math.floor(e/2592e3);e%=2592e3;var r=Math.floor(e/86400);e%=86400;var o=Math.floor(e/3600);e%=3600;var i=Math.floor(e/60);e%=60;var s=e;return t=t>0?t+"Y":"",n=n>0?n+"M":"",r=r>0?r+"D":"",o=o>0?o+"H":"",i=i>0?i+"M":"",s=s>0?s+"S":"","P"+t+n+r+"T"+o+i+s},t.ISOWEEKNUM=function(e){if((e=s.parseDate(e))instanceof Error)return e;e.setHours(0,0,0),e.setDate(e.getDate()+4-(e.getDay()||7));var t=new Date(e.getFullYear(),0,1);return Math.ceil(((e-t)/864e5+1)/7)},t.MINUTE=function(e){return e=s.parseDate(e),e instanceof Error?e:e.getMinutes()},t.MONTH=function(e){return e=s.parseDate(e),e instanceof Error?e:e.getMonth()+1},t.NETWORKDAYS=function(e,t,n){return this.NETWORKDAYS.INTL(e,t,1,n)},t.NETWORKDAYS.INTL=function(e,t,n,r){if((e=s.parseDate(e))instanceof Error)return e;if((t=s.parseDate(t))instanceof Error)return t;if(!((n=void 0===n?f[1]:f[n])instanceof Array))return a.value;void 0===r?r=[]:r instanceof Array||(r=[r]);for(var o=0;o0?c.getUTCDay():c.getDay(),d=!1;h!==n[0]&&h!==n[1]||(d=!0);for(var p=0;pc||a===c&&i>=u))return(l===f&&r(l)||function(e,t){var n=e.getFullYear(),o=new Date(n,2,1);if(r(n)&&e=o)return!0;var i=t.getFullYear(),a=new Date(i,2,1);return r(i)&&t>=a&&et?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return a(e,function(e,t){return e1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:"value",o="_"+n,i=(t={_touched:!1},r(t,o,e),r(t,"isTouched",function(){return this._touched}),t);return Object.defineProperty(i,n,{get:function(){return this[o]},set:function(e){this._touched=!0,this[o]=e},enumerable:!0,configurable:!0}),i}function y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.__esModule=!0;var w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.duckSchema=o,t.inherit=i,t.extend=a,t.deepExtend=s,t.deepClone=l,t.clone=u,t.mixin=c,t.isObjectEqual=f,t.isObject=h,t.defineGetter=d,t.objectEach=p,t.getProperty=g,t.deepObjectSize=v,t.createObjectPropListener=m,t.hasOwnProperty=y;var b=n(0)},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:0,n=-1,r=null,o=e;null!==o;){if(n===t){r=o;break}o.host&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE?o=o.host:(n+=1,o=o.parentNode)}return r}function i(e,t,n){for(var r=e;null!==r&&r!==n;){if(r.nodeType===Node.ELEMENT_NODE&&(t.indexOf(r.nodeName)>-1||t.indexOf(r)>-1))return r;r=r.host&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE?r.host:r.parentNode}return null}function a(e,t,n){for(var r=[],o=e;o&&(o=i(o,t,n))&&(!n||n.contains(o));)r.push(o),o=o.host&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE?o.host:o.parentNode;var a=r.length;return a?r[a-1]:null}function s(e,t){var n=e.parentNode,r=[];for("string"==typeof t?r=Array.prototype.slice.call(document.querySelectorAll(t),0):r.push(t);null!==n;){if(r.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function l(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===n.toUpperCase()}for(var n="hot-table",r=!1,o=u(e);null!==o;){if(t(o)){r=!0;break}if(o.host&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r=t(o.host))break;o=o.host}o=o.parentNode}return r}function u(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function c(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function f(e){var t=0,n=e;if(n.previousSibling)for(;n=n.previousSibling;)t+=1;return t}function h(e,t){var n=document.querySelector(".ht_clone_"+e);return n?n.contains(t):null}function d(e){var t=[];if(!e||!e.length)return t;for(var n=0;e[n];)t.push(e[n]),n+=1;return t}function p(e,t){return J(e,t)}function g(e,t){return ee(e,t)}function v(e,t){return te(e,t)}function m(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var n=e.childNodes,r=n.length-1;r>=0;r--)m(n[r],e)}function y(e){for(var t=void 0;t=e.lastChild;)e.removeChild(t)}function w(e,t){ie.test(t)?e.innerHTML=t:b(e,t)}function b(e,t){var n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?ae?n.textContent=t:n.data=t:(y(e),e.appendChild(document.createTextNode(t)))}function C(e){for(var t=e;c(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return C(t.host.impl);if(t.host)return C(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function _(e){var t=document.documentElement,n=e,r=void 0,o=void 0,i=void 0,a=void 0;if((0,Z.hasCaptionProblem)()&&n.firstChild&&"CAPTION"===n.firstChild.nodeName)return a=n.getBoundingClientRect(),{top:a.top+(window.pageYOffset||t.scrollTop)-(t.clientTop||0),left:a.left+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)};for(r=n.offsetLeft,o=n.offsetTop,i=n;(n=n.offsetParent)&&n!==document.body;)r+=n.offsetLeft,o+=n.offsetTop,i=n;return i&&"fixed"===i.style.position&&(r+=window.pageXOffset||t.scrollLeft,o+=window.pageYOffset||t.scrollTop),{left:r,top:o}}function E(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function O(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function S(e){return e===window?E():e.scrollTop}function T(e){return e===window?O():e.scrollLeft}function R(e){for(var t=["auto","scroll"],n=e.parentNode,r=void 0,o=void 0,i=void 0,a="",s="",l="",u="";n&&n.style&&document.body!==n;){if(r=n.style.overflow,o=n.style.overflowX,i=n.style.overflowY,"scroll"===r||"scroll"===o||"scroll"===i)return n;if(window.getComputedStyle&&(a=window.getComputedStyle(n),s=a.getPropertyValue("overflow"),l=a.getPropertyValue("overflow-y"),u=a.getPropertyValue("overflow-x"),"scroll"===s||"scroll"===u||"scroll"===l))return n;if(n.clientHeight<=n.scrollHeight+1&&(-1!==t.indexOf(i)||-1!==t.indexOf(r)||-1!==t.indexOf(s)||-1!==t.indexOf(l)))return n;if(n.clientWidth<=n.scrollWidth+1&&(-1!==t.indexOf(o)||-1!==t.indexOf(r)||-1!==t.indexOf(s)||-1!==t.indexOf(u)))return n;n=n.parentNode}return window}function M(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;var n=N(t),r=["scroll","hidden","auto"],o=n.getPropertyValue("overflow"),i=n.getPropertyValue("overflow-y"),a=n.getPropertyValue("overflow-x");if(r.includes(o)||r.includes(i)||r.includes(a))return t;t=t.parentNode}return window}function k(e,t){if(e){if(e!==window){var n,r=e.style[t];return""!==r&&void 0!==r?r:(n=N(e),""!==n[t]&&void 0!==n[t]?n[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function N(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function A(e){return e.offsetWidth}function I(e){return(0,Z.hasCaptionProblem)()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function D(e){return e.clientHeight||e.innerHeight}function P(e){return e.clientWidth||e.innerWidth}function x(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function L(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function H(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange(),r=n.duplicate();return n.moveToBookmark(t.getBookmark()),r.setEndPoint("EndToStart",n),r.text.length}return 0}function j(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;return e.createTextRange().text.indexOf(t.text)+t.text.length}return 0}function F(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function V(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(i){var r=e.parentNode,o=r.style.display;r.style.display="block",e.setSelectionRange(t,n),r.style.display=o}}else if(e.createTextRange){var i=e.createTextRange();i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i.select()}}function B(){var e=document.createElement("div");e.style.height="200px",e.style.width="100%";var t=document.createElement("div");t.style.boxSizing="content-box",t.style.height="150px",t.style.left="0px",t.style.overflow="hidden",t.style.position="absolute",t.style.top="0px",t.style.width="200px",t.style.visibility="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var r=e.offsetWidth;return n==r&&(r=t.clientWidth),(document.body||document.documentElement).removeChild(t),n-r}function W(){return void 0===oe&&(oe=B()),oe}function U(e){return e.offsetWidth!==e.clientWidth}function Y(e){return e.offsetHeight!==e.clientHeight}function $(e,t,n){(0,q.isIE8)()||(0,q.isIE9)()?(e.style.top=n,e.style.left=t):(0,q.isSafari)()?e.style["-webkit-transform"]="translate3d("+t+","+n+",0)":e.style.transform="translate3d("+t+","+n+",0)"}function G(e){var t=void 0;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function z(e){e.style.transform&&""!==e.style.transform?e.style.transform="":e.style["-webkit-transform"]&&""!==e.style["-webkit-transform"]&&(e.style["-webkit-transform"]="")}function X(e){var t=["INPUT","SELECT","TEXTAREA"];return e&&(t.indexOf(e.nodeName)>-1||"true"===e.contentEditable)}function K(e){return X(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}t.__esModule=!0,t.HTML_CHARACTERS=void 0,t.getParent=o,t.closest=i,t.closestDown=a,t.isChildOf=s,t.isChildOfWebComponentTable=l,t.polymerWrap=u,t.polymerUnwrap=c,t.index=f,t.overlayContainsElement=h,t.hasClass=p,t.addClass=g,t.removeClass=v,t.removeTextNodes=m,t.empty=y,t.fastInnerHTML=w,t.fastInnerText=b,t.isVisible=C,t.offset=_,t.getWindowScrollTop=E,t.getWindowScrollLeft=O,t.getScrollTop=S,t.getScrollLeft=T,t.getScrollableElement=R,t.getTrimmingContainer=M,t.getStyle=k,t.getComputedStyle=N,t.outerWidth=A,t.outerHeight=I,t.innerHeight=D,t.innerWidth=P,t.addEvent=x,t.removeEvent=L,t.getCaretPosition=H,t.getSelectionEndPosition=j,t.getSelectionText=F,t.setCaretPosition=V,t.getScrollbarWidth=W,t.hasVerticalScrollbar=U,t.hasHorizontalScrollbar=Y,t.setOverlayPosition=$,t.getCssTransform=G,t.resetCssTransform=z,t.isInput=X,t.isOutsideInput=K;var q=n(42),Z=n(43),Q=!!document.documentElement.classList,J=void 0,ee=void 0,te=void 0;if(Q){var ne=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();J=function(e,t){return void 0!==e.classList&&"string"==typeof t&&""!==t&&e.classList.contains(t)},ee=function(e,t){var n=t;if("string"==typeof n&&(n=n.split(" ")),n=d(n),n.length>0)if(ne){var o;(o=e.classList).add.apply(o,r(n))}else for(var i=0;n&&n[i];)e.classList.add(n[i]),i+=1},te=function(e,t){var n=t;if("string"==typeof n&&(n=n.split(" ")),n=d(n),n.length>0)if(ne){var o;(o=e.classList).remove.apply(o,r(n))}else for(var i=0;n&&n[i];)e.classList.remove(n[i]),i+=1}}else{var re=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};J=function(e,t){return void 0!==e.className&&re(t).test(e.className)},ee=function(e,t){var n=0,r=e.className,o=t;if("string"==typeof o&&(o=o.split(" ")),""===r)r=o.join(" ");else for(;o&&o[n];)re(o[n]).test(r)||(r+=" "+o[n]),n+=1;e.className=r},te=function(e,t){var n=0,r=e.className,o=t;for("string"==typeof o&&(o=o.split(" "));o&&o[n];)r=r.replace(re(o[n])," ").trim(),n+=1;e.className!==r&&(e.className=r)}}var oe,ie=t.HTML_CHARACTERS=/(<(.*)>|&(.*);)/,ae=!!document.createTextNode("test").textContent},function(e,t,n){"use strict";t.__esModule=!0;var r=t.CONTEXT_MENU_ITEMS_NAMESPACE="ContextMenu:items",o=(t.CONTEXTMENU_ITEMS_ROW_ABOVE=r+".insertRowAbove",t.CONTEXTMENU_ITEMS_ROW_BELOW=r+".insertRowBelow",t.CONTEXTMENU_ITEMS_INSERT_LEFT=r+".insertColumnOnTheLeft",t.CONTEXTMENU_ITEMS_INSERT_RIGHT=r+".insertColumnOnTheRight",t.CONTEXTMENU_ITEMS_REMOVE_ROW=r+".removeRow",t.CONTEXTMENU_ITEMS_REMOVE_COLUMN=r+".removeColumn",t.CONTEXTMENU_ITEMS_UNDO=r+".undo",t.CONTEXTMENU_ITEMS_REDO=r+".redo",t.CONTEXTMENU_ITEMS_READ_ONLY=r+".readOnly",t.CONTEXTMENU_ITEMS_CLEAR_COLUMN=r+".clearColumn",t.CONTEXTMENU_ITEMS_COPY=r+".copy",t.CONTEXTMENU_ITEMS_CUT=r+".cut",t.CONTEXTMENU_ITEMS_FREEZE_COLUMN=r+".freezeColumn",t.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN=r+".unfreezeColumn",t.CONTEXTMENU_ITEMS_MERGE_CELLS=r+".mergeCells",t.CONTEXTMENU_ITEMS_UNMERGE_CELLS=r+".unmergeCells",t.CONTEXTMENU_ITEMS_ADD_COMMENT=r+".addComment",t.CONTEXTMENU_ITEMS_EDIT_COMMENT=r+".editComment",t.CONTEXTMENU_ITEMS_REMOVE_COMMENT=r+".removeComment",t.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT=r+".readOnlyComment",t.CONTEXTMENU_ITEMS_ALIGNMENT=r+".align",t.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT=r+".align.left",t.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER=r+".align.center",t.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT=r+".align.right",t.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY=r+".align.justify",t.CONTEXTMENU_ITEMS_ALIGNMENT_TOP=r+".align.top",t.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE=r+".align.middle",t.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM=r+".align.bottom",t.CONTEXTMENU_ITEMS_BORDERS=r+".borders",t.CONTEXTMENU_ITEMS_BORDERS_TOP=r+".borders.top",t.CONTEXTMENU_ITEMS_BORDERS_RIGHT=r+".borders.right",t.CONTEXTMENU_ITEMS_BORDERS_BOTTOM=r+".borders.bottom",t.CONTEXTMENU_ITEMS_BORDERS_LEFT=r+".borders.left",t.CONTEXTMENU_ITEMS_REMOVE_BORDERS=r+".borders.remove",t.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD=r+".nestedHeaders.insertChildRow",t.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD=r+".nestedHeaders.detachFromParent",t.CONTEXTMENU_ITEMS_HIDE_COLUMN=r+".hideColumn",t.CONTEXTMENU_ITEMS_SHOW_COLUMN=r+".showColumn",t.CONTEXTMENU_ITEMS_HIDE_ROW=r+".hideRow",t.CONTEXTMENU_ITEMS_SHOW_ROW=r+".showRow",t.FILTERS_NAMESPACE="Filters:"),i=t.FILTERS_CONDITIONS_NAMESPACE=o+"conditions";t.FILTERS_CONDITIONS_NONE=i+".none",t.FILTERS_CONDITIONS_EMPTY=i+".isEmpty",t.FILTERS_CONDITIONS_NOT_EMPTY=i+".isNotEmpty",t.FILTERS_CONDITIONS_EQUAL=i+".isEqualTo",t.FILTERS_CONDITIONS_NOT_EQUAL=i+".isNotEqualTo",t.FILTERS_CONDITIONS_BEGINS_WITH=i+".beginsWith",t.FILTERS_CONDITIONS_ENDS_WITH=i+".endsWith",t.FILTERS_CONDITIONS_CONTAINS=i+".contains",t.FILTERS_CONDITIONS_NOT_CONTAIN=i+".doesNotContain",t.FILTERS_CONDITIONS_BY_VALUE=i+".byValue",t.FILTERS_CONDITIONS_GREATER_THAN=i+".greaterThan",t.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL=i+".greaterThanOrEqualTo",t.FILTERS_CONDITIONS_LESS_THAN=i+".lessThan",t.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL=i+".lessThanOrEqualTo",t.FILTERS_CONDITIONS_BETWEEN=i+".isBetween",t.FILTERS_CONDITIONS_NOT_BETWEEN=i+".isNotBetween",t.FILTERS_CONDITIONS_AFTER=i+".after",t.FILTERS_CONDITIONS_BEFORE=i+".before",t.FILTERS_CONDITIONS_TODAY=i+".today",t.FILTERS_CONDITIONS_TOMORROW=i+".tomorrow",t.FILTERS_CONDITIONS_YESTERDAY=i+".yesterday",t.FILTERS_DIVS_FILTER_BY_CONDITION=o+"labels.filterByCondition",t.FILTERS_DIVS_FILTER_BY_VALUE=o+"labels.filterByValue",t.FILTERS_LABELS_CONJUNCTION=o+"labels.conjunction",t.FILTERS_LABELS_DISJUNCTION=o+"labels.disjunction",t.FILTERS_VALUES_BLANK_CELLS=o+"values.blankCells",t.FILTERS_BUTTONS_SELECT_ALL=o+"buttons.selectAll",t.FILTERS_BUTTONS_CLEAR=o+"buttons.clear",t.FILTERS_BUTTONS_OK=o+"buttons.ok",t.FILTERS_BUTTONS_CANCEL=o+"buttons.cancel",t.FILTERS_BUTTONS_PLACEHOLDER_SEARCH=o+"buttons.placeholder.search",t.FILTERS_BUTTONS_PLACEHOLDER_VALUE=o+"buttons.placeholder.value",t.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE=o+"buttons.placeholder.secondValue"},function(e,t,n){"use strict";function r(e){var t=void 0===e?"undefined":s(e);return"number"==t?!isNaN(e)&&isFinite(e):"string"==t?!!e.length&&(1==e.length?/\d/.test(e):/^\s*[+-]?\s*(?:(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?)|(?:0x[a-f\d]+))\s*$/i.test(e)):"object"==t&&!(!e||"number"!=typeof e.valueOf()||e instanceof Date)}function o(e,t,n){var r=-1;for("function"==typeof t?(n=t,t=e):r=e-1;++r<=t&&!1!==n(r););}function i(e,t,n){var r=e+1;for("function"==typeof t&&(n=t,t=0);--r>=t&&!1!==n(r););}function a(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100,10)}t.__esModule=!0;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.isNumeric=r,t.rangeEach=o,t.rangeEachReverse=i,t.valueAccordingPercent=a},function(e,t,n){"use strict";function r(e,t){var n=(0,c.toUpperCaseFirst)(e);l.default.getSingleton().add("construct",function(){f.has(this)||f.set(this,{});var e=f.get(this);e[n]||(e[n]=new t(this))}),l.default.getSingleton().add("afterDestroy",function(){if(f.has(this)){var e=f.get(this);(0,u.objectEach)(e,function(e){return e.destroy()}),f.delete(this)}})}function o(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var n=(0,c.toUpperCaseFirst)(t);if(f.has(e)&&f.get(e)[n])return f.get(e)[n]}function i(e){return f.has(e)?Object.keys(f.get(e)):[]}function a(e,t){var n=null;return f.has(e)&&(0,u.objectEach)(f.get(e),function(e,r){e===t&&(n=r)}),n}t.__esModule=!0,t.getPluginName=t.getRegistredPluginNames=t.getPlugin=t.registerPlugin=void 0;var s=n(17),l=function(e){return e&&e.__esModule?e:{default:e}}(s),u=n(1),c=n(32),f=new WeakMap;t.registerPlugin=r,t.getPlugin=o,t.getRegistredPluginNames=i,t.getPluginName=a},function(e,t,n){var r=n(16),o=n(50),i=n(37),a=n(36),s=n(38),l=function(e,t,n){var u,c,f,h,d=e&l.F,p=e&l.G,g=e&l.S,v=e&l.P,m=e&l.B,y=p?r:g?r[t]||(r[t]={}):(r[t]||{}).prototype,w=p?o:o[t]||(o[t]={}),b=w.prototype||(w.prototype={});p&&(n=t);for(u in n)c=!d&&y&&void 0!==y[u],f=(c?y:n)[u],h=m&&c?s(f,r):v&&"function"==typeof f?s(Function.call,f):f,y&&a(y,u,f,e&l.U),w[u]!=f&&i(w,u,h),v&&b[u]!=f&&(b[u]=f)};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=function(){function e(e,t){for(var n=0;n=0&&c.splice(c.indexOf(this.pluginName),1),c.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0}},{key:"enablePlugin",value:function(){this.enabled=!0}},{key:"disablePlugin",value:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1}},{key:"addHook",value:function(e,t){u.get(this).hooks[e]=u.get(this).hooks[e]||[];var n=u.get(this).hooks[e];this.hot.addHook(e,t),n.push(t),u.get(this).hooks[e]=n}},{key:"removeHooks",value:function(e){var t=this;(0,a.arrayEach)(u.get(this).hooks[e]||[],function(n){t.hot.removeHook(e,n)})}},{key:"clearHooks",value:function(){var e=this,t=u.get(this).hooks;(0,i.objectEach)(t,function(t,n){return e.removeHooks(n)}),t.length=0}},{key:"callOnPluginsReady",value:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}},{key:"onAfterPluginsInitialized",value:function(){(0,a.arrayEach)(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}},{key:"onUpdateSettings",value:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())}},{key:"updatePlugin",value:function(){}},{key:"destroy",value:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),(0,i.objectEach)(this,function(t,n){"hot"!==n&&"t"!==n&&(e[n]=null)}),delete this.t,delete this.hot}}]),e}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){var n=void 0,r=void 0,o=void 0,i=void 0,a=void 0;t.isTargetWebComponent=!1,t.realTarget=t.target;var f=t.stopImmediatePropagation;if(t.stopImmediatePropagation=function(){f.apply(this),(0,c.stopImmediatePropagation)(this)},!h.isHotTableEnv)return t;for(t=(0,s.polymerWrap)(t),a=t.path?t.path.length:0;a;){if(a-=1,"HOT-TABLE"===t.path[a].nodeName)n=!0;else if(n&&t.path[a].shadowRoot){i=t.path[a];break}0!==a||i||(i=t.path[a])}return i||(i=t.target),t.isTargetWebComponent=!0,(0,u.isWebComponentSupportedNatively)()?t.realTarget=t.srcElement||t.toElement:((0,l.hasOwnProperty)(e,"hot")||e.isHotTableEnv||e.wtTable)&&((0,l.hasOwnProperty)(e,"hot")?r=e.hot?e.hot.view.wt.wtTable.TABLE:null:e.isHotTableEnv?r=e.view.activeWt.wtTable.TABLE.parentNode.parentNode:e.wtTable&&(r=e.wtTable.TABLE.parentNode.parentNode),o=(0,s.closest)(t.target,["HOT-TABLE"],r),t.realTarget=o?r.querySelector("HOT-TABLE")||t.target:t.target),Object.defineProperty(t,"target",{get:function(){return(0,s.polymerWrap)(i)},enumerable:!0,configurable:!0}),t}function i(){return f}t.__esModule=!0;var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;r(this,e),this.context=t||this,this.context.eventListeners||(this.context.eventListeners=[])}return a(e,[{key:"addEventListener",value:function(e,t,n){function r(e){n.call(this,o(a,e))}var i=this,a=this.context;return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:r}),window.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r),f+=1,function(){i.removeEventListener(e,t,n)}}},{key:"removeEventListener",value:function(e,t,n){for(var r=this.context.eventListeners.length,o=void 0;r;)if(r-=1,o=this.context.eventListeners[r],o.event===t&&o.element===e){if(n&&n!==o.callback)continue;this.context.eventListeners.splice(r,1),o.element.removeEventListener?o.element.removeEventListener(o.event,o.callbackProxy,!1):o.element.detachEvent("on"+o.event,o.callbackProxy),f-=1}}},{key:"clearEvents",value:function(){if(this.context)for(var e=this.context.eventListeners.length;e;){e-=1;var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}}},{key:"clear",value:function(){this.clearEvents()}},{key:"destroy",value:function(){this.clearEvents(),this.context=null}},{key:"fireEvent",value:function(e,t){var n={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0},r=void 0;document.createEvent?(r=document.createEvent("MouseEvents"),r.initMouseEvent(t,n.bubbles,n.cancelable,n.view,n.detail,n.screenX,n.screenY,n.clientX,n.clientY,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,n.button,n.relatedTarget||document.body.parentNode)):r=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(r):e.fireEvent("on"+t,r)}}]),e}();t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.Viewport=t.TableRenderer=t.Table=t.Settings=t.Selection=t.Scroll=t.Overlays=t.Event=t.Core=t.default=t.Border=t.BottomLeftCornerOverlay=t.BottomOverlay=t.TopLeftCornerOverlay=t.TopOverlay=t.LeftOverlay=t.DebugOverlay=t.RowFilter=t.ColumnFilter=t.CellRange=t.CellCoords=t.ViewportRowsCalculator=t.ViewportColumnsCalculator=void 0,n(89),n(98),n(99),n(100),n(101),n(104),n(106),n(107),n(108),n(109),n(110),n(111),n(112),n(113),n(114),n(115),n(116),n(117),n(118),n(119),n(120),n(121),n(122),n(123),n(124),n(127),n(128),n(129),n(130),n(131),n(132),n(133),n(134),n(136),n(137),n(138),n(139),n(140),n(83),n(141),n(142),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155);var o=n(194),i=r(o),a=n(195),s=r(a),l=n(65),u=r(l),c=n(196),f=r(c),h=n(197),d=r(h),p=n(198),g=r(p),v=n(506),m=r(v),y=n(508),w=r(y),b=n(509),C=r(b),_=n(510),E=r(_),O=n(511),S=r(O),T=n(512),R=r(T),M=n(327),k=r(M),N=n(199),A=r(N),I=n(320),D=r(I),P=n(321),x=r(P),L=n(322),H=r(L),j=n(513),F=r(j),V=n(323),B=r(V),W=n(324),U=r(W),Y=n(325),$=r(Y),G=n(326),z=r(G);t.ViewportColumnsCalculator=i.default,t.ViewportRowsCalculator=s.default,t.CellCoords=u.default,t.CellRange=f.default,t.ColumnFilter=d.default,t.RowFilter=g.default,t.DebugOverlay=m.default,t.LeftOverlay=w.default,t.TopOverlay=C.default,t.TopLeftCornerOverlay=E.default,t.BottomOverlay=S.default,t.BottomLeftCornerOverlay=R.default,t.Border=k.default,t.default=A.default,t.Core=A.default,t.Event=D.default,t.Overlays=x.default,t.Scroll=H.default,t.Selection=F.default,t.Settings=B.default,t.Table=U.default,t.TableRenderer=$.default,t.Viewport=z.default},function(e,t,n){"use strict";function r(e){var t=void 0;switch(void 0===e?"undefined":c(e)){case"string":case"number":t=""+e;break;case"object":t=null===e?"":e.toString();break;case"undefined":t="";break;default:t=e.toString()}return t}function o(e){return void 0!==e}function i(e){return void 0===e}function a(e){return null===e||""===e||i(e)}function s(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function l(e,t){e=b(e||"");var n="",r=!0,o=u(e),i=_(),s=a(e)||"trial"===e;if(s||o)if(o){var l=Math.floor((0,d.default)("14/11/2018","DD/MM/YYYY").toDate().getTime()/864e5),c=C(e);(c>45e3||c!==parseInt(c,10))&&(n="The license key provided to Handsontable Pro is invalid. Make sure you pass it correctly."),n||(l>c+1&&(n=(0,p.toSingleLine)(f)),r=l>c+15)}else n="Evaluation version of Handsontable Pro. Not licensed for use in a production environment.";else n="The license key provided to Handsontable Pro is invalid. Make sure you pass it correctly.";if(i&&(n=!1,r=!1),n&&!E&&(console[s?"info":"warn"](n),E=!0),r&&t.parentNode){var h=document.createElement("div");h.id="hot-display-license-info",h.appendChild(document.createTextNode("Evaluation version of Handsontable Pro.")),h.appendChild(document.createElement("br")),h.appendChild(document.createTextNode("Not licensed for production use.")),t.parentNode.insertBefore(h,t.nextSibling)}}function u(e){var t=[][g],n=t;if(e[g]!==w("Z"))return!1;for(var r="",o="B>1:r=y(e,i,i?1===o[g]?9:8:6);return n===t}t.__esModule=!0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f=function(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n Your license key of Handsontable Pro has expired.‌‌‌‌ \n Renew your maintenance plan at https://handsontable.com or downgrade to the previous version of the software.\n "],["\n Your license key of Handsontable Pro has expired.‌‌‌‌ \n Renew your maintenance plan at https://handsontable.com or downgrade to the previous version of the software.\n "]);t.stringify=r,t.isDefined=o,t.isUndefined=i,t.isEmpty=a,t.isRegExp=s,t._injectProductInfo=l;var h=n(25),d=function(e){return e&&e.__esModule?e:{default:e}}(h),p=n(26),g="length",v=function(e){return parseInt(e,16)},m=function(e){return parseInt(e,10)},y=function(e,t,n){return e.substr(t,n)},w=function(e){return e.codePointAt(0)-65},b=function(e){return(""+e).replace(/\-/g,"")},C=function(e){return v(y(b(e),v("12"),w("F")))/(v(y(b(e),w("B"),~~![][g]))||9)},_=function(){return"undefined"!=typeof location&&/^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host)},E=!1},function(e,t,n){"use strict";function r(e,t){if(!a[e])throw Error('Filter condition "'+e+'" does not exist.');var n=a[e],r=n.condition,o=n.descriptor,i=t;return o.inputValuesDecorator&&(i=o.inputValuesDecorator(i)),function(e){return r.apply(e.meta.instance,[].concat([e],[i]))}}function o(e){if(!a[e])throw Error('Filter condition "'+e+'" does not exist.');return a[e].descriptor}function i(e,t,n){n.key=e,a[e]={condition:t,descriptor:n}}t.__esModule=!0,t.getCondition=r,t.getConditionDescriptor=o,t.registerCondition=i;var a=t.conditions={}},function(e,t,n){"use strict";function r(e){e.isImmediatePropagationEnabled=!1,e.cancelBubble=!0}function o(e){return!1===e.isImmediatePropagationEnabled}function i(e){"function"==typeof e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function a(e){return e.pageX?e.pageX:e.clientX+(0,c.getWindowScrollLeft)()}function s(e){return e.pageY?e.pageY:e.clientY+(0,c.getWindowScrollTop)()}function l(e){return 2===e.button}function u(e){return 0===e.button}t.__esModule=!0,t.stopImmediatePropagation=r,t.isImmediatePropagationStopped=o,t.stopPropagation=i,t.pageX=a,t.pageY=s,t.isRightClick=l,t.isLeftClick=u;var c=n(2)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(95)("wks"),o=n(59),i=n(16).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if("function"==typeof e)return e;if(!O(e))throw Error('No registered renderer found under "'+e+'" name');return E(e)}t.__esModule=!0,t.getRegisteredRenderers=t.getRegisteredRendererNames=t.hasRenderer=t.getRenderer=t.registerRenderer=void 0;var i=n(41),a=r(i),s=n(525),l=r(s),u=n(526),c=r(u),f=n(527),h=r(f),d=n(528),p=r(d),g=n(529),v=r(g),m=n(530),y=r(m),w=n(531),b=r(w),C=(0,a.default)("renderers"),_=C.register,E=C.getItem,O=C.hasItem,S=C.getNames,T=C.getValues;_("base",l.default),_("autocomplete",c.default),_("checkbox",h.default),_("html",p.default),_("numeric",v.default),_("password",y.default),_("text",b.default),t.registerRenderer=_,t.getRenderer=o,t.hasRenderer=O,t.getRegisteredRendererNames=S,t.getRegisteredRenderers=T},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return c}t.__esModule=!0;var i=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=this.createEmptyBucket()),e.pluginHookBucket):this.globalBucket}},{key:"add",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(Array.isArray(t))(0,a.arrayEach)(t,function(t){return n.add(e,t,r)});else{var o=this.getBucket(r);if(void 0===o[e]&&(this.register(e),o[e]=[]),t.skip=!1,-1===o[e].indexOf(t)){var i=!1;t.initialHook&&(0,a.arrayEach)(o[e],function(n,r){if(n.initialHook)return o[e][r]=t,i=!0,!1}),i||o[e].push(t)}}return this}},{key:"once",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Array.isArray(t)?(0,a.arrayEach)(t,function(t){return n.once(e,t,r)}):(t.runOnce=!0,this.add(e,t,r))}},{key:"remove",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.getBucket(n);return void 0!==r[e]&&r[e].indexOf(t)>=0&&(t.skip=!0,!0)}},{key:"has",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getBucket(t);return!(void 0===n[e]||!n[e].length)}},{key:"run",value:function(e,t,n,r,o,i,a,s){var l=this.globalBucket[t],u=l?l.length:0,c=0;if(u)for(;c0&&void 0!==arguments[0]?arguments[0]:null),function(e,t,n){return n[t].length=0})}},{key:"register",value:function(e){this.isRegistered(e)||l.push(e)}},{key:"deregister",value:function(e){this.isRegistered(e)&&l.splice(l.indexOf(e),1)}},{key:"isRegistered",value:function(e){return l.indexOf(e)>=0}},{key:"getRegistered",value:function(){return l}}]),e}(),c=new u;t.default=u},function(e,t,n){"use strict";function r(e){return 32===e||e>=48&&e<=57||e>=96&&e<=111||e>=186&&e<=192||e>=219&&e<=222||e>=226||e>=65&&e<=90}function o(e){return-1!==[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT].indexOf(e)}function i(e){var t=[];return window.navigator.platform.includes("Mac")?t.push(u.COMMAND_LEFT,u.COMMAND_RIGHT,u.COMMAND_FIREFOX):t.push(u.CONTROL),t.includes(e)}function a(e){return[u.CONTROL,u.COMMAND_LEFT,u.COMMAND_RIGHT,u.COMMAND_FIREFOX].includes(e)}function s(e,t){var n=t.split("|"),r=!1;return(0,l.arrayEach)(n,function(t){if(e===u[t])return r=!0,!1}),r}t.__esModule=!0,t.KEY_CODES=void 0,t.isPrintableChar=r,t.isMetaKey=o,t.isCtrlKey=i,t.isCtrlMetaKey=a,t.isKey=s;var l=n(0),u=t.KEY_CODES={MOUSE_LEFT:1,MOUSE_RIGHT:3,MOUSE_MIDDLE:2,BACKSPACE:8,COMMA:188,INSERT:45,DELETE:46,END:35,ENTER:13,ESCAPE:27,CONTROL:17,COMMAND_LEFT:91,COMMAND_RIGHT:93,COMMAND_FIREFOX:224,ALT:18,HOME:36,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,SPACE:32,SHIFT:16,CAPS_LOCK:20,TAB:9,ARROW_RIGHT:39,ARROW_LEFT:37,ARROW_UP:38,ARROW_DOWN:40,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,A:65,C:67,D:68,F:70,L:76,O:79,P:80,S:83,V:86,X:88}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t={},n=e;this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in t||(t[e.guid]=new n(e)),t[e.guid]},f.default.getSingleton().add("afterDestroy",function(){t[this.guid]=null})}function i(e,t){var n=void 0;if("function"==typeof e)I.get(e)||s(null,e),n=I.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter');n=x(e)}if(!n)throw Error('No editor registered under name "'+e+'"');return n.getInstance(t)}function a(e){if(!L(e))throw Error('No registered editor found under "'+e+'" name');return x(e).getConstructor()}function s(e,t){var n=new o(t);"string"==typeof e&&P(e,n),I.set(t,n)}t.__esModule=!0,t.getRegisteredEditors=t.getRegisteredEditorNames=t.hasEditor=t.getEditorInstance=t.getEditor=t.registerEditor=void 0,t.RegisteredEditor=o,t._getEditorInstance=i;var l=n(41),u=r(l),c=n(17),f=r(c),h=n(64),d=r(h),p=n(328),g=r(p),v=n(515),m=r(v),y=n(516),w=r(y),b=n(521),C=r(b),_=n(329),E=r(_),O=n(522),S=r(O),T=n(523),R=r(T),M=n(524),k=r(M),N=n(66),A=r(N),I=new WeakMap,D=(0,u.default)("editors"),P=D.register,x=D.getItem,L=D.hasItem,H=D.getNames,j=D.getValues;s("base",d.default),s("autocomplete",g.default),s("checkbox",m.default),s("date",w.default),s("dropdown",C.default),s("handsontable",E.default),s("numeric",S.default),s("password",R.default),s("select",k.default),s("text",A.default),t.registerEditor=s,t.getEditor=a,t.getEditorInstance=i,t.hasEditor=L,t.getRegisteredEditorNames=H,t.getRegisteredEditors=j},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0),o=n(1),i={_localHooks:Object.create(null),addLocalHook:function(e,t){return this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t),this},runLocalHooks:function(e){for(var t=this,n=arguments.length,o=Array(n>1?n-1:0),i=1;i'+String.fromCharCode(10003)+""+e}function v(e,t){return!e.hidden||!("function"==typeof e.hidden&&e.hidden.call(t))}function m(e,t){for(var n=e.slice(0);00?t[t.length-1].name!==e.name&&t.push(e):t.push(e)}),t}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E.KEY,n=e.slice(0);return n=m(n,t),n=y(n,t),n=w(n)}t.__esModule=!0,t.normalizeSelection=r,t.isSeparator=o,t.hasSubMenu=i,t.isDisabled=a,t.isSelectionDisabled=s,t.getValidSelection=l,t.prepareVerticalAlignClass=u,t.prepareHorizontalAlignClass=c,t.getAlignmentClasses=f,t.align=h,t.checkSelectionConsistency=p,t.markLabelAsSelected=g,t.isItemHidden=v,t.filterSeparators=b;var C=n(0),_=n(2),E=n(161)},function(e,t,n){var r=n(21),o=n(170),i=n(91),a=Object.defineProperty;t.f=n(27)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){(function(e){!function(t,n){e.exports=n()}(0,function(){"use strict";function t(){return Mr.apply(null,arguments)}function r(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}function a(e){return void 0===e}function s(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function l(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function u(e,t){var n,r=[];for(n=0;n0)for(n=0;n0?"future":"past"];return T(n)?n(t):n.replace(/%s/i,t)}function L(e,t){var n=e.toLowerCase();jr[n]=jr[n+"s"]=jr[t]=e}function H(e){return"string"==typeof e?jr[e]||jr[e.toLowerCase()]:void 0}function j(e){var t,n,r={};for(n in e)c(e,n)&&(t=H(n))&&(r[t]=e[n]);return r}function F(e,t){Fr[e]=t}function V(e){var t=[];for(var n in e)t.push({unit:n,priority:Fr[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}function B(e,t,n){var r=""+Math.abs(e),o=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+r}function W(e,t,n,r){var o=r;"string"==typeof r&&(o=function(){return this[r]()}),e&&(Ur[e]=o),t&&(Ur[t[0]]=function(){return B(o.apply(this,arguments),t[1],t[2])}),n&&(Ur[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function U(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Y(e){var t,n,r=e.match(Vr);for(t=0,n=r.length;t=0&&Br.test(e);)e=e.replace(Br,n),Br.lastIndex=0,r-=1;return e}function z(e,t,n){so[e]=T(t)?t:function(e,r){return e&&n?n:t}}function X(e,t){return c(so,e)?so[e](t._strict,t._locale):new RegExp(K(e))}function K(e){return q(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,o){return t||n||r||o}))}function q(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),s(t)&&(r=function(e,n){n[t]=C(e)}),n=0;n=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}function Ce(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function _e(e,t,n){var r=7+t-n;return-(7+Ce(e,0,r).getUTCDay()-t)%7+r-1}function Ee(e,t,n,r,o){var i,a,s=(7+n-r)%7,l=_e(e,r,o),u=1+7*(t-1)+s+l;return u<=0?(i=e-1,a=ee(i)+u):u>ee(e)?(i=e+1,a=u-ee(e)):(i=e,a=u),{year:i,dayOfYear:a}}function Oe(e,t,n){var r,o,i=_e(e.year(),t,n),a=Math.floor((e.dayOfYear()-i-1)/7)+1;return a<1?(o=e.year()-1,r=a+Se(o,t,n)):a>Se(e.year(),t,n)?(r=a-Se(e.year(),t,n),o=e.year()+1):(o=e.year(),r=a),{week:r,year:o}}function Se(e,t,n){var r=_e(e,t,n),o=_e(e+1,t,n);return(ee(e)-r+o)/7}function Te(e){return Oe(e,this._week.dow,this._week.doy).week}function Re(){return this._week.dow}function Me(){return this._week.doy}function ke(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Ne(e){var t=Oe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Ae(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function Ie(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function De(e,t){return e?r(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:r(this._weekdays)?this._weekdays:this._weekdays.standalone}function Pe(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort}function xe(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Le(e,t,n){var r,o,i,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=h([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?(o=wo.call(this._weekdaysParse,a),-1!==o?o:null):"ddd"===t?(o=wo.call(this._shortWeekdaysParse,a),-1!==o?o:null):(o=wo.call(this._minWeekdaysParse,a),-1!==o?o:null):"dddd"===t?-1!==(o=wo.call(this._weekdaysParse,a))?o:-1!==(o=wo.call(this._shortWeekdaysParse,a))?o:(o=wo.call(this._minWeekdaysParse,a),-1!==o?o:null):"ddd"===t?-1!==(o=wo.call(this._shortWeekdaysParse,a))?o:-1!==(o=wo.call(this._weekdaysParse,a))?o:(o=wo.call(this._minWeekdaysParse,a),-1!==o?o:null):-1!==(o=wo.call(this._minWeekdaysParse,a))?o:-1!==(o=wo.call(this._weekdaysParse,a))?o:(o=wo.call(this._shortWeekdaysParse,a),-1!==o?o:null)}function He(e,t,n){var r,o,i;if(this._weekdaysParseExact)return Le.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(o=h([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(o,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(o,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(o,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function je(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Ae(e,this.localeData()),this.add(e-t,"d")):t}function Fe(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Ve(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Ie(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Be(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Ye.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=No),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function We(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Ye.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ao),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ue(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Ye.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Io),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ye(){function e(e,t){return t.length-e.length}var t,n,r,o,i,a=[],s=[],l=[],u=[];for(t=0;t<7;t++)n=h([2e3,1]).day(t),r=this.weekdaysMin(n,""),o=this.weekdaysShort(n,""),i=this.weekdays(n,""),a.push(r),s.push(o),l.push(i),u.push(r),u.push(o),u.push(i);for(a.sort(e),s.sort(e),l.sort(e),u.sort(e),t=0;t<7;t++)s[t]=q(s[t]),l[t]=q(l[t]),u[t]=q(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function $e(){return this.hours()%12||12}function Ge(){return this.hours()||24}function ze(e,t){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Xe(e,t){return t._meridiemParse}function Ke(e){return"p"===(e+"").toLowerCase().charAt(0)}function qe(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function Ze(e){return e?e.toLowerCase().replace("_","-"):e}function Qe(e){for(var t,n,r,o,i=0;i0;){if(r=Je(o.slice(0,t).join("-")))return r;if(n&&n.length>=t&&_(o,n,!0)>=t-1)break;t--}i++}return null}function Je(t){var r=null;if(!Ho[t]&&void 0!==e&&e&&e.exports)try{r=Do._abbr;n(507)("./"+t),et(r)}catch(e){}return Ho[t]}function et(e,t){var n;return e&&(n=a(t)?rt(e):tt(e,t))&&(Do=n),Do._abbr}function tt(e,t){if(null!==t){var n=Lo;if(t.abbr=e,null!=Ho[e])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Ho[e]._config;else if(null!=t.parentLocale){if(null==Ho[t.parentLocale])return jo[t.parentLocale]||(jo[t.parentLocale]=[]),jo[t.parentLocale].push({name:e,config:t}),null;n=Ho[t.parentLocale]._config}return Ho[e]=new k(M(n,t)),jo[e]&&jo[e].forEach(function(e){tt(e.name,e.config)}),et(e),Ho[e]}return delete Ho[e],null}function nt(e,t){if(null!=t){var n,r,o=Lo;r=Je(e),null!=r&&(o=r._config),t=M(o,t),n=new k(t),n.parentLocale=Ho[e],Ho[e]=n,et(e)}else null!=Ho[e]&&(null!=Ho[e].parentLocale?Ho[e]=Ho[e].parentLocale:null!=Ho[e]&&delete Ho[e]);return Ho[e]}function rt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Do;if(!r(e)){if(t=Je(e))return t;e=[e]}return Qe(e)}function ot(){return Dr(Ho)}function it(e){var t,n=e._a;return n&&-2===p(e).overflow&&(t=n[co]<0||n[co]>11?co:n[fo]<1||n[fo]>ue(n[uo],n[co])?fo:n[ho]<0||n[ho]>24||24===n[ho]&&(0!==n[po]||0!==n[go]||0!==n[vo])?ho:n[po]<0||n[po]>59?po:n[go]<0||n[go]>59?go:n[vo]<0||n[vo]>999?vo:-1,p(e)._overflowDayOfYear&&(tfo)&&(t=fo),p(e)._overflowWeeks&&-1===t&&(t=mo),p(e)._overflowWeekday&&-1===t&&(t=yo),p(e).overflow=t),e}function at(e,t,n){return null!=e?e:null!=t?t:n}function st(e){var n=new Date(t.now());return e._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function lt(e){var t,n,r,o,i,a=[];if(!e._d){for(r=st(e),e._w&&null==e._a[fo]&&null==e._a[co]&&ut(e),null!=e._dayOfYear&&(i=at(e._a[uo],r[uo]),(e._dayOfYear>ee(i)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),n=Ce(i,0,e._dayOfYear),e._a[co]=n.getUTCMonth(),e._a[fo]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=r[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ho]&&0===e._a[po]&&0===e._a[go]&&0===e._a[vo]&&(e._nextDay=!0,e._a[ho]=0),e._d=(e._useUTC?Ce:be).apply(null,a),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ho]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(p(e).weekdayMismatch=!0)}}function ut(e){var t,n,r,o,i,a,s,l;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)i=1,a=4,n=at(t.GG,e._a[uo],Oe(Tt(),1,4).year),r=at(t.W,1),((o=at(t.E,1))<1||o>7)&&(l=!0);else{i=e._locale._week.dow,a=e._locale._week.doy;var u=Oe(Tt(),i,a);n=at(t.gg,e._a[uo],u.year),r=at(t.w,u.week),null!=t.d?((o=t.d)<0||o>6)&&(l=!0):null!=t.e?(o=t.e+i,(t.e<0||t.e>6)&&(l=!0)):o=i}r<1||r>Se(n,i,a)?p(e)._overflowWeeks=!0:null!=l?p(e)._overflowWeekday=!0:(s=Ee(n,r,o,i,a),e._a[uo]=s.year,e._dayOfYear=s.dayOfYear)}function ct(e){var t,n,r,o,i,a,s=e._i,l=Fo.exec(s)||Vo.exec(s);if(l){for(p(e).iso=!0,t=0,n=Wo.length;t0&&p(e).unusedInput.push(a),s=s.slice(s.indexOf(r)+r.length),u+=r.length),Ur[i]?(r?p(e).empty=!1:p(e).unusedTokens.push(i),J(i,r,e)):e._strict&&!r&&p(e).unusedTokens.push(i);p(e).charsLeftOver=l-u,s.length>0&&p(e).unusedInput.push(s),e._a[ho]<=12&&!0===p(e).bigHour&&e._a[ho]>0&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[ho]=wt(e._locale,e._a[ho],e._meridiem),lt(e),it(e)}function wt(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(r=e.isPM(n),r&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function bt(e){var t,n,r,o,i;if(0===e._f.length)return p(e).invalidFormat=!0,void(e._d=new Date(NaN));for(o=0;othis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function zt(){if(!a(this._isDSTShifted))return this._isDSTShifted;var e={};if(m(e,this),e=Et(e),e._a){var t=e._isUTC?h(e._a):Tt(e._a);this._isDSTShifted=this.isValid()&&_(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Xt(){return!!this.isValid()&&!this._isUTC}function Kt(){return!!this.isValid()&&this._isUTC}function qt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Zt(e,t){var n,r,o,i=e,a=null;return Pt(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:s(e)?(i={},t?i[t]=e:i.milliseconds=e):(a=Qo.exec(e))?(n="-"===a[1]?-1:1,i={y:0,d:C(a[fo])*n,h:C(a[ho])*n,m:C(a[po])*n,s:C(a[go])*n,ms:C(xt(1e3*a[vo]))*n}):(a=Jo.exec(e))?(n="-"===a[1]?-1:1,i={y:Qt(a[2],n),M:Qt(a[3],n),w:Qt(a[4],n),d:Qt(a[5],n),h:Qt(a[6],n),m:Qt(a[7],n),s:Qt(a[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(o=en(Tt(i.from),Tt(i.to)),i={},i.ms=o.milliseconds,i.M=o.months),r=new Dt(i),Pt(e)&&c(e,"_locale")&&(r._locale=e._locale),r}function Qt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Jt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function en(e,t){var n;return e.isValid()&&t.isValid()?(t=jt(t,e),e.isBefore(t)?n=Jt(e,t):(n=Jt(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function tn(e,t){return function(n,r){var o,i;return null===r||isNaN(+r)||(S(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),n="string"==typeof n?+n:n,o=Zt(n,r),nn(this,o,e),this}}function nn(e,n,r,o){var i=n._milliseconds,a=xt(n._days),s=xt(n._months);e.isValid()&&(o=null==o||o,s&&pe(e,oe(e,"Month")+s*r),a&&ie(e,"Date",oe(e,"Date")+a*r),i&&e._d.setTime(e._d.valueOf()+i*r),o&&t.updateOffset(e,a||s))}function rn(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function on(e,n){var r=e||Tt(),o=jt(r,this).startOf("day"),i=t.calendarFormat(this,o)||"sameElse";return this.format(n&&(T(n[i])?n[i].call(this,r):n[i])||this.localeData().calendar(i,this,Tt(r)))}function an(){return new y(this)}function sn(e,t){var n=w(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&(t=H(a(t)?"millisecond":t),"millisecond"===t?this.valueOf()>n.valueOf():n.valueOf()9999?$(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this._d.valueOf()).toISOString().replace("Z",$(n,"Z")):$(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function mn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");return this.format("["+e+'("]'+(0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY")+"-MM-DD[T]HH:mm:ss.SSS"+t+'[")]')}function yn(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var n=$(this,e);return this.localeData().postformat(n)}function wn(e,t){return this.isValid()&&(w(e)&&e.isValid()||Tt(e).isValid())?Zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function bn(e){return this.from(Tt(),e)}function Cn(e,t){return this.isValid()&&(w(e)&&e.isValid()||Tt(e).isValid())?Zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function _n(e){return this.to(Tt(),e)}function En(e){var t;return void 0===e?this._locale._abbr:(t=rt(e),null!=t&&(this._locale=t),this)}function On(){return this._locale}function Sn(e){switch(e=H(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function Tn(e){return void 0===(e=H(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))}function Rn(){return this._d.valueOf()-6e4*(this._offset||0)}function Mn(){return Math.floor(this.valueOf()/1e3)}function kn(){return new Date(this.valueOf())}function Nn(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function An(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function In(){return this.isValid()?this.toISOString():null}function Dn(){return g(this)}function Pn(){return f({},p(this))}function xn(){return p(this).overflow}function Ln(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Hn(e,t){W(0,[e,e.length],0,t)}function jn(e){return Wn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Fn(e){return Wn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Vn(){return Se(this.year(),1,4)}function Bn(){var e=this.localeData()._week;return Se(this.year(),e.dow,e.doy)}function Wn(e,t,n,r,o){var i;return null==e?Oe(this,r,o).year:(i=Se(e,r,o),t>i&&(t=i),Un.call(this,e,t,n,r,o))}function Un(e,t,n,r,o){var i=Ee(e,t,n,r,o),a=Ce(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Yn(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function $n(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function Gn(e,t){t[vo]=C(1e3*("0."+e))}function zn(){return this._isUTC?"UTC":""}function Xn(){return this._isUTC?"Coordinated Universal Time":""}function Kn(e){return Tt(1e3*e)}function qn(){return Tt.apply(null,arguments).parseZone()}function Zn(e){return e}function Qn(e,t,n,r){return rt()[n](h().set(r,t),e)}function Jn(e,t,n){if(s(e)&&(t=e,e=void 0),e=e||"",null!=t)return Qn(e,t,n,"month");var r,o=[];for(r=0;r<12;r++)o[r]=Qn(e,r,n,"month");return o}function er(e,t,n,r){"boolean"==typeof e?(s(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,s(t)&&(n=t,t=void 0),t=t||"");var o=rt(),i=e?o._week.dow:0;if(null!=n)return Qn(t,(n+i)%7,r,"day");var a,l=[];for(a=0;a<7;a++)l[a]=Qn(t,(a+i)%7,r,"day");return l}function tr(e,t){return Jn(e,t,"months")}function nr(e,t){return Jn(e,t,"monthsShort")}function rr(e,t,n){return er(e,t,n,"weekdays")}function or(e,t,n){return er(e,t,n,"weekdaysShort")}function ir(e,t,n){return er(e,t,n,"weekdaysMin")}function ar(){var e=this._data;return this._milliseconds=ci(this._milliseconds),this._days=ci(this._days),this._months=ci(this._months),e.milliseconds=ci(e.milliseconds),e.seconds=ci(e.seconds),e.minutes=ci(e.minutes),e.hours=ci(e.hours),e.months=ci(e.months),e.years=ci(e.years),this}function sr(e,t,n,r){var o=Zt(t,n);return e._milliseconds+=r*o._milliseconds,e._days+=r*o._days,e._months+=r*o._months,e._bubble()}function lr(e,t){return sr(this,e,t,1)}function ur(e,t){return sr(this,e,t,-1)}function cr(e){return e<0?Math.floor(e):Math.ceil(e)}function fr(){var e,t,n,r,o,i=this._milliseconds,a=this._days,s=this._months,l=this._data;return i>=0&&a>=0&&s>=0||i<=0&&a<=0&&s<=0||(i+=864e5*cr(dr(s)+a),a=0,s=0),l.milliseconds=i%1e3,e=b(i/1e3),l.seconds=e%60,t=b(e/60),l.minutes=t%60,n=b(t/60),l.hours=n%24,a+=b(n/24),o=b(hr(a)),s+=o,a-=cr(dr(o)),r=b(s/12),s%=12,l.days=a,l.months=s,l.years=r,this}function hr(e){return 4800*e/146097}function dr(e){return 146097*e/4800}function pr(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=H(e))||"year"===e)return t=this._days+r/864e5,n=this._months+hr(t),"month"===e?n:n/12;switch(t=this._days+Math.round(dr(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function gr(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*C(this._months/12):NaN}function vr(e){return function(){return this.as(e)}}function mr(){return Zt(this)}function yr(e){return e=H(e),this.isValid()?this[e+"s"]():NaN}function wr(e){return function(){return this.isValid()?this._data[e]:NaN}}function br(){return b(this.days()/7)}function Cr(e,t,n,r,o){return o.relativeTime(t||1,!!n,e,r)}function _r(e,t,n){var r=Zt(e).abs(),o=Ti(r.as("s")),i=Ti(r.as("m")),a=Ti(r.as("h")),s=Ti(r.as("d")),l=Ti(r.as("M")),u=Ti(r.as("y")),c=o<=Ri.ss&&["s",o]||o0,c[4]=n,Cr.apply(null,c)}function Er(e){return void 0===e?Ti:"function"==typeof e&&(Ti=e,!0)}function Or(e,t){return void 0!==Ri[e]&&(void 0===t?Ri[e]:(Ri[e]=t,"s"===e&&(Ri.ss=t-1),!0))}function Sr(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=_r(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function Tr(e){return(e>0)-(e<0)||+e}function Rr(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r=Mi(this._milliseconds)/1e3,o=Mi(this._days),i=Mi(this._months);e=b(r/60),t=b(e/60),r%=60,e%=60,n=b(i/12),i%=12;var a=n,s=i,l=o,u=t,c=e,f=r?r.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var d=h<0?"-":"",p=Tr(this._months)!==Tr(h)?"-":"",g=Tr(this._days)!==Tr(h)?"-":"",v=Tr(this._milliseconds)!==Tr(h)?"-":"";return d+"P"+(a?p+a+"Y":"")+(s?p+s+"M":"")+(l?g+l+"D":"")+(u||c||f?"T":"")+(u?v+u+"H":"")+(c?v+c+"M":"")+(f?v+f+"S":"")}var Mr,kr;kr=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,r=0;r68?1900:2e3)};var wo,bo=re("FullYear",!0);wo=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;tthis?this:e:v()}),Ko=function(){return Date.now?Date.now():+new Date},qo=["year","quarter","month","week","day","hour","minute","second","millisecond"];Lt("Z",":"),Lt("ZZ",""),z("Z",oo),z("ZZ",oo),Z(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ht(oo,e)});var Zo=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var Qo=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Jo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;Zt.fn=Dt.prototype,Zt.invalid=It;var ei=tn(1,"add"),ti=tn(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ni=O("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Hn("gggg","weekYear"),Hn("ggggg","weekYear"),Hn("GGGG","isoWeekYear"),Hn("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),z("G",no),z("g",no),z("GG",Kr,$r),z("gg",Kr,$r),z("GGGG",Jr,zr),z("gggg",Jr,zr),z("GGGGG",eo,Xr),z("ggggg",eo,Xr),Q(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=C(e)}),Q(["gg","GG"],function(e,n,r,o){n[o]=t.parseTwoDigitYear(e)}),W("Q",0,"Qo","quarter"),L("quarter","Q"),F("quarter",7),z("Q",Yr),Z("Q",function(e,t){t[co]=3*(C(e)-1)}),W("D",["DD",2],"Do","date"),L("date","D"),F("date",9),z("D",Kr),z("DD",Kr,$r),z("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Z(["D","DD"],fo),Z("Do",function(e,t){t[fo]=C(e.match(Kr)[0])});var ri=re("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),F("dayOfYear",4),z("DDD",Qr),z("DDDD",Gr),Z(["DDD","DDDD"],function(e,t,n){n._dayOfYear=C(e)}),W("m",["mm",2],0,"minute"),L("minute","m"),F("minute",14),z("m",Kr),z("mm",Kr,$r),Z(["m","mm"],po);var oi=re("Minutes",!1);W("s",["ss",2],0,"second"),L("second","s"),F("second",15),z("s",Kr),z("ss",Kr,$r),Z(["s","ss"],go);var ii=re("Seconds",!1);W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return 10*this.millisecond()}),W(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),W(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),W(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),W(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),W(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),L("millisecond","ms"),F("millisecond",16),z("S",Qr,Yr),z("SS",Qr,$r),z("SSS",Qr,Gr);var ai;for(ai="SSSS";ai.length<=9;ai+="S")z(ai,to);for(ai="S";ai.length<=9;ai+="S")Z(ai,Gn);var si=re("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var li=y.prototype;li.add=ei,li.calendar=on,li.clone=an,li.diff=dn,li.endOf=Tn,li.format=yn,li.from=wn,li.fromNow=bn,li.to=Cn,li.toNow=_n,li.get=ae,li.invalidAt=xn,li.isAfter=sn,li.isBefore=ln,li.isBetween=un,li.isSame=cn,li.isSameOrAfter=fn,li.isSameOrBefore=hn,li.isValid=Dn,li.lang=ni,li.locale=En,li.localeData=On,li.max=Xo,li.min=zo,li.parsingFlags=Pn,li.set=se,li.startOf=Sn,li.subtract=ti,li.toArray=Nn,li.toObject=An,li.toDate=kn,li.toISOString=vn,li.inspect=mn,li.toJSON=In,li.toString=gn,li.unix=Mn,li.valueOf=Rn,li.creationData=Ln,li.year=bo,li.isLeapYear=ne,li.weekYear=jn,li.isoWeekYear=Fn,li.quarter=li.quarters=Yn,li.month=ge,li.daysInMonth=ve,li.week=li.weeks=ke,li.isoWeek=li.isoWeeks=Ne,li.weeksInYear=Bn,li.isoWeeksInYear=Vn,li.date=ri,li.day=li.days=je,li.weekday=Fe,li.isoWeekday=Ve,li.dayOfYear=$n,li.hour=li.hours=xo,li.minute=li.minutes=oi,li.second=li.seconds=ii,li.millisecond=li.milliseconds=si,li.utcOffset=Vt,li.utc=Wt,li.local=Ut,li.parseZone=Yt,li.hasAlignedHourOffset=$t,li.isDST=Gt,li.isLocal=Xt,li.isUtcOffset=Kt,li.isUtc=qt,li.isUTC=qt,li.zoneAbbr=zn,li.zoneName=Xn,li.dates=O("dates accessor is deprecated. Use date instead.",ri),li.months=O("months accessor is deprecated. Use month instead",ge),li.years=O("years accessor is deprecated. Use year instead",bo),li.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Bt),li.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",zt);var ui=k.prototype;ui.calendar=N,ui.longDateFormat=A,ui.invalidDate=I,ui.ordinal=D,ui.preparse=Zn,ui.postformat=Zn,ui.relativeTime=P,ui.pastFuture=x,ui.set=R,ui.months=ce,ui.monthsShort=fe,ui.monthsParse=de,ui.monthsRegex=ye,ui.monthsShortRegex=me,ui.week=Te,ui.firstDayOfYear=Me,ui.firstDayOfWeek=Re,ui.weekdays=De,ui.weekdaysMin=xe,ui.weekdaysShort=Pe,ui.weekdaysParse=He,ui.weekdaysRegex=Be,ui.weekdaysShortRegex=We,ui.weekdaysMinRegex=Ue,ui.isPM=Ke,ui.meridiem=qe,et("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===C(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),t.lang=O("moment.lang is deprecated. Use moment.locale instead.",et),t.langData=O("moment.langData is deprecated. Use moment.localeData instead.",rt);var ci=Math.abs,fi=vr("ms"),hi=vr("s"),di=vr("m"),pi=vr("h"),gi=vr("d"),vi=vr("w"),mi=vr("M"),yi=vr("y"),wi=wr("milliseconds"),bi=wr("seconds"),Ci=wr("minutes"),_i=wr("hours"),Ei=wr("days"),Oi=wr("months"),Si=wr("years"),Ti=Math.round,Ri={ss:44,s:45,m:45,h:22,d:26,M:11},Mi=Math.abs,ki=Dt.prototype;return ki.isValid=At,ki.abs=ar,ki.add=lr,ki.subtract=ur,ki.as=pr,ki.asMilliseconds=fi,ki.asSeconds=hi,ki.asMinutes=di,ki.asHours=pi,ki.asDays=gi,ki.asWeeks=vi,ki.asMonths=mi,ki.asYears=yi,ki.valueOf=gr,ki._bubble=fr,ki.clone=mr,ki.get=yr,ki.milliseconds=wi,ki.seconds=bi,ki.minutes=Ci,ki.hours=_i,ki.days=Ei,ki.weeks=br,ki.months=Oi,ki.years=Si,ki.humanize=Sr,ki.toISOString=Rr,ki.toString=Rr,ki.toJSON=Rr,ki.locale=En,ki.localeData=On,ki.toIsoString=O("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Rr),ki.lang=ni,W("X",0,0,"unix"),W("x",0,0,"valueOf"),z("x",no),z("X",io),Z("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),Z("x",function(e,t,n){n._d=new Date(C(e))}),t.version="2.20.1",function(e){Mr=e}(Tt),t.fn=li,t.min=Mt,t.max=kt,t.now=Ko,t.utc=h,t.unix=Kn,t.months=tr,t.isDate=l,t.locale=et,t.invalid=v,t.duration=Zt,t.isMoment=w,t.weekdays=rr,t.parseZone=qn,t.localeData=rt,t.isDuration=Pt,t.monthsShort=nr,t.weekdaysMin=ir,t.defineLocale=tt,t.updateLocale=nt,t.locales=ot,t.weekdaysShort=or,t.normalizeUnits=H,t.relativeTimeRounding=Er,t.relativeTimeThreshold=Or,t.calendarFormat=rn,t.prototype=li,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},t}),window.moment=n(25)}).call(t,n(200)(e))},function(e,t,n){"use strict";function r(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(6),o=n(50),i=n(28);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",a)}},function(e,t,n){"use strict";function r(e){return e[0].toUpperCase()+e.substr(1)}function o(){for(var e=[],t=arguments.length,n=Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return(""+e).replace(/(?:\\)?\[([^[\]]+)]/g,function(e,n){return"\\"===e.charAt(0)?e.substr(1,e.length-1):void 0===t[n]?"":t[n]})}function l(e){return(""+e).replace(c,"")}t.__esModule=!0,t.toUpperCaseFirst=r,t.equalsIgnoreCase=o,t.randomString=i,t.isPercentValue=a,t.substitute=s,t.stripTags=l;var u=n(10),c=/<\/?\w+\/?>|<\w+[\s|\/][^>]*>/gi},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t}},{key:"reset",value:function(){if(this.clone){var e=this.clone.wtTable.holder;(0,l.arrayEach)([e.style,this.clone.wtTable.hider.style,e.parentNode.style],function(e){e.width="",e.height=""})}}},{key:"destroy",value:function(){new c.default(this.clone).destroy()}}]),e}()},function(e,t,n){"use strict";function r(e){return"function"==typeof e}function o(e){function t(){for(var t=this,a=arguments.length,s=Array(a),l=0;l1&&void 0!==arguments[1]?arguments[1]:200,r=0,o={lastCallThrottled:!0},i=null;return t}function i(e){function t(){s=i}function n(){for(var t=arguments.length,n=Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:200,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=o(e,r),s=i;return n.clearHits=t,n}function a(e){function t(){for(var t=this,i=arguments.length,a=Array(i),s=0;s1&&void 0!==arguments[1]?arguments[1]:200,r=null,o=void 0;return t}function s(){for(var e=arguments.length,t=Array(e),n=0;n1?t-1:0),r=1;r=n?e.apply(this,s):t(s)}}var n=e.length;return t([])}function c(e){function t(r){return function(){for(var o=arguments.length,i=Array(o),a=0;a=n?e.apply(this,s):t(s)}}var n=e.length;return t([])}t.__esModule=!0,t.isFunction=r,t.throttle=o,t.throttleAfterHits=i,t.debounce=a,t.pipe=s,t.partial=l,t.curry=u,t.curryRight=c;var f=n(0)},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(16),o=n(37),i=n(35),a=n(59)("src"),s=Function.toString,l=(""+s).split("toString");n(50).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var u="function"==typeof n;u&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(u&&(i(n,a)||o(n,a,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t,n){var r=n(24),o=n(60);e.exports=n(27)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(75);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(49);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(59)("meta"),o=n(13),i=n(35),a=n(24).f,s=0,l=Object.isExtensible||function(){return!0},u=!n(28)(function(){return l(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},f=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!l(e))return"F";if(!t)return"E";c(e)}return e[r].i},h=function(e,t){if(!i(e,r)){if(!l(e))return!0;if(!t)return!1;c(e)}return e[r].w},d=function(e){return u&&p.NEED&&l(e)&&!i(e,r)&&c(e),e},p=e.exports={KEY:r,NEED:!1,fastKey:f,getWeak:h,onFreeze:d}},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:"common";i.has(s)||i.set(s,new Map);var l=i.get(s);return{register:e,getItem:t,hasItem:n,getNames:o,getValues:a}}t.__esModule=!0,t.default=o;var i=t.collection=new Map},function(e,t,n){"use strict";function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.userAgent,n=void 0===t?navigator.userAgent:t,r=e.vendor,o=void 0===r?navigator.vendor:r;(0,h.objectEach)(p,function(e){return void(0,e.test)(n,o)})}function o(){return p.chrome.value}function i(){return p.edge.value}function a(){return p.ie.value}function s(){return p.ie8.value}function l(){return p.ie9.value}function u(){return p.ie.value||p.edge.value}function c(){return p.mobile.value}function f(){return p.safari.value}t.__esModule=!0,t.setBrowserMeta=r,t.isChrome=o,t.isEdge=i,t.isIE=a,t.isIE8=s,t.isIE9=l,t.isMSBrowser=u,t.isMobileBrowser=c,t.isSafari=f;var h=n(1),d=function(e){var t={value:!1};return t.test=function(n,r){t.value=e(n,r)},t},p={chrome:d(function(e,t){return/Chrome/.test(e)&&/Google/.test(t)}),edge:d(function(e){return/Edge/.test(e)}),ie:d(function(e){return/Trident/.test(e)}),ie8:d(function(){return!document.createTextNode("test").textContent}),ie9:d(function(){return!!document.documentMode}),mobile:d(function(e){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}),safari:d(function(e,t){return/Safari/.test(e)&&/Apple Computer/.test(t)})};r()},function(e,t,n){"use strict";function r(e){return d.call(window,e)}function o(e){p.call(window,e)}function i(){return"ontouchstart"in window}function a(){var e=document.createElement("div");return!(!e.createShadowRoot||!e.createShadowRoot.toString().match(/\[native code\]/))}function s(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var n=document.createElement("CAPTION");n.innerHTML="c
c
c
c",n.style.padding=0,n.style.margin=0,e.insertBefore(n,t),document.body.appendChild(e),v=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function l(){return void 0===v&&s(),v}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m||(m="object"===("undefined"==typeof Intl?"undefined":c(Intl))?new Intl.Collator(e,t).compare:"function"==typeof String.prototype.localeCompare?function(e,t){return(""+e).localeCompare(t)}:function(e,t){return e===t?0:e>t?-1:1})}t.__esModule=!0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.requestAnimationFrame=r,t.cancelAnimationFrame=o,t.isTouchSupported=i,t.isWebComponentSupportedNatively=a,t.hasCaptionProblem=l,t.getComparisonFunction=u;for(var f=0,h=["ms","moz","webkit","o"],d=window.requestAnimationFrame,p=window.cancelAnimationFrame,g=0;g=2&&"="===e.charAt(0)}function o(e){return"string"==typeof e&&"'"===e.charAt(0)&&"="===e.charAt(1)}function i(e){return o(e)?e.substr(1):e}function a(e){var t=/(\\"|"(?:\\"|[^"])*"|(\+))|(\\'|'(?:\\'|[^'])*'|(\+))/g,n=e.match(t)||[],r=-1;return e.toUpperCase().replace(t,function(){return r+=1,n[r]})}function s(e,t){return function(n){return{row:"row"===e?t:n.row,column:"column"===e?t:n.column}}}t.__esModule=!0,t.isFormulaExpression=r,t.isFormulaExpressionEscaped=o,t.unescapeFormulaExpression=i,t.toUpperCaseFormula=a,t.cellCoordFactory=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=function(){function e(e,t){for(var n=0;n0}},{key:"hasPrecedent",value:function(e){return(0,l.arrayFilter)(this.precedents,function(t){return t.isEqual(e)}).length>0}}]),t}(c.default)},function(e,t,n){var r=n(171),o=n(96);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";t.__esModule=!0,t.sort=t.DO_NOT_SWAP=t.FIRST_BEFORE_SECOND=t.FIRST_AFTER_SECOND=t.getCompareFunctionFactory=t.getRootComparator=t.registerRootComparator=void 0;var r=n(465),o=n(579);t.registerRootComparator=r.registerRootComparator,t.getRootComparator=r.getRootComparator,t.getCompareFunctionFactory=r.getCompareFunctionFactory,t.FIRST_AFTER_SECOND=o.FIRST_AFTER_SECOND,t.FIRST_BEFORE_SECOND=o.FIRST_BEFORE_SECOND,t.DO_NOT_SWAP=o.DO_NOT_SWAP,t.sort=o.sort},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(13);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){var r=n(14)("unscopables"),o=Array.prototype;void 0==o[r]&&n(37)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){h.set(e,t)}function i(e){var t=e instanceof u.default?e:a(e),n=void 0;return d.has(t)?n=d.get(t):(n=new f(t),d.set(t,n)),n}function a(e){if(!h.has(e))throw Error("Record translator was not registered for this object identity");return h.get(e)}t.__esModule=!0,t.RecordTranslator=void 0;var s=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:1,r=(0,o.arrayMax)(this._arrayMap)+1,i=[];return(0,a.rangeEach)(n-1,function(n){i.push(t._arrayMap.splice(e+n,0,r+n))}),i},removeItems:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[];if(Array.isArray(e)){var i=[].concat(this._arrayMap);e.sort(function(e,t){return t-e}),r=(0,o.arrayReduce)(e,function(e,n){return t._arrayMap.splice(n,1),e.concat(i.slice(n,n+1))},[])}else r=this._arrayMap.splice(e,n);return r},unshiftItems:function(e){function t(e){return(0,o.arrayReduce)(r,function(t,n){var r=t;return e>n&&(r+=1),r},0)}var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this.removeItems(e,n);this._arrayMap=(0,o.arrayMap)(this._arrayMap,function(e){var n=e,r=t(n);return r&&(n-=r),n})},shiftItems:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this._arrayMap=(0,o.arrayMap)(this._arrayMap,function(t){var r=t;return r>=e&&(r+=n),r}),(0,a.rangeEach)(n-1,function(n){t._arrayMap.splice(e+n,0,e+n)})},swapIndexes:function(e,t){var n;(n=this._arrayMap).splice.apply(n,[t,0].concat(r(this._arrayMap.splice(e,1))))},clearMap:function(){this._arrayMap.length=0}};(0,i.defineGetter)(s,"MIXIN_NAME","arrayMapper",{writable:!1,enumerable:!1}),t.default=s},function(e,t,n){"use strict";function r(e,t){return"border_row"+e+"col"+t}function o(){return{width:1,color:"#000"}}function i(){return{hide:!0}}function a(){return{width:1,color:"#000",cornerVisible:!1}}function s(e,t){return{id:r(e,t),border:a(),row:e,col:t,top:i(),right:i(),bottom:i(),left:i()}}function l(e,t){return(0,f.hasOwnProperty)(t,"border")&&(e.border=t.border),(0,f.hasOwnProperty)(t,"top")&&(t.top?((0,f.isObject)(t.top)||(t.top=o()),e.top=t.top):(t.top=i(),e.top=t.top)),(0,f.hasOwnProperty)(t,"right")&&(t.right?((0,f.isObject)(t.right)||(t.right=o()),e.right=t.right):(t.right=i(),e.right=t.right)),(0,f.hasOwnProperty)(t,"bottom")&&(t.bottom?((0,f.isObject)(t.bottom)||(t.bottom=o()),e.bottom=t.bottom):(t.bottom=i(),e.bottom=t.bottom)),(0,f.hasOwnProperty)(t,"left")&&(t.left?((0,f.isObject)(t.left)||(t.left=o()),e.left=t.left):(t.left=i(),e.left=t.left)),e}function u(e,t){var n=!1;return(0,h.arrayEach)(e.getSelectedRange(),function(r){r.forAll(function(r,o){var i=e.getCellMeta(r,o).borders;if(i){if(!t)return n=!0,!1;if(!(0,f.hasOwnProperty)(i[t],"hide")||!1===i[t].hide)return n=!0,!1}})}),n}function c(e){return''+String.fromCharCode(10003)+""+e}t.__esModule=!0,t.createId=r,t.createDefaultCustomBorder=o,t.createSingleEmptyBorder=i,t.createDefaultHtBorder=a,t.createEmptyBorders=s,t.extendDefaultBorder=l,t.checkSelectionBorders=u,t.markSelected=c;var f=n(1),h=n(0)},function(e,t){e.exports=!1},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports={}},function(e,t,n){var r=n(24).f,o=n(35),i=n(14)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){"use strict";function r(e){this.instance=e,this.state=a.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}t.__esModule=!0,t.EditorState=void 0;var o=n(9),i=n(10),a=t.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"};r.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},r.prototype.init=function(){},r.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},r.prototype.setValue=function(){throw Error("Editor setValue() method unimplemented")},r.prototype.open=function(){throw Error("Editor open() method unimplemented")},r.prototype.close=function(){throw Error("Editor close() method unimplemented")},r.prototype.prepare=function(e,t,n,r,o,i){this.TD=r,this.row=e,this.col=t,this.prop=n,this.originalValue=o,this.cellProperties=i,this.state=a.VIRGIN},r.prototype.extend=function(){function e(){for(var e=arguments.length,n=Array(e),r=0;rn[2]&&(r=n[0],n[0]=n[2],n[2]=r),n[1]>n[3]&&(r=n[1],n[1]=n[3],n[3]=r)):n=[this.row,this.col,null,null],this.instance.populateFromArray(n[0],n[1],e,n[2],n[3],"edit")},r.prototype.beginEditing=function(e,t){if(this.state===a.VIRGIN){if(this.instance.view.scrollViewport(new o.CellCoords(this.row,this.col)),this.state=a.EDITING,this.isInFullEditMode()){this.setValue("string"==typeof e?e:(0,i.stringify)(this.originalValue))}this.open(t),this._opened=!0,this.focus(),this.instance.view.render(),this.instance.runHooks("afterBeginEditing",this.row,this.col)}},r.prototype.finishEditing=function(e,t,n){var r=this,o=void 0;if(n){var i=this._closeCallback;this._closeCallback=function(e){i&&i(e),n(e),r.instance.view.render()}}if(!this.isWaiting()){if(this.state===a.VIRGIN)return void this.instance._registerTimeout(function(){r._fireCallbacks(!0)});if(this.state===a.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();var s=this.getValue();o=this.instance.getSettings().trimWhitespace?[["string"==typeof s?String.prototype.trim.call(s||""):s]]:[[s]],this.state=a.WAITING,this.saveValue(o,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){r.state=a.FINISHED,r.discardEditor(e)}):(this.state=a.FINISHED,this.discardEditor(!0))}}},r.prototype.cancelChanges=function(){this.state=a.FINISHED,this.discardEditor()},r.prototype.discardEditor=function(e){this.state===a.FINISHED&&(!1===e&&!0!==this.cellProperties.allowInvalid?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=a.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=a.VIRGIN,this._fireCallbacks(!0)))},r.prototype.enableFullEditMode=function(){this._fullEditMode=!0},r.prototype.isInFullEditMode=function(){return this._fullEditMode},r.prototype.isOpened=function(){return this._opened},r.prototype.isWaiting=function(){return this.state===a.WAITING},r.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns"))}},{key:"isEqual",value:function(e){return e===this||this.row===e.row&&this.col===e.col}},{key:"isSouthEastOf",value:function(e){return this.row>=e.row&&this.col>=e.col}},{key:"isNorthWestOf",value:function(e){return this.row<=e.row&&this.col<=e.col}},{key:"isSouthWestOf",value:function(e){return this.row>=e.row&&this.col<=e.col}},{key:"isNorthEastOf",value:function(e){return this.row<=e.row&&this.col>=e.col}},{key:"toObject",value:function(){return{row:this.row,col:this.col}}}]),e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(2),i=n(514),a=r(i),s=n(64),l=r(s),u=n(8),c=r(u),f=n(18),h=n(12),d=l.default.prototype.extend();d.prototype.init=function(){var e=this;this.createElements(),this.eventManager=new c.default(this),this.bindEvents(),this.autoResize=(0,a.default)(),this.holderZIndex=-1,this.instance.addHook("afterDestroy",function(){e.destroy()})},d.prototype.prepare=function(e,t,n,r,o,i){for(var a=this,u=this.state,c=arguments.length,f=Array(c>6?c-6:0),h=6;h=0?this.holderZIndex:"",this.textareaParentStyle.position=""},d.prototype.getValue=function(){return this.TEXTAREA.value},d.prototype.setValue=function(e){this.TEXTAREA.value=e},d.prototype.beginEditing=function(){if(this.state===s.EditorState.VIRGIN){this.TEXTAREA.value="";for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]&&arguments[0];if(this.state===s.EditorState.EDITING||e){if(!(this.TD=this.getEditedCell()))return void(e||this.close(!0));var t=(0,o.offset)(this.TD),n=(0,o.offset)(this.instance.rootElement),r=this.instance.view.wt.wtOverlays.topOverlay.mainTableScrollableElement,i=this.instance.view.wt.wtOverlays.leftOverlay.mainTableScrollableElement,a=this.instance.countRows(),l=r!==window?r.scrollTop:0,u=i!==window?i.scrollLeft:0,c=this.checkEditorSection(),f=["","left"].includes(c)?l:0,h=["","top","bottom"].includes(c)?u:0,d=t.top===n.top?0:1,p=this.instance.getSettings(),g=this.instance.hasColHeaders(),v=this.TD.style.backgroundColor,m=t.top-n.top-d-f,y=t.left-n.left-1-h,w=void 0;switch(c){case"top":w=(0,o.getCssTransform)(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":w=(0,o.getCssTransform)(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":w=(0,o.getCssTransform)(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":w=(0,o.getCssTransform)(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":w=(0,o.getCssTransform)(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(g&&0===this.instance.getSelectedLast()[0]||p.fixedRowsBottom&&this.instance.getSelectedLast()[0]===a-p.fixedRowsBottom)&&(m+=1),0===this.instance.getSelectedLast()[1]&&(y+=1),w&&-1!==w?this.textareaParentStyle[w[0]]=w[1]:(0,o.resetCssTransform)(this.TEXTAREA_PARENT),this.textareaParentStyle.top=m+"px",this.textareaParentStyle.left=y+"px",this.showEditableElement();var b=this.instance.view.wt.wtViewport.rowsRenderCalculator.startPosition,C=this.instance.view.wt.wtViewport.columnsRenderCalculator.startPosition,_=this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),E=this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),O=(0,o.getScrollbarWidth)(),S=this.TD.offsetTop+b-E,T=this.TD.offsetLeft+C-_,R=(0,o.innerWidth)(this.TD)-8,M=(0,o.hasVerticalScrollbar)(r)?O:0,k=(0,o.hasHorizontalScrollbar)(i)?O:0,N=this.instance.view.maximumVisibleElementWidth(T)-9-M,A=this.TD.scrollHeight+1,I=Math.max(this.instance.view.maximumVisibleElementHeight(S)-k,23),D=(0,o.getComputedStyle)(this.TD);this.TEXTAREA.style.fontSize=D.fontSize,this.TEXTAREA.style.fontFamily=D.fontFamily,this.TEXTAREA.style.backgroundColor=v,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(A,I),maxHeight:I,minWidth:Math.min(R,N),maxWidth:N},!0)}},d.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){(0,h.stopPropagation)(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){(0,h.stopPropagation)(e)}),this.instance.addHook("afterScrollHorizontally",function(){e.refreshDimensions()}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},d.prototype.destroy=function(){this.eventManager.destroy()},t.default=d},function(e,t,n){"use strict";function r(e,t){return"number"==typeof e&&"number"==typeof t?e-t:f(e,t)}function o(e,t){var n=e;return""===n&&(n="("+t+")"),n}function i(e){var t=e;return h&&(t=new Set(t)),function(e){return h?t.has(e):!!~t.indexOf(e)}}function a(e){return null===e||void 0===e?"":e}function s(e){var t=e;return t=d?Array.from(new Set(t)):(0,c.arrayUnique)(t),t=t.sort(function(e,t){return"number"==typeof e&&"number"==typeof t?e-t:e===t?0:e>t?1:-1})}function l(e,t,n,r){var a=[],s=e===t,l=void 0;return s||(l=i(t)),(0,c.arrayEach)(e,function(e){var t=!1;(s||l(e))&&(t=!0);var i={checked:t,value:e,visualValue:o(e,n)};r&&r(i),a.push(i)}),a}t.__esModule=!0,t.sortComparison=r,t.toVisualValue=o,t.createArrayAssertion=i,t.toEmptyString=a,t.unifyColumnValues=s,t.intersectValues=l;var u=n(43),c=n(0),f=(0,u.getComparisonFunction)(),h=new Set([1]).has(1),d=h&&"function"==typeof Array.from},function(e,t,n){"use strict";function r(e){if(!a[e])throw Error('Operation with id "'+e+'" does not exist.');var t=a[e].func;return function(e,n){return t(e,n)}}function o(e){return a[e].name}function i(e,t,n){a[e]={name:t,func:n}}t.__esModule=!0,t.getOperationFunc=r,t.getOperationName=o,t.registerOperation=i;var a=t.operations={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=function(){function e(e,t){for(var n=0;n-1?parseFloat(e):parseInt(e,10)),t}function o(e){return-1*r(e)}t.__esModule=!0,t.toNumber=r,t.invertNumber=o},function(module,exports,__webpack_require__){var utils=__webpack_require__(1),error=__webpack_require__(0),statistical=__webpack_require__(5),information=__webpack_require__(7);exports.ABS=function(e){return(e=utils.parseNumber(e))instanceof Error?e:Math.abs(e)},exports.ACOS=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.acos(e);return isNaN(t)&&(t=error.num),t},exports.ACOSH=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.log(e+Math.sqrt(e*e-1));return isNaN(t)&&(t=error.num),t},exports.ACOT=function(e){return(e=utils.parseNumber(e))instanceof Error?e:Math.atan(1/e)},exports.ACOTH=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=.5*Math.log((e+1)/(e-1));return isNaN(t)&&(t=error.num),t},exports.AGGREGATE=function(e,t,n,r){if(e=utils.parseNumber(e),t=utils.parseNumber(e),utils.anyIsError(e,t))return error.value;switch(e){case 1:return statistical.AVERAGE(n);case 2:return statistical.COUNT(n);case 3:return statistical.COUNTA(n);case 4:return statistical.MAX(n);case 5:return statistical.MIN(n);case 6:return exports.PRODUCT(n);case 7:return statistical.STDEV.S(n);case 8:return statistical.STDEV.P(n);case 9:return exports.SUM(n);case 10:return statistical.VAR.S(n);case 11:return statistical.VAR.P(n);case 12:return statistical.MEDIAN(n);case 13:return statistical.MODE.SNGL(n);case 14:return statistical.LARGE(n,r);case 15:return statistical.SMALL(n,r);case 16:return statistical.PERCENTILE.INC(n,r);case 17:return statistical.QUARTILE.INC(n,r);case 18:return statistical.PERCENTILE.EXC(n,r);case 19:return statistical.QUARTILE.EXC(n,r)}},exports.ARABIC=function(e){if(!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(e))return error.value;var t=0;return e.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,function(e){t+={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1}[e]}),t},exports.ASIN=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.asin(e);return isNaN(t)&&(t=error.num),t},exports.ASINH=function(e){return e=utils.parseNumber(e),e instanceof Error?e:Math.log(e+Math.sqrt(e*e+1))},exports.ATAN=function(e){return e=utils.parseNumber(e),e instanceof Error?e:Math.atan(e)},exports.ATAN2=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:Math.atan2(e,t)},exports.ATANH=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.log((1+e)/(1-e))/2;return isNaN(t)&&(t=error.num),t},exports.BASE=function(e,t,n){if(n=n||0,e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n))return error.value;n=void 0===n?0:n;var r=e.toString(t);return new Array(Math.max(n+1-r.length,0)).join("0")+r},exports.CEILING=function(e,t,n){if(t=void 0===t?1:Math.abs(t),n=n||0,e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n))return error.value;if(0===t)return 0;var r=-Math.floor(Math.log(t)/Math.log(10));return e>=0?exports.ROUND(Math.ceil(e/t)*t,r):0===n?-exports.ROUND(Math.floor(Math.abs(e)/t)*t,r):-exports.ROUND(Math.ceil(Math.abs(e)/t)*t,r)},exports.CEILING.MATH=exports.CEILING,exports.CEILING.PRECISE=exports.CEILING,exports.COMBIN=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:exports.FACT(e)/(exports.FACT(t)*exports.FACT(e-t))},exports.COMBINA=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:0===e&&0===t?1:exports.COMBIN(e+t-1,e-1)},exports.COS=function(e){return e=utils.parseNumber(e),e instanceof Error?e:Math.cos(e)},exports.COSH=function(e){return e=utils.parseNumber(e),e instanceof Error?e:(Math.exp(e)+Math.exp(-e))/2},exports.COT=function(e){return e=utils.parseNumber(e),e instanceof Error?e:1/Math.tan(e)},exports.COTH=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.exp(2*e);return(t+1)/(t-1)},exports.CSC=function(e){return e=utils.parseNumber(e),e instanceof Error?e:1/Math.sin(e)},exports.CSCH=function(e){return e=utils.parseNumber(e),e instanceof Error?e:2/(Math.exp(e)-Math.exp(-e))},exports.DECIMAL=function(e,t){return arguments.length<1?error.value:parseInt(e,t)},exports.DEGREES=function(e){return e=utils.parseNumber(e),e instanceof Error?e:180*e/Math.PI},exports.EVEN=function(e){return e=utils.parseNumber(e),e instanceof Error?e:exports.CEILING(e,-2,-1)},exports.EXP=function(e){return arguments.length<1?error.na:"number"!=typeof e||arguments.length>1?error.error:e=Math.exp(e)};var MEMOIZED_FACT=[];exports.FACT=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.floor(e);return 0===t||1===t?1:MEMOIZED_FACT[t]>0?MEMOIZED_FACT[t]:MEMOIZED_FACT[t]=exports.FACT(t-1)*t},exports.FACTDOUBLE=function(e){if((e=utils.parseNumber(e))instanceof Error)return e;var t=Math.floor(e);return t<=0?1:t*exports.FACTDOUBLE(t-2)},exports.FLOOR=function(e,t){if(e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t))return error.value;if(0===t)return 0;if(!(e>0&&t>0||e<0&&t<0))return error.num;t=Math.abs(t);var n=-Math.floor(Math.log(t)/Math.log(10));return e>=0?exports.ROUND(Math.floor(e/t)*t,n):-exports.ROUND(Math.ceil(Math.abs(e)/t),n)},exports.FLOOR.MATH=function(e,t,n){if(t=void 0===t?1:t,n=void 0===n?0:n,e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n))return error.value;if(0===t)return 0;t=t?Math.abs(t):1;var r=-Math.floor(Math.log(t)/Math.log(10));return e>=0?exports.ROUND(Math.floor(e/t)*t,r):0===n||void 0===n?-exports.ROUND(Math.ceil(Math.abs(e)/t)*t,r):-exports.ROUND(Math.floor(Math.abs(e)/t)*t,r)},exports.FLOOR.PRECISE=exports.FLOOR.MATH,exports.GCD=function(){var e=utils.parseNumberArray(utils.flatten(arguments));if(e instanceof Error)return e;for(var t=e.length,n=e[0],r=n<0?-n:n,o=1;oa?r%=a:a%=r;r+=a}return r},exports.INT=function(e){return e=utils.parseNumber(e),e instanceof Error?e:Math.floor(e)},exports.ISO={CEILING:exports.CEILING},exports.LCM=function(){var e=utils.parseNumberArray(utils.flatten(arguments));if(e instanceof Error)return e;for(var t,n,r,o,i=1;void 0!==(r=e.pop());)for(;r>1;){if(r%2){for(t=3,n=Math.floor(Math.sqrt(r));t<=n&&r%t;t+=2);o=t<=n?t:r}else o=2;for(r/=o,i*=o,t=e.length;t;e[--t]%o==0&&1==(e[t]/=o)&&e.splice(t,1));}return i},exports.LN=function(e){return e=utils.parseNumber(e),e instanceof Error?e:Math.log(e)},exports.LN10=function(){return Math.log(10)},exports.LN2=function(){return Math.log(2)},exports.LOG10E=function(){return Math.LOG10E},exports.LOG2E=function(){return Math.LOG2E},exports.LOG=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:(t=void 0===t?10:t,Math.log(e)/Math.log(t))},exports.LOG10=function(e){return e=utils.parseNumber(e),e instanceof Error?e:Math.log(e)/Math.log(10)},exports.MOD=function(e,t){if(e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t))return error.value;if(0===t)return error.div0;var n=Math.abs(e%t);return t>0?n:-n},exports.MROUND=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:e*t<0?error.num:Math.round(e/t)*t},exports.MULTINOMIAL=function(){var e=utils.parseNumberArray(utils.flatten(arguments));if(e instanceof Error)return e;for(var t=0,n=1,r=0;r0?t:-t},exports.PI=function(){return Math.PI},exports.E=function(){return Math.E},exports.POWER=function(e,t){if(e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t))return error.value;var n=Math.pow(e,t);return isNaN(n)?error.num:n},exports.PRODUCT=function(){var e=utils.parseNumberArray(utils.flatten(arguments));if(e instanceof Error)return e;for(var t=1,n=0;n0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)},exports.ROUNDUP=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:(e>0?1:-1)*Math.ceil(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)},exports.SEC=function(e){return e=utils.parseNumber(e),e instanceof Error?e:1/Math.cos(e)},exports.SECH=function(e){return e=utils.parseNumber(e),e instanceof Error?e:2/(Math.exp(e)+Math.exp(-e))},exports.SERIESSUM=function(e,t,n,r){if(e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),r=utils.parseNumberArray(r),utils.anyIsError(e,t,n,r))return error.value;for(var o=r[0]*Math.pow(e,t),i=1;i=t)},exports.LT=function(e,t){return 2!==arguments.length?error.na:(e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.error:e0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}},function(module,exports,__webpack_require__){var mathTrig=__webpack_require__(4),text=__webpack_require__(6),jStat=__webpack_require__(11).jStat,utils=__webpack_require__(1),error=__webpack_require__(0),misc=__webpack_require__(12);exports.AVEDEV=function(){var e=utils.parseNumberArray(utils.flatten(arguments));return e instanceof Error?e:jStat.sum(jStat(e).subtract(jStat.mean(e)).abs()[0])/e.length},exports.AVERAGE=function(){for(var e,t=utils.numbers(utils.flatten(arguments)),n=t.length,r=0,o=0,i=0;i=n)return r;r++}},exports.CHISQ={},exports.CHISQ.DIST=function(e,t,n){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:n?jStat.chisquare.cdf(e,t):jStat.chisquare.pdf(e,t)},exports.CHISQ.DIST.RT=function(e,t){return!e|!t?error.na:e<1||t>Math.pow(10,10)?error.num:"number"!=typeof e||"number"!=typeof t?error.value:1-jStat.chisquare.cdf(e,t)},exports.CHISQ.INV=function(e,t){return e=utils.parseNumber(e),t=utils.parseNumber(t),utils.anyIsError(e,t)?error.value:jStat.chisquare.inv(e,t)},exports.CHISQ.INV.RT=function(e,t){return!e|!t?error.na:e<0||e>1||t<1||t>Math.pow(10,10)?error.num:"number"!=typeof e||"number"!=typeof t?error.value:jStat.chisquare.inv(1-e,t)},exports.CHISQ.TEST=function(e,t){if(2!==arguments.length)return error.na;if(!(e instanceof Array&&t instanceof Array))return error.value;if(e.length!==t.length)return error.value;if(e[0]&&t[0]&&e[0].length!==t[0].length)return error.value;var n,r,o,i=e.length;for(r=0;r=2;)n=n*e/r,r-=2;for(var o=n,i=t;o>1e-10*n;)i+=2,o=o*e/i,n+=o;return 1-n}(l,s))/1e6},exports.COLUMN=function(e,t){return 2!==arguments.length?error.na:t<0?error.num:e instanceof Array&&"number"==typeof t?0!==e.length?jStat.col(e,t):void 0:error.value},exports.COLUMNS=function(e){return 1!==arguments.length?error.na:e instanceof Array?0===e.length?0:jStat.cols(e):error.value},exports.CONFIDENCE={},exports.CONFIDENCE.NORM=function(e,t,n){return e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n)?error.value:jStat.normalci(1,e,t,n)[1]-1},exports.CONFIDENCE.T=function(e,t,n){return e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n)?error.value:jStat.tci(1,e,t,n)[1]-1},exports.CORREL=function(e,t){return e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(e,t)?error.value:jStat.corrcoeff(e,t)},exports.COUNT=function(){return utils.numbers(utils.flatten(arguments)).length},exports.COUNTA=function(){var e=utils.flatten(arguments);return e.length-exports.COUNTBLANK(e)},exports.COUNTIN=function(e,t){var n=0;e=utils.flatten(e);for(var r=0;r=!]/.test(criteria)||(criteria='=="'+criteria+'"');for(var matches=0,i=0;i=!]/.test(criteria)||(criteria='=="'+criteria+'"');for(var j=0;j1?error.num:jStat.centralF.inv(e,t,n)},exports.F.INV.RT=function(e,t,n){return 3!==arguments.length?error.na:e<0||e>1||t<1||t>Math.pow(10,10)||n<1||n>Math.pow(10,10)?error.num:"number"!=typeof e||"number"!=typeof t||"number"!=typeof n?error.value:jStat.centralF.inv(1-e,t,n)},exports.F.TEST=function(e,t){if(!e||!t)return error.na;if(!(e instanceof Array&&t instanceof Array))return error.na;if(e.length<2||t.length<2)return error.div0;var n=function(e,t){for(var n=0,r=0;rt[i-1]&&e[a]<=t[i]&&(o[i]+=1):i===r&&e[a]>t[r-1]&&(o[r]+=1)}return o},exports.GAMMA=function(e){return e=utils.parseNumber(e),e instanceof Error?e:0===e?error.num:parseInt(e,10)===e&&e<0?error.num:jStat.gammafn(e)},exports.GAMMA.DIST=function(e,t,n,r){return 4!==arguments.length?error.na:e<0||t<=0||n<=0?error.value:"number"!=typeof e||"number"!=typeof t||"number"!=typeof n?error.value:r?jStat.gamma.cdf(e,t,n,!0):jStat.gamma.pdf(e,t,n,!1)},exports.GAMMA.INV=function(e,t,n){return 3!==arguments.length?error.na:e<0||e>1||t<=0||n<=0?error.num:"number"!=typeof e||"number"!=typeof t||"number"!=typeof n?error.value:jStat.gamma.inv(e,t,n)},exports.GAMMALN=function(e){return e=utils.parseNumber(e),e instanceof Error?e:jStat.gammaln(e)},exports.GAMMALN.PRECISE=function(e){return 1!==arguments.length?error.na:e<=0?error.num:"number"!=typeof e?error.value:jStat.gammaln(e)},exports.GAUSS=function(e){return e=utils.parseNumber(e),e instanceof Error?e:jStat.normal.cdf(e,0,1)-.5},exports.GEOMEAN=function(){var e=utils.parseNumberArray(utils.flatten(arguments));return e instanceof Error?e:jStat.geomean(e)},exports.GROWTH=function(e,t,n,r){if((e=utils.parseNumberArray(e))instanceof Error)return e;var o;if(void 0===t)for(t=[],o=1;o<=e.length;o++)t.push(o);if(void 0===n)for(n=[],o=1;o<=e.length;o++)n.push(o);if(t=utils.parseNumberArray(t),n=utils.parseNumberArray(n),utils.anyIsError(t,n))return error.value;void 0===r&&(r=!0);var i=e.length,a=0,s=0,l=0,u=0;for(o=0;oi&&(i=r[t],o=[]),r[t]===i&&(o[o.length]=t);return o},exports.MODE.SNGL=function(){var e=utils.parseNumberArray(utils.flatten(arguments));return e instanceof Error?e:exports.MODE.MULT(e).sort(function(e,t){return e-t})[0]},exports.NEGBINOM={},exports.NEGBINOM.DIST=function(e,t,n,r){return e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n)?error.value:r?jStat.negbin.cdf(e,t,n):jStat.negbin.pdf(e,t,n)},exports.NORM={},exports.NORM.DIST=function(e,t,n,r){return e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n)?error.value:n<=0?error.num:r?jStat.normal.cdf(e,t,n):jStat.normal.pdf(e,t,n)},exports.NORM.INV=function(e,t,n){return e=utils.parseNumber(e),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n)?error.value:jStat.normal.inv(e,t,n)},exports.NORM.S={},exports.NORM.S.DIST=function(e,t){return e=utils.parseNumber(e),e instanceof Error?error.value:t?jStat.normal.cdf(e,0,1):jStat.normal.pdf(e,0,1)},exports.NORM.S.INV=function(e){return e=utils.parseNumber(e),e instanceof Error?error.value:jStat.normal.inv(e,0,1)},exports.PEARSON=function(e,t){if(t=utils.parseNumberArray(utils.flatten(t)),e=utils.parseNumberArray(utils.flatten(e)),utils.anyIsError(t,e))return error.value;for(var n=jStat.mean(e),r=jStat.mean(t),o=e.length,i=0,a=0,s=0,l=0;l1-1/(n+1))return error.num;var r=t*(n+1)-1,o=Math.floor(r);return utils.cleanFloat(r===o?e[r]:e[o]+(r-o)*(e[o+1]-e[o]))},exports.PERCENTILE.INC=function(e,t){if(e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumber(t),utils.anyIsError(e,t))return error.value;e=e.sort(function(e,t){return e-t});var n=e.length,r=t*(n-1),o=Math.floor(r);return utils.cleanFloat(r===o?e[r]:e[o]+(r-o)*(e[o+1]-e[o]))},exports.PERCENTRANK={},exports.PERCENTRANK.EXC=function(e,t,n){if(n=void 0===n?3:n,e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumber(t),n=utils.parseNumber(n),utils.anyIsError(e,t,n))return error.value;e=e.sort(function(e,t){return e-t});for(var r=misc.UNIQUE.apply(null,e),o=e.length,i=r.length,a=Math.pow(10,n),s=0,l=!1,u=0;!l&&u=r[u]&&(t=r[u]&&(t=0?t[e.indexOf(n)]:0;for(var o=e.sort(function(e,t){return e-t}),i=o.length,a=0,s=0;s=n&&o[s]<=r&&(a+=t[e.indexOf(o[s])]);return a},exports.QUARTILE={},exports.QUARTILE.EXC=function(e,t){if(e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumber(t),utils.anyIsError(e,t))return error.value;switch(t){case 1:return exports.PERCENTILE.EXC(e,.25);case 2:return exports.PERCENTILE.EXC(e,.5);case 3:return exports.PERCENTILE.EXC(e,.75);default:return error.num}},exports.QUARTILE.INC=function(e,t){if(e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumber(t),utils.anyIsError(e,t))return error.value;switch(t){case 1:return exports.PERCENTILE.INC(e,.25);case 2:return exports.PERCENTILE.INC(e,.5);case 3:return exports.PERCENTILE.INC(e,.75);default:return error.num}},exports.RANK={},exports.RANK.AVG=function(e,t,n){if(e=utils.parseNumber(e),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(e,t))return error.value;t=utils.flatten(t),n=n||!1,t=t.sort(n?function(e,t){return e-t}:function(e,t){return t-e});for(var r=t.length,o=0,i=0;i1?(2*t.indexOf(e)+o+1)/2:t.indexOf(e)+1},exports.RANK.EQ=function(e,t,n){return e=utils.parseNumber(e),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(e,t)?error.value:(n=n||!1,t=t.sort(n?function(e,t){return e-t}:function(e,t){return t-e}),t.indexOf(e)+1)},exports.ROW=function(e,t){return 2!==arguments.length?error.na:t<0?error.num:e instanceof Array&&"number"==typeof t?0!==e.length?jStat.row(e,t):void 0:error.value},exports.ROWS=function(e){return 1!==arguments.length?error.na:e instanceof Array?0===e.length?0:jStat.rows(e):error.value},exports.RSQ=function(e,t){return e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(e,t)?error.value:Math.pow(exports.PEARSON(e,t),2)},exports.SKEW=function(){var e=utils.parseNumberArray(utils.flatten(arguments));if(e instanceof Error)return e;for(var t=jStat.mean(e),n=e.length,r=0,o=0;o1||t<1?error.num:utils.anyIsError(e,t)?error.value:Math.abs(jStat.studentt.inv(e/2,t))},exports.T.TEST=function(e,t){if(e=utils.parseNumberArray(utils.flatten(e)),t=utils.parseNumberArray(utils.flatten(t)),utils.anyIsError(e,t))return error.value;var n,r=jStat.mean(e),o=jStat.mean(t),i=0,a=0;for(n=0;n-1;)e[t]="TRUE";for(var n=0;(n=e.indexOf(!1))>-1;)e[n]="FALSE";return e.join("")},t.DBCS=function(){throw new Error("DBCS is not implemented")},t.DOLLAR=function(e,t){if(t=void 0===t?2:t,e=r.parseNumber(e),t=r.parseNumber(t),r.anyIsError(e,t))return o.value;var n="";return t<=0?(e=Math.round(e*Math.pow(10,t))/Math.pow(10,t),n="($0,0)"):t>0&&(n="($0,0."+new Array(t+1).join("0")+")"),i(e).format(n)},t.EXACT=function(e,t){return 2!==arguments.length?o.na:e===t},t.FIND=function(e,t,n){return arguments.length<2?o.na:(n=void 0===n?0:n,t?t.indexOf(e,n-1)+1:null)},t.FIXED=function(e,t,n){if(t=void 0===t?2:t,n=void 0!==n&&n,e=r.parseNumber(e),t=r.parseNumber(t),r.anyIsError(e,t))return o.value;var a=n?"0":"0,0";return t<=0?e=Math.round(e*Math.pow(10,t))/Math.pow(10,t):t>0&&(a+="."+new Array(t+1).join("0")),i(e).format(a)},t.HTML2TEXT=function(e){var t="";return e&&(e instanceof Array?e.forEach(function(e){""!==t&&(t+="\n"),t+=e.replace(/<(?:.|\n)*?>/gm,"")}):t=e.replace(/<(?:.|\n)*?>/gm,"")),t},t.LEFT=function(e,t){return t=void 0===t?1:t,t=r.parseNumber(t),t instanceof Error||"string"!=typeof e?o.value:e?e.substring(0,t):null},t.LEN=function(e){return 0===arguments.length?o.error:"string"==typeof e?e?e.length:0:e.length?e.length:o.value},t.LOWER=function(e){return"string"!=typeof e?o.value:e?e.toLowerCase():e},t.MID=function(e,t,n){if(t=r.parseNumber(t),n=r.parseNumber(n),r.anyIsError(t,n)||"string"!=typeof e)return n;var o=t-1;return e.substring(o,o+n)},t.NUMBERVALUE=function(e,t,n){return t=void 0===t?".":t,n=void 0===n?",":n,Number(e.replace(t,".").replace(n,""))},t.PRONETIC=function(){throw new Error("PRONETIC is not implemented")},t.PROPER=function(e){return void 0===e||0===e.length?o.value:(!0===e&&(e="TRUE"),!1===e&&(e="FALSE"),isNaN(e)&&"number"==typeof e?o.value:("number"==typeof e&&(e=""+e),e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})))},t.REGEXEXTRACT=function(e,t){if(arguments.length<2)return o.na;var n=e.match(new RegExp(t));return n?n[n.length>1?n.length-1:0]:null},t.REGEXMATCH=function(e,t,n){if(arguments.length<2)return o.na;var r=e.match(new RegExp(t));return n?r:!!r},t.REGEXREPLACE=function(e,t,n){return arguments.length<3?o.na:e.replace(new RegExp(t),n)},t.REPLACE=function(e,t,n,i){return t=r.parseNumber(t),n=r.parseNumber(n),r.anyIsError(t,n)||"string"!=typeof e||"string"!=typeof i?o.value:e.substr(0,t-1)+i+e.substr(t-1+n)},t.REPT=function(e,t){return t=r.parseNumber(t),t instanceof Error?t:new Array(t+1).join(e)},t.RIGHT=function(e,t){return t=void 0===t?1:t,t=r.parseNumber(t),t instanceof Error?t:e?e.substring(e.length-t):o.na},t.SEARCH=function(e,t,n){var r;return"string"!=typeof e||"string"!=typeof t?o.value:(n=void 0===n?0:n,r=t.toLowerCase().indexOf(e.toLowerCase(),n-1)+1,0===r?o.value:r)},t.SPLIT=function(e,t){return e.split(t)},t.SUBSTITUTE=function(e,t,n,r){if(arguments.length<2)return o.na;if(!(e&&t&&n))return e;if(void 0===r)return e.replace(new RegExp(t,"g"),n);for(var i=0,a=0;e.indexOf(t,i)>0;)if(i=e.indexOf(t,i+1),++a===r)return e.substring(0,i)+n+e.substring(i+t.length)},t.T=function(e){return"string"==typeof e?e:""},t.TEXT=function(e,t){return e=r.parseNumber(e),r.anyIsError(e)?o.na:i(e).format(t)},t.TRIM=function(e){return"string"!=typeof e?o.value:e.replace(/ +/g," ").trim()},t.UNICHAR=t.CHAR,t.UNICODE=t.CODE,t.UPPER=function(e){return"string"!=typeof e?o.value:e.toUpperCase()},t.VALUE=function(e){if("string"!=typeof e)return o.value;var t=i().unformat(e);return void 0===t?0:t}},function(e,t,n){var r=n(0);t.CELL=function(){throw new Error("CELL is not implemented")},t.ERROR={},t.ERROR.TYPE=function(e){switch(e){case r.nil:return 1;case r.div0:return 2;case r.value:return 3;case r.ref:return 4;case r.name:return 5;case r.num:return 6;case r.na:return 7;case r.data:return 8}return r.na},t.INFO=function(){throw new Error("INFO is not implemented")},t.ISBLANK=function(e){return null===e},t.ISBINARY=function(e){return/^[01]{1,10}$/.test(e)},t.ISERR=function(e){return[r.value,r.ref,r.div0,r.num,r.name,r.nil].indexOf(e)>=0||"number"==typeof e&&(isNaN(e)||!isFinite(e))},t.ISERROR=function(e){return t.ISERR(e)||e===r.na},t.ISEVEN=function(e){return!(1&Math.floor(Math.abs(e)))},t.ISFORMULA=function(){throw new Error("ISFORMULA is not implemented")},t.ISLOGICAL=function(e){return!0===e||!1===e},t.ISNA=function(e){return e===r.na},t.ISNONTEXT=function(e){return"string"!=typeof e},t.ISNUMBER=function(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)},t.ISODD=function(e){return!!(1&Math.floor(Math.abs(e)))},t.ISREF=function(){throw new Error("ISREF is not implemented")},t.ISTEXT=function(e){return"string"==typeof e},t.N=function(e){return this.ISNUMBER(e)?e:e instanceof Date?e.getTime():!0===e?1:!1===e?0:this.ISERROR(e)?e:0},t.NA=function(){return r.na},t.SHEET=function(){throw new Error("SHEET is not implemented")},t.SHEETS=function(){throw new Error("SHEETS is not implemented")},t.TYPE=function(e){return this.ISNUMBER(e)?1:this.ISTEXT(e)?2:this.ISLOGICAL(e)?4:this.ISERROR(e)?16:Array.isArray(e)?64:void 0}},function(e,t,n){function r(e){return 1===new Date(e,1,29).getMonth()}function o(e,t){return Math.ceil((t-e)/1e3/60/60/24)}function i(e){return(e-l)/864e5+(e>-22038912e5?2:1)}var a=n(0),s=n(1),l=new Date(1900,0,1),u=[void 0,0,1,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,1,2,3,4,5,6,0],c=[[],[1,2,3,4,5,6,7],[7,1,2,3,4,5,6],[6,0,1,2,3,4,5],[],[],[],[],[],[],[],[7,1,2,3,4,5,6],[6,7,1,2,3,4,5],[5,6,7,1,2,3,4],[4,5,6,7,1,2,3],[3,4,5,6,7,1,2],[2,3,4,5,6,7,1],[1,2,3,4,5,6,7]],f=[[],[6,0],[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],void 0,void 0,void 0,[0,0],[1,1],[2,2],[3,3],[4,4],[5,5],[6,6]];t.DATE=function(e,t,n){return e=s.parseNumber(e),t=s.parseNumber(t),n=s.parseNumber(n),s.anyIsError(e,t,n)?a.value:e<0||t<0||n<0?a.num:new Date(e,t-1,n)},t.DATEVALUE=function(e){if("string"!=typeof e)return a.value;var t=Date.parse(e);return isNaN(t)?a.value:t<=-22038912e5?(t-l)/864e5+1:(t-l)/864e5+2},t.DAY=function(e){var t=s.parseDate(e);return t instanceof Error?t:t.getDate()},t.DAYS=function(e,t){return e=s.parseDate(e),t=s.parseDate(t),e instanceof Error?e:t instanceof Error?t:i(e)-i(t)},t.DAYS360=function(e,t,n){if(n=s.parseBool(n),e=s.parseDate(e),t=s.parseDate(t),e instanceof Error)return e;if(t instanceof Error)return t;if(n instanceof Error)return n;var r,o,i=e.getMonth(),a=t.getMonth();if(n)r=31===e.getDate()?30:e.getDate(),o=31===t.getDate()?30:t.getDate();else{var l=new Date(e.getFullYear(),i+1,0).getDate(),u=new Date(t.getFullYear(),a+1,0).getDate();r=e.getDate()===l?30:e.getDate(),t.getDate()===u?r<30?(a++,o=1):o=30:o=t.getDate()}return 360*(t.getFullYear()-e.getFullYear())+30*(a-i)+(o-r)},t.EDATE=function(e,t){return(e=s.parseDate(e))instanceof Error?e:isNaN(t)?a.value:(t=parseInt(t,10),e.setMonth(e.getMonth()+t),i(e))},t.EOMONTH=function(e,t){return(e=s.parseDate(e))instanceof Error?e:isNaN(t)?a.value:(t=parseInt(t,10),i(new Date(e.getFullYear(),e.getMonth()+t+1,0)))},t.HOUR=function(e){return e=s.parseDate(e),e instanceof Error?e:e.getHours()},t.INTERVAL=function(e){if("number"!=typeof e&&"string"!=typeof e)return a.value;e=parseInt(e,10);var t=Math.floor(e/94608e4);e%=94608e4;var n=Math.floor(e/2592e3);e%=2592e3;var r=Math.floor(e/86400);e%=86400;var o=Math.floor(e/3600);e%=3600;var i=Math.floor(e/60);e%=60;var s=e;return t=t>0?t+"Y":"",n=n>0?n+"M":"",r=r>0?r+"D":"",o=o>0?o+"H":"",i=i>0?i+"M":"",s=s>0?s+"S":"","P"+t+n+r+"T"+o+i+s},t.ISOWEEKNUM=function(e){if((e=s.parseDate(e))instanceof Error)return e;e.setHours(0,0,0),e.setDate(e.getDate()+4-(e.getDay()||7));var t=new Date(e.getFullYear(),0,1);return Math.ceil(((e-t)/864e5+1)/7)},t.MINUTE=function(e){return e=s.parseDate(e),e instanceof Error?e:e.getMinutes()},t.MONTH=function(e){return e=s.parseDate(e),e instanceof Error?e:e.getMonth()+1},t.NETWORKDAYS=function(e,t,n){return this.NETWORKDAYS.INTL(e,t,1,n)},t.NETWORKDAYS.INTL=function(e,t,n,r){if((e=s.parseDate(e))instanceof Error)return e;if((t=s.parseDate(t))instanceof Error)return t;if(!((n=void 0===n?f[1]:f[n])instanceof Array))return a.value;void 0===r?r=[]:r instanceof Array||(r=[r]);for(var o=0;o0?c.getUTCDay():c.getDay(),d=!1;h!==n[0]&&h!==n[1]||(d=!0);for(var p=0;pc||a===c&&i>=u))return(l===f&&r(l)||function(e,t){var n=e.getFullYear(),o=new Date(n,2,1);if(r(n)&&e=o)return!0;var i=t.getFullYear(),a=new Date(i,2,1);return r(i)&&t>=a&&e0?c=r+o+l(i-o.length):(a=+r<0?"-0":"0",t>0&&(a+="."),u=l(-1*i-1),s=(u+Math.abs(r)+o).substr(0,t),c=a+s),+i>0&&t>0&&(c+="."+l(t)),c}function c(e,t,n,r){var o,i,a=Math.pow(10,t);return e.toString().indexOf("e")>-1?(i=u(e,t),"-"===i.charAt(0)&&+i>=0&&(i=i.substr(1))):i=(n(e+"e+"+t)/a).toFixed(t),r&&(o=new RegExp("0{1,"+r+"}$"),i=i.replace(o,"")),i}function f(e,t,n){var r=t.replace(/\{[^\{\}]*\}/g,"");return r.indexOf("$")>-1?d(e,k[A].currency.symbol,t,n):r.indexOf("%")>-1?g(e,t,n):r.indexOf(":")>-1?v(e):w(e._value,t,n)}function h(e,t){var n,r,o,i,a,s=t,l=!1;if(t.indexOf(":")>-1)e._value=m(t);else if(t===I)e._value=0;else{for("."!==k[A].delimiters.decimal&&(t=t.replace(/\./g,"").replace(k[A].delimiters.decimal,".")),n=new RegExp("[^a-zA-Z]"+k[A].abbreviations.thousand+"(?:\\)|(\\"+k[A].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+k[A].abbreviations.million+"(?:\\)|(\\"+k[A].currency.symbol+")?(?:\\))?)?$"),o=new RegExp("[^a-zA-Z]"+k[A].abbreviations.billion+"(?:\\)|(\\"+k[A].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+k[A].abbreviations.trillion+"(?:\\)|(\\"+k[A].currency.symbol+")?(?:\\))?)?$"),a=1;a-1?l=Math.pow(1024,a):t.indexOf(T[a])>-1&&(l=Math.pow(1e3,a));var u=t.replace(/[^0-9\.]+/g,"");""===u?e._value=NaN:(e._value=(l||1)*(s.match(n)?Math.pow(10,3):1)*(s.match(r)?Math.pow(10,6):1)*(s.match(o)?Math.pow(10,9):1)*(s.match(i)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(u),e._value=l?Math.ceil(e._value):e._value)}return e._value}function d(e,t,n,r){var o,i,a=n,s=a.indexOf("$"),l=a.indexOf("("),u=a.indexOf("+"),c=a.indexOf("-"),f="",h="";if(-1===a.indexOf("$")?"infix"===k[A].currency.position?(h=t,k[A].currency.spaceSeparated&&(h=" "+h+" ")):k[A].currency.spaceSeparated&&(f=" "):a.indexOf(" $")>-1?(f=" ",a=a.replace(" $","")):a.indexOf("$ ")>-1?(f=" ",a=a.replace("$ ","")):a=a.replace("$",""),i=w(e._value,a,r,h),-1===n.indexOf("$"))switch(k[A].currency.position){case"postfix":i.indexOf(")")>-1?(i=i.split(""),i.splice(-1,0,f+t),i=i.join("")):i=i+f+t;break;case"infix":break;case"prefix":i.indexOf("(")>-1||i.indexOf("-")>-1?(i=i.split(""),o=Math.max(l,c)+1,i.splice(o,0,t+f),i=i.join("")):i=t+f+i;break;default:throw Error('Currency position should be among ["prefix", "infix", "postfix"]')}else s<=1?i.indexOf("(")>-1||i.indexOf("+")>-1||i.indexOf("-")>-1?(i=i.split(""),o=1,(s-1?(i=i.split(""),i.splice(-1,0,f+t),i=i.join("")):i=i+f+t;return i}function p(e,t,n,r){return d(e,t,n,r)}function g(e,t,n){var r,o="",i=100*e._value;return t.indexOf(" %")>-1?(o=" ",t=t.replace(" %","")):t=t.replace("%",""),r=w(i,t,n),r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,o+"%"),r=r.join("")):r=r+o+"%",r}function v(e){var t=Math.floor(e._value/60/60),n=Math.floor((e._value-60*t*60)/60),r=Math.round(e._value-60*t*60-60*n);return t+":"+(n<10?"0"+n:n)+":"+(r<10?"0"+r:r)}function m(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}function y(e,t,n){var r,o,i,a=t[0],s=Math.abs(e);if(s>=n){for(r=1;r=o&&s-1?(O=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(S=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(p=t.split(".")[0].match(/[0-9]+/g)||["0"],p=parseInt(p[0],10),N=t.indexOf("aK")>=0,D=t.indexOf("aM")>=0,P=t.indexOf("aB")>=0,x=t.indexOf("aT")>=0,L=N||D||P||x,t.indexOf(" a")>-1?(R=" ",t=t.replace(" a","")):t=t.replace("a",""),a=s(e),f=a%3,f=0===f?3:f,p&&0!==F&&(h=3*~~((Math.min(p,a)-f)/3),F/=Math.pow(10,h)),a!==p&&(F>=Math.pow(10,12)&&!L||x?(R+=k[A].abbreviations.trillion,e/=Math.pow(10,12)):F=Math.pow(10,9)&&!L||P?(R+=k[A].abbreviations.billion,e/=Math.pow(10,9)):F=Math.pow(10,6)&&!L||D?(R+=k[A].abbreviations.million,e/=Math.pow(10,6)):(F=Math.pow(10,3)&&!L||N)&&(R+=k[A].abbreviations.thousand,e/=Math.pow(10,3))),u=s(e),p&&u-1){t.indexOf(" "+o.marker)>-1&&(H=" "),t=t.replace(H+o.marker,""),i=y(e,o.suffixes,o.scale),e=i.value,H+=i.suffix;break}if(t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(j=" ",t=t.replace(" o","")):t=t.replace("o",""),k[A].ordinal&&(j+=k[A].ordinal(e))),t.indexOf("[.]")>-1&&(T=!0,t=t.replace("[.]",".")),g=t.split(".")[1],w=t.indexOf(","),g){var z=[];if(-1!==g.indexOf("*")?(V=e.toString(),z=V.split("."),z.length>1&&(V=c(e,z[1].length,n))):g.indexOf("[")>-1?(g=g.replace("]",""),g=g.split("["),V=c(e,g[0].length+g[1].length,n,g[1].length)):V=c(e,g.length,n),z=V.split("."),d=z[0],z.length>1&&z[1].length){V=(r?R+r:k[A].delimiters.decimal)+z[1]}else V="";T&&0===Number(V.slice(1))&&(V="")}else d=c(e,0,n);return d.indexOf("-")>-1&&(d=d.slice(1),W=!0),d.length<_&&(d=l(_-d.length)+d),w>-1&&(d=d.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+k[A].delimiters.thousands)),0===t.indexOf(".")&&(d=""),b=t.indexOf("("),C=t.indexOf("-"),U=br?n:r},-1/0)}var O,S=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],T=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],R={general:{scale:1024,suffixes:T,marker:"bd"},binary:{scale:1024,suffixes:S,marker:"b"},decimal:{scale:1e3,suffixes:T,marker:"d"}},M=[R.general,R.binary,R.decimal],k={},N=k,A="en-US",I=null,D="0,0",P="0$",x=void 0!==e&&e.exports,L={delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$",position:"prefix"},defaults:{currencyFormat:",0000 a"},formats:{fourDigits:"0000 a",fullWithTwoDecimals:"$ ,0.00",fullWithTwoDecimalsNoCurrency:",0.00"}};O=function(e){return e=O.isNumbro(e)?e.value():"string"==typeof e||"number"==typeof e?O.fn.unformat(e):NaN,new a(Number(e))},O.version="1.11.1",O.isNumbro=function(e){return e instanceof a},O.setLanguage=function(e,t){console.warn("`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead");var n=e,r=e.split("-")[0],o=null;N[n]||(Object.keys(N).forEach(function(e){o||e.split("-")[0]!==r||(o=e)}),n=o||t||"en-US"),C(n)},O.setCulture=function(e,t){var n=e,r=e.split("-")[1],o=null;k[n]||(r&&Object.keys(k).forEach(function(e){o||e.split("-")[1]!==r||(o=e)}),n=o||t||"en-US"),C(n)},O.language=function(e,t){if(console.warn("`language` is deprecated since version 1.6.0. Use `culture` instead"),!e)return A;if(e&&!t){if(!N[e])throw new Error("Unknown language : "+e);C(e)}return!t&&N[e]||b(e,t),O},O.culture=function(e,t){if(!e)return A;if(e&&!t){if(!k[e])throw new Error("Unknown culture : "+e);C(e)}return!t&&k[e]||b(e,t),O},O.languageData=function(e){if(console.warn("`languageData` is deprecated since version 1.6.0. Use `cultureData` instead"),!e)return N[A];if(!N[e])throw new Error("Unknown language : "+e);return N[e]},O.cultureData=function(e){if(!e)return k[A];if(!k[e])throw new Error("Unknown culture : "+e);return k[e]},O.culture("en-US",L),O.languages=function(){return console.warn("`languages` is deprecated since version 1.6.0. Use `cultures` instead"),N},O.cultures=function(){return k},O.zeroFormat=function(e){I="string"==typeof e?e:null},O.defaultFormat=function(e){D="string"==typeof e?e:"0.0"},O.defaultCurrencyFormat=function(e){P="string"==typeof e?e:"0$"},O.validate=function(e,t){var n,r,o,i,a,s,l,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numbro.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),e=e.replace(/^[+-]?/,""),e.match(/^\d+$/))return!0;if(""===e)return!1;try{l=O.cultureData(t)}catch(e){l=O.cultureData(O.culture())}return o=l.currency.symbol,a=l.abbreviations,n=l.delimiters.decimal,r="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,(null===(u=e.match(/^[^\d\.\,]+/))||(e=e.substr(1),u[0]===o))&&((null===(u=e.match(/[^\d]+$/))||(e=e.slice(0,-1),u[0]===a.thousand||u[0]===a.million||u[0]===a.billion||u[0]===a.trillion))&&(s=new RegExp(r+"{2}"),!e.match(/[^\d.,]/g)&&(i=e.split(n),!(i.length>2)&&(i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(s):""===i[0]?!i[0].match(s)&&!!i[1].match(/^\d+$/):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(s)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(s)&&!!i[1].match(/^\d+$/)))))},O.loadLanguagesInNode=function(){console.warn("`loadLanguagesInNode` is deprecated since version 1.6.0. Use `loadCulturesInNode` instead"),O.loadCulturesInNode()},O.loadCulturesInNode=function(){var e=n(27);for(var t in e)t&&O.culture(t,e[t])},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||void 0===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,r,o=this.length>>>0,i=!1;for(1n;++n)this.hasOwnProperty(n)&&(i?r=e(r,this[n],n,this):(r=this[n],i=!0));if(!i)throw new TypeError("Reduce of empty array with no initial value");return r}),O.fn=a.prototype={clone:function(){return O(this)},format:function(e,t){return f(this,e||D,void 0!==t?t:Math.round)},formatCurrency:function(e,t){return d(this,k[A].currency.symbol,e||P,void 0!==t?t:Math.round)},formatForeignCurrency:function(e,t,n){return p(this,e,t||P,void 0!==n?n:Math.round)},unformat:function(e){if("number"==typeof e)return e;if("string"==typeof e){var t=h(this,e);return isNaN(t)?void 0:t}},binaryByteUnits:function(){return y(this._value,R.binary.suffixes,R.binary.scale).suffix},byteUnits:function(){return y(this._value,R.general.suffixes,R.general.scale).suffix},decimalByteUnits:function(){return y(this._value,R.decimal.suffixes,R.decimal.scale).suffix},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t){return e+n*t}var n=E.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/n,this},subtract:function(e){function t(e,t){return e-n*t}var n=E.call(null,this._value,e);return this._value=[e].reduce(t,this._value*n)/n,this},multiply:function(e){function t(e,t){var n=E(e,t),r=e*n;return r*=t*n,r/=n*n}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t){var n=E(e,t);return e*n/(t*n)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(O(this._value).subtract(e).value())}},function(){return void 0!==r&&void 0===r.browser&&r.title&&(-1!==r.title.indexOf("node")||r.title.indexOf("meteor-tool")>0||"grunt"===r.title||"gulp"===r.title)&&!0}()&&O.loadCulturesInNode(),x?e.exports=O:("undefined"==typeof ender&&(this.numbro=O),o=[],void 0!==(i=function(){return O}.apply(t,o))&&(e.exports=i))}).call("undefined"==typeof window?this:window)}).call(t,n(10))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(f===clearTimeout)return clearTimeout(e);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function a(){g&&d&&(g=!1,d.length?p=d.concat(p):v=-1,p.length&&s())}function s(){if(!g){var e=o(a);g=!0;for(var t=p.length;t;){for(d=p,p=[];++v1)for(var n=1;nn?t:n;return e.pow(10,17-~~(e.log(r>0?r:-r)*e.LOG10E))}function r(e){return"[object Function]"===d.call(e)}function o(e){return"number"==typeof e&&e===e}function a(e){return f.apply([],e)}function s(){return new s._init(arguments)}function l(){return 0}function u(){return 1}function c(e,t){return e===t?1:0}var f=Array.prototype.concat,h=Array.prototype.slice,d=Object.prototype.toString,p=Array.isArray||function(e){return"[object Array]"===d.call(e)};s.fn=s.prototype,s._init=function(e){var t;if(p(e[0]))if(p(e[0][0])){r(e[1])&&(e[0]=s.map(e[0],e[1]));for(var t=0;t=0;t--,r++)n[r]=[e[r][t]];return n},s.transpose=function(e){var t,n,r,o,i,a=[];p(e[0])||(e=[e]),n=e.length,r=e[0].length;for(var i=0;i0&&(a[r][0]=e[r][0]),s=1;sn&&r>0)return[];if(r>0)for(i=e;in;i+=r)o.push(i);return o},s.slice=function(){function e(e,n,r,o){var i,a=[],l=e.length;if(n===t&&r===t&&o===t)return s.copy(e);if(n=n||0,r=r||e.length,n=n>=0?n:l+n,r=r>=0?r:l+r,o=o||1,n===r||0===o)return[];if(nr&&o>0)return[];if(o>0)for(i=n;ir;i+=o)a.push(e[i]);return a}function n(t,n){if(n=n||{},o(n.row)){if(o(n.col))return t[n.row][n.col];var r=s.rowa(t,n.row),i=n.col||{};return e(r,i.start,i.end,i.step)}if(o(n.col)){var a=s.cola(t,n.col),l=n.row||{};return e(a,l.start,l.end,l.step)}var l=n.row||{},i=n.col||{};return e(t,l.start,l.end,l.step).map(function(t){return e(t,i.start,i.end,i.step)})}return n}(),s.sliceAssign=function(n,r,i){if(o(r.row)){if(o(r.col))return n[r.row][r.col]=i;r.col=r.col||{},r.col.start=r.col.start||0,r.col.end=r.col.end||n[0].length,r.col.step=r.col.step||1;var a=s.arange(r.col.start,e.min(n.length,r.col.end),r.col.step),l=r.row;return a.forEach(function(e,t){n[l][e]=i[t]}),n}if(o(r.col)){r.row=r.row||{},r.row.start=r.row.start||0,r.row.end=r.row.end||n.length,r.row.step=r.row.step||1;var u=s.arange(r.row.start,e.min(n[0].length,r.row.end),r.row.step),c=r.col;return u.forEach(function(e,t){n[e][c]=i[t]}),n}i[0].length===t&&(i=[i]),r.row.start=r.row.start||0,r.row.end=r.row.end||n.length,r.row.step=r.row.step||1,r.col.start=r.col.start||0,r.col.end=r.col.end||n[0].length,r.col.step=r.col.step||1;var u=s.arange(r.row.start,e.min(n.length,r.row.end),r.row.step),a=s.arange(r.col.start,e.min(n[0].length,r.col.end),r.col.step);return u.forEach(function(e,t){a.forEach(function(r,o){n[e][r]=i[t][o]})}),n},s.diagonal=function(e){var t=s.zeros(e.length,e.length);return e.forEach(function(e,n){t[n][n]=e}),t},s.copy=function(e){return e.map(function(e){return o(e)?e:e.map(function(e){return e})})};var g=s.prototype;return g.length=0,g.push=Array.prototype.push,g.sort=Array.prototype.sort,g.splice=Array.prototype.splice,g.slice=Array.prototype.slice,g.toArray=function(){return this.length>1?h.call(this):h.call(this)[0]},g.map=function(e,t){return s(s.map(this,e,t))},g.cumreduce=function(e,t){return s(s.cumreduce(this,e,t))},g.alter=function(e){return s.alter(this,e),this},function(e){for(var t=0;t=0;)t+=e[n];return t},e.sumsqrd=function(e){for(var t=0,n=e.length;--n>=0;)t+=e[n]*e[n];return t},e.sumsqerr=function(t){for(var n,r=e.mean(t),o=0,i=t.length;--i>=0;)n=t[i]-r,o+=n*n;return o},e.sumrow=function(e){for(var t=0,n=e.length;--n>=0;)t+=e[n];return t},e.product=function(e){for(var t=1,n=e.length;--n>=0;)t*=e[n];return t},e.min=function(e){for(var t=e[0],n=0;++nt&&(t=e[n]);return t},e.unique=function(e){for(var t={},n=[],r=0;ra?(l=[o[t]],a=i,s=0):i===a&&(l.push(o[t]),s++),i=1);return 0===s?l[0]:l},e.range=function(t){return e.max(t)-e.min(t)},e.variance=function(t,n){return e.sumsqerr(t)/(t.length-(n?1:0))},e.pooledvariance=function(t){return t.reduce(function(t,n){return t+e.sumsqerr(n)},0)/(t.reduce(function(e,t){return e+t.length},0)-t.length)},e.deviation=function(t){for(var n=e.mean(t),r=t.length,o=new Array(r),i=0;i=0;i--)o.push(t.abs(n[i]-r));return e.mean(o)},e.meddev=function(n){for(var r=e.median(n),o=[],i=n.length-1;i>=0;i--)o.push(t.abs(n[i]-r));return e.median(o)},e.coeffvar=function(t){return e.stdev(t)/e.mean(t)},e.quartiles=function(e){var r=e.length,o=e.slice().sort(n);return[o[t.round(r/4)-1],o[t.round(r/2)-1],o[t.round(3*r/4)-1]]},e.quantiles=function(e,o,i,a){var s,l,u,c,f,h,d=e.slice().sort(n),p=[o.length],g=e.length;void 0===i&&(i=3/8),void 0===a&&(a=3/8);for(var s=0;s1){for(l=!0===n?this:this.transpose();s1){for("sumrow"!==t&&(l=!0===n?this:this.transpose());s1){for(a=a.transpose();rh)for(var n=0;n=1?n:1/n)+.4*n+17);if(r<0||n<=0)return NaN;if(r170||r>170?t.exp(e.combinationln(n,r)):e.factorial(n)/e.factorial(r)/e.factorial(n-r)},e.combinationln=function(t,n){return e.factorialln(t)-e.factorialln(n)-e.factorialln(t-n)},e.permutation=function(t,n){return e.factorial(t)/e.factorial(t-n)},e.betafn=function(n,r){if(!(n<=0||r<=0))return n+r>170?t.exp(e.betaln(n,r)):e.gammafn(n)*e.gammafn(r)/e.gammafn(n+r)},e.betaln=function(t,n){return e.gammaln(t)+e.gammaln(n)-e.gammaln(t+n)},e.betacf=function(e,n,r){var o,i,a,s,l=1,u=n+r,c=n+1,f=n-1,h=1,d=1-u*e/c;for(t.abs(d)<1e-30&&(d=1e-30),d=1/d,s=d;l<=100&&(o=2*l,i=l*(r-l)*e/((f+o)*(n+o)),d=1+i*d,t.abs(d)<1e-30&&(d=1e-30),h=1+i/h,t.abs(h)<1e-30&&(h=1e-30),d=1/d,s*=d*h,i=-(n+l)*(u+l)*e/((n+o)*(c+o)),d=1+i*d,t.abs(d)<1e-30&&(d=1e-30),h=1+i/h,t.abs(h)<1e-30&&(h=1e-30),d=1/d,a=d*h,s*=a,!(t.abs(a-1)<3e-7));l++);return s},e.gammapinv=function(n,r){var o,i,a,s,l,u,c,f=0,h=r-1,d=e.gammaln(r);if(n>=1)return t.max(100,r+100*t.sqrt(r));if(n<=0)return 0;for(r>1?(u=t.log(h),c=t.exp(h*(u-1)-d),l=n<.5?n:1-n,a=t.sqrt(-2*t.log(l)),o=(2.30753+.27061*a)/(1+a*(.99229+.04481*a))-a,n<.5&&(o=-o),o=t.max(.001,r*t.pow(1-1/(9*r)-o/(3*t.sqrt(r)),3))):(a=1-r*(.253+.12*r),o=n1?c*t.exp(-(o-h)+h*(t.log(o)-u)):t.exp(-o+h*t.log(o)-d),s=i/a,o-=a=s/(1-.5*t.min(1,s*((r-1)/o-1))),o<=0&&(o=.5*(o+a)),t.abs(a)<1e-8*o)break}return o},e.erf=function(e){var n,r,o,i,a=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,9.6467911e-11,2.394038e-12,-6.886027e-12,8.94487e-13,3.13092e-13,-1.12708e-13,3.81e-16,7.106e-15,-1.523e-15,-9.4e-17,1.21e-16,-2.8e-17],s=a.length-1,l=!1,u=0,c=0;for(e<0&&(e=-e,l=!0),n=2/(2+e),r=4*n-2;s>0;s--)o=u,u=r*u-c+a[s],c=o;return i=n*t.exp(-e*e+.5*(a[0]+r*u)-c),l?i-1:1-i},e.erfc=function(t){return 1-e.erf(t)},e.erfcinv=function(n){var r,o,i,a,s=0;if(n>=2)return-100;if(n<=0)return 100;for(a=n<1?n:2-n,i=t.sqrt(-2*t.log(a/2)),r=-.70711*((2.30753+.27061*i)/(1+i*(.99229+.04481*i))-i);s<2;s++)o=e.erfc(r)-a,r+=o/(1.1283791670955126*t.exp(-r*r)-r*o);return n<1?r:-r},e.ibetainv=function(n,r,o){var i,a,s,l,u,c,f,h,d,p,g,v=r-1,m=o-1,y=0;if(n<=0)return 0;if(n>=1)return 1;for(r>=1&&o>=1?(s=n<.5?n:1-n,l=t.sqrt(-2*t.log(s)),f=(2.30753+.27061*l)/(1+l*(.99229+.04481*l))-l,n<.5&&(f=-f),h=(f*f-3)/6,d=2/(1/(2*r-1)+1/(2*o-1)),p=f*t.sqrt(h+d)/d-(1/(2*o-1)-1/(2*r-1))*(h+5/6-2/(3*d)),f=r/(r+o*t.exp(2*p))):(i=t.log(r/(r+o)),a=t.log(o/(r+o)),l=t.exp(r*i)/r,u=t.exp(o*a)/o,p=l+u,f=n=1&&(f=.5*(f+l+1)),t.abs(l)<1e-8*f&&y>0)break}return f},e.ibeta=function(n,r,o){var i=0===n||1===n?0:t.exp(e.gammaln(r+o)-e.gammaln(r)-e.gammaln(o)+r*t.log(n)+o*t.log(1-n));return!(n<0||n>1)&&(n<(r+1)/(r+o+2)?i*e.betacf(n,r,o)/r:1-i*e.betacf(1-n,o,r)/o)},e.randn=function(n,r){var o,i,a,s,l;if(r||(r=n),n)return e.create(n,r,function(){return e.randn()});do{o=t.random(),i=1.7156*(t.random()-.5),a=o-.449871,s=t.abs(i)+.386595,l=a*a+s*(.196*s-.25472*a)}while(l>.27597&&(l>.27846||i*i>-4*t.log(o)*o*o));return i/o},e.randg=function(n,r,o){var i,a,s,l,u,c,f=n;if(o||(o=r),n||(n=1),r)return c=e.zeros(r,o),c.alter(function(){return e.randg(n)}),c;n<1&&(n+=1),i=n-1/3,a=1/t.sqrt(9*i);do{do{u=e.randn(),l=1+a*u}while(l<=0);l*=l*l,s=t.random()}while(s>1-.331*t.pow(u,4)&&t.log(s)>.5*u*u+i*(1-l+t.log(l)));if(n==f)return i*l;do{s=t.random()}while(0===s);return t.pow(s,1/f)*i*l},function(t){for(var n=0;n=8)return 1;var l=2*e.normal.cdf(s,0,1,1,0)-1;l=l>=t.exp(-50/o)?t.pow(l,o):0;var u;u=n>3?2:3;for(var c=s,f=(8-s)/u,h=c+f,d=0,p=o-1,g=1;g<=u;g++){for(var v=0,m=.5*(h+c),y=.5*(h-c),w=1;w<=12;w++){var b,C;660)break;var S=2*e.normal.cdf(E,0,1,1,0),T=2*e.normal.cdf(E,n,1,1,0),R=.5*S-.5*T;R>=t.exp(-30/p)&&(R=a[b-1]*t.exp(-.5*O)*t.pow(R,p),v+=R)}v*=2*y*o/t.sqrt(2*t.PI),d+=v,c=h,h+=f}return(l+=d)<=t.exp(-30/r)?0:(l=t.pow(l,r),l>=1?1:l)}function o(e,n,r){var o=.5-.5*e,i=t.sqrt(t.log(1/(o*o))),a=i+((((-453642210148e-16*i-.204231210125)*i-.342242088547)*i-1)*i+.322232421088)/((((.0038560700634*i+.10353775285)*i+.531103462366)*i+.588581570495)*i+.099348462606);r<120&&(a+=(a*a*a+a)/r/4);var s=.8832-.2368*a;return r<120&&(s+=-1.214/r+1.208*a/r),a*(s*t.log(n-1)+1.4142)}!function(t){for(var n=0;n1||n<0?0:1==r&&1==o?1:r<512&&o<512?t.pow(n,r-1)*t.pow(1-n,o-1)/e.betafn(r,o):t.exp((r-1)*t.log(n)+(o-1)*t.log(1-n)-e.betaln(r,o))},cdf:function(t,n,r){return t>1||t<0?1*(t>1):e.ibeta(t,n,r)},inv:function(t,n,r){return e.ibetainv(t,n,r)},mean:function(e,t){return e/(e+t)},median:function(t,n){return e.ibetainv(.5,t,n)},mode:function(e,t){return(e-1)/(e+t-2)},sample:function(t,n){var r=e.randg(t);return r/(r+e.randg(n))},variance:function(e,n){return e*n/(t.pow(e+n,2)*(e+n+1))}}),e.extend(e.centralF,{pdf:function(n,r,o){var i,a;return n<0?0:r<=2?0===n&&r<2?1/0:0===n&&2===r?1:1/e.betafn(r/2,o/2)*t.pow(r/o,r/2)*t.pow(n,r/2-1)*t.pow(1+r/o*n,-(r+o)/2):(i=r*n/(o+n*r),a=o/(o+n*r),r*a/2*e.binomial.pdf((r-2)/2,(r+o-2)/2,i))},cdf:function(t,n,r){return t<0?0:e.ibeta(n*t/(n*t+r),n/2,r/2)},inv:function(t,n,r){return r/(n*(1/e.ibetainv(t,n/2,r/2)-1))},mean:function(e,t){return t>2?t/(t-2):void 0},mode:function(e,t){return e>2?t*(e-2)/(e*(t+2)):void 0},sample:function(t,n){return 2*e.randg(t/2)/t/(2*e.randg(n/2)/n)},variance:function(e,t){if(!(t<=4))return 2*t*t*(e+t-2)/(e*(t-2)*(t-2)*(t-4))}}),e.extend(e.cauchy,{pdf:function(e,n,r){return r<0?0:r/(t.pow(e-n,2)+t.pow(r,2))/t.PI},cdf:function(e,n,r){return t.atan((e-n)/r)/t.PI+.5},inv:function(e,n,r){return n+r*t.tan(t.PI*(e-.5))},median:function(e,t){return e},mode:function(e,t){return e},sample:function(n,r){return e.randn()*t.sqrt(1/(2*e.randg(.5)))*r+n}}),e.extend(e.chisquare,{pdf:function(n,r){return n<0?0:0===n&&2===r?.5:t.exp((r/2-1)*t.log(n)-n/2-r/2*t.log(2)-e.gammaln(r/2))},cdf:function(t,n){return t<0?0:e.lowRegGamma(n/2,t/2)},inv:function(t,n){return 2*e.gammapinv(t,.5*n)},mean:function(e){return e},median:function(e){return e*t.pow(1-2/(9*e),3)},mode:function(e){return e-2>0?e-2:0},sample:function(t){return 2*e.randg(t/2)},variance:function(e){return 2*e}}),e.extend(e.exponential,{pdf:function(e,n){return e<0?0:n*t.exp(-n*e)},cdf:function(e,n){return e<0?0:1-t.exp(-n*e)},inv:function(e,n){return-t.log(1-e)/n},mean:function(e){return 1/e},median:function(e){return 1/e*t.log(2)},mode:function(e){return 0},sample:function(e){return-1/e*t.log(t.random())},variance:function(e){return t.pow(e,-2)}}),e.extend(e.gamma,{pdf:function(n,r,o){return n<0?0:0===n&&1===r?1/o:t.exp((r-1)*t.log(n)-n/o-e.gammaln(r)-r*t.log(o))},cdf:function(t,n,r){return t<0?0:e.lowRegGamma(n,t/r)},inv:function(t,n,r){return e.gammapinv(t,n)*r},mean:function(e,t){return e*t},mode:function(e,t){if(e>1)return(e-1)*t},sample:function(t,n){return e.randg(t)*n},variance:function(e,t){return e*t*t}}),e.extend(e.invgamma,{pdf:function(n,r,o){return n<=0?0:t.exp(-(r+1)*t.log(n)-o/n-e.gammaln(r)+r*t.log(o))},cdf:function(t,n,r){return t<=0?0:1-e.lowRegGamma(n,r/t)},inv:function(t,n,r){return r/e.gammapinv(1-t,n)},mean:function(e,t){return e>1?t/(e-1):void 0},mode:function(e,t){return t/(e+1)},sample:function(t,n){return n/e.randg(t)},variance:function(e,t){if(!(e<=2))return t*t/((e-1)*(e-1)*(e-2))}}),e.extend(e.kumaraswamy,{pdf:function(e,n,r){return 0===e&&1===n?r:1===e&&1===r?n:t.exp(t.log(n)+t.log(r)+(n-1)*t.log(e)+(r-1)*t.log(1-t.pow(e,n)))},cdf:function(e,n,r){return e<0?0:e>1?1:1-t.pow(1-t.pow(e,n),r)},inv:function(e,n,r){return t.pow(1-t.pow(1-e,1/r),1/n)},mean:function(t,n){return n*e.gammafn(1+1/t)*e.gammafn(n)/e.gammafn(1+1/t+n)},median:function(e,n){return t.pow(1-t.pow(2,-1/n),1/e)},mode:function(e,n){if(e>=1&&n>=1&&1!==e&&1!==n)return t.pow((e-1)/(e*n-1),1/e)},variance:function(e,t){throw new Error("variance not yet implemented")}}),e.extend(e.lognormal,{pdf:function(e,n,r){return e<=0?0:t.exp(-t.log(e)-.5*t.log(2*t.PI)-t.log(r)-t.pow(t.log(e)-n,2)/(2*r*r))},cdf:function(n,r,o){return n<0?0:.5+.5*e.erf((t.log(n)-r)/t.sqrt(2*o*o))},inv:function(n,r,o){return t.exp(-1.4142135623730951*o*e.erfcinv(2*n)+r)},mean:function(e,n){return t.exp(e+n*n/2)},median:function(e,n){return t.exp(e)},mode:function(e,n){return t.exp(e-n*n)},sample:function(n,r){return t.exp(e.randn()*r+n)},variance:function(e,n){return(t.exp(n*n)-1)*t.exp(2*e+n*n)}}),e.extend(e.noncentralt,{pdf:function(n,r,o){return t.abs(o)<1e-14?e.studentt.pdf(n,r):t.abs(n)<1e-14?t.exp(e.gammaln((r+1)/2)-o*o/2-.5*t.log(t.PI*r)-e.gammaln(r/2)):r/n*(e.noncentralt.cdf(n*t.sqrt(1+2/r),r+2,o)-e.noncentralt.cdf(n,r,o))},cdf:function(n,r,o){if(t.abs(o)<1e-14)return e.studentt.cdf(n,r);var i=!1;n<0&&(i=!0,o=-o);for(var a=e.normal.cdf(-o,0,1),s=1e-14+1,l=s,u=n*n/(n*n+r),c=0,f=t.exp(-o*o/2),h=t.exp(-o*o/2-.5*t.log(2)-e.gammaln(1.5))*o;c<200||l>1e-14||s>1e-14;)l=s,c>0&&(f*=o*o/(2*c),h*=o*o/(2*(c+.5))),s=f*e.beta.cdf(u,c+.5,r/2)+h*e.beta.cdf(u,c+1,r/2),a+=.5*s,c++;return i?1-a:a}}),e.extend(e.normal,{pdf:function(e,n,r){return t.exp(-.5*t.log(2*t.PI)-t.log(r)-t.pow(e-n,2)/(2*r*r))},cdf:function(n,r,o){return.5*(1+e.erf((n-r)/t.sqrt(2*o*o)))},inv:function(t,n,r){return-1.4142135623730951*r*e.erfcinv(2*t)+n},mean:function(e,t){return e},median:function(e,t){return e},mode:function(e,t){return e},sample:function(t,n){return e.randn()*n+t},variance:function(e,t){return t*t}}),e.extend(e.pareto,{pdf:function(e,n,r){return e1e100?1e100:r,1/(t.sqrt(r)*e.betafn(.5,r/2))*t.pow(1+n*n/r,-(r+1)/2)},cdf:function(n,r){var o=r/2;return e.ibeta((n+t.sqrt(n*n+r))/(2*t.sqrt(n*n+r)),o,o)},inv:function(n,r){var o=e.ibetainv(2*t.min(n,1-n),.5*r,.5);return o=t.sqrt(r*(1-o)/o),n>.5?o:-o},mean:function(e){return e>1?0:void 0},median:function(e){return 0},mode:function(e){return 0},sample:function(n){return e.randn()*t.sqrt(n/(2*e.randg(n/2)))},variance:function(e){return e>2?e/(e-2):e>1?1/0:void 0}}),e.extend(e.weibull,{pdf:function(e,n,r){return e<0||n<0||r<0?0:r/n*t.pow(e/n,r-1)*t.exp(-t.pow(e/n,r))},cdf:function(e,n,r){return e<0?0:1-t.exp(-t.pow(e/n,r))},inv:function(e,n,r){return n*t.pow(-t.log(1-e),1/r)},mean:function(t,n){return t*e.gammafn(1+1/n)},median:function(e,n){return e*t.pow(t.log(2),1/n)},mode:function(e,n){return n<=1?0:e*t.pow((n-1)/n,1/n)},sample:function(e,n){return e*t.pow(-t.log(t.random()),1/n)},variance:function(n,r){return n*n*e.gammafn(1+2/r)-t.pow(e.weibull.mean(n,r),2)}}),e.extend(e.uniform,{pdf:function(e,t,n){return en?0:1/(n-t)},cdf:function(e,t,n){return e>>0&&(n<0?0:e.combination(n+r-1,r-1)*t.pow(1-o,n)*t.pow(o,r))},cdf:function(t,n,r){var o=0,i=0;if(t<0)return 0;for(;i<=t;i++)o+=e.negbin.pdf(i,n,r);return o}}),e.extend(e.hypgeom,{pdf:function(n,r,o,i){if(n!==n|0)return!1;if(n<0||ni||n>o)return 0;if(2*o>r)return 2*i>r?e.hypgeom.pdf(r-o-i+n,r,r-o,r-i):e.hypgeom.pdf(i-n,r,r-o,i);if(2*i>r)return e.hypgeom.pdf(o-n,r,o,r-i);if(o1&&s=i||n>=o)return 1;if(2*o>r)return 2*i>r?e.hypgeom.cdf(r-o-i+n,r,r-o,r-i):1-e.hypgeom.cdf(i-n-1,r,r-o,i);if(2*i>r)return 1-e.hypgeom.cdf(o-n-1,r,o,r-i);if(o1&&lo);return r-1}}),e.extend(e.triangular,{pdf:function(e,t,n,r){return n<=t||rn?NaN:en?0:er?NaN:e<=n?0:e>=r?1:e<=o?t.pow(e-n,2)/((r-n)*(o-n)):1-t.pow(r-e,2)/((r-n)*(r-o))},inv:function(e,n,r,o){return r<=n||or?NaN:e<=(o-n)/(r-n)?n+(r-n)*t.sqrt(e*((o-n)/(r-n))):n+(r-n)*(1-t.sqrt((1-e)*(1-(o-n)/(r-n))))},mean:function(e,t,n){return(e+t+n)/3},median:function(e,n,r){return r<=(e+n)/2?n-t.sqrt((n-e)*(n-r))/t.sqrt(2):r>(e+n)/2?e+t.sqrt((n-e)*(r-e))/t.sqrt(2):void 0},mode:function(e,t,n){return n},sample:function(e,n,r){var o=t.random();return o<(r-e)/(n-e)?e+t.sqrt(o*(n-e)*(r-e)):n-t.sqrt((1-o)*(n-e)*(n-r))},variance:function(e,t,n){return(e*e+t*t+n*n-e*t-e*n-t*n)/18}}),e.extend(e.arcsine,{pdf:function(e,n,r){return r<=n?NaN:e<=n||e>=r?0:2/t.PI*t.pow(t.pow(r-n,2)-t.pow(2*e-n-r,2),-.5)},cdf:function(e,n,r){return e25e3)return r(n,1,a);var u,c=.5*i,f=c*t.log(i)-i*t.log(2)-e.gammaln(c),h=c-1,d=.25*i;u=i<=100?1:i<=800?.5:i<=5e3?.25:.125,f+=t.log(u);for(var p=0,g=1;g<=50;g++){for(var v=0,m=(2*g-1)*u,y=1;y<=16;y++){var w,b;8=-30){C=8=1&&v<=1e-14)break;p+=v}if(v>1e-14)throw new Error("tukey.cdf failed to converge");return p>1&&(p=1),p},inv:function(n,r,i){var a=r;if(i<2||a<2)return NaN;if(n<0||n>1)return NaN;if(0===n)return 0;if(1===n)return 1/0;var s,l=o(n,a,i),u=e.tukey.cdf(l,r,i)-n;s=u>0?t.max(0,l-1):l+1;for(var c,f=e.tukey.cdf(s,r,i)-n,h=1;h<50;h++){c=s-f*(s-l)/(f-u),u=f,l=s,c<0&&(c=0,f=-n),f=e.tukey.cdf(c,r,i)-n,s=c;if(t.abs(s-l)<1e-4)return c}throw new Error("tukey.inv failed to converge")}})}(e,Math),function(e,t){function n(t){return a(t)||t instanceof e}var o=Array.prototype.push,a=e.utils.isArray;e.extend({add:function(t,r){return n(r)?(n(r[0])||(r=[r]),e.map(t,function(e,t,n){return e+r[t][n]})):e.map(t,function(e){return e+r})},subtract:function(t,r){return n(r)?(n(r[0])||(r=[r]),e.map(t,function(e,t,n){return e-r[t][n]||0})):e.map(t,function(e){return e-r})},divide:function(t,r){return n(r)?(n(r[0])||(r=[r]),e.multiply(t,e.inv(r))):e.map(t,function(e){return e/r})},multiply:function(t,r){var o,i,a,s,l,u,c,f;if(void 0===t.length&&void 0===r.length)return t*r;if(l=t.length,u=t[0].length,c=e.zeros(l,a=n(r)?r[0].length:u),f=0,n(r)){for(;f=0;l--){for(d=0,u=l+1;u<=c-1;u++)d+=p[u]*n[l][u];p[l]=(n[l][o-1]-d)/n[l][l]}return p},gauss_jordan:function(n,r){for(var o=e.aug(n,r),i=o.length,a=o[0].length,s=0,l=0;lt.abs(o[u][l])&&(u=c);var f=o[l];o[l]=o[u],o[u]=f;for(var c=l+1;c=0;l--){s=o[l][l];for(var c=0;cl-1;h--)o[c][h]-=o[l][h]*o[c][l]/s;o[l][l]/=s;for(var h=i;hf?(d[c][f]=n[c][f],p[c][f]=g[c][f]=0):ci;)a=u,u=e.add(e.multiply(l,a),s),c++;return u},gauss_seidel:function(n,r,o,i){for(var a,s,l,u,c,f=0,h=n.length,d=[],p=[],g=[];fa?(d[f][a]=n[f][a],p[f][a]=g[f][a]=0):fi;)s=c,c=e.add(e.multiply(u,s),l),f+=1;return c},SOR:function(n,r,o,i,a){for(var s,l,u,c,f,h=0,d=n.length,p=[],g=[],v=[];hs?(p[h][s]=n[h][s],g[h][s]=v[h][s]=0):hi;)l=f,f=e.add(e.multiply(c,l),u),h++;return f},householder:function(n){for(var r,o,i,a,s,l=n.length,u=n[0].length,c=0,f=[],h=[];c0?-1:1,r=s*t.sqrt(r),o=t.sqrt((r*r-n[c+1][c]*r)/2),f=e.zeros(l,1),f[c+1][0]=(n[c+1][c]-r)/(2*o),i=c+2;i0?t.PI/4:-t.PI/4:t.atan(2*n[a][s]/(n[a][a]-n[s][s]))/2,c=e.identity(d,d),c[a][a]=t.cos(u),c[a][s]=-t.sin(u),c[s][a]=t.sin(u),c[s][s]=t.cos(u),p=e.multiply(p,c),r=e.multiply(e.multiply(e.inv(c),n),c),n=r,f=0;for(var o=1;o.001&&(f=1)}for(var o=0;o=f;)a=i(e,r+o),s=i(e,r),d[h]=(n[a]-2*n[s]+n[2*s-a])/(o*o),o/=2,h++;for(u=d.length,l=1;1!=u;){for(c=0;cr);o++);return o-=1,n[o]+(r-t[o])*h[o]+e.sq(r-t[o])*c[o]+(r-t[o])*e.sq(r-t[o])*d[o]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(t){for(var n,r,o=t.length,i=t[0].length,a=0,s=[],l=[],u=[],c=[],f=[],h=[],d=[],p=[],g=[],v=[],a=0;a1||r>1||e<=0||r<=0)throw new Error("Proportions should be greater than 0 and less than 1");var i=(e*n+r*o)/(n+o);return(e-r)/t.sqrt(i*(1-i)*(1/n+1/o))}var r=[].slice,o=e.utils.isNumber,i=e.utils.isArray;e.extend({zscore:function(){var t=r.call(arguments);return o(t[1])?(t[0]-t[1])/t[2]:(t[0]-e.mean(t[1]))/e.stdev(t[1],t[2])},ztest:function(){var n,o=r.call(arguments);return i(o[1])?(n=e.zscore(o[0],o[1],o[3]),1===o[2]?e.normal.cdf(-t.abs(n),0,1):2*e.normal.cdf(-t.abs(n),0,1)):o.length>2?(n=e.zscore(o[0],o[1],o[2]),1===o[3]?e.normal.cdf(-t.abs(n),0,1):2*e.normal.cdf(-t.abs(n),0,1)):(n=o[0],1===o[1]?e.normal.cdf(-t.abs(n),0,1):2*e.normal.cdf(-t.abs(n),0,1))}}),e.extend(e.fn,{zscore:function(e,t){return(e-this.mean())/this.stdev(t)},ztest:function(n,r,o){var i=t.abs(this.zscore(n,o));return 1===r?e.normal.cdf(-i,0,1):2*e.normal.cdf(-i,0,1)}}),e.extend({tscore:function(){var n=r.call(arguments);return 4===n.length?(n[0]-n[1])/(n[2]/t.sqrt(n[3])):(n[0]-e.mean(n[1]))/(e.stdev(n[1],!0)/t.sqrt(n[1].length))},ttest:function(){var n,i=r.call(arguments);return 5===i.length?(n=t.abs(e.tscore(i[0],i[1],i[2],i[3])),1===i[4]?e.studentt.cdf(-n,i[3]-1):2*e.studentt.cdf(-n,i[3]-1)):o(i[1])?(n=t.abs(i[0]),1==i[2]?e.studentt.cdf(-n,i[1]-1):2*e.studentt.cdf(-n,i[1]-1)):(n=t.abs(e.tscore(i[0],i[1])),1==i[2]?e.studentt.cdf(-n,i[1].length-1):2*e.studentt.cdf(-n,i[1].length-1))}}),e.extend(e.fn,{tscore:function(e){return(e-this.mean())/(this.stdev(!0)/t.sqrt(this.cols()))},ttest:function(n,r){return 1===r?1-e.studentt.cdf(t.abs(this.tscore(n)),this.cols()-1):2*e.studentt.cdf(-t.abs(this.tscore(n)),this.cols()-1)}}),e.extend({anovafscore:function(){var n,o,i,a,s,l,u,c,f=r.call(arguments);if(1===f.length){s=new Array(f[0].length);for(var u=0;u.5?1-r:r)}),l=e.studentt.inv(.975,n.df_resid),u=n.coef.map(function(e,t){var n=l*i[t];return[e-n,e+n]});return{se:i,t:a,p:s,sigmaHat:o,interval95:u}}function o(t){var n=t.R2/t.df_model/((1-t.R2)/t.df_resid);return{F_statistic:n,pvalue:1-function(t,n,r){return e.beta.cdf(t/(r/n+t),n/2,r/2)}(n,t.df_model,t.df_resid)}}function i(e,t){var i=n(e,t),a=r(i),s=o(i),l=1-(i.nobs-1)/i.df_resid*(1-i.R2);return i.t=a,i.f=s,i.adjust_R2=l,i}return{ols:i}}(),e.jStat=e,e})},function(e,t,n){var r=n(1),o=n(9),i=n(0);t.UNIQUE=function(){for(var e=[],t=0;t=i.length?a.REPT("0",t-i.length)+i:o.num)},t.BIN2OCT=function(e,t){if(!r(e))return o.num;var n=e.toString();if(10===n.length&&"1"===n.substring(0,1))return(1073741312+parseInt(n.substring(1),2)).toString(8);var i=parseInt(e,2).toString(8);return void 0===t?i:isNaN(t)?o.value:t<0?o.num:(t=Math.floor(t),t>=i.length?a.REPT("0",t-i.length)+i:o.num)},t.BITAND=function(e,t){return e=s.parseNumber(e),t=s.parseNumber(t),s.anyIsError(e,t)?o.value:e<0||t<0?o.num:Math.floor(e)!==e||Math.floor(t)!==t?o.num:e>0xffffffffffff||t>0xffffffffffff?o.num:e&t},t.BITLSHIFT=function(e,t){return e=s.parseNumber(e),t=s.parseNumber(t),s.anyIsError(e,t)?o.value:e<0?o.num:Math.floor(e)!==e?o.num:e>0xffffffffffff?o.num:Math.abs(t)>53?o.num:t>=0?e<>-t},t.BITOR=function(e,t){return e=s.parseNumber(e),t=s.parseNumber(t),s.anyIsError(e,t)?o.value:e<0||t<0?o.num:Math.floor(e)!==e||Math.floor(t)!==t?o.num:e>0xffffffffffff||t>0xffffffffffff?o.num:e|t},t.BITRSHIFT=function(e,t){return e=s.parseNumber(e),t=s.parseNumber(t),s.anyIsError(e,t)?o.value:e<0?o.num:Math.floor(e)!==e?o.num:e>0xffffffffffff?o.num:Math.abs(t)>53?o.num:t>=0?e>>t:e<<-t},t.BITXOR=function(e,t){return e=s.parseNumber(e),t=s.parseNumber(t),s.anyIsError(e,t)?o.value:e<0||t<0?o.num:Math.floor(e)!==e||Math.floor(t)!==t?o.num:e>0xffffffffffff||t>0xffffffffffff?o.num:e^t},t.COMPLEX=function(e,t,n){if(e=s.parseNumber(e),t=s.parseNumber(t),s.anyIsError(e,t))return e;if("i"!==(n=void 0===n?"i":n)&&"j"!==n)return o.value;if(0===e&&0===t)return 0;if(0===e)return 1===t?n:t.toString()+n;if(0===t)return e.toString();var r=t>0?"+":"";return e.toString()+r+(1===t?n:t.toString()+n)},t.CONVERT=function(e,t,n){if((e=s.parseNumber(e))instanceof Error)return e;for(var r,i=[["a.u. of action","?",null,"action",!1,!1,1.05457168181818e-34],["a.u. of charge","e",null,"electric_charge",!1,!1,1.60217653141414e-19],["a.u. of energy","Eh",null,"energy",!1,!1,4.35974417757576e-18],["a.u. of length","a?",null,"length",!1,!1,5.29177210818182e-11],["a.u. of mass","m?",null,"mass",!1,!1,9.10938261616162e-31],["a.u. of time","?/Eh",null,"time",!1,!1,2.41888432650516e-17],["admiralty knot","admkn",null,"speed",!1,!0,.514773333],["ampere","A",null,"electric_current",!0,!1,1],["ampere per meter","A/m",null,"magnetic_field_intensity",!0,!1,1],["ångström","Å",["ang"],"length",!1,!0,1e-10],["are","ar",null,"area",!1,!0,100],["astronomical unit","ua",null,"length",!1,!1,1.49597870691667e-11],["bar","bar",null,"pressure",!1,!1,1e5],["barn","b",null,"area",!1,!1,1e-28],["becquerel","Bq",null,"radioactivity",!0,!1,1],["bit","bit",["b"],"information",!1,!0,1],["btu","BTU",["btu"],"energy",!1,!0,1055.05585262],["byte","byte",null,"information",!1,!0,8],["candela","cd",null,"luminous_intensity",!0,!1,1],["candela per square metre","cd/m?",null,"luminance",!0,!1,1],["coulomb","C",null,"electric_charge",!0,!1,1],["cubic ångström","ang3",["ang^3"],"volume",!1,!0,1e-30],["cubic foot","ft3",["ft^3"],"volume",!1,!0,.028316846592],["cubic inch","in3",["in^3"],"volume",!1,!0,16387064e-12],["cubic light-year","ly3",["ly^3"],"volume",!1,!0,8.46786664623715e-47],["cubic metre","m?",null,"volume",!0,!0,1],["cubic mile","mi3",["mi^3"],"volume",!1,!0,4168181825.44058],["cubic nautical mile","Nmi3",["Nmi^3"],"volume",!1,!0,6352182208],["cubic Pica","Pica3",["Picapt3","Pica^3","Picapt^3"],"volume",!1,!0,7.58660370370369e-8],["cubic yard","yd3",["yd^3"],"volume",!1,!0,.764554857984],["cup","cup",null,"volume",!1,!0,.0002365882365],["dalton","Da",["u"],"mass",!1,!1,1.66053886282828e-27],["day","d",["day"],"time",!1,!0,86400],["degree","°",null,"angle",!1,!1,.0174532925199433],["degrees Rankine","Rank",null,"temperature",!1,!0,.555555555555556],["dyne","dyn",["dy"],"force",!1,!0,1e-5],["electronvolt","eV",["ev"],"energy",!1,!0,1.60217656514141],["ell","ell",null,"length",!1,!0,1.143],["erg","erg",["e"],"energy",!1,!0,1e-7],["farad","F",null,"electric_capacitance",!0,!1,1],["fluid ounce","oz",null,"volume",!1,!0,295735295625e-16],["foot","ft",null,"length",!1,!0,.3048],["foot-pound","flb",null,"energy",!1,!0,1.3558179483314],["gal","Gal",null,"acceleration",!1,!1,.01],["gallon","gal",null,"volume",!1,!0,.003785411784],["gauss","G",["ga"],"magnetic_flux_density",!1,!0,1],["grain","grain",null,"mass",!1,!0,647989e-10],["gram","g",null,"mass",!1,!0,.001],["gray","Gy",null,"absorbed_dose",!0,!1,1],["gross registered ton","GRT",["regton"],"volume",!1,!0,2.8316846592],["hectare","ha",null,"area",!1,!0,1e4],["henry","H",null,"inductance",!0,!1,1],["hertz","Hz",null,"frequency",!0,!1,1],["horsepower","HP",["h"],"power",!1,!0,745.69987158227],["horsepower-hour","HPh",["hh","hph"],"energy",!1,!0,2684519.538],["hour","h",["hr"],"time",!1,!0,3600],["imperial gallon (U.K.)","uk_gal",null,"volume",!1,!0,.00454609],["imperial hundredweight","lcwt",["uk_cwt","hweight"],"mass",!1,!0,50.802345],["imperial quart (U.K)","uk_qt",null,"volume",!1,!0,.0011365225],["imperial ton","brton",["uk_ton","LTON"],"mass",!1,!0,1016.046909],["inch","in",null,"length",!1,!0,.0254],["international acre","uk_acre",null,"area",!1,!0,4046.8564224],["IT calorie","cal",null,"energy",!1,!0,4.1868],["joule","J",null,"energy",!0,!0,1],["katal","kat",null,"catalytic_activity",!0,!1,1],["kelvin","K",["kel"],"temperature",!0,!0,1],["kilogram","kg",null,"mass",!0,!0,1],["knot","kn",null,"speed",!1,!0,.514444444444444],["light-year","ly",null,"length",!1,!0,9460730472580800],["litre","L",["l","lt"],"volume",!1,!0,.001],["lumen","lm",null,"luminous_flux",!0,!1,1],["lux","lx",null,"illuminance",!0,!1,1],["maxwell","Mx",null,"magnetic_flux",!1,!1,1e-18],["measurement ton","MTON",null,"volume",!1,!0,1.13267386368],["meter per hour","m/h",["m/hr"],"speed",!1,!0,.00027777777777778],["meter per second","m/s",["m/sec"],"speed",!0,!0,1],["meter per second squared","m?s??",null,"acceleration",!0,!1,1],["parsec","pc",["parsec"],"length",!1,!0,0x6da012f958ee1c],["meter squared per second","m?/s",null,"kinematic_viscosity",!0,!1,1],["metre","m",null,"length",!0,!0,1],["miles per hour","mph",null,"speed",!1,!0,.44704],["millimetre of mercury","mmHg",null,"pressure",!1,!1,133.322],["minute","?",null,"angle",!1,!1,.000290888208665722],["minute","min",["mn"],"time",!1,!0,60],["modern teaspoon","tspm",null,"volume",!1,!0,5e-6],["mole","mol",null,"amount_of_substance",!0,!1,1],["morgen","Morgen",null,"area",!1,!0,2500],["n.u. of action","?",null,"action",!1,!1,1.05457168181818e-34],["n.u. of mass","m?",null,"mass",!1,!1,9.10938261616162e-31],["n.u. of speed","c?",null,"speed",!1,!1,299792458],["n.u. of time","?/(me?c??)",null,"time",!1,!1,1.28808866778687e-21],["nautical mile","M",["Nmi"],"length",!1,!0,1852],["newton","N",null,"force",!0,!0,1],["œrsted","Oe ",null,"magnetic_field_intensity",!1,!1,79.5774715459477],["ohm","Ω",null,"electric_resistance",!0,!1,1],["ounce mass","ozm",null,"mass",!1,!0,.028349523125],["pascal","Pa",null,"pressure",!0,!1,1],["pascal second","Pa?s",null,"dynamic_viscosity",!0,!1,1],["pferdestärke","PS",null,"power",!1,!0,735.49875],["phot","ph",null,"illuminance",!1,!1,1e-4],["pica (1/6 inch)","pica",null,"length",!1,!0,.00035277777777778],["pica (1/72 inch)","Pica",["Picapt"],"length",!1,!0,.00423333333333333],["poise","P",null,"dynamic_viscosity",!1,!1,.1],["pond","pond",null,"force",!1,!0,.00980665],["pound force","lbf",null,"force",!1,!0,4.4482216152605],["pound mass","lbm",null,"mass",!1,!0,.45359237],["quart","qt",null,"volume",!1,!0,.000946352946],["radian","rad",null,"angle",!0,!1,1],["second","?",null,"angle",!1,!1,484813681109536e-20],["second","s",["sec"],"time",!0,!0,1],["short hundredweight","cwt",["shweight"],"mass",!1,!0,45.359237],["siemens","S",null,"electrical_conductance",!0,!1,1],["sievert","Sv",null,"equivalent_dose",!0,!1,1],["slug","sg",null,"mass",!1,!0,14.59390294],["square ångström","ang2",["ang^2"],"area",!1,!0,1e-20],["square foot","ft2",["ft^2"],"area",!1,!0,.09290304],["square inch","in2",["in^2"],"area",!1,!0,64516e-8],["square light-year","ly2",["ly^2"],"area",!1,!0,8.95054210748189e31],["square meter","m?",null,"area",!0,!0,1],["square mile","mi2",["mi^2"],"area",!1,!0,2589988.110336],["square nautical mile","Nmi2",["Nmi^2"],"area",!1,!0,3429904],["square Pica","Pica2",["Picapt2","Pica^2","Picapt^2"],"area",!1,!0,1792111111111e-17],["square yard","yd2",["yd^2"],"area",!1,!0,.83612736],["statute mile","mi",null,"length",!1,!0,1609.344],["steradian","sr",null,"solid_angle",!0,!1,1],["stilb","sb",null,"luminance",!1,!1,1e-4],["stokes","St",null,"kinematic_viscosity",!1,!1,1e-4],["stone","stone",null,"mass",!1,!0,6.35029318],["tablespoon","tbs",null,"volume",!1,!0,147868e-10],["teaspoon","tsp",null,"volume",!1,!0,492892e-11],["tesla","T",null,"magnetic_flux_density",!0,!0,1],["thermodynamic calorie","c",null,"energy",!1,!0,4.184],["ton","ton",null,"mass",!1,!0,907.18474],["tonne","t",null,"mass",!1,!1,1e3],["U.K. pint","uk_pt",null,"volume",!1,!0,.00056826125],["U.S. bushel","bushel",null,"volume",!1,!0,.03523907],["U.S. oil barrel","barrel",null,"volume",!1,!0,.158987295],["U.S. pint","pt",["us_pt"],"volume",!1,!0,.000473176473],["U.S. survey mile","survey_mi",null,"length",!1,!0,1609.347219],["U.S. survey/statute acre","us_acre",null,"area",!1,!0,4046.87261],["volt","V",null,"voltage",!0,!1,1],["watt","W",null,"power",!0,!0,1],["watt-hour","Wh",["wh"],"energy",!1,!0,3600],["weber","Wb",null,"magnetic_flux",!0,!1,1],["yard","yd",null,"length",!1,!0,.9144],["year","yr",null,"time",!1,!0,31557600]],a={Yi:["yobi",80,1.2089258196146292e24,"Yi","yotta"],Zi:["zebi",70,0x400000000000000000,"Zi","zetta"],Ei:["exbi",60,0x1000000000000000,"Ei","exa"],Pi:["pebi",50,0x4000000000000,"Pi","peta"],Ti:["tebi",40,1099511627776,"Ti","tera"],Gi:["gibi",30,1073741824,"Gi","giga"],Mi:["mebi",20,1048576,"Mi","mega"],ki:["kibi",10,1024,"ki","kilo"]},l={Y:["yotta",1e24,"Y"],Z:["zetta",1e21,"Z"],E:["exa",1e18,"E"],P:["peta",1e15,"P"],T:["tera",1e12,"T"],G:["giga",1e9,"G"],M:["mega",1e6,"M"],k:["kilo",1e3,"k"],h:["hecto",100,"h"],e:["dekao",10,"e"],d:["deci",.1,"d"],c:["centi",.01,"c"],m:["milli",.001,"m"],u:["micro",1e-6,"u"],n:["nano",1e-9,"n"],p:["pico",1e-12,"p"],f:["femto",1e-15,"f"],a:["atto",1e-18,"a"],z:["zepto",1e-21,"z"],y:["yocto",1e-24,"y"]},u=null,c=null,f=t,h=n,d=1,p=1,g=0;g=0)&&(u=i[g]),(i[g][1]===h||r.indexOf(h)>=0)&&(c=i[g]);if(null===u){var v=a[t.substring(0,2)],m=l[t.substring(0,1)];"da"===t.substring(0,2)&&(m=["dekao",10,"da"]),v?(d=v[2],f=t.substring(2)):m&&(d=m[1],f=t.substring(m[2].length));for(var y=0;y=0)&&(u=i[y])}if(null===c){var w=a[n.substring(0,2)],b=l[n.substring(0,1)];"da"===n.substring(0,2)&&(b=["dekao",10,"da"]),w?(p=w[2],h=n.substring(2)):b&&(p=b[1],h=n.substring(b[2].length));for(var C=0;C=0)&&(c=i[C])}return null===u||null===c?o.na:u[3]!==c[3]?o.na:e*u[6]*d/(c[6]*p)},t.DEC2BIN=function(e,t){if((e=s.parseNumber(e))instanceof Error)return e;if(!/^-?[0-9]{1,3}$/.test(e)||e<-512||e>511)return o.num;if(e<0)return"1"+a.REPT("0",9-(512+e).toString(2).length)+(512+e).toString(2);var n=parseInt(e,10).toString(2);return void 0===t?n:isNaN(t)?o.value:t<0?o.num:(t=Math.floor(t),t>=n.length?a.REPT("0",t-n.length)+n:o.num)},t.DEC2HEX=function(e,t){if((e=s.parseNumber(e))instanceof Error)return e;if(!/^-?[0-9]{1,12}$/.test(e)||e<-549755813888||e>549755813887)return o.num;if(e<0)return(1099511627776+e).toString(16);var n=parseInt(e,10).toString(16);return void 0===t?n:isNaN(t)?o.value:t<0?o.num:(t=Math.floor(t),t>=n.length?a.REPT("0",t-n.length)+n:o.num)},t.DEC2OCT=function(e,t){if((e=s.parseNumber(e))instanceof Error)return e;if(!/^-?[0-9]{1,9}$/.test(e)||e<-536870912||e>536870911)return o.num;if(e<0)return(1073741824+e).toString(8);var n=parseInt(e,10).toString(8);return void 0===t?n:isNaN(t)?o.value:t<0?o.num:(t=Math.floor(t),t>=n.length?a.REPT("0",t-n.length)+n:o.num)},t.DELTA=function(e,t){return t=void 0===t?0:t,e=s.parseNumber(e),t=s.parseNumber(t),s.anyIsError(e,t)?o.value:e===t?1:0},t.ERF=function(e,t){return t=void 0===t?0:t,e=s.parseNumber(e),t=s.parseNumber(t),s.anyIsError(e,t)?o.value:i.erf(e)},t.ERF.PRECISE=function(){throw new Error("ERF.PRECISE is not implemented")},t.ERFC=function(e){return isNaN(e)?o.value:i.erfc(e)},t.ERFC.PRECISE=function(){throw new Error("ERFC.PRECISE is not implemented")},t.GESTEP=function(e,t){return t=t||0,e=s.parseNumber(e),s.anyIsError(t,e)?e:e>=t?1:0},t.HEX2BIN=function(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return o.num;var n=10===e.length&&"f"===e.substring(0,1).toLowerCase(),r=n?parseInt(e,16)-1099511627776:parseInt(e,16);if(r<-512||r>511)return o.num;if(n)return"1"+a.REPT("0",9-(512+r).toString(2).length)+(512+r).toString(2);var i=r.toString(2);return void 0===t?i:isNaN(t)?o.value:t<0?o.num:(t=Math.floor(t),t>=i.length?a.REPT("0",t-i.length)+i:o.num)},t.HEX2DEC=function(e){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return o.num;var t=parseInt(e,16);return t>=549755813888?t-1099511627776:t},t.HEX2OCT=function(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return o.num;var n=parseInt(e,16);if(n>536870911&&n<0xffe0000000)return o.num;if(n>=0xffe0000000)return(n-0xffc0000000).toString(8);var r=n.toString(8);return void 0===t?r:isNaN(t)?o.value:t<0?o.num:(t=Math.floor(t),t>=r.length?a.REPT("0",t-r.length)+r:o.num)},t.IMABS=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);return s.anyIsError(n,r)?o.value:Math.sqrt(Math.pow(n,2)+Math.pow(r,2))},t.IMAGINARY=function(e){if(void 0===e||!0===e||!1===e)return o.value;if(0===e||"0"===e)return 0;if(["i","j"].indexOf(e)>=0)return 1;e=e.replace("+i","+1i").replace("-i","-1i").replace("+j","+1j").replace("-j","-1j");var t=e.indexOf("+"),n=e.indexOf("-");0===t&&(t=e.indexOf("+",1)),0===n&&(n=e.indexOf("-",1));var r=e.substring(e.length-1,e.length),i="i"===r||"j"===r;return t>=0||n>=0?i?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?o.num:Number(e.substring(t+1,e.length-1)):isNaN(e.substring(0,n))||isNaN(e.substring(n+1,e.length-1))?o.num:-Number(e.substring(n+1,e.length-1)):o.num:i?isNaN(e.substring(0,e.length-1))?o.num:e.substring(0,e.length-1):isNaN(e)?o.num:0},t.IMARGUMENT=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);return s.anyIsError(n,r)?o.value:0===n&&0===r?o.div0:0===n&&r>0?Math.PI/2:0===n&&r<0?-Math.PI/2:0===r&&n>0?0:0===r&&n<0?-Math.PI:n>0?Math.atan(r/n):n<0&&r>=0?Math.atan(r/n)+Math.PI:Math.atan(r/n)-Math.PI},t.IMCONJUGATE=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);if(s.anyIsError(n,r))return o.value;var i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",0!==r?t.COMPLEX(n,-r,i):e},t.IMCOS=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);if(s.anyIsError(n,r))return o.value;var i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",t.COMPLEX(Math.cos(n)*(Math.exp(r)+Math.exp(-r))/2,-Math.sin(n)*(Math.exp(r)-Math.exp(-r))/2,i)},t.IMCOSH=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);if(s.anyIsError(n,r))return o.value;var i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",t.COMPLEX(Math.cos(r)*(Math.exp(n)+Math.exp(-n))/2,Math.sin(r)*(Math.exp(n)-Math.exp(-n))/2,i)},t.IMCOT=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);return s.anyIsError(n,r)?o.value:t.IMDIV(t.IMCOS(e),t.IMSIN(e))},t.IMDIV=function(e,n){var r=t.IMREAL(e),i=t.IMAGINARY(e),a=t.IMREAL(n),l=t.IMAGINARY(n);if(s.anyIsError(r,i,a,l))return o.value;var u=e.substring(e.length-1),c=n.substring(n.length-1),f="i";if("j"===u?f="j":"j"===c&&(f="j"),0===a&&0===l)return o.num;var h=a*a+l*l;return t.COMPLEX((r*a+i*l)/h,(i*a-r*l)/h,f)},t.IMEXP=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);if(s.anyIsError(n,r))return o.value;var i=e.substring(e.length-1);i="i"===i||"j"===i?i:"i";var a=Math.exp(n);return t.COMPLEX(a*Math.cos(r),a*Math.sin(r),i)},t.IMLN=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);if(s.anyIsError(n,r))return o.value;var i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",t.COMPLEX(Math.log(Math.sqrt(n*n+r*r)),Math.atan(r/n),i)},t.IMLOG10=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);if(s.anyIsError(n,r))return o.value;var i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",t.COMPLEX(Math.log(Math.sqrt(n*n+r*r))/Math.log(10),Math.atan(r/n)/Math.log(10),i)},t.IMLOG2=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);if(s.anyIsError(n,r))return o.value;var i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",t.COMPLEX(Math.log(Math.sqrt(n*n+r*r))/Math.log(2),Math.atan(r/n)/Math.log(2),i)},t.IMPOWER=function(e,n){n=s.parseNumber(n);var r=t.IMREAL(e),i=t.IMAGINARY(e);if(s.anyIsError(n,r,i))return o.value;var a=e.substring(e.length-1);a="i"===a||"j"===a?a:"i";var l=Math.pow(t.IMABS(e),n),u=t.IMARGUMENT(e);return t.COMPLEX(l*Math.cos(n*u),l*Math.sin(n*u),a)},t.IMPRODUCT=function(){var e=arguments[0];if(!arguments.length)return o.value;for(var n=1;n=0)return 0;var t=e.indexOf("+"),n=e.indexOf("-");0===t&&(t=e.indexOf("+",1)),0===n&&(n=e.indexOf("-",1));var r=e.substring(e.length-1,e.length),i="i"===r||"j"===r;return t>=0||n>=0?i?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?o.num:Number(e.substring(0,t)):isNaN(e.substring(0,n))||isNaN(e.substring(n+1,e.length-1))?o.num:Number(e.substring(0,n)):o.num:i?isNaN(e.substring(0,e.length-1))?o.num:0:isNaN(e)?o.num:e},t.IMSEC=function(e){if(!0===e||!1===e)return o.value;var n=t.IMREAL(e),r=t.IMAGINARY(e);return s.anyIsError(n,r)?o.value:t.IMDIV("1",t.IMCOS(e))},t.IMSECH=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);return s.anyIsError(n,r)?o.value:t.IMDIV("1",t.IMCOSH(e))},t.IMSIN=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);if(s.anyIsError(n,r))return o.value;var i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",t.COMPLEX(Math.sin(n)*(Math.exp(r)+Math.exp(-r))/2,Math.cos(n)*(Math.exp(r)-Math.exp(-r))/2,i)},t.IMSINH=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);if(s.anyIsError(n,r))return o.value;var i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",t.COMPLEX(Math.cos(r)*(Math.exp(n)-Math.exp(-n))/2,Math.sin(r)*(Math.exp(n)+Math.exp(-n))/2,i)},t.IMSQRT=function(e){var n=t.IMREAL(e),r=t.IMAGINARY(e);if(s.anyIsError(n,r))return o.value;var i=e.substring(e.length-1);i="i"===i||"j"===i?i:"i";var a=Math.sqrt(t.IMABS(e)),l=t.IMARGUMENT(e);return t.COMPLEX(a*Math.cos(l/2),a*Math.sin(l/2),i)},t.IMCSC=function(e){if(!0===e||!1===e)return o.value;var n=t.IMREAL(e),r=t.IMAGINARY(e);return s.anyIsError(n,r)?o.num:t.IMDIV("1",t.IMSIN(e))},t.IMCSCH=function(e){if(!0===e||!1===e)return o.value;var n=t.IMREAL(e),r=t.IMAGINARY(e);return s.anyIsError(n,r)?o.num:t.IMDIV("1",t.IMSINH(e))},t.IMSUB=function(e,t){var n=this.IMREAL(e),r=this.IMAGINARY(e),i=this.IMREAL(t),a=this.IMAGINARY(t);if(s.anyIsError(n,r,i,a))return o.value;var l=e.substring(e.length-1),u=t.substring(t.length-1),c="i";return"j"===l?c="j":"j"===u&&(c="j"),this.COMPLEX(n-i,r-a,c)},t.IMSUM=function(){if(!arguments.length)return o.value;for(var e=s.flatten(arguments),t=e[0],n=1;n511)return o.num;if(n)return"1"+a.REPT("0",9-(512+r).toString(2).length)+(512+r).toString(2);var i=r.toString(2);return void 0===t?i:isNaN(t)?o.value:t<0?o.num:(t=Math.floor(t),t>=i.length?a.REPT("0",t-i.length)+i:o.num)},t.OCT2DEC=function(e){if(!/^[0-7]{1,10}$/.test(e))return o.num;var t=parseInt(e,8);return t>=536870912?t-1073741824:t},t.OCT2HEX=function(e,t){if(!/^[0-7]{1,10}$/.test(e))return o.num;var n=parseInt(e,8);if(n>=536870912)return"ff"+(n+3221225472).toString(16);var r=n.toString(16);return void 0===t?r:isNaN(t)?o.value:t<0?o.num:(t=Math.floor(t),t>=r.length?a.REPT("0",t-r.length)+r:o.num)}},function(e,t,n){"use strict";t.__esModule=!0,t.default=["ABS","ACCRINT","ACOS","ACOSH","ACOT","ACOTH","ADD","AGGREGATE","AND","ARABIC","ARGS2ARRAY","ASIN","ASINH","ATAN","ATAN2","ATANH","AVEDEV","AVERAGE","AVERAGEA","AVERAGEIF","AVERAGEIFS","BASE","BESSELI","BESSELJ","BESSELK","BESSELY","BETA.DIST","BETA.INV","BETADIST","BETAINV","BIN2DEC","BIN2HEX","BIN2OCT","BINOM.DIST","BINOM.DIST.RANGE","BINOM.INV","BINOMDIST","BITAND","BITLSHIFT","BITOR","BITRSHIFT","BITXOR","CEILING","CEILINGMATH","CEILINGPRECISE","CHAR","CHISQ.DIST","CHISQ.DIST.RT","CHISQ.INV","CHISQ.INV.RT","CHOOSE","CHOOSE","CLEAN","CODE","COLUMN","COLUMNS","COMBIN","COMBINA","COMPLEX","CONCATENATE","CONFIDENCE","CONFIDENCE.NORM","CONFIDENCE.T","CONVERT","CORREL","COS","COSH","COT","COTH","COUNT","COUNTA","COUNTBLANK","COUNTIF","COUNTIFS","COUNTIN","COUNTUNIQUE","COVARIANCE.P","COVARIANCE.S","CSC","CSCH","CUMIPMT","CUMPRINC","DATE","DATEVALUE","DAY","DAYS","DAYS360","DB","DDB","DEC2BIN","DEC2HEX","DEC2OCT","DECIMAL","DEGREES","DELTA","DEVSQ","DIVIDE","DOLLAR","DOLLARDE","DOLLARFR","E","EDATE","EFFECT","EOMONTH","EQ","ERF","ERFC","EVEN","EXACT","EXP","EXPON.DIST","EXPONDIST","F.DIST","F.DIST.RT","F.INV","F.INV.RT","FACT","FACTDOUBLE","FALSE","FDIST","FDISTRT","FIND","FINV","FINVRT","FISHER","FISHERINV","FIXED","FLATTEN","FLOOR","FORECAST","FREQUENCY","FV","FVSCHEDULE","GAMMA","GAMMA.DIST","GAMMA.INV","GAMMADIST","GAMMAINV","GAMMALN","GAMMALN.PRECISE","GAUSS","GCD","GEOMEAN","GESTEP","GROWTH","GTE","HARMEAN","HEX2BIN","HEX2DEC","HEX2OCT","HOUR","HTML2TEXT","HYPGEOM.DIST","HYPGEOMDIST","IF","IMABS","IMAGINARY","IMARGUMENT","IMCONJUGATE","IMCOS","IMCOSH","IMCOT","IMCSC","IMCSCH","IMDIV","IMEXP","IMLN","IMLOG10","IMLOG2","IMPOWER","IMPRODUCT","IMREAL","IMSEC","IMSECH","IMSIN","IMSINH","IMSQRT","IMSUB","IMSUM","IMTAN","INT","INTERCEPT","INTERVAL","IPMT","IRR","ISBINARY","ISBLANK","ISEVEN","ISLOGICAL","ISNONTEXT","ISNUMBER","ISODD","ISODD","ISOWEEKNUM","ISPMT","ISTEXT","JOIN","KURT","LARGE","LCM","LEFT","LEN","LINEST","LN","LOG","LOG10","LOGEST","LOGNORM.DIST","LOGNORM.INV","LOGNORMDIST","LOGNORMINV","LOWER","LT","LTE","MATCH","MAX","MAXA","MEDIAN","MID","MIN","MINA","MINUS","MINUTE","MIRR","MOD","MODE.MULT","MODE.SNGL","MODEMULT","MODESNGL","MONTH","MROUND","MULTINOMIAL","MULTIPLY","NE","NEGBINOM.DIST","NEGBINOMDIST","NETWORKDAYS","NOMINAL","NORM.DIST","NORM.INV","NORM.S.DIST","NORM.S.INV","NORMDIST","NORMINV","NORMSDIST","NORMSINV","NOT","NOW","NPER","NPV","NUMBERS","NUMERAL","OCT2BIN","OCT2DEC","OCT2HEX","ODD","OR","PDURATION","PEARSON","PERCENTILEEXC","PERCENTILEINC","PERCENTRANKEXC","PERCENTRANKINC","PERMUT","PERMUTATIONA","PHI","PI","PMT","POISSON.DIST","POISSONDIST","POW","POWER","PPMT","PROB","PRODUCT","PROPER","PV","QUARTILE.EXC","QUARTILE.INC","QUARTILEEXC","QUARTILEINC","QUOTIENT","RADIANS","RAND","RANDBETWEEN","RANK.AVG","RANK.EQ","RANKAVG","RANKEQ","RATE","REFERENCE","REGEXEXTRACT","REGEXMATCH","REGEXREPLACE","REPLACE","REPT","RIGHT","ROMAN","ROUND","ROUNDDOWN","ROUNDUP","ROW","ROWS","RRI","RSQ","SEARCH","SEC","SECH","SECOND","SERIESSUM","SIGN","SIN","SINH","SKEW","SKEW.P","SKEWP","SLN","SLOPE","SMALL","SPLIT","SPLIT","SQRT","SQRTPI","STANDARDIZE","STDEV.P","STDEV.S","STDEVA","STDEVP","STDEVPA","STDEVS","STEYX","SUBSTITUTE","SUBTOTAL","SUM","SUMIF","SUMIFS","SUMPRODUCT","SUMSQ","SUMX2MY2","SUMX2PY2","SUMXMY2","SWITCH","SYD","T","T.DIST","T.DIST.2T","T.DIST.RT","T.INV","T.INV.2T","TAN","TANH","TBILLEQ","TBILLPRICE","TBILLYIELD","TDIST","TDIST2T","TDISTRT","TEXT","TIME","TIMEVALUE","TINV","TINV2T","TODAY","TRANSPOSE","TREND","TRIM","TRIMMEAN","TRUE","TRUNC","UNICHAR","UNICODE","UNIQUE","UPPER","VALUE","VAR.P","VAR.S","VARA","VARP","VARPA","VARS","WEEKDAY","WEEKNUM","WEIBULL.DIST","WEIBULLDIST","WORKDAY","XIRR","XNPV","XOR","YEAR","YEARFRAC"]},function(e,t,n){"use strict";function r(e){var t=parseInt(e,10);return t=isNaN(t)?-1:Math.max(t-1,-1)}function o(e){var t="";return e>=0&&(t=""+(e+1)),t}function i(e){var t=0;if("string"==typeof e){e=e.toUpperCase();for(var n=0,r=e.length-1;n=0;)t=String.fromCharCode(e%c+97)+t,e=Math.floor(e/c)-1;return t.toUpperCase()}function s(e){if("string"!=typeof e||!f.test(e))return[];var t=e.toUpperCase().match(f),n=t[1],o=t[2],a=t[3],s=t[4];return[{index:r(s),label:s,isAbsolute:"$"===a},{index:i(o),label:o,isAbsolute:"$"===n}]}function l(e,t){var n=(e.isAbsolute?"$":"")+o(e.index);return(t.isAbsolute?"$":"")+a(t.index)+n}t.__esModule=!0,t.rowLabelToIndex=r,t.rowIndexToLabel=o,t.columnLabelToIndex=i,t.columnIndexToLabel=a,t.extractLabel=s,t.toLabel=l;var u="ABCDEFGHIJKLMNOPQRSTUVWXYZ",c=u.length,f=/^([$])?([A-Za-z]+)([$])?([0-9]+)$/},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.rowLabelToIndex=t.rowIndexToLabel=t.columnLabelToIndex=t.columnIndexToLabel=t.toLabel=t.extractLabel=t.error=t.Parser=t.ERROR_VALUE=t.ERROR_REF=t.ERROR_NUM=t.ERROR_NULL=t.ERROR_NOT_AVAILABLE=t.ERROR_NAME=t.ERROR_DIV_ZERO=t.ERROR=t.SUPPORTED_FORMULAS=void 0;var o=n(17),i=r(o),a=n(14),s=r(a),l=n(2),u=r(l),c=n(15);t.SUPPORTED_FORMULAS=s.default,t.ERROR=l.ERROR,t.ERROR_DIV_ZERO=l.ERROR_DIV_ZERO,t.ERROR_NAME=l.ERROR_NAME,t.ERROR_NOT_AVAILABLE=l.ERROR_NOT_AVAILABLE,t.ERROR_NULL=l.ERROR_NULL,t.ERROR_NUM=l.ERROR_NUM,t.ERROR_REF=l.ERROR_REF,t.ERROR_VALUE=l.ERROR_VALUE,t.Parser=i.default,t.error=u.default,t.extractLabel=c.extractLabel,t.toLabel=c.toLabel,t.columnIndexToLabel=c.columnIndexToLabel,t.columnLabelToIndex=c.columnLabelToIndex,t.rowIndexToLabel=c.rowIndexToLabel,t.rowLabelToIndex=c.rowLabelToIndex},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var s=n(18),l=r(s),u=n(19),c=r(u),f=n(41),h=n(43),d=n(3),p=n(2),g=r(p),v=n(15);t.default=function(e){function t(){o(this,t);var n=i(this,e.call(this));return n.parser=new f.Parser,n.parser.yy={toNumber:d.toNumber,trimEdges:h.trimEdges,invertNumber:d.invertNumber,throwError:function(e){return n._throwError(e)},callVariable:function(e){return n._callVariable(e)},evaluateByOperator:c.default,callFunction:function(e,t){return n._callFunction(e,t)},cellValue:function(e){return n._callCellValue(e)},rangeValue:function(e,t){return n._callRangeValue(e,t)}},n.variables=Object.create(null),n.functions=Object.create(null),n.setVariable("TRUE",!0).setVariable("FALSE",!1).setVariable("NULL",null),n}return a(t,e),t.prototype.parse=function(e){var t=null,n=null;try{t=""===e?"":this.parser.parse(e)}catch(e){var r=(0,g.default)(e.message);n=r||(0,g.default)(p.ERROR)}return t instanceof Error&&(n=(0,g.default)(t.message)||(0,g.default)(p.ERROR),t=null),{error:n,result:t}},t.prototype.setVariable=function(e,t){return this.variables[e]=t,this},t.prototype.getVariable=function(e){return this.variables[e]},t.prototype._callVariable=function(e){var t=this.getVariable(e);if(this.emit("callVariable",e,function(e){void 0!==e&&(t=e)}),void 0===t)throw Error(p.ERROR_NAME);return t},t.prototype.setFunction=function(e,t){return this.functions[e]=t,this},t.prototype.getFunction=function(e){return this.functions[e]},t.prototype._callFunction=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this.getFunction(e),r=void 0;return n&&(r=n(t)),this.emit("callFunction",e,t,function(e){void 0!==e&&(r=e)}),void 0===r?(0,c.default)(e,t):r},t.prototype._callCellValue=function(e){e=e.toUpperCase();var t=(0,v.extractLabel)(e),n=t[0],r=t[1],o=void 0;return this.emit("callCellValue",{label:e,row:n,column:r},function(e){o=e}),o},t.prototype._callRangeValue=function(e,t){e=e.toUpperCase(),t=t.toUpperCase();var n=(0,v.extractLabel)(e),r=n[0],o=n[1],i=(0,v.extractLabel)(t),a=i[0],s=i[1],l={},u={};r.index<=a.index?(l.row=r,u.row=a):(l.row=a,u.row=r),o.index<=s.index?(l.column=o,u.column=s):(l.column=s,u.column=o),l.label=(0,v.toLabel)(l.row,l.column),u.label=(0,v.toLabel)(u.row,u.column);var c=[];return this.emit("callRangeValue",l,u,function(){c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]}),c},t.prototype._throwError=function(e){if((0,p.isValidStrict)(e))throw Error(e);throw Error(p.ERROR)},t}(l.default)},function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function r(){o.off(e,r),t.apply(n,arguments)}var o=this;return r._=t,this.on(e,r,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;for(r;r1&&void 0!==arguments[1]?arguments[1]:[];if(e=e.toUpperCase(),!D[e])throw Error(I.ERROR_NAME);return D[e].apply(D,t)}function i(e,t){Array.isArray(e)||(e=[e.toUpperCase()]),e.forEach(function(e){D[e]=t.isFactory?t(e):t})}t.__esModule=!0,t.default=o,t.registerOperation=i;var a=n(20),s=r(a),l=n(21),u=r(l),c=n(22),f=r(c),h=n(23),d=r(h),p=n(24),g=r(p),v=n(33),m=r(v),y=n(34),w=r(y),b=n(35),C=r(b),_=n(36),E=r(_),O=n(37),S=r(O),T=n(38),R=r(T),M=n(39),k=r(M),N=n(40),A=r(N),I=n(2),D=Object.create(null);i(s.default.SYMBOL,s.default),i(u.default.SYMBOL,u.default),i(f.default.SYMBOL,f.default),i(d.default.SYMBOL,d.default),i(A.default.SYMBOL,A.default),i(g.default.SYMBOL,g.default),i(m.default.SYMBOL,m.default),i(w.default.SYMBOL,w.default),i(C.default.SYMBOL,C.default),i(E.default.SYMBOL,E.default),i(R.default.SYMBOL,R.default),i(k.default.SYMBOL,k.default),i(S.default.SYMBOL,S.default)},function(e,t,n){"use strict";function r(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;rr)i=o(n,r,e(a.abs(n)),t(a.abs(n)),-1);else{for(l=2*a.floor((r+a.floor(a.sqrt(40*r)))/2),u=0,f=i=c=0,h=1,s=l;s>0;s--)d=s*p*h-f,f=h,h=d,a.abs(h)>1e10&&(h*=1e-10,f*=1e-10,i*=1e-10,c*=1e-10),u&&(c+=h),u=!u,s==r&&(i=f);c=2*c-h,i/=c}return n<0&&r%2?-i:i}}(),l=function(){function e(e){var t,i,f,h=e*e,d=e-.785398164;return e<8?(i=r(n,h),f=r(o,h),t=i/f+c*s(e,0)*a.log(e)):(h=64/h,i=r(l,h),f=r(u,h),t=a.sqrt(c/e)*(a.sin(d)*i+a.cos(d)*f*8/e)),t}function t(e){var t,n,o,i=e*e,l=e-2.356194491;return e<8?(n=e*r(f,i),o=r(h,i),t=n/o+c*(s(e,1)*a.log(e)-1/e)):(i=64/i,n=r(d,i),o=r(p,i),t=a.sqrt(c/e)*(a.sin(l)*n+a.cos(l)*o*8/e)),t}var n=[-2957821389,7062834065,-512359803.6,10879881.29,-86327.92757,228.4622733].reverse(),o=[40076544269,745249964.8,7189466.438,47447.2647,226.1030244,1].reverse(),l=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),u=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34945152e-8].reverse(),c=.636619772,f=[-4900604943e3,127527439e4,-51534381390,734926455.1,-4237922.726,8511.937935].reverse(),h=[249958057e5,424441966400,3733650367,22459040.02,102042.605,354.9632885,1].reverse(),d=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),p=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse();return i(e,t,"BESSELY",1,-1)}(),u=function(){function e(e){return e<=3.75?r(n,e*e/14.0625):a.exp(a.abs(e))/a.sqrt(a.abs(e))*r(o,3.75/a.abs(e))}function t(e){return e<3.75?e*r(i,e*e/14.0625):(e<0?-1:1)*a.exp(a.abs(e))/a.sqrt(a.abs(e))*r(s,3.75/a.abs(e))}var n=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),o=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse(),i=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),s=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse();return function n(r,o){if(0===(o=Math.round(o)))return e(r);if(1==o)return t(r);if(o<0)throw"BESSELI Order ("+o+") must be nonnegative";if(0===a.abs(r))return 0;var i,s,l,u,c,f,h=2/a.abs(r);for(l=2*a.round((o+a.round(a.sqrt(40*o)))/2),u=i=0,c=1,s=l;s>0;s--)f=s*h*c+u,u=c,c=f,a.abs(c)>1e10&&(c*=1e-10,u*=1e-10,i*=1e-10),s==o&&(i=u);return i*=n(r,0)/c,r<0&&o%2?-i:i}}(),c=function(){function e(e){return e<=2?-a.log(e/2)*u(e,0)+r(n,e*e/4):a.exp(-e)/a.sqrt(e)*r(o,2/e)}function t(e){return e<=2?a.log(e/2)*u(e,1)+1/e*r(s,e*e/4):a.exp(-e)/a.sqrt(e)*r(l,2/e)}var n=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),o=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse(),s=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),l=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();return i(e,t,"BESSELK",2,1)}();t.besselj=s,t.bessely=l,t.besseli=u,t.besselk=c},function(module,exports,__webpack_require__){function compact(e){var t=[];return utils.arrayEach(e,function(e){e&&t.push(e)}),t}function findResultIndex(database,criterias){for(var matches={},i=1;imaxCriteriaLength&&(maxCriteriaLength=criterias[i].length);for(var k=1;k1?error.num:o[r[0]]},exports.DMAX=function(e,t,n){if(isNaN(t)&&"string"!=typeof t)return error.value;var r=findResultIndex(e,n),o=[];if("string"==typeof t){var i=exports.FINDFIELD(e,t);o=utils.rest(e[i])}else o=utils.rest(e[t]);var a=o[r[0]];return utils.arrayEach(r,function(e){ao[e]&&(a=o[e])}),a},exports.DPRODUCT=function(e,t,n){if(isNaN(t)&&"string"!=typeof t)return error.value;var r=findResultIndex(e,n),o=[];if("string"==typeof t){var i=exports.FINDFIELD(e,t);o=utils.rest(e[i])}else o=utils.rest(e[t]);var a=[];utils.arrayEach(r,function(e){a.push(o[e])}),a=compact(a);var s=1;return utils.arrayEach(a,function(e){s*=e}),s},exports.DSTDEV=function(e,t,n){if(isNaN(t)&&"string"!=typeof t)return error.value;var r=findResultIndex(e,n),o=[];if("string"==typeof t){var i=exports.FINDFIELD(e,t);o=utils.rest(e[i])}else o=utils.rest(e[t]);var a=[];return utils.arrayEach(r,function(e){a.push(o[e])}),a=compact(a),stats.STDEV.S(a)},exports.DSTDEVP=function(e,t,n){if(isNaN(t)&&"string"!=typeof t)return error.value;var r=findResultIndex(e,n),o=[];if("string"==typeof t){var i=exports.FINDFIELD(e,t);o=utils.rest(e[i])}else o=utils.rest(e[t]);var a=[];return utils.arrayEach(r,function(e){a.push(o[e])}),a=compact(a),stats.STDEV.P(a)},exports.DSUM=function(e,t,n){if(isNaN(t)&&"string"!=typeof t)return error.value;var r=findResultIndex(e,n),o=[];if("string"==typeof t){var i=exports.FINDFIELD(e,t);o=utils.rest(e[i])}else o=utils.rest(e[t]);var a=[];return utils.arrayEach(r,function(e){a.push(o[e])}),maths.SUM(a)},exports.DVAR=function(e,t,n){if(isNaN(t)&&"string"!=typeof t)return error.value;var r=findResultIndex(e,n),o=[];if("string"==typeof t){var i=exports.FINDFIELD(e,t);o=utils.rest(e[i])}else o=utils.rest(e[t]);var a=[];return utils.arrayEach(r,function(e){a.push(o[e])}),stats.VAR.S(a)},exports.DVARP=function(e,t,n){if(isNaN(t)&&"string"!=typeof t)return error.value;var r=findResultIndex(e,n),o=[];if("string"==typeof t){var i=exports.FINDFIELD(e,t);o=utils.rest(e[i])}else o=utils.rest(e[t]);var a=[];return utils.arrayEach(r,function(e){a.push(o[e])}),stats.VAR.P(a)}},function(e,t,n){var r=n(0),o=n(1),i=n(7);t.AND=function(){for(var e=o.flatten(arguments),t=!0,n=0;n254?r.value:arguments.length0){var t=arguments[0],n=arguments.length-1,o=Math.floor(n/2),i=!1,a=n%2!=0,s=n%2==0?null:arguments[arguments.length-1];if(o)for(var l=0;la)return i.num;if(0!==l&&1!==l)return i.num;var u=t.PMT(e,n,r,0,l),c=0;1===o&&0===l&&(c=-r,o++);for(var f=o;f<=a;f++)c+=1===l?t.FV(e,f-2,u,r,1)-u:t.FV(e,f-1,u,r,0);return c*=e},t.CUMPRINC=function(e,n,r,o,a,l){if(e=s.parseNumber(e),n=s.parseNumber(n),r=s.parseNumber(r),s.anyIsError(e,n,r))return i.value;if(e<=0||n<=0||r<=0)return i.num;if(o<1||a<1||o>a)return i.num;if(0!==l&&1!==l)return i.num;var u=t.PMT(e,n,r,0,l),c=0;1===o&&(c=0===l?u+r*e:u,o++);for(var f=o;f<=a;f++)c+=l>0?u-(t.FV(e,f-2,u,r,1)-u)*e:u-t.FV(e,f-1,u,r,0)*e;return c},t.DB=function(e,t,n,r,o){if(o=void 0===o?12:o,e=s.parseNumber(e),t=s.parseNumber(t),n=s.parseNumber(n),r=s.parseNumber(r),o=s.parseNumber(o),s.anyIsError(e,t,n,r,o))return i.value;if(e<0||t<0||n<0||r<0)return i.num;if(-1===[1,2,3,4,5,6,7,8,9,10,11,12].indexOf(o))return i.num;if(r>n)return i.num;if(t>=e)return 0;for(var a=(1-Math.pow(t/e,1/n)).toFixed(3),l=e*a*o/12,u=l,c=0,f=r===n?n-1:r,h=2;h<=f;h++)c=(e-u)*a,u+=c;return 1===r?l:r===n?(e-u)*a:c},t.DDB=function(e,t,n,r,o){if(o=void 0===o?2:o,e=s.parseNumber(e),t=s.parseNumber(t),n=s.parseNumber(n),r=s.parseNumber(r),o=s.parseNumber(o),s.anyIsError(e,t,n,r,o))return i.value;if(e<0||t<0||n<0||r<0||o<=0)return i.num;if(r>n)return i.num;if(t>=e)return 0;for(var a=0,l=0,u=1;u<=r;u++)l=Math.min(o/n*(e-a),e-t-a),a+=l;return l},t.DISC=function(){throw new Error("DISC is not implemented")},t.DOLLARDE=function(e,t){if(e=s.parseNumber(e),t=s.parseNumber(t),s.anyIsError(e,t))return i.value;if(t<0)return i.num;if(t>=0&&t<1)return i.div0;t=parseInt(t,10);var n=parseInt(e,10);n+=e%1*Math.pow(10,Math.ceil(Math.log(t)/Math.LN10))/t;var r=Math.pow(10,Math.ceil(Math.log(t)/Math.LN2)+1);return n=Math.round(n*r)/r},t.DOLLARFR=function(e,t){if(e=s.parseNumber(e),t=s.parseNumber(t),s.anyIsError(e,t))return i.value;if(t<0)return i.num;if(t>=0&&t<1)return i.div0;t=parseInt(t,10);var n=parseInt(e,10);return n+=e%1*Math.pow(10,-Math.ceil(Math.log(t)/Math.LN10))*t},t.DURATION=function(){throw new Error("DURATION is not implemented")},t.EFFECT=function(e,t){return e=s.parseNumber(e),t=s.parseNumber(t),s.anyIsError(e,t)?i.value:e<=0||t<1?i.num:(t=parseInt(t,10),Math.pow(1+e/t,t)-1)},t.FV=function(e,t,n,r,o){if(r=r||0,o=o||0,e=s.parseNumber(e),t=s.parseNumber(t),n=s.parseNumber(n),r=s.parseNumber(r),o=s.parseNumber(o),s.anyIsError(e,t,n,r,o))return i.value;var a;if(0===e)a=r+n*t;else{var l=Math.pow(1+e,t);a=1===o?r*l+n*(1+e)*(l-1)/e:r*l+n*(l-1)/e}return-a},t.FVSCHEDULE=function(e,t){if(e=s.parseNumber(e),t=s.parseNumberArray(s.flatten(t)),s.anyIsError(e,t))return i.value;for(var n=t.length,r=e,o=0;o0&&(r=!0),e[a]<0&&(o=!0);if(!r||!o)return i.num;t=void 0===t?.1:t;var l,u,c,f=t,h=!0;do{c=function(e,t,n){for(var r=n+1,o=e[0],i=1;i1e-10&&Math.abs(c)>1e-10}while(h);return f},t.ISPMT=function(e,t,n,r){return e=s.parseNumber(e),t=s.parseNumber(t),n=s.parseNumber(n),r=s.parseNumber(r),s.anyIsError(e,t,n,r)?i.value:r*e*(t/n-1)},t.MDURATION=function(){throw new Error("MDURATION is not implemented")},t.MIRR=function(e,n,r){if(e=s.parseNumberArray(s.flatten(e)),n=s.parseNumber(n),r=s.parseNumber(r),s.anyIsError(e,n,r))return i.value;for(var o=e.length,a=[],l=[],u=0;u1e-10&&p<50;)g=(c*f-u*h)/(c-u),f=h,h=g,Math.abs(g)<1e-10?l=n*(1+e*g)+t*(1+g*o)*e+r:(d=Math.exp(e*Math.log(1+g)),l=n*d+t*(1/g+o)*(d-1)+r),u=c,c=l,++p;return g},t.RECEIVED=function(){throw new Error("RECEIVED is not implemented")},t.RRI=function(e,t,n){return e=s.parseNumber(e),t=s.parseNumber(t),n=s.parseNumber(n),s.anyIsError(e,t,n)?i.value:0===e||0===t?i.num:Math.pow(n/t,1/e)-1},t.SLN=function(e,t,n){return e=s.parseNumber(e),t=s.parseNumber(t),n=s.parseNumber(n),s.anyIsError(e,t,n)?i.value:0===n?i.num:(e-t)/n},t.SYD=function(e,t,n,r){return e=s.parseNumber(e),t=s.parseNumber(t),n=s.parseNumber(n),r=s.parseNumber(r),s.anyIsError(e,t,n,r)?i.value:0===n?i.num:r<1||r>n?i.num:(r=parseInt(r,10),(e-t)*(n-r+1)*2/(n*(n+1)))},t.TBILLEQ=function(e,t,n){return e=s.parseDate(e),t=s.parseDate(t),n=s.parseNumber(n),s.anyIsError(e,t,n)?i.value:n<=0?i.num:e>t?i.num:t-e>31536e6?i.num:365*n/(360-n*a.DAYS360(e,t,!1))},t.TBILLPRICE=function(e,t,n){return e=s.parseDate(e),t=s.parseDate(t),n=s.parseNumber(n),s.anyIsError(e,t,n)?i.value:n<=0?i.num:e>t?i.num:t-e>31536e6?i.num:100*(1-n*a.DAYS360(e,t,!1)/360)},t.TBILLYIELD=function(e,t,n){return e=s.parseDate(e),t=s.parseDate(t),n=s.parseNumber(n),s.anyIsError(e,t,n)?i.value:n<=0?i.num:e>t?i.num:t-e>31536e6?i.num:360*(100-n)/(n*a.DAYS360(e,t,!1))},t.VDB=function(){throw new Error("VDB is not implemented")},t.XNPV=function(e,t,n){if(e=s.parseNumber(e),t=s.parseNumberArray(s.flatten(t)),n=s.parseDateArray(s.flatten(n)),s.anyIsError(e,t,n))return i.value;for(var r=0,o=0;oi&&(o=a+1,i=t[a]):(o=a+1,i=t[a]))}else if(0===n){if("string"==typeof e){if(e=e.replace(/\?/g,"."),t[a].toLowerCase().match(e.toLowerCase()))return a+1}else if(t[a]===e)return a+1}else if(-1===n){if(t[a]===e)return a+1;t[a]>e&&(i?t[a]t}t.__esModule=!0,t.default=r,r.SYMBOL=t.SYMBOL=">"},function(e,t,n){"use strict";function r(e,t){return e>=t}t.__esModule=!0,t.default=r,r.SYMBOL=t.SYMBOL=">="},function(e,t,n){"use strict";function r(e,t){return e1?t-1:0),r=1;r1?t-1:0),r=1;r"},function(e,t,n){"use strict";function r(e,t){var n=Math.pow((0,o.toNumber)(e),(0,o.toNumber)(t));if(isNaN(n))throw Error(i.ERROR_VALUE);return n}t.__esModule=!0,t.SYMBOL=void 0,t.default=r;var o=n(3),i=n(2);r.SYMBOL=t.SYMBOL="^"},function(module,exports,__webpack_require__){(function(module,process){var grammarParser=function(){function Parser(){this.yy={}}var o=function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},$V0=[1,5],$V1=[1,8],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,14],$V6=[1,15],$V7=[1,16],$V8=[1,12],$V9=[1,13],$Va=[1,17],$Vb=[1,19],$Vc=[1,20],$Vd=[1,21],$Ve=[1,22],$Vf=[1,23],$Vg=[1,24],$Vh=[1,25],$Vi=[1,26],$Vj=[1,27],$Vk=[1,28],$Vl=[5,9,10,11,13,14,15,16,17,18,19,20,29,30],$Vm=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,32],$Vn=[5,9,10,11,13,14,15,16,17,18,19,20,29,30,34],$Vo=[5,10,11,13,14,15,16,17,29,30],$Vp=[5,10,13,14,15,16,29,30],$Vq=[5,10,11,13,14,15,16,17,18,19,29,30],$Vr=[13,29,30],parser={trace:function(){},yy:{},symbols_:{error:2,expressions:3,expression:4,EOF:5,variableSequence:6,number:7,STRING:8,"&":9,"=":10,"+":11,"(":12,")":13,"<":14,">":15,NOT:16,"-":17,"*":18,"/":19,"^":20,FUNCTION:21,expseq:22,cell:23,ABSOLUTE_CELL:24,RELATIVE_CELL:25,MIXED_CELL:26,":":27,ARRAY:28,";":29,",":30,VARIABLE:31,DECIMAL:32,NUMBER:33,"%":34,ERROR:35,$accept:0,$end:1},terminals_:{5:"EOF",8:"STRING",9:"&",10:"=",11:"+",12:"(",13:")",14:"<",15:">",16:"NOT",17:"-",18:"*",19:"/",20:"^",21:"FUNCTION",24:"ABSOLUTE_CELL",25:"RELATIVE_CELL",26:"MIXED_CELL",27:":",28:"ARRAY",29:";",30:",",31:"VARIABLE",32:"DECIMAL",33:"NUMBER",34:"%",35:"ERROR"},productions_:[0,[3,2],[4,1],[4,1],[4,1],[4,3],[4,3],[4,3],[4,3],[4,4],[4,4],[4,4],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,2],[4,3],[4,4],[4,1],[4,1],[4,2],[23,1],[23,1],[23,1],[23,3],[23,3],[23,3],[23,3],[23,3],[23,3],[23,3],[23,3],[23,3],[22,1],[22,1],[22,3],[22,3],[6,1],[6,3],[7,1],[7,3],[7,2],[2,1]],performAction:function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:return $$[$0-1];case 2:this.$=yy.callVariable($$[$0][0]);break;case 3:this.$=yy.toNumber($$[$0]);break;case 4:this.$=yy.trimEdges($$[$0]);break;case 5:this.$=yy.evaluateByOperator("&",[$$[$0-2],$$[$0]]);break;case 6:this.$=yy.evaluateByOperator("=",[$$[$0-2],$$[$0]]);break;case 7:this.$=yy.evaluateByOperator("+",[$$[$0-2],$$[$0]]);break;case 8:this.$=$$[$0-1];break;case 9:this.$=yy.evaluateByOperator("<=",[$$[$0-3],$$[$0]]);break;case 10:this.$=yy.evaluateByOperator(">=",[$$[$0-3],$$[$0]]);break;case 11:this.$=yy.evaluateByOperator("<>",[$$[$0-3],$$[$0]]);break;case 12:this.$=yy.evaluateByOperator("NOT",[$$[$0-2],$$[$0]]);break;case 13:this.$=yy.evaluateByOperator(">",[$$[$0-2],$$[$0]]);break;case 14:this.$=yy.evaluateByOperator("<",[$$[$0-2],$$[$0]]);break;case 15:this.$=yy.evaluateByOperator("-",[$$[$0-2],$$[$0]]);break;case 16:this.$=yy.evaluateByOperator("*",[$$[$0-2],$$[$0]]);break;case 17:this.$=yy.evaluateByOperator("/",[$$[$0-2],$$[$0]]);break;case 18:this.$=yy.evaluateByOperator("^",[$$[$0-2],$$[$0]]);break;case 19:var n1=yy.invertNumber($$[$0]);this.$=n1,isNaN(this.$)&&(this.$=0);break;case 20:var n1=yy.toNumber($$[$0]);this.$=n1,isNaN(this.$)&&(this.$=0);break;case 21:this.$=yy.callFunction($$[$0-2]);break;case 22:this.$=yy.callFunction($$[$0-3],$$[$0-1]);break;case 26:case 27:case 28:this.$=yy.cellValue($$[$0]);break;case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:this.$=yy.rangeValue($$[$0-2],$$[$0]);break;case 38:case 42:this.$=[$$[$0]];break;case 39:var result=[],arr=eval("["+yytext+"]");arr.forEach(function(e){result.push(e)}),this.$=result;break;case 40:case 41:$$[$0-2].push($$[$0]),this.$=$$[$0-2];break;case 43:this.$=Array.isArray($$[$0-2])?$$[$0-2]:[$$[$0-2]],this.$.push($$[$0]);break;case 44:this.$=$$[$0];break;case 45:this.$=1*($$[$0-2]+"."+$$[$0]);break;case 46:this.$=.01*$$[$0-1];break;case 47:this.$=yy.throwError($$[$0])}},table:[{2:11,3:1,4:2,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{1:[3]},{5:[1,18],9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk},o($Vl,[2,2],{32:[1,29]}),o($Vl,[2,3],{34:[1,30]}),o($Vl,[2,4]),{2:11,4:31,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:32,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:33,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{12:[1,34]},o($Vl,[2,23]),o($Vl,[2,24],{2:35,35:$Va}),o($Vm,[2,42]),o($Vn,[2,44],{32:[1,36]}),o($Vl,[2,26],{27:[1,37]}),o($Vl,[2,27],{27:[1,38]}),o($Vl,[2,28],{27:[1,39]}),o([5,9,10,11,13,14,15,16,17,18,19,20,29,30,35],[2,47]),{1:[2,1]},{2:11,4:40,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:41,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:42,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:45,6:3,7:4,8:$V0,10:[1,43],11:$V1,12:$V2,15:[1,44],17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:47,6:3,7:4,8:$V0,10:[1,46],11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:48,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:49,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:50,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:51,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:52,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{31:[1,53]},o($Vn,[2,46]),{9:$Vb,10:$Vc,11:$Vd,13:[1,54],14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk},o($Vo,[2,19],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),o($Vo,[2,20],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:57,6:3,7:4,8:$V0,11:$V1,12:$V2,13:[1,55],17:$V3,21:$V4,22:56,23:10,24:$V5,25:$V6,26:$V7,28:[1,58],31:$V8,33:$V9,35:$Va},o($Vl,[2,25]),{33:[1,59]},{24:[1,60],25:[1,61],26:[1,62]},{24:[1,63],25:[1,64],26:[1,65]},{24:[1,66],25:[1,67],26:[1,68]},o($Vl,[2,5]),o([5,10,13,29,30],[2,6],{9:$Vb,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vo,[2,7],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:69,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:70,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},o($Vp,[2,14],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),{2:11,4:71,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},o($Vp,[2,13],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o([5,10,13,16,29,30],[2,12],{9:$Vb,11:$Vd,14:$Ve,15:$Vf,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vo,[2,15],{9:$Vb,18:$Vi,19:$Vj,20:$Vk}),o($Vq,[2,16],{9:$Vb,20:$Vk}),o($Vq,[2,17],{9:$Vb,20:$Vk}),o([5,10,11,13,14,15,16,17,18,19,20,29,30],[2,18],{9:$Vb}),o($Vm,[2,43]),o($Vl,[2,8]),o($Vl,[2,21]),{13:[1,72],29:[1,73],30:[1,74]},o($Vr,[2,38],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vr,[2,39]),o($Vn,[2,45]),o($Vl,[2,29]),o($Vl,[2,30]),o($Vl,[2,31]),o($Vl,[2,32]),o($Vl,[2,33]),o($Vl,[2,34]),o($Vl,[2,35]),o($Vl,[2,36]),o($Vl,[2,37]),o($Vp,[2,9],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,11],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vp,[2,10],{9:$Vb,11:$Vd,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vl,[2,22]),{2:11,4:75,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},{2:11,4:76,6:3,7:4,8:$V0,11:$V1,12:$V2,17:$V3,21:$V4,23:10,24:$V5,25:$V6,26:$V7,31:$V8,33:$V9,35:$Va},o($Vr,[2,40],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk}),o($Vr,[2,41],{9:$Vb,10:$Vc,11:$Vd,14:$Ve,15:$Vf,16:$Vg,17:$Vh,18:$Vi,19:$Vj,20:$Vk})],defaultActions:{18:[2,1]},parseError:function(e,t){function n(e,t){this.message=e,this.hash=t}if(!t.recoverable)throw n.prototype=Error,new n(e,t);this.trace(e)},parse:function(e){function t(e){for(var t=r.length-1,n=0;;){if(f.toString()in a[e])return n;if(0===e||t<2)return!1;t-=2,e=r[t],++n}}var n=this,r=[0],o=[null],i=[],a=this.table,s="",l=0,u=0,c=0,f=2,h=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(e,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var v=d.yylloc;i.push(v);var m=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var y,w,b,C,_,E,O,S,T,R=function(){var e;return e=d.lex()||1,"number"!=typeof e&&(e=n.symbols_[e]||e),e},M={};;){if(b=r[r.length-1],this.defaultActions[b]?C=this.defaultActions[b]:(null!==y&&void 0!==y||(y=R()),C=a[b]&&a[b][y]),void 0===C||!C.length||!C[0]){var k,N="";if(c)1!==w&&(k=t(b));else{k=t(b),T=[];for(E in a[b])this.terminals_[E]&&E>f&&T.push("'"+this.terminals_[E]+"'");N=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(N,{text:d.match,token:this.terminals_[y]||y,line:d.yylineno,loc:v,expected:T,recoverable:!1!==k})}if(3==c){if(1===y||1===w)throw new Error(N||"Parsing halted while starting to recover from another error.");u=d.yyleng,s=d.yytext,l=d.yylineno,v=d.yylloc,y=R()}if(!1===k)throw new Error(N||"Parsing halted. No suitable error recovery rule available.");!function(e){r.length=r.length-2*e,o.length=o.length-e,i.length=i.length-e}(k),w=y==f?null:y,y=f,b=r[r.length-1],C=a[b]&&a[b][f],c=3}if(C[0]instanceof Array&&C.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+y);switch(C[0]){case 1:r.push(y),o.push(d.yytext),i.push(d.yylloc),r.push(C[1]),y=null,w?(y=w,w=null):(u=d.yyleng,s=d.yytext,l=d.yylineno,v=d.yylloc,c>0&&c--);break;case 2:if(O=this.productions_[C[1]][1],M.$=o[o.length-O],M._$={first_line:i[i.length-(O||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(O||1)].first_column,last_column:i[i.length-1].last_column},m&&(M._$.range=[i[i.length-(O||1)].range[0],i[i.length-1].range[1]]),void 0!==(_=this.performAction.apply(M,[s,u,l,p.yy,C[1],o,i].concat(h))))return _;O&&(r=r.slice(0,-1*O*2),o=o.slice(0,-1*O),i=i.slice(0,-1*O)),r.push(this.productions_[C[1]][0]),o.push(M.$),i.push(M._$),S=a[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}},lexer=function(){return{EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var o=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[o[0],o[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var n,r,o;if(this.options.backtrack_lexer&&(o={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(o.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var i in o)this[i]=o[i];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),i=0;it[0].length)){if(t=n,r=i,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,o[i])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,o[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,n,r){switch(n){case 0:break;case 1:case 2:return 8;case 3:return 21;case 4:return 35;case 5:return 24;case 6:case 7:return 26;case 8:return 25;case 9:return 21;case 10:case 11:return 31;case 12:return 33;case 13:return 28;case 14:return 9;case 15:return" ";case 16:return 32;case 17:return 27;case 18:return 29;case 19:return 30;case 20:return 18;case 21:return 19;case 22:return 17;case 23:return 11;case 24:return 20;case 25:return 12;case 26:return 13;case 27:return 15;case 28:return 14;case 29:return 16;case 30:return'"';case 31:return"'";case 32:return"!";case 33:return 10;case 34:return 34;case 35:return"#";case 36:return 5}},rules:[/^(?:\s+)/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:[A-Za-z]{1,}[A-Za-z_0-9\.]+(?=[(]))/,/^(?:#[A-Z0-9\/]+(!|\?)?)/,/^(?:\$[A-Za-z]+\$[0-9]+)/,/^(?:\$[A-Za-z]+[0-9]+)/,/^(?:[A-Za-z]+\$[0-9]+)/,/^(?:[A-Za-z]+[0-9]+)/,/^(?:[A-Za-z\.]+(?=[(]))/,/^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/,/^(?:[A-Za-z_]+)/,/^(?:[0-9]+)/,/^(?:\[(.*)?\])/,/^(?:&)/,/^(?: )/,/^(?:[.])/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\/)/,/^(?:-)/,/^(?:\+)/,/^(?:\^)/,/^(?:\()/,/^(?:\))/,/^(?:>)/,/^(?:<)/,/^(?:NOT\b)/,/^(?:")/,/^(?:')/,/^(?:!)/,/^(?:=)/,/^(?:%)/,/^(?:[#])/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],inclusive:!0}}}}();return parser.lexer=lexer,Parser.prototype=parser,parser.Parser=Parser,new Parser}();exports.parser=grammarParser,exports.Parser=grammarParser.Parser,exports.parse=function(){return grammarParser.parse.apply(grammarParser,arguments)},void 0!==module&&__webpack_require__.c[__webpack_require__.s]===module&&exports.main(process.argv.slice(1))}).call(exports,__webpack_require__(42)(module),__webpack_require__(10))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e=e.substring(t,e.length-t)}t.__esModule=!0,t.trimEdges=r}])})},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.arrayEach)(this.cells,function(e){null!==n&&void 0!==n&&t._translateCell(e,"row",n,o.row),null!==r&&void 0!==r&&t._translateCell(e,"column",r,o.column)}),this}},{key:"toString",value:function(){var e=this,t=this.expression.replace(v,function(t,n,r){var o=-1===t.indexOf(":"),i=t,s=t,l=null;o&&(s=h.test(n)?n:r);var u=e._searchCell(s);return u&&(l=u.refError?(0,a.error)(a.ERROR_REF):u.toLabel(),i=o?t.replace(s,l):l),i});return t.startsWith("=")||(t="="+t),t}},{key:"_translateCell",value:function(e,t,n,r){var i=e.start,a=e.end,s=i[t].index,l=a[t].index,u=n,c=n,f=!1;if(this.customModifier){var h=this.customModifier(e,t,n,r),d=o(h,3);u=d[0],c=d[1],f=d[2]}else i[t].isAbsolute&&(u=0),a[t].isAbsolute&&(c=0);u&&!f&&(s+u<0&&(f=!0),i[t].index=Math.max(s+u,0)),c&&!f&&(l+c<0&&(f=!0),a[t].index=Math.max(l+c,0)),f&&(e.refError=!0)}},{key:"_extractCells",value:function(){var e=this,t=this.expression.match(p);t&&(0,s.arrayEach)(t,function(t){var n=t.match(d);if(n){var r=(0,a.extractLabel)(n[0]),i=o(r,2),s=i[0],l=i[1];e.cells.push(e._createCell({row:s,column:l},{row:s,column:l},n[0]))}})}},{key:"_extractCellsRange",value:function(){var e=this,t=this.expression.match(g);t&&(0,s.arrayEach)(t,function(t){var n=t.split(":"),r=o(n,2),i=r[0],s=r[1],l=(0,a.extractLabel)(i),u=o(l,2),c=u[0],f=u[1],h=(0,a.extractLabel)(s),d=o(h,2);e.cells.push(e._createCell({row:c,column:f},{row:d[0],column:d[1]},t))})}},{key:"_searchCell",value:function(e){var t=(0,s.arrayFilter)(this.cells,function(t){return t.origLabel===e});return o(t,1)[0]||null}},{key:"_createCell",value:function(e,t,n){return{start:e,end:t,origLabel:n,type:-1===n.indexOf(":")?"cell":"range",refError:!1,toLabel:function(){var e=(0,a.toLabel)(this.start.row,this.start.column);return"range"===this.type&&(e+=":"+(0,a.toLabel)(this.end.row,this.end.column)),e}}}}]),e}();(0,l.mixin)(m,c.default),t.default=m},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(71),o=Math.max,i=Math.min;e.exports=function(e,t){return e=r(e),e<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(36);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(38),o=n(174),i=n(175),a=n(22),s=n(30),l=n(176),u={},c={},t=e.exports=function(e,t,n,f,h){var d,p,g,v,m=h?function(){return e}:l(e),y=r(n,f,t?2:1),w=0;if("function"!=typeof m)throw TypeError(e+" is not iterable!");if(i(m)){for(d=s(e.length);d>w;w++)if((v=t?y(a(p=e[w])[0],p[1]):y(e[w]))===u||v===c)return v}else for(g=m.call(e);!(p=g.next()).done;)if((v=o(g,y,p.value,t))===u||v===c)return v};t.BREAK=u,t.RETURN=c},function(e,t,n){"use strict";var r=n(16),o=n(7),i=n(36),a=n(73),s=n(40),l=n(76),u=n(75),c=n(13),f=n(28),h=n(98),d=n(61),p=n(487);e.exports=function(e,t,n,g,v,m){var y=r[e],w=y,b=v?"set":"add",C=w&&w.prototype,_={},E=function(e){var t=C[e];i(C,e,"delete"==e?function(e){return!(m&&!c(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(m&&!c(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return m&&!c(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof w&&(m||C.forEach&&!f(function(){(new w).entries().next()}))){var O=new w,S=O[b](m?{}:-0,1)!=O,T=f(function(){O.has(1)}),R=h(function(e){new w(e)}),M=!m&&f(function(){for(var e=new w,t=5;t--;)e[b](t,t);return!e.has(-0)});R||(w=t(function(t,n){u(t,w,e);var r=p(new y,t,w);return void 0!=n&&l(n,v,r[b],r),r}),w.prototype=C,C.constructor=w),(T||M)&&(E("delete"),E("has"),v&&E("get")),(M||S)&&E(b),m&&C.clear&&delete C.clear}else w=g.getConstructor(t,e,v,b),a(w.prototype,n),s.NEED=!0;return d(w,e),_[e]=w,o(o.G+o.W+o.F*(w!=y),_),m||g.setStrong(w,e,v),w}},function(e,t,n){var r=n(62),o=n(59),i=n(29),a=n(92),s=n(35),l=n(170),u=Object.getOwnPropertyDescriptor;t.f=n(27)?u:function(e,t){if(e=i(e),t=a(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(38),o=n(94),i=n(39),a=n(30),s=n(488);e.exports=function(e,t){var n=1==e,l=2==e,u=3==e,c=4==e,f=6==e,h=5==e||f,d=t||s;return function(t,s,p){for(var g,v,m=i(t),y=o(m),w=r(s,p,3),b=a(y.length),C=0,_=n?d(t,b):l?d(t,0):void 0;b>C;C++)if((h||C in y)&&(g=y[C],v=w(g,C,m),e))if(n)_[C]=v;else if(v)switch(e){case 3:return!0;case 5:return g;case 6:return C;case 2:_.push(g)}else if(c)return!1;return f?-1:u||c?c:_}}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){"use strict";var r=n(37),o=n(36),i=n(28),a=n(47),s=n(14);e.exports=function(e,t,n){var l=s(e),u=n(a,l,""[e]),c=u[0],f=u[1];i(function(){var t={};return t[l]=function(){return 7},7!=""[e](t)})&&(o(String.prototype,e,c),r(RegExp.prototype,l,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){"use strict";var r=n(54),o=n(180),i=n(60),a=n(29);e.exports=n(178)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):"keys"==t?o(0,n):"values"==t?o(0,e[n]):o(0,[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";function r(e){for(var t=e+1,n="",r=void 0;t>0;)r=(t-1)%d,n=String.fromCharCode(65+r)+n,t=parseInt((t-r)/d,10);return n}function o(e){var t=0;if(e)for(var n=0,r=e.length-1;n0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=[],o=void 0,i=void 0;for(o=0;o0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=[],o=void 0,i=void 0;for(o=0;o0&&(p-=1),0===p&&i()}function i(){h.clearEvents(),d.clear(),p=0}function a(e){return Array.from(d.values()).some(function(t){return(0,f.isKey)(t,e)})}function s(){return Array.from(d.values()).some(function(e){return(0,f.isCtrlMetaKey)(e)})}function l(){return p}t.__esModule=!0,t.stopObserving=t.startObserving=t.isPressedCtrlKey=t.isPressed=t._resetState=t._getRefCount=void 0;var u=n(9),c=function(e){return e&&e.__esModule?e:{default:e}}(u),f=n(18),h=new c.default,d=new Set,p=0;t._getRefCount=l,t._resetState=i,t.isPressed=a,t.isPressedCtrlKey=s,t.startObserving=r,t.stopObserving=o},function(e,t,n){"use strict";function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w;if(t!==w&&t!==b)throw new Error("The second argument is used internally only and cannot be overwritten.");var n=Array.isArray(e),o=t===w,i=d;if(n){var a=e[0];if(0===e.length)i=p;else if(o&&a instanceof c.CellRange)i=v;else if(o&&Array.isArray(a))i=r(a,b);else if(e.length>=2&&e.length<=4){var s=!e.some(function(e,t){return!y[t].includes(void 0===e?"undefined":u(e))});s&&(i=g)}}return i}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.keepDirection,r=void 0!==n&&n,o=t.propToCol;if(!m.includes(e))throw new Error("Unsupported selection ranges schema type was provided.");return function(t){var n=e===v,i=n?t.from.row:t[0],a=n?t.from.col:t[1],s=n?t.to.row:t[2],l=n?t.to.col:t[3];if("function"==typeof o&&("string"==typeof a&&(a=o(a)),"string"==typeof l&&(l=o(l))),(0,h.isUndefined)(s)&&(s=i),(0,h.isUndefined)(l)&&(l=a),!r){var u=i,c=a,f=s,d=l;i=Math.min(u,f),a=Math.min(c,d),s=Math.max(u,f),l=Math.max(c,d)}return[i,a,s,l]}}function i(e){var t=r(e);if(t===d||t===p)return[];var n=o(t),i=new Set;(0,f.arrayEach)(e,function(e){var t=n(e),r=l(t,4),o=r[1],a=r[3],s=a-o+1;(0,f.arrayEach)(Array.from(new Array(s),function(e,t){return o+t}),function(e){i.has(e)||i.add(e)})});var a=Array.from(i).sort(function(e,t){return e-t});return(0,f.arrayReduce)(a,function(e,t,n,r){return 0!==n&&t===r[n-1]+1?e[e.length-1][1]+=1:e.push([t,1]),e},[])}function a(e){var t=r(e);if(t===d||t===p)return[];var n=o(t),i=new Set;(0,f.arrayEach)(e,function(e){var t=n(e),r=l(t,3),o=r[0],a=r[2],s=a-o+1;(0,f.arrayEach)(Array.from(new Array(s),function(e,t){return o+t}),function(e){i.has(e)||i.add(e)})});var a=Array.from(i).sort(function(e,t){return e-t});return(0,f.arrayReduce)(a,function(e,t,n,r){return 0!==n&&t===r[n-1]+1?e[e.length-1][1]+=1:e.push([t,1]),e},[])}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0;return"number"==typeof e&&e>=0&&e0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(o(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(o(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){var r=n(13),o=n(16).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(13);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(22),o=n(485),i=n(97),a=n(95)("IE_PROTO"),s=function(){},l=function(){var e,t=n(91)("iframe"),r=i.length;for(t.style.display="none",n(173).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("