UNPKG

handsontable

Version:

Handsontable is a JavaScript Spreadsheet Component available for React, Angular and Vue.

1,709 lines (1,424 loc) 3.16 MB
/*! * Copyright (c) HANDSONCODE sp. z o. o. * * HANDSONTABLE is a software distributed by HANDSONCODE sp. z o. o., * a Polish corporation, based in Gdynia, Poland, at 96/98 Aleja Zwycięstwa, * registered with the National Court Register under number 538651, * EU tax ID number: PL5862294002, share capital: PLN 62,800.00. * * This software is protected by applicable copyright laws, including * international treaties, and dual-licensed – depending on whether * your use is intended for or may result in commercial advantage * or monetary compensation (commercial purposes), or not. * * If your use involves only such purposes as research, private study, * evaluation and the like, you agree to be bound by the terms included * in the "handsontable-non-commercial-license.pdf" file, available * in the main directory of this software repository. * * By installing, copying, or otherwise using this software for * commercial purposes, you agree to be bound by the terms included * in the "handsontable-general-terms.pdf" file, available in the main * directory of this software repository. * * HANDSONCODE PROVIDES THIS SOFTWARE ON AN "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND. IN NO EVENT * AND UNDER NO LEGAL THEORY, SHALL HANDSONCODE BE LIABLE * TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, * INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING * FROM USE OR INABILITY TO USE THIS SOFTWARE. * * Version: 9.0.1 * Release date: 17/06/2021 (built at 17/06/2021 09:14:18) */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("moment"), require("dompurify"), require("pikaday"), require("numbro")); else if(typeof define === 'function' && define.amd) define("Handsontable", ["moment", "dompurify", "pikaday", "numbro"], factory); else if(typeof exports === 'object') exports["Handsontable"] = factory(require("moment"), require("dompurify"), require("pikaday"), require("numbro")); else root["Handsontable"] = factory(root["moment"], root["DOMPurify"], root["Pikaday"], root["numbro"]); })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__81__, __WEBPACK_EXTERNAL_MODULE__353__, __WEBPACK_EXTERNAL_MODULE__444__, __WEBPACK_EXTERNAL_MODULE__458__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 324); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } module.exports = _interopRequireDefault; module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), /* 1 */ /***/ (function(module, exports) { function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } module.exports = _classCallCheck; module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), /* 2 */ /***/ (function(module, exports) { 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } module.exports = _createClass; module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { var TO_STRING_TAG_SUPPORT = __webpack_require__(171); var redefine = __webpack_require__(79); var toString = __webpack_require__(329); // `Object.prototype.toString` method // https://tc39.es/ecma262/#sec-object.prototype.tostring if (!TO_STRING_TAG_SUPPORT) { redefine(Object.prototype, 'toString', toString, { unsafe: true }); } /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var charAt = __webpack_require__(172).charAt; var InternalStateModule = __webpack_require__(91); var defineIterator = __webpack_require__(168); var STRING_ITERATOR = 'String Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-string.prototype-@@iterator defineIterator(String, 'String', function (iterated) { setInternalState(this, { type: STRING_ITERATOR, string: String(iterated), index: 0 }); // `%StringIteratorPrototype%.next` method // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next }, function next() { var state = getInternalState(this); var string = state.string; var index = state.index; var point; if (index >= string.length) return { value: undefined, done: true }; point = charAt(string, index); state.index += point.length; return { value: point, done: false }; }); /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toIndexedObject = __webpack_require__(72); var addToUnscopables = __webpack_require__(111); var Iterators = __webpack_require__(117); var InternalStateModule = __webpack_require__(91); var defineIterator = __webpack_require__(168); var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method // https://tc39.es/ecma262/#sec-array.prototype.entries // `Array.prototype.keys` method // https://tc39.es/ecma262/#sec-array.prototype.keys // `Array.prototype.values` method // https://tc39.es/ecma262/#sec-array.prototype.values // `Array.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-array.prototype-@@iterator // `CreateArrayIterator` internal method // https://tc39.es/ecma262/#sec-createarrayiterator module.exports = defineIterator(Array, 'Array', function (iterated, kind) { setInternalState(this, { type: ARRAY_ITERATOR, target: toIndexedObject(iterated), // target index: 0, // next index kind: kind // kind }); // `%ArrayIteratorPrototype%.next` method // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next }, function () { var state = getInternalState(this); var target = state.target; var kind = state.kind; var index = state.index++; if (!target || index >= target.length) { state.target = undefined; return { value: undefined, done: true }; } if (kind == 'keys') return { value: index, done: false }; if (kind == 'values') return { value: target[index], done: false }; return { value: [index, target[index]], done: false }; }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% // https://tc39.es/ecma262/#sec-createunmappedargumentsobject // https://tc39.es/ecma262/#sec-createmappedargumentsobject Iterators.Arguments = Iterators.Array; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(41); var DOMIterables = __webpack_require__(231); var ArrayIteratorMethods = __webpack_require__(5); var createNonEnumerableProperty = __webpack_require__(78); var wellKnownSymbol = __webpack_require__(42); var ITERATOR = wellKnownSymbol('iterator'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var ArrayValues = ArrayIteratorMethods.values; for (var COLLECTION_NAME in DOMIterables) { var Collection = global[COLLECTION_NAME]; var CollectionPrototype = Collection && Collection.prototype; if (CollectionPrototype) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype[ITERATOR] !== ArrayValues) try { createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues); } catch (error) { CollectionPrototype[ITERATOR] = ArrayValues; } if (!CollectionPrototype[TO_STRING_TAG]) { createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); } if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); } catch (error) { CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; } } } } /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var global = __webpack_require__(41); var redefineAll = __webpack_require__(173); var InternalMetadataModule = __webpack_require__(119); var collection = __webpack_require__(145); var collectionWeak = __webpack_require__(230); var isObject = __webpack_require__(47); var enforceIternalState = __webpack_require__(91).enforce; var NATIVE_WEAK_MAP = __webpack_require__(217); var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; // eslint-disable-next-line es/no-object-isextensible -- safe var isExtensible = Object.isExtensible; var InternalWeakMap; var wrapper = function (init) { return function WeakMap() { return init(this, arguments.length ? arguments[0] : undefined); }; }; // `WeakMap` constructor // https://tc39.es/ecma262/#sec-weakmap-constructor var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak); // IE11 WeakMap frozen keys fix // We can't use feature detection because it crash some old IE builds // https://github.com/zloirock/core-js/issues/485 if (NATIVE_WEAK_MAP && IS_IE11) { InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true); InternalMetadataModule.REQUIRED = true; var WeakMapPrototype = $WeakMap.prototype; var nativeDelete = WeakMapPrototype['delete']; var nativeHas = WeakMapPrototype.has; var nativeGet = WeakMapPrototype.get; var nativeSet = WeakMapPrototype.set; redefineAll(WeakMapPrototype, { 'delete': function (key) { if (isObject(key) && !isExtensible(key)) { var state = enforceIternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeDelete.call(this, key) || state.frozen['delete'](key); } return nativeDelete.call(this, key); }, has: function has(key) { if (isObject(key) && !isExtensible(key)) { var state = enforceIternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeHas.call(this, key) || state.frozen.has(key); } return nativeHas.call(this, key); }, get: function get(key) { if (isObject(key) && !isExtensible(key)) { var state = enforceIternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeHas.call(this, key) ? nativeGet.call(this, key) : state.frozen.get(key); } return nativeGet.call(this, key); }, set: function set(key, value) { if (isObject(key) && !isExtensible(key)) { var state = enforceIternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); nativeHas.call(this, key) ? nativeSet.call(this, key, value) : state.frozen.set(key, value); } else nativeSet.call(this, key, value); return this; } }); } /***/ }), /* 8 */ /***/ (function(module, exports) { function _getPrototypeOf(o) { module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; module.exports["default"] = module.exports, module.exports.__esModule = true; return _getPrototypeOf(o); } module.exports = _getPrototypeOf; module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__(23); var getBuiltIn = __webpack_require__(100); var aFunction = __webpack_require__(102); var anObject = __webpack_require__(50); var isObject = __webpack_require__(47); var create = __webpack_require__(101); var bind = __webpack_require__(358); var fails = __webpack_require__(31); var nativeConstruct = getBuiltIn('Reflect', 'construct'); // `Reflect.construct` method // https://tc39.es/ecma262/#sec-reflect.construct // MS Edge supports only 2 arguments and argumentsList argument is optional // FF Nightly sets third argument as `new.target`, but does not create `this` from it var NEW_TARGET_BUG = fails(function () { function F() { /* empty */ } return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F); }); var ARGS_BUG = !fails(function () { nativeConstruct(function () { /* empty */ }); }); var FORCED = NEW_TARGET_BUG || ARGS_BUG; $({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, { construct: function construct(Target, args /* , newTarget */) { aFunction(Target); anObject(args); var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget); if (Target == newTarget) { // w/o altered newTarget, optimization for 0-4 arguments switch (args.length) { case 0: return new Target(); case 1: return new Target(args[0]); case 2: return new Target(args[0], args[1]); case 3: return new Target(args[0], args[1], args[2]); case 4: return new Target(args[0], args[1], args[2], args[3]); } // w/o altered newTarget, lot of arguments case var $args = [null]; $args.push.apply($args, args); return new (bind.apply(Target, $args))(); } // with altered newTarget, not support built-in constructors var proto = newTarget.prototype; var instance = create(isObject(proto) ? proto : Object.prototype); var result = Function.apply.call(Target, instance, args); return isObject(result) ? result : instance; } }); /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { var setPrototypeOf = __webpack_require__(251); function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) setPrototypeOf(subClass, superClass); } module.exports = _inherits; module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { var _typeof = __webpack_require__(14)["default"]; var assertThisInitialized = __webpack_require__(29); function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return assertThisInitialized(self); } module.exports = _possibleConstructorReturn; module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__(0); exports.__esModule = true; exports.duckSchema = duckSchema; exports.inherit = inherit; exports.extend = extend; exports.deepExtend = deepExtend; exports.deepClone = deepClone; exports.clone = clone; exports.mixin = mixin; exports.isObjectEqual = isObjectEqual; exports.isObject = isObject; exports.defineGetter = defineGetter; exports.objectEach = objectEach; exports.getProperty = getProperty; exports.setProperty = setProperty; exports.deepObjectSize = deepObjectSize; exports.createObjectPropListener = createObjectPropListener; exports.hasOwnProperty = hasOwnProperty; __webpack_require__(25); __webpack_require__(33); __webpack_require__(3); __webpack_require__(36); __webpack_require__(66); __webpack_require__(24); var _defineProperty2 = _interopRequireDefault(__webpack_require__(35)); var _typeof2 = _interopRequireDefault(__webpack_require__(14)); var _array = __webpack_require__(13); /** * Generate schema for passed object. * * @param {Array|object} object An object to analyze. * @returns {Array|object} */ function duckSchema(object) { var schema; if (Array.isArray(object)) { schema = []; } else { schema = {}; objectEach(object, function (value, key) { if (key === '__children') { return; } if (value && (0, _typeof2.default)(value) === 'object' && !Array.isArray(value)) { schema[key] = duckSchema(value); } else if (Array.isArray(value)) { if (value.length && (0, _typeof2.default)(value[0]) === 'object' && !Array.isArray(value[0])) { schema[key] = [duckSchema(value[0])]; } else { schema[key] = []; } } else { schema[key] = null; } }); } return schema; } /** * Inherit without without calling parent constructor, and setting `Child.prototype.constructor` to `Child` instead of `Parent`. * Creates temporary dummy function to call it as constructor. * Described in ticket: https://github.com/handsontable/handsontable/pull/516. * * @param {object} Child The child class. * @param {object} Parent The parent class. * @returns {object} */ function inherit(Child, Parent) { Parent.prototype.constructor = Parent; Child.prototype = new Parent(); Child.prototype.constructor = Child; return Child; } /** * Perform shallow extend of a target object with extension's own properties. * * @param {object} target An object that will receive the new properties. * @param {object} extension An object containing additional properties to merge into the target. * @param {string[]} [writableKeys] An array of keys that are writable to target object. * @returns {object} */ function extend(target, extension, writableKeys) { var hasWritableKeys = Array.isArray(writableKeys); objectEach(extension, function (value, key) { if (hasWritableKeys === false || writableKeys.includes(key)) { target[key] = value; } }); return target; } /** * Perform deep extend of a target object with extension's own properties. * * @param {object} target An object that will receive the new properties. * @param {object} extension An object containing additional properties to merge into the target. */ function deepExtend(target, extension) { objectEach(extension, function (value, key) { if (extension[key] && (0, _typeof2.default)(extension[key]) === 'object') { if (!target[key]) { if (Array.isArray(extension[key])) { target[key] = []; } else if (Object.prototype.toString.call(extension[key]) === '[object Date]') { target[key] = extension[key]; } else { target[key] = {}; } } deepExtend(target[key], extension[key]); } else { target[key] = extension[key]; } }); } /** * Perform deep clone of an object. * WARNING! Only clones JSON properties. Will cause error when `obj` contains a function, Date, etc. * * @param {object} obj An object that will be cloned. * @returns {object} */ function deepClone(obj) { if ((0, _typeof2.default)(obj) === 'object') { return JSON.parse(JSON.stringify(obj)); } return obj; } /** * Shallow clone object. * * @param {object} object An object to clone. * @returns {object} */ function clone(object) { var result = {}; objectEach(object, function (value, key) { result[key] = value; }); return result; } /** * Extend the Base object (usually prototype) of the functionality the `mixins` objects. * * @param {object} Base Base object which will be extended. * @param {object} mixins The object of the functionality will be "copied". * @returns {object} */ function mixin(Base) { if (!Base.MIXINS) { Base.MIXINS = []; } for (var _len = arguments.length, mixins = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { mixins[_key - 1] = arguments[_key]; } (0, _array.arrayEach)(mixins, function (mixinItem) { Base.MIXINS.push(mixinItem.MIXIN_NAME); objectEach(mixinItem, function (value, key) { if (Base.prototype[key] !== void 0) { throw new Error("Mixin conflict. Property '".concat(key, "' already exist and cannot be overwritten.")); } if (typeof value === 'function') { Base.prototype[key] = value; } else { var getter = function _getter(property, initialValue) { var propertyName = "_".concat(property); var initValue = function initValue(newValue) { var result = newValue; if (Array.isArray(result) || isObject(result)) { result = deepClone(result); } return result; }; return function () { if (this[propertyName] === void 0) { this[propertyName] = initValue(initialValue); } return this[propertyName]; }; }; var setter = function _setter(property) { var propertyName = "_".concat(property); return function (newValue) { this[propertyName] = newValue; }; }; Object.defineProperty(Base.prototype, key, { get: getter(key, value), set: setter(key), configurable: true }); } }); }); return Base; } /** * Checks if two objects or arrays are (deep) equal. * * @param {object|Array} object1 The first object to compare. * @param {object|Array} object2 The second object to compare. * @returns {boolean} */ function isObjectEqual(object1, object2) { return JSON.stringify(object1) === JSON.stringify(object2); } /** * Determines whether given object is a plain Object. * Note: String and Array are not plain Objects. * * @param {*} object An object to check. * @returns {boolean} */ function isObject(object) { return Object.prototype.toString.call(object) === '[object Object]'; } /** * @param {object} object The object on which to define the property. * @param {string} property The name of the property to be defined or modified. * @param {*} value The value associated with the property. * @param {object} options The descriptor for the property being defined or modified. */ function defineGetter(object, property, value, options) { options.value = value; options.writable = options.writable !== false; options.enumerable = options.enumerable !== false; options.configurable = options.configurable !== false; Object.defineProperty(object, property, options); } /** * A specialized version of `.forEach` for objects. * * @param {object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {object} Returns `object`. */ function objectEach(object, iteratee) { // eslint-disable-next-line no-restricted-syntax for (var key in object) { if (!object.hasOwnProperty || object.hasOwnProperty && Object.prototype.hasOwnProperty.call(object, key)) { if (iteratee(object[key], key, object) === false) { break; } } } return object; } /** * Get object property by its name. Access to sub properties can be achieved by dot notation (e.q. `'foo.bar.baz'`). * * @param {object} object Object which value will be exported. * @param {string} name Object property name. * @returns {*} */ function getProperty(object, name) { var names = name.split('.'); var result = object; objectEach(names, function (nameItem) { result = result[nameItem]; if (result === void 0) { result = void 0; return false; } }); return result; } /** * Set a property value on the provided object. Works on nested object prop names as well (e.g. `first.name`). * * @param {object} object Object to work on. * @param {string} name Prop name. * @param {*} value Value to be assigned at the provided property. */ function setProperty(object, name, value) { var names = name.split('.'); var workingObject = object; names.forEach(function (propName, index) { if (index !== names.length - 1) { if (!hasOwnProperty(workingObject, propName)) { workingObject[propName] = {}; } workingObject = workingObject[propName]; } else { workingObject[propName] = value; } }); } /** * Return object length (recursively). * * @param {*} object Object for which we want get length. * @returns {number} */ function deepObjectSize(object) { if (!isObject(object)) { return 0; } var recursObjLen = function recursObjLen(obj) { var result = 0; if (isObject(obj)) { objectEach(obj, function (value, key) { if (key === '__children') { return; } result += recursObjLen(value); }); } else { result += 1; } return result; }; return recursObjLen(object); } /** * Create object with property where its value change will be observed. * * @param {*} [defaultValue=undefined] Default value. * @param {string} [propertyToListen='value'] Property to listen. * @returns {object} */ function createObjectPropListener(defaultValue) { var _holder; var propertyToListen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value'; var privateProperty = "_".concat(propertyToListen); var holder = (_holder = { _touched: false }, (0, _defineProperty2.default)(_holder, privateProperty, defaultValue), (0, _defineProperty2.default)(_holder, "isTouched", function isTouched() { return this._touched; }), _holder); Object.defineProperty(holder, propertyToListen, { get: function get() { return this[privateProperty]; }, set: function set(value) { this._touched = true; this[privateProperty] = value; }, enumerable: true, configurable: true }); return holder; } /** * Check if at specified `key` there is any value for `object`. * * @param {object} object Object to search value at specyfic key. * @param {string} key String key to check. * @returns {boolean} */ function hasOwnProperty(object, key) { return Object.prototype.hasOwnProperty.call(object, key); } /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.to2dArray = to2dArray; exports.extendArray = extendArray; exports.pivot = pivot; exports.arrayReduce = arrayReduce; exports.arrayFilter = arrayFilter; exports.arrayMap = arrayMap; exports.arrayEach = arrayEach; exports.arraySum = arraySum; exports.arrayMax = arrayMax; exports.arrayMin = arrayMin; exports.arrayAvg = arrayAvg; exports.arrayFlatten = arrayFlatten; exports.arrayUnique = arrayUnique; exports.getDifferenceOfArrays = getDifferenceOfArrays; exports.getIntersectionOfArrays = getIntersectionOfArrays; exports.getUnionOfArrays = getUnionOfArrays; exports.stringToArray = stringToArray; __webpack_require__(44); __webpack_require__(4); __webpack_require__(21); __webpack_require__(19); __webpack_require__(34); __webpack_require__(28); __webpack_require__(25); __webpack_require__(33); __webpack_require__(5); __webpack_require__(3); __webpack_require__(52); __webpack_require__(6); __webpack_require__(36); __webpack_require__(66); /** * @param {Array} arr An array to process. */ function to2dArray(arr) { var ilen = arr.length; var i = 0; while (i < ilen) { arr[i] = [arr[i]]; i += 1; } } /** * @param {Array} arr An array to extend. * @param {Array} extension The data to extend from. */ function extendArray(arr, extension) { var ilen = extension.length; var i = 0; while (i < ilen) { arr.push(extension[i]); i += 1; } } /** * @param {Array} arr An array to pivot. * @returns {Array} */ function pivot(arr) { var pivotedArr = []; if (!arr || arr.length === 0 || !arr[0] || arr[0].length === 0) { return pivotedArr; } var rowCount = arr.length; var colCount = arr[0].length; for (var i = 0; i < rowCount; i++) { for (var j = 0; j < colCount; j++) { if (!pivotedArr[j]) { pivotedArr[j] = []; } pivotedArr[j][i] = arr[i][j]; } } return pivotedArr; } /** * A specialized version of `.reduce` for arrays without support for callback * shorthands and `this` binding. * * {@link https://github.com/lodash/lodash/blob/master/lodash.js}. * * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initFromArray] Specify using the first element of `array` as the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initFromArray) { var index = -1; var iterable = array; var result = accumulator; if (!Array.isArray(array)) { iterable = Array.from(array); } var length = iterable.length; if (initFromArray && length) { index += 1; result = iterable[index]; } index += 1; while (index < length) { result = iteratee(result, iterable[index], index, iterable); index += 1; } return result; } /** * A specialized version of `.filter` for arrays without support for callback * shorthands and `this` binding. * * {@link https://github.com/lodash/lodash/blob/master/lodash.js}. * * @param {Array} array The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { var index = 0; var iterable = array; if (!Array.isArray(array)) { iterable = Array.from(array); } var length = iterable.length; var result = []; var resIndex = -1; while (index < length) { var value = iterable[index]; if (predicate(value, index, iterable)) { resIndex += 1; result[resIndex] = value; } index += 1; } return result; } /** * A specialized version of `.map` for arrays without support for callback * shorthands and `this` binding. * * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayMap(array, iteratee) { var index = 0; var iterable = array; if (!Array.isArray(array)) { iterable = Array.from(array); } var length = iterable.length; var result = []; var resIndex = -1; while (index < length) { var value = iterable[index]; resIndex += 1; result[resIndex] = iteratee(value, index, iterable); index += 1; } return result; } /** * A specialized version of `.forEach` for arrays without support for callback * shorthands and `this` binding. * * {@link https://github.com/lodash/lodash/blob/master/lodash.js}. * * @param {Array|*} array The array to iterate over or an any element with implemented iterator protocol. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = 0; var iterable = array; if (!Array.isArray(array)) { iterable = Array.from(array); } var length = iterable.length; while (index < length) { if (iteratee(iterable[index], index, iterable) === false) { break; } index += 1; } return array; } /** * Calculate sum value for each item of the array. * * @param {Array} array The array to process. * @returns {number} Returns calculated sum value. */ function arraySum(array) { return arrayReduce(array, function (a, b) { return a + b; }, 0); } /** * Returns the highest value from an array. Can be array of numbers or array of strings. * NOTICE: Mixed values is not supported. * * @param {Array} array The array to process. * @returns {number} Returns the highest value from an array. */ function arrayMax(array) { return arrayReduce(array, function (a, b) { return a > b ? a : b; }, Array.isArray(array) ? array[0] : void 0); } /** * Returns the lowest value from an array. Can be array of numbers or array of strings. * NOTICE: Mixed values is not supported. * * @param {Array} array The array to process. * @returns {number} Returns the lowest value from an array. */ function arrayMin(array) { return arrayReduce(array, function (a, b) { return a < b ? a : b; }, Array.isArray(array) ? array[0] : void 0); } /** * Calculate average value for each item of the array. * * @param {Array} array The array to process. * @returns {number} Returns calculated average value. */ function arrayAvg(array) { if (!array.length) { return 0; } return arraySum(array) / array.length; } /** * Flatten multidimensional array. * * @param {Array} array Array of Arrays. * @returns {Array} */ function arrayFlatten(array) { return arrayReduce(array, function (initial, value) { return initial.concat(Array.isArray(value) ? arrayFlatten(value) : value); }, []); } /** * Unique values in the array. * * @param {Array} array The array to process. * @returns {Array} */ function arrayUnique(array) { var unique = []; arrayEach(array, function (value) { if (unique.indexOf(value) === -1) { unique.push(value); } }); return unique; } /** * Differences from two or more arrays. * * @param {...Array} arrays Array of strings or array of numbers. * @returns {Array} Returns the difference between arrays. */ function getDifferenceOfArrays() { for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) { arrays[_key] = arguments[_key]; } var _ref = [].concat(arrays), first = _ref[0], rest = _ref.slice(1); var filteredFirstArray = first; arrayEach(rest, function (array) { filteredFirstArray = filteredFirstArray.filter(function (value) { return !array.includes(value); }); }); return filteredFirstArray; } /** * Intersection of two or more arrays. * * @param {...Array} arrays Array of strings or array of numbers. * @returns {Array} Returns elements that exists in every array. */ function getIntersectionOfArrays() { for (var _len2 = arguments.length, arrays = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { arrays[_key2] = arguments[_key2]; } var _ref2 = [].concat(arrays), first = _ref2[0], rest = _ref2.slice(1); var filteredFirstArray = first; arrayEach(rest, function (array) { filteredFirstArray = filteredFirstArray.filter(function (value) { return array.includes(value); }); }); return filteredFirstArray; } /** * Union of two or more arrays. * * @param {...Array} arrays Array of strings or array of numbers. * @returns {Array} Returns the elements that exist in any of the arrays, without duplicates. */ function getUnionOfArrays() { for (var _len3 = arguments.length, arrays = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { arrays[_key3] = arguments[_key3]; } var _ref3 = [].concat(arrays), first = _ref3[0], rest = _ref3.slice(1); var set = new Set(first); arrayEach(rest, function (array) { arrayEach(array, function (value) { if (!set.has(value)) { set.add(value); } }); }); return Array.from(set); } /** * Convert a separated strings to an array of strings. * * @param {string} value A string of class name(s). * @param {string|RegExp} delimiter The pattern describing where each split should occur. * @returns {string[]} Returns array of string or empty array. */ function stringToArray(value) { var delimiter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' '; return value.split(delimiter); } /***/ }), /* 14 */ /***/ (function(module, exports) { function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { module.exports = _typeof = function _typeof(obj) { return typeof obj; }; module.exports["default"] = module.exports, module.exports.__esModule = true; } else { module.exports = _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; module.exports["default"] = module.exports, module.exports.__esModule = true; } return _typeof(obj); } module.exports = _typeof; module.exports["default"] = module.exports, module.exports.__esModule = true; /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__(23); var fails = __webpack_require__(31); var toIndexedObject = __webpack_require__(72); var nativeGetOwnPropertyDescriptor = __webpack_require__(92).f; var DESCRIPTORS = __webpack_require__(55); var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); }); var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key); } }); /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__(0); exports.__esModule = true; exports.getParent = getParent; exports.getFrameElement = getFrameElement; exports.getParentWindow = getParentWindow; exports.hasAccessToParentWindow = hasAccessToParentWindow; exports.closest = closest; exports.closestDown = closestDown; exports.isChildOf = isChildOf; exports.index = index; exports.overlayContainsElement = overlayContainsElement; exports.hasClass = hasClass; exports.addClass = addClass; exports.removeClass = removeClass; exports.removeTextNodes = removeTextNodes; exports.empty = empty; exports.fastInnerHTML = fastInnerHTML; exports.fastInnerText = fastInnerText; exports.isVisible = isVisible; exports.offset = offset; exports.getWindowScrollTop = getWindowScrollTop; exports.getWindowScrollLeft = getWindowScrollLeft; exports.getScrollTop = getScrollTop; exports.getScrollLeft = getScrollLeft; exports.getScrollableElement = getScrollableElement; exports.getTrimmingContainer = getTrimmingContainer; exports.getStyle = getStyle; exports.matchesCSSRules = matchesCSSRules; exports.getComputedStyle = getComputedStyle; exports.outerWidth = outerWidth; exports.outerHeight = outerHeight; exports.innerHeight = innerHeight; exports.innerWidth = innerWidth; exports.addEvent = addEvent; exports.removeEvent = removeEvent; exports.getCaretPosition = getCaretPosition; exports.getSelectionEndPosition = getSelectionEndPosition; exports.getSelectionText = getSelectionText; exports.clearTextSelection = clearTextSelection; exports.setCaretPosition = setCaretPosition; exports.getScrollbarWidth = getScrollbarWidth; exports.hasVerticalScrollbar = hasVerticalScrollbar; exports.hasHorizontalScrollbar = hasHorizontalScrollbar; exports.setOverlayPosition = setOverlayPosition; exports.getCssTransform = getCssTransform; exports.resetCssTransform = resetCssTransform; exports.isInput = isInput; exports.isOutsideInput = isOutsideInput; exports.selectElementIfAllowed = selectElementIfAllowed; exports.isDetached = isDetached; exports.HTML_CHARACTERS = void 0; var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(26)); __webpack_require__(182); __webpack_require__(25); __webpack_require__(33); __webpack_require__(34); __webpack_require__(19); __webpack_require__(28); __webpack_require__(36); __webpack_require__(66); __webpack_require__(124); __webpack_require__(74); __webpack_require__(75); __webpack_require__(125); __webpack_require__(65); __webpack_require__(3); __webpack_require__(21); var _feature = __webpack_require__(93); var _browser = __webpack_require__(80); var _string = __webpack_require__(70); /** * Get the parent of the specified node in the DOM tree. * * @param {HTMLElement} element Element from which traversing is started. * @param {number} [level=0] Traversing deep level. * @returns {HTMLElement|null} */ function getParent(element) { var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var iteration = -1; var parent = null; var elementToCheck = element; while (elementToCheck !== null) { if (iteration === level) { parent = elementToCheck; break; } if (elementToCheck.host && elementToCheck.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { elementToCheck = elementToCheck.host; } else { iteration += 1; elementToCheck = elementToCheck.parentNode; } } return parent; } /** * Gets `frameElement` of the specified frame. Returns null if it is a top frame or if script has no access to read property. * * @param {Window} frame Frame from which should be get frameElement in safe way. * @returns {HTMLIFrameElement|null} */ function getFrameElement(frame) { return Object.getPrototypeOf(frame.parent) && frame.frameElement; } /** * Gets parent frame of the specified frame. Returns null if it is a top frame or if script has no access to read property. * * @param {Window} frame Frame from which should be get frameElement in safe way. * @returns {Window|null} */ function getParentWindow(frame) { return getFrameElement(frame) && frame.parent; } /** * Checks if script has access to read from parent frame of specified frame. * * @param {Window} frame Frame from which should be get frameElement in safe way. * @returns {boolean} */ function hasAccessToParentWindow(frame) { return !!Object.getPrototypeOf(frame.parent); } /** * Goes up the DOM tree (including given element) until it finds an parent element that matches the nodes or nodes name. * This method goes up through web components. * * @param {Node} element Element from which traversing is started. * @param {Array<string|Node>} [nodes] Array of elements or Array of elements name (in uppercase form). * @param {Node} [until] The element until the traversing ends. * @returns {Node|null} */ function closest(element) { var nodes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var until = arguments.length > 2 ? arguments[2] : undefined; var _Node = Node, ELEMENT_NODE = _Node.ELEMENT_NODE, DOCUMENT_FRAGMENT_NODE = _Node.DOCUMENT_FRAGMENT_NODE; var elementToCheck = element; while (elementToCheck !== null && elementToCheck !== void 0 && elementToCheck !== until) { var _elementToCheck = elementToCheck, nodeType = _elementToCheck.nodeType, nodeName = _elementToCheck.nodeName; if (nodeType === ELEMENT_NODE && (nodes.includes(nodeName) || nodes.includes(elementToCheck))) { return elementToCheck; } var _elementToCheck2 = elementToCheck, host = _elementToCheck2.host; if (host && nodeType === DOCUMENT_FRAGMENT_NODE) { elementToCheck = host; } else { elementToCheck = elementToCheck.parentNode; } } return null; } /** * Goes "down" the DOM tree (including given element) until it finds an element that matches the nodes or nodes name. * * @param {HTMLElement} element Element from which traversing is started. * @param {Array} nodes Array of elements or Array of elements name. * @param {HTMLElement} [until] The list of elements until the traversing ends. * @returns {HTMLElement|null} */ function closestDown(element, nodes, until) { var matched = []; var elementToCheck = element; while (elementToCheck) { elementToCheck = closest(elementToCheck, nodes, until); if (!elementToCheck || until && !until.contains(elementToCheck)) { break; } matched.push(elementToCheck); if (elementToCheck.host && elementToCheck.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { elementToCheck = elementToCheck.host; } else { elementToCheck = elementToCheck.parentNode; } } var length = matched.length; return length ? matched[length - 1] : null; } /** * Goes up the DOM tree and checks if element is child of another element. * * @param {HTMLElement} child Child element An element to check. * @param {object|string} parent Parent element OR selector of the parent element. * If string provided, function returns `true` for the first occurrence of element with that class. * @returns {boolean} */ function isChildOf(child, parent) { var node = child.parentNode; var queriedParents = []; if (typeof parent === 'string') { if (child.defaultView) { queriedParents = Array.prototype.slice.call(child.querySelectorAll(parent), 0); } else { queriedParents = Array.prototype.slice.call(child.ownerDocument.querySelectorAll(parent), 0); } } else { queriedParents.push(parent); } while (node !== null) { if (queriedParents.indexOf(node) > -1) { return true; } node = node.parentNode; } return false; } /** * Counts index of element within its parent. * WARNING: for performance reasons, assumes there are only element nodes (no text nodes). This is true * for Walkotnable, otherwise would need to check for nodeType or use previousElementSibling. * * @see http://jsperf.com/sibling-index/10 * @param {Element} element The element to check. * @returns {number} */ function index(element) { var i = 0; var elementToCheck = element; if (elementToCheck.previousSibling) { /* eslint-disable no-cond-assign */ while (elementToCheck = elementToCheck.previousSibling) { i += 1; } } return i; } /** * Check if the provided overlay contai