(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["vendors~bootstrap_env~jquery-ui_env"],{ /***/ "./node_modules/@googlemaps/js-api-loader/dist/index.esm.js": /*!******************************************************************!*\ !*** ./node_modules/@googlemaps/js-api-loader/dist/index.esm.js ***! \******************************************************************/ /*! exports provided: DEFAULT_ID, Loader */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_ID", function() { return DEFAULT_ID; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Loader", function() { return Loader; }); // do not edit .js files directly - edit src/index.jst var fastDeepEqual = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { var key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } // true if both NaN, false otherwise return a!==a && b!==b; }; /** * Copyright 2019 Google LLC. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at. * * Http://www.apache.org/licenses/LICENSE-2.0. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const DEFAULT_ID = "__googleMapsScriptId"; /** * [[Loader]] makes it easier to add Google Maps JavaScript API to your application * dynamically using * [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). * It works by dynamically creating and appending a script node to the the * document head and wrapping the callback function so as to return a promise. * * ``` * const loader = new Loader({ * apiKey: "", * version: "weekly", * libraries: ["places"] * }); * * loader.load().then((google) => { * const map = new google.maps.Map(...) * }) * ``` */ class Loader { /** * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set * using this library, instead the defaults are set by the Google Maps * JavaScript API server. * * ``` * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']}); * ``` */ constructor({ apiKey, channel, client, id = DEFAULT_ID, libraries = [], language, region, version, mapIds, nonce, retries = 3, url = "https://maps.googleapis.com/maps/api/js", }) { this.CALLBACK = "__googleMapsCallback"; this.callbacks = []; this.done = false; this.loading = false; this.errors = []; this.version = version; this.apiKey = apiKey; this.channel = channel; this.client = client; this.id = id || DEFAULT_ID; // Do not allow empty string this.libraries = libraries; this.language = language; this.region = region; this.mapIds = mapIds; this.nonce = nonce; this.retries = retries; this.url = url; if (Loader.instance) { if (!fastDeepEqual(this.options, Loader.instance.options)) { throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Loader.instance.options)}`); } return Loader.instance; } Loader.instance = this; } get options() { return { version: this.version, apiKey: this.apiKey, channel: this.channel, client: this.client, id: this.id, libraries: this.libraries, language: this.language, region: this.region, mapIds: this.mapIds, nonce: this.nonce, url: this.url, }; } get failed() { return this.done && !this.loading && this.errors.length >= this.retries + 1; } /** * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]]. * * @ignore */ createUrl() { let url = this.url; url += `?callback=${this.CALLBACK}`; if (this.apiKey) { url += `&key=${this.apiKey}`; } if (this.channel) { url += `&channel=${this.channel}`; } if (this.client) { url += `&client=${this.client}`; } if (this.libraries.length > 0) { url += `&libraries=${this.libraries.join(",")}`; } if (this.language) { url += `&language=${this.language}`; } if (this.region) { url += `®ion=${this.region}`; } if (this.version) { url += `&v=${this.version}`; } if (this.mapIds) { url += `&map_ids=${this.mapIds.join(",")}`; } return url; } /** * Load the Google Maps JavaScript API script and return a Promise. */ load() { return this.loadPromise(); } /** * Load the Google Maps JavaScript API script and return a Promise. * * @ignore */ loadPromise() { return new Promise((resolve, reject) => { this.loadCallback((err) => { if (!err) { resolve(window.google); } else { reject(err.error); } }); }); } /** * Load the Google Maps JavaScript API script with a callback. */ loadCallback(fn) { this.callbacks.push(fn); this.execute(); } /** * Set the script on document. */ setScript() { if (document.getElementById(this.id)) { // TODO wrap onerror callback for cases where the script was loaded elsewhere this.callback(); return; } const url = this.createUrl(); const script = document.createElement("script"); script.id = this.id; script.type = "text/javascript"; script.src = url; script.onerror = this.loadErrorCallback.bind(this); script.defer = true; script.async = true; if (this.nonce) { script.nonce = this.nonce; } document.head.appendChild(script); } deleteScript() { const script = document.getElementById(this.id); if (script) { script.remove(); } } /** * Reset the loader state. */ reset() { this.deleteScript(); this.done = false; this.loading = false; this.errors = []; this.onerrorEvent = null; } resetIfRetryingFailed() { if (this.failed) { this.reset(); } } loadErrorCallback(e) { this.errors.push(e); if (this.errors.length <= this.retries) { const delay = this.errors.length * Math.pow(2, this.errors.length); console.log(`Failed to load Google Maps script, retrying in ${delay} ms.`); setTimeout(() => { this.deleteScript(); this.setScript(); }, delay); } else { this.onerrorEvent = e; this.callback(); } } setCallback() { window.__googleMapsCallback = this.callback.bind(this); } callback() { this.done = true; this.loading = false; this.callbacks.forEach((cb) => { cb(this.onerrorEvent); }); this.callbacks = []; } execute() { this.resetIfRetryingFailed(); if (this.done) { this.callback(); } else { // short circuit and warn if google.maps is already loaded if (window.google && window.google.maps && window.google.maps.version) { console.warn("Google Maps already loaded outside @googlemaps/js-api-loader." + "This may result in undesirable behavior as options and script parameters may not match."); this.callback(); return; } if (this.loading) ; else { this.loading = true; this.setCallback(); this.setScript(); } } } } //# sourceMappingURL=index.esm.js.map /***/ }), /***/ "./node_modules/ckeditor/adapters/jquery.js": /*!**************************************************!*\ !*** ./node_modules/ckeditor/adapters/jquery.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports) { /* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ (function(a){if("undefined"==typeof a)throw Error("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeof CKEDITOR)throw Error("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a}, ckeditor:function(g,e){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g)){var m=e;e=g;g=m}var k=[];e=e||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function d(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(d,100)},0)},null,null,9999); else{if(e.autoUpdateElement||"undefined"==typeof e.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)e.autoUpdateElementJquery=!0;e.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,e):CKEDITOR.inline(h,e);b.data("ckeditorInstance",c);c.on("instanceReady",function(e){var d=e.editor;setTimeout(function n(){if(d.element){e.removeListener();d.on("dataReady",function(){b.trigger("dataReady.ckeditor",[d])});d.on("setData",function(a){b.trigger("setData.ckeditor", [d,a.data])});d.on("getData",function(a){b.trigger("getData.ckeditor",[d,a.data])},999);d.on("destroy",function(){b.trigger("destroy.ckeditor",[d])});d.on("save",function(){a(h.form).submit();return!1},null,null,20);if(d.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){d.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize", c)})}d.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[d]);g&&g.apply(d,[h]);l.resolve()}else setTimeout(n,100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,k).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}});CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(e){if(arguments.length){var m= this,k=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(e,function(){f.resolve()});k.push(f.promise());return!0}return g.call(b,e)});if(k.length){var b=new a.Deferred;a.when.apply(this,k).done(function(){b.resolveWith(m)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}}))})(window.jQuery); /***/ }), /***/ "./node_modules/ckeditor/ckeditor.js": /*!*******************************************!*\ !*** ./node_modules/ckeditor/ckeditor.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { /* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ (function(){window.CKEDITOR&&window.CKEDITOR.dom||(window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,f={timestamp:"J5S9",version:"4.12.1 (Standard)",revision:"64749bb245",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var b=window.CKEDITOR_BASEPATH||"";if(!b)for(var c=document.getElementsByTagName("script"),f=0;fe.getListenerIndex(d)){e=e.listeners;f||(f=this);isNaN(g)&&(g=10);var n=this;h.fn=d;h.priority=g;for(var q=e.length-1;0<=q;q--)if(e[q].priority<=g)return e.splice(q+1,0,h),{removeListener:m};e.unshift(h)}return{removeListener:m}},once:function(){var a=Array.prototype.slice.call(arguments),b=a[1];a[1]=function(a){a.removeListener();return b.apply(this, arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,b=function(){a=1},l=0,k=function(){l=1};return function(g,h,m){var e=f(this)[g];g=a;var n=l;a=l=0;if(e){var q=e.listeners;if(q.length)for(var q=q.slice(0),y,u=0;udocument.documentMode),mobile:-1c||b.quirks);b.gecko&&(f=a.match(/rv:([\d\.]+)/))&&(f=f[1].split("."),c=1E4*f[0]+100*(f[1]||0)+1*(f[2]||0));b.air&&(c=parseFloat(a.match(/ adobeair\/(\d+)/)[1]));b.webkit&&(c=parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));b.version=c;b.isCompatible=!(b.ie&&7>c)&&!(b.gecko&&4E4>c)&&!(b.webkit&& 534>c);b.hidpi=2<=window.devicePixelRatio;b.needsBrFiller=b.gecko||b.webkit||b.ie&&10c;b.cssClass="cke_browser_"+(b.ie?"ie":b.gecko?"gecko":b.webkit?"webkit":"unknown");b.quirks&&(b.cssClass+=" cke_browser_quirks");b.ie&&(b.cssClass+=" cke_browser_ie"+(b.quirks?"6 cke_browser_iequirks":b.version));b.air&&(b.cssClass+=" cke_browser_air");b.iOS&&(b.cssClass+=" cke_browser_ios");b.hidpi&&(b.cssClass+=" cke_hidpi");return b}()),"unloaded"==CKEDITOR.status&&function(){CKEDITOR.event.implementOn(CKEDITOR); CKEDITOR.loadFullCore=function(){if("basic_ready"!=CKEDITOR.status)CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var a=document.createElement("script");a.type="text/javascript";a.src=CKEDITOR.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(a)}};CKEDITOR.loadFullCoreTimeout=0;CKEDITOR.add=function(a){(this._.pending||(this._.pending=[])).push(a)};(function(){CKEDITOR.domReady(function(){var a=CKEDITOR.loadFullCore,f=CKEDITOR.loadFullCoreTimeout;a&&(CKEDITOR.status= "basic_ready",a&&a._load?a():f&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},1E3*f))})})();CKEDITOR.status="basic_loaded"}(),"use strict",CKEDITOR.VERBOSITY_WARN=1,CKEDITOR.VERBOSITY_ERROR=2,CKEDITOR.verbosity=CKEDITOR.VERBOSITY_WARN|CKEDITOR.VERBOSITY_ERROR,CKEDITOR.warn=function(a,f){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_WARN&&CKEDITOR.fire("log",{type:"warn",errorCode:a,additionalData:f})},CKEDITOR.error=function(a,f){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_ERROR&&CKEDITOR.fire("log", {type:"error",errorCode:a,additionalData:f})},CKEDITOR.on("log",function(a){if(window.console&&window.console.log){var f=console[a.data.type]?a.data.type:"log",b=a.data.errorCode;if(a=a.data.additionalData)console[f]("[CKEDITOR] Error code: "+b+".",a);else console[f]("[CKEDITOR] Error code: "+b+".");console[f]("[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#"+b)}},null,null,999),CKEDITOR.dom={},function(){function a(a,e,b){this._minInterval= a;this._context=b;this._lastOutput=this._scheduledTimer=0;this._output=CKEDITOR.tools.bind(e,b||{});var g=this;this.input=function(){function a(){g._lastOutput=(new Date).getTime();g._scheduledTimer=0;g._call()}if(!g._scheduledTimer||!1!==g._reschedule()){var e=(new Date).getTime()-g._lastOutput;e/g,k=/|\s) /g,function(a,e){return e+"\x26nbsp;"}).replace(/ (?=<)/g,"\x26nbsp;")},getNextNumber:function(){var a=0;return function(){return++a}}(),getNextId:function(){return"cke_"+this.getNextNumber()},getUniqueId:function(){for(var a="e",e=0;8>e;e++)a+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return a},override:function(a,e){var g=e(a);g.prototype=a.prototype;return g},setTimeout:function(a,e,g,b,h){h||(h=window);g||(g= h);return h.setTimeout(function(){b?a.apply(g,[].concat(b)):a.apply(g)},e||0)},throttle:function(a,e,g){return new this.buffers.throttle(a,e,g)},trim:function(){var a=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(e){return e.replace(a,"")}}(),ltrim:function(){var a=/^[ \t\n\r]+/g;return function(e){return e.replace(a,"")}}(),rtrim:function(){var a=/[ \t\n\r]+$/g;return function(e){return e.replace(a,"")}}(),indexOf:function(a,e){if("function"==typeof e)for(var g=0,b=a.length;gparseFloat(e);g&&(e=e.replace("-",""));a.setStyle("width",e);e=a.$.clientWidth;return g?-e:e}return e}}(),repeat:function(a, e){return Array(e+1).join(a)},tryThese:function(){for(var a,e=0,g=arguments.length;ee;e++)a[e]=("0"+parseInt(a[e],10).toString(16)).slice(-2);return"#"+a.join("")})},normalizeHex:function(a){return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi,function(a,e,g,b){a=e.toLowerCase();3==a.length&&(a=a.split(""),a=[a[0],a[0],a[1],a[1],a[2],a[2]].join(""));return"#"+a+b})},parseCssText:function(a,e,g){var b={};g&&(a=(new CKEDITOR.dom.element("span")).setAttribute("style",a).getAttribute("style")||"");a&&(a=CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a))); if(!a||";"==a)return b;a.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,g,h){e&&(g=g.toLowerCase(),"font-family"==g&&(h=h.replace(/\s*,\s*/g,",")),h=CKEDITOR.tools.trim(h));b[g]=h});return b},writeCssText:function(a,e){var g,b=[];for(g in a)b.push(g+":"+a[g]);e&&b.sort();return b.join("; ")},objectCompare:function(a,e,g){var b;if(!a&&!e)return!0;if(!a||!e)return!1;for(b in a)if(a[b]!=e[b])return!1;if(!g)for(b in e)if(a[b]!=e[b])return!1;return!0},objectKeys:function(a){return CKEDITOR.tools.object.keys(a)}, convertArrayToObject:function(a,e){var g={};1==arguments.length&&(e=!0);for(var b=0,h=a.length;bg;g++)a.push(Math.floor(256*Math.random())); for(g=0;gCKEDITOR.env.version||CKEDITOR.env.ie6Compat)?4===a.button?CKEDITOR.MOUSE_BUTTON_MIDDLE:1===a.button? CKEDITOR.MOUSE_BUTTON_LEFT:CKEDITOR.MOUSE_BUTTON_RIGHT:a.button:!1},convertHexStringToBytes:function(a){var e=[],g=a.length/2,b;for(b=0;bc)for(m=c;3>m;m++)h[m]=0;d[0]=(h[0]&252)>>2;d[1]=(h[0]&3)<<4|h[1]>>4;d[2]=(h[1]&15)<<2|(h[2]&192)>>6;d[3]=h[2]&63;for(m=0;4>m;m++)e=m<=c?e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d[m]): e+"\x3d"}return e},style:{parse:{_colors:{aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9", darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF", gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1", lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA", mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072", sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",windowtext:"windowtext",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},_borderStyle:"none hidden dotted dashed solid double groove ridge inset outset".split(" "), _widthRegExp:/^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/,_rgbaRegExp:/rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,_hslaRegExp:/hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,background:function(a){var e={},g=this._findColor(a);g.length&&(e.color=g[0],CKEDITOR.tools.array.forEach(g,function(e){a=a.replace(e,"")}));if(a=CKEDITOR.tools.trim(a))e.unprocessed=a;return e},margin:function(a){return CKEDITOR.tools.style.parse.sideShorthand(a, function(a){return a.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset|revert)/g)||["0px"]})},sideShorthand:function(a,e){function g(a){b.top=h[a[0]];b.right=h[a[1]];b.bottom=h[a[2]];b.left=h[a[3]]}var b={},h=e?e(a):a.split(/\s+/);switch(h.length){case 1:g([0,0,0,0]);break;case 2:g([0,1,0,1]);break;case 3:g([0,1,2,1]);break;case 4:g([0,1,2,3])}return b},border:function(a){return CKEDITOR.tools.style.border.fromCssRule(a)},_findColor:function(a){var e=[],g=CKEDITOR.tools.array,e=e.concat(a.match(this._rgbaRegExp)|| []),e=e.concat(a.match(this._hslaRegExp)||[]);return e=e.concat(g.filter(a.split(/\s+/),function(a){return a.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi)?!0:a.toLowerCase()in CKEDITOR.tools.style.parse._colors}))}}},array:{filter:function(a,e,g){var b=[];this.forEach(a,function(h,c){e.call(g,h,c,a)&&b.push(h)});return b},find:function(a,e,g){for(var b=a.length,h=0;hCKEDITOR.env.version)for(h=0;hCKEDITOR.env.version&&(this.type==CKEDITOR.NODE_ELEMENT||this.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)&&c(d);return d},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(a){a.$.parentNode.insertBefore(this.$,a.$.nextSibling);return a},insertBefore:function(a){a.$.parentNode.insertBefore(this.$, a.$);return a},insertBeforeMe:function(a){this.$.parentNode.insertBefore(a.$,this.$);return a},getAddress:function(a){for(var f=[],b=this.getDocument().$.documentElement,c=this.$;c&&c!=b;){var d=c.parentNode;d&&f.unshift(this.getIndex.call({$:c},a));c=d}return f},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(a){function f(a,g){var h=g?a.nextSibling:a.previousSibling;return h&&h.nodeType==CKEDITOR.NODE_TEXT?b(h)?f(h, g):h:null}function b(a){return!a.nodeValue||a.nodeValue==CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE}var c=this.$,d=-1,l;if(!this.$.parentNode||a&&c.nodeType==CKEDITOR.NODE_TEXT&&b(c)&&!f(c)&&!f(c,!0))return-1;do a&&c!=this.$&&c.nodeType==CKEDITOR.NODE_TEXT&&(l||b(c))||(d++,l=c.nodeType==CKEDITOR.NODE_TEXT);while(c=c.previousSibling);return d},getNextSourceNode:function(a,f,b){if(b&&!b.call){var c=b;b=function(a){return!a.equals(c)}}a=!a&&this.getFirst&&this.getFirst();var d;if(!a){if(this.type== CKEDITOR.NODE_ELEMENT&&b&&!1===b(this,!0))return null;a=this.getNext()}for(;!a&&(d=(d||this).getParent());){if(b&&!1===b(d,!0))return null;a=d.getNext()}return!a||b&&!1===b(a)?null:f&&f!=a.type?a.getNextSourceNode(!1,f,b):a},getPreviousSourceNode:function(a,f,b){if(b&&!b.call){var c=b;b=function(a){return!a.equals(c)}}a=!a&&this.getLast&&this.getLast();var d;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&b&&!1===b(this,!0))return null;a=this.getPrevious()}for(;!a&&(d=(d||this).getParent());){if(b&&!1=== b(d,!0))return null;a=d.getPrevious()}return!a||b&&!1===b(a)?null:f&&a.type!=f?a.getPreviousSourceNode(!1,f,b):a},getPrevious:function(a){var f=this.$,b;do b=(f=f.previousSibling)&&10!=f.nodeType&&new CKEDITOR.dom.node(f);while(b&&a&&!a(b));return b},getNext:function(a){var f=this.$,b;do b=(f=f.nextSibling)&&new CKEDITOR.dom.node(f);while(b&&a&&!a(b));return b},getParent:function(a){var f=this.$.parentNode;return f&&(f.nodeType==CKEDITOR.NODE_ELEMENT||a&&f.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)? new CKEDITOR.dom.node(f):null},getParents:function(a){var f=this,b=[];do b[a?"push":"unshift"](f);while(f=f.getParent());return b},getCommonAncestor:function(a){if(a.equals(this))return this;if(a.contains&&a.contains(this))return a;var f=this.contains?this:this.getParent();do if(f.contains(a))return f;while(f=f.getParent());return null},getPosition:function(a){var f=this.$,b=a.$;if(f.compareDocumentPosition)return f.compareDocumentPosition(b);if(f==b)return CKEDITOR.POSITION_IDENTICAL;if(this.type== CKEDITOR.NODE_ELEMENT&&a.type==CKEDITOR.NODE_ELEMENT){if(f.contains){if(f.contains(b))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(b.contains(f))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in f)return 0>f.sourceIndex||0>b.sourceIndex?CKEDITOR.POSITION_DISCONNECTED:f.sourceIndex=document.documentMode||!f||(a=f+":"+a);return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))},getHead:function(){var a=this.$.getElementsByTagName("head")[0];return a=a?new CKEDITOR.dom.element(a):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),!0)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)}, getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(a){this.$.open("text/html","replace");CKEDITOR.env.ie&&(a=a.replace(/(?:^\s*]*?>)|^/i,'$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e('+CKEDITOR.tools.fixDomain+")();\x3c/script\x3e"));this.$.write(a);this.$.close()},find:function(a){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))},findOne:function(a){return(a= this.$.querySelector(a))?new CKEDITOR.dom.element(a):null},_getHtml5ShivFrag:function(){var a=this.getCustomData("html5ShivFrag");a||(a=this.$.createDocumentFragment(),CKEDITOR.tools.enableHtml5Elements(a,!0),this.setCustomData("html5ShivFrag",a));return a}}),CKEDITOR.dom.nodeList=function(a){this.$=a},CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(a){return 0>a||a>=this.$.length?null:(a=this.$[a])?new CKEDITOR.dom.node(a):null},toArray:function(){return CKEDITOR.tools.array.map(this.$, function(a){return new CKEDITOR.dom.node(a)})}},CKEDITOR.dom.element=function(a,f){"string"==typeof a&&(a=(f?f.$:document).createElement(a));CKEDITOR.dom.domObject.call(this,a)},CKEDITOR.dom.element.get=function(a){return(a="string"==typeof a?document.getElementById(a)||document.getElementsByName(a)[0]:a)&&(a.$?a:new CKEDITOR.dom.element(a))},CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node,CKEDITOR.dom.element.createFromHtml=function(a,f){var b=new CKEDITOR.dom.element("div",f);b.setHtml(a); return b.getFirst().remove()},CKEDITOR.dom.element.setMarker=function(a,f,b,c){var d=f.getCustomData("list_marker_id")||f.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),l=f.getCustomData("list_marker_names")||f.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");a[d]=f;l[b]=1;return f.setCustomData(b,c)},CKEDITOR.dom.element.clearAllMarkers=function(a){for(var f in a)CKEDITOR.dom.element.clearMarkers(a,a[f],1)},CKEDITOR.dom.element.clearMarkers= function(a,f,b){var c=f.getCustomData("list_marker_names"),d=f.getCustomData("list_marker_id"),l;for(l in c)f.removeCustomData(l);f.removeCustomData("list_marker_names");b&&(f.removeCustomData("list_marker_id"),delete a[d])},function(){function a(a,b){return-1<(" "+a+" ").replace(l," ").indexOf(" "+b+" ")}function f(a){var b=!0;a.$.id||(a.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),b=!1);return function(){b||a.removeAttribute("id")}}function b(a,b){var c=CKEDITOR.tools.escapeCss(a.$.id);return"#"+ c+" "+b.split(/,\s*/).join(", #"+c+" ")}function c(a){for(var b=0,c=0,e=k[a].length;cCKEDITOR.env.version?this.$.text+=a:this.append(new CKEDITOR.dom.text(a))},appendBogus:function(a){if(a||CKEDITOR.env.needsBrFiller){for(a=this.getLast();a&&a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(a.getText());)a=a.getPrevious();a&& a.is&&a.is("br")||(a=this.getDocument().createElement("br"),CKEDITOR.env.gecko&&a.setAttribute("type","_moz"),this.append(a))}},breakParent:function(a,b){var c=new CKEDITOR.dom.range(this.getDocument());c.setStartAfter(this);c.setEndAfter(a);var e=c.extractContents(!1,b||!1),d;c.insertNode(this.remove());if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){for(c=new CKEDITOR.dom.element("div");d=e.getFirst();)d.$.style.backgroundColor&&(d.$.style.backgroundColor=d.$.style.backgroundColor),c.append(d);c.insertAfter(this); c.remove(!0)}else e.insertAfterNode(this)},contains:document.compareDocumentPosition?function(a){return!!(this.$.compareDocumentPosition(a.$)&16)}:function(a){var b=this.$;return a.type!=CKEDITOR.NODE_ELEMENT?b.contains(a.getParent().$):b!=a.$&&b.contains(a.$)},focus:function(){function a(){try{this.$.focus()}catch(b){}}return function(b){b?CKEDITOR.tools.setTimeout(a,100,this):a.call(this)}}(),getHtml:function(){var a=this.$.innerHTML;return CKEDITOR.env.ie?a.replace(/<\?[^>]*>/g,""):a},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/, "");var a=this.$.ownerDocument.createElement("div");a.appendChild(this.$.cloneNode(!0));return a.innerHTML},getClientRect:function(a){var b=CKEDITOR.tools.extend({},this.$.getBoundingClientRect());!b.width&&(b.width=b.right-b.left);!b.height&&(b.height=b.bottom-b.top);return a?CKEDITOR.tools.getAbsoluteRectPosition(this.getWindow(),b):b},setHtml:CKEDITOR.env.ie&&9>CKEDITOR.env.version?function(a){try{var b=this.$;if(this.getParent())return b.innerHTML=a;var c=this.getDocument()._getHtml5ShivFrag(); c.appendChild(b);b.innerHTML=a;c.removeChild(b);return a}catch(e){this.$.innerHTML="";b=new CKEDITOR.dom.element("body",this.getDocument());b.$.innerHTML=a;for(b=b.getChildren();b.count();)this.append(b.getItem(0));return a}}:function(a){return this.$.innerHTML=a},setText:function(){var a=document.createElement("p");a.innerHTML="x";a=a.textContent;return function(b){this.$[a?"textContent":"innerText"]=b}}(),getAttribute:function(){var a=function(a){return this.$.getAttribute(a,2)};return CKEDITOR.env.ie&& (CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){switch(a){case "class":a="className";break;case "http-equiv":a="httpEquiv";break;case "name":return this.$.name;case "tabindex":return a=this.$.getAttribute(a,2),0!==a&&0===this.$.tabIndex&&(a=null),a;case "checked":return a=this.$.attributes.getNamedItem(a),(a.specified?a.nodeValue:this.$.checked)?"checked":null;case "hspace":case "value":return this.$[a];case "style":return this.$.style.cssText;case "contenteditable":case "contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified? this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(a,2)}:a}(),getAttributes:function(a){var b={},c=this.$.attributes,e;a=CKEDITOR.tools.isArray(a)?a:[];for(e=0;e=document.documentMode){var b=this.$.scopeName;"HTML"!=b&&(a=b.toLowerCase()+":"+a)}this.getName=function(){return a};return this.getName()},getValue:function(){return this.$.value},getFirst:function(a){var b=this.$.firstChild;(b=b&&new CKEDITOR.dom.node(b))&&a&&!a(b)&&(b=b.getNext(a));return b},getLast:function(a){var b=this.$.lastChild; (b=b&&new CKEDITOR.dom.node(b))&&a&&!a(b)&&(b=b.getPrevious(a));return b},getStyle:function(a){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]},is:function(){var a=this.getName();if("object"==typeof arguments[0])return!!arguments[0][a];for(var b=0;bCKEDITOR.env.version&&this.is("a")){var c=this.getParent();c.type==CKEDITOR.NODE_ELEMENT&&(c=c.clone(),c.setHtml(b),b=c.getHtml(),c.setHtml(a),a=c.getHtml())}return b==a},isVisible:function(){var a=(this.$.offsetHeight||this.$.offsetWidth)&&"hidden"!=this.getComputedStyle("visibility"),b,c;a&&CKEDITOR.env.webkit&&(b=this.getWindow(),!b.equals(CKEDITOR.document.getWindow())&& (c=b.$.frameElement)&&(a=(new CKEDITOR.dom.element(c)).isVisible()));return!!a},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return!1;for(var a=this.getChildren(),b=0,c=a.count();bCKEDITOR.env.version?function(b){return"name"==b?!!this.$.name:a.call(this,b)}:a:function(a){return!!this.$.attributes.getNamedItem(a)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,b){var c=this.$;a=a.$;if(c!=a){var e;if(b)for(;e=c.lastChild;)a.insertBefore(c.removeChild(e), a.firstChild);else for(;e=c.firstChild;)a.appendChild(c.removeChild(e))}},mergeSiblings:function(){function a(b,g,e){if(g&&g.type==CKEDITOR.NODE_ELEMENT){for(var c=[];g.data("cke-bookmark")||g.isEmptyInlineRemoveable();)if(c.push(g),g=e?g.getNext():g.getPrevious(),!g||g.type!=CKEDITOR.NODE_ELEMENT)return;if(b.isIdentical(g)){for(var d=e?b.getLast():b.getFirst();c.length;)c.shift().move(b,!e);g.moveChildren(b,!e);g.remove();d&&d.type==CKEDITOR.NODE_ELEMENT&&d.mergeSiblings()}}}return function(b){if(!1=== b||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))a(this,this.getNext(),!0),a(this,this.getPrevious())}}(),show:function(){this.setStyles({display:"",visibility:""})},setAttribute:function(){var a=function(a,b){this.$.setAttribute(a,b);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(b,c){"class"==b?this.$.className=c:"style"==b?this.$.style.cssText=c:"tabindex"==b?this.$.tabIndex=c:"checked"==b?this.$.checked=c:"contenteditable"==b?a.call(this, "contentEditable",c):a.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(b,c){if("src"==b&&c.match(/^http:\/\//))try{a.apply(this,arguments)}catch(e){}else a.apply(this,arguments);return this}:a}(),setAttributes:function(a){for(var b in a)this.setAttribute(b,a[b]);return this},setValue:function(a){this.$.value=a;return this},removeAttribute:function(){var a=function(a){this.$.removeAttribute(a)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)? function(a){"class"==a?a="className":"tabindex"==a?a="tabIndex":"contenteditable"==a&&(a="contentEditable");this.$.removeAttribute(a)}:a}(),removeAttributes:function(a){if(CKEDITOR.tools.isArray(a))for(var b=0;bCKEDITOR.env.version?(a=Math.round(100*a),this.setStyle("filter",100<=a?"":"progid:DXImageTransform.Microsoft.Alpha(opacity\x3d"+a+")")):this.setStyle("opacity",a)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var a,b=this.getElementsByTag("*"),c=0,e=b.count();cl||0l?l:d);c&&(0>f||0f?f:e,0)},setState:function(a,b,c){b=b||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(b+"_on");this.removeClass(b+"_off");this.removeClass(b+"_disabled");c&&this.setAttribute("aria-pressed",!0);c&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(b+"_disabled");this.removeClass(b+"_off");this.removeClass(b+"_on");c&&this.setAttribute("aria-disabled", !0);c&&this.removeAttribute("aria-pressed");break;default:this.addClass(b+"_off"),this.removeClass(b+"_on"),this.removeClass(b+"_disabled"),c&&this.removeAttribute("aria-pressed"),c&&this.removeAttribute("aria-disabled")}},getFrameDocument:function(){var a=this.$;try{a.contentWindow.document}catch(b){a.src=a.src}return a&&new CKEDITOR.dom.document(a.contentWindow.document)},copyAttributes:function(a,b){var c=this.$.attributes;b=b||{};for(var e=0;e=A.getChildCount()?(A=A.getChild(C-1),F=!0):A=A.getChild(C):J=F=!0;x.type==CKEDITOR.NODE_TEXT?t?E=!0:x.split(B):0ha)for(;Z;)Z=h(Z,K,!0);K=W}t||m()}}function b(){var a=!1,b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!0),d=CKEDITOR.dom.walker.bogus();return function(g){return c(g)||b(g)?!0:d(g)&&!a?a=!0:g.type==CKEDITOR.NODE_TEXT&&(g.hasAscendant("pre")||CKEDITOR.tools.trim(g.getText()).length)||g.type==CKEDITOR.NODE_ELEMENT&&!g.is(l)?!1:!0}}function c(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(1); return function(d){return c(d)||b(d)?!0:!a&&k(d)||d.type==CKEDITOR.NODE_ELEMENT&&d.is(CKEDITOR.dtd.$removeEmpty)}}function d(a){return function(){var b;return this[a?"getPreviousNode":"getNextNode"](function(a){!b&&m(a)&&(b=a);return h(a)&&!(k(a)&&a.equals(b))})}}var l={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},k=CKEDITOR.dom.walker.bogus(),g=/^[\t\r\n ]*(?: |\xa0)$/, h=CKEDITOR.dom.walker.editable(),m=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype={clone:function(){var a=new CKEDITOR.dom.range(this.root);a._setStartContainer(this.startContainer);a.startOffset=this.startOffset;a._setEndContainer(this.endContainer);a.endOffset=this.endOffset;a.collapsed=this.collapsed;return a},collapse:function(a){a?(this._setEndContainer(this.startContainer),this.endOffset=this.startOffset):(this._setStartContainer(this.endContainer),this.startOffset=this.endOffset); this.collapsed=!0},cloneContents:function(a){var b=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||f(this,2,b,!1,"undefined"==typeof a?!0:a);return b},deleteContents:function(a){this.collapsed||f(this,0,null,a)},extractContents:function(a,b){var c=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||f(this,1,c,a,"undefined"==typeof b?!0:b);return c},createBookmark:function(a){var b,c,d,g,h=this.collapsed;b=this.document.createElement("span");b.data("cke-bookmark",1);b.setStyle("display", "none");b.setHtml("\x26nbsp;");a&&(d="cke_bm_"+CKEDITOR.tools.getNextNumber(),b.setAttribute("id",d+(h?"C":"S")));h||(c=b.clone(),c.setHtml("\x26nbsp;"),a&&c.setAttribute("id",d+"E"),g=this.clone(),g.collapse(),g.insertNode(c));g=this.clone();g.collapse(!0);g.insertNode(b);c?(this.setStartAfter(b),this.setEndBefore(c)):this.moveToPosition(b,CKEDITOR.POSITION_AFTER_END);return{startNode:a?d+(h?"C":"S"):b,endNode:a?d+"E":c,serializable:a,collapsed:h}},createBookmark2:function(){function a(b){var e= b.container,d=b.offset,g;g=e;var h=d;g=g.type!=CKEDITOR.NODE_ELEMENT||0===h||h==g.getChildCount()?0:g.getChild(h-1).type==CKEDITOR.NODE_TEXT&&g.getChild(h).type==CKEDITOR.NODE_TEXT;g&&(e=e.getChild(d-1),d=e.getLength());if(e.type==CKEDITOR.NODE_ELEMENT&&0=a.offset&&(a.offset=d.getIndex(),a.container=d.getParent()))}}var c=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,!0);return function(c){var d=this.collapsed,g={container:this.startContainer, offset:this.startOffset},h={container:this.endContainer,offset:this.endOffset};c&&(a(g),b(g,this.root),d||(a(h),b(h,this.root)));return{start:g.container.getAddress(c),end:d?null:h.container.getAddress(c),startOffset:g.offset,endOffset:h.offset,normalized:c,collapsed:d,is2:!0}}}(),moveToBookmark:function(a){if(a.is2){var b=this.document.getByAddress(a.start,a.normalized),c=a.startOffset,d=a.end&&this.document.getByAddress(a.end,a.normalized);a=a.endOffset;this.setStart(b,c);d?this.setEnd(d,a):this.collapse(!0)}else b= (c=a.serializable)?this.document.getById(a.startNode):a.startNode,a=c?this.document.getById(a.endNode):a.endNode,this.setStartBefore(b),b.remove(),a?(this.setEndBefore(a),a.remove()):this.collapse(!0)},getBoundaryNodes:function(){var a=this.startContainer,b=this.endContainer,c=this.startOffset,d=this.endOffset,g;if(a.type==CKEDITOR.NODE_ELEMENT)if(g=a.getChildCount(),g>c)a=a.getChild(c);else if(1>g)a=a.getPreviousSourceNode();else{for(a=a.$;a.lastChild;)a=a.lastChild;a=new CKEDITOR.dom.node(a);a= a.getNextSourceNode()||a}if(b.type==CKEDITOR.NODE_ELEMENT)if(g=b.getChildCount(),g>d)b=b.getChild(d).getPreviousSourceNode(!0);else if(1>g)b=b.getPreviousSourceNode();else{for(b=b.$;b.lastChild;)b=b.lastChild;b=new CKEDITOR.dom.node(b)}a.getPosition(b)&CKEDITOR.POSITION_FOLLOWING&&(a=b);return{startNode:a,endNode:b}},getCommonAncestor:function(a,b){var c=this.startContainer,d=this.endContainer,c=c.equals(d)?a&&c.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?c.getChild(this.startOffset): c:c.getCommonAncestor(d);return b&&!c.is?c.getParent():c},optimize:function(){var a=this.startContainer,b=this.startOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setStartAfter(a):this.setStartBefore(a));a=this.endContainer;b=this.endOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setEndAfter(a):this.setEndBefore(a))},optimizeBookmark:function(){var a=this.startContainer,b=this.endContainer;a.is&&a.is("span")&&a.data("cke-bookmark")&&this.setStartAt(a,CKEDITOR.POSITION_BEFORE_START); b&&b.is&&b.is("span")&&b.data("cke-bookmark")&&this.setEndAt(b,CKEDITOR.POSITION_AFTER_END)},trim:function(a,b){var c=this.startContainer,d=this.startOffset,g=this.collapsed;if((!a||g)&&c&&c.type==CKEDITOR.NODE_TEXT){if(d)if(d>=c.getLength())d=c.getIndex()+1,c=c.getParent();else{var h=c.split(d),d=c.getIndex()+1,c=c.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(h,this.endOffset-this.startOffset):c.equals(this.endContainer)&&(this.endOffset+=1)}else d=c.getIndex(),c=c.getParent(); this.setStart(c,d);if(g){this.collapse(!0);return}}c=this.endContainer;d=this.endOffset;b||g||!c||c.type!=CKEDITOR.NODE_TEXT||(d?(d>=c.getLength()||c.split(d),d=c.getIndex()+1):d=c.getIndex(),c=c.getParent(),this.setEnd(c,d))},enlarge:function(a,b){function c(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}var d=new RegExp(/[^\s\ufeff]/);switch(a){case CKEDITOR.ENLARGE_INLINE:var g=1;case CKEDITOR.ENLARGE_ELEMENT:var h=function(a,b){var e=new CKEDITOR.dom.range(m); e.setStart(a,b);e.setEndAt(m,CKEDITOR.POSITION_BEFORE_END);var e=new CKEDITOR.dom.walker(e),c;for(e.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};c=e.next();){if(c.type!=CKEDITOR.NODE_TEXT)return!1;H=c!=a?c.getText():c.substring(b);if(d.test(H))return!1}return!0};if(this.collapsed)break;var f=this.getCommonAncestor(),m=this.root,l,k,t,x,A,B=!1,C,H;C=this.startContainer;var F=this.startOffset;C.type==CKEDITOR.NODE_TEXT?(F&&(C=!CKEDITOR.tools.trim(C.substring(0,F)).length&& C,B=!!C),C&&((x=C.getPrevious())||(t=C.getParent()))):(F&&(x=C.getChild(F-1)||C.getLast()),x||(t=C));for(t=c(t);t||x;){if(t&&!x){!A&&t.equals(f)&&(A=!0);if(g?t.isBlockBoundary():!m.contains(t))break;B&&"inline"==t.getComputedStyle("display")||(B=!1,A?l=t:this.setStartBefore(t));x=t.getPrevious()}for(;x;)if(C=!1,x.type==CKEDITOR.NODE_COMMENT)x=x.getPrevious();else{if(x.type==CKEDITOR.NODE_TEXT)H=x.getText(),d.test(H)&&(x=null),C=/[\s\ufeff]$/.test(H);else if((x.$.offsetWidth>(CKEDITOR.env.webkit?1: 0)||b&&x.is("br"))&&!x.data("cke-bookmark"))if(B&&CKEDITOR.dtd.$removeEmpty[x.getName()]){H=x.getText();if(d.test(H))x=null;else for(var F=x.$.getElementsByTagName("*"),I=0,J;J=F[I++];)if(!CKEDITOR.dtd.$removeEmpty[J.nodeName.toLowerCase()]){x=null;break}x&&(C=!!H.length)}else x=null;C&&(B?A?l=t:t&&this.setStartBefore(t):B=!0);if(x){C=x.getPrevious();if(!t&&!C){t=x;x=null;break}x=C}else t=null}t&&(t=c(t.getParent()))}C=this.endContainer;F=this.endOffset;t=x=null;A=B=!1;C.type==CKEDITOR.NODE_TEXT? CKEDITOR.tools.trim(C.substring(F)).length?B=!0:(B=!C.getLength(),F==C.getLength()?(x=C.getNext())||(t=C.getParent()):h(C,F)&&(t=C.getParent())):(x=C.getChild(F))||(t=C);for(;t||x;){if(t&&!x){!A&&t.equals(f)&&(A=!0);if(g?t.isBlockBoundary():!m.contains(t))break;B&&"inline"==t.getComputedStyle("display")||(B=!1,A?k=t:t&&this.setEndAfter(t));x=t.getNext()}for(;x;){C=!1;if(x.type==CKEDITOR.NODE_TEXT)H=x.getText(),h(x,0)||(x=null),C=/^[\s\ufeff]/.test(H);else if(x.type==CKEDITOR.NODE_ELEMENT){if((0=f.getLength()?h.setStartAfter(f):(h.setStartBefore(f),c=0):h.setStartBefore(f));m&&m.type==CKEDITOR.NODE_TEXT&&(k?k>=m.getLength()?h.setEndAfter(m):(h.setEndAfter(m),t=0):h.setEndBefore(m));var h=new CKEDITOR.dom.walker(h),x=CKEDITOR.dom.walker.bookmark(),A=CKEDITOR.dom.walker.bogus();h.evaluator=function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)}; var B;h.guard=function(b,c){if(g&&A(b)||x(b))return!0;if(a==CKEDITOR.SHRINK_ELEMENT&&b.type==CKEDITOR.NODE_TEXT||c&&b.equals(B)||!1===d&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return!1;c||b.type!=CKEDITOR.NODE_ELEMENT||(B=b);return!0};c&&(f=h[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(f,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);t&&(h.reset(),(h=h[a==CKEDITOR.SHRINK_ELEMENT? "lastBackward":"previous"]())&&this.setEndAt(h,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END));return!(!c&&!t)}},insertNode:function(a){this.optimizeBookmark();this.trim(!1,!0);var b=this.startContainer,c=b.getChild(this.startOffset);c?a.insertBefore(c):b.append(a);a.getParent()&&a.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(a)},moveToPosition:function(a,b){this.setStartAt(a,b);this.collapse(!0)},moveToRange:function(a){this.setStart(a.startContainer,a.startOffset); this.setEnd(a.endContainer,a.endOffset)},selectNodeContents:function(a){this.setStart(a,0);this.setEnd(a,a.type==CKEDITOR.NODE_TEXT?a.getLength():a.getChildCount())},setStart:function(b,c){b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]&&(c=b.getIndex(),b=b.getParent());this._setStartContainer(b);this.startOffset=c;this.endContainer||(this._setEndContainer(b),this.endOffset=c);a(this)},setEnd:function(b,c){b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]&&(c=b.getIndex()+ 1,b=b.getParent());this._setEndContainer(b);this.endOffset=c;this.startContainer||(this._setStartContainer(b),this.startOffset=c);a(this)},setStartAfter:function(a){this.setStart(a.getParent(),a.getIndex()+1)},setStartBefore:function(a){this.setStart(a.getParent(),a.getIndex())},setEndAfter:function(a){this.setEnd(a.getParent(),a.getIndex()+1)},setEndBefore:function(a){this.setEnd(a.getParent(),a.getIndex())},setStartAt:function(b,c){switch(c){case CKEDITOR.POSITION_AFTER_START:this.setStart(b,0); break;case CKEDITOR.POSITION_BEFORE_END:b.type==CKEDITOR.NODE_TEXT?this.setStart(b,b.getLength()):this.setStart(b,b.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(b);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(b)}a(this)},setEndAt:function(b,c){switch(c){case CKEDITOR.POSITION_AFTER_START:this.setEnd(b,0);break;case CKEDITOR.POSITION_BEFORE_END:b.type==CKEDITOR.NODE_TEXT?this.setEnd(b,b.getLength()):this.setEnd(b,b.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(b); break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(b)}a(this)},fixBlock:function(a,b){var c=this.createBookmark(),d=this.document.createElement(b);this.collapse(a);this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);this.extractContents().appendTo(d);d.trim();this.insertNode(d);var g=d.getBogus();g&&g.remove();d.appendBogus();this.moveToBookmark(c);return d},splitBlock:function(a,b){var c=new CKEDITOR.dom.elementPath(this.startContainer,this.root),d=new CKEDITOR.dom.elementPath(this.endContainer,this.root), g=c.block,h=d.block,f=null;if(!c.blockLimit.equals(d.blockLimit))return null;"br"!=a&&(g||(g=this.fixBlock(!0,a),h=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block),h||(h=this.fixBlock(!1,a)));c=g&&this.checkStartOfBlock();d=h&&this.checkEndOfBlock();this.deleteContents();g&&g.equals(h)&&(d?(f=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(h,CKEDITOR.POSITION_AFTER_END),h=null):c?(f=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(g, CKEDITOR.POSITION_BEFORE_START),g=null):(h=this.splitElement(g,b||!1),g.is("ul","ol")||g.appendBogus()));return{previousBlock:g,nextBlock:h,wasStartOfBlock:c,wasEndOfBlock:d,elementPath:f}},splitElement:function(a,b){if(!this.collapsed)return null;this.setEndAt(a,CKEDITOR.POSITION_BEFORE_END);var c=this.extractContents(!1,b||!1),d=a.clone(!1,b||!1);c.appendTo(d);d.insertAfter(a);this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return d},removeEmptyBlocksAtEnd:function(){function a(e){return function(a){return b(a)|| c(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.isEmptyInlineRemoveable()||e.is("table")&&a.is("caption")?!1:!0}}var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!1);return function(b){for(var c=this.createBookmark(),d=this[b?"endPath":"startPath"](),g=d.block||d.blockLimit,h;g&&!g.equals(d.root)&&!g.getFirst(a(g));)h=g.getParent(),this[b?"setEndAt":"setStartAt"](g,CKEDITOR.POSITION_AFTER_END),g.remove(1),g=h;this.moveToBookmark(c)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer, this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,this.root)},checkBoundaryOfElement:function(a,b){var d=b==CKEDITOR.START,g=this.clone();g.collapse(d);g[d?"setStartAt":"setEndAt"](a,d?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);g=new CKEDITOR.dom.walker(g);g.evaluator=c(d);return g[d?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var a=this.startContainer,c=this.startOffset;CKEDITOR.env.ie&&c&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.ltrim(a.substring(0, c)),g.test(a)&&this.trim(0,1));this.trim();a=new CKEDITOR.dom.elementPath(this.startContainer,this.root);c=this.clone();c.collapse(!0);c.setStartAt(a.block||a.blockLimit,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(c);a.evaluator=b();return a.checkBackward()},checkEndOfBlock:function(){var a=this.endContainer,c=this.endOffset;CKEDITOR.env.ie&&a.type==CKEDITOR.NODE_TEXT&&(a=CKEDITOR.tools.rtrim(a.substring(c)),g.test(a)&&this.trim(1,0));this.trim();a=new CKEDITOR.dom.elementPath(this.endContainer, this.root);c=this.clone();c.collapse(!1);c.setEndAt(a.block||a.blockLimit,CKEDITOR.POSITION_BEFORE_END);a=new CKEDITOR.dom.walker(c);a.evaluator=b();return a.checkForward()},getPreviousNode:function(a,b,c){var d=this.clone();d.collapse(1);d.setStartAt(c||this.root,CKEDITOR.POSITION_AFTER_START);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.previous()},getNextNode:function(a,b,c){var d=this.clone();d.collapse();d.setEndAt(c||this.root,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(d); c.evaluator=a;c.guard=b;return c.next()},checkReadOnly:function(){function a(b,c){for(;b;){if(b.type==CKEDITOR.NODE_ELEMENT){if("false"==b.getAttribute("contentEditable")&&!b.data("cke-editable"))return 0;if(b.is("html")||"true"==b.getAttribute("contentEditable")&&(b.contains(c)||b.equals(c)))break}b=b.getParent()}return 1}return function(){var b=this.startContainer,c=this.endContainer;return!(a(b,c)&&a(c,b))}}(),moveToElementEditablePosition:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&!a.isEditable(!1))return this.moveToPosition(a, b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var c=0;a;){if(a.type==CKEDITOR.NODE_TEXT){b&&this.endContainer&&this.checkEndOfBlock()&&g.test(a.getText())?this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);c=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable())this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),c=1;else if(b&&a.is("br")&&this.endContainer&& this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);else if("false"==a.getAttribute("contenteditable")&&a.is(CKEDITOR.dtd.$block))return this.setStartBefore(a),this.setEndAfter(a),!0;var d=a,h=c,f=void 0;d.type==CKEDITOR.NODE_ELEMENT&&d.isEditable(!1)&&(f=d[b?"getLast":"getFirst"](m));h||f||(f=d[b?"getPrevious":"getNext"](m));a=f}return!!c},moveToClosestEditablePosition:function(a,b){var c,d=0,g,h,f=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];a?(c=new CKEDITOR.dom.range(this.root), c.moveToPosition(a,f[b?0:1])):c=this.clone();if(a&&!a.is(CKEDITOR.dtd.$block))d=1;else if(g=c[b?"getNextEditableNode":"getPreviousEditableNode"]())d=1,(h=g.type==CKEDITOR.NODE_ELEMENT)&&g.is(CKEDITOR.dtd.$block)&&"false"==g.getAttribute("contenteditable")?(c.setStartAt(g,CKEDITOR.POSITION_BEFORE_START),c.setEndAt(g,CKEDITOR.POSITION_AFTER_END)):!CKEDITOR.env.needsBrFiller&&h&&g.is(CKEDITOR.dom.walker.validEmptyBlockContainers)?(c.setEnd(g,0),c.collapse()):c.moveToPosition(g,f[b?1:0]);d&&this.moveToRange(c); return!!d},moveToElementEditStart:function(a){return this.moveToElementEditablePosition(a)},moveToElementEditEnd:function(a){return this.moveToElementEditablePosition(a,!0)},getEnclosedNode:function(){var a=this.clone();a.optimize();if(a.startContainer.type!=CKEDITOR.NODE_ELEMENT||a.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var a=new CKEDITOR.dom.walker(a),b=CKEDITOR.dom.walker.bookmark(!1,!0),c=CKEDITOR.dom.walker.whitespaces(!0);a.evaluator=function(a){return c(a)&&b(a)};var d=a.next(); a.reset();return d&&d.equals(a.previous())?d:null},getTouchedStartNode:function(){var a=this.startContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.startOffset)||a},getTouchedEndNode:function(){var a=this.endContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.endOffset-1)||a},getNextEditableNode:d(),getPreviousEditableNode:d(1),_getTableElement:function(a){a=a||{td:1,th:1,tr:1,tbody:1,thead:1,tfoot:1,table:1};var b=this.startContainer,c= this.endContainer,d=b.getAscendant("table",!0),g=c.getAscendant("table",!0);return d&&!this.root.contains(d)?null:CKEDITOR.env.safari&&d&&c.equals(this.root)?b.getAscendant(a,!0):this.getEnclosedNode()?this.getEnclosedNode().getAscendant(a,!0):d&&g&&(d.equals(g)||d.contains(g)||g.contains(d))?b.getAscendant(a,!0):null},scrollIntoView:function(){var a=new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",this.document),b,c,d,g=this.clone();g.optimize();(d=g.startContainer.type== CKEDITOR.NODE_TEXT)?(c=g.startContainer.getText(),b=g.startContainer.split(g.startOffset),a.insertAfter(g.startContainer)):g.insertNode(a);a.scrollIntoView();d&&(g.startContainer.setText(c),b.remove());a.remove()},getClientRects:function(){function a(b,c){var e=CKEDITOR.tools.array.map(b,function(a){return a}),d=new CKEDITOR.dom.range(c.root),g,h,f;c.startContainer instanceof CKEDITOR.dom.element&&(h=0===c.startOffset&&c.startContainer.hasAttribute("data-widget"));c.endContainer instanceof CKEDITOR.dom.element&& (f=(f=c.endOffset===(c.endContainer.getChildCount?c.endContainer.getChildCount():c.endContainer.length))&&c.endContainer.hasAttribute("data-widget"));h&&d.setStart(c.startContainer.getParent(),c.startContainer.getIndex());f&&d.setEnd(c.endContainer.getParent(),c.endContainer.getIndex()+1);if(h||f)c=d;d=c.cloneContents().find("[data-cke-widget-id]").toArray();if(d=CKEDITOR.tools.array.map(d,function(a){var b=c.root.editor;a=a.getAttribute("data-cke-widget-id");return b.widgets.instances[a].element}))return d= CKEDITOR.tools.array.map(d,function(a){var b;b=a.getParent().hasClass("cke_widget_wrapper")?a.getParent():a;g=this.root.getDocument().$.createRange();g.setStart(b.getParent().$,b.getIndex());g.setEnd(b.getParent().$,b.getIndex()+1);b=g.getClientRects();b.widgetRect=a.getClientRect();return b},c),CKEDITOR.tools.array.forEach(d,function(a){function b(d){CKEDITOR.tools.array.forEach(e,function(b,g){var h=CKEDITOR.tools.objectCompare(a[d],b);h||(h=CKEDITOR.tools.objectCompare(a.widgetRect,b));h&&(Array.prototype.splice.call(e, g,a.length-d,a.widgetRect),c=!0)});c||(darguments.length||(this.range=a,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||(this._={}))}function f(a){var b=[];a.forEach(function(a){if("true"==a.getAttribute("contenteditable"))return b.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return b}function b(a,c,d,g){a:{null==g&&(g=f(d));for(var h;h=g.shift();)if(h.getDtd().p){g={element:h,remaining:g};break a}g=null}if(!g)return 0;if((h=CKEDITOR.filter.instances[g.element.data("cke-filter")])&& !h.check(c))return b(a,c,d,g.remaining);c=new CKEDITOR.dom.range(g.element);c.selectNodeContents(g.element);c=c.createIterator();c.enlargeBr=a.enlargeBr;c.enforceRealBlocks=a.enforceRealBlocks;c.activeFilter=c.filter=h;a._.nestedEditable={element:g.element,container:d,remaining:g.remaining,iterator:c};return 1}function c(a,b,c){if(!b)return!1;a=a.clone();a.collapse(!c);return a.checkBoundaryOfElement(b,c?CKEDITOR.START:CKEDITOR.END)}var d=/^[\r\n\t ]+$/,l=CKEDITOR.dom.walker.bookmark(!1,!0),k=CKEDITOR.dom.walker.whitespaces(!0), g=function(a){return l(a)&&k(a)},h={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var e,f,k,y,u;a=a||"p";if(this._.nestedEditable){if(e=this._.nestedEditable.iterator.getNextParagraph(a))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,e;this.activeFilter=this.filter;if(b(this,a,this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(a);this._.nestedEditable= null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var p=this.range.clone();f=p.startPath();var v=p.endPath(),w=!p.collapsed&&c(p,f.block),r=!p.collapsed&&c(p,v.block,1);p.shrink(CKEDITOR.SHRINK_ELEMENT,!0);w&&p.setStartAt(f.block,CKEDITOR.POSITION_BEFORE_END);r&&p.setEndAt(v.block,CKEDITOR.POSITION_AFTER_START);f=p.endContainer.hasAscendant("pre",!0)||p.startContainer.hasAscendant("pre",!0);p.enlarge(this.forceBrBreak&&!f||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS); p.collapsed||(f=new CKEDITOR.dom.walker(p.clone()),v=CKEDITOR.dom.walker.bookmark(!0,!0),f.evaluator=v,this._.nextNode=f.next(),f=new CKEDITOR.dom.walker(p.clone()),f.evaluator=v,f=f.previous(),this._.lastNode=f.getNextSourceNode(!0,null,p.root),this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(v=this.range.clone(),v.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),v.checkEndOfBlock()&& (v=new CKEDITOR.dom.elementPath(v.endContainer,v.root),this._.lastNode=(v.block||v.blockLimit).getNextSourceNode(!0))),this._.lastNode&&p.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=p.document.createText(""),this._.lastNode.insertAfter(f)),p=null);this._.started=1;f=p}v=this._.nextNode;p=this._.lastNode;for(this._.nextNode=null;v;){var w=0,r=v.hasAscendant("pre"),z=v.type!=CKEDITOR.NODE_ELEMENT,t=0;if(z)v.type==CKEDITOR.NODE_TEXT&&d.test(v.getText())&&(z=0);else{var x=v.getName(); if(CKEDITOR.dtd.$block[x]&&"false"==v.getAttribute("contenteditable")){e=v;b(this,a,e);break}else if(v.isBlockBoundary(this.forceBrBreak&&!r&&{br:1})){if("br"==x)z=1;else if(!f&&!v.getChildCount()&&"hr"!=x){e=v;k=v.equals(p);break}f&&(f.setEndAt(v,CKEDITOR.POSITION_BEFORE_START),"br"!=x&&(this._.nextNode=v));w=1}else{if(v.getFirst()){f||(f=this.range.clone(),f.setStartAt(v,CKEDITOR.POSITION_BEFORE_START));v=v.getFirst();continue}z=1}}z&&!f&&(f=this.range.clone(),f.setStartAt(v,CKEDITOR.POSITION_BEFORE_START)); k=(!w||z)&&v.equals(p);if(f&&!w)for(;!v.getNext(g)&&!k;){x=v.getParent();if(x.isBlockBoundary(this.forceBrBreak&&!r&&{br:1})){w=1;z=0;k||x.equals(p);f.setEndAt(x,CKEDITOR.POSITION_BEFORE_END);break}v=x;z=1;k=v.equals(p);t=1}z&&f.setEndAt(v,CKEDITOR.POSITION_AFTER_END);v=this._getNextSourceNode(v,t,p);if((k=!v)||w&&f)break}if(!e){if(!f)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;e=new CKEDITOR.dom.elementPath(f.startContainer,f.root);v=e.blockLimit;w={div:1,th:1,td:1}; e=e.block;!e&&v&&!this.enforceRealBlocks&&w[v.getName()]&&f.checkStartOfBlock()&&f.checkEndOfBlock()&&!v.equals(f.root)?e=v:!e||this.enforceRealBlocks&&e.is(h)?(e=this.range.document.createElement(a),f.extractContents().appendTo(e),e.trim(),f.insertNode(e),y=u=!0):"li"!=e.getName()?f.checkStartOfBlock()&&f.checkEndOfBlock()||(e=e.clone(!1),f.extractContents().appendTo(e),e.trim(),u=f.splitBlock(),y=!u.wasStartOfBlock,u=!u.wasEndOfBlock,f.insertNode(e)):k||(this._.nextNode=e.equals(p)?null:this._getNextSourceNode(f.getBoundaryNodes().endNode, 1,p))}y&&(y=e.getPrevious())&&y.type==CKEDITOR.NODE_ELEMENT&&("br"==y.getName()?y.remove():y.getLast()&&"br"==y.getLast().$.nodeName.toLowerCase()&&y.getLast().remove());u&&(y=e.getLast())&&y.type==CKEDITOR.NODE_ELEMENT&&"br"==y.getName()&&(!CKEDITOR.env.needsBrFiller||y.getPrevious(l)||y.getNext(l))&&y.remove();this._.nextNode||(this._.nextNode=k||e.equals(p)||!p?null:this._getNextSourceNode(e,1,p));return e},_getNextSourceNode:function(a,b,c){function d(a){return!(a.equals(c)||a.equals(g))}var g= this.range.root;for(a=a.getNextSourceNode(b,null,d);!l(a);)a=a.getNextSourceNode(b,null,d);return a}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}}(),CKEDITOR.command=function(a,f){this.uiItems=[];this.exec=function(b){if(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())return!1;this.editorFocus&&a.focus();return!1===this.fire("exec")?!0:!1!==f.exec.call(this,a,b)};this.refresh=function(a,b){if(!this.readOnly&&a.readOnly)return!0;if(this.context&&!b.isContextFor(this.context)|| !this.checkAllowed(!0))return this.disable(),!0;this.startDisabled||this.enable();this.modes&&!this.modes[a.mode]&&this.disable();return!1===this.fire("refresh",{editor:a,path:b})?!0:f.refresh&&!1!==f.refresh.apply(this,arguments)};var b;this.checkAllowed=function(c){return c||"boolean"!=typeof b?b=a.activeFilter.checkFeature(this):b};CKEDITOR.tools.extend(this,f,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!f.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)},CKEDITOR.command.prototype= {enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(this.preserveState&&"undefined"!=typeof this.previousState?this.previousState:CKEDITOR.TRISTATE_OFF)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(a){if(this.state==a||a!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return!1;this.previousState=this.state;this.state=a;this.fire("state");return!0},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?this.setState(CKEDITOR.TRISTATE_ON): this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}},CKEDITOR.event.implementOn(CKEDITOR.command.prototype),CKEDITOR.ENTER_P=1,CKEDITOR.ENTER_BR=2,CKEDITOR.ENTER_DIV=3,CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"\x3c!DOCTYPE html\x3e",bodyId:"",bodyClass:"",fullPage:!1,height:200,contentsCss:CKEDITOR.getUrl("contents.css"), extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1E4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]},function(){function a(a,b,c,e,d){var g,h;a=[];for(g in b){h=b[g];h="boolean"==typeof h?{}:"function"==typeof h?{match:h}:I(h);"$"!=g.charAt(0)&&(h.elements=g);c&&(h.featureName=c.toLowerCase());var f=h;f.elements=k(f.elements,/\s+/)||null;f.propertiesOnly=f.propertiesOnly||!0===f.elements;var m=/\s*,\s*/,l=void 0;for(l in L){f[l]=k(f[l], m)||null;var n=f,v=G[l],D=k(f[G[l]],m),x=f[l],A=[],B=!0,r=void 0;D?B=!1:D={};for(r in x)"!"==r.charAt(0)&&(r=r.slice(1),A.push(r),D[r]=!0,B=!1);for(;r=A.pop();)x[r]=x["!"+r],delete x["!"+r];n[v]=(B?!1:D)||null}f.match=f.match||null;e.push(h);a.push(h)}b=d.elements;d=d.generic;var F;c=0;for(e=a.length;c=--g&&(l&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),e(b))},q=function(b,c){a[b]=1;var e=f[b];delete f[b];for(var d=0;d=CKEDITOR.env.version||CKEDITOR.env.ie9Compat)?d.$.onreadystatechange=function(){if("loaded"==d.$.readyState||"complete"==d.$.readyState)d.$.onreadystatechange=null,q(b,!0)}:(d.$.onload=function(){setTimeout(function(){d.$.onload=null;d.$.onerror=null;q(b,!0)},0)},d.$.onerror=function(){d.$.onload=null;d.$.onerror=null;q(b,!1)}));d.appendTo(CKEDITOR.document.getHead())}}};l&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var u=0;u]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}},function(){var a=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g, f={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(b){for(var c,d,l=0,k;c=this._.htmlPartsRegex.exec(b);){d=c.index;if(d>l)if(l=b.substring(l,d),k)k.push(l);else this.onText(l);l=this._.htmlPartsRegex.lastIndex;if(d=c[1])if(d=d.toLowerCase(),k&&CKEDITOR.dtd.$cdata[d]&& (this.onCDATA(k.join("")),k=null),!k){this.onTagClose(d);continue}if(k)k.push(c[0]);else if(d=c[3]){if(d=d.toLowerCase(),!/="/.test(d)){var g={},h,m=c[4];c=!!c[5];if(m)for(;h=a.exec(m);){var e=h[1].toLowerCase();h=h[2]||h[3]||h[4]||"";g[e]=!h&&f[e]?e:CKEDITOR.tools.htmlDecodeAttr(h)}this.onTagOpen(d,g,c);!k&&CKEDITOR.dtd.$cdata[d]&&(k=[])}}else if(d=c[2])this.onComment(d)}if(b.length>l)this.onText(b.substring(l,b.length))}}}(),CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._= {output:[]}},proto:{openTag:function(a){this._.output.push("\x3c",a)},openTagClose:function(a,f){f?this._.output.push(" /\x3e"):this._.output.push("\x3e")},attribute:function(a,f){"string"==typeof f&&(f=CKEDITOR.tools.htmlEncodeAttr(f));this._.output.push(" ",a,'\x3d"',f,'"')},closeTag:function(a){this._.output.push("\x3c/",a,"\x3e")},text:function(a){this._.output.push(a)},comment:function(a){this._.output.push("\x3c!--",a,"--\x3e")},write:function(a){this._.output.push(a)},reset:function(){this._.output= [];this._.indent=!1},getHtml:function(a){var f=this._.output.join("");a&&this.reset();return f}}}),"use strict",function(){CKEDITOR.htmlParser.node=function(){};CKEDITOR.htmlParser.node.prototype={remove:function(){var a=this.parent.children,f=CKEDITOR.tools.indexOf(a,this),b=this.previous,c=this.next;b&&(b.next=c);c&&(c.previous=b);a.splice(f,1);this.parent=null},replaceWith:function(a){var f=this.parent.children,b=CKEDITOR.tools.indexOf(f,this),c=a.previous=this.previous,d=a.next=this.next;c&&(c.next= a);d&&(d.previous=a);f[b]=a;a.parent=this.parent;this.parent=null},insertAfter:function(a){var f=a.parent.children,b=CKEDITOR.tools.indexOf(f,a),c=a.next;f.splice(b+1,0,this);this.next=a.next;this.previous=a;a.next=this;c&&(c.previous=this);this.parent=a.parent},insertBefore:function(a){var f=a.parent.children,b=CKEDITOR.tools.indexOf(f,a);f.splice(b,0,this);this.next=a;(this.previous=a.previous)&&(a.previous.next=this);a.previous=this;this.parent=a.parent},getAscendant:function(a){var f="function"== typeof a?a:"string"==typeof a?function(b){return b.name==a}:function(b){return b.name in a},b=this.parent;for(;b&&b.type==CKEDITOR.NODE_ELEMENT;){if(f(b))return b;b=b.parent}return null},wrapWith:function(a){this.replaceWith(a);a.add(this);return a},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(a){return a||{}}}}(),"use strict",CKEDITOR.htmlParser.comment=function(a){this.value=a;this._={isBlockLike:!1}},CKEDITOR.htmlParser.comment.prototype= CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(a,f){var b=this.value;if(!(b=a.onComment(f,b,this)))return this.remove(),!1;if("string"!=typeof b)return this.replaceWith(b),!1;this.value=b;return!0},writeHtml:function(a,f){f&&this.filter(f);a.comment(this.value)}}),"use strict",function(){CKEDITOR.htmlParser.text=function(a){this.value=a;this._={isBlockLike:!1}};CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT, filter:function(a,f){if(!(this.value=a.onText(f,this.value,this)))return this.remove(),!1},writeHtml:function(a,f){f&&this.filter(f);a.text(this.value)}})}(),"use strict",function(){CKEDITOR.htmlParser.cdata=function(a){this.value=a};CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(a){a.write(this.value)}})}(),"use strict",CKEDITOR.htmlParser.fragment=function(){this.children=[];this.parent=null; this._={isBlockLike:!0,hasInlineStarted:!1}},function(){function a(a){return a.attributes["data-cke-survive"]?!1:"a"==a.name&&a.attributes.href||CKEDITOR.dtd.$removeEmpty[a.name]}var f=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),b={ol:1,ul:1},c=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),d={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"}; CKEDITOR.htmlParser.fragment.fromHtml=function(l,k,g){function h(a){var b;if(0k;k++)if(f=d[k]){f= f.exec(a,c,this);if(!1===f)return null;if(f&&f!=c)return this.onNode(a,f);if(c.parent&&!c.name)break}return c},onNode:function(a,c){var d=c.type;return d==CKEDITOR.NODE_ELEMENT?this.onElement(a,c):d==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(a,c.value)):d==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,c.value)):null},onAttribute:function(a,c,d,f){return(d=this.attributesRules[d])?d.exec(a,f,c,this):f}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype= {add:function(a,c,d){this.rules.splice(this.findIndex(c),0,{value:a,priority:c,options:d})},addMany:function(a,c,d){for(var f=[this.findIndex(c),0],k=0,g=a.length;k/g,"\x26gt;")+"\x3c/textarea\x3e");return"\x3ccke:encoded\x3e"+encodeURIComponent(a)+"\x3c/cke:encoded\x3e"})}function n(a){return a.replace(D,function(a,b){return decodeURIComponent(b)})}function q(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g, function(a){return"\x3c!--"+z+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function y(a){return CKEDITOR.tools.array.reduce(a.split(""),function(a,b){var c=b.toLowerCase(),e=b.toUpperCase(),d=u(c);c!==e&&(d+="|"+u(e));return a+("("+d+")")},"")}function u(a){var b;b=a.charCodeAt(0);var c=b.toString(16);b={htmlCode:"\x26#"+b+";?",hex:"\x26#x0*"+c+";?",entity:{"\x3c":"\x26lt;","\x3e":"\x26gt;",":":"\x26colon;"}[a]};for(var e in b)b[e]&&(a+="|"+b[e]);return a}function p(a){return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g, function(a,b){return decodeURIComponent(b)})}function v(a,b){var c=b._.dataStore;return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return c&&c[b]||""})}function w(a,b){var c=[],e=b.config.protectedSource,d=b._.dataStore||(b._.dataStore={id:1}),g=/<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,e=[/|$)/gi,//gi,//gi].concat(e);a=a.replace(/\x3c!--[\s\S]*?--\x3e/g, function(a){return"\x3c!--{cke_tempcomment}"+(c.push(a)-1)+"--\x3e"});for(var h=0;h]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g,function(a){return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g, function(a,b){d[d.id]=decodeURIComponent(b);return"{cke_protected_"+d.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,e,d){return"\x3c"+c+e+"\x3e"+v(p(d),b)+"\x3c/"+c+"\x3e"})}CKEDITOR.htmlDataProcessor=function(b){var c,d,g=this;this.editor=b;this.dataFilter=c=new CKEDITOR.htmlParser.filter;this.htmlFilter=d=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;c.addRules(B);c.addRules(C,{applyToAll:!0});c.addRules(a(b,"data"), {applyToAll:!0});d.addRules(H);d.addRules(F,{applyToAll:!0});d.addRules(a(b,"html"),{applyToAll:!0});b.on("toHtml",function(a){a=a.data;var c=a.dataValue,d,c=c.replace(N,""),c=w(c,b),c=e(c,G),c=m(c),c=e(c,L),c=c.replace(Q,"$1cke:$2"),c=c.replace(K,"\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),c=c.replace(/(]*>)(\r\n|\n)/g,"$1$2$2"),c=c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");d=a.context||b.editable().getName();var g;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&"pre"== d&&(d="div",c="\x3cpre\x3e"+c+"\x3c/pre\x3e",g=1);d=b.document.createElement(d);d.setHtml("a"+c);c=d.getHtml().substr(1);c=c.replace(new RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");g&&(c=c.replace(/^
|<\/pre>$/gi,""));c=c.replace(O,"$1$2");c=n(c);c=p(c);d=!1===a.fixForBody?!1:f(a.enterMode,b.config.autoParagraph);c=CKEDITOR.htmlParser.fragment.fromHtml(c,a.context,d);d&&(g=c,!g.children.length&&CKEDITOR.dtd[g.name][d]&&(d=new CKEDITOR.htmlParser.element(d),g.add(d)));a.dataValue=c},null,null,
5);b.on("toHtml",function(a){a.data.filter.applyTo(a.data.dataValue,!0,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(g.dataFilter,!0)},null,null,10);b.on("toHtml",function(a){a=a.data;var b=a.dataValue,c=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(c);b=c.getHtml(!0);a.dataValue=q(b)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(c=c.replace(/^
/i, ""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,f(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(g.htmlFilter,!0)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,!1,!0)},null,null,11);b.on("toDataFormat",function(a){var c=a.data.dataValue,e=g.writer;e.reset();c.writeChildrenHtml(e);c=e.getHtml(!0);c=p(c);c=v(c,b);a.data.dataValue=c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype= {toHtml:function(a,b,c,e){var d=this.editor,g,h,f,m;b&&"object"==typeof b?(g=b.context,c=b.fixForBody,e=b.dontFilter,h=b.filter,f=b.enterMode,m=b.protectedWhitespaces):g=b;g||null===g||(g=d.editable().getName());return d.fire("toHtml",{dataValue:a,context:g,fixForBody:c,dontFilter:e,filter:h||d.filter,enterMode:f||d.enterMode,protectedWhitespaces:m}).dataValue},toDataFormat:function(a,b){var c,e,d;b&&(c=b.context,e=b.filter,d=b.enterMode);c||null===c||(c=this.editor.editable().getName());return this.editor.fire("toDataFormat", {dataValue:a,filter:e||this.editor.filter,context:c,enterMode:d||this.editor.enterMode}).dataValue}};var r=/(?: |\xa0)$/,z="{cke_protected}",t=CKEDITOR.dtd,x="caption colgroup col thead tfoot tbody".split(" "),A=CKEDITOR.tools.extend({},t.$blockLimit,t.$block),B={elements:{input:g,textarea:g}},C={attributeNames:[[/^on/,"data-cke-pa-on"],[/^srcdoc/,"data-cke-pa-srcdoc"],[/^data-cke-expando$/,""]],elements:{iframe:function(a){if(a.attributes&&a.attributes.src){var b=a.attributes.src.toLowerCase().replace(/[^a-z]/gi, "");if(0===b.indexOf("javascript")||0===b.indexOf("data"))a.attributes["data-cke-pa-src"]=a.attributes.src,delete a.attributes.src}}}},H={elements:{embed:function(a){var b=a.parent;if(b&&"object"==b.name){var c=b.attributes.width,b=b.attributes.height;c&&(a.attributes.width=c);b&&(a.attributes.height=b)}},a:function(a){var b=a.attributes;if(!(a.children.length||b.name||b.id||a.attributes["data-cke-saved-name"]))return!1}}},F={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/, ""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return!1;for(var c=["name","href","src"],e,d=0;de? 1:-1})},param:function(a){a.children=[];a.isEmpty=!0;return a},span:function(a){"Apple-style-span"==a.attributes["class"]&&delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck;delete a.attributes.contenteditable},style:function(a){var b=a.children[0];b&&b.value&&(b.value=CKEDITOR.tools.trim(b.value));a.attributes.type||(a.attributes.type="text/css")},title:function(a){var b=a.children[0];!b&&k(a,b=new CKEDITOR.htmlParser.text); b.value=a.attributes["data-cke-title"]||""},input:h,textarea:h},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(F.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})});var I=/<(a|area|img|input|source)\b([^>]*)>/gi,J=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,E=/^(href|src|name)$/i,L=/(?:])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi, G=/(])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,D=/([^<]*)<\/cke:encoded>/gi,N=new RegExp("("+y("\x3ccke:encoded\x3e")+"(.*?)"+y("\x3c/cke:encoded\x3e")+")|("+y("\x3c")+y("/")+"?"+y("cke:encoded\x3e")+")","gi"),Q=/(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,O=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,K=/]*?)\/?>(?!\s*<\/cke:\1)/gi}(),"use strict",CKEDITOR.htmlParser.element=function(a,f){this.name=a;this.attributes=f||{};this.children= [];var b=a||"",c=b.match(/^cke:(.*)/);c&&(b=c[1]);b=!!(CKEDITOR.dtd.$nonBodyContent[b]||CKEDITOR.dtd.$block[b]||CKEDITOR.dtd.$listItem[b]||CKEDITOR.dtd.$tableContent[b]||CKEDITOR.dtd.$nonEditable[b]||"br"==b);this.isEmpty=!!CKEDITOR.dtd.$empty[a];this.isUnknown=!CKEDITOR.dtd[a];this._={isBlockLike:b,hasInlineStarted:this.isEmpty||!b}},CKEDITOR.htmlParser.cssStyle=function(a){var f={};((a instanceof CKEDITOR.htmlParser.element?a.attributes.style:a)||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(a,c,d){"font-family"==c&&(d=d.replace(/["']/g,""));f[c.toLowerCase()]=d});return{rules:f,populate:function(a){var c=this.toString();c&&(a instanceof CKEDITOR.dom.element?a.setAttribute("style",c):a instanceof CKEDITOR.htmlParser.element?a.attributes.style=c:a.style=c)},toString:function(){var a=[],c;for(c in f)f[c]&&a.push(c,":",f[c],";");return a.join("")}}},function(){function a(a){return function(b){return b.type==CKEDITOR.NODE_ELEMENT&&("string"==typeof a?b.name==a:b.name in a)}}var f= function(a,b){a=a[0];b=b[0];return ab?1:0},b=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:b.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a,b){var f=this,k,g;b=f.getFilterContext(b);if(!f.parent)a.onRoot(b,f);for(;;){k=f.name;if(!(g=a.onElementName(b,k)))return this.remove(),!1;f.name=g;if(!(f=a.onElement(b,f)))return this.remove(), !1;if(f!==this)return this.replaceWith(f),!1;if(f.name==k)break;if(f.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(f),!1;if(!f.name)return this.replaceWithChildren(),!1}k=f.attributes;var h,m;for(h in k){for(g=k[h];;)if(m=a.onAttributeName(b,h))if(m!=h)delete k[h],h=m;else break;else{delete k[h];break}m&&(!1===(g=a.onAttribute(b,f,m,g))?delete k[m]:k[m]=g)}f.isEmpty||this.filterChildren(a,!1,b);return!0},filterChildren:b.filterChildren,writeHtml:function(a,b){b&&this.filter(b);var l=this.name, k=[],g=this.attributes,h,m;a.openTag(l,g);for(h in g)k.push([h,g[h]]);a.sortAttributes&&k.sort(f);h=0;for(m=k.length;hCKEDITOR.env.version||CKEDITOR.env.quirks))this.hasFocus&&(this.focus(),b());else if(this.hasFocus)this.focus(), a();else this.once("focus",function(){a()},null,null,-999)},getHtmlFromRange:function(a){if(a.collapsed)return new CKEDITOR.dom.documentFragment(a.document);a={doc:this.getDocument(),range:a.clone()};z.eol.detect(a,this);z.bogus.exclude(a);z.cell.shrink(a);a.fragment=a.range.cloneContents();z.tree.rebuild(a,this);z.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},extractHtmlFromRange:function(a,b){var c=t,e={range:a,doc:a.document},d=this.getHtmlFromRange(a);if(a.collapsed)return a.optimize(), d;a.enlarge(CKEDITOR.ENLARGE_INLINE,1);c.table.detectPurge(e);e.bookmark=a.createBookmark();delete e.range;var g=this.editor.createRange();g.moveToPosition(e.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);e.targetBookmark=g.createBookmark();c.list.detectMerge(e,this);c.table.detectRanges(e,this);c.block.detectMerge(e,this);e.tableContentsRanges?(c.table.deleteRanges(e),a.moveToBookmark(e.bookmark),e.range=a):(a.moveToBookmark(e.bookmark),e.range=a,a.extractContents(c.detectExtractMerge(e)));a.moveToBookmark(e.targetBookmark); a.optimize();c.fixUneditableRangePosition(a);c.list.merge(e,this);c.table.purge(e,this);c.block.merge(e,this);if(b){c=a.startPath();if(e=a.checkStartOfBlock()&&a.checkEndOfBlock()&&c.block&&!a.root.equals(c.block)){a:{var e=c.block.getElementsByTag("span"),g=0,f;if(e)for(;f=e.getItem(g++);)if(!q(f)){e=!0;break a}e=!1}e=!e}e&&(a.moveToPosition(c.block,CKEDITOR.POSITION_BEFORE_START),c.block.remove())}else c.autoParagraph(this.editor,a),y(a.startContainer)&&a.startContainer.appendBogus();a.startContainer.mergeSiblings(); return d},setup:function(){var a=this.editor;this.attachListener(a,"beforeGetData",function(){var b=this.getData();this.is("textarea")||!1!==a.config.ignoreEmptyParagraph&&(b=b.replace(p,function(a,b){return b}));a.setData(b,null,1)},this);this.attachListener(a,"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(a,"afterSetData",function(){this.setData(a.getData(1))},this);this.attachListener(a,"loadSnapshot",function(a){this.setData(a.data,1)},this);this.attachListener(a, "beforeFocus",function(){var b=a.getSelection();(b=b&&b.getNative())&&"Control"==b.type||this.focus()},this);this.attachListener(a,"insertHtml",function(a){this.insertHtml(a.data.dataValue,a.data.mode,a.data.range)},this);this.attachListener(a,"insertElement",function(a){this.insertElement(a.data)},this);this.attachListener(a,"insertText",function(a){this.insertText(a.data)},this);this.setReadOnly(a.readOnly);this.attachClass("cke_editable");a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?this.attachClass("cke_editable_inline"): a.elementMode!=CKEDITOR.ELEMENT_MODE_REPLACE&&a.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO||this.attachClass("cke_editable_themed");this.attachClass("cke_contents_"+a.config.contentsLangDirection);a.keystrokeHandler.blockedKeystrokes[8]=+a.readOnly;a.keystrokeHandler.attach(this);this.on("blur",function(){this.hasFocus=!1},null,null,-1);this.on("focus",function(){this.hasFocus=!0},null,null,-1);if(CKEDITOR.env.webkit)this.on("scroll",function(){a._.previousScrollTop=a.editable().$.scrollTop},null, null,-1);if(CKEDITOR.env.edge&&14CKEDITOR.env.version?m.$.styleSheet.cssText=h:m.setText(h)):(h=g.appendStyleText(h),h=new CKEDITOR.dom.element(h.ownerNode||h.owningElement),f.setCustomData("stylesheet", h),h.data("cke-temp",1))}f=g.getCustomData("stylesheet_ref")||0;g.setCustomData("stylesheet_ref",f+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){a=a.data;var b=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&2!=a.$.button&&b.isReadOnly()&&a.preventDefault()});var k={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var c=b.data.domEvent.getKey(),e;b=a.getSelection();if(0!==b.getRanges().length){if(c in k){var d,g=b.getRanges()[0],f=g.startPath(),h,m,q,c=8==c;CKEDITOR.env.ie&&11>CKEDITOR.env.version&&(d=b.getSelectedElement())||(d=l(b))?(a.fire("saveSnapshot"),g.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START),d.remove(),g.select(),a.fire("saveSnapshot"),e=1):g.collapsed&&((h=f.block)&&(q=h[c?"getPrevious":"getNext"](n))&&q.type==CKEDITOR.NODE_ELEMENT&&q.is("table")&&g[c?"checkStartOfBlock":"checkEndOfBlock"]()?(a.fire("saveSnapshot"),g[c?"checkEndOfBlock":"checkStartOfBlock"]()&&h.remove(),g["moveToElementEdit"+ (c?"End":"Start")](q),g.select(),a.fire("saveSnapshot"),e=1):f.blockLimit&&f.blockLimit.is("td")&&(m=f.blockLimit.getAscendant("table"))&&g.checkBoundaryOfElement(m,c?CKEDITOR.START:CKEDITOR.END)&&(q=m[c?"getPrevious":"getNext"](n))?(a.fire("saveSnapshot"),g["moveToElementEdit"+(c?"End":"Start")](q),g.checkStartOfBlock()&&g.checkEndOfBlock()?q.remove():g.select(),a.fire("saveSnapshot"),e=1):(m=f.contains(["td","th","caption"]))&&g.checkBoundaryOfElement(m,c?CKEDITOR.START:CKEDITOR.END)&&(e=1))}return!e}}); a.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&this.attachListener(this,"keyup",function(b){b.data.getKeystroke()in k&&!this.getFirst(c)&&(this.appendBogus(),b=a.createRange(),b.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),b.select())});this.attachListener(this,"dblclick",function(b){if(a.readOnly)return!1;b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this,"click",b);CKEDITOR.env.ie&&!CKEDITOR.env.edge||this.attachListener(this,"mousedown", function(b){var c=b.data.getTarget();c.is("img","hr","input","textarea","select")&&!c.isReadOnly()&&(a.getSelection().selectElement(c),c.is("input","textarea","select")&&b.data.preventDefault())});CKEDITOR.env.edge&&this.attachListener(this,"mouseup",function(b){(b=b.data.getTarget())&&b.is("img")&&!b.isReadOnly()&&a.getSelection().selectElement(b)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(2==b.data.$.button&&(b=b.data.getTarget(),!b.getAscendant("table")&&!b.getOuterHtml().replace(p, ""))){var c=a.createRange();c.moveToElementEditStart(b);c.select(!0)}});CKEDITOR.env.webkit&&(this.attachListener(this,"click",function(a){a.data.getTarget().is("input","select")&&a.data.preventDefault()}),this.attachListener(this,"mouseup",function(a){a.data.getTarget().is("input","textarea")&&a.data.preventDefault()}));CKEDITOR.env.webkit&&this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var c=b.data.domEvent.getKey();if(c in k&&(b=a.getSelection(),0!==b.getRanges().length)){var c= 8==c,d=b.getRanges()[0];b=d.startPath();if(d.collapsed)a:{var g=b.block;if(g&&d[c?"checkStartOfBlock":"checkEndOfBlock"]()&&d.moveToClosestEditablePosition(g,!c)&&d.collapsed){if(d.startContainer.type==CKEDITOR.NODE_ELEMENT){var f=d.startContainer.getChild(d.startOffset-(c?1:0));if(f&&f.type==CKEDITOR.NODE_ELEMENT&&f.is("hr")){a.fire("saveSnapshot");f.remove();b=!0;break a}}d=d.startPath().block;if(!d||d&&d.contains(g))b=void 0;else{a.fire("saveSnapshot");var h;(h=(c?d:g).getBogus())&&h.remove(); h=a.getSelection();f=h.createBookmarks();(c?g:d).moveChildren(c?d:g,!1);b.lastElement.mergeSiblings();e(g,d,!c);h.selectBookmarks(f);b=!0}}else b=!1}else c=d,h=b.block,d=c.endPath().block,h&&d&&!h.equals(d)?(a.fire("saveSnapshot"),(g=h.getBogus())&&g.remove(),c.enlarge(CKEDITOR.ENLARGE_INLINE),c.deleteContents(),d.getParent()&&(d.moveChildren(h,!1),b.lastElement.mergeSiblings(),e(h,d,!0)),c=a.getSelection().getRanges()[0],c.collapse(1),c.optimize(),""===c.startContainer.getHtml()&&c.startContainer.appendBogus(), c.select(),b=!0):b=!1;if(!b)return;a.getSelection().scrollIntoView();a.fire("saveSnapshot");return!1}},this,null,100)}}},_:{detach:function(){this.editor.setData(this.editor.getData(),0,1);this.clearListeners();this.restoreAttrs();var a;if(a=this.removeCustomData("classes"))for(;a.length;)this.removeClass(a.pop());if(!this.is("textarea")){a=this.getDocument();var b=a.getHead();if(b.getCustomData("stylesheet")){var c=a.getCustomData("stylesheet_ref");--c?a.setCustomData("stylesheet_ref",c):(a.removeCustomData("stylesheet_ref"), b.removeCustomData("stylesheet").remove())}}this.editor.fire("contentDomUnload");delete this.editor}}});CKEDITOR.editor.prototype.editable=function(a){var b=this._.editable;if(b&&a)return 0;arguments.length&&(b=this._.editable=a?a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,a):(b&&b.detach(),null));return b};CKEDITOR.on("instanceLoaded",function(b){var c=b.editor;c.on("insertElement",function(a){a=a.data;a.type==CKEDITOR.NODE_ELEMENT&&(a.is("input")||a.is("textarea"))&&("false"!=a.getAttribute("contentEditable")&& a.data("cke-editable",a.hasAttribute("contenteditable")?"true":"1"),a.setAttribute("contentEditable",!1))});c.on("selectionChange",function(b){if(!c.readOnly){var e=c.getSelection();e&&!e.isLocked&&(e=c.checkDirty(),c.fire("lockSnapshot"),a(b),c.fire("unlockSnapshot"),!e&&c.resetDirty())}})});CKEDITOR.on("instanceCreated",function(a){var b=a.editor;b.on("mode",function(){var a=b.editable();if(a&&a.isInline()){var c=b.title;a.changeAttr("role","textbox");a.changeAttr("aria-multiline","true");a.changeAttr("aria-label", c);c&&a.changeAttr("title",c);var e=b.fire("ariaEditorHelpLabel",{}).label;if(e&&(c=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents"))){var d=CKEDITOR.tools.getNextId(),e=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+d+'" class\x3d"cke_voice_label"\x3e'+e+"\x3c/span\x3e");c.append(e);a.changeAttr("aria-describedby",d)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");n=CKEDITOR.dom.walker.whitespaces(!0); q=CKEDITOR.dom.walker.bookmark(!1,!0);y=CKEDITOR.dom.walker.empty();u=CKEDITOR.dom.walker.bogus();p=/(^|]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;v=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(c,e){var d,g,f,h,m=[],k=e.range.startContainer;d=e.range.startPath();for(var k=n[k.getName()],l=0,q=c.getChildren(),G=q.count(),v=-1,r=-1,F=0,t=d.contains(n.$list);lCKEDITOR.env.version&&e.getChildCount()&&e.getFirst().remove())}return function(e){var d=e.startContainer,g=d.getAscendant("table",1),f=!1;c(g.getElementsByTag("td"));c(g.getElementsByTag("th"));g=e.clone();g.setStart(d,0);g= a(g).lastBackward();g||(g=e.clone(),g.setEndAt(d,CKEDITOR.POSITION_BEFORE_END),g=a(g).lastForward(),f=!0);g||(g=d);g.is("table")?(e.setStartAt(g,CKEDITOR.POSITION_BEFORE_START),e.collapse(!0),g.remove()):(g.is({tbody:1,thead:1,tfoot:1})&&(g=b(g,"tr",f)),g.is("tr")&&(g=b(g,g.getParent().is("thead")?"th":"td",f)),(d=g.getBogus())&&d.remove(),e.moveToPosition(g,f?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END))}}();r=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a, b){if(b)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$list)||a.is(CKEDITOR.dtd.$listItem)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$listItem)};return b}return function(b){var c=b.startContainer,e=!1,d;d=b.clone();d.setStart(c,0);d=a(d).lastBackward();d||(d=b.clone(),d.setEndAt(c,CKEDITOR.POSITION_BEFORE_END),d=a(d).lastForward(),e=!0);d||(d=c);d.is(CKEDITOR.dtd.$list)?(b.setStartAt(d,CKEDITOR.POSITION_BEFORE_START),b.collapse(!0),d.remove()): ((c=d.getBogus())&&c.remove(),b.moveToPosition(d,e?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END),b.select())}}();z={eol:{detect:function(a,b){var c=a.range,e=c.clone(),d=c.clone(),g=new CKEDITOR.dom.elementPath(c.startContainer,b),f=new CKEDITOR.dom.elementPath(c.endContainer,b);e.collapse(1);d.collapse();g.block&&e.checkBoundaryOfElement(g.block,CKEDITOR.END)&&(c.setStartAfter(g.block),a.prependEolBr=1);f.block&&d.checkBoundaryOfElement(f.block,CKEDITOR.START)&&(c.setEndBefore(f.block), a.appendEolBr=1)},fix:function(a,b){var c=b.getDocument(),e;a.appendEolBr&&(e=this.createEolBr(c),a.fragment.append(e));!a.prependEolBr||e&&!e.getPrevious()||a.fragment.append(this.createEolBr(c),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}},bogus:{exclude:function(a){var b=a.range.getBoundaryNodes(),c=b.startNode,b=b.endNode;!b||!u(b)||c&&c.equals(b)||a.range.setEndBefore(b)}},tree:{rebuild:function(a,b){var c=a.range,e=c.getCommonAncestor(),d=new CKEDITOR.dom.elementPath(e, b),g=new CKEDITOR.dom.elementPath(c.startContainer,b),c=new CKEDITOR.dom.elementPath(c.endContainer,b),f;e.type==CKEDITOR.NODE_TEXT&&(e=e.getParent());if(d.blockLimit.is({tr:1,table:1})){var h=d.contains("table").getParent();f=function(a){return!a.equals(h)}}else if(d.block&&d.block.is(CKEDITOR.dtd.$listItem)&&(g=g.contains(CKEDITOR.dtd.$list),c=c.contains(CKEDITOR.dtd.$list),!g.equals(c))){var m=d.contains(CKEDITOR.dtd.$list).getParent();f=function(a){return!a.equals(m)}}f||(f=function(a){return!a.equals(d.block)&& !a.equals(d.blockLimit)});this.rebuildFragment(a,b,e,f)},rebuildFragment:function(a,b,c,e){for(var d;c&&!c.equals(b)&&e(c);)d=c.clone(0,1),a.fragment.appendTo(d),a.fragment=d,c=c.getParent()}},cell:{shrink:function(a){a=a.range;var b=a.startContainer,c=a.endContainer,e=a.startOffset,d=a.endOffset;b.type==CKEDITOR.NODE_ELEMENT&&b.equals(c)&&b.is("tr")&&++e==d&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};t=function(){function a(b,c){var e=b.getParent();if(e.is(CKEDITOR.dtd.$inline))b[c?"insertBefore":"insertAfter"](e)} function b(c,e,d){a(e);a(d,1);for(var g;g=d.getNext();)g.insertAfter(e),e=g;y(c)&&c.remove()}function c(a,b){var e=new CKEDITOR.dom.range(a);e.setStartAfter(b.startNode);e.setEndBefore(b.endNode);return e}return{list:{detectMerge:function(a,b){var e=c(b,a.bookmark),d=e.startPath(),g=e.endPath(),f=d.contains(CKEDITOR.dtd.$list),h=g.contains(CKEDITOR.dtd.$list);a.mergeList=f&&h&&f.getParent().equals(h.getParent())&&!f.equals(h);a.mergeListItems=d.block&&g.block&&d.block.is(CKEDITOR.dtd.$listItem)&& g.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList||a.mergeListItems)e=e.clone(),e.setStartBefore(a.bookmark.startNode),e.setEndAfter(a.bookmark.endNode),a.mergeListBookmark=e.createBookmark()},merge:function(a,c){if(a.mergeListBookmark){var e=a.mergeListBookmark.startNode,d=a.mergeListBookmark.endNode,g=new CKEDITOR.dom.elementPath(e,c),f=new CKEDITOR.dom.elementPath(d,c);if(a.mergeList){var h=g.contains(CKEDITOR.dtd.$list),m=f.contains(CKEDITOR.dtd.$list);h.equals(m)||(m.moveChildren(h),m.remove())}a.mergeListItems&& (g=g.contains(CKEDITOR.dtd.$listItem),f=f.contains(CKEDITOR.dtd.$listItem),g.equals(f)||b(f,e,d));e.remove();d.remove()}}},block:{detectMerge:function(a,b){if(!a.tableContentsRanges&&!a.mergeListBookmark){var c=new CKEDITOR.dom.range(b);c.setStartBefore(a.bookmark.startNode);c.setEndAfter(a.bookmark.endNode);a.mergeBlockBookmark=c.createBookmark()}},merge:function(a,c){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var e=a.mergeBlockBookmark.startNode,d=a.mergeBlockBookmark.endNode,g=new CKEDITOR.dom.elementPath(e, c),f=new CKEDITOR.dom.elementPath(d,c),g=g.block,f=f.block;g&&f&&!g.equals(f)&&b(f,e,d);e.remove();d.remove()}}},table:function(){function a(c){var d=[],g,f=new CKEDITOR.dom.walker(c),h=c.startPath().contains(e),m=c.endPath().contains(e),k={};f.guard=function(a,f){if(a.type==CKEDITOR.NODE_ELEMENT){var l="visited_"+(f?"out":"in");if(a.getCustomData(l))return;CKEDITOR.dom.element.setMarker(k,a,l,1)}if(f&&h&&a.equals(h))g=c.clone(),g.setEndAt(h,CKEDITOR.POSITION_BEFORE_END),d.push(g);else if(!f&&m&& a.equals(m))g=c.clone(),g.setStartAt(m,CKEDITOR.POSITION_AFTER_START),d.push(g);else{if(l=!f)l=a.type==CKEDITOR.NODE_ELEMENT&&a.is(e)&&(!h||b(a,h))&&(!m||b(a,m));if(!l&&(l=f))if(a.is(e))var l=h&&h.getAscendant("table",!0),n=m&&m.getAscendant("table",!0),q=a.getAscendant("table",!0),l=l&&l.contains(q)||n&&n.contains(q);else l=void 0;l&&(g=c.clone(),g.selectNodeContents(a),d.push(g))}};f.lastForward();CKEDITOR.dom.element.clearAllMarkers(k);return d}function b(a,c){var e=CKEDITOR.POSITION_CONTAINS+ CKEDITOR.POSITION_IS_CONTAINED,d=a.getPosition(c);return d===CKEDITOR.POSITION_IDENTICAL?!1:0===(d&e)}var e={td:1,th:1,caption:1};return{detectPurge:function(a){var b=a.range,c=b.clone();c.enlarge(CKEDITOR.ENLARGE_ELEMENT);var c=new CKEDITOR.dom.walker(c),d=0;c.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(e)&&++d};c.checkForward();if(1g&&d&&d.intersectsNode(c.$)){var f=[{node:e.anchorNode,offset:e.anchorOffset},{node:e.focusNode,offset:e.focusOffset}];e.anchorNode==c.$&&e.anchorOffset>g&&(f[0].offset-=g);e.focusNode==c.$&&e.focusOffset>g&&(f[1].offset-=g)}}c.setText(q(c.getText(),1));f&&(c=a.getDocument().$, e=c.getSelection(),c=c.createRange(),c.setStart(f[0].node,f[0].offset),c.collapse(!0),e.removeAllRanges(),e.addRange(c),e.extend(f[1].node,f[1].offset))}}function q(a,b){return b?a.replace(z,function(a,b){return b?" ":""}):a.replace(r,"")}function y(a,b){var c=b&&CKEDITOR.tools.htmlEncode(b)||"\x26nbsp;",c=CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"'+(CKEDITOR.env.ie&&14>CKEDITOR.env.version?"display:none":"position:fixed;top:0;left:-1000px;width:0;height:0;overflow:hidden;")+ '"\x3e'+c+"\x3c/div\x3e",a.document);a.fire("lockSnapshot");a.editable().append(c);var e=a.getSelection(1),d=a.createRange(),g=e.root.on("selectionchange",function(a){a.cancel()},null,null,0);d.setStartAt(c,CKEDITOR.POSITION_AFTER_START);d.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);e.selectRanges([d]);g.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=c}function u(a){var b={37:1,39:1,8:1,46:1};return function(c){var e=c.data.getKeystroke();if(b[e]){var d=a.getSelection().getRanges(), g=d[0];1==d.length&&g.collapsed&&(e=g[38>e?"getPreviousEditableNode":"getNextEditableNode"]())&&e.type==CKEDITOR.NODE_ELEMENT&&"false"==e.getAttribute("contenteditable")&&(a.getSelection().fake(e),c.data.preventDefault(),c.cancel())}}}function p(a){for(var b=0;b=e.getLength()?h.setStartAfter(e):h.setStartBefore(e));d&&d.type==CKEDITOR.NODE_TEXT&&(f?h.setEndAfter(d):h.setEndBefore(d));e=new CKEDITOR.dom.walker(h);e.evaluator=function(e){if(e.type==CKEDITOR.NODE_ELEMENT&&e.isReadOnly()){var d=c.clone();c.setEndBefore(e);c.collapsed&&a.splice(b--,1);e.getPosition(h.endContainer)& CKEDITOR.POSITION_CONTAINS||(d.setStartAfter(e),d.collapsed||a.splice(b+1,0,d));return!0}return!1};e.next()}}return a}var v="function"!=typeof window.getSelection,w=1,r=CKEDITOR.tools.repeat("​",7),z=new RegExp(r+"( )?","g"),t,x,A,B=CKEDITOR.dom.walker.invisible(1),C=function(){function a(b){return function(a){var c=a.editor.createRange();c.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([c]);return!1}}function b(a){return function(b){var c=b.editor,e=c.createRange(), d;if(!c.readOnly)return(d=e.moveToClosestEditablePosition(b.selected,a))||(d=e.moveToClosestEditablePosition(b.selected,!a)),d&&c.getSelection().selectRanges([e]),c.fire("saveSnapshot"),b.selected.remove(),d||(e.moveToElementEditablePosition(c.editable()),c.getSelection().selectRanges([e])),c.fire("saveSnapshot"),!1}}var c=a(),e=a(1);return{37:c,38:c,39:e,40:e,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(a){function b(){var a=c.getSelection();a&&a.removeAllRanges()}var c=a.editor;c.on("contentDom", function(){function a(){t=new CKEDITOR.dom.selection(c.getSelection());t.lock()}function b(){g.removeListener("mouseup",b);m.removeListener("mouseup",b);var a=CKEDITOR.document.$.selection,c=a.createRange();"None"!=a.type&&c.parentElement()&&c.parentElement().ownerDocument==d.$&&c.select()}function e(a){a=a.getRanges()[0];return a?(a=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")},!0))&&"false"===a.getAttribute("contenteditable")? a:null:null}var d=c.document,g=CKEDITOR.document,f=c.editable(),h=d.getBody(),m=d.getDocumentElement(),q=f.isInline(),r,t;CKEDITOR.env.gecko&&f.attachListener(f,"focus",function(a){a.removeListener();0!==r&&(a=c.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==f.$&&(a=c.createRange(),a.moveToElementEditStart(f),a.select())},null,null,-2);f.attachListener(f,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){if(r&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){r=c._.previousActive&& c._.previousActive.equals(d.getActive());var a=null!=c._.previousScrollTop&&c._.previousScrollTop!=f.$.scrollTop;CKEDITOR.env.webkit&&r&&a&&(f.$.scrollTop=c._.previousScrollTop)}c.unlockSelection(r);r=0},null,null,-1);f.attachListener(f,"mousedown",function(){r=0});if(CKEDITOR.env.ie||q)v?f.attachListener(f,"beforedeactivate",a,null,null,-1):f.attachListener(c,"selectionCheck",a,null,null,-1),f.attachListener(f,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusout":"blur",function(){c.lockSelection(t); r=1},null,null,-1),f.attachListener(f,"mousedown",function(){r=0});if(CKEDITOR.env.ie&&!q){var w;f.attachListener(f,"mousedown",function(a){2==a.data.$.button&&((a=c.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(w=c.window.getScrollPosition()))});f.attachListener(f,"mouseup",function(a){2==a.data.$.button&&w&&(c.document.$.documentElement.scrollLeft=w.x,c.document.$.documentElement.scrollTop=w.y);w=null});if("BackCompat"!=d.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var z, y;m.on("mousedown",function(a){function b(a){a=a.data.$;if(z){var c=h.$.createTextRange();try{c.moveToPoint(a.clientX,a.clientY)}catch(e){}z.setEndPoint(0>y.compareEndPoints("StartToStart",c)?"EndToEnd":"StartToStart",c);z.select()}}function c(){m.removeListener("mousemove",b);g.removeListener("mouseup",c);m.removeListener("mouseup",c);z.select()}a=a.data;if(a.getTarget().is("html")&&a.$.yCKEDITOR.env.version)m.on("mousedown",function(a){a.data.getTarget().is("html")&&(g.on("mouseup",b),m.on("mouseup",b))})}}f.attachListener(f,"selectionchange",l,c);f.attachListener(f,"keyup",k,c);f.attachListener(f,"touchstart",k,c);f.attachListener(f,"touchend",k,c);CKEDITOR.env.ie&&f.attachListener(f,"keydown",function(a){var b=this.getSelection(1),c=e(b);c&&!c.equals(f)&&(b.selectElement(c),a.data.preventDefault())}, c);f.attachListener(f,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){c.forceNextSelectionCheck();c.selectionChange(1)});if(q&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var p;f.attachListener(f,"mousedown",function(){p=1});f.attachListener(d.getDocumentElement(),"mouseup",function(){p&&k.call(c);p=0})}else f.attachListener(CKEDITOR.env.ie?f:d.getDocumentElement(),"mouseup",k,c);CKEDITOR.env.webkit&&f.attachListener(d,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:f.hasFocus&& n(f)}},null,null,-1);f.attachListener(f,"keydown",u(c),null,null,-1)});c.on("setData",function(){c.unlockSelection();CKEDITOR.env.webkit&&b()});c.on("contentDomUnload",function(){c.unlockSelection()});if(CKEDITOR.env.ie9Compat)c.on("beforeDestroy",b,null,null,9);c.on("dataReady",function(){delete c._.fakeSelection;delete c._.hiddenSelectionContainer;c.selectionChange(1)});c.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=c.editable().getLast(a);b&&b.hasAttribute("data-cke-hidden-sel")&& (b.remove(),CKEDITOR.env.gecko&&(a=c.editable().getFirst(a))&&a.is("br")&&a.getAttribute("_moz_editor_bogus_node")&&a.remove())},null,null,100);c.on("key",function(a){if("wysiwyg"==c.mode){var b=c.getSelection();if(b.isFake){var e=C[a.data.keyCode];if(e)return e({editor:c,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var b=a.editor;b.on("selectionChange",function(){var a=b.editable(),c=a.getCustomData("cke-fillingChar"); c&&(c.getCustomData("ready")?(n(a),a.editor.fire("selectionCheck")):c.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){n(b.editable())},null,null,-1);b.on("getSnapshot",function(a){a.data&&(a.data=q(a.data))},b,null,20);b.on("toDataFormat",function(a){a.data.dataValue=q(a.data.dataValue)},null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(a){(a?l:k).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){return!this._.savedSelection&&!this._.fakeSelection|| a?(a=this.editable())&&"wysiwyg"==this.mode?new CKEDITOR.dom.selection(a):null:this._.savedSelection||this._.fakeSelection};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);return a.getType()!=CKEDITOR.SELECTION_NONE?(!a.isLocked&&a.lock(),this._.savedSelection=a,!0):!1};CKEDITOR.editor.prototype.unlockSelection=function(a){var b=this._.savedSelection;return b?(b.unlock(a),delete this._.savedSelection,!0):!1};CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath}; CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};CKEDITOR.dom.range.prototype.select=function(){var a=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);a.selectRanges([this]);return a};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT=2;CKEDITOR.SELECTION_ELEMENT=3;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection){var b=a;a=a.root}var c=a instanceof CKEDITOR.dom.element; this.rev=b?b.rev:w++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=c?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(b)return CKEDITOR.tools.extend(this._.cache,b._.cache),this.isFake=b.isFake,this.isLocked=b.isLocked,this;a=this.getNative();var e,d;if(a)if(a.getRangeAt)e=(d=a.rangeCount&&a.getRangeAt(0))&&new CKEDITOR.dom.node(d.commonAncestorContainer);else{try{d=a.createRange()}catch(g){}e=d&&CKEDITOR.dom.element.get(d.item&&d.item(0)||d.parentElement())}if(!e|| e.type!=CKEDITOR.NODE_ELEMENT&&e.type!=CKEDITOR.NODE_TEXT||!this.root.equals(e)&&!this.root.contains(e))this._.cache.type=CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var H={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:q, _createFillingCharSequenceNode:e,FILLING_CHAR_SEQUENCE:r});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=v?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:v?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var c=this.getNative(),e=c.type;"Text"==e&&(b=CKEDITOR.SELECTION_TEXT);"Control"==e&&(b=CKEDITOR.SELECTION_ELEMENT);c.createRange().parentElement()&& (b=CKEDITOR.SELECTION_TEXT)}catch(d){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_TEXT,c=this.getNative();if(!c||!c.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(1==c.rangeCount){var c=c.getRangeAt(0),e=c.startContainer;e==c.endContainer&&1==e.nodeType&&1==c.endOffset-c.startOffset&&H[e.childNodes[c.startOffset].nodeName.toLowerCase()]&&(b=CKEDITOR.SELECTION_ELEMENT)}return a.type=b},getRanges:function(){var a=v?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()} var b=function(b,c){b=b.duplicate();b.collapse(c);var e=b.parentElement();if(!e.hasChildNodes())return{container:e,offset:0};for(var d=e.children,g,f,h=b.duplicate(),m=0,k=d.length-1,l=-1,n,q;m<=k;)if(l=Math.floor((m+k)/2),g=d[l],h.moveToElementText(g),n=h.compareEndPoints("StartToStart",b),0n)m=l+1;else return{container:e,offset:a(g)};if(-1==l||l==d.length-1&&0>n){h.moveToElementText(e);h.setEndPoint("StartToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;d=e.childNodes;if(!h)return g= d[d.length-1],g.nodeType!=CKEDITOR.NODE_TEXT?{container:e,offset:d.length}:{container:g,offset:g.nodeValue.length};for(e=d.length;0]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+| )/g, " ");f=f.replace(/]*>/gi,"\n");if(CKEDITOR.env.ie){var h=a.getDocument().createElement("div");h.append(g);g.$.outerHTML="\x3cpre\x3e"+f+"\x3c/pre\x3e";g.copyAttributes(h.getFirst());g=h.getFirst().remove()}else g.setHtml(f);b=g}else f?b=q(c?[a.getHtml()]:e(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,m;(m=c.getPrevious(E))&&m.type==CKEDITOR.NODE_ELEMENT&&m.is("pre")&&(d=n(m.getHtml(),/\n$/,"")+"\n\n"+n(c.getHtml(),/^\n/,""),CKEDITOR.env.ie?c.$.outerHTML="\x3cpre\x3e"+d+"\x3c/pre\x3e": c.setHtml(d),m.remove())}else c&&v(b)}function e(a){var b=[];n(a.getOuterHtml(),/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"\x3c/pre\x3e"+c+"\x3cpre\x3e"}).replace(/([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function n(a,b,c){var e="",d="";a=a.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi,function(a,b,c){b&&(e=b);c&&(d=c);return""});return e+a.replace(b,c)+d}function q(a,b){var c; 1=c?(l=d.createText(""),l.insertAfter(this)):(a=d.createText(""),a.insertAfter(l),a.remove()));return l},substring:function(a,f){return"number"!=typeof f?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,f)}}),function(){function a(a,c,d){var f=a.serializable,k=c[d?"endContainer":"startContainer"],g=d?"endOffset":"startOffset",h=f?c.document.getById(a.startNode):a.startNode;a=f?c.document.getById(a.endNode):a.endNode;k.equals(h.getPrevious())? (c.startOffset=c.startOffset-k.getLength()-a.getPrevious().getLength(),k=a.getNext()):k.equals(a.getPrevious())&&(c.startOffset-=k.getLength(),k=a.getNext());k.equals(h.getParent())&&c[g]++;k.equals(a.getParent())&&c[g]++;c[d?"endContainer":"startContainer"]=k;return c}CKEDITOR.dom.rangeList=function(a){if(a instanceof CKEDITOR.dom.rangeList)return a;a?a instanceof CKEDITOR.dom.range&&(a=[a]):a=[];return CKEDITOR.tools.extend(a,f)};var f={createIterator:function(){var a=this,c=CKEDITOR.dom.walker.bookmark(), d=[],f;return{getNextRange:function(k){f=void 0===f?0:f+1;var g=a[f];if(g&&1b?-1:1}),g=0,f;gCKEDITOR.env.version?a[h].$.styleSheet.cssText+=f:a[h].$.innerHTML+=f}}var l={};CKEDITOR.skin={path:a,loadPart:function(c, e){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a()+"skin.js"),function(){b(c,e)}):b(c,e)},getPath:function(a){return CKEDITOR.getUrl(f(a))},icons:{},addIcon:function(a,b,c,d){a=a.toLowerCase();this.icons[a]||(this.icons[a]={path:b,offset:c||0,bgsize:d||"16px"})},getIconStyle:function(a,b,c,d,g){var f;a&&(a=a.toLowerCase(),b&&(f=this.icons[a+"-rtl"]),f||(f=this.icons[a]));a=c||f&&f.path||"";d=d||f&&f.offset;g=g||f&&f.bgsize||"16px";a&&(a=a.replace(/'/g, "\\'"));return a&&"background-image:url('"+CKEDITOR.getUrl(a)+"');background-position:0 "+d+"px;background-size:"+g+";"}};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{getUiColor:function(){return this.uiColor},setUiColor:function(a){var b=c(CKEDITOR.document);return(this.setUiColor=function(a){this.uiColor=a;var c=CKEDITOR.skin.chameleon,f="",m="";"function"==typeof c&&(f=c(this,"editor"),m=c(this,"panel"));a=[[h,a]];d([b],f,a);d(g,m,a)}).call(this,a)}});var k="cke_ui_color",g=[],h=/\$color/g; CKEDITOR.on("instanceLoaded",function(a){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var b=a.editor;a=function(a){a=(a.data[0]||a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!a.getById("cke_ui_color")){var f=c(a);g.push(f);b.on("destroy",function(){g=CKEDITOR.tools.array.filter(g,function(a){return f!==a})});(a=b.getUiColor())&&d([f],CKEDITOR.skin.chameleon(b,"panel"),[[h,a]])}};b.on("panelShow",a);b.on("menuShow",a);b.config.uiColor&&b.setUiColor(b.config.uiColor)}})}(), function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=!1;else{var a=CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"\x3e\x3c/div\x3e',CKEDITOR.document);a.appendTo(CKEDITOR.document.getHead());try{var f=a.getComputedStyle("border-top-color"),b=a.getComputedStyle("border-right-color");CKEDITOR.env.hc=!(!f||f!=b)}catch(c){CKEDITOR.env.hc=!1}a.remove()}CKEDITOR.env.hc&&(CKEDITOR.env.cssClass+=" cke_hc");CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}"); CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(a=CKEDITOR._.pending)for(delete CKEDITOR._.pending,f=0;ff;f++){var k=f,g;g=parseInt(d[f],16);g=("0"+(0>c?0|g*(1+c):0| g+(255-g)*c).toString(16)).slice(-2);d[k]=g}return"#"+d.join("")}}(),f={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_bottom [background-color:{defaultBackground};border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [background-color:{defaultBackground};outline-color:{defaultBorder};] {id} .cke_dialog_tab [background-color:{dialogTab};border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [background-color:{lightBackground};] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} a.cke_button_off:hover,{id} a.cke_button_off:focus,{id} a.cke_button_off:active [background-color:{darkBackground};border-color:{toolbarElementsBorder};] {id} .cke_button_on [background-color:{ckeButtonOn};border-color:{toolbarElementsBorder};] {id} .cke_toolbar_separator,{id} .cke_toolgroup a.cke_button:last-child:after,{id} .cke_toolgroup a.cke_button.cke_button_disabled:hover:last-child:after [background-color: {toolbarElementsBorder};border-color: {toolbarElementsBorder};] {id} a.cke_combo_button:hover,{id} a.cke_combo_button:focus,{id} .cke_combo_on a.cke_combo_button [border-color:{toolbarElementsBorder};background-color:{darkBackground};] {id} .cke_combo:after [border-color:{toolbarElementsBorder};] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover,{id} a.cke_path_item:focus,{id} a.cke_path_item:active [background-color:{darkBackground};] {id}.cke_panel [border-color:{defaultBorder};] "), panel:new CKEDITOR.template(".cke_panel_grouptitle [background-color:{lightBackground};border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover,.cke_menubutton:focus,.cke_menubutton:active [background-color:{menubuttonHover};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menubutton_disabled:hover .cke_menubutton_icon,.cke_menubutton_disabled:focus .cke_menubutton_icon,.cke_menubutton_disabled:active .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")}; return function(b,c){var d=a(b.uiColor,.4),d={id:"."+b.id,defaultBorder:a(d,-.2),toolbarElementsBorder:a(d,-.25),defaultBackground:d,lightBackground:a(d,.8),darkBackground:a(d,-.15),ckeButtonOn:a(d,.4),ckeResizer:a(d,-.4),ckeColorauto:a(d,.8),dialogBody:a(d,.7),dialogTab:a(d,.65),dialogTabSelected:"#FFF",dialogTabSelectedBorder:"#FFF",elementsPathColor:a(d,-.6),menubuttonHover:a(d,.1),menubuttonIcon:a(d,.5),menubuttonIconHover:a(d,.3)};return f[c].output(d).replace(/\[/g,"{").replace(/\]/g,"}")}}(), CKEDITOR.plugins.add("dialogui",{onLoad:function(){var a=function(a){this._||(this._={});this._["default"]=this._.initValue=a["default"]||"";this._.required=a.required||!1;for(var b=[this._],c=1;carguments.length)){var g=a.call(this,c);g.labelId=CKEDITOR.tools.getNextId()+ "_label";this._.children=[];var f={role:c.role||"presentation"};c.includeLabel&&(f["aria-labelledby"]=g.labelId);CKEDITOR.ui.dialog.uiElement.call(this,b,c,e,"div",null,f,function(){var a=[],e=c.required?" cke_required":"";"horizontal"!=c.labelLayout?a.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label'+e+'" ',' id\x3d"'+g.labelId+'"',g.inputId?' for\x3d"'+g.inputId+'"':"",(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e",c.label,"\x3c/label\x3e",'\x3cdiv class\x3d"cke_dialog_ui_labeled_content"', c.controlStyle?' style\x3d"'+c.controlStyle+'"':"",' role\x3d"presentation"\x3e',d.call(this,b,c),"\x3c/div\x3e"):(e={type:"hbox",widths:c.widths,padding:0,children:[{type:"html",html:'\x3clabel class\x3d"cke_dialog_ui_labeled_label'+e+'" id\x3d"'+g.labelId+'" for\x3d"'+g.inputId+'"'+(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e"+CKEDITOR.tools.htmlEncode(c.label)+"\x3c/label\x3e"},{type:"html",html:'\x3cspan class\x3d"cke_dialog_ui_labeled_content"'+(c.controlStyle?' style\x3d"'+c.controlStyle+ '"':"")+"\x3e"+d.call(this,b,c)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,e,a));return a.join("")})}},textInput:function(b,c,e){if(!(3>arguments.length)){a.call(this,c);var d=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",f={"class":"cke_dialog_ui_input_"+c.type,id:d,type:c.type};c.validate&&(this.validate=c.validate);c.maxLength&&(f.maxlength=c.maxLength);c.size&&(f.size=c.size);c.inputStyle&&(f.style=c.inputStyle);var k=this,l=!1;b.on("load",function(){k.getInputElement().on("keydown", function(a){13==a.data.getKeystroke()&&(l=!0)});k.getInputElement().on("keyup",function(a){13==a.data.getKeystroke()&&l&&(b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0),l=!1);k.bidi&&g.call(k,a)},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,b,c,e,function(){var a=['\x3cdiv class\x3d"cke_dialog_ui_input_',c.type,'" role\x3d"presentation"'];c.width&&a.push('style\x3d"width:'+c.width+'" ');a.push("\x3e\x3cinput ");f["aria-labelledby"]=this._.labelId;this._.required&& (f["aria-required"]=this._.required);for(var b in f)a.push(b+'\x3d"'+f[b]+'" ');a.push(" /\x3e\x3c/div\x3e");return a.join("")})}},textarea:function(b,c,e){if(!(3>arguments.length)){a.call(this,c);var d=this,f=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",k={};c.validate&&(this.validate=c.validate);k.rows=c.rows||5;k.cols=c.cols||20;k["class"]="cke_dialog_ui_input_textarea "+(c["class"]||"");"undefined"!=typeof c.inputStyle&&(k.style=c.inputStyle);c.dir&&(k.dir=c.dir);if(d.bidi)b.on("load", function(){d.getInputElement().on("keyup",g)},d);CKEDITOR.ui.dialog.labeledElement.call(this,b,c,e,function(){k["aria-labelledby"]=this._.labelId;this._.required&&(k["aria-required"]=this._.required);var a=['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',f,'" '],b;for(b in k)a.push(b+'\x3d"'+CKEDITOR.tools.htmlEncode(k[b])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(d._["default"]),"\x3c/textarea\x3e\x3c/div\x3e");return a.join("")})}},checkbox:function(b, c,e){if(!(3>arguments.length)){var d=a.call(this,c,{"default":!!c["default"]});c.validate&&(this.validate=c.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,c,e,"span",null,null,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),e=[],g=CKEDITOR.tools.getNextId()+"_label",f={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":g};k(a);c["default"]&&(f.checked="checked");"undefined"!=typeof a.inputStyle&&(a.style=a.inputStyle); d.checkbox=new CKEDITOR.ui.dialog.uiElement(b,a,e,"input",null,f);e.push(' \x3clabel id\x3d"',g,'" for\x3d"',f.id,'"'+(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e",CKEDITOR.tools.htmlEncode(c.label),"\x3c/label\x3e");return e.join("")})}},radio:function(b,c,e){if(!(3>arguments.length)){a.call(this,c);this._["default"]||(this._["default"]=this._.initValue=c.items[0][1]);c.validate&&(this.validate=c.validate);var d=[],g=this;c.role="radiogroup";c.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this, b,c,e,function(){for(var a=[],e=[],f=(c.id?c.id:CKEDITOR.tools.getNextId())+"_radio",l=0;larguments.length)){var d=a.call(this,c);c.validate&&(this.validate=c.validate);d.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,c,e,function(){var a=CKEDITOR.tools.extend({},c,{id:c.id?c.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),e=[],g=[],f={id:d.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};e.push('\x3cdiv class\x3d"cke_dialog_ui_input_', c.type,'" role\x3d"presentation"');c.width&&e.push('style\x3d"width:'+c.width+'" ');e.push("\x3e");void 0!==c.size&&(f.size=c.size);void 0!==c.multiple&&(f.multiple=c.multiple);k(a);for(var l=0,w;larguments.length)){void 0===c["default"]&&(c["default"]="");var d=CKEDITOR.tools.extend(a.call(this,c),{definition:c,buttons:[]});c.validate&&(this.validate=c.validate);b.on("load",function(){CKEDITOR.document.getById(d.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,c,e,function(){d.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var a=['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"', d.frameId,'" title\x3d"',c.label,'" src\x3d"javascript:void('];a.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");a.push(')"\x3e\x3c/iframe\x3e');return a.join("")})}},fileButton:function(b,c,e){var d=this;if(!(3>arguments.length)){a.call(this,c);c.validate&&(this.validate=c.validate);var g=CKEDITOR.tools.extend({},c),f=g.onClick;g.className=(g.className?g.className+" ":"")+"cke_dialog_ui_button";g.onClick=function(a){var e= c["for"];a=f?f.call(this,a):!1;!1!==a&&("xhr"!==a&&b.getContentElement(e[0],e[1]).submit(),this.disable())};b.on("load",function(){b.getContentElement(c["for"][0],c["for"][1])._.buttons.push(d)});CKEDITOR.ui.dialog.button.call(this,b,g,e)}},html:function(){var a=/^\s*<[\w:]+\s+([^>]*)?>/,b=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,c=/\/$/;return function(d,g,f){if(!(3>arguments.length)){var k=[],l=g.html;"\x3c"!=l.charAt(0)&&(l="\x3cspan\x3e"+l+"\x3c/span\x3e");var v=g.focus;if(v){var w=this.focus; this.focus=function(){("function"==typeof v?v:w).call(this);this.fire("focus")};g.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,d,g,k,"span",null,null,"");k=k.join("").match(a);l=l.match(b)||["","",""];c.test(l[1])&&(l[1]=l[1].slice(0,-1),l[2]="/"+l[2]);f.push([l[1]," ",k[1]||"",l[2]].join(""))}}}(),fieldset:function(a,b,c,d,g){var f=g.label;this._={children:b};CKEDITOR.ui.dialog.uiElement.call(this,a,g,d,"fieldset",null,null,function(){var a= [];f&&a.push("\x3clegend"+(g.labelStyle?' style\x3d"'+g.labelStyle+'"':"")+"\x3e"+f+"\x3c/legend\x3e");for(var b=0;bb.getChildCount()?(new CKEDITOR.dom.text(a,CKEDITOR.document)).appendTo(b):b.getChild(0).$.nodeValue= a;return this},getLabel:function(){var a=CKEDITOR.document.getById(this._.labelId);return!a||1>a.getChildCount()?"":a.getChild(0).getText()},eventProcessors:d},!0);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return this._.disabled?!1:this.fire("click",{dialog:this._.dialog})},enable:function(){this._.disabled=!1;var a=this.getElement();a&&a.removeClass("cke_disabled")},disable:function(){this._.disabled=!0;this.getElement().addClass("cke_disabled")}, isVisible:function(){return this.getElement().getFirst().isVisible()},isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(a,b){this.on("click",function(){b.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)}, focus:function(){var a=this.selectParentTab();setTimeout(function(){var b=a.getInputElement();b&&b.$.focus()},0)},select:function(){var a=this.selectParentTab();setTimeout(function(){var b=a.getInputElement();b&&(b.$.focus(),b.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(a){if(this.bidi){var b=a&&a.charAt(0);(b="‪"==b?"ltr":"‫"==b?"rtl":null)&&(a=a.slice(1));this.setDirectionMarker(b)}a||(a="");return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)}, getValue:function(){var a=CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);if(this.bidi&&a){var b=this.getDirectionMarker();b&&(a=("ltr"==b?"‪":"‫")+a)}return a},setDirectionMarker:function(a){var b=this.getInputElement();a?b.setAttributes({dir:a,"data-cke-dir-marker":a}):this.getDirectionMarker()&&b.removeAttributes(["dir","data-cke-dir-marker"])},getDirectionMarker:function(){return this.getInputElement().data("cke-dir-marker")},keyboardFocusable:!0},c,!0);CKEDITOR.ui.dialog.textarea.prototype= new CKEDITOR.ui.dialog.textInput;CKEDITOR.ui.dialog.select.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(a,b,c){var d=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),g=this.getInputElement().$;d.$.text=a;d.$.value=void 0===b||null===b?a:b;void 0===c||null===c?CKEDITOR.env.ie?g.add(d.$):g.add(d.$,null):g.add(d.$,c);return this},remove:function(a){this.getInputElement().$.remove(a); return this},clear:function(){for(var a=this.getInputElement().$;0b-a;c--)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function f(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),c=b+1;cl.width-k.width-f?l.width-k.width+("rtl"==g.lang.dir?0:h[1]):d.x,d.y+h[0]l.height-k.height-f?l.height-k.height+h[2]:d.y,1);c.data.preventDefault()} function c(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",c);if(CKEDITOR.env.ie6Compat){var a=B.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup",c)}}var e=null,d=null,g=a.getParentEditor(),f=g.config.dialog_magnetDistance,h=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof f&&(f=20);a.parts.title.on("mousedown",function(g){e={x:g.data.$.screenX,y:g.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup", c);d=a.getPosition();if(CKEDITOR.env.ie6Compat){var f=B.getChild(0).getFrameDocument();f.on("mousemove",b);f.on("mouseup",c)}g.data.preventDefault()},a)}function e(a){function b(c){var n="rtl"==g.lang.dir,r=m.width,t=m.height,v=r+(c.data.$.screenX-l.x)*(n?-1:1)*(a._.moved?1:2),q=t+(c.data.$.screenY-l.y)*(a._.moved?1:2),w=a._.element.getFirst(),w=n&&w.getComputedStyle("right"),z=a.getPosition();z.y+q>k.height&&(q=k.height-z.y);(n?w:z.x)+v>k.width&&(v=k.width-(n?w:z.x));if(d==CKEDITOR.DIALOG_RESIZE_WIDTH|| d==CKEDITOR.DIALOG_RESIZE_BOTH)r=Math.max(e.minWidth||0,v-f);if(d==CKEDITOR.DIALOG_RESIZE_HEIGHT||d==CKEDITOR.DIALOG_RESIZE_BOTH)t=Math.max(e.minHeight||0,q-h);a.resize(r,t);a._.moved||a.layout();c.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mouseup",c);CKEDITOR.document.removeListener("mousemove",b);n&&(n.remove(),n=null);if(CKEDITOR.env.ie6Compat){var a=B.getChild(0).getFrameDocument();a.removeListener("mouseup",c);a.removeListener("mousemove",b)}}var e=a.definition,d=e.resizable; if(d!=CKEDITOR.DIALOG_RESIZE_NONE){var g=a.getParentEditor(),f,h,k,l,m,n,r=CKEDITOR.tools.addFunction(function(e){m=a.getSize();var d=a.parts.contents;d.$.getElementsByTagName("iframe").length&&(n=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%;"\x3e\x3c/div\x3e'),d.append(n));h=m.height-a.parts.contents.getSize("height",!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks));f=m.width-a.parts.contents.getSize("width", 1);l={x:e.screenX,y:e.screenY};k=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);CKEDITOR.env.ie6Compat&&(d=B.getChild(0).getFrameDocument(),d.on("mousemove",b),d.on("mouseup",c));e.preventDefault&&e.preventDefault()});a.on("load",function(){var b="";d==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":d==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer'+ b+" cke_resizer_"+g.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(g.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+r+', event )"\x3e'+("ltr"==g.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(b,1)});g.on("destroy",function(){CKEDITOR.tools.removeFunction(r)})}}function n(a){a.data.preventDefault(1)}function q(a){var b=CKEDITOR.document.getWindow(),c=a.config,e=CKEDITOR.skinName||a.config.skin,d=c.dialog_backgroundCoverColor||("moono-lisa"==e?"black":"white"),e=c.dialog_backgroundCoverOpacity, g=c.baseFloatZIndex,c=CKEDITOR.tools.genKey(d,e,g),f=A[c];f?f.show():(g=['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",g,"; top: 0px; left: 0px; ",CKEDITOR.env.ie6Compat?"":"background-color: "+d,'" class\x3d"cke_dialog_background_cover"\x3e'],CKEDITOR.env.ie6Compat&&(d="\x3chtml\x3e\x3cbody style\x3d\\'background-color:"+d+";\\'\x3e\x3c/body\x3e\x3c/html\x3e",g.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'), g.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.write( '"+d+"' );document.close();")+"})())"),g.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')),g.push("\x3c/div\x3e"),f=CKEDITOR.dom.element.createFromHtml(g.join("")),f.setOpacity(void 0!==e?e:.5),f.on("keydown",n),f.on("keypress",n),f.on("keyup",n),f.appendTo(CKEDITOR.document.getBody()), A[c]=f);a.focusManager.add(f);B=f;a=function(){var a=b.getViewPaneSize();f.setStyles({width:a.width+"px",height:a.height+"px"})};var h=function(){var a=b.getScrollPosition(),c=CKEDITOR.dialog._.currentTop;f.setStyles({left:a.x+"px",top:a.y+"px"});if(c){do a=c.getPosition(),c.move(a.x,a.y);while(c=c._.parentDialog)}};x=a;b.on("resize",a);a();CKEDITOR.env.mac&&CKEDITOR.env.webkit||f.focus();if(CKEDITOR.env.ie6Compat){var k=function(){h();k.prevScrollHandler.apply(this,arguments)};b.$.setTimeout(function(){k.prevScrollHandler= window.onscroll||function(){};window.onscroll=k},0);h()}}function y(a){B&&(a.focusManager.remove(B),a=CKEDITOR.document.getWindow(),B.hide(),B=null,a.removeListener("resize",x),CKEDITOR.env.ie6Compat&&a.$.setTimeout(function(){window.onscroll=window.onscroll&&window.onscroll.prevScrollHandler||null},0),x=null)}var u=CKEDITOR.tools.cssLength,p='\x3cdiv class\x3d"cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog '+ CKEDITOR.env.cssClass+' cke_{langDir}" style\x3d"position:absolute" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd role\x3d"presentation"\x3e\x3cdiv class\x3d"cke_dialog_body" role\x3d"presentation"\x3e\x3cdiv id\x3d"cke_dialog_title_{id}" class\x3d"cke_dialog_title" role\x3d"presentation"\x3e\x3c/div\x3e\x3ca id\x3d"cke_dialog_close_button_{id}" class\x3d"cke_dialog_close_button" href\x3d"javascript:void(0)" title\x3d"{closeTitle}" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e\x3cdiv id\x3d"cke_dialog_tabs_{id}" class\x3d"cke_dialog_tabs" role\x3d"tablist"\x3e\x3c/div\x3e\x3ctable class\x3d"cke_dialog_contents" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_contents_{id}" class\x3d"cke_dialog_contents_body" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_footer_{id}" class\x3d"cke_dialog_footer" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e'; CKEDITOR.dialog=function(b,g){function h(){var a=x._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,c=0;cb.length)){var c=x._.currentFocusIndex;x._.tabBarMode&&0>a&&(c=0);try{b[c].getInputElement().$.blur()}catch(e){}var d=c,g=1c.height||b.width+(0c.width?a.setStyle("position","absolute"):a.setStyle("position","fixed"));this.move(this._.moved?this._.position.x:e,this._.moved?this._.position.y:d)},foreach:function(a){for(var b in this._.contents)for(var c in this._.contents[b])a.call(this,this._.contents[b][c]);return this},reset:function(){var a=function(a){a.reset&&a.reset(1)};return function(){this.foreach(a);return this}}(), setupContent:function(){var a=arguments;this.foreach(function(b){b.setup&&b.setup.apply(b,a)})},commitContent:function(){var a=arguments;this.foreach(function(b){CKEDITOR.env.ie&&this._.currentFocusIndex==b.focusIndex&&b.getInputElement().$.blur();b.commit&&b.commit.apply(b,a)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{});this._.editor.fire("dialogHide",this);this.selectPage(this._.tabIdList[0]);var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility", "hidden");for(J(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var b=this._.parentDialog.getElement().getFirst();b.setStyle("z-index",parseInt(b.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else y(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",H);a.removeListener("keyup",F);var c=this._.editor; c.focus();setTimeout(function(){c.focusManager.unlock();CKEDITOR.env.iOS&&c.window.focus()},0)}delete this._.parentDialog;this.foreach(function(a){a.resetInitValue&&a.resetInitValue()});this.setState(CKEDITOR.DIALOG_STATE_IDLE)}},addPage:function(a){if(!a.requiredContent||this._.editor.filter.check(a.requiredContent)){for(var b=[],c=a.label?' title\x3d"'+CKEDITOR.tools.htmlEncode(a.label)+'"':"",e=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents", children:a.elements,expand:!!a.expand,padding:a.padding,style:a.style||"width: 100%;"},b),d=this._.contents[a.id]={},g=e.getChild(),f=0;e=g.shift();)e.notAllowed||"hbox"==e.type||"vbox"==e.type||f++,d[e.id]=e,"function"==typeof e.getChild&&g.push.apply(g,e.getChild());f||(a.hidden=!0);b=CKEDITOR.dom.element.createFromHtml(b.join(""));b.setAttribute("role","tabpanel");e=CKEDITOR.env;d="cke_"+a.id+"_"+CKEDITOR.tools.getNextNumber();c=CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"', 0arguments.length)){var h=(e.call?e(b):e)||"div",k=["\x3c",h," "],l=(d&&d.call?d(b):d)||{},m=(g&&g.call?g(b):g)||{},n=(f&&f.call?f.call(this,a,b):f)||"",r=this.domId=m.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(l.display="none",this.notAllowed=!0);m.id=r;var q={};b.type&&(q["cke_dialog_ui_"+ b.type]=1);b.className&&(q[b.className]=1);b.disabled&&(q.cke_disabled=1);for(var t=m["class"]&&m["class"].split?m["class"].split(" "):[],r=0;rCKEDITOR.env.version?"cke_dialog_ui_focused":"";b.on("focus",function(){a._.tabBarMode=!1;a._.hasFocus=!0;v.fire("focus"); c&&this.addClass(c)});b.on("blur",function(){v.fire("blur");c&&this.removeClass(c)})}});CKEDITOR.tools.extend(this,b);this.keyboardFocusable&&(this.tabIndex=b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=v.focusIndex}))}},hbox:function(a,b,c,e,d){if(!(4>arguments.length)){this._||(this._={});var g=this._.children=b,f=d&&d.widths||null,h=d&&d.height||null,k,l={role:"presentation"};d&&d.align&&(l.align=d.align);CKEDITOR.ui.dialog.uiElement.call(this, a,d||{type:"hbox"},e,"table",{},l,function(){var a=['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];for(k=0;karguments.length)){this._||(this._={});var g=this._.children=b,f=d&&d.width||null,h=d&&d.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,a,d||{type:"vbox"},e,"div",null,{role:"presentation"},function(){var b=['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" ']; b.push('style\x3d"');d&&d.expand&&b.push("height:100%;");b.push("width:"+u(f||"100%"),";");CKEDITOR.env.webkit&&b.push("float:none;");b.push('"');b.push('align\x3d"',CKEDITOR.tools.htmlEncode(d&&d.align||("ltr"==a.getParentEditor().lang.dir?"left":"right")),'" ');b.push("\x3e\x3ctbody\x3e");for(var e=0;earguments.length)return this._.children.concat();a.splice||(a=[a]);return 2>a.length?this._.children[a[0]]:this._.children[a[0]]&&this._.children[a[0]].getChild?this._.children[a[0]].getChild(a.slice(1,a.length)):null}},!0);CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox;(function(){var a={build:function(a,b,c){for(var e=b.children,d,g=[],f=[],h=0;hk.length&&(b=a.document.createElement(a.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),g=l.shift(),d.insertNode(b),b.append(new CKEDITOR.dom.text("",a.document)),d.moveToBookmark(g),d.selectNodeContents(b),d.collapse(!0),g=d.createBookmark(),k.push(b),l.unshift(g)); h=k[0].getParent();d=[];for(g=0;gc||(this.notifications.splice(c,1),a.element.remove(), this.element.getChildCount()||(this._removeListeners(),this.element.remove()))},_createElement:function(){var a=this.editor,c=a.config,d=new CKEDITOR.dom.element("div");d.addClass("cke_notifications_area");d.setAttribute("id","cke_notifications_area_"+a.name);d.setStyle("z-index",c.baseFloatZIndex-2);return d},_attachListeners:function(){var a=CKEDITOR.document.getWindow(),c=this.editor;a.on("scroll",this._uiBuffer.input);a.on("resize",this._uiBuffer.input);c.on("change",this._changeBuffer.input); c.on("floatingSpaceLayout",this._layout,this,null,20);c.on("blur",this._layout,this,null,20)},_removeListeners:function(){var a=CKEDITOR.document.getWindow(),c=this.editor;a.removeListener("scroll",this._uiBuffer.input);a.removeListener("resize",this._uiBuffer.input);c.removeListener("change",this._changeBuffer.input);c.removeListener("floatingSpaceLayout",this._layout);c.removeListener("blur",this._layout)},_layout:function(){function a(){c.setStyle("left",w(r+f.width-n-q))}var c=this.element,d= this.editor,f=d.ui.contentsElement.getClientRect(),k=d.ui.contentsElement.getDocumentPosition(),g,h,m=c.getClientRect(),e,n=this._notificationWidth,q=this._notificationMargin;e=CKEDITOR.document.getWindow();var y=e.getScrollPosition(),u=e.getViewPaneSize(),p=CKEDITOR.document.getBody(),v=p.getDocumentPosition(),w=CKEDITOR.tools.cssLength;n&&q||(e=this.element.getChild(0),n=this._notificationWidth=e.getClientRect().width,q=this._notificationMargin=parseInt(e.getComputedStyle("margin-left"),10)+parseInt(e.getComputedStyle("margin-right"), 10));d.toolbar&&(g=d.ui.space("top"),h=g.getClientRect());g&&g.isVisible()&&h.bottom>f.top&&h.bottomy.y?c.setStyles({position:"fixed",top:0}):c.setStyles({position:"absolute",top:w(k.y+f.height-m.height)});var r="fixed"==c.getStyle("position")?f.left:"static"!=p.getComputedStyle("position")?k.x-v.x:k.x;f.widthy.x+u.width?a():c.setStyle("left", w(r)):k.x+n+q>y.x+u.width?c.setStyle("left",w(r)):k.x+f.width/2+n/2+q>y.x+u.width?c.setStyle("left",w(r-k.x+y.x+u.width-n-q)):0>f.left+f.width-n-q?a():0>f.left+f.width/2-n/2?c.setStyle("left",w(r-k.x+y.x)):c.setStyle("left",w(r+f.width/2-n/2-q/2))}};CKEDITOR.plugins.notification=a}(),function(){var a='\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"'; CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(a+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(a+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var f="";CKEDITOR.env.ie&&(f='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var a=a+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+f+'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"')+ '\x3e\x26nbsp;\x3c/span\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_button_label cke_button__{name}_label" aria-hidden\x3d"false"\x3e{label}\x3c/span\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_button_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e{arrowHtml}\x3c/a\x3e',b=CKEDITOR.addTemplate("buttonArrow",'\x3cspan class\x3d"cke_button_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":"")+"\x3c/span\x3e"),c=CKEDITOR.addTemplate("button",a);CKEDITOR.plugins.add("button",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(b){b.execCommand(a.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}};CKEDITOR.ui.button.prototype={render:function(a,f){function k(){var b=a.mode;b&&(b=this.modes[b]?void 0!==g[b]?g[b]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,b=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED: b,this.setState(b),this.refresh&&this.refresh())}var g=null,h=CKEDITOR.env,m=this._.id=CKEDITOR.tools.getNextId(),e="",n=this.command,q,y,u;this._.editor=a;var p={id:m,button:this,editor:a,focus:function(){CKEDITOR.document.getById(m).focus()},execute:function(){this.button.click(a)},attach:function(a){this.button.attach(a)}},v=CKEDITOR.tools.addFunction(function(a){if(p.onkey)return a=new CKEDITOR.dom.event(a),!1!==p.onkey(p,a.getKeystroke())}),w=CKEDITOR.tools.addFunction(function(a){var b;p.onfocus&& (b=!1!==p.onfocus(p,new CKEDITOR.dom.event(a)));return b}),r=0;p.clickFn=q=CKEDITOR.tools.addFunction(function(){r&&(a.unlockSelection(1),r=0);p.execute();h.iOS&&a.focus()});this.modes?(g={},a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(g[a.mode]=this._.state)},this),a.on("activeFilterChange",k,this),a.on("mode",k,this),!this.readOnly&&a.on("readOnly",k,this)):n&&(n=a.getCommand(n))&&(n.on("state",function(){this.setState(n.state)},this),e+=n.state==CKEDITOR.TRISTATE_ON? "on":n.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");var z;if(this.directional)a.on("contentDirChanged",function(b){var c=CKEDITOR.document.getById(this._.id),e=c.getFirst();b=b.data;b!=a.lang.dir?c.addClass("cke_"+b):c.removeClass("cke_ltr").removeClass("cke_rtl");e.setAttribute("style",CKEDITOR.skin.getIconStyle(z,"rtl"==b,this.icon,this.iconOffset))},this);n?(y=a.getCommandKeystroke(n))&&(u=CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard,y)):e+="off";y=this.name||this.command;var t= null,x=this.icon;z=y;this.icon&&!/\./.test(this.icon)?(z=this.icon,x=null):(this.icon&&(t=this.icon),CKEDITOR.env.hidpi&&this.iconHiDpi&&(t=this.iconHiDpi));t?(CKEDITOR.skin.addIcon(t,t),x=null):t=z;e={id:m,name:y,iconName:z,label:this.label,cls:(this.hasArrow?"cke_button_expandable ":"")+(this.className||""),state:e,ariaDisabled:"disabled"==e?"true":"false",title:this.title+(u?" ("+u.display+")":""),ariaShortcut:u?a.lang.common.keyboardShortcut+" "+u.aria:"",titleJs:h.gecko&&!h.hc?"":(this.title|| "").replace("'",""),hasArrow:"string"===typeof this.hasArrow&&this.hasArrow||(this.hasArrow?"true":"false"),keydownFn:v,focusFn:w,clickFn:q,style:CKEDITOR.skin.getIconStyle(t,"rtl"==a.lang.dir,x,this.iconOffset),arrowHtml:this.hasArrow?b.output():""};c.output(e,f);if(this.onRender)this.onRender();return p},setState:function(a){if(this._.state==a)return!1;this._.state=a;var b=CKEDITOR.document.getById(this._.id);return b?(b.setState(a,"cke_button"),b.setAttribute("aria-disabled",a==CKEDITOR.TRISTATE_DISABLED), this.hasArrow?b.setAttribute("aria-expanded",a==CKEDITOR.TRISTATE_ON):a===CKEDITOR.TRISTATE_ON?b.setAttribute("aria-pressed",!0):b.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(a){if(this._.feature)return this._.feature;var b=this;this.allowedContent||this.requiredContent||!this.command||(b=a.getCommand(this.command)||b);return this._.feature=b}};CKEDITOR.ui.prototype.addButton=function(a,b){this.add(a,CKEDITOR.UI_BUTTON,b)}}(),function(){function a(a){function b(){for(var e= c(),h=CKEDITOR.tools.clone(a.config.toolbarGroups)||f(a),m=0;mb.order?-1:0>a.order? 1:a.order]+data-cke-bookmark[^<]*?<\/span>/ig,"");g&&a(b,d)})}function A(){if("wysiwyg"==b.mode){var a=B("paste");b.getCommand("cut").setState(B("cut"));b.getCommand("copy").setState(B("copy"));b.getCommand("paste").setState(a);b.fire("pasteState",a)}}function B(a){var c= b.getSelection(),c=c&&c.getRanges()[0];if((b.readOnly||c&&c.checkReadOnly())&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;a=b.getSelection();c=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==c.length&&c[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var C=CKEDITOR.plugins.clipboard,H=0,F=0;(function(){b.on("key",t);b.on("contentDom",c);b.on("selectionChange",A);if(b.contextMenu){b.contextMenu.addListener(function(){return{cut:B("cut"), copy:B("copy"),paste:B("paste")}});var a=null;b.on("menuShow",function(){a&&(a.removeListener(),a=null);var c=b.contextMenu.findItemByCommandName("paste");c&&c.element&&(a=c.element.on("touchend",function(){b._.forcePasteDialog=!0}))})}if(b.ui.addButton)b.once("instanceReady",function(){b._.pasteButtons&&CKEDITOR.tools.array.forEach(b._.pasteButtons,function(a){if(a=b.ui.get(a))if(a=CKEDITOR.document.getById(a._.id))a.on("touchend",function(){b._.forcePasteDialog=!0})})})})();(function(){function a(c, d,g,f,h){var k=b.lang.clipboard[d];b.addCommand(d,g);b.ui.addButton&&b.ui.addButton(c,{label:k,command:d,toolbar:"clipboard,"+f});b.addMenuItems&&b.addMenuItem(d,{label:k,command:d,group:"clipboard",order:h})}a("Cut","cut",d("cut"),10,1);a("Copy","copy",d("copy"),20,4);a("Paste","paste",g(),30,8);b._.pasteButtons||(b._.pasteButtons=[]);b._.pasteButtons.push("Paste")})();b.getClipboardData=function(a,c){function d(a){a.removeListener();a.cancel();c(a.data)}function g(a){a.removeListener();a.cancel(); c({type:h,dataValue:a.data.dataValue,dataTransfer:a.data.dataTransfer,method:"paste"})}var f=!1,h="auto";c||(c=a,a=null);b.on("beforePaste",function(a){a.removeListener();f=!0;h=a.data.type},null,null,1E3);b.on("paste",d,null,null,0);!1===z()&&(b.removeListener("paste",d),b._.forcePasteDialog&&f&&b.fire("pasteDialog")?(b.on("pasteDialogCommit",g),b.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",g);a.data._.committed||c(null)})):c(null))}}function b(a){if(CKEDITOR.env.webkit){if(!a.match(/^[^<]*$/g)&& !a.match(/^(
<\/div>|
[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!a.match(/^([^<]|)*$/gi)&&!a.match(/^(

([^<]|)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!a.match(/^([^<]|)*$/gi))return"html"}else return"html";return"htmlifiedtext"}function c(a,b){function c(a){return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e",~~(a/2))+(1==a%2?"\x3cbr\x3e":"")}b=b.replace(/(?!\u3000)\s+/g," ").replace(/> +/gi, "\x3cbr\x3e");b=b.replace(/<\/?[A-Z]+>/g,function(a){return a.toLowerCase()});if(b.match(/^[^<]$/))return b;CKEDITOR.env.webkit&&-1(
|)<\/div>)(?!$|(

(
|)<\/div>))/g,"\x3cbr\x3e").replace(/^(
(
|)<\/div>){2}(?!$)/g,"\x3cdiv\x3e\x3c/div\x3e"),b.match(/
(
|)<\/div>/)&&(b="\x3cp\x3e"+b.replace(/(
(
|)<\/div>)+/g,function(a){return c(a.split("\x3c/div\x3e\x3cdiv\x3e").length+1)})+"\x3c/p\x3e"),b=b.replace(/<\/div>
/g,"\x3cbr\x3e"), b=b.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&a.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(b=b.replace(/^

$/,"\x3cbr\x3e")),-1){2,}/g,function(a){return c(a.length/4)})+"\x3c/p\x3e"));return k(a,b)}function d(a){function b(){var a={},c;for(c in CKEDITOR.dtd)"$"!=c.charAt(0)&&"div"!=c&&"span"!=c&&(a[c]=1);return a}var c={};return{get:function(d){return"plain-text"==d?c.plainText||(c.plainText=new CKEDITOR.filter(a, "br")):"semantic-content"==d?((d=c.semanticContent)||(d=new CKEDITOR.filter(a,{}),d.allow({$1:{elements:b(),attributes:!0,styles:!1,classes:!1}}),d=c.semanticContent=d),d):d?new CKEDITOR.filter(a,d):null}}}function l(a,b,c){b=CKEDITOR.htmlParser.fragment.fromHtml(b);var d=new CKEDITOR.htmlParser.basicWriter;c.applyTo(b,!0,!1,a.activeEnterMode);b.writeHtml(d);return d.getHtml()}function k(a,b){a.enterMode==CKEDITOR.ENTER_BR?b=b.replace(/(<\/p>

)+/g,function(a){return CKEDITOR.tools.repeat("\x3cbr\x3e", a.length/7*2)}).replace(/<\/?p>/g,""):a.enterMode==CKEDITOR.ENTER_DIV&&(b=b.replace(/<(\/)?p>/g,"\x3c$1div\x3e"));return b}function g(a){a.data.preventDefault();a.data.$.dataTransfer.dropEffect="none"}function h(b){var c=CKEDITOR.plugins.clipboard;b.on("contentDom",function(){function d(c,g,f){g.select();a(b,{dataTransfer:f,method:"drop"},1);f.sourceEditor.fire("saveSnapshot");f.sourceEditor.editable().extractHtmlFromRange(c);f.sourceEditor.getSelection().selectRanges([c]);f.sourceEditor.fire("saveSnapshot")} function g(d,f){d.select();a(b,{dataTransfer:f,method:"drop"},1);c.resetDragDataTransfer()}function f(a,c,d){var g={$:a.data.$,target:a.data.getTarget()};c&&(g.dragRange=c);d&&(g.dropRange=d);!1===b.fire(a.name,g)&&a.data.preventDefault()}function h(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());return a.getChildCount()}var k=b.editable(),l=CKEDITOR.plugins.clipboard.getDropTarget(b),m=b.ui.space("top"),z=b.ui.space("bottom");c.preventDefaultDropOnElement(m);c.preventDefaultDropOnElement(z); k.attachListener(l,"dragstart",f);k.attachListener(b,"dragstart",c.resetDragDataTransfer,c,null,1);k.attachListener(b,"dragstart",function(a){c.initDragDataTransfer(a,b)},null,null,2);k.attachListener(b,"dragstart",function(){var a=c.dragRange=b.getSelection().getRanges()[0];CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(c.dragStartContainerChildCount=a?h(a.startContainer):null,c.dragEndContainerChildCount=a?h(a.endContainer):null)},null,null,100);k.attachListener(l,"dragend",f);k.attachListener(b,"dragend", c.initDragDataTransfer,c,null,1);k.attachListener(b,"dragend",c.resetDragDataTransfer,c,null,100);k.attachListener(l,"dragover",function(a){if(CKEDITOR.env.edge)a.data.preventDefault();else{var b=a.data.getTarget();b&&b.is&&b.is("html")?a.data.preventDefault():CKEDITOR.env.ie&&CKEDITOR.plugins.clipboard.isFileApiSupported&&a.data.$.dataTransfer.types.contains("Files")&&a.data.preventDefault()}});k.attachListener(l,"drop",function(a){if(!a.data.$.defaultPrevented){a.data.preventDefault();var d=a.data.getTarget(); if(!d.isReadOnly()||d.type==CKEDITOR.NODE_ELEMENT&&d.is("html")){var d=c.getRangeAtDropPosition(a,b),g=c.dragRange;d&&f(a,g,d)}}},null,null,9999);k.attachListener(b,"drop",c.initDragDataTransfer,c,null,1);k.attachListener(b,"drop",function(a){if(a=a.data){var f=a.dropRange,h=a.dragRange,k=a.dataTransfer;k.getTransferType(b)==CKEDITOR.DATA_TRANSFER_INTERNAL?setTimeout(function(){c.internalDrop(h,f,k,b)},0):k.getTransferType(b)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?d(h,f,k):g(f,k)}},null,null,9999)})} var m;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",init:function(a){var g,k=d(a);a.config.forcePasteAsPlainText?g="plain-text":a.config.pasteFilter?g=a.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in a.config||(g="semantic-content");a.pasteFilter=k.get(g);f(a);h(a);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));if(CKEDITOR.env.gecko){var m=["image/png","image/jpeg","image/gif"],u;a.on("paste",function(b){var c=b.data,d=c.dataTransfer; if(!c.dataValue&&"paste"==c.method&&d&&1==d.getFilesCount()&&u!=d.id&&(d=d.getFile(0),-1!=CKEDITOR.tools.indexOf(m,d.type))){var g=new FileReader;g.addEventListener("load",function(){b.data.dataValue='\x3cimg src\x3d"'+g.result+'" /\x3e';a.fire("paste",b.data)},!1);g.addEventListener("abort",function(){a.fire("paste",b.data)},!1);g.addEventListener("error",function(){a.fire("paste",b.data)},!1);g.readAsDataURL(d);u=c.dataTransfer.id;b.stop()}},null,null,1)}a.on("paste",function(b){b.data.dataTransfer|| (b.data.dataTransfer=new CKEDITOR.plugins.clipboard.dataTransfer);if(!b.data.dataValue){var c=b.data.dataTransfer,d=c.getData("text/html");if(d)b.data.dataValue=d,b.data.type="html";else if(d=c.getData("text/plain"))b.data.dataValue=a.editable().transformPlainTextToHtml(d),b.data.type="text"}},null,null,1);a.on("paste",function(a){var b=a.data.dataValue,c=CKEDITOR.dtd.$block;-1 <\/span>/gi," "),"html"!=a.data.type&&(b=b.replace(/]*>([^<]*)<\/span>/gi, function(a,b){return b.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;")})),-1/,"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(b.match(/^<[^<]+cke_(editable|contents)/i)){var d,e,g=new CKEDITOR.dom.element("div");for(g.setHtml(b);1==g.getChildCount()&&(d=g.getFirst())&&d.type==CKEDITOR.NODE_ELEMENT&&(d.hasClass("cke_editable")|| d.hasClass("cke_contents"));)g=e=d;e&&(b=e.getHtml().replace(/
$/i,""))}CKEDITOR.env.ie?b=b.replace(/^ (?: |\r\n)?<(\w+)/g,function(b,d){return d.toLowerCase()in c?(a.data.preSniffing="html","\x3c"+d):b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)>


<\/div>$/,function(b,d){return d in c?(a.data.endsWithEOL=1,"\x3c/"+d+"\x3e"):b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)
$/,"$1"));a.data.dataValue=b},null,null,3);a.on("paste",function(d){d=d.data;var g=a._.nextPasteType||d.type,f=d.dataValue, h,m=a.config.clipboard_defaultContentType||"html",n=d.dataTransfer.getTransferType(a)==CKEDITOR.DATA_TRANSFER_EXTERNAL,u=!0===a.config.forcePasteAsPlainText;h="html"==g||"html"==d.preSniffing?"html":b(f);delete a._.nextPasteType;"htmlifiedtext"==h&&(f=c(a.config,f));if("text"==g&&"html"==h)f=l(a,f,k.get("plain-text"));else if(n&&a.pasteFilter&&!d.dontFilter||u)f=l(a,f,a.pasteFilter);d.startsWithEOL&&(f='\x3cbr data-cke-eol\x3d"1"\x3e'+f);d.endsWithEOL&&(f+='\x3cbr data-cke-eol\x3d"1"\x3e');"auto"== g&&(g="html"==h||"html"==m?"html":"text");d.type=g;d.dataValue=f;delete d.preSniffing;delete d.startsWithEOL;delete d.endsWithEOL},null,null,6);a.on("paste",function(b){b=b.data;b.dataValue&&(a.insertHtml(b.dataValue,b.type,b.range),setTimeout(function(){a.fire("afterPaste")},0))},null,null,1E3);a.on("pasteDialog",function(b){setTimeout(function(){a.openDialog("paste",b.data)},0)})}});CKEDITOR.plugins.clipboard={isCustomCopyCutSupported:(!CKEDITOR.env.ie||16<=CKEDITOR.env.version)&&!CKEDITOR.env.iOS, isCustomDataTypesSupported:!CKEDITOR.env.ie||16<=CKEDITOR.env.version,isFileApiSupported:!CKEDITOR.env.ie||9CKEDITOR.env.version||b.isInline()?b:a.document},fixSplitNodesAfterDrop:function(a,b,c,d){function g(a,c,d){var e=a;e.type==CKEDITOR.NODE_TEXT&&(e=a.getParent());if(e.equals(c)&&d!=c.getChildCount())return a=b.startContainer.getChild(b.startOffset-1),c=b.startContainer.getChild(b.startOffset), a&&a.type==CKEDITOR.NODE_TEXT&&c&&c.type==CKEDITOR.NODE_TEXT&&(d=a.getLength(),a.setText(a.getText()+c.getText()),c.remove(),b.setStart(a,d),b.collapse(!0)),!0}var f=b.startContainer;"number"==typeof d&&"number"==typeof c&&f.type==CKEDITOR.NODE_ELEMENT&&(g(a.startContainer,f,c)||g(a.endContainer,f,d))},isDropRangeAffectedByDragRange:function(a,b){var c=b.startContainer,d=b.endOffset;return a.endContainer.equals(c)&&a.endOffset<=d||a.startContainer.getParent().equals(c)&&a.startContainer.getIndex()< d||a.endContainer.getParent().equals(c)&&a.endContainer.getIndex()CKEDITOR.env.version&&this.fixSplitNodesAfterDrop(b,c,f.dragStartContainerChildCount,f.dragEndContainerChildCount);(l=this.isDropRangeAffectedByDragRange(b,c))||(k=b.createBookmark(!1));f=c.clone().createBookmark(!1);l&&(k=b.createBookmark(!1));b=k.startNode;c= k.endNode;l=f.startNode;c&&b.getPosition(l)&CKEDITOR.POSITION_PRECEDING&&c.getPosition(l)&CKEDITOR.POSITION_FOLLOWING&&l.insertBefore(b);b=g.createRange();b.moveToBookmark(k);h.extractHtmlFromRange(b,1);c=g.createRange();f.startNode.getCommonAncestor(h)||(f=g.getSelection().createBookmarks()[0]);c.moveToBookmark(f);a(g,{dataTransfer:d,method:"drop",range:c},1);g.fire("unlockSnapshot")},getRangeAtDropPosition:function(a,b){var c=a.data.$,d=c.clientX,g=c.clientY,f=b.getSelection(!0).getRanges()[0], h=b.createRange();if(a.data.testRange)return a.data.testRange;if(document.caretRangeFromPoint&&b.document.$.caretRangeFromPoint(d,g))c=b.document.$.caretRangeFromPoint(d,g),h.setStart(CKEDITOR.dom.node(c.startContainer),c.startOffset),h.collapse(!0);else if(c.rangeParent)h.setStart(CKEDITOR.dom.node(c.rangeParent),c.rangeOffset),h.collapse(!0);else{if(CKEDITOR.env.ie&&8l&&!k;l++){if(!k)try{c.moveToPoint(d,g-l),k=!0}catch(m){}if(!k)try{c.moveToPoint(d,g+l),k=!0}catch(t){}}if(k){var x="cke-temp-"+(new Date).getTime();c.pasteHTML('\x3cspan id\x3d"'+x+'"\x3e​\x3c/span\x3e');var A=b.document.getById(x);h.moveToPosition(A,CKEDITOR.POSITION_BEFORE_START);A.remove()}else{var B=b.document.$.elementFromPoint(d,g),C=new CKEDITOR.dom.element(B),H;if(C.equals(b.editable())||"html"==C.getName())return f&&f.startContainer&&!f.startContainer.equals(b.editable())? f:null;H=C.getClientRect();d/i,bodyRegExp:/([\s\S]*)<\/body>/i,fragmentRegExp:/\x3c!--(?:Start|End)Fragment--\x3e/g,data:{},files:[],nativeHtmlCache:"",normalizeType:function(a){a=a.toLowerCase();return"text"==a||"text/plain"==a?"Text":"url"==a?"URL":a}};this._.fallbackDataTransfer=new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this);this.id=this.getData(m);this.id||(this.id="Text"==m?"":"cke-"+ CKEDITOR.tools.getUniqueId());b&&(this.sourceEditor=b,this.setData("text/html",b.getSelectedHtml(1)),"Text"==m||this.getData("text/plain")||this.setData("text/plain",b.getSelection().getSelectedText()))};CKEDITOR.DATA_TRANSFER_INTERNAL=1;CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2;CKEDITOR.DATA_TRANSFER_EXTERNAL=3;CKEDITOR.plugins.clipboard.dataTransfer.prototype={getData:function(a,b){a=this._.normalizeType(a);var c="text/html"==a&&b?this._.nativeHtmlCache:this._.data[a];if(void 0===c||null===c||""=== c){if(this._.fallbackDataTransfer.isRequired())c=this._.fallbackDataTransfer.getData(a,b);else try{c=this.$.getData(a)||""}catch(d){c=""}"text/html"!=a||b||(c=this._stripHtml(c))}"Text"==a&&CKEDITOR.env.gecko&&this.getFilesCount()&&"file://"==c.substring(0,7)&&(c="");if("string"===typeof c)var g=c.indexOf("\x3c/html\x3e"),c=-1!==g?c.substring(0,g+7):c;return c},setData:function(a,b){a=this._.normalizeType(a);"text/html"==a?(this._.data[a]=this._stripHtml(b),this._.nativeHtmlCache=b):this._.data[a]= b;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||"URL"==a||"Text"==a)if("Text"==m&&"Text"==a&&(this.id=b),this._.fallbackDataTransfer.isRequired())this._.fallbackDataTransfer.setData(a,b);else try{this.$.setData(a,b)}catch(c){}},storeId:function(){"Text"!==m&&this.setData(m,this.id)},getTransferType:function(a){return this.sourceEditor?this.sourceEditor==a?CKEDITOR.DATA_TRANSFER_INTERNAL:CKEDITOR.DATA_TRANSFER_CROSS_EDITORS:CKEDITOR.DATA_TRANSFER_EXTERNAL},cacheData:function(){function a(c){c= b._.normalizeType(c);var d=b.getData(c);"text/html"==c&&(b._.nativeHtmlCache=b.getData(c,!0),d=b._stripHtml(d));d&&(b._.data[c]=d)}if(this.$){var b=this,c,d;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(c=0;cc?v+c:b.width>c?v-a.left:v-a.right+b.width):ec?v-c:b.width>c?v-a.right+b.width:v-a.left);c=a.top;b.height-a.topd?w-d:b.height>d?w-a.bottom+b.height:w-a.top);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&(b=a=new CKEDITOR.dom.element(n.$.offsetParent),"html"==b.getName()&&(b=b.getDocument().getBody()),"rtl"==b.getComputedStyle("direction")&&(v=CKEDITOR.env.ie8Compat?v-2*n.getDocument().getDocumentElement().$.scrollLeft:v-(a.$.scrollWidth- a.$.clientWidth)));var a=n.getFirst(),k;(k=a.getCustomData("activePanel"))&&k.onHide&&k.onHide.call(this,1);a.setCustomData("activePanel",this);n.setStyles({top:w+"px",left:v+"px"});n.setOpacity(1);g&&g()},this);h.isLoaded?a():h.onLoad=a;CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus();m.element.focus();CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=a);this.allowBlur(!0);this._.markFirst&&(CKEDITOR.env.ie? CKEDITOR.tools.setTimeout(function(){m.markFirstDisplayed?m.markFirstDisplayed():m._.markFirstDisplayed()},0):m.markFirstDisplayed?m.markFirstDisplayed():m._.markFirstDisplayed());this._.editor.fire("panelShow",this)},0,this)},CKEDITOR.env.air?200:0,this);this.visible=1;this.onShow&&this.onShow.call(this)},reposition:function(){var a=this._.showBlockParams;this.visible&&this._.showBlockParams&&(this.hide(),this.showBlock.apply(this,a))},focus:function(){if(CKEDITOR.env.webkit){var a=CKEDITOR.document.getActive(); a&&!a.equals(this._.iframe)&&a.$.blur()}(this._.lastFocused||this._.iframe.getFrameDocument().getWindow()).focus()},blur:function(){var a=this._.iframe.getFrameDocument().getActive();a&&a.is("a")&&(this._.lastFocused=a)},hide:function(a){if(this.visible&&(!this.onHide||!0!==this.onHide.call(this))){this.hideChild();CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur();this.element.setStyle("display","none");this.visible=0;this.element.getFirst().removeCustomData("activePanel"); if(a=a&&this._.returnFocus)CKEDITOR.env.webkit&&a.type&&a.getWindow().$.focus(),a.focus();delete this._.lastFocused;this._.showBlockParams=null;this._.editor.fire("panelHide",this)}},allowBlur:function(a){var c=this._.panel;void 0!==a&&(c.allowBlur=a);return c.allowBlur},showAsChild:function(a,c,d,f,k,g){if(this._.activeChild!=a||a._.panel._.offsetParentId!=d.getId())this.hideChild(),a.onHide=CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){this._.focused||this.hide()},0,this)}, this),this._.activeChild=a,this._.focused=!1,a.showBlock(c,d,f,k,g),this.blur(),(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&setTimeout(function(){a.element.getChild(0).$.style.cssText+=""},100)},hideChild:function(a){var c=this._.activeChild;c&&(delete c.onHide,delete this._.activeChild,c.hide(),a&&this.focus())}}});CKEDITOR.on("instanceDestroyed",function(){var a=CKEDITOR.tools.isEmpty(CKEDITOR.instances),c;for(c in f){var d=f[c];a?d.destroy():d.element.hide()}a&&(f={})})}(),CKEDITOR.plugins.add("menu", {requires:"floatpanel",beforeInit:function(a){for(var f=a.config.menu_groups.split(","),b=a._.menuGroups={},c=a._.menuItems={},d=0;db.group?1:a.orderb.order?1:0})}var f='\x3cspan class\x3d"cke_menuitem"\x3e\x3ca id\x3d"{id}" class\x3d"cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href\x3d"{href}" title\x3d"{title}" tabindex\x3d"-1" _cke_focus\x3d1 hidefocus\x3d"true" role\x3d"{role}" aria-label\x3d"{label}" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasPopup}" aria-disabled\x3d"{disabled}" {ariaChecked} draggable\x3d"false"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&& (f+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(f+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;" ondragstart\x3d"return false;"');var f=f+(' onmouseover\x3d"CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout\x3d"CKEDITOR.tools.callFunction({moveOutFn},{index});" '+(CKEDITOR.env.ie?'onclick\x3d"return false;" onmouseup':"onclick")+'\x3d"CKEDITOR.tools.callFunction({clickFn},{index}); return false;"\x3e'),b=CKEDITOR.addTemplate("menuItem",f+'\x3cspan class\x3d"cke_menubutton_inner"\x3e\x3cspan class\x3d"cke_menubutton_icon"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{iconStyle}"\x3e\x3c/span\x3e\x3c/span\x3e\x3cspan class\x3d"cke_menubutton_label"\x3e{label}\x3c/span\x3e{shortcutHtml}{arrowHtml}\x3c/span\x3e\x3c/a\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_voice_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e\x3c/span\x3e'), c=CKEDITOR.addTemplate("menuArrow",'\x3cspan class\x3d"cke_menuarrow"\x3e\x3cspan\x3e{label}\x3c/span\x3e\x3c/span\x3e'),d=CKEDITOR.addTemplate("menuShortcut",'\x3cspan class\x3d"cke_menubutton_label cke_menubutton_shortcut"\x3e{shortcut}\x3c/span\x3e');CKEDITOR.menu=CKEDITOR.tools.createClass({$:function(a,b){b=this._.definition=b||{};this.id=CKEDITOR.tools.getNextId();this.editor=a;this.items=[];this._.listeners=[];this._.level=b.level||1;var c=CKEDITOR.tools.extend({},b.panel,{css:[CKEDITOR.skin.getPath("editor")], level:this._.level-1,block:{}}),d=c.block.attributes=c.attributes||{};!d.role&&(d.role="menu");this._.panelDefinition=c},_:{onShow:function(){var a=this.editor.getSelection(),b=a&&a.getStartElement(),c=this.editor.elementPath(),d=this._.listeners;this.removeAll();for(var f=0;fz.length)return!1;h=f.getParents(!0);for(r=0;rx;r++)t[r].indent+=h;h=CKEDITOR.plugins.list.arrayToList(t,e,null,a.config.enterMode,f.getDirection());if(!d.isIndent){var C;if((C=f.getParent())&&C.is("li"))for(var z=h.listNode.getChildren(),u=[],p,r=z.count()-1;0<=r;r--)(p=z.getItem(r))&&p.is&&p.is("li")&&u.push(p)}h&&h.listNode.replace(f);if(u&&u.length)for(r=0;rg.length)){d=g[g.length-1].getNext();f=e.createElement(this.type);for(c.push(f);g.length;)c=g.shift(),a=e.createElement("li"),l=c,l.is("pre")||u.test(l.getName())||"false"==l.getAttribute("contenteditable")?c.appendTo(a):(c.copyAttributes(a),h&&c.getDirection()&&(a.removeStyle("direction"),a.removeAttribute("dir")),c.moveChildren(a),c.remove()),a.appendTo(f);h&&k&&f.setAttribute("dir",h);d?f.insertBefore(d):f.appendTo(b)}}function b(a,b,c){function d(c){if(!(!(l= k[c?"getFirst":"getLast"]())||l.is&&l.isBlockBoundary()||!(m=b.root[c?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))||m.is&&m.isBlockBoundary({br:1})))a.document.createElement("br")[c?"insertBefore":"insertAfter"](l)}for(var e=CKEDITOR.plugins.list.listToArray(b.root,c),g=[],f=0;fe[f-1].indent+1){g=e[f-1].indent+1-e[f].indent;for(h=e[f].indent;e[f]&&e[f].indent>=h;)e[f].indent+=g,f++;f--}var k=CKEDITOR.plugins.list.arrayToList(e,c,null,a.config.enterMode,b.root.getAttribute("dir")).listNode,l,m;d(!0);d();k.replace(b.root);a.fire("contentDomInvalidated")}function c(a,b){this.name=a;this.context=this.type=b;this.allowedContent=b+" li";this.requiredContent=b}function d(a,b,c,d){for(var e, g;e=a[d?"getLast":"getFirst"](p);)(g=e.getDirection(1))!==b.getDirection(1)&&e.setAttribute("dir",g),e.remove(),c?e[d?"insertBefore":"insertAfter"](c):b.append(e,d),c=e}function l(a){function b(c){var e=a[c?"getPrevious":"getNext"](q);e&&e.type==CKEDITOR.NODE_ELEMENT&&e.is(a.getName())&&(d(a,e,null,!c),a.remove(),a=e)}b();b(1)}function k(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.getName()in CKEDITOR.dtd.$block||a.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[a.getName()]["#"]}function g(a,b, c){a.fire("saveSnapshot");c.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var e=c.extractContents();b.trim(!1,!0);var g=b.createBookmark(),f=new CKEDITOR.dom.elementPath(b.startContainer),k=f.block,f=f.lastElement.getAscendant("li",1)||k,m=new CKEDITOR.dom.elementPath(c.startContainer),n=m.contains(CKEDITOR.dtd.$listItem),m=m.contains(CKEDITOR.dtd.$list);k?(k=k.getBogus())&&k.remove():m&&(k=m.getPrevious(q))&&y(k)&&k.remove();(k=e.getLast())&&k.type==CKEDITOR.NODE_ELEMENT&&k.is("br")&&k.remove();(k= b.startContainer.getChild(b.startOffset))?e.insertBefore(k):b.startContainer.append(e);n&&(e=h(n))&&(f.contains(n)?(d(e,n.getParent(),n),e.remove()):f.append(e));for(;c.checkStartOfBlock()&&c.checkEndOfBlock();){m=c.startPath();e=m.block;if(!e)break;e.is("li")&&(f=e.getParent(),e.equals(f.getLast(q))&&e.equals(f.getFirst(q))&&(e=f));c.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);e.remove()}c=c.clone();e=a.editable();c.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(c);c.evaluator= function(a){return q(a)&&!y(a)};(c=c.next())&&c.type==CKEDITOR.NODE_ELEMENT&&c.getName()in CKEDITOR.dtd.$list&&l(c);b.moveToBookmark(g);b.select();a.fire("saveSnapshot")}function h(a){return(a=a.getLast(q))&&a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in m?a:null}var m={ol:1,ul:1},e=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(),q=function(a){return!(e(a)||n(a))},y=CKEDITOR.dom.walker.bogus();CKEDITOR.plugins.list={listToArray:function(a,b,c,d,e){if(!m[a.getName()])return[];d||(d= 0);c||(c=[]);for(var g=0,f=a.getChildCount();g=f.$.documentMode&&p.append(f.createText(" ")),p.append(l.listNode),l=l.nextIndex;else if(-1== G.indent&&!c&&g){m[g.getName()]?(p=G.element.clone(!1,!0),y!=g.getDirection(1)&&p.setAttribute("dir",y)):p=new CKEDITOR.dom.documentFragment(f);var k=g.getDirection(1)!=y,D=G.element,N=D.getAttribute("class"),Q=D.getAttribute("style"),O=p.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(d!=CKEDITOR.ENTER_BR||k||Q||N),K,W=G.contents.length,R;for(g=0;gCKEDITOR.env.version? k.createText("\r"):k.createElement("br"),c.deleteContents(),c.insertNode(a),CKEDITOR.env.needsBrFiller?(k.createText("").insertAfter(a),l&&(v||p.blockLimit).appendBogus(),a.getNext().$.nodeValue="",c.setStartAt(a.getNext(),CKEDITOR.POSITION_AFTER_START)):c.setStartAt(a,CKEDITOR.POSITION_AFTER_END)),c.collapse(!0),c.select(),c.scrollIntoView()):g(a,b,c,d)}}};l=CKEDITOR.plugins.enterkey;k=l.enterBr;g=l.enterBlock;h=/^h[1-6]$/}(),function(){function a(a,b){var c={},d=[],l={nbsp:" ",shy:"­",gt:"\x3e", lt:"\x3c",amp:"\x26",apos:"'",quot:'"'};a=a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(a,e){var g=b?"\x26"+e+";":l[e];c[g]=b?l[e]:"\x26"+e+";";d.push(g);return""});a=a.replace(/,$/,"");if(!b&&a){a=a.split(",");var k=document.createElement("div"),g;k.innerHTML="\x26"+a.join(";\x26")+";";g=k.innerHTML;k=null;for(k=0;kf&&(f=640);420>b&&(b=420);var d=parseInt((window.screen.height-b)/2,10),l=parseInt((window.screen.width- f)/2,10);c=(c||"location\x3dno,menubar\x3dno,toolbar\x3dno,dependent\x3dyes,minimizable\x3dno,modal\x3dyes,alwaysRaised\x3dyes,resizable\x3dyes,scrollbars\x3dyes")+",width\x3d"+f+",height\x3d"+b+",top\x3d"+d+",left\x3d"+l;var k=window.open("",null,c,!0);if(!k)return!1;try{-1==navigator.userAgent.toLowerCase().indexOf(" chrome/")&&(k.moveTo(l,d),k.resizeTo(f,b)),k.focus(),k.location.href=a}catch(g){window.open(a,null,c,!0)}return!0}}),"use strict",function(){function a(a){this.editor=a;this.loaders= []}function f(a,c,f){var g=a.config.fileTools_defaultFileName;this.editor=a;this.lang=a.lang;"string"===typeof c?(this.data=c,this.file=b(this.data),this.loaded=this.total=this.file.size):(this.data=null,this.file=c,this.total=this.file.size,this.loaded=0);f?this.fileName=f:this.file.name?this.fileName=this.file.name:(a=this.file.type.split("/"),g&&(a[0]=g),this.fileName=a.join("."));this.uploaded=0;this.responseData=this.uploadTotal=null;this.status="created";this.abort=function(){this.changeStatus("abort")}} function b(a){var b=a.match(c)[1];a=a.replace(c,"");a=atob(a);var f=[],g,h,m,e;for(g=0;gg.status||299w.height-v.bottom?g("pin"):g("bottom"),e=w.width/2,e=d.floatSpacePreferRight?"right":0p.width?"rtl"==d.contentsLangDirection?"right":"left":e-v.left>v.right-e?"left":"right",p.width>w.width?(e="left",n=0):(n="left"==e?0w.width&&(e="left"==e?"right":"left",n=0)),h.setStyle(e,b(("pin"==l?A:t)+n+("pin"==l?0:"left"==e?z:-z)))):(l="pin",g("pin"),k(e))}}}();if(l){var g=new CKEDITOR.template('\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+ CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" title\x3d"'+(CKEDITOR.env.gecko?" ":"")+'" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"'+(a.title?' aria-labelledby\x3d"cke_{name}_arialbl"':" ")+"\x3e"+(a.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':" ")+'\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),h=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(g.output({content:l, id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(d.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.title}))),m=CKEDITOR.tools.eventsBuffer(500,k),e=CKEDITOR.tools.eventsBuffer(100,k);h.unselectable();h.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){k(b);a.on("change",m.input);f.on("scroll",e.input);f.on("resize",e.input)});a.on("blur",function(){h.hide();a.removeListener("change", m.input);f.removeListener("scroll",e.input);f.removeListener("resize",e.input)});a.on("destroy",function(){f.removeListener("scroll",e.input);f.removeListener("resize",e.input);h.clearCustomData();h.remove()});a.focusManager.hasFocus&&h.show();a.focusManager.add(h,1)}}var f=CKEDITOR.document.getWindow(),b=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(b){b.on("loaded",function(){a(this)},null,null,20)}})}(),CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var a= CKEDITOR.addTemplate("panel-list",'\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),f=CKEDITOR.addTemplate("panel-list-item",'\x3cli id\x3d"{id}" class\x3d"cke_panel_listItem" role\x3dpresentation\x3e\x3ca id\x3d"{id}_option" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"{title}" draggable\x3d"false" ondragstart\x3d"return false;" href\x3d"javascript:void(\'{val}\')" {onclick}\x3d"CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'), b=CKEDITOR.addTemplate("panel-list-group",'\x3ch1 id\x3d"{id}" draggable\x3d"false" ondragstart\x3d"return false;" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'),c=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(a,b){return this.addBlock(a,new CKEDITOR.ui.listBlock(this.getHolderElement(),b))};CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(a,b){b=b||{};var c=b.attributes||(b.attributes={});(this.multiSelect=!!b.multiSelect)&& (c["aria-multiselectable"]=!0);!c.role&&(c.role="listbox");this.base.apply(this,arguments);this.element.setAttribute("role",c.role);c=this.keys;c[40]="next";c[9]="next";c[38]="prev";c[CKEDITOR.SHIFT+9]="prev";c[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(c[13]="mouseup");this._.pendingHtml=[];this._.pendingList=[];this._.items={};this._.groups={}},_:{close:function(){if(this._.started){var b=a.output({items:this._.pendingList.join("")});this._.pendingList=[];this._.pendingHtml.push(b); delete this._.started}},getClick:function(){this._.click||(this._.click=CKEDITOR.tools.addFunction(function(a){var b=this.toggle(a);if(this.onClick)this.onClick(a,b)},this));return this._.click}},proto:{add:function(a,b,k){var g=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0);this._.items[a]=g;var h;h=CKEDITOR.tools.htmlEncodeAttr(a).replace(c,"\\'");a={id:g,val:h,onclick:CKEDITOR.env.ie?'onclick\x3d"return false;" onmouseup':"onclick",clickFn:this._.getClick(), title:CKEDITOR.tools.htmlEncodeAttr(k||a),text:b||a};this._.pendingList.push(f.output(a))},startGroup:function(a){this._.close();var c=CKEDITOR.tools.getNextId();this._.groups[a]=c;this._.pendingHtml.push(b.output({id:c,label:a}))},commit:function(){this._.close();this.element.appendHtml(this._.pendingHtml.join(""));delete this._.size;this._.pendingHtml=[]},toggle:function(a){var b=this.isMarked(a);b?this.unmark(a):this.mark(a);return!b},hideGroup:function(a){var b=(a=this.element.getDocument().getById(this._.groups[a]))&& a.getNext();a&&(a.setStyle("display","none"),b&&"ul"==b.getName()&&b.setStyle("display","none"))},hideItem:function(a){this.element.getDocument().getById(this._.items[a]).setStyle("display","none")},showAll:function(){var a=this._.items,b=this._.groups,c=this.element.getDocument(),g;for(g in a)c.getById(a[g]).setStyle("display","");for(var f in b)a=c.getById(b[f]),g=a.getNext(),a.setStyle("display",""),g&&"ul"==g.getName()&&g.setStyle("display","")},mark:function(a){this.multiSelect||this.unmarkAll(); a=this._.items[a];var b=this.element.getDocument().getById(a);b.addClass("cke_selected");this.element.getDocument().getById(a+"_option").setAttribute("aria-selected",!0);this.onMark&&this.onMark(b)},markFirstDisplayed:function(){var a=this;this._.markFirstDisplayed(function(){a.multiSelect||a.unmarkAll()})},unmark:function(a){var b=this.element.getDocument();a=this._.items[a];var c=b.getById(a);c.removeClass("cke_selected");b.getById(a+"_option").removeAttribute("aria-selected");this.onUnmark&&this.onUnmark(c)}, unmarkAll:function(){var a=this._.items,b=this.element.getDocument(),c;for(c in a){var g=a[c];b.getById(g).removeClass("cke_selected");b.getById(g+"_option").removeAttribute("aria-selected")}this.onUnmark&&this.onUnmark()},isMarked:function(a){return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")},focus:function(a){this._.focusIndex=-1;var b=this.element.getElementsByTag("a"),c,g=-1;if(a)for(c=this.element.getDocument().getById(this._.items[a]).getFirst();a=b.getItem(++g);){if(a.equals(c)){this._.focusIndex= g;break}}else this.element.focus();c&&setTimeout(function(){c.focus()},0)}}})}}),CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler)}}),function(){var a='\x3cspan id\x3d"{id}" class\x3d"cke_combo cke_combo__{name} {cls}" role\x3d"presentation"\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_combo_label"\x3e{label}\x3c/span\x3e\x3ca class\x3d"cke_combo_button" title\x3d"{title}" tabindex\x3d"-1"'+ (CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-haspopup\x3d"listbox"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(a+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(a+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var a=a+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" '+(CKEDITOR.env.ie? 'onclick\x3d"return false;" onmouseup':"onclick")+'\x3d"CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan id\x3d"{id}_text" class\x3d"cke_combo_text cke_combo_inlinelabel"\x3e{label}\x3c/span\x3e\x3cspan class\x3d"cke_combo_open"\x3e\x3cspan class\x3d"cke_combo_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":CKEDITOR.env.air?"\x26nbsp;":"")+"\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e"),f=CKEDITOR.addTemplate("combo",a);CKEDITOR.UI_RICHCOMBO="richcombo";CKEDITOR.ui.richCombo= CKEDITOR.tools.createClass({$:function(a){CKEDITOR.tools.extend(this,a,{canGroup:!1,title:a.label,modes:{wysiwyg:1},editorFocus:1});a=this.panel||{};delete this.panel;this.id=CKEDITOR.tools.getNextNumber();this.document=a.parent&&a.parent.getDocument()||CKEDITOR.document;a.className="cke_combopanel";a.block={multiSelect:a.multiSelect,attributes:a.attributes};a.toolbarRelated=!0;this._={panelDefinition:a,items:{},listeners:[]}},proto:{renderHtml:function(a){var c=[];this.render(a,c);return c.join("")}, render:function(a,c){function d(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var c=this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;a.readOnly&&!this.readOnly&&(c=CKEDITOR.TRISTATE_DISABLED);this.setState(c);this.setValue("");c!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var l=CKEDITOR.env,k="cke_"+this.id,g=CKEDITOR.tools.addFunction(function(c){q&&(a.unlockSelection(1),q=0);m.execute(c)},this),h=this,m={id:k,combo:this,focus:function(){CKEDITOR.document.getById(k).getChild(1).focus()}, execute:function(c){var d=h._;if(d.state!=CKEDITOR.TRISTATE_DISABLED)if(h.createPanel(a),d.on)d.panel.hide();else{h.commit();var e=h.getValue();e?d.list.mark(e):d.list.unmarkAll();d.panel.showBlock(h.id,new CKEDITOR.dom.element(c),4)}},clickFn:g};this._.listeners.push(a.on("activeFilterChange",d,this));this._.listeners.push(a.on("mode",d,this));this._.listeners.push(a.on("selectionChange",d,this));!this.readOnly&&this._.listeners.push(a.on("readOnly",d,this));var e=CKEDITOR.tools.addFunction(function(a, b){a=new CKEDITOR.dom.event(a);var c=a.getKeystroke();switch(c){case 13:case 32:case 40:CKEDITOR.tools.callFunction(g,b);break;default:m.onkey(m,c)}a.preventDefault()}),n=CKEDITOR.tools.addFunction(function(){m.onfocus&&m.onfocus()}),q=0;m.keyDownFn=e;l={id:k,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:l.gecko&&!l.hc?"":(this.title||"").replace("'",""),keydownFn:e,focusFn:n,clickFn:g};f.output(l,c);if(this.onRender)this.onRender();return m},createPanel:function(a){if(!this._.panel){var c= this._.panelDefinition,d=this._.panelDefinition.block,f=c.parent||CKEDITOR.document.getBody(),k="cke_combopanel__"+this.name,g=new CKEDITOR.ui.floatPanel(a,f,c),c=g.addListBlock(this.id,d),h=this;g.onShow=function(){this.element.addClass(k);h.setState(CKEDITOR.TRISTATE_ON);h._.on=1;h.editorFocus&&!a.focusManager.hasFocus&&a.focus();if(h.onOpen)h.onOpen()};g.onHide=function(c){this.element.removeClass(k);h.setState(h.modes&&h.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);h._.on=0; if(!c&&h.onClose)h.onClose()};g.onEscape=function(){g.hide(1)};c.onClick=function(a,b){h.onClick&&h.onClick.call(h,a,b);g.hide()};this._.panel=g;this._.list=c;g.getBlock(this.id).onHide=function(){h._.on=0;h.setState(CKEDITOR.TRISTATE_OFF)};this.init&&this.init()}},setValue:function(a,c){this._.value=a;var d=this.document.getById("cke_"+this.id+"_text");d&&(a||c?d.removeClass("cke_combo_inlinelabel"):(c=this.label,d.addClass("cke_combo_inlinelabel")),d.setText("undefined"!=typeof c?c:a))},getValue:function(){return this._.value|| ""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(a){this._.list.mark(a)},hideItem:function(a){this._.list.hideItem(a)},hideGroup:function(a){this._.list.hideGroup(a)},showAll:function(){this._.list.showAll()},add:function(a,c,d){this._.items[a]=d||a;this._.list.add(a,c,d)},startGroup:function(a){this._.list.startGroup(a)},commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this));this._.committed=1},setState:function(a){if(this._.state!= a){var c=this.document.getById("cke_"+this.id);c.setState(a,"cke_combo");a==CKEDITOR.TRISTATE_DISABLED?c.setAttribute("aria-disabled",!0):c.removeAttribute("aria-disabled");this._.state=a}},getState:function(){return this._.state},enable:function(){this._.state==CKEDITOR.TRISTATE_DISABLED&&this.setState(this._.lastState)},disable:function(){this._.state!=CKEDITOR.TRISTATE_DISABLED&&(this._.lastState=this._.state,this.setState(CKEDITOR.TRISTATE_DISABLED))},destroy:function(){CKEDITOR.tools.array.forEach(this._.listeners, function(a){a.removeListener()});this._.listeners=[]}},statics:{handler:{create:function(a){return new CKEDITOR.ui.richCombo(a)}}}});CKEDITOR.ui.prototype.addRichCombo=function(a,c){this.add(a,CKEDITOR.UI_RICHCOMBO,c)}}(),CKEDITOR.plugins.add("format",{requires:"richcombo",init:function(a){if(!a.blockless){for(var f=a.config,b=a.lang.format,c=f.format_tags.split(";"),d={},l=0,k=[],g=0;gb&&aI.version?" ":R,g=a.hotNode&&a.hotNode.getText()==d&&a.element.equals(a.hotNode)&&a.lastCmdDirection===!!c;h(a,function(d){g&&a.hotNode&&a.hotNode.remove();d[c?"insertAfter":"insertBefore"](b);d.setAttributes({"data-cke-magicline-hot":1, "data-cke-magicline-dir":!!c});a.lastCmdDirection=!!c});I.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();a.line.detach()}return function(g){g=g.getSelection().getStartElement();var f;g=g.getAscendant(U,1);if(!p(a,g)&&g&&!g.equals(a.editable)&&!g.contains(a.editable)){(f=k(g))&&"false"==f.getAttribute("contenteditable")&&(g=f);a.element=g;f=d(a,g,!c);var h;n(f)&&f.is(a.triggers)&&f.is(X)&&(!d(a,f,!c)||(h=d(a,f,!c))&&n(h)&&h.is(a.triggers))?e(f):(h=b(a,g),n(h)&&(d(a,h,!c)?(g=d(a,h,!c))&& n(g)&&g.is(a.triggers)&&e(h):e(h)))}}}()}}function e(a,b){if(!b||b.type!=CKEDITOR.NODE_ELEMENT||!b.$)return!1;var c=a.line;return c.wrap.equals(b)||c.wrap.contains(b)}function n(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.$}function q(a){if(!n(a))return!1;var b;(b=y(a))||(n(a)?(b={left:1,right:1,center:1},b=!(!b[a.getComputedStyle("float")]&&!b[a.getAttribute("align")])):b=!1);return b}function y(a){return!!{absolute:1,fixed:1}[a.getComputedStyle("position")]}function u(a,b){return n(b)?b.is(a.triggers): null}function p(a,b){if(!b)return!1;for(var c=b.getParents(1),d=c.length;d--;)for(var e=a.tabuList.length;e--;)if(c[d].hasAttribute(a.tabuList[e]))return!0;return!1}function v(a,b,c){b=b[c?"getLast":"getFirst"](function(b){return a.isRelevant(b)&&!b.is(ha)});if(!b)return!1;t(a,b);return c?b.size.top>a.mouse.y:b.size.bottom(a.inInlineMode?d.editable.top+d.editable.height/2:Math.min(d.editable.height,d.pane.height)/ 2),b=b[h?"getLast":"getFirst"](function(a){return!(P(a)||S(a))});if(!b)return null;e(a,b)&&(b=a.line.wrap[h?"getPrevious":"getNext"](function(a){return!(P(a)||S(a))}));if(!n(b)||q(b)||!u(a,b))return null;t(a,b);return!h&&0<=b.size.top&&l(c.y,0,b.size.top+g)?(a=a.inInlineMode||0===d.scroll.y?O:W,new f([null,b,G,Q,a])):h&&b.size.bottom<=d.pane.height&&l(c.y,b.size.bottom-g,d.pane.height)?(a=a.inInlineMode||l(b.size.bottom,d.pane.height-g,d.pane.height)?K:W,new f([b,null,D,Q,a])):null}function r(a){var c= a.mouse,e=a.view,g=a.triggerOffset,h=b(a);if(!h)return null;t(a,h);var g=Math.min(g,0|h.size.outerHeight/2),k=[],m,r;if(l(c.y,h.size.top-1,h.size.top+g))r=!1;else if(l(c.y,h.size.bottom-g,h.size.bottom+1))r=!0;else return null;if(q(h)||v(a,h,r)||h.getParent().is(Z))return null;var M=d(a,h,!r);if(M){if(M&&M.type==CKEDITOR.NODE_TEXT)return null;if(n(M)){if(q(M)||!u(a,M)||M.getParent().is(Z))return null;k=[M,h][r?"reverse":"concat"]().concat([N,Q])}}else h.equals(a.editable[r?"getLast":"getFirst"](a.isRelevant))? (x(a),r&&l(c.y,h.size.bottom-g,e.pane.height)&&l(h.size.bottom,e.pane.height-g,e.pane.height)?m=K:l(c.y,0,h.size.top+g)&&(m=O)):m=W,k=[null,h][r?"reverse":"concat"]().concat([r?D:G,Q,m,h.equals(a.editable[r?"getLast":"getFirst"](a.isRelevant))?r?K:O:W]);return 0 in k?new f(k):null}function z(a,b,c,d){for(var e=b.getDocumentPosition(),g={},f={},h={},k={},l=Y.length;l--;)g[Y[l]]=parseInt(b.getComputedStyle.call(b,"border-"+Y[l]+"-width"),10)||0,h[Y[l]]=parseInt(b.getComputedStyle.call(b,"padding-"+ Y[l]),10)||0,f[Y[l]]=parseInt(b.getComputedStyle.call(b,"margin-"+Y[l]),10)||0;c&&!d||A(a,d);k.top=e.y-(c?0:a.view.scroll.y);k.left=e.x-(c?0:a.view.scroll.x);k.outerWidth=b.$.offsetWidth;k.outerHeight=b.$.offsetHeight;k.height=k.outerHeight-(h.top+h.bottom+g.top+g.bottom);k.width=k.outerWidth-(h.left+h.right+g.left+g.right);k.bottom=k.top+k.outerHeight;k.right=k.left+k.outerWidth;a.inInlineMode&&(k.scroll={top:b.$.scrollTop,left:b.$.scrollLeft});return C({border:g,padding:h,margin:f,ignoreScroll:c}, k,!0)}function t(a,b,c){if(!n(b))return b.size=null;if(!b.size)b.size={};else if(b.size.ignoreScroll==c&&b.size.date>new Date-ba)return null;return C(b.size,z(a,b,c),{date:+new Date},!0)}function x(a,b){a.view.editable=z(a,a.editable,b,!0)}function A(a,b){a.view||(a.view={});var c=a.view;if(!(!b&&c&&c.date>new Date-ba)){var d=a.win,c=d.getScrollPosition(),d=d.getViewPaneSize();C(a.view,{scroll:{x:c.x,y:c.y,width:a.doc.$.documentElement.scrollWidth-d.width,height:a.doc.$.documentElement.scrollHeight- d.height},pane:{width:d.width,height:d.height,bottom:d.height+c.y},date:+new Date},!0)}}function B(a,b,c,d){for(var e=d,g=d,h=0,k=!1,l=!1,m=a.view.pane.height,n=a.mouse;n.y+hd.left-e.x&&cd.top-e.y&&bCKEDITOR.env.version,E=CKEDITOR.dtd,L={},G=128,D=64,N=32,Q=16, O=4,K=2,W=1,R=" ",Z=E.$listItem,ha=E.$tableContent,X=C({},E.$nonEditable,E.$empty),U=E.$block,ba=100,ca="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",V=ca+"border-color:transparent;display:block;border-style:solid;",M="\x3cspan\x3e"+R+"\x3c/span\x3e";L[CKEDITOR.ENTER_BR]="br";L[CKEDITOR.ENTER_P]="p";L[CKEDITOR.ENTER_DIV]="div";f.prototype={set:function(a,b,c){this.properties=a+b+(c||W);return this},is:function(a){return(this.properties& a)==a}};var aa=function(){function a(b,c){var d=b.$.elementFromPoint(c.x,c.y);return d&&d.nodeType?new CKEDITOR.dom.element(d):null}return function(b,c,d){if(!b.mouse)return null;var g=b.doc,f=b.line.wrap;d=d||b.mouse;var h=a(g,d);c&&e(b,h)&&(f.hide(),h=a(g,d),f.show());return!h||h.type!=CKEDITOR.NODE_ELEMENT||!h.$||I.ie&&9>I.version&&!b.boundary.equals(h)&&!b.boundary.contains(h)?null:h}}(),P=CKEDITOR.dom.walker.whitespaces(),S=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),T=function(){function b(e){var g= e.element,f,h,k;if(!n(g)||g.contains(e.editable)||g.isReadOnly())return null;k=B(e,function(a,b){return!b.equals(a)},function(a,b){return aa(a,!0,b)},g);f=k.upper;h=k.lower;if(a(e,f,h))return k.set(N,8);if(f&&g.contains(f))for(;!f.getParent().equals(g);)f=f.getParent();else f=g.getFirst(function(a){return d(e,a)});if(h&&g.contains(h))for(;!h.getParent().equals(g);)h=h.getParent();else h=g.getLast(function(a){return d(e,a)});if(!f||!h)return null;t(e,f);t(e,h);if(!l(e.mouse.y,f.size.top,h.size.bottom))return null; for(var g=Number.MAX_VALUE,m,r,M,q;h&&!h.equals(f)&&(r=f.getNext(e.isRelevant));)m=Math.abs(c(e,f,r)-e.mouse.y),m|<\/font>)/,l=/h.width&&(c.resize_minWidth=h.width);c.resize_minHeight> h.height&&(c.resize_minHeight=h.height);CKEDITOR.document.on("mousemove",f);CKEDITOR.document.on("mouseup",b);a.document&&(a.document.on("mousemove",f),a.document.on("mouseup",b));d.preventDefault&&d.preventDefault()});a.on("destroy",function(){CKEDITOR.tools.removeFunction(n)});a.on("uiSpace",function(b){if("bottom"==b.data.space){var c="";m&&!e&&(c=" cke_resizer_horizontal");!m&&e&&(c=" cke_resizer_vertical");var g='\x3cspan id\x3d"'+d+'" class\x3d"cke_resizer'+c+" cke_resizer_"+l+'" title\x3d"'+ CKEDITOR.tools.htmlEncode(a.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+n+', event)"\x3e'+("ltr"==l?"◢":"◣")+"\x3c/span\x3e";"ltr"==l&&"ltr"==c?b.data.html+=g:b.data.html=g+b.data.html}},a,null,100);a.on("maximize",function(b){a.ui.space("resizer")[b.data==CKEDITOR.TRISTATE_ON?"hide":"show"]()})}}}),CKEDITOR.plugins.add("menubutton",{requires:"button,menu",onLoad:function(){var a=function(a){var b=this._,c=b.menu;b.state!==CKEDITOR.TRISTATE_DISABLED&&(b.on&&c?c.hide():(b.previousState= b.state,c||(c=b.menu=new CKEDITOR.menu(a,{panel:{className:"cke_menu_panel",attributes:{"aria-label":a.lang.common.options}}}),c.onHide=CKEDITOR.tools.bind(function(){var c=this.command?a.getCommand(this.command).modes:this.modes;this.setState(!c||c[a.mode]?b.previousState:CKEDITOR.TRISTATE_DISABLED);b.on=0},this),this.onMenu&&c.addListener(this.onMenu)),this.setState(CKEDITOR.TRISTATE_ON),b.on=1,setTimeout(function(){c.show(CKEDITOR.document.getById(b.id),4)},0)))};CKEDITOR.ui.menuButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button, $:function(f){delete f.panel;this.base(f);this.hasArrow="menu";this.click=a},statics:{handler:{create:function(a){return new CKEDITOR.ui.menuButton(a)}}}})},beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_MENUBUTTON,CKEDITOR.ui.menuButton.handler)}}),CKEDITOR.UI_MENUBUTTON="menubutton","use strict",CKEDITOR.plugins.add("scayt",{requires:"menubutton,dialog",tabToOpen:null,dialogName:"scaytDialog",onLoad:function(a){"moono-lisa"==(CKEDITOR.skinName||a.config.skin)&&CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(this.path+ "skins/"+CKEDITOR.skin.name+"/scayt.css"));CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(this.path+"dialogs/dialog.css"))},init:function(a){var f=this,b=CKEDITOR.plugins.scayt;this.bindEvents(a);this.parseConfig(a);this.addRule(a);CKEDITOR.dialog.add(this.dialogName,CKEDITOR.getUrl(this.path+"dialogs/options.js"));this.addMenuItems(a);var c=a.lang.scayt,d=CKEDITOR.env;a.ui.add("Scayt",CKEDITOR.UI_MENUBUTTON,{label:c.text_title,title:a.plugins.wsc?a.lang.wsc.title:c.text_title,modes:{wysiwyg:!(d.ie&& (8>d.version||d.quirks))},toolbar:"spellchecker,20",refresh:function(){var c=a.ui.instances.Scayt.getState();a.scayt&&(c=b.state.scayt[a.name]?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF);a.fire("scaytButtonState",c)},onRender:function(){var b=this;a.on("scaytButtonState",function(a){void 0!==typeof a.data&&b.setState(a.data)})},onMenu:function(){var c=a.scayt;a.getMenuItem("scaytToggle").label=a.lang.scayt[c&&b.state.scayt[a.name]?"btn_disable":"btn_enable"];var d={scaytToggle:CKEDITOR.TRISTATE_OFF, scaytOptions:c?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytLangs:c?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytDict:c?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytAbout:c?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,WSC:a.plugins.wsc?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED};a.config.scayt_uiTabs[0]||delete d.scaytOptions;a.config.scayt_uiTabs[1]||delete d.scaytLangs;a.config.scayt_uiTabs[2]||delete d.scaytDict;c&&!CKEDITOR.plugins.scayt.isNewUdSupported(c)&& (delete d.scaytDict,a.config.scayt_uiTabs[2]=0,CKEDITOR.plugins.scayt.alarmCompatibilityMessage());return d}});a.contextMenu&&a.addMenuItems&&(a.contextMenu.addListener(function(b,c){var d=a.scayt,h,m;d&&(m=d.getSelectionNode())&&(h=f.menuGenerator(a,m),d.showBanner("."+a.contextMenu._.definition.panel.className.split(" ").join(" .")));return h}),a.contextMenu._.onHide=CKEDITOR.tools.override(a.contextMenu._.onHide,function(b){return function(){var c=a.scayt;c&&c.hideBanner();return b.apply(this)}}))}, addMenuItems:function(a){var f=this,b=CKEDITOR.plugins.scayt;a.addMenuGroup("scaytButton");for(var c=a.config.scayt_contextMenuItemsOrder.split("|"),d=0;da.config.scayt_maxSuggestions)a.config.scayt_maxSuggestions=3;if(void 0===a.config.scayt_minWordLength||"number"!=typeof a.config.scayt_minWordLength||1>a.config.scayt_minWordLength)a.config.scayt_minWordLength=3;if(void 0===a.config.scayt_customDictionaryIds||"string"!==typeof a.config.scayt_customDictionaryIds)a.config.scayt_customDictionaryIds="";if(void 0=== a.config.scayt_userDictionaryName||"string"!==typeof a.config.scayt_userDictionaryName)a.config.scayt_userDictionaryName=null;if("string"===typeof a.config.scayt_uiTabs&&3===a.config.scayt_uiTabs.split(",").length){var b=[],c=[];a.config.scayt_uiTabs=a.config.scayt_uiTabs.split(",");CKEDITOR.tools.search(a.config.scayt_uiTabs,function(a){1===Number(a)||0===Number(a)?(c.push(!0),b.push(Number(a))):c.push(!1)});null===CKEDITOR.tools.search(c,!1)?a.config.scayt_uiTabs=b:a.config.scayt_uiTabs=[1,1,1]}else a.config.scayt_uiTabs= [1,1,1];"string"!=typeof a.config.scayt_serviceProtocol&&(a.config.scayt_serviceProtocol=null);"string"!=typeof a.config.scayt_serviceHost&&(a.config.scayt_serviceHost=null);"string"!=typeof a.config.scayt_servicePort&&(a.config.scayt_servicePort=null);"string"!=typeof a.config.scayt_servicePath&&(a.config.scayt_servicePath=null);a.config.scayt_moreSuggestions||(a.config.scayt_moreSuggestions="on");"string"!==typeof a.config.scayt_customerId&&(a.config.scayt_customerId="1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2"); "string"!==typeof a.config.scayt_customPunctuation&&(a.config.scayt_customPunctuation="-");"string"!==typeof a.config.scayt_srcUrl&&(f=document.location.protocol,f=-1!=f.search(/https?:/)?f:"http:",a.config.scayt_srcUrl=f+"//svc.webspellchecker.net/spellcheck31/wscbundle/wscbundle.js");"boolean"!==typeof CKEDITOR.config.scayt_handleCheckDirty&&(CKEDITOR.config.scayt_handleCheckDirty=!0);"boolean"!==typeof CKEDITOR.config.scayt_handleUndoRedo&&(CKEDITOR.config.scayt_handleUndoRedo=!0);CKEDITOR.config.scayt_handleUndoRedo= CKEDITOR.plugins.undo?CKEDITOR.config.scayt_handleUndoRedo:!1;"boolean"!==typeof a.config.scayt_multiLanguageMode&&(a.config.scayt_multiLanguageMode=!1);"object"!==typeof a.config.scayt_multiLanguageStyles&&(a.config.scayt_multiLanguageStyles={});a.config.scayt_ignoreAllCapsWords&&"boolean"!==typeof a.config.scayt_ignoreAllCapsWords&&(a.config.scayt_ignoreAllCapsWords=!1);a.config.scayt_ignoreDomainNames&&"boolean"!==typeof a.config.scayt_ignoreDomainNames&&(a.config.scayt_ignoreDomainNames=!1);a.config.scayt_ignoreWordsWithMixedCases&& "boolean"!==typeof a.config.scayt_ignoreWordsWithMixedCases&&(a.config.scayt_ignoreWordsWithMixedCases=!1);a.config.scayt_ignoreWordsWithNumbers&&"boolean"!==typeof a.config.scayt_ignoreWordsWithNumbers&&(a.config.scayt_ignoreWordsWithNumbers=!1);if(a.config.scayt_disableOptionsStorage){var f=CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage)?a.config.scayt_disableOptionsStorage:"string"===typeof a.config.scayt_disableOptionsStorage?[a.config.scayt_disableOptionsStorage]:void 0,d="all options lang ignore-all-caps-words ignore-domain-names ignore-words-with-mixed-cases ignore-words-with-numbers".split(" "), l=["lang","ignore-all-caps-words","ignore-domain-names","ignore-words-with-mixed-cases","ignore-words-with-numbers"],k=CKEDITOR.tools.search,g=CKEDITOR.tools.indexOf;a.config.scayt_disableOptionsStorage=function(a){for(var b=[],c=0;ca.config.scayt_cacheSize)a.config.scayt_cacheSize=4E3},addRule:function(a){var f=CKEDITOR.plugins.scayt,b=a.dataProcessor,c=b&&b.htmlFilter,d=a._.elementsPath&&a._.elementsPath.filters,b=b&&b.dataFilter,l=a.addRemoveFormatFilter,k=function(b){if(a.scayt&&(b.hasAttribute(f.options.data_attribute_name)||b.hasAttribute(f.options.problem_grammar_data_attribute)))return!1},g=function(b){var c= !0;a.scayt&&(b.hasAttribute(f.options.data_attribute_name)||b.hasAttribute(f.options.problem_grammar_data_attribute))&&(c=!1);return c};d&&d.push(k);b&&b.addRules({elements:{span:function(a){var b=a.hasClass(f.options.misspelled_word_class)&&a.attributes[f.options.data_attribute_name],c=a.hasClass(f.options.problem_grammar_class)&&a.attributes[f.options.problem_grammar_data_attribute];f&&(b||c)&&delete a.name;return a}}});c&&c.addRules({elements:{span:function(a){var b=a.hasClass(f.options.misspelled_word_class)&& a.attributes[f.options.data_attribute_name],c=a.hasClass(f.options.problem_grammar_class)&&a.attributes[f.options.problem_grammar_data_attribute];f&&(b||c)&&delete a.name;return a}}});l&&l.call(a,g)},scaytMenuDefinition:function(a){var f=this,b=CKEDITOR.plugins.scayt;a=a.scayt;return{scayt:{scayt_ignore:{label:a.getLocal("btn_ignore"),group:"scayt_control",order:1,exec:function(a){a.scayt.ignoreWord()}},scayt_ignoreall:{label:a.getLocal("btn_ignoreAll"),group:"scayt_control",order:2,exec:function(a){a.scayt.ignoreAllWords()}}, scayt_add:{label:a.getLocal("btn_addWord"),group:"scayt_control",order:3,exec:function(a){var b=a.scayt;setTimeout(function(){b.addWordToUserDictionary()},10)}},scayt_option:{label:a.getLocal("btn_options"),group:"scayt_control",order:4,exec:function(a){a.scayt.tabToOpen="options";b.openDialog(f.dialogName,a)},verification:function(a){return 1==a.config.scayt_uiTabs[0]?!0:!1}},scayt_language:{label:a.getLocal("btn_langs"),group:"scayt_control",order:5,exec:function(a){a.scayt.tabToOpen="langs";b.openDialog(f.dialogName, a)},verification:function(a){return 1==a.config.scayt_uiTabs[1]?!0:!1}},scayt_dictionary:{label:a.getLocal("btn_dictionaries"),group:"scayt_control",order:6,exec:function(a){a.scayt.tabToOpen="dictionaries";b.openDialog(f.dialogName,a)},verification:function(a){return 1==a.config.scayt_uiTabs[2]?!0:!1}},scayt_about:{label:a.getLocal("btn_about"),group:"scayt_control",order:7,exec:function(a){a.scayt.tabToOpen="about";b.openDialog(f.dialogName,a)}}},grayt:{grayt_problemdescription:{label:"Grammar problem description", group:"grayt_description",order:1,state:CKEDITOR.TRISTATE_DISABLED,exec:function(a){}},grayt_ignore:{label:a.getLocal("btn_ignore"),group:"grayt_control",order:2,exec:function(a){a.scayt.ignorePhrase()}},grayt_ignoreall:{label:a.getLocal("btn_ignoreAll"),group:"grayt_control",order:3,exec:function(a){a.scayt.ignoreAllPhrases()}}}}},buildSuggestionMenuItems:function(a,f,b){var c={},d={},l=b?"word":"phrase",k=b?"startGrammarCheck":"startSpellCheck",g=a.scayt;if(0=parseInt(f)*Math.pow(10,b)}return f?Array(7).join(String.fromCharCode(8203)):String.fromCharCode(8203)}()}],state:{scayt:{},grayt:{}},warningCounter:0,suggestions:[],options:{disablingCommandExec:{source:!0,newpage:!0,templates:!0},data_attribute_name:"data-scayt-word",misspelled_word_class:"scayt-misspell-word",problem_grammar_data_attribute:"data-grayt-phrase",problem_grammar_class:"gramm-problem"},backCompatibilityMap:{scayt_service_protocol:"scayt_serviceProtocol",scayt_service_host:"scayt_serviceHost", scayt_service_port:"scayt_servicePort",scayt_service_path:"scayt_servicePath",scayt_customerid:"scayt_customerId"},openDialog:function(a,f){var b=f.scayt;b.isAllModulesReady&&!1===b.isAllModulesReady()||(f.lockSelection(),f.openDialog(a))},alarmCompatibilityMessage:function(){5>this.warningCounter&&(console.warn("You are using the latest version of SCAYT plugin for CKEditor with the old application version. In order to have access to the newest features, it is recommended to upgrade the application version to latest one as well. Contact us for more details at support@webspellchecker.net."), this.warningCounter+=1)},isNewUdSupported:function(a){return a.getUserDictionary?!0:!1},reloadMarkup:function(a){var f;a&&(f=a.getScaytLangList(),a.reloadMarkup?a.reloadMarkup():(this.alarmCompatibilityMessage(),f&&f.ltr&&f.rtl&&a.fire("startSpellCheck, startGrammarCheck")))},replaceOldOptionsNames:function(a){for(var f in a)f in this.backCompatibilityMap&&(a[this.backCompatibilityMap[f]]=a[f],delete a[f])},createScayt:function(a){var f=this,b=CKEDITOR.plugins.scayt;this.loadScaytLibrary(a,function(a){function d(a){return new SCAYT.CKSCAYT(a, function(){},function(){})}var l;a.window&&(l="BODY"==a.editable().$.nodeName?a.window.getFrame():a.editable());if(l){l={lang:a.config.scayt_sLang,container:l.$,customDictionary:a.config.scayt_customDictionaryIds,userDictionaryName:a.config.scayt_userDictionaryName,localization:a.langCode,customer_id:a.config.scayt_customerId,customPunctuation:a.config.scayt_customPunctuation,debug:a.config.scayt_debug,data_attribute_name:f.options.data_attribute_name,misspelled_word_class:f.options.misspelled_word_class, problem_grammar_data_attribute:f.options.problem_grammar_data_attribute,problem_grammar_class:f.options.problem_grammar_class,"options-to-restore":a.config.scayt_disableOptionsStorage,focused:a.editable().hasFocus,ignoreElementsRegex:a.config.scayt_elementsToIgnore,ignoreGraytElementsRegex:a.config.grayt_elementsToIgnore,minWordLength:a.config.scayt_minWordLength,multiLanguageMode:a.config.scayt_multiLanguageMode,multiLanguageStyles:a.config.scayt_multiLanguageStyles,graytAutoStartup:a.config.grayt_autoStartup, disableCache:a.config.scayt_disableCache,cacheSize:a.config.scayt_cacheSize,charsToObserve:b.charsToObserve};a.config.scayt_serviceProtocol&&(l.service_protocol=a.config.scayt_serviceProtocol);a.config.scayt_serviceHost&&(l.service_host=a.config.scayt_serviceHost);a.config.scayt_servicePort&&(l.service_port=a.config.scayt_servicePort);a.config.scayt_servicePath&&(l.service_path=a.config.scayt_servicePath);"boolean"===typeof a.config.scayt_ignoreAllCapsWords&&(l["ignore-all-caps-words"]=a.config.scayt_ignoreAllCapsWords); "boolean"===typeof a.config.scayt_ignoreDomainNames&&(l["ignore-domain-names"]=a.config.scayt_ignoreDomainNames);"boolean"===typeof a.config.scayt_ignoreWordsWithMixedCases&&(l["ignore-words-with-mixed-cases"]=a.config.scayt_ignoreWordsWithMixedCases);"boolean"===typeof a.config.scayt_ignoreWordsWithNumbers&&(l["ignore-words-with-numbers"]=a.config.scayt_ignoreWordsWithNumbers);var k;try{k=d(l)}catch(g){f.alarmCompatibilityMessage(),delete l.charsToObserve,k=d(l)}k.subscribe("suggestionListSend", function(a){for(var b={},c=[],d=0;d=parseInt(a.getAttribute("border"),10))&&a.addClass("cke_show_border")})},afterInit:function(a){var b=a.dataProcessor;a=b&&b.dataFilter;b=b&&b.htmlFilter;a&&a.addRules({elements:{table:function(a){a=a.attributes;var b=a["class"],f=parseInt(a.border,10);f&&!(0>=f)||b&&-1!=b.indexOf("cke_show_border")||(a["class"]=(b||"")+" cke_show_border")}}});b&&b.addRules({elements:{table:function(a){a=a.attributes;var b=a["class"];b&&(a["class"]=b.replace("cke_show_border","").replace(/\s{2}/," ").replace(/^\s+|\s+$/, ""))}}})}});CKEDITOR.on("dialogDefinition",function(a){var b=a.data.name;if("table"==b||"tableProperties"==b)if(a=a.data.definition,b=a.getContents("info").get("txtBorder"),b.commit=CKEDITOR.tools.override(b.commit,function(a){return function(b,f){a.apply(this,arguments);var k=parseInt(this.getValue(),10);f[!k||0>=k?"addClass":"removeClass"]("cke_show_border")}}),a=(a=a.getContents("advanced"))&&a.get("advCSSClasses"))a.setup=CKEDITOR.tools.override(a.setup,function(a){return function(){a.apply(this, arguments);this.setValue(this.getValue().replace(/cke_show_border/,""))}}),a.commit=CKEDITOR.tools.override(a.commit,function(a){return function(b,f){a.apply(this,arguments);parseInt(f.getAttribute("border"),10)||f.addClass("cke_show_border")}})})}(),function(){CKEDITOR.plugins.add("sourcearea",{init:function(f){function b(){var a=d&&this.equals(CKEDITOR.document.getActive());this.hide();this.setStyle("height",this.getParent().$.clientHeight+"px");this.setStyle("width",this.getParent().$.clientWidth+ "px");this.show();a&&this.focus()}if(f.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var c=CKEDITOR.plugins.sourcearea;f.addMode("source",function(c){var d=f.ui.space("contents").getDocument().createElement("textarea");d.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",f.config.sourceAreaTabSize||4)));d.setAttribute("dir","ltr");d.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu"); f.ui.space("contents").append(d);d=f.editable(new a(f,d));d.setData(f.getData(1));CKEDITOR.env.ie&&(d.attachListener(f,"resize",b,d),d.attachListener(CKEDITOR.document.getWindow(),"resize",b,d),CKEDITOR.tools.setTimeout(b,0,d));f.fire("ariaWidget",this);c()});f.addCommand("source",c.commands.source);f.ui.addButton&&f.ui.addButton("Source",{label:f.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"});f.on("mode",function(){f.getCommand("source").setState("source"==f.mode?CKEDITOR.TRISTATE_ON: CKEDITOR.TRISTATE_OFF)});var d=CKEDITOR.env.ie&&9==CKEDITOR.env.version}}});var a=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(a){this.setValue(a);this.status="ready";this.editor.fire("dataReady")},getData:function(){return this.getValue()},insertHtml:function(){},insertElement:function(){},insertText:function(){},setReadOnly:function(a){this[(a?"set":"remove")+"Attribute"]("readOnly","readonly")},detach:function(){a.baseProto.detach.call(this);this.clearCustomData(); this.remove()}}})}(),CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(a){"wysiwyg"==a.mode&&a.fire("saveSnapshot");a.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);a.setMode("source"==a.mode?"wysiwyg":"source")},canUndo:!1}}},CKEDITOR.plugins.add("specialchar",{availableLangs:{af:1,ar:1,az:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,en:1,"en-au":1,"en-ca":1,"en-gb":1,eo:1,es:1,"es-mx":1,et:1,eu:1,fa:1,fi:1,fr:1,"fr-ca":1, gl:1,he:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,nb:1,nl:1,no:1,oc:1,pl:1,pt:1,"pt-br":1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,"sr-latn":1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},requires:"dialog",init:function(a){var f=this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js");a.addCommand("specialchar",{exec:function(){var b=a.langCode,b=f.availableLangs[b]?b:f.availableLangs[b.replace(/-.*/,"")]?b.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(f.path+ "dialogs/lang/"+b+".js"),function(){CKEDITOR.tools.extend(a.lang.specialchar,f.langEntries[b]);a.openDialog("specialchar")})},modes:{wysiwyg:1},canUndo:!1});a.ui.addButton&&a.ui.addButton("SpecialChar",{label:a.lang.specialchar.toolbar,command:"specialchar",toolbar:"insert,50"})}}),CKEDITOR.config.specialChars="! \x26quot; # $ % \x26amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; \x26lt; \x3d \x26gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x26euro; \x26lsquo; \x26rsquo; \x26ldquo; \x26rdquo; \x26ndash; \x26mdash; \x26iexcl; \x26cent; \x26pound; \x26curren; \x26yen; \x26brvbar; \x26sect; \x26uml; \x26copy; \x26ordf; \x26laquo; \x26not; \x26reg; \x26macr; \x26deg; \x26sup2; \x26sup3; \x26acute; \x26micro; \x26para; \x26middot; \x26cedil; \x26sup1; \x26ordm; \x26raquo; \x26frac14; \x26frac12; \x26frac34; \x26iquest; \x26Agrave; \x26Aacute; \x26Acirc; \x26Atilde; \x26Auml; \x26Aring; \x26AElig; \x26Ccedil; \x26Egrave; \x26Eacute; \x26Ecirc; \x26Euml; \x26Igrave; \x26Iacute; \x26Icirc; \x26Iuml; \x26ETH; \x26Ntilde; \x26Ograve; \x26Oacute; \x26Ocirc; \x26Otilde; \x26Ouml; \x26times; \x26Oslash; \x26Ugrave; \x26Uacute; \x26Ucirc; \x26Uuml; \x26Yacute; \x26THORN; \x26szlig; \x26agrave; \x26aacute; \x26acirc; \x26atilde; \x26auml; \x26aring; \x26aelig; \x26ccedil; \x26egrave; \x26eacute; \x26ecirc; \x26euml; \x26igrave; \x26iacute; \x26icirc; \x26iuml; \x26eth; \x26ntilde; \x26ograve; \x26oacute; \x26ocirc; \x26otilde; \x26ouml; \x26divide; \x26oslash; \x26ugrave; \x26uacute; \x26ucirc; \x26uuml; \x26yacute; \x26thorn; \x26yuml; \x26OElig; \x26oelig; \x26#372; \x26#374 \x26#373 \x26#375; \x26sbquo; \x26#8219; \x26bdquo; \x26hellip; \x26trade; \x26#9658; \x26bull; \x26rarr; \x26rArr; \x26hArr; \x26diams; \x26asymp;".split(" "), function(){CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(a){var f=a.config,b=a.lang.stylescombo,c={},d=[],l=[];a.on("stylesSet",function(b){if(b=b.data.styles){for(var g,h,m,e=0,n=b.length;e=b)for(g=this.getNextSourceNode(a,CKEDITOR.NODE_ELEMENT);g;){if(g.isVisible()&&0===g.getTabIndex()){l=g;break}g=g.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT)}else for(g=this.getDocument().getBody().getFirst();g=g.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!c)if(!d&&g.equals(this)){if(d=!0,a){if(!(g=g.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;c=1}}else d&&!this.contains(g)&&(c=1);if(g.isVisible()&&!(0>(h=g.getTabIndex()))){if(c&&h==b){l= g;break}h>b&&(!l||!k||h(g=h.getTabIndex())))if(0>=b){if(c&&0===g){l=h;break}g>k&& (l=h,k=g)}else{if(c&&g==b){l=h;break}gk)&&(l=h,k=g)}}l&&l.focus()},CKEDITOR.plugins.add("table",{requires:"dialog",init:function(a){function f(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,b){this.setState(b.contains("table",1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}if(!a.blockless){var b=a.lang.table;a.addCommand("table",new CKEDITOR.dialogCommand("table",{context:"table",allowedContent:"table{width,height,border-collapse}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];td{border*,background-color,vertical-align,width,height}[colspan,rowspan];"+ (a.plugins.dialogadvtab?"table"+a.plugins.dialogadvtab.allowedContent():""),requiredContent:"table",contentTransformations:[["table{width}: sizeToStyle","table[width]: sizeToAttribute"],["td: splitBorderShorthand"],[{element:"table",right:function(a){if(a.styles){var b;if(a.styles.border)b=CKEDITOR.tools.style.parse.border(a.styles.border);else if(CKEDITOR.env.ie&&8===CKEDITOR.env.version){var f=a.styles;f["border-left"]&&f["border-left"]===f["border-right"]&&f["border-right"]===f["border-top"]&& f["border-top"]===f["border-bottom"]&&(b=CKEDITOR.tools.style.parse.border(f["border-top"]))}b&&b.style&&"solid"===b.style&&b.width&&0!==parseFloat(b.width)&&(a.attributes.border=1);"collapse"==a.styles["border-collapse"]&&(a.attributes.cellspacing=0)}}}]]}));a.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",f()));a.addCommand("tableDelete",f({exec:function(a){var b=a.elementPath().contains("table",1);if(b){var f=b.getParent(),k=a.editable();1!=f.getChildCount()||f.is("td", "th")||f.equals(k)||(b=f);a=a.createRange();a.moveToPosition(b,CKEDITOR.POSITION_BEFORE_START);b.remove();a.select()}}}));a.ui.addButton&&a.ui.addButton("Table",{label:b.toolbar,command:"table",toolbar:"insert,30"});CKEDITOR.dialog.add("table",this.path+"dialogs/table.js");CKEDITOR.dialog.add("tableProperties",this.path+"dialogs/table.js");a.addMenuItems&&a.addMenuItems({table:{label:b.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:b.deleteTable,command:"tableDelete",group:"table", order:1}});a.on("doubleclick",function(a){a.data.element.is("table")&&(a.data.dialog="tableProperties")});a.contextMenu&&a.contextMenu.addListener(function(){return{tabledelete:CKEDITOR.TRISTATE_OFF,table:CKEDITOR.TRISTATE_OFF}})}}}),function(){function a(a,b){function c(a){return b?b.contains(a)&&a.getAscendant("table",!0).equals(b):!0}function d(a){0d)d=g}return d}function l(b,c){for(var e=p(b)?b:a(b),g=e[0].getAscendant("table"),f=d(e,1),e=d(e),h=c?f:e,k=CKEDITOR.tools.buildTableMap(g),g=[],f=[],e=[],l=k.length,m=0;ml?new CKEDITOR.dom.element(h[0][l+1]):k&&-1!==h[0][k-1].cellIndex?new CKEDITOR.dom.element(h[0][k-1]):new CKEDITOR.dom.element(e.$.parentNode);m.length==b&&(d[0].moveToPosition(e,CKEDITOR.POSITION_AFTER_END),d[0].select(),e.remove());return k}function g(a,b){var c=a.getStartElement().getAscendant({td:1,th:1},!0);if(c){var d=c.clone();d.appendBogus();b?d.insertBefore(c):d.insertAfter(c)}}function h(b){if(b instanceof CKEDITOR.dom.selection){var c= b.getRanges(),d=a(b),e=d[0]&&d[0].getAscendant("table"),g;a:{var f=0;g=d.length-1;for(var k={},l,n;l=d[f++];)CKEDITOR.dom.element.setMarker(k,l,"delete_cell",!0);for(f=0;l=d[f++];)if((n=l.getPrevious())&&!n.getCustomData("delete_cell")||(n=l.getNext())&&!n.getCustomData("delete_cell")){CKEDITOR.dom.element.clearAllMarkers(k);g=n;break a}CKEDITOR.dom.element.clearAllMarkers(k);f=d[0].getParent();(f=f.getPrevious())?g=f.getLast():(f=d[g].getParent(),g=(f=f.getNext())?f.getChild(0):null)}b.reset();for(b= d.length-1;0<=b;b--)h(d[b]);g?m(g,!0):e&&(c[0].moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),c[0].select(),e.remove())}else b instanceof CKEDITOR.dom.element&&(c=b.getParent(),1==c.getChildCount()?c.remove():b.remove())}function m(a,b){var c=a.getDocument(),d=CKEDITOR.document;CKEDITOR.env.ie&&10==CKEDITOR.env.version&&(d.focus(),c.focus());c=new CKEDITOR.dom.range(c);c["moveToElementEdit"+(b?"End":"Start")](a)||(c.selectNodeContents(a),c.collapse(b?!1:!0));c.select(!0)}function e(a,b,c){a=a[b]; if("undefined"==typeof c)return a;for(b=0;a&&bg.length)||(f=b.getCommonAncestor())&&f.type==CKEDITOR.NODE_ELEMENT&&f.is("table"))return!1;var h;b=g[0];f=b.getAscendant("table");var k=CKEDITOR.tools.buildTableMap(f),l=k.length,m=k[0].length,n=b.getParent().$.rowIndex,q=e(k,n,b);if(c){var p;try{var u=parseInt(b.getAttribute("rowspan"),10)||1; h=parseInt(b.getAttribute("colspan"),10)||1;p=k["up"==c?n-u:"down"==c?n+u:n]["left"==c?q-h:"right"==c?q+h:q]}catch(y){return!1}if(!p||b.$==p)return!1;g["up"==c||"left"==c?"unshift":"push"](new CKEDITOR.dom.element(p))}c=b.getDocument();var L=n,u=p=0,G=!d&&new CKEDITOR.dom.documentFragment(c),D=0;for(c=0;c=m?b.removeAttribute("rowSpan"):b.$.rowSpan=p;p>=l?b.removeAttribute("colSpan"):b.$.colSpan=u;d=new CKEDITOR.dom.nodeList(f.$.rows);g=d.count();for(c=g-1;0<=c;c--)f=d.getItem(c),f.$.cells.length||(f.remove(),g++);return b} function q(b,c){var d=a(b);if(1l){g.insertBefore(new CKEDITOR.dom.element(q));break}else q=null;q||f.append(g)}else for(m=n=1,f=g.clone(),f.insertAfter(g),f.append(g=d.clone()), q=e(h,k),l=0;lc);n++){k[l+n]||(k[l+n]=[]);for(var q=0;q=d)break}}return k},function(){function a(a){return CKEDITOR.plugins.widget&&CKEDITOR.plugins.widget.isDomWidget(a)}function f(a, b){var c=a.getAscendant("table"),d=b.getAscendant("table"),e=CKEDITOR.tools.buildTableMap(c),g=m(a),f=m(b),h=[],k={},l,n;c.contains(d)&&(b=b.getAscendant({td:1,th:1}),f=m(b));g>f&&(c=g,g=f,f=c,c=a,a=b,b=c);for(c=0;cn&&(c=l,l=n,n=c);for(c=g;c<=f;c++)for(g=l;g<=n;g++)d=new CKEDITOR.dom.element(e[c][g]),d.$&&!d.getCustomData("selected_cell")&&(h.push(d),CKEDITOR.dom.element.setMarker(k,d,"selected_cell", !0));CKEDITOR.dom.element.clearAllMarkers(k);return h}function b(a){if(a)return a=a.clone(),a.enlarge(CKEDITOR.ENLARGE_ELEMENT),(a=a.getEnclosedNode())&&a.is&&a.is(CKEDITOR.dtd.$tableContent)}function c(a){return(a=a.editable().findOne(".cke_table-faked-selection"))&&a.getAscendant("table")}function d(a,b){var c=a.editable().find(".cke_table-faked-selection"),d=a.editable().findOne("[data-cke-table-faked-selection-table]"),e;a.fire("lockSnapshot");a.editable().removeClass("cke_table-faked-selection-editor"); for(e=0;eb.count()||(b=f(b.getItem(0),b.getItem(b.count()-1)), l(a,b))}function g(b,c,e){var g=r(b.getSelection(!0));c=c.is("table")?null:c;var h;(h=v.active&&!v.first)&&!(h=c)&&(h=b.getSelection().getRanges(),h=1CKEDITOR.env.version,l=a.blockless||CKEDITOR.env.ie?"span":"div",m,n,p,q;g.getById("cke_table_copybin")||(m=g.createElement(l),n=g.createElement(l),n.setAttributes({id:"cke_table_copybin","data-cke-temp":"1"}),m.setStyles({position:"absolute",width:"1px", height:"1px",overflow:"hidden"}),m.setStyle("ltr"==a.config.contentsLangDirection?"left":"right","-5000px"),m.setHtml(a.getSelectedHtml(!0)),a.fire("lockSnapshot"),n.append(m),a.editable().append(n),q=a.on("selectionChange",c,null,null,0),k&&(p=h.scrollTop),f.selectNodeContents(m),f.select(),k&&(h.scrollTop=p),setTimeout(function(){n.remove();d.selectBookmarks(e);q.removeListener();a.fire("unlockSnapshot");b&&(a.extractSelectedHtml(),a.fire("saveSnapshot"))},100))}function y(a){var b=a.editor||a.sender.editor, c=b.getSelection();c.isInTable()&&(c.getRanges()[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored")||q(b,"cut"===a.name))}function u(a){this._reset();a&&this.setSelectedCells(a)}function p(a,b,c){a.on("beforeCommandExec",function(c){-1!==CKEDITOR.tools.array.indexOf(b,c.data.name)&&(c.data.selectedCells=r(a.getSelection()))});a.on("afterCommandExec",function(d){-1!==CKEDITOR.tools.array.indexOf(b,d.data.name)&&c(a,d.data)})}var v={active:!1},w,r,z,t,x;u.prototype={};u.prototype._reset= function(){this.cells={first:null,last:null,all:[]};this.rows={first:null,last:null}};u.prototype.setSelectedCells=function(a){this._reset();a=a.slice(0);this._arraySortByDOMOrder(a);this.cells.all=a;this.cells.first=a[0];this.cells.last=a[a.length-1];this.rows.first=a[0].getAscendant("tr");this.rows.last=this.cells.last.getAscendant("tr")};u.prototype.getTableMap=function(){var a=z(this.cells.first),b;a:{b=this.cells.last;var c=b.getAscendant("table"),d=m(b),c=CKEDITOR.tools.buildTableMap(c),e;for(e= 0;e=a)return;for(var d=this.cells.first.$.cellIndex,e=this.cells.last.$.cellIndex,g=c?[]:this.cells.all,f,h=0;h=d&&a.$.cellIndex<=e}),g=b?f.concat(g):g.concat(f);this.setSelectedCells(g)};u.prototype.insertColumn=function(a){function b(a){a=m(a);return a>=e&&a<=g}if("undefined"===typeof a)a=1;else if(0>=a)return;for(var c=this.cells,d=c.all,e=m(c.first),g=m(c.last),c=0;cg)l[0].moveToElementEditablePosition(k?m:n,!k),h.selectRanges([l[0]]); else if(13!==g||13===f||f===CKEDITOR.SHIFT+13){for(e=0;eCKEDITOR.env.version)},onLoad:function(){w=CKEDITOR.plugins.tabletools;r=w.getSelectedCells;z=w.getCellColIndex;t=w.insertRow;x=w.insertColumn; CKEDITOR.document.appendStyleSheet(this.path+"styles/tableselection.css")},init:function(a){this.isSupportedEnvironment()&&(a.addContentsCss&&a.addContentsCss(this.path+"styles/tableselection.css"),a.on("contentDom",function(){var b=a.editable(),c=b.isInline()?b:a.document,d={editor:a};b.attachListener(c,"mousedown",e,null,d);b.attachListener(c,"mousemove",e,null,d);b.attachListener(c,"mouseup",e,null,d);b.attachListener(b,"dragstart",n);b.attachListener(a,"selectionCheck",h);CKEDITOR.plugins.tableselection.keyboardIntegration(a); CKEDITOR.plugins.clipboard&&!CKEDITOR.plugins.clipboard.isCustomCopyCutSupported&&(b.attachListener(b,"cut",y),b.attachListener(b,"copy",y))}),a.on("paste",A.onPaste,A),p(a,"rowInsertBefore rowInsertAfter columnInsertBefore columnInsertAfter cellInsertBefore cellInsertAfter".split(" "),function(a,b){l(a,b.selectedCells)}),p(a,["cellMerge","cellMergeRight","cellMergeDown"],function(a,b){l(a,[b.commandData.cell])}),p(a,["cellDelete"],function(a){d(a,!0)}))}})}(),"use strict",function(){var a=[CKEDITOR.CTRL+ 90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],f={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(c){function d(a){e.enabled&&!1!==a.data.command.canUndo&&e.save()}function f(){e.enabled=c.readOnly?!1:"wysiwyg"==c.mode;e.onChange()}var e=c.undoManager=new b(c),k=e.editingHandler=new l(e),q=c.addCommand("undo",{exec:function(){e.undo()&&(c.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),y=c.addCommand("redo",{exec:function(){e.redo()&&(c.selectionChange(),this.fire("afterRedo"))}, startDisabled:!0,canUndo:!1});c.setKeystroke([[a[0],"undo"],[a[1],"redo"],[a[2],"redo"]]);e.onChange=function(){q.setState(e.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);y.setState(e.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)};c.on("beforeCommandExec",d);c.on("afterCommandExec",d);c.on("saveSnapshot",function(a){e.save(a.data&&a.data.contentOnly)});c.on("contentDom",k.attachListeners,k);c.on("instanceReady",function(){c.fire("saveSnapshot")});c.on("beforeModeUnload", function(){"wysiwyg"==c.mode&&e.save(!0)});c.on("mode",f);c.on("readOnly",f);c.ui.addButton&&(c.ui.addButton("Undo",{label:c.lang.undo.undo,command:"undo",toolbar:"undo,10"}),c.ui.addButton("Redo",{label:c.lang.undo.redo,command:"redo",toolbar:"undo,20"}));c.resetUndo=function(){e.reset();c.fire("saveSnapshot")};c.on("updateSnapshot",function(){e.currentImage&&e.update()});c.on("lockSnapshot",function(a){a=a.data;e.lock(a&&a.dontUpdate,a&&a.forceUpdate)});c.on("unlockSnapshot",e.unlock,e)}});CKEDITOR.plugins.undo= {};var b=CKEDITOR.plugins.undo.UndoManager=function(a){this.strokesRecorded=[0,0];this.locked=null;this.previousKeyGroup=-1;this.limit=a.config.undoStackSize||20;this.strokesLimit=25;this.editor=a;this.reset()};b.prototype={type:function(a,c){var d=b.getKeyGroup(a),e=this.strokesRecorded[d]+1;c=c||e>=this.strokesLimit;this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange());c?(e=0,this.editor.fire("saveSnapshot")):this.editor.fire("change");this.strokesRecorded[d]=e;this.previousKeyGroup= d},keyGroupChanged:function(a){return b.getKeyGroup(a)!=this.previousKeyGroup},reset:function(){this.snapshots=[];this.index=-1;this.currentImage=null;this.hasRedo=this.hasUndo=!1;this.locked=null;this.resetType()},resetType:function(){this.strokesRecorded=[0,0];this.typing=!1;this.previousKeyGroup=-1},refreshState:function(){this.hasUndo=!!this.getNextImage(!0);this.hasRedo=!!this.getNextImage(!1);this.resetType();this.onChange()},save:function(a,b,d){var e=this.editor;if(this.locked||"ready"!=e.status|| "wysiwyg"!=e.mode)return!1;var f=e.editable();if(!f||"ready"!=f.status)return!1;f=this.snapshots;b||(b=new c(e));if(!1===b.contents)return!1;if(this.currentImage)if(b.equalsContent(this.currentImage)){if(a||b.equalsSelection(this.currentImage))return!1}else!1!==d&&e.fire("change");f.splice(this.index+1,f.length-this.index-1);f.length==this.limit&&f.shift();this.index=f.push(b)-1;this.currentImage=b;!1!==d&&this.refreshState();return!0},restoreImage:function(a){var b=this.editor,c;a.bookmarks&&(b.focus(), c=b.getSelection());this.locked={level:999};this.editor.loadSnapshot(a.contents);a.bookmarks?c.selectBookmarks(a.bookmarks):CKEDITOR.env.ie&&(c=this.editor.document.getBody().$.createTextRange(),c.collapse(!0),c.select());this.locked=null;this.index=a.index;this.currentImage=this.snapshots[this.index];this.update();this.refreshState();b.fire("change")},getNextImage:function(a){var b=this.snapshots,c=this.currentImage,d;if(c)if(a)for(d=this.index-1;0<=d;d--){if(a=b[d],!c.equalsContent(a))return a.index= d,a}else for(d=this.index+1;d=this.undoManager.strokesLimit&&(this.undoManager.type(a.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(a){var d=this.undoManager; a=a.data.getKey();var f=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(a);if(!(b.ieFunctionalKeysBug(a)&&this.lastKeydownImage&&this.lastKeydownImage.equalsContent(new c(d.editor,!0))))if(0=this.rect.right||a<=this.rect.top||a>=this.rect.bottom)&&this.hideVisible();(0>=b||b>=this.winTopPane.width||0>=a||a>=this.winTopPane.height)&&this.hideVisible()},this);c.attachListener(a,"resize",f);c.attachListener(a,"mode",k);a.on("destroy",k);this.lineTpl=(new CKEDITOR.template('\x3cdiv data-cke-lineutils-line\x3d"1" class\x3d"cke_reset_all" style\x3d"{lineStyle}"\x3e\x3cspan style\x3d"{tipLeftStyle}"\x3e\x26nbsp;\x3c/span\x3e\x3cspan style\x3d"{tipRightStyle}"\x3e\x26nbsp;\x3c/span\x3e\x3c/div\x3e')).output({lineStyle:CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({}, l,this.lineStyle,!0)),tipLeftStyle:CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({},d,{left:"0px","border-left-color":"red","border-width":"6px 0 6px 6px"},this.tipCss,this.tipLeftStyle,!0)),tipRightStyle:CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({},d,{right:"0px","border-right-color":"red","border-width":"6px 6px 6px 0"},this.tipCss,this.tipRightStyle,!0))})}function c(a){var b;if(b=a&&a.type==CKEDITOR.NODE_ELEMENT)b=!(k[a.getComputedStyle("float")]||k[a.getAttribute("align")]);return b&& !g[a.getComputedStyle("position")]}CKEDITOR.plugins.add("lineutils");CKEDITOR.LINEUTILS_BEFORE=1;CKEDITOR.LINEUTILS_AFTER=2;CKEDITOR.LINEUTILS_INSIDE=4;a.prototype={start:function(a){var b=this,c=this.editor,d=this.doc,f,g,k,l,v=CKEDITOR.tools.eventsBuffer(50,function(){c.readOnly||"wysiwyg"!=c.mode||(b.relations={},(g=d.$.elementFromPoint(k,l))&&g.nodeType&&(f=new CKEDITOR.dom.element(g),b.traverseSearch(f),isNaN(k+l)||b.pixelSearch(f,k,l),a&&a(b.relations,k,l)))});this.listener=this.editable.attachListener(this.target, "mousemove",function(a){k=a.data.$.clientX;l=a.data.$.clientY;v.input()});this.editable.attachListener(this.inline?this.editable:this.frame,"mouseout",function(){v.reset()})},stop:function(){this.listener&&this.listener.removeListener()},getRange:function(){var a={};a[CKEDITOR.LINEUTILS_BEFORE]=CKEDITOR.POSITION_BEFORE_START;a[CKEDITOR.LINEUTILS_AFTER]=CKEDITOR.POSITION_AFTER_END;a[CKEDITOR.LINEUTILS_INSIDE]=CKEDITOR.POSITION_AFTER_START;return function(b){var c=this.editor.createRange();c.moveToPosition(this.relations[b.uid].element, a[b.type]);return c}}(),store:function(){function a(b,c,d){var f=b.getUniqueId();f in d?d[f].type|=c:d[f]={element:b,type:c}}return function(b,d){var f;d&CKEDITOR.LINEUTILS_AFTER&&c(f=b.getNext())&&f.isVisible()&&(a(f,CKEDITOR.LINEUTILS_BEFORE,this.relations),d^=CKEDITOR.LINEUTILS_AFTER);d&CKEDITOR.LINEUTILS_INSIDE&&c(f=b.getFirst())&&f.isVisible()&&(a(f,CKEDITOR.LINEUTILS_BEFORE,this.relations),d^=CKEDITOR.LINEUTILS_INSIDE);a(b,d,this.relations)}}(),traverseSearch:function(a){var b,d,f;do if(f=a.$["data-cke-expando"], !(f&&f in this.relations)){if(a.equals(this.editable))break;if(c(a))for(b in this.lookups)(d=this.lookups[b](a))&&this.store(a,d)}while((!a||a.type!=CKEDITOR.NODE_ELEMENT||"true"!=a.getAttribute("contenteditable"))&&(a=a.getParent()))},pixelSearch:function(){function a(d,f,g,h,k){for(var l=0,v;k(g);){g+=h;if(25==++l)break;if(v=this.doc.$.elementFromPoint(f,g))if(v==d)l=0;else if(b(d,v)&&(l=0,c(v=new CKEDITOR.dom.element(v))))return v}}var b=CKEDITOR.env.ie||CKEDITOR.env.webkit?function(a,b){return a.contains(b)}: function(a,b){return!!(a.compareDocumentPosition(b)&16)};return function(b,d,f){var g=this.win.getViewPaneSize().height,k=a.call(this,b.$,d,f,-1,function(a){return 0this.rect.bottom)return!1;this.inline? f.left=c.elementRect.left-this.rect.relativeX:(0[^<]*e});0>f&&(f=a._.upcasts.length);a._.upcasts.splice(f,0,[CKEDITOR.tools.bind(b,c),c.name,e])}var e=b.upcast,f=b.upcastPriority||10;e&&("string"==typeof e?d(c, b,f):d(e,b,f))}function l(a,b){a.focused=null;if(b.isInited()){var c=b.editor.checkDirty();a.fire("widgetBlurred",{widget:b});b.setFocused(!1);!c&&b.editor.resetDirty()}}function k(a){a=a.data;if("wysiwyg"==this.editor.mode){var b=this.editor.editable(),c=this.instances,d,e,g,h;if(b){for(d in c)c[d].isReady()&&!b.contains(c[d].wrapper)&&this.destroy(c[d],!0);if(a&&a.initOnlyNew)c=this.initOnAll();else{var k=b.find(".cke_widget_wrapper"),c=[];d=0;for(e=k.count();dCKEDITOR.tools.indexOf(b,a)&&c.push(a);a=CKEDITOR.tools.indexOf(d,a);0<=a&&d.splice(a,1);return this},focus:function(a){e=a;return this}, commit:function(){var f=a.focused!==e,g,h;a.editor.fire("lockSnapshot");for(f&&(g=a.focused)&&l(a,g);g=d.pop();)b.splice(CKEDITOR.tools.indexOf(b,g),1),g.isInited()&&(h=g.editor.checkDirty(),g.setSelected(!1),!h&&g.editor.resetDirty());f&&e&&(h=a.editor.checkDirty(),a.focused=e,a.fire("widgetFocused",{widget:e}),e.setFocused(!0),!h&&a.editor.resetDirty());for(;g=c.pop();)b.push(g),g.setSelected(!0);a.editor.fire("unlockSnapshot")}}}function I(a,b,c){var d=0;b=L(b);var e=a.data.classes||{},f;if(b){for(e= CKEDITOR.tools.clone(e);f=b.pop();)c?e[f]||(d=e[f]=1):e[f]&&(delete e[f],d=1);d&&a.setData("classes",e)}}function J(a){a.cancel()}function E(a,b){var c=a.editor,d=c.document,e=CKEDITOR.env.edge&&16<=CKEDITOR.env.version;if(!d.getById("cke_copybin")){var f=!c.blockless&&!CKEDITOR.env.ie||e?"div":"span",e=d.createElement(f),g=d.createElement(f),f=CKEDITOR.env.ie&&9>CKEDITOR.env.version;g.setAttributes({id:"cke_copybin","data-cke-temp":"1"});e.setStyles({position:"absolute",width:"1px",height:"1px", overflow:"hidden"});e.setStyle("ltr"==c.config.contentsLangDirection?"left":"right","-5000px");var h=c.createRange();h.setStartBefore(a.wrapper);h.setEndAfter(a.wrapper);e.setHtml('\x3cspan data-cke-copybin-start\x3d"1"\x3e​\x3c/span\x3e'+c.editable().getHtmlFromRange(h).getHtml()+'\x3cspan data-cke-copybin-end\x3d"1"\x3e​\x3c/span\x3e');c.fire("saveSnapshot");c.fire("lockSnapshot");g.append(e);c.editable().append(g);var k=c.on("selectionChange",J,null,null,0),l=a.repository.on("checkSelection",J, null,null,0);if(f)var m=d.getDocumentElement().$,n=m.scrollTop;h=c.createRange();h.selectNodeContents(e);h.select();f&&(m.scrollTop=n);setTimeout(function(){b||a.focus();g.remove();k.removeListener();l.removeListener();c.fire("unlockSnapshot");b&&!c.readOnly&&(a.repository.del(a),c.fire("saveSnapshot"))},100)}}function L(a){return(a=(a=a.getDefinition().attributes)&&a["class"])?a.split(/\s+/):null}function G(){var a=CKEDITOR.document.getActive(),b=this.editor,c=b.editable();(c.isInline()?c:b.document.getWindow().getFrame()).equals(a)&& b.focusManager.focus(c)}function D(){CKEDITOR.env.gecko&&this.editor.unlockSelection();CKEDITOR.env.webkit||(this.editor.forceNextSelectionCheck(),this.editor.selectionChange(1))}function N(a){var b=null;a.on("data",function(){var a=this.data.classes,c;if(b!=a){for(c in b)a&&a[c]||this.removeClass(c);for(c in a)this.addClass(c);b=a}})}function Q(a){a.on("data",function(){if(a.wrapper){var b=this.getLabel?this.getLabel():this.editor.lang.widget.label.replace(/%1/,this.pathName||this.element.getName()); a.wrapper.setAttribute("role","region");a.wrapper.setAttribute("aria-label",b)}},null,null,9999)}function O(a){if(a.draggable){var b=a.editor,c=a.wrapper.getLast(f.isDomDragHandlerContainer),d;c?d=c.findOne("img"):(c=new CKEDITOR.dom.element("span",b.document),c.setAttributes({"class":"cke_reset cke_widget_drag_handler_container",style:"background:rgba(220,220,220,0.5);background-image:url("+b.plugins.widget.path+"images/handle.png)"}),d=new CKEDITOR.dom.element("img",b.document),d.setAttributes({"class":"cke_reset cke_widget_drag_handler", "data-cke-widget-drag-handler":"1",src:CKEDITOR.tools.transparentImageData,width:15,title:b.lang.widget.move,height:15,role:"presentation"}),a.inline&&d.setAttribute("draggable","true"),c.append(d),a.wrapper.append(c));a.wrapper.on("dragover",function(a){a.data.preventDefault()});a.wrapper.on("mouseenter",a.updateDragHandlerPosition,a);setTimeout(function(){a.on("data",a.updateDragHandlerPosition,a)},50);if(!a.inline&&(d.on("mousedown",K,a),CKEDITOR.env.ie&&9>CKEDITOR.env.version))d.on("dragstart", function(a){a.data.preventDefault(!0)});a.dragHandlerContainer=c}}function K(a){function b(){var c;for(p.reset();c=h.pop();)c.removeListener();var d=k;c=a.sender;var e=this.repository.finder,f=this.repository.liner,g=this.editor,l=this.editor.editable();CKEDITOR.tools.isEmpty(f.visible)||(d=e.getRange(d[0]),this.focus(),g.fire("drop",{dropRange:d,target:d.startContainer}));l.removeClass("cke_widget_dragging");f.hideVisible();g.fire("dragend",{target:c})}if(CKEDITOR.tools.getMouseButton(a)===CKEDITOR.MOUSE_BUTTON_LEFT){var c= this.repository.finder,d=this.repository.locator,e=this.repository.liner,f=this.editor,g=f.editable(),h=[],k=[],l,m;this.repository._.draggedWidget=this;var n=c.greedySearch(),p=CKEDITOR.tools.eventsBuffer(50,function(){l=d.locate(n);k=d.sort(m,1);k.length&&(e.prepare(n,l),e.placeLine(k[0]),e.cleanup())});g.addClass("cke_widget_dragging");h.push(g.on("mousemove",function(a){m=a.data.$.clientY;p.input()}));f.fire("dragstart",{target:a.sender});h.push(f.document.once("mouseup",b,this));g.isInline()|| h.push(CKEDITOR.document.once("mouseup",b,this))}}function W(a){var b,c,d=a.editables;a.editables={};if(a.editables)for(b in d)c=d[b],a.initEditable(b,"string"==typeof c?{selector:c}:c)}function R(a){if(a.mask){var b=a.wrapper.findOne(".cke_widget_mask");b||(b=new CKEDITOR.dom.element("img",a.editor.document),b.setAttributes({src:CKEDITOR.tools.transparentImageData,"class":"cke_reset cke_widget_mask"}),a.wrapper.append(b));a.mask=b}}function Z(a){if(a.parts){var b={},c,d;for(d in a.parts)c=a.wrapper.findOne(a.parts[d]), b[d]=c;a.parts=b}}function ha(a,b){X(a);Z(a);W(a);R(a);O(a);N(a);Q(a);if(CKEDITOR.env.ie&&9>CKEDITOR.env.version)a.wrapper.on("dragstart",function(b){var c=b.data.getTarget();f.getNestedEditable(a,c)||a.inline&&f.isDomDragHandler(c)||b.data.preventDefault()});a.wrapper.removeClass("cke_widget_new");a.element.addClass("cke_widget_element");a.on("key",function(b){b=b.data.keyCode;if(13==b)a.edit();else{if(b==CKEDITOR.CTRL+67||b==CKEDITOR.CTRL+88){E(a,b==CKEDITOR.CTRL+88);return}if(b in V||CKEDITOR.CTRL& b||CKEDITOR.ALT&b)return}return!1},null,null,999);a.on("doubleclick",function(b){a.edit()&&b.cancel()});if(b.data)a.on("data",b.data);if(b.edit)a.on("edit",b.edit)}function X(a){(a.wrapper=a.element.getParent()).setAttribute("data-cke-widget-id",a.id)}function U(a){a.element.data("cke-widget-data",encodeURIComponent(JSON.stringify(a.data)))}function ba(){function a(){}function b(a,c,d){return d&&this.checkElement(a)?(a=d.widgets.getByElement(a,!0))&&a.checkStyleActive(this):!1}function c(a){function b(a, c,d){for(var e=a.length,f=0;f)?(?:<(?:div|span)(?: style="[^"]+")?>)?]*data-cke-copybin-start="1"[^>]*>.?<\/span>([\s\S]+)]*data-cke-copybin-end="1"[^>]*>.?<\/span>(?:<\/(?:div|span)>)?(?:<\/(?:div|span)>)?$/i,V={37:1,38:1,39:1,40:1,8:1,46:1};V[CKEDITOR.SHIFT+121]=1;CKEDITOR.plugins.widget=f;f.repository=a;f.nestedEditable=b}(),function(){function a(a,c,d){this.editor= a;this.notification=null;this._message=new CKEDITOR.template(c);this._singularMessage=d?new CKEDITOR.template(d):null;this._tasks=[];this._doneTasks=this._doneWeights=this._totalWeights=0}function f(a){this._weight=a||1;this._doneWeight=0;this._isCanceled=!1}CKEDITOR.plugins.add("notificationaggregator",{requires:"notification"});a.prototype={createTask:function(a){a=a||{};var c=!this.notification,d;c&&(this.notification=this._createNotification());d=this._addTask(a);d.on("updated",this._onTaskUpdate, this);d.on("done",this._onTaskDone,this);d.on("canceled",function(){this._removeTask(d)},this);this.update();c&&this.notification.show();return d},update:function(){this._updateNotification();this.isFinished()&&this.fire("finished")},getPercentage:function(){return 0===this.getTaskCount()?1:this._doneWeights/this._totalWeights},isFinished:function(){return this.getDoneTaskCount()===this.getTaskCount()},getTaskCount:function(){return this._tasks.length},getDoneTaskCount:function(){return this._doneTasks}, _updateNotification:function(){this.notification.update({message:this._getNotificationMessage(),progress:this.getPercentage()})},_getNotificationMessage:function(){var a=this.getTaskCount(),c={current:this.getDoneTaskCount(),max:a,percentage:Math.round(100*this.getPercentage())};return(1==a&&this._singularMessage?this._singularMessage:this._message).output(c)},_createNotification:function(){return new CKEDITOR.plugins.notification(this.editor,{type:"progress"})},_addTask:function(a){a=new f(a.weight); this._tasks.push(a);this._totalWeights+=a._weight;return a},_removeTask:function(a){var c=CKEDITOR.tools.indexOf(this._tasks,a);-1!==c&&(a._doneWeight&&(this._doneWeights-=a._doneWeight),this._totalWeights-=a._weight,this._tasks.splice(c,1),this.update())},_onTaskUpdate:function(a){this._doneWeights+=a.data;this.update()},_onTaskDone:function(){this._doneTasks+=1;this.update()}};CKEDITOR.event.implementOn(a.prototype);f.prototype={done:function(){this.update(this._weight)},update:function(a){if(!this.isDone()&& !this.isCanceled()){a=Math.min(this._weight,a);var c=a-this._doneWeight;this._doneWeight=a;this.fire("updated",c);this.isDone()&&this.fire("done")}},cancel:function(){this.isDone()||this.isCanceled()||(this._isCanceled=!0,this.fire("canceled"))},isDone:function(){return this._weight===this._doneWeight},isCanceled:function(){return this._isCanceled}};CKEDITOR.event.implementOn(f.prototype);CKEDITOR.plugins.notificationAggregator=a;CKEDITOR.plugins.notificationAggregator.task=f}(),"use strict",function(){CKEDITOR.plugins.add("uploadwidget", {requires:"widget,clipboard,filetools,notificationaggregator",init:function(a){a.filter.allow("*[!data-widget,!data-cke-upload-id]")},isSupportedEnvironment:function(){return CKEDITOR.plugins.clipboard.isFileApiSupported}});CKEDITOR.fileTools||(CKEDITOR.fileTools={});CKEDITOR.tools.extend(CKEDITOR.fileTools,{addUploadWidget:function(a,f,b){var c=CKEDITOR.fileTools,d=a.uploadRepository,l=b.supportedTypes?10:20;if(b.fileToElement)a.on("paste",function(b){b=b.data;var g=a.widgets.registered[f],h=b.dataTransfer, l=h.getFilesCount(),e=g.loadMethod||"loadAndUpload",n,q;if(!b.dataValue&&l)for(q=0;q=a&&(a="0"+a);return String(a)}function f(c){var d=new Date,d=[d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds()];b+=1;return"image-"+CKEDITOR.tools.array.map(d,a).join("")+"-"+b+"."+c}var b=0;CKEDITOR.plugins.add("uploadimage", {requires:"uploadwidget",onLoad:function(){CKEDITOR.addCss(".cke_upload_uploading img{opacity: 0.3}")},isSupportedEnvironment:function(){return CKEDITOR.plugins.clipboard.isFileApiSupported},init:function(a){if(this.isSupportedEnvironment()){var b=CKEDITOR.fileTools,l=b.getUploadUrl(a.config,"image");l&&(b.addUploadWidget(a,"uploadimage",{supportedTypes:/image\/(jpeg|png|gif|bmp)/,uploadUrl:l,fileToElement:function(){var a=new CKEDITOR.dom.element("img");a.setAttribute("src","data:image/gif;base64,R0lGODlhDgAOAIAAAAAAAP///yH5BAAAAAAALAAAAAAOAA4AAAIMhI+py+0Po5y02qsKADs\x3d"); return a},parts:{img:"img"},onUploading:function(a){this.parts.img.setAttribute("src",a.data)},onUploaded:function(a){var b=this.parts.img.$;this.replaceWith('\x3cimg src\x3d"'+a.url+'" width\x3d"'+(a.responseData.width||b.naturalWidth)+'" height\x3d"'+(a.responseData.height||b.naturalHeight)+'"\x3e')}}),a.on("paste",function(k){if(k.data.dataValue.match(/f.version||f.quirks))};"undefined"==typeof a.plugins.scayt&&a.ui.addButton&&a.ui.addButton("SpellChecker",{label:a.lang.wsc.toolbar,click:function(a){var c=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.container.getText(): a.document.getBody().getText();(c=c.replace(/\s/g,""))?a.execCommand("checkspell"):alert("Nothing to check!")},toolbar:"spellchecker,10"});CKEDITOR.dialog.add("checkspell",this.path+(CKEDITOR.env.ie&&7>=CKEDITOR.env.version?"dialogs/wsc_ie.js":window.postMessage?"dialogs/wsc.js":"dialogs/wsc_ie.js"))}}),function(){function a(a){function b(a){var c=!1;e.attachListener(e,"keydown",function(){var b=g.getBody().getElementsByTag(a);if(!c){for(var d=0;dCKEDITOR.env.version&&c.enterMode!=CKEDITOR.ENTER_DIV&&b("div");if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10this.$.offsetHeight){var d=c.createRange();d[33==b?"moveToElementEditStart": "moveToElementEditEnd"](this);d.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(g,"blur",function(){try{g.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&this.attachListener(g,"touchend",function(){a.focus()});h=c.document.getElementsByTag("title").getItem(0);h.data("cke-title",h.getText());CKEDITOR.env.ie&&(c.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready");c.fire("contentDom");this._.isPendingFocus&& (c.focus(),this._.isPendingFocus=!1);setTimeout(function(){c.fire("dataReady")},0)},0,this)}function f(a){function b(){var f;a.editable().attachListener(a,"selectionChange",function(){var b=a.getSelection().getSelectedElement();b&&(f&&(f.detachEvent("onresizestart",c),f=null),b.$.attachEvent("onresizestart",c),f=b.$)})}function c(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var f=a.document.$;f.execCommand("enableObjectResizing",!1,!a.config.disableObjectResizing);f.execCommand("enableInlineTableEditing", !1,!a.config.disableNativeTableHandles)}catch(h){}else CKEDITOR.env.ie&&11>CKEDITOR.env.version&&a.config.disableObjectResizing&&b(a)}function b(){var a=[];if(8<=CKEDITOR.document.$.documentMode){a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");var b=[],c;for(c in CKEDITOR.dtd.$removeEmpty)b.push("html.CSS1Compat "+c+"[contenteditable\x3dfalse]");a.push(b.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(a.push("html{height:100% !important}"),a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")); a.push("html{cursor:text;*cursor:auto}");a.push("img,input,textarea{cursor:default}");return a.join("\n")}var c;CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",requiredContent:"body"});a.addMode("wysiwyg",function(b){function f(e){e&&e.removeListener();a.editable(new c(a,h.$.contentWindow.document.body));a.setData(a.getData(1),b)}var g="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+ ")();":"")+"document.close();",g=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent(g)+"}())":"",h=CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"'+g+'" frameBorder\x3d"0"\x3e\x3c/iframe\x3e');h.setStyles({width:"100%",height:"100%"});h.addClass("cke_wysiwyg_frame").addClass("cke_reset");g=a.ui.space("contents");g.append(h);var m=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.gecko;if(m)h.on("load",f);var e=a.title, n=a.fire("ariaEditorHelpLabel",{}).label;e&&(CKEDITOR.env.ie&&n&&(e+=", "+n),h.setAttribute("title",e));if(n){var e=CKEDITOR.tools.getNextId(),q=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+e+'" class\x3d"cke_voice_label"\x3e'+n+"\x3c/span\x3e");g.append(q,1);h.setAttribute("aria-describedby",e)}a.on("beforeModeUnload",function(a){a.removeListener();q&&q.remove()});h.setAttributes({tabIndex:a.tabIndex,allowTransparency:"true"});!m&&f();a.fire("ariaWidget",h)})}});CKEDITOR.editor.prototype.addContentsCss= function(a){var b=this.config,c=b.contentsCss;CKEDITOR.tools.isArray(c)||(b.contentsCss=c?[c]:[]);b.contentsCss.push(a)};c=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments);this._.frameLoadedHandler=CKEDITOR.tools.addFunction(function(b){CKEDITOR.tools.setTimeout(a,0,this,b)},this);this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(a,c){var f=this.editor;if(c)this.setHtml(a),this.fixInitialSelection(),f.fire("dataReady"); else{this._.isLoadingData=!0;f._.dataStore={id:1};var g=f.config,h=g.fullPage,m=g.docType,e=CKEDITOR.tools.buildStyleHtml(b()).replace(/'].join(''); /* eslint-disable jsdoc/require-description-complete-sentence */ /** * @description * This plugin enables the copy/paste functionality in the Handsontable. The functionality works for API, Context Menu, * using keyboard shortcuts and menu bar from the browser. * Possible values: * * `true` (to enable default options), * * `false` (to disable completely). * * or an object with values: * * `'columnsLimit'` (see {@link CopyPaste#columnsLimit}) * * `'rowsLimit'` (see {@link CopyPaste#rowsLimit}) * * `'pasteMode'` (see {@link CopyPaste#pasteMode}) * * `'uiContainer'` (see {@link CopyPaste#uiContainer}). * * See [the copy/paste demo](@/guides/cell-features/clipboard.md) for examples. * * @example * ```js * // Enables the plugin with default values * copyPaste: true, * // Enables the plugin with custom values * copyPaste: { * columnsLimit: 25, * rowsLimit: 50, * pasteMode: 'shift_down', * uiContainer: document.body, * }, * ``` * @class CopyPaste * @plugin CopyPaste */ /* eslint-enable jsdoc/require-description-complete-sentence */ var CopyPaste = /*#__PURE__*/function (_BasePlugin) { _inherits(CopyPaste, _BasePlugin); var _super = _createSuper(CopyPaste); function CopyPaste(hotInstance) { var _this; _classCallCheck(this, CopyPaste); _this = _super.call(this, hotInstance); /** * Maximum number of columns than can be copied to clipboard using CTRL + C. * * @type {number} * @default 1000 */ _this.columnsLimit = COLUMNS_LIMIT; /** * Ranges of the cells coordinates, which should be used to copy/cut/paste actions. * * @private * @type {Array} */ _this.copyableRanges = []; /** * Provides focusable element to support IME and copy/paste/cut actions. * * @type {FocusableWrapper} */ _this.focusableElement = void 0; /** * Defines paste (CTRL + V) behavior. * * Default value `"overwrite"` will paste clipboard value over current selection. * * When set to `"shift_down"`, clipboard data will be pasted in place of current selection, while all selected cells are moved down. * * When set to `"shift_right"`, clipboard data will be pasted in place of current selection, while all selected cells are moved right. * * @type {string} * @default 'overwrite' */ _this.pasteMode = 'overwrite'; /** * Maximum number of rows than can be copied to clipboard using CTRL + C. * * @type {number} * @default 1000 */ _this.rowsLimit = ROWS_LIMIT; /** * UI container for the secondary focusable element. * * @type {HTMLElement} */ _this.uiContainer = _this.hot.rootDocument.body; privatePool.set(_assertThisInitialized(_this), { isTriggeredByCopy: false, isTriggeredByCut: false, isBeginEditing: false, isFragmentSelectionEnabled: false }); 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 CopyPaste#enablePlugin} method is called. * * @returns {boolean} */ _createClass(CopyPaste, [{ key: "isEnabled", value: function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } var _this$hot$getSettings = this.hot.getSettings(), settings = _this$hot$getSettings[PLUGIN_KEY], fragmentSelection = _this$hot$getSettings.fragmentSelection; var priv = privatePool.get(this); priv.isFragmentSelectionEnabled = !!fragmentSelection; if (_typeof(settings) === 'object') { this.pasteMode = settings.pasteMode || this.pasteMode; this.rowsLimit = isNaN(settings.rowsLimit) ? this.rowsLimit : settings.rowsLimit; this.columnsLimit = isNaN(settings.columnsLimit) ? this.columnsLimit : settings.columnsLimit; this.uiContainer = settings.uiContainer || this.uiContainer; } this.addHook('afterContextMenuDefaultOptions', function (options) { return _this2.onAfterContextMenuDefaultOptions(options); }); this.addHook('afterOnCellMouseUp', function () { return _this2.onAfterOnCellMouseUp(); }); this.addHook('afterSelectionEnd', function () { return _this2.onAfterSelectionEnd(); }); this.addHook('beforeKeyDown', function () { return _this2.onBeforeKeyDown(); }); this.focusableElement = Object(_focusableElement_mjs__WEBPACK_IMPORTED_MODULE_28__["createElement"])(this.uiContainer); this.focusableElement.addLocalHook('copy', function (event) { return _this2.onCopy(event); }).addLocalHook('cut', function (event) { return _this2.onCut(event); }).addLocalHook('paste', function (event) { return _this2.onPaste(event); }); _get(_getPrototypeOf(CopyPaste.prototype), "enablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); this.getOrCreateFocusableElement(); _get(_getPrototypeOf(CopyPaste.prototype), "updatePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { if (this.focusableElement) { Object(_focusableElement_mjs__WEBPACK_IMPORTED_MODULE_28__["destroyElement"])(this.focusableElement); } _get(_getPrototypeOf(CopyPaste.prototype), "disablePlugin", this).call(this); } /** * Copies the selected cell into the clipboard. */ }, { key: "copy", value: function copy() { var priv = privatePool.get(this); priv.isTriggeredByCopy = true; this.getOrCreateFocusableElement(); this.focusableElement.focus(); this.hot.rootDocument.execCommand('copy'); } /** * Cuts the selected cell into the clipboard. */ }, { key: "cut", value: function cut() { var priv = privatePool.get(this); priv.isTriggeredByCut = true; this.getOrCreateFocusableElement(); this.focusableElement.focus(); this.hot.rootDocument.execCommand('cut'); } /** * Creates copyable text releated to range objects. * * @param {object[]} ranges Array of objects with properties `startRow`, `endRow`, `startCol` and `endCol`. * @returns {string} Returns string which will be copied into clipboard. */ }, { key: "getRangedCopyableData", value: function getRangedCopyableData(ranges) { var _this3 = this; var dataSet = []; var copyableRows = []; var copyableColumns = []; // Count all copyable rows and columns Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(ranges, function (range) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(range.startRow, range.endRow, function (row) { if (copyableRows.indexOf(row) === -1) { copyableRows.push(row); } }); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(range.startCol, range.endCol, function (column) { if (copyableColumns.indexOf(column) === -1) { copyableColumns.push(column); } }); }); // Concat all rows and columns data defined in ranges into one copyable string Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(copyableRows, function (row) { var rowSet = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(copyableColumns, function (column) { rowSet.push(_this3.hot.getCopyableData(row, column)); }); dataSet.push(rowSet); }); return Object(_3rdparty_SheetClip_index_mjs__WEBPACK_IMPORTED_MODULE_20__["stringify"])(dataSet); } /** * Creates copyable text releated to range objects. * * @param {object[]} ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`. * @returns {Array[]} Returns array of arrays which will be copied into clipboard. */ }, { key: "getRangedData", value: function getRangedData(ranges) { var _this4 = this; var dataSet = []; var copyableRows = []; var copyableColumns = []; // Count all copyable rows and columns Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(ranges, function (range) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(range.startRow, range.endRow, function (row) { if (copyableRows.indexOf(row) === -1) { copyableRows.push(row); } }); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(range.startCol, range.endCol, function (column) { if (copyableColumns.indexOf(column) === -1) { copyableColumns.push(column); } }); }); // Concat all rows and columns data defined in ranges into one copyable string Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(copyableRows, function (row) { var rowSet = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(copyableColumns, function (column) { rowSet.push(_this4.hot.getCopyableData(row, column)); }); dataSet.push(rowSet); }); return dataSet; } /** * Simulates the paste action. * * @param {string} pastableText Value as raw string to paste. * @param {string} [pastableHtml=''] Value as HTML to paste. */ }, { key: "paste", value: function paste() { var pastableText = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; var pastableHtml = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : pastableText; if (!pastableText && !pastableHtml) { return; } var pasteData = new _pasteEvent_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](); if (pastableText) { pasteData.clipboardData.setData('text/plain', pastableText); } if (pastableHtml) { pasteData.clipboardData.setData('text/html', pastableHtml); } this.getOrCreateFocusableElement(); this.onPaste(pasteData); } /** * Prepares copyable text from the cells selection in the invisible textarea. */ }, { key: "setCopyableText", value: function setCopyableText() { var selRange = this.hot.getSelectedRangeLast(); if (!selRange) { return; } var topLeft = selRange.getTopLeftCorner(); var bottomRight = selRange.getBottomRightCorner(); var startRow = topLeft.row; var startCol = topLeft.col; var endRow = bottomRight.row; var endCol = bottomRight.col; var finalEndRow = Math.min(endRow, startRow + this.rowsLimit - 1); var finalEndCol = Math.min(endCol, startCol + this.columnsLimit - 1); this.copyableRanges.length = 0; this.copyableRanges.push({ startRow: startRow, startCol: startCol, endRow: finalEndRow, endCol: finalEndCol }); this.copyableRanges = this.hot.runHooks('modifyCopyableRange', this.copyableRanges); if (endRow !== finalEndRow || endCol !== finalEndCol) { this.hot.runHooks('afterCopyLimit', endRow - startRow + 1, endCol - startCol + 1, this.rowsLimit, this.columnsLimit); } } /** * Force focus on editable element. * * @private */ }, { key: "getOrCreateFocusableElement", value: function getOrCreateFocusableElement() { var editor = this.hot.getActiveEditor(); var editableElement = editor ? editor.TEXTAREA : void 0; if (editableElement) { this.focusableElement.setFocusableElement(editableElement); } else { this.focusableElement.useSecondaryElement(); } } /** * Verifies if editor exists and is open. * * @private * @returns {boolean} */ }, { key: "isEditorOpened", value: function isEditorOpened() { var editor = this.hot.getActiveEditor(); return editor && editor.isOpened(); } /** * Prepares new values to populate them into datasource. * * @private * @param {Array} inputArray An array of the data to populate. * @param {Array} [selection] The selection which indicates from what position the data will be populated. * @returns {Array} Range coordinates after populate data. */ }, { key: "populateValues", value: function populateValues(inputArray) { var selection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.hot.getSelectedRangeLast(); if (!inputArray.length) { return; } var populatedRowsLength = inputArray.length; var populatedColumnsLength = inputArray[0].length; var newRows = []; var _selection$getTopLeft = selection.getTopLeftCorner(), startRow = _selection$getTopLeft.row, startColumn = _selection$getTopLeft.col; var _selection$getBottomR = selection.getBottomRightCorner(), endRowFromSelection = _selection$getBottomR.row, endColumnFromSelection = _selection$getBottomR.col; var visualRowForPopulatedData = startRow; var visualColumnForPopulatedData = startColumn; var lastVisualRow = startRow; var lastVisualColumn = startColumn; // We try to populate just all copied data or repeat copied data within a selection. Please keep in mind that we // don't know whether populated data is bigger than selection on start as there are some cells for which values // should be not inserted (it's known right after getting cell meta). while (newRows.length < populatedRowsLength || visualRowForPopulatedData <= endRowFromSelection) { var _this$hot$getCellMeta = this.hot.getCellMeta(visualRowForPopulatedData, startColumn), skipRowOnPaste = _this$hot$getCellMeta.skipRowOnPaste, visualRow = _this$hot$getCellMeta.visualRow; visualRowForPopulatedData = visualRow + 1; if (skipRowOnPaste === true) { /* eslint-disable no-continue */ continue; } lastVisualRow = visualRow; visualColumnForPopulatedData = startColumn; var newRow = []; var insertedRow = newRows.length % populatedRowsLength; while (newRow.length < populatedColumnsLength || visualColumnForPopulatedData <= endColumnFromSelection) { var _this$hot$getCellMeta2 = this.hot.getCellMeta(startRow, visualColumnForPopulatedData), skipColumnOnPaste = _this$hot$getCellMeta2.skipColumnOnPaste, visualCol = _this$hot$getCellMeta2.visualCol; visualColumnForPopulatedData = visualCol + 1; if (skipColumnOnPaste === true) { /* eslint-disable no-continue */ continue; } lastVisualColumn = visualCol; var insertedColumn = newRow.length % populatedColumnsLength; newRow.push(inputArray[insertedRow][insertedColumn]); } newRows.push(newRow); } this.hot.populateFromArray(startRow, startColumn, newRows, void 0, void 0, 'CopyPaste.paste', this.pasteMode); return [startRow, startColumn, lastVisualRow, lastVisualColumn]; } /** * `copy` event callback on textarea element. * * @param {Event} event ClipboardEvent. * @private */ }, { key: "onCopy", value: function onCopy(event) { var priv = privatePool.get(this); if (!this.hot.isListening() && !priv.isTriggeredByCopy || this.isEditorOpened()) { return; } this.setCopyableText(); priv.isTriggeredByCopy = false; var rangedData = this.getRangedData(this.copyableRanges); var allowCopying = !!this.hot.runHooks('beforeCopy', rangedData, this.copyableRanges); if (allowCopying) { var textPlain = Object(_3rdparty_SheetClip_index_mjs__WEBPACK_IMPORTED_MODULE_20__["stringify"])(rangedData); if (event && event.clipboardData) { var textHTML = Object(_utils_parseTable_mjs__WEBPACK_IMPORTED_MODULE_29__["_dataToHTML"])(rangedData, this.hot.rootDocument); event.clipboardData.setData('text/plain', textPlain); event.clipboardData.setData('text/html', [META_HEAD, textHTML].join('')); } else if (typeof ClipboardEvent === 'undefined') { this.hot.rootWindow.clipboardData.setData('Text', textPlain); } this.hot.runHooks('afterCopy', rangedData, this.copyableRanges); } event.preventDefault(); } /** * `cut` event callback on textarea element. * * @param {Event} event ClipboardEvent. * @private */ }, { key: "onCut", value: function onCut(event) { var priv = privatePool.get(this); if (!this.hot.isListening() && !priv.isTriggeredByCut || this.isEditorOpened()) { return; } this.setCopyableText(); priv.isTriggeredByCut = false; var rangedData = this.getRangedData(this.copyableRanges); var allowCuttingOut = !!this.hot.runHooks('beforeCut', rangedData, this.copyableRanges); if (allowCuttingOut) { var textPlain = Object(_3rdparty_SheetClip_index_mjs__WEBPACK_IMPORTED_MODULE_20__["stringify"])(rangedData); if (event && event.clipboardData) { var textHTML = Object(_utils_parseTable_mjs__WEBPACK_IMPORTED_MODULE_29__["_dataToHTML"])(rangedData, this.hot.rootDocument); event.clipboardData.setData('text/plain', textPlain); event.clipboardData.setData('text/html', [META_HEAD, textHTML].join('')); } else if (typeof ClipboardEvent === 'undefined') { this.hot.rootWindow.clipboardData.setData('Text', textPlain); } this.hot.emptySelectedCells('CopyPaste.cut'); this.hot.runHooks('afterCut', rangedData, this.copyableRanges); } event.preventDefault(); } /** * `paste` event callback on textarea element. * * @param {Event} event ClipboardEvent or pseudo ClipboardEvent, if paste was called manually. * @private */ }, { key: "onPaste", value: function onPaste(event) { if (!this.hot.isListening() || this.isEditorOpened()) { return; } if (event && event.preventDefault) { event.preventDefault(); } var pastedData; if (event && typeof event.clipboardData !== 'undefined') { var textHTML = Object(_helpers_string_mjs__WEBPACK_IMPORTED_MODULE_23__["sanitize"])(event.clipboardData.getData('text/html'), { ADD_TAGS: ['meta'], ADD_ATTR: ['content'], FORCE_BODY: true }); if (textHTML && /( 0) { counter -= 1; } deactivateElement(wrapper); if (counter <= 0) { counter = 0; // Detach secondary element from the DOM. var secondaryElement = secondaryElements.get(wrapper.container); if (secondaryElement && secondaryElement.parentNode) { secondaryElement.parentNode.removeChild(secondaryElement); secondaryElements.delete(wrapper.container); } wrapper.mainElement = null; } refCounter.set(wrapper.container, counter); } /***/ }), /***/ "./node_modules/handsontable/plugins/copyPaste/index.mjs": /*!***************************************************************!*\ !*** ./node_modules/handsontable/plugins/copyPaste/index.mjs ***! \***************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, CopyPaste */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _copyPaste_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./copyPaste.mjs */ "./node_modules/handsontable/plugins/copyPaste/copyPaste.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _copyPaste_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _copyPaste_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CopyPaste", function() { return _copyPaste_mjs__WEBPACK_IMPORTED_MODULE_0__["CopyPaste"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/copyPaste/pasteEvent.mjs": /*!********************************************************************!*\ !*** ./node_modules/handsontable/plugins/copyPaste/pasteEvent.mjs ***! \********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PasteEvent; }); /* harmony import */ var _clipboardData_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clipboardData.mjs */ "./node_modules/handsontable/plugins/copyPaste/clipboardData.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var PasteEvent = function PasteEvent() { _classCallCheck(this, PasteEvent); this.clipboardData = new _clipboardData_mjs__WEBPACK_IMPORTED_MODULE_0__["default"](); }; /***/ }), /***/ "./node_modules/handsontable/plugins/customBorders/contextMenuItem/bottom.mjs": /*!************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/customBorders/contextMenuItem/bottom.mjs ***! \************************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return bottom; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.mjs */ "./node_modules/handsontable/plugins/customBorders/utils.mjs"); /** * @param {CustomBorders} customBordersPlugin The plugin instance. * @returns {object} */ function bottom(customBordersPlugin) { return { key: 'borders:bottom', name: function name() { var label = this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["CONTEXTMENU_ITEMS_BORDERS_BOTTOM"]); var hasBorder = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["checkSelectionBorders"])(this, 'bottom'); if (hasBorder) { label = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["markSelected"])(label); } return label; }, callback: function callback(key, selected) { var hasBorder = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["checkSelectionBorders"])(this, 'bottom'); customBordersPlugin.prepareBorder(selected, 'bottom', hasBorder); } }; } /***/ }), /***/ "./node_modules/handsontable/plugins/customBorders/contextMenuItem/index.mjs": /*!***********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/customBorders/contextMenuItem/index.mjs ***! \***********************************************************************************/ /*! exports provided: bottom, left, noBorders, right, top */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _bottom_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bottom.mjs */ "./node_modules/handsontable/plugins/customBorders/contextMenuItem/bottom.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bottom", function() { return _bottom_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]; }); /* harmony import */ var _left_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./left.mjs */ "./node_modules/handsontable/plugins/customBorders/contextMenuItem/left.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "left", function() { return _left_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]; }); /* harmony import */ var _noBorders_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./noBorders.mjs */ "./node_modules/handsontable/plugins/customBorders/contextMenuItem/noBorders.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noBorders", function() { return _noBorders_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]; }); /* harmony import */ var _right_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./right.mjs */ "./node_modules/handsontable/plugins/customBorders/contextMenuItem/right.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "right", function() { return _right_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]; }); /* harmony import */ var _top_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./top.mjs */ "./node_modules/handsontable/plugins/customBorders/contextMenuItem/top.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "top", function() { return _top_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/customBorders/contextMenuItem/left.mjs": /*!**********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/customBorders/contextMenuItem/left.mjs ***! \**********************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return left; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.mjs */ "./node_modules/handsontable/plugins/customBorders/utils.mjs"); /** * @param {CustomBorders} customBordersPlugin The plugin instance. * @returns {object} */ function left(customBordersPlugin) { return { key: 'borders:left', name: function name() { var label = this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["CONTEXTMENU_ITEMS_BORDERS_LEFT"]); var hasBorder = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["checkSelectionBorders"])(this, 'left'); if (hasBorder) { label = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["markSelected"])(label); } return label; }, callback: function callback(key, selected) { var hasBorder = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["checkSelectionBorders"])(this, 'left'); customBordersPlugin.prepareBorder(selected, 'left', hasBorder); } }; } /***/ }), /***/ "./node_modules/handsontable/plugins/customBorders/contextMenuItem/noBorders.mjs": /*!***************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/customBorders/contextMenuItem/noBorders.mjs ***! \***************************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return noBorders; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.mjs */ "./node_modules/handsontable/plugins/customBorders/utils.mjs"); /** * @param {CustomBorders} customBordersPlugin The plugin instance. * @returns {object} */ function noBorders(customBordersPlugin) { return { key: 'borders:no_borders', name: function name() { return this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["CONTEXTMENU_ITEMS_REMOVE_BORDERS"]); }, callback: function callback(key, selected) { customBordersPlugin.prepareBorder(selected, 'noBorders'); }, disabled: function disabled() { return !Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["checkSelectionBorders"])(this); } }; } /***/ }), /***/ "./node_modules/handsontable/plugins/customBorders/contextMenuItem/right.mjs": /*!***********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/customBorders/contextMenuItem/right.mjs ***! \***********************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return right; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.mjs */ "./node_modules/handsontable/plugins/customBorders/utils.mjs"); /** * @param {CustomBorders} customBordersPlugin The plugin instance. * @returns {object} */ function right(customBordersPlugin) { return { key: 'borders:right', name: function name() { var label = this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["CONTEXTMENU_ITEMS_BORDERS_RIGHT"]); var hasBorder = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["checkSelectionBorders"])(this, 'right'); if (hasBorder) { label = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["markSelected"])(label); } return label; }, callback: function callback(key, selected) { var hasBorder = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["checkSelectionBorders"])(this, 'right'); customBordersPlugin.prepareBorder(selected, 'right', hasBorder); } }; } /***/ }), /***/ "./node_modules/handsontable/plugins/customBorders/contextMenuItem/top.mjs": /*!*********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/customBorders/contextMenuItem/top.mjs ***! \*********************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return top; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.mjs */ "./node_modules/handsontable/plugins/customBorders/utils.mjs"); /** * @param {CustomBorders} customBordersPlugin The plugin instance. * @returns {object} */ function top(customBordersPlugin) { return { key: 'borders:top', name: function name() { var label = this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["CONTEXTMENU_ITEMS_BORDERS_TOP"]); var hasBorder = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["checkSelectionBorders"])(this, 'top'); if (hasBorder) { label = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["markSelected"])(label); } return label; }, callback: function callback(key, selected) { var hasBorder = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__["checkSelectionBorders"])(this, 'top'); customBordersPlugin.prepareBorder(selected, 'top', hasBorder); } }; } /***/ }), /***/ "./node_modules/handsontable/plugins/customBorders/customBorders.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/plugins/customBorders/customBorders.mjs ***! \***************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, CustomBorders */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomBorders", function() { return CustomBorders; }); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_object_assign_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.assign.js */ "./node_modules/core-js/modules/es.object.assign.js"); /* harmony import */ var core_js_modules_es_object_values_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.values.js */ "./node_modules/core-js/modules/es.object.values.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _contextMenuItem_index_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./contextMenuItem/index.mjs */ "./node_modules/handsontable/plugins/customBorders/contextMenuItem/index.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/handsontable/plugins/customBorders/utils.mjs"); /* harmony import */ var _selection_index_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../selection/index.mjs */ "./node_modules/handsontable/selection/index.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var PLUGIN_KEY = 'customBorders'; var PLUGIN_PRIORITY = 90; /** * @plugin CustomBorders * @class CustomBorders * * @description * This plugin enables an option to apply custom borders through the context menu (configurable with context menu key * `borders`). * * To initialize Handsontable with predefined custom borders, provide cell coordinates and border styles in a form * of an array. * * See [Custom Borders](@/guides/cell-features/formatting-cells.md#custom-cell-borders) demo for more examples. * * @example * ```js * customBorders: [ * { * range: { * from: { * row: 1, * col: 1 * }, * to: { * row: 3, * col: 4 * }, * }, * left: {}, * right: {}, * top: {}, * bottom: {}, * }, * ], * * // or * customBorders: [ * { row: 2, * col: 2, * left: { * width: 2, * color: 'red', * }, * right: { * width: 1, * color: 'green', * }, * top: '', * bottom: '', * } * ], * ``` */ var CustomBorders = /*#__PURE__*/function (_BasePlugin) { _inherits(CustomBorders, _BasePlugin); var _super = _createSuper(CustomBorders); function CustomBorders(hotInstance) { var _this; _classCallCheck(this, CustomBorders); _this = _super.call(this, hotInstance); /** * Saved borders. * * @private * @type {Array} */ _this.savedBorders = []; 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 CustomBorders#enablePlugin} method is called. * * @returns {boolean} */ _createClass(CustomBorders, [{ key: "isEnabled", value: function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } this.addHook('afterContextMenuDefaultOptions', function (options) { return _this2.onAfterContextMenuDefaultOptions(options); }); this.addHook('init', function () { return _this2.onAfterInit(); }); _get(_getPrototypeOf(CustomBorders.prototype), "enablePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { this.hideBorders(); _get(_getPrototypeOf(CustomBorders.prototype), "disablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); this.changeBorderSettings(); _get(_getPrototypeOf(CustomBorders.prototype), "updatePlugin", this).call(this); } /** * Set custom borders. * * @example * ```js * const customBordersPlugin = hot.getPlugin('customBorders'); * * // Using an array of arrays (produced by `.getSelected()` method). * customBordersPlugin.setBorders([[1, 1, 2, 2], [6, 2, 0, 2]], {left: {width: 2, color: 'blue'}}); * * // Using an array of CellRange objects (produced by `.getSelectedRange()` method). * // Selecting a cell range. * hot.selectCell(0, 0, 2, 2); * // Returning selected cells' range with the getSelectedRange method. * customBordersPlugin.setBorders(hot.getSelectedRange(), {left: {hide: false, width: 2, color: 'blue'}}); * ``` * * @param {Array[]|CellRange[]} selectionRanges Array of selection ranges. * @param {object} borderObject Object with `top`, `right`, `bottom` and `left` properties. */ }, { key: "setBorders", value: function setBorders(selectionRanges, borderObject) { var _this3 = this; var defaultBorderKeys = ['top', 'right', 'bottom', 'left']; var borderKeys = borderObject ? Object.keys(borderObject) : defaultBorderKeys; var selectionType = Object(_selection_index_mjs__WEBPACK_IMPORTED_MODULE_28__["detectSelectionType"])(selectionRanges); var selectionSchemaNormalizer = Object(_selection_index_mjs__WEBPACK_IMPORTED_MODULE_28__["normalizeSelectionFactory"])(selectionType); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(selectionRanges, function (selection) { var _selectionSchemaNorma = selectionSchemaNormalizer(selection), _selectionSchemaNorma2 = _slicedToArray(_selectionSchemaNorma, 4), rowStart = _selectionSchemaNorma2[0], columnStart = _selectionSchemaNorma2[1], rowEnd = _selectionSchemaNorma2[2], columnEnd = _selectionSchemaNorma2[3]; var _loop = function _loop(row) { var _loop2 = function _loop2(col) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(borderKeys, function (borderKey) { _this3.prepareBorderFromCustomAdded(row, col, borderObject, borderKey); }); }; for (var col = columnStart; col <= columnEnd; col += 1) { _loop2(col); } }; for (var row = rowStart; row <= rowEnd; row += 1) { _loop(row); } }); /* The line below triggers a re-render of Handsontable. This will be a "fastDraw" render, because that is the default for the TableView class. The re-render is needed for borders on cells that did not have a border before. The way this call works is that it calls Table.refreshSelections, which calls Selection.getBorder, which creates a new instance of Border. Seems wise to keep this single-direction flow of creating new Borders */ this.hot.view.render(); } /** * Get custom borders. * * @example * ```js * const customBordersPlugin = hot.getPlugin('customBorders'); * * // Using an array of arrays (produced by `.getSelected()` method). * customBordersPlugin.getBorders([[1, 1, 2, 2], [6, 2, 0, 2]]); * // Using an array of CellRange objects (produced by `.getSelectedRange()` method). * customBordersPlugin.getBorders(hot.getSelectedRange()); * // Using without param - return all customBorders. * customBordersPlugin.getBorders(); * ``` * * @param {Array[]|CellRange[]} selectionRanges Array of selection ranges. * @returns {object[]} Returns array of border objects. */ }, { key: "getBorders", value: function getBorders(selectionRanges) { var _this4 = this; if (!Array.isArray(selectionRanges)) { return this.savedBorders; } var selectionType = Object(_selection_index_mjs__WEBPACK_IMPORTED_MODULE_28__["detectSelectionType"])(selectionRanges); var selectionSchemaNormalizer = Object(_selection_index_mjs__WEBPACK_IMPORTED_MODULE_28__["normalizeSelectionFactory"])(selectionType); var selectedBorders = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(selectionRanges, function (selection) { var _selectionSchemaNorma3 = selectionSchemaNormalizer(selection), _selectionSchemaNorma4 = _slicedToArray(_selectionSchemaNorma3, 4), rowStart = _selectionSchemaNorma4[0], columnStart = _selectionSchemaNorma4[1], rowEnd = _selectionSchemaNorma4[2], columnEnd = _selectionSchemaNorma4[3]; var _loop3 = function _loop3(row) { var _loop4 = function _loop4(col) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(_this4.savedBorders, function (border) { if (border.row === row && border.col === col) { selectedBorders.push(border); } }); }; for (var col = columnStart; col <= columnEnd; col += 1) { _loop4(col); } }; for (var row = rowStart; row <= rowEnd; row += 1) { _loop3(row); } }); return selectedBorders; } /** * Clear custom borders. * * @example * ```js * const customBordersPlugin = hot.getPlugin('customBorders'); * * // Using an array of arrays (produced by `.getSelected()` method). * customBordersPlugin.clearBorders([[1, 1, 2, 2], [6, 2, 0, 2]]); * // Using an array of CellRange objects (produced by `.getSelectedRange()` method). * customBordersPlugin.clearBorders(hot.getSelectedRange()); * // Using without param - clear all customBorders. * customBordersPlugin.clearBorders(); * ``` * * @param {Array[]|CellRange[]} selectionRanges Array of selection ranges. */ }, { key: "clearBorders", value: function clearBorders(selectionRanges) { var _this5 = this; if (selectionRanges) { this.setBorders(selectionRanges); } else { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(this.savedBorders, function (border) { _this5.clearBordersFromSelectionSettings(border.id); _this5.clearNullCellRange(); _this5.hot.removeCellMeta(border.row, border.col, 'borders'); }); this.savedBorders.length = 0; } } /** * Insert WalkontableSelection instance into Walkontable settings. * * @private * @param {object} border Object with `row` and `col`, `left`, `right`, `top` and `bottom`, `id` and `border` ({Object} with `color`, `width` and `cornerVisible` property) properties. * @param {string} place Coordinate where add/remove border - `top`, `bottom`, `left`, `right`. */ }, { key: "insertBorderIntoSettings", value: function insertBorderIntoSettings(border, place) { var hasSavedBorders = this.checkSavedBorders(border); if (!hasSavedBorders) { this.savedBorders.push(border); } var visualCellRange = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellRange"](new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](border.row, border.col)); var hasCustomSelections = this.checkCustomSelections(border, visualCellRange, place); if (!hasCustomSelections) { this.hot.selection.highlight.addCustomSelection({ border: border, visualCellRange: visualCellRange }); } } /** * Prepare borders from setting (single cell). * * @private * @param {number} row Visual row index. * @param {number} column Visual column index. * @param {object} borderDescriptor Object with `row` and `col`, `left`, `right`, `top` and `bottom` properties. * @param {string} place Coordinate where add/remove border - `top`, `bottom`, `left`, `right`. */ }, { key: "prepareBorderFromCustomAdded", value: function prepareBorderFromCustomAdded(row, column, borderDescriptor, place) { var nrOfRows = this.hot.countRows(); var nrOfColumns = this.hot.countCols(); if (row >= nrOfRows || column >= nrOfColumns) { return; } var border = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_27__["createEmptyBorders"])(row, column); if (borderDescriptor) { border = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_27__["extendDefaultBorder"])(border, borderDescriptor); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(this.hot.selection.highlight.customSelections, function (customSelection) { if (border.id === customSelection.settings.id) { Object.assign(customSelection.settings, borderDescriptor); border.id = customSelection.settings.id; border.left = customSelection.settings.left; border.right = customSelection.settings.right; border.top = customSelection.settings.top; border.bottom = customSelection.settings.bottom; return false; // breaks forAll } }); } this.hot.setCellMeta(row, column, 'borders', border); this.insertBorderIntoSettings(border, place); } /** * Prepare borders from setting (object). * * @private * @param {object} rowDecriptor Object with `range`, `left`, `right`, `top` and `bottom` properties. */ }, { key: "prepareBorderFromCustomAddedRange", value: function prepareBorderFromCustomAddedRange(rowDecriptor) { var _this6 = this; var range = rowDecriptor.range; var lastRowIndex = Math.min(range.to.row, this.hot.countRows() - 1); var lastColumnIndex = Math.min(range.to.col, this.hot.countCols() - 1); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(range.from.row, lastRowIndex, function (rowIndex) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(range.from.col, lastColumnIndex, function (colIndex) { var border = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_27__["createEmptyBorders"])(rowIndex, colIndex); var add = 0; if (rowIndex === range.from.row) { if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_21__["hasOwnProperty"])(rowDecriptor, 'top')) { add += 1; border.top = rowDecriptor.top; } } // Please keep in mind that `range.to.row` may be beyond the table boundaries. The border won't be rendered. if (rowIndex === range.to.row) { if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_21__["hasOwnProperty"])(rowDecriptor, 'bottom')) { add += 1; border.bottom = rowDecriptor.bottom; } } if (colIndex === range.from.col) { if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_21__["hasOwnProperty"])(rowDecriptor, 'left')) { add += 1; border.left = rowDecriptor.left; } } // Please keep in mind that `range.to.col` may be beyond the table boundaries. The border won't be rendered. if (colIndex === range.to.col) { if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_21__["hasOwnProperty"])(rowDecriptor, 'right')) { add += 1; border.right = rowDecriptor.right; } } if (add > 0) { _this6.hot.setCellMeta(rowIndex, colIndex, 'borders', border); _this6.insertBorderIntoSettings(border); } else {// TODO sometimes it enters here. Why? } }); }); } /** * Remove border (triggered from context menu). * * @private * @param {number} row Visual row index. * @param {number} column Visual column index. */ }, { key: "removeAllBorders", value: function removeAllBorders(row, column) { var borderId = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_27__["createId"])(row, column); this.spliceBorder(borderId); this.clearBordersFromSelectionSettings(borderId); this.clearNullCellRange(); this.hot.removeCellMeta(row, column, 'borders'); } /** * Set borders for each cell re. To border position. * * @private * @param {number} row Visual row index. * @param {number} column Visual column index. * @param {string} place Coordinate where add/remove border - `top`, `bottom`, `left`, `right` and `noBorders`. * @param {boolean} remove True when remove borders, and false when add borders. */ }, { key: "setBorder", value: function setBorder(row, column, place, remove) { var bordersMeta = this.hot.getCellMeta(row, column).borders; if (!bordersMeta || bordersMeta.border === void 0) { bordersMeta = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_27__["createEmptyBorders"])(row, column); } if (remove) { bordersMeta[place] = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_27__["createSingleEmptyBorder"])(); var hideCount = this.countHide(bordersMeta); if (hideCount === 4) { this.removeAllBorders(row, column); } else { var customSelectionsChecker = this.checkCustomSelectionsFromContextMenu(bordersMeta, place, remove); if (!customSelectionsChecker) { this.insertBorderIntoSettings(bordersMeta); } this.hot.setCellMeta(row, column, 'borders', bordersMeta); } } else { bordersMeta[place] = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_27__["createDefaultCustomBorder"])(); var _customSelectionsChecker = this.checkCustomSelectionsFromContextMenu(bordersMeta, place, remove); if (!_customSelectionsChecker) { this.insertBorderIntoSettings(bordersMeta); } this.hot.setCellMeta(row, column, 'borders', bordersMeta); } } /** * Prepare borders based on cell and border position. * * @private * @param {CellRange[]} selected An array of CellRange objects. * @param {string} place Coordinate where add/remove border - `top`, `bottom`, `left`, `right` and `noBorders`. * @param {boolean} remove True when remove borders, and false when add borders. */ }, { key: "prepareBorder", value: function prepareBorder(selected, place, remove) { var _this7 = this; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(selected, function (_ref) { var start = _ref.start, end = _ref.end; if (start.row === end.row && start.col === end.col) { if (place === 'noBorders') { _this7.removeAllBorders(start.row, start.col); } else { _this7.setBorder(start.row, start.col, place, remove); } } else { switch (place) { case 'noBorders': Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(start.col, end.col, function (colIndex) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(start.row, end.row, function (rowIndex) { _this7.removeAllBorders(rowIndex, colIndex); }); }); break; case 'top': Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(start.col, end.col, function (topCol) { _this7.setBorder(start.row, topCol, place, remove); }); break; case 'right': Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(start.row, end.row, function (rowRight) { _this7.setBorder(rowRight, end.col, place, remove); }); break; case 'bottom': Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(start.col, end.col, function (bottomCol) { _this7.setBorder(end.row, bottomCol, place, remove); }); break; case 'left': Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(start.row, end.row, function (rowLeft) { _this7.setBorder(rowLeft, start.col, place, remove); }); break; default: break; } } }); } /** * Create borders from settings. * * @private * @param {Array} customBorders Object with `row` and `col`, `left`, `right`, `top` and `bottom` properties. */ }, { key: "createCustomBorders", value: function createCustomBorders(customBorders) { var _this8 = this; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(customBorders, function (customBorder) { if (customBorder.range) { _this8.prepareBorderFromCustomAddedRange(customBorder); } else { _this8.prepareBorderFromCustomAdded(customBorder.row, customBorder.col, customBorder); } }); } /** * Count hide property in border object. * * @private * @param {object} border Object with `row` and `col`, `left`, `right`, `top` and `bottom`, `id` and `border` ({Object} with `color`, `width` and `cornerVisible` property) properties. * @returns {Array} */ }, { key: "countHide", value: function countHide(border) { var values = Object.values(border); return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayReduce"])(values, function (accumulator, value) { var result = accumulator; if (value.hide) { result += 1; } return result; }, 0); } /** * Clear borders settings from custom selections. * * @private * @param {string} borderId Border id name as string. */ }, { key: "clearBordersFromSelectionSettings", value: function clearBordersFromSelectionSettings(borderId) { var index = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayMap"])(this.hot.selection.highlight.customSelections, function (customSelection) { return customSelection.settings.id; }).indexOf(borderId); if (index > -1) { this.hot.selection.highlight.customSelections[index].clear(); } } /** * Clear cellRange with null value. * * @private */ }, { key: "clearNullCellRange", value: function clearNullCellRange() { var _this9 = this; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(this.hot.selection.highlight.customSelections, function (customSelection, index) { if (customSelection.cellRange === null) { _this9.hot.selection.highlight.customSelections[index].destroy(); _this9.hot.selection.highlight.customSelections.splice(index, 1); return false; // breaks forAll } }); } /** * Hide custom borders. * * @private */ }, { key: "hideBorders", value: function hideBorders() { var _this10 = this; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(this.savedBorders, function (border) { _this10.clearBordersFromSelectionSettings(border.id); _this10.clearNullCellRange(); }); } /** * Splice border from savedBorders. * * @private * @param {string} borderId Border id name as string. */ }, { key: "spliceBorder", value: function spliceBorder(borderId) { var index = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayMap"])(this.savedBorders, function (border) { return border.id; }).indexOf(borderId); if (index > -1) { this.savedBorders.splice(index, 1); } } /** * Check if an border already exists in the savedBorders array, and if true update border in savedBorders. * * @private * @param {object} border Object with `row` and `col`, `left`, `right`, `top` and `bottom`, `id` and `border` ({Object} with `color`, `width` and `cornerVisible` property) properties. * * @returns {boolean} */ }, { key: "checkSavedBorders", value: function checkSavedBorders(border) { var _this11 = this; var check = false; var hideCount = this.countHide(border); if (hideCount === 4) { this.spliceBorder(border.id); check = true; } else { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(this.savedBorders, function (savedBorder, index) { if (border.id === savedBorder.id) { _this11.savedBorders[index] = border; check = true; return false; // breaks forAll } }); } return check; } /** * Check if an border already exists in the customSelections, and if true call toggleHiddenClass method. * * @private * @param {object} border Object with `row` and `col`, `left`, `right`, `top` and `bottom`, `id` and `border` ({Object} with `color`, `width` and `cornerVisible` property) properties. * @param {string} place Coordinate where add/remove border - `top`, `bottom`, `left`, `right` and `noBorders`. * @param {boolean} remove True when remove borders, and false when add borders. * * @returns {boolean} */ }, { key: "checkCustomSelectionsFromContextMenu", value: function checkCustomSelectionsFromContextMenu(border, place, remove) { var check = false; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(this.hot.selection.highlight.customSelections, function (customSelection) { if (border.id === customSelection.settings.id) { Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_21__["objectEach"])(customSelection.instanceBorders, function (borderObject) { borderObject.toggleHiddenClass(place, remove); // TODO this also bad? }); check = true; return false; // breaks forAll } }); return check; } /** * Check if an border already exists in the customSelections, and if true reset cellRange. * * @private * @param {object} border Object with `row` and `col`, `left`, `right`, `top` and `bottom`, `id` and `border` ({Object} with `color`, `width` and `cornerVisible` property) properties. * @param {CellRange} cellRange The selection range to check. * @param {string} place Coordinate where add/remove border - `top`, `bottom`, `left`, `right`. * @returns {boolean} */ }, { key: "checkCustomSelections", value: function checkCustomSelections(border, cellRange, place) { var hideCount = this.countHide(border); var check = false; if (hideCount === 4) { this.removeAllBorders(border.row, border.col); check = true; } else { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_23__["arrayEach"])(this.hot.selection.highlight.customSelections, function (customSelection) { if (border.id === customSelection.settings.id) { customSelection.visualCellRange = cellRange; customSelection.commit(); if (place) { Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_21__["objectEach"])(customSelection.instanceBorders, function (borderObject) { borderObject.changeBorderStyle(place, border); }); } check = true; return false; // breaks forAll } }); } return check; } /** * Change borders from settings. * * @private */ }, { key: "changeBorderSettings", value: function changeBorderSettings() { var customBorders = this.hot.getSettings()[PLUGIN_KEY]; if (Array.isArray(customBorders)) { if (!customBorders.length) { this.savedBorders = customBorders; } this.createCustomBorders(customBorders); } else if (customBorders !== void 0) { this.createCustomBorders(this.savedBorders); } } /** * Add border options to context menu. * * @private * @param {object} defaultOptions Context menu items. */ }, { key: "onAfterContextMenuDefaultOptions", value: function onAfterContextMenuDefaultOptions(defaultOptions) { if (!this.hot.getSettings()[PLUGIN_KEY]) { return; } defaultOptions.items.push({ name: '---------' }, { key: 'borders', name: function name() { return this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_25__["CONTEXTMENU_ITEMS_BORDERS"]); }, disabled: function disabled() { return this.selection.isSelectedByCorner(); }, submenu: { items: [Object(_contextMenuItem_index_mjs__WEBPACK_IMPORTED_MODULE_26__["top"])(this), Object(_contextMenuItem_index_mjs__WEBPACK_IMPORTED_MODULE_26__["right"])(this), Object(_contextMenuItem_index_mjs__WEBPACK_IMPORTED_MODULE_26__["bottom"])(this), Object(_contextMenuItem_index_mjs__WEBPACK_IMPORTED_MODULE_26__["left"])(this), Object(_contextMenuItem_index_mjs__WEBPACK_IMPORTED_MODULE_26__["noBorders"])(this)] } }); } /** * `afterInit` hook callback. * * @private */ }, { key: "onAfterInit", value: function onAfterInit() { this.changeBorderSettings(); } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { _get(_getPrototypeOf(CustomBorders.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return CustomBorders; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_20__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/customBorders/index.mjs": /*!*******************************************************************!*\ !*** ./node_modules/handsontable/plugins/customBorders/index.mjs ***! \*******************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, CustomBorders */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _customBorders_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./customBorders.mjs */ "./node_modules/handsontable/plugins/customBorders/customBorders.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _customBorders_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _customBorders_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomBorders", function() { return _customBorders_mjs__WEBPACK_IMPORTED_MODULE_0__["CustomBorders"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/customBorders/utils.mjs": /*!*******************************************************************!*\ !*** ./node_modules/handsontable/plugins/customBorders/utils.mjs ***! \*******************************************************************/ /*! exports provided: createId, createDefaultCustomBorder, createSingleEmptyBorder, createDefaultHtBorder, createEmptyBorders, extendDefaultBorder, checkSelectionBorders, markSelected */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createId", function() { return createId; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDefaultCustomBorder", function() { return createDefaultCustomBorder; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSingleEmptyBorder", function() { return createSingleEmptyBorder; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDefaultHtBorder", function() { return createDefaultHtBorder; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEmptyBorders", function() { return createEmptyBorders; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extendDefaultBorder", function() { return extendDefaultBorder; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkSelectionBorders", function() { return checkSelectionBorders; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "markSelected", function() { return markSelected; }); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /** * Create separated id for borders for each cell. * * @param {number} row Visual row index. * @param {number} col Visual column index. * @returns {string} */ function createId(row, col) { return "border_row".concat(row, "col").concat(col); } /** * Create default single border for each position (top/right/bottom/left). * * @returns {object} `{{width: number, color: string}}`. */ function createDefaultCustomBorder() { return { width: 1, color: '#000' }; } /** * Create default object for empty border. * * @returns {object} `{{hide: boolean}}`. */ function createSingleEmptyBorder() { return { hide: true }; } /** * Create default Handsontable border object. * * @returns {object} `{{width: number, color: string, cornerVisible: boolean}}`. */ function createDefaultHtBorder() { return { width: 1, color: '#000', cornerVisible: false }; } /** * Prepare empty border for each cell with all custom borders hidden. * * @param {number} row Visual row index. * @param {number} col Visual column index. * @returns {object} Returns border configuration containing visual indexes. Example of an object defining it: * `{{id: *, border: *, row: *, col: *, top: {hide: boolean}, right: {hide: boolean}, bottom: {hide: boolean}, left: {hide: boolean}}}`. */ function createEmptyBorders(row, col) { return { id: createId(row, col), border: createDefaultHtBorder(), row: row, col: col, top: createSingleEmptyBorder(), right: createSingleEmptyBorder(), bottom: createSingleEmptyBorder(), left: createSingleEmptyBorder() }; } /** * @param {object} defaultBorder The default border object. * @param {object} customBorder The border object with custom settings. * @returns {object} */ function extendDefaultBorder(defaultBorder, customBorder) { if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["hasOwnProperty"])(customBorder, 'border')) { defaultBorder.border = customBorder.border; } if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["hasOwnProperty"])(customBorder, 'top')) { if (customBorder.top) { if (!Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["isObject"])(customBorder.top)) { customBorder.top = createDefaultCustomBorder(); } defaultBorder.top = customBorder.top; } else { customBorder.top = createSingleEmptyBorder(); defaultBorder.top = customBorder.top; } } if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["hasOwnProperty"])(customBorder, 'right')) { if (customBorder.right) { if (!Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["isObject"])(customBorder.right)) { customBorder.right = createDefaultCustomBorder(); } defaultBorder.right = customBorder.right; } else { customBorder.right = createSingleEmptyBorder(); defaultBorder.right = customBorder.right; } } if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["hasOwnProperty"])(customBorder, 'bottom')) { if (customBorder.bottom) { if (!Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["isObject"])(customBorder.bottom)) { customBorder.bottom = createDefaultCustomBorder(); } defaultBorder.bottom = customBorder.bottom; } else { customBorder.bottom = createSingleEmptyBorder(); defaultBorder.bottom = customBorder.bottom; } } if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["hasOwnProperty"])(customBorder, 'left')) { if (customBorder.left) { if (!Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["isObject"])(customBorder.left)) { customBorder.left = createDefaultCustomBorder(); } defaultBorder.left = customBorder.left; } else { customBorder.left = createSingleEmptyBorder(); defaultBorder.left = customBorder.left; } } return defaultBorder; } /** * Check if selection has border. * * @param {Core} hot The Handsontable instance. * @param {string} [direction] If set ('left' or 'top') then only the specified border side will be checked. * @returns {boolean} */ function checkSelectionBorders(hot, direction) { var atLeastOneHasBorder = false; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_2__["arrayEach"])(hot.getSelectedRange(), function (range) { range.forAll(function (r, c) { if (r < 0 || c < 0) { return; } var metaBorders = hot.getCellMeta(r, c).borders; if (metaBorders) { if (direction) { if (!Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["hasOwnProperty"])(metaBorders[direction], 'hide') || metaBorders[direction].hide === false) { atLeastOneHasBorder = true; return false; // breaks forAll } } else { atLeastOneHasBorder = true; return false; // breaks forAll } } }); }); return atLeastOneHasBorder; } /** * Mark label in contextMenu as selected. * * @param {string} label The label text. * @returns {string} */ function markSelected(label) { return "".concat(String.fromCharCode(10003), "").concat(label); // workaround for https://github.com/handsontable/handsontable/issues/1946 } /***/ }), /***/ "./node_modules/handsontable/plugins/dragToScroll/dragToScroll.mjs": /*!*************************************************************************!*\ !*** ./node_modules/handsontable/plugins/dragToScroll/dragToScroll.mjs ***! \*************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, DragToScroll */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragToScroll", function() { return DragToScroll; }); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../helpers/dom/event.mjs */ "./node_modules/handsontable/helpers/dom/event.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var PLUGIN_KEY = 'dragToScroll'; var PLUGIN_PRIORITY = 100; /** * @description * Plugin used to scroll Handsontable by selecting a cell and dragging outside of the visible viewport. * * * @class DragToScroll * @plugin DragToScroll */ var DragToScroll = /*#__PURE__*/function (_BasePlugin) { _inherits(DragToScroll, _BasePlugin); var _super = _createSuper(DragToScroll); function DragToScroll(hotInstance) { var _this; _classCallCheck(this, DragToScroll); _this = _super.call(this, hotInstance); /** * Instance of {@link EventManager}. * * @private * @type {EventManager} */ _this.eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_13__["default"](_assertThisInitialized(_this)); /** * Size of an element and its position relative to the viewport, * e.g. {bottom: 449, height: 441, left: 8, right: 814, top: 8, width: 806, x: 8, y:8}. * * @type {DOMRect} */ _this.boundaries = null; /** * Callback function. * * @private * @type {Function} */ _this.callback = null; /** * Flag indicates mouseDown/mouseUp. * * @private * @type {boolean} */ _this.listening = false; 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 DragToScroll#enablePlugin} method is called. * * @returns {boolean} */ _createClass(DragToScroll, [{ key: "isEnabled", value: function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } this.addHook('afterOnCellMouseDown', function (event) { return _this2.setupListening(event); }); this.addHook('afterOnCellCornerMouseDown', function (event) { return _this2.setupListening(event); }); this.registerEvents(); _get(_getPrototypeOf(DragToScroll.prototype), "enablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); _get(_getPrototypeOf(DragToScroll.prototype), "updatePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { this.unregisterEvents(); _get(_getPrototypeOf(DragToScroll.prototype), "disablePlugin", this).call(this); } /** * Sets the value of the visible element. * * @param {DOMRect} boundaries An object with coordinates compatible with DOMRect. */ }, { key: "setBoundaries", value: function setBoundaries(boundaries) { this.boundaries = boundaries; } /** * Changes callback function. * * @param {Function} callback The callback function. */ }, { key: "setCallback", value: function setCallback(callback) { this.callback = callback; } /** * Checks if the mouse position (X, Y) is outside of the viewport and fires a callback with calculated X an Y diffs * between passed boundaries. * * @param {number} x Mouse X coordinate to check. * @param {number} y Mouse Y coordinate to check. */ }, { key: "check", value: function check(x, y) { var diffX = 0; var diffY = 0; if (y < this.boundaries.top) { // y is less than top diffY = y - this.boundaries.top; } else if (y > this.boundaries.bottom) { // y is more than bottom diffY = y - this.boundaries.bottom; } if (x < this.boundaries.left) { // x is less than left diffX = x - this.boundaries.left; } else if (x > this.boundaries.right) { // x is more than right diffX = x - this.boundaries.right; } this.callback(diffX, diffY); } /** * Enables listening on `mousemove` event. * * @private */ }, { key: "listen", value: function listen() { this.listening = true; } /** * Disables listening on `mousemove` event. * * @private */ }, { key: "unlisten", value: function unlisten() { this.listening = false; } /** * Returns current state of listening. * * @private * @returns {boolean} */ }, { key: "isListening", value: function isListening() { return this.listening; } /** * Registers dom listeners. * * @private */ }, { key: "registerEvents", value: function registerEvents() { var _this3 = this; var rootWindow = this.hot.rootWindow; var frame = rootWindow; while (frame) { this.eventManager.addEventListener(frame.document, 'contextmenu', function () { return _this3.unlisten(); }); this.eventManager.addEventListener(frame.document, 'mouseup', function () { return _this3.unlisten(); }); this.eventManager.addEventListener(frame.document, 'mousemove', function (event) { return _this3.onMouseMove(event); }); frame = Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["getParentWindow"])(frame); } } /** * Unbinds the events used by the plugin. * * @private */ }, { key: "unregisterEvents", value: function unregisterEvents() { this.eventManager.clear(); } /** * On after on cell/cellCorner mouse down listener. * * @private * @param {MouseEvent} event The mouse event object. */ }, { key: "setupListening", value: function setupListening(event) { if (Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_14__["isRightClick"])(event)) { return; } var scrollHandler = this.hot.view.wt.wtTable.holder; // native scroll if (scrollHandler === this.hot.rootWindow) { // not much we can do currently return; } this.setBoundaries(scrollHandler.getBoundingClientRect()); this.setCallback(function (scrollX, scrollY) { if (scrollX < 0) { scrollHandler.scrollLeft -= 50; } else if (scrollX > 0) { scrollHandler.scrollLeft += 50; } if (scrollY < 0) { scrollHandler.scrollTop -= 20; } else if (scrollY > 0) { scrollHandler.scrollTop += 20; } }); this.listen(); } /** * 'mouseMove' event callback. * * @private * @param {MouseEvent} event `mousemove` event properties. */ }, { key: "onMouseMove", value: function onMouseMove(event) { if (!this.isListening()) { return; } this.check(event.clientX, event.clientY); } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { _get(_getPrototypeOf(DragToScroll.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return DragToScroll; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_12__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/dragToScroll/index.mjs": /*!******************************************************************!*\ !*** ./node_modules/handsontable/plugins/dragToScroll/index.mjs ***! \******************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, DragToScroll */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _dragToScroll_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dragToScroll.mjs */ "./node_modules/handsontable/plugins/dragToScroll/dragToScroll.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _dragToScroll_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _dragToScroll_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragToScroll", function() { return _dragToScroll_mjs__WEBPACK_IMPORTED_MODULE_0__["DragToScroll"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/dropdownMenu/dropdownMenu.mjs": /*!*************************************************************************!*\ !*** ./node_modules/handsontable/plugins/dropdownMenu/dropdownMenu.mjs ***! \*************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, DropdownMenu */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return DropdownMenu; }); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _contextMenu_commandExecutor_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../contextMenu/commandExecutor.mjs */ "./node_modules/handsontable/plugins/contextMenu/commandExecutor.mjs"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _contextMenu_itemsFactory_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../contextMenu/itemsFactory.mjs */ "./node_modules/handsontable/plugins/contextMenu/itemsFactory.mjs"); /* harmony import */ var _contextMenu_menu_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../contextMenu/menu.mjs */ "./node_modules/handsontable/plugins/contextMenu/menu.mjs"); /* harmony import */ var _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../pluginHooks.mjs */ "./node_modules/handsontable/pluginHooks.mjs"); /* harmony import */ var _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../contextMenu/predefinedItems.mjs */ "./node_modules/handsontable/plugins/contextMenu/predefinedItems.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_21__["default"].getSingleton().register('afterDropdownMenuDefaultOptions'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_21__["default"].getSingleton().register('beforeDropdownMenuShow'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_21__["default"].getSingleton().register('afterDropdownMenuShow'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_21__["default"].getSingleton().register('afterDropdownMenuHide'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_21__["default"].getSingleton().register('afterDropdownMenuExecute'); var PLUGIN_KEY = 'dropdownMenu'; var PLUGIN_PRIORITY = 230; var BUTTON_CLASS_NAME = 'changeType'; /* eslint-disable jsdoc/require-description-complete-sentence */ /** * @plugin DropdownMenu * @class DropdownMenu * * @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](@/guides/accessories-and-menus/context-menu.md#context-menu-with-specific-options). * 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](@/guides/columns/column-menu.md) for examples. * * @example * ```js * 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, * colHeaders: true, * // enable and configure dropdown menu * dropdownMenu: ['remove_col', '---------', 'make_read_only', 'alignment'] * }); * ``` */ /* eslint-enable jsdoc/require-description-complete-sentence */ var DropdownMenu = /*#__PURE__*/function (_BasePlugin) { _inherits(DropdownMenu, _BasePlugin); var _super = _createSuper(DropdownMenu); function DropdownMenu(hotInstance) { var _this; _classCallCheck(this, DropdownMenu); _this = _super.call(this, hotInstance); /** * Instance of {@link EventManager}. * * @private * @type {EventManager} */ _this.eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_17__["default"](_assertThisInitialized(_this)); /** * Instance of {@link CommandExecutor}. * * @private * @type {CommandExecutor} */ _this.commandExecutor = new _contextMenu_commandExecutor_mjs__WEBPACK_IMPORTED_MODULE_16__["default"](_this.hot); /** * Instance of {@link ItemsFactory}. * * @private * @type {ItemsFactory} */ _this.itemsFactory = null; /** * Instance of {@link Menu}. * * @private * @type {Menu} */ _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 DropdownMenu#enablePlugin} method is called. * * @returns {boolean} */ _createClass(DropdownMenu, [{ key: "isEnabled", value: function isEnabled() { return this.hot.getSettings()[PLUGIN_KEY]; } /** * 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 _contextMenu_itemsFactory_mjs__WEBPACK_IMPORTED_MODULE_19__["default"](this.hot, DropdownMenu.DEFAULT_ITEMS); var settings = this.hot.getSettings()[PLUGIN_KEY]; var predefinedItems = { items: this.itemsFactory.getItems(settings) }; this.registerEvents(); if (typeof settings.callback === 'function') { this.commandExecutor.setCommonCallback(settings.callback); } _get(_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 _contextMenu_menu_mjs__WEBPACK_IMPORTED_MODULE_20__["default"](_this2.hot, { className: 'htDropdownMenu', keepInViewport: true, container: settings.uiContainer || _this2.hot.rootDocument.body }); _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 _this2$executeCommand; for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) { params[_key] = arguments[_key]; } return (_this2$executeCommand = _this2.executeCommand).call.apply(_this2$executeCommand, [_this2].concat(params)); }); // Register all commands. Predefined and added by user or by plugins Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__["arrayEach"])(menuItems, function (command) { return _this2.commandExecutor.registerCommand(command.key, command); }); }); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); _get(_getPrototypeOf(DropdownMenu.prototype), "updatePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { this.close(); if (this.menu) { this.menu.destroy(); } _get(_getPrototypeOf(DropdownMenu.prototype), "disablePlugin", this).call(this); } /** * Registers the DOM listeners. * * @private */ }, { key: "registerEvents", value: function registerEvents() { var _this3 = this; this.eventManager.addEventListener(this.hot.rootElement, 'click', function (event) { return _this3.onTableClick(event); }); } /** * Opens menu and re-position it based on the passed coordinates. * * @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: "open", value: function open(position) { if (!this.menu) { return; } this.menu.open(); if (position.width) { this.menu.setOffset('left', position.width); } this.menu.setPosition(position); } /** * Closes dropdown menu. */ }, { key: "close", value: function close() { if (!this.menu) { return; } this.menu.close(); } /** * 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 Additional parameters passed to the command executor. */ }, { key: "executeCommand", value: function executeCommand(commandName) { var _this$commandExecutor; for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { params[_key2 - 1] = arguments[_key2]; } (_this$commandExecutor = this.commandExecutor).execute.apply(_this$commandExecutor, [commandName].concat(params)); } /** * 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: "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(); } } } /** * Table click listener. * * @private * @param {Event} event The mouse event object. */ }, { key: "onTableClick", value: function onTableClick(event) { event.stopPropagation(); if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["hasClass"])(event.target, BUTTON_CLASS_NAME) && !this.menu.isOpened()) { var offsetTop = 0; var offsetLeft = 0; if (this.hot.rootDocument !== this.menu.container.ownerDocument) { var frameElement = this.hot.rootWindow.frameElement; var _frameElement$getBoun = frameElement.getBoundingClientRect(), top = _frameElement$getBoun.top, left = _frameElement$getBoun.left; offsetTop = top; offsetLeft = left; } var rect = event.target.getBoundingClientRect(); this.open({ left: rect.left + offsetLeft, top: rect.top + event.target.offsetHeight + 3 + offsetTop, width: rect.width, height: rect.height }); } } /** * On after get column header listener. * * @private * @param {number} col Visual column index. * @param {HTMLTableCellElement} TH Header's TH element. */ }, { key: "onAfterGetColHeader", value: function onAfterGetColHeader(col, TH) { // Corner or a higher-level header var headerRow = TH.parentNode; if (!headerRow) { return; } var headerRowList = headerRow.parentNode.childNodes; var level = Array.prototype.indexOf.call(headerRowList, headerRow); if (col < 0 || level !== headerRowList.length - 1) { return; } var existingButton = TH.querySelector(".".concat(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); } return; } var button = this.hot.rootDocument.createElement('button'); button.className = BUTTON_CLASS_NAME; // prevent page reload on button click button.onclick = function () { return false; }; TH.firstChild.insertBefore(button, TH.firstChild.firstChild); } /** * On menu before open listener. * * @private * @fires Hooks#beforeDropdownMenuShow */ }, { key: "onMenuBeforeOpen", value: function onMenuBeforeOpen() { this.hot.runHooks('beforeDropdownMenuShow', this); } /** * On menu after open listener. * * @private * @fires Hooks#afterDropdownMenuShow */ }, { key: "onMenuAfterOpen", value: function onMenuAfterOpen() { this.hot.runHooks('afterDropdownMenuShow', this); } /** * On menu after close listener. * * @private * @fires Hooks#afterDropdownMenuHide */ }, { key: "onMenuAfterClose", value: function onMenuAfterClose() { this.hot.listen(); this.hot.runHooks('afterDropdownMenuHide', this); } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { this.close(); if (this.menu) { this.menu.destroy(); } _get(_getPrototypeOf(DropdownMenu.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }, { key: "PLUGIN_DEPS", get: function get() { return ['plugin:AutoColumnSize']; } /** * Default menu items order when `dropdownMenu` is enabled by setting the config item to `true`. * * @returns {Array} */ }, { key: "DEFAULT_ITEMS", get: function get() { return [_contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_22__["COLUMN_LEFT"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_22__["COLUMN_RIGHT"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_22__["SEPARATOR"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_22__["REMOVE_COLUMN"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_22__["SEPARATOR"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_22__["CLEAR_COLUMN"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_22__["SEPARATOR"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_22__["READ_ONLY"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_22__["SEPARATOR"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_22__["ALIGNMENT"]]; } }]); return DropdownMenu; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_14__["BasePlugin"]); DropdownMenu.SEPARATOR = { name: _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_22__["SEPARATOR"] }; /***/ }), /***/ "./node_modules/handsontable/plugins/dropdownMenu/index.mjs": /*!******************************************************************!*\ !*** ./node_modules/handsontable/plugins/dropdownMenu/index.mjs ***! \******************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, DropdownMenu */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _dropdownMenu_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dropdownMenu.mjs */ "./node_modules/handsontable/plugins/dropdownMenu/dropdownMenu.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _dropdownMenu_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _dropdownMenu_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return _dropdownMenu_mjs__WEBPACK_IMPORTED_MODULE_0__["DropdownMenu"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/exportFile/dataProvider.mjs": /*!***********************************************************************!*\ !*** ./node_modules/handsontable/plugins/exportFile/dataProvider.mjs ***! \***********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } // Waiting for jshint >=2.9.0 where they added support for destructing // jshint ignore: start /** * @plugin ExportFile * @private */ var DataProvider = /*#__PURE__*/function () { function DataProvider(hotInstance) { _classCallCheck(this, DataProvider); /** * Handsontable instance. * * @type {Core} */ this.hot = hotInstance; /** * Format type class options. * * @type {object} */ this.options = {}; } /** * Set options for data provider. * * @param {object} options Object with specified options. */ _createClass(DataProvider, [{ key: "setOptions", value: function setOptions(options) { this.options = options; } /** * Get table data based on provided settings to the class constructor. * * @returns {Array} */ }, { key: "getData", value: function getData() { var _this = this; var _this$_getDataRange = this._getDataRange(), startRow = _this$_getDataRange.startRow, startCol = _this$_getDataRange.startCol, endRow = _this$_getDataRange.endRow, endCol = _this$_getDataRange.endCol; var options = this.options; var data = []; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_10__["rangeEach"])(startRow, endRow, function (rowIndex) { var row = []; if (!options.exportHiddenRows && _this._isHiddenRow(rowIndex)) { return; } Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_10__["rangeEach"])(startCol, endCol, function (colIndex) { if (!options.exportHiddenColumns && _this._isHiddenColumn(colIndex)) { return; } row.push(_this.hot.getDataAtCell(rowIndex, colIndex)); }); data.push(row); }); return data; } /** * Gets list of row headers. * * @returns {Array} */ }, { key: "getRowHeaders", value: function getRowHeaders() { var _this2 = this; var headers = []; if (this.options.rowHeaders) { var _this$_getDataRange2 = this._getDataRange(), startRow = _this$_getDataRange2.startRow, endRow = _this$_getDataRange2.endRow; var rowHeaders = this.hot.getRowHeader(); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_10__["rangeEach"])(startRow, endRow, function (row) { if (!_this2.options.exportHiddenRows && _this2._isHiddenRow(row)) { return; } headers.push(rowHeaders[row]); }); } return headers; } /** * Gets list of columns headers. * * @returns {Array} */ }, { key: "getColumnHeaders", value: function getColumnHeaders() { var _this3 = this; var headers = []; if (this.options.columnHeaders) { var _this$_getDataRange3 = this._getDataRange(), startCol = _this$_getDataRange3.startCol, endCol = _this$_getDataRange3.endCol; var colHeaders = this.hot.getColHeader(); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_10__["rangeEach"])(startCol, endCol, function (column) { if (!_this3.options.exportHiddenColumns && _this3._isHiddenColumn(column)) { return; } headers.push(colHeaders[column]); }); } return headers; } /** * Get data range object based on settings provided in the class constructor. * * @private * @returns {object} Returns object with keys `startRow`, `startCol`, `endRow` and `endCol`. */ }, { key: "_getDataRange", value: function _getDataRange() { var cols = this.hot.countCols() - 1; var rows = this.hot.countRows() - 1; var _this$options$range = _slicedToArray(this.options.range, 4), _this$options$range$ = _this$options$range[0], startRow = _this$options$range$ === void 0 ? 0 : _this$options$range$, _this$options$range$2 = _this$options$range[1], startCol = _this$options$range$2 === void 0 ? 0 : _this$options$range$2, _this$options$range$3 = _this$options$range[2], endRow = _this$options$range$3 === void 0 ? rows : _this$options$range$3, _this$options$range$4 = _this$options$range[3], endCol = _this$options$range$4 === void 0 ? cols : _this$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 }; } /** * Check if row at specified row index is hidden. * * @private * @param {number} row Row index. * @returns {boolean} */ }, { key: "_isHiddenRow", value: function _isHiddenRow(row) { return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(row)); } /** * Check if column at specified column index is hidden. * * @private * @param {number} column Visual column index. * @returns {boolean} */ }, { key: "_isHiddenColumn", value: function _isHiddenColumn(column) { return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(column)); } }]); return DataProvider; }(); /* harmony default export */ __webpack_exports__["default"] = (DataProvider); /***/ }), /***/ "./node_modules/handsontable/plugins/exportFile/exportFile.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/plugins/exportFile/exportFile.mjs ***! \*********************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, ExportFile */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExportFile", function() { return ExportFile; }); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/web.timers.js */ "./node_modules/core-js/modules/web.timers.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _dataProvider_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./dataProvider.mjs */ "./node_modules/handsontable/plugins/exportFile/dataProvider.mjs"); /* harmony import */ var _typeFactory_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./typeFactory.mjs */ "./node_modules/handsontable/plugins/exportFile/typeFactory.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var PLUGIN_KEY = 'exportFile'; var PLUGIN_PRIORITY = 240; /** * @plugin ExportFile * @class ExportFile * * @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](@/guides/accessories-and-menus/export-to-csv.md) 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 = /*#__PURE__*/function (_BasePlugin) { _inherits(ExportFile, _BasePlugin); var _super = _createSuper(ExportFile); function ExportFile() { _classCallCheck(this, ExportFile); return _super.apply(this, arguments); } _createClass(ExportFile, [{ key: "isEnabled", value: /** * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link hooks#beforeinit Hooks#beforeInit} * hook and if it returns `true` than the {@link export-file#enableplugin ExportFile#enablePlugin} method is called. * * @returns {boolean} */ function isEnabled() { return true; } /** * @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. */ /** * Exports table data as a string. * * @param {string} format Export format type eq. `'csv'`. * @param {ExportOptions} options Export options. * @returns {string} */ }, { key: "exportAsString", value: function exportAsString(format) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return this._createTypeFormatter(format, options).export(); } /** * Exports table data as a blob object. * * @param {string} format Export format type eq. `'csv'`. * @param {ExportOptions} options Export options. * @returns {Blob} */ }, { key: "exportAsBlob", value: function exportAsBlob(format) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return this._createBlob(this._createTypeFormatter(format, options)); } /** * Exports table data as a downloadable file. * * @param {string} format Export format type eq. `'csv'`. * @param {ExportOptions} options Export options. */ }, { key: "downloadFile", value: function downloadFile(format) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _this$hot = this.hot, rootDocument = _this$hot.rootDocument, rootWindow = _this$hot.rootWindow; var formatter = this._createTypeFormatter(format, options); var blob = this._createBlob(formatter); var URL = rootWindow.URL || rootWindow.webkitURL; var a = rootDocument.createElement('a'); var name = "".concat(formatter.options.filename, ".").concat(formatter.options.fileExtension); if (a.download !== void 0) { var url = URL.createObjectURL(blob); a.style.display = 'none'; a.setAttribute('href', url); a.setAttribute('download', name); rootDocument.body.appendChild(a); a.dispatchEvent(new MouseEvent('click')); rootDocument.body.removeChild(a); setTimeout(function () { URL.revokeObjectURL(url); }, 100); } else if (navigator.msSaveOrOpenBlob) { // IE10+ navigator.msSaveOrOpenBlob(blob, name); } } /** * Creates and returns class formatter for specified export type. * * @private * @param {string} format Export format type eq. `'csv'`. * @param {ExportOptions} options Export options. * @returns {BaseType} */ }, { key: "_createTypeFormatter", value: function _createTypeFormatter(format) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (!_typeFactory_mjs__WEBPACK_IMPORTED_MODULE_14__["EXPORT_TYPES"][format]) { throw new Error("Export format type \"".concat(format, "\" is not supported.")); } return Object(_typeFactory_mjs__WEBPACK_IMPORTED_MODULE_14__["default"])(format, new _dataProvider_mjs__WEBPACK_IMPORTED_MODULE_13__["default"](this.hot), options); } /** * Creates blob object based on provided type formatter class. * * @private * @param {BaseType} typeFormatter The instance of the specyfic formatter/exporter. * @returns {Blob} */ }, { key: "_createBlob", value: function _createBlob(typeFormatter) { var formatter = null; if (typeof Blob !== 'undefined') { formatter = new Blob([typeFormatter.export()], { type: "".concat(typeFormatter.options.mimeType, ";charset=").concat(typeFormatter.options.encoding) }); } return formatter; } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return ExportFile; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_12__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/exportFile/index.mjs": /*!****************************************************************!*\ !*** ./node_modules/handsontable/plugins/exportFile/index.mjs ***! \****************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, ExportFile */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _exportFile_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./exportFile.mjs */ "./node_modules/handsontable/plugins/exportFile/exportFile.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _exportFile_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _exportFile_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ExportFile", function() { return _exportFile_mjs__WEBPACK_IMPORTED_MODULE_0__["ExportFile"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/exportFile/typeFactory.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/plugins/exportFile/typeFactory.mjs ***! \**********************************************************************/ /*! exports provided: TYPE_CSV, TYPE_EXCEL, TYPE_PDF, EXPORT_TYPES, default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPE_CSV", function() { return TYPE_CSV; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPE_EXCEL", function() { return TYPE_EXCEL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPE_PDF", function() { return TYPE_PDF; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPORT_TYPES", function() { return EXPORT_TYPES; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return typeFactory; }); /* harmony import */ var _types_csv_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types/csv.mjs */ "./node_modules/handsontable/plugins/exportFile/types/csv.mjs"); 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 = 'csv'; var TYPE_EXCEL = 'excel'; // TODO var TYPE_PDF = 'pdf'; // TODO var EXPORT_TYPES = _defineProperty({}, TYPE_CSV, _types_csv_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]); /** * @param {string} type The exporter type. * @param {DataProvider} dataProvider The data provider. * @param {object} options Constructor options for exporter class. * @returns {BaseType|null} */ function typeFactory(type, dataProvider, options) { if (typeof EXPORT_TYPES[type] === 'function') { return new EXPORT_TYPES[type](dataProvider, options); } return null; } /***/ }), /***/ "./node_modules/handsontable/plugins/exportFile/types/_base.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/plugins/exportFile/types/_base.mjs ***! \**********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_string_pad_start_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.string.pad-start.js */ "./node_modules/core-js/modules/es.string.pad-start.js"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_string_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../helpers/string.mjs */ "./node_modules/handsontable/helpers/string.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * @plugin ExportFile * @private */ var BaseType = /*#__PURE__*/function () { function BaseType(dataProvider, options) { _classCallCheck(this, BaseType); /** * Data provider. * * @type {DataProvider} */ this.dataProvider = dataProvider; /** * Format type class options. * * @type {object} */ this.options = this._mergeOptions(options); this.dataProvider.setOptions(this.options); } /** * Merge options provided by users with defaults. * * @param {object} options An object with options to merge with. * @returns {object} Returns new options object. */ _createClass(BaseType, [{ key: "_mergeOptions", value: function _mergeOptions(options) { var _options = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["clone"])(this.constructor.DEFAULT_OPTIONS); var date = new Date(); _options = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["extend"])(Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["clone"])(BaseType.DEFAULT_OPTIONS), _options); _options = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["extend"])(_options, options); _options.filename = Object(_helpers_string_mjs__WEBPACK_IMPORTED_MODULE_2__["substitute"])(_options.filename, { YYYY: date.getFullYear(), MM: "".concat(date.getMonth() + 1).padStart(2, '0'), DD: "".concat(date.getDate()).padStart(2, '0') }); return _options; } }], [{ key: "DEFAULT_OPTIONS", get: /** * Default options. * * @returns {object} */ 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: [] }; } }]); return BaseType; }(); /* harmony default export */ __webpack_exports__["default"] = (BaseType); /***/ }), /***/ "./node_modules/handsontable/plugins/exportFile/types/csv.mjs": /*!********************************************************************!*\ !*** ./node_modules/handsontable/plugins/exportFile/types/csv.mjs ***! \********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js"); /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.replace.js */ "./node_modules/core-js/modules/es.string.replace.js"); /* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.regexp.constructor.js */ "./node_modules/core-js/modules/es.regexp.constructor.js"); /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/exportFile/types/_base.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var CHAR_CARRIAGE_RETURN = String.fromCharCode(13); var CHAR_DOUBLE_QUOTES = String.fromCharCode(34); var CHAR_LINE_FEED = String.fromCharCode(10); /** * @plugin ExportFile * @private */ var Csv = /*#__PURE__*/function (_BaseType) { _inherits(Csv, _BaseType); var _super = _createSuper(Csv); function Csv() { _classCallCheck(this, Csv); return _super.apply(this, arguments); } _createClass(Csv, [{ key: "export", value: /** * Create string body in desired format. * * @returns {string} */ function _export() { var _this = 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 = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayMap"])(columnHeaders, function (value) { return _this._escapeCell(value, true); }); if (hasRowHeaders) { result += options.columnDelimiter; } result += columnHeaders.join(options.columnDelimiter); result += options.rowDelimiter; } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayEach"])(data, function (value, index) { if (index > 0) { result += options.rowDelimiter; } if (hasRowHeaders) { result += _this._escapeCell(rowHeaders[index]) + options.columnDelimiter; } result += value.map(function (cellValue) { return _this._escapeCell(cellValue); }).join(options.columnDelimiter); }); return result; } /** * Escape cell value. * * @param {*} value Cell value. * @param {boolean} [force=false] Indicates if cell value will be escaped forcefully. * @returns {string} */ }, { key: "_escapeCell", value: function _escapeCell(value) { var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var escapedValue = Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_18__["stringify"])(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)) { escapedValue = escapedValue.replace(new RegExp('"', 'g'), '""'); escapedValue = "\"".concat(escapedValue, "\""); } return escapedValue; } }], [{ key: "DEFAULT_OPTIONS", get: /** * Default options for exporting CSV format. * * @returns {object} */ function get() { return { mimeType: 'text/csv', fileExtension: 'csv', bom: true, columnDelimiter: ',', rowDelimiter: '\r\n' }; } }]); return Csv; }(_base_mjs__WEBPACK_IMPORTED_MODULE_19__["default"]); /* harmony default export */ __webpack_exports__["default"] = (Csv); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/component/_base.mjs": /*!***********************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/component/_base.mjs ***! \***********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../mixins/localHooks.mjs */ "./node_modules/handsontable/mixins/localHooks.mjs"); /* harmony import */ var _translations_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../translations/index.mjs */ "./node_modules/handsontable/translations/index.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * @plugin Filters * @class BaseComponent */ var BaseComponent = /*#__PURE__*/function () { function BaseComponent(hotInstance, _ref) { var id = _ref.id, _ref$stateless = _ref.stateless, stateless = _ref$stateless === void 0 ? true : _ref$stateless; _classCallCheck(this, BaseComponent); /** * The Handsontable instance. * * @type {Core} */ this.hot = hotInstance; /** * The component uniq id. * * @type {string} */ this.id = id; /** * List of registered component UI elements. * * @type {Array} */ this.elements = []; /** * Flag which determines if element is hidden. * * @type {boolean} */ this.hidden = false; /** * The component states id. * * @type {string} */ this.stateId = "Filters.component.".concat(this.id); /** * Index map which stores component states for each column. * * @type {LinkedPhysicalIndexToValueMap|null} */ this.state = stateless ? null : this.hot.columnIndexMapper.registerMap(this.stateId, new _translations_index_mjs__WEBPACK_IMPORTED_MODULE_3__["LinkedPhysicalIndexToValueMap"]()); } /** * Reset elements to its initial state. */ _createClass(BaseComponent, [{ key: "reset", value: function reset() { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_0__["arrayEach"])(this.elements, function (ui) { return ui.reset(); }); } /** * Hide component. */ }, { key: "hide", value: function hide() { this.hidden = true; } /** * Show component. */ }, { key: "show", value: function show() { this.hidden = false; } /** * Check if component is hidden. * * @returns {boolean} */ }, { key: "isHidden", value: function isHidden() { return this.hot === null || this.hidden; } /** * Restores the component state from the given physical column index. The method * internally calls the `setState` method. The state then is individually processed * by each component. * * @param {number} physicalColumn The physical column index. */ }, { key: "restoreState", value: function restoreState(physicalColumn) { if (this.state) { this.setState(this.state.getValueAtIndex(physicalColumn)); } } /** * The custom logic for component state restoring. */ }, { key: "setState", value: function setState() { throw new Error('The state setting logic is not implemented'); } /** * Saves the component state to the given physical column index. The method * internally calls the `getState` method, which returns the current state of * the component. * * @param {number} physicalColumn The physical column index. */ }, { key: "saveState", value: function saveState(physicalColumn) { if (this.state) { this.state.setValueAtIndex(physicalColumn, this.getState()); } } /** * The custom logic for component state gathering (for stateful components). */ }, { key: "getState", value: function getState() { throw new Error('The state gathering logic is not implemented'); } /** * Destroy element. */ }, { key: "destroy", value: function destroy() { this.hot.columnIndexMapper.unregisterMap(this.stateId); this.clearLocalHooks(); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_0__["arrayEach"])(this.elements, function (ui) { return ui.destroy(); }); this.state = null; this.elements = null; this.hot = null; } }]); return BaseComponent; }(); Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["mixin"])(BaseComponent, _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]); /* harmony default export */ __webpack_exports__["default"] = (BaseComponent); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/component/actionBar.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/component/actionBar.mjs ***! \***************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/filters/component/_base.mjs"); /* harmony import */ var _ui_input_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../ui/input.mjs */ "./node_modules/handsontable/plugins/filters/ui/input.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /** * @class ActionBarComponent * @plugin Filters */ var ActionBarComponent = /*#__PURE__*/function (_BaseComponent) { _inherits(ActionBarComponent, _BaseComponent); var _super = _createSuper(ActionBarComponent); function ActionBarComponent(hotInstance, options) { var _this; _classCallCheck(this, ActionBarComponent); _this = _super.call(this, hotInstance, { id: options.id, stateless: true }); _this.name = options.name; _this.elements.push(new _ui_input_mjs__WEBPACK_IMPORTED_MODULE_15__["default"](_this.hot, { type: 'button', value: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_13__["FILTERS_BUTTONS_OK"], className: 'htUIButton htUIButtonOK', identifier: ActionBarComponent.BUTTON_OK })); _this.elements.push(new _ui_input_mjs__WEBPACK_IMPORTED_MODULE_15__["default"](_this.hot, { type: 'button', value: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_13__["FILTERS_BUTTONS_CANCEL"], className: 'htUIButton htUIButtonCancel', identifier: ActionBarComponent.BUTTON_CANCEL })); _this.registerHooks(); return _this; } /** * Register all necessary hooks. * * @private */ _createClass(ActionBarComponent, [{ key: "registerHooks", value: function registerHooks() { var _this2 = this; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_12__["arrayEach"])(this.elements, function (element) { element.addLocalHook('click', function (event, button) { return _this2.onButtonClick(event, button); }); }); } /** * Get menu object descriptor. * * @returns {object} */ }, { key: "getMenuItemDescriptor", value: function getMenuItemDescriptor() { var _this3 = this; return { key: this.id, name: this.name, isCommand: false, disableSelection: true, hidden: function hidden() { return _this3.isHidden(); }, renderer: function renderer(hot, wrapper) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_11__["addClass"])(wrapper.parentNode, 'htFiltersMenuActionBar'); if (!wrapper.parentNode.hasAttribute('ghost-table')) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_12__["arrayEach"])(_this3.elements, function (ui) { return wrapper.appendChild(ui.element); }); } return wrapper; } }; } /** * Fire accept event. */ }, { key: "accept", value: function accept() { this.runLocalHooks('accept'); } /** * Fire cancel event. */ }, { key: "cancel", value: function cancel() { this.runLocalHooks('cancel'); } /** * On button click listener. * * @private * @param {Event} event DOM event. * @param {InputUI} button InputUI object. */ }, { key: "onButtonClick", value: function onButtonClick(event, button) { if (button.options.identifier === ActionBarComponent.BUTTON_OK) { this.accept(); } else { this.cancel(); } } }], [{ key: "BUTTON_OK", get: function get() { return 'ok'; } }, { key: "BUTTON_CANCEL", get: function get() { return 'cancel'; } }]); return ActionBarComponent; }(_base_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]); /* harmony default export */ __webpack_exports__["default"] = (ActionBarComponent); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/component/condition.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/component/condition.mjs ***! \***************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.string.starts-with.js */ "./node_modules/core-js/modules/es.string.starts-with.js"); /* harmony import */ var core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/web.timers.js */ "./node_modules/core-js/modules/web.timers.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../helpers/dom/event.mjs */ "./node_modules/handsontable/helpers/dom/event.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../helpers/unicode.mjs */ "./node_modules/handsontable/helpers/unicode.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/filters/component/_base.mjs"); /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/handsontable/plugins/filters/constants.mjs"); /* harmony import */ var _ui_input_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../ui/input.mjs */ "./node_modules/handsontable/plugins/filters/ui/input.mjs"); /* harmony import */ var _ui_select_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../ui/select.mjs */ "./node_modules/handsontable/plugins/filters/ui/select.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /** * @class ConditionComponent * @plugin Filters */ var ConditionComponent = /*#__PURE__*/function (_BaseComponent) { _inherits(ConditionComponent, _BaseComponent); var _super = _createSuper(ConditionComponent); function ConditionComponent(hotInstance, options) { var _this; _classCallCheck(this, ConditionComponent); _this = _super.call(this, hotInstance, { id: options.id, stateless: false }); _this.name = options.name; _this.addSeparator = options.addSeparator; _this.elements.push(new _ui_select_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](_this.hot, { menuContainer: options.menuContainer })); _this.elements.push(new _ui_input_mjs__WEBPACK_IMPORTED_MODULE_26__["default"](_this.hot, { placeholder: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_23__["FILTERS_BUTTONS_PLACEHOLDER_VALUE"] })); _this.elements.push(new _ui_input_mjs__WEBPACK_IMPORTED_MODULE_26__["default"](_this.hot, { placeholder: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_23__["FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE"] })); _this.registerHooks(); return _this; } /** * Register all necessary hooks. * * @private */ _createClass(ConditionComponent, [{ key: "registerHooks", value: function registerHooks() { var _this2 = this; this.getSelectElement().addLocalHook('select', function (command) { return _this2.onConditionSelect(command); }); this.getSelectElement().addLocalHook('afterClose', function () { return _this2.onSelectUIClosed(); }); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.getInputElements(), function (input) { input.addLocalHook('keydown', function (event) { return _this2.onInputKeyDown(event); }); }); } /** * Set state of the component. * * @param {object} value State to restore. */ }, { key: "setState", value: function setState(value) { var _this3 = this; this.reset(); if (!value) { return; } var copyOfCommand = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_22__["clone"])(value.command); if (copyOfCommand.name.startsWith(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_23__["FILTERS_CONDITIONS_NAMESPACE"])) { copyOfCommand.name = this.hot.getTranslatedPhrase(copyOfCommand.name); } this.getSelectElement().setValue(copyOfCommand); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(value.args, function (arg, index) { if (index > copyOfCommand.inputsCount - 1) { return false; } var element = _this3.getInputElement(index); element.setValue(arg); element[copyOfCommand.inputsCount > index ? 'show' : 'hide'](); if (!index) { setTimeout(function () { return element.focus(); }, 10); } }); } /** * Export state of the component (get selected filter and filter arguments). * * @returns {object} Returns object where `command` key keeps used condition filter and `args` key its arguments. */ }, { key: "getState", value: function getState() { var command = this.getSelectElement().getValue() || Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_28__["getConditionDescriptor"])(_constants_mjs__WEBPACK_IMPORTED_MODULE_25__["CONDITION_NONE"]); var args = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.getInputElements(), function (element, index) { if (command.inputsCount > index) { args.push(element.getValue()); } }); return { command: command, args: args }; } /** * Update state of component. * * @param {object} condition The condition object. * @param {object} condition.command The command object with condition name as `key` property. * @param {Array} condition.args An array of values to compare. * @param {number} column Physical column index. */ }, { key: "updateState", value: function updateState(condition, column) { var command = condition ? Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_28__["getConditionDescriptor"])(condition.name) : Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_28__["getConditionDescriptor"])(_constants_mjs__WEBPACK_IMPORTED_MODULE_25__["CONDITION_NONE"]); this.state.setValueAtIndex(column, { command: command, args: condition ? condition.args : [] }); if (!condition) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.getInputElements(), function (element) { return element.setValue(null); }); } } /** * Get select element. * * @returns {SelectUI} */ }, { key: "getSelectElement", value: function getSelectElement() { return this.elements.filter(function (element) { return element instanceof _ui_select_mjs__WEBPACK_IMPORTED_MODULE_27__["default"]; })[0]; } /** * Get input element. * * @param {number} index Index an array of elements. * @returns {InputUI} */ }, { key: "getInputElement", value: function getInputElement() { var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; return this.getInputElements()[index]; } /** * Get input elements. * * @returns {Array} */ }, { key: "getInputElements", value: function getInputElements() { return this.elements.filter(function (element) { return element instanceof _ui_input_mjs__WEBPACK_IMPORTED_MODULE_26__["default"]; }); } /** * Get menu object descriptor. * * @returns {object} */ }, { key: "getMenuItemDescriptor", value: function getMenuItemDescriptor() { var _this4 = this; return { key: this.id, name: this.name, isCommand: false, disableSelection: true, hidden: function hidden() { return _this4.isHidden(); }, renderer: function renderer(hot, wrapper, row, col, prop, value) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(wrapper.parentNode, 'htFiltersMenuCondition'); if (_this4.addSeparator) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(wrapper.parentNode, 'border'); } var label = _this4.hot.rootDocument.createElement('div'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(label, 'htFiltersMenuLabel'); label.textContent = value; wrapper.appendChild(label); if (!wrapper.parentNode.hasAttribute('ghost-table')) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(_this4.elements, function (ui) { return wrapper.appendChild(ui.element); }); } return wrapper; } }; } /** * Reset elements to their initial state. */ }, { key: "reset", value: function reset() { var _this$hot; var lastSelectedColumn = this.hot.getPlugin('filters').getSelectedColumn(); var visualIndex = lastSelectedColumn && lastSelectedColumn.visualIndex; var columnType = (_this$hot = this.hot).getDataType.apply(_this$hot, _toConsumableArray(this.hot.getSelectedLast() || [0, visualIndex])); var items = Object(_constants_mjs__WEBPACK_IMPORTED_MODULE_25__["default"])(columnType); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.getInputElements(), function (element) { return element.hide(); }); this.getSelectElement().setItems(items); _get(_getPrototypeOf(ConditionComponent.prototype), "reset", this).call(this); // Select element as default 'None' this.getSelectElement().setValue(items[0]); } /** * On condition select listener. * * @private * @param {object} command Menu item object (command). */ }, { key: "onConditionSelect", value: function onConditionSelect(command) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.getInputElements(), function (element, index) { element[command.inputsCount > index ? 'show' : 'hide'](); if (index === 0) { setTimeout(function () { return element.focus(); }, 10); } }); this.runLocalHooks('change', command); } /** * On component SelectUI closed listener. * * @private */ }, { key: "onSelectUIClosed", value: function onSelectUIClosed() { this.runLocalHooks('afterClose'); } /** * Key down listener. * * @private * @param {Event} event The DOM event object. */ }, { key: "onInputKeyDown", value: function onInputKeyDown(event) { if (Object(_helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_21__["isKey"])(event.keyCode, 'ENTER')) { this.runLocalHooks('accept'); Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_19__["stopImmediatePropagation"])(event); } else if (Object(_helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_21__["isKey"])(event.keyCode, 'ESCAPE')) { this.runLocalHooks('cancel'); Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_19__["stopImmediatePropagation"])(event); } } }]); return ConditionComponent; }(_base_mjs__WEBPACK_IMPORTED_MODULE_24__["default"]); /* harmony default export */ __webpack_exports__["default"] = (ConditionComponent); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/component/operators.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/component/operators.mjs ***! \***************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.freeze.js */ "./node_modules/core-js/modules/es.object.freeze.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.array.find.js */ "./node_modules/core-js/modules/es.array.find.js"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../helpers/templateLiteralTag.mjs */ "./node_modules/handsontable/helpers/templateLiteralTag.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/filters/component/_base.mjs"); /* harmony import */ var _logicalOperationRegisterer_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../logicalOperationRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/logicalOperationRegisterer.mjs"); /* harmony import */ var _logicalOperations_conjunction_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../logicalOperations/conjunction.mjs */ "./node_modules/handsontable/plugins/filters/logicalOperations/conjunction.mjs"); /* harmony import */ var _logicalOperations_disjunction_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../logicalOperations/disjunction.mjs */ "./node_modules/handsontable/plugins/filters/logicalOperations/disjunction.mjs"); /* harmony import */ var _logicalOperations_disjunctionWithExtraCondition_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../logicalOperations/disjunctionWithExtraCondition.mjs */ "./node_modules/handsontable/plugins/filters/logicalOperations/disjunctionWithExtraCondition.mjs"); /* harmony import */ var _ui_radioInput_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../ui/radioInput.mjs */ "./node_modules/handsontable/plugins/filters/ui/radioInput.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var _templateObject; function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } 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"); } } 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; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var SELECTED_AT_START_ELEMENT_INDEX = 0; /** * @class OperatorsComponent * @plugin Filters */ var OperatorsComponent = /*#__PURE__*/function (_BaseComponent) { _inherits(OperatorsComponent, _BaseComponent); var _super = _createSuper(OperatorsComponent); function OperatorsComponent(hotInstance, options) { var _this; _classCallCheck(this, OperatorsComponent); _this = _super.call(this, hotInstance, { id: options.id, stateless: false }); _this.name = options.name; _this.buildOperatorsElement(); return _this; } /** * Get menu object descriptor. * * @returns {object} */ _createClass(OperatorsComponent, [{ key: "getMenuItemDescriptor", value: function getMenuItemDescriptor() { var _this2 = this; return { key: this.id, name: this.name, isCommand: false, disableSelection: true, hidden: function hidden() { return _this2.isHidden(); }, renderer: function renderer(hot, wrapper) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_14__["addClass"])(wrapper.parentNode, 'htFiltersMenuOperators'); if (!wrapper.parentNode.hasAttribute('ghost-table')) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__["arrayEach"])(_this2.elements, function (ui) { return wrapper.appendChild(ui.element); }); } return wrapper; } }; } /** * Add RadioInputUI elements to component. * * @private */ }, { key: "buildOperatorsElement", value: function buildOperatorsElement() { var _this3 = this; var operationKeys = [_logicalOperations_conjunction_mjs__WEBPACK_IMPORTED_MODULE_19__["OPERATION_ID"], _logicalOperations_disjunction_mjs__WEBPACK_IMPORTED_MODULE_20__["OPERATION_ID"]]; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__["arrayEach"])(operationKeys, function (operation) { var radioInput = new _ui_radioInput_mjs__WEBPACK_IMPORTED_MODULE_22__["default"](_this3.hot, { name: 'operator', label: { htmlFor: operation, textContent: Object(_logicalOperationRegisterer_mjs__WEBPACK_IMPORTED_MODULE_18__["getOperationName"])(operation) }, value: operation, checked: operation === operationKeys[SELECTED_AT_START_ELEMENT_INDEX], id: operation }); radioInput.addLocalHook('change', function (event) { return _this3.onRadioInputChange(event); }); _this3.elements.push(radioInput); }); } /** * Set state of operators component to check radio input at specific `index`. * * @param {number} searchedIndex Index of radio input to check. */ }, { key: "setChecked", value: function setChecked(searchedIndex) { if (this.elements.length < searchedIndex) { throw Error(Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_16__["toSingleLine"])(_templateObject || (_templateObject = _taggedTemplateLiteral(["Radio button with index ", " doesn't exist."])), searchedIndex)); } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__["arrayEach"])(this.elements, function (element, index) { element.setChecked(index === searchedIndex); }); } /** * Get `id` of active operator. * * @returns {string} */ }, { key: "getActiveOperationId", value: function getActiveOperationId() { var operationElement = this.elements.find(function (element) { return element instanceof _ui_radioInput_mjs__WEBPACK_IMPORTED_MODULE_22__["default"] && element.isChecked(); }); if (operationElement) { return operationElement.getValue(); } return _logicalOperations_conjunction_mjs__WEBPACK_IMPORTED_MODULE_19__["OPERATION_ID"]; } /** * Export state of the component (get selected operator). * * @returns {string} Returns `id` of selected operator. */ }, { key: "getState", value: function getState() { return this.getActiveOperationId(); } /** * Set state of the component. * * @param {object} value State to restore. */ }, { key: "setState", value: function setState(value) { this.reset(); if (value && this.getActiveOperationId() !== value) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__["arrayEach"])(this.elements, function (element) { element.setChecked(element.getValue() === value); }); } } /** * Update state of component. * * @param {string} [operationId='conjunction'] Id of selected operation. * @param {number} column Physical column index. */ }, { key: "updateState", value: function updateState() { var operationId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _logicalOperations_conjunction_mjs__WEBPACK_IMPORTED_MODULE_19__["OPERATION_ID"]; var column = arguments.length > 1 ? arguments[1] : undefined; var selectedOperationId = operationId; if (selectedOperationId === _logicalOperations_disjunctionWithExtraCondition_mjs__WEBPACK_IMPORTED_MODULE_21__["OPERATION_ID"]) { selectedOperationId = _logicalOperations_disjunction_mjs__WEBPACK_IMPORTED_MODULE_20__["OPERATION_ID"]; } this.state.setValueAtIndex(column, selectedOperationId); } /** * Reset elements to their initial state. */ }, { key: "reset", value: function reset() { this.setChecked(SELECTED_AT_START_ELEMENT_INDEX); } /** * OnChange listener. * * @private * @param {Event} event The DOM event object. */ }, { key: "onRadioInputChange", value: function onRadioInputChange(event) { this.setState(event.target.value); } }]); return OperatorsComponent; }(_base_mjs__WEBPACK_IMPORTED_MODULE_17__["default"]); /* harmony default export */ __webpack_exports__["default"] = (OperatorsComponent); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/component/value.mjs": /*!***********************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/component/value.mjs ***! \***********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../helpers/dom/event.mjs */ "./node_modules/handsontable/helpers/dom/event.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../helpers/unicode.mjs */ "./node_modules/handsontable/helpers/unicode.mjs"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../utils.mjs */ "./node_modules/handsontable/plugins/filters/utils.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/filters/component/_base.mjs"); /* harmony import */ var _ui_multipleSelect_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../ui/multipleSelect.mjs */ "./node_modules/handsontable/plugins/filters/ui/multipleSelect.mjs"); /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/handsontable/plugins/filters/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /** * @class ValueComponent * @plugin Filters */ var ValueComponent = /*#__PURE__*/function (_BaseComponent) { _inherits(ValueComponent, _BaseComponent); var _super = _createSuper(ValueComponent); function ValueComponent(hotInstance, options) { var _this; _classCallCheck(this, ValueComponent); _this = _super.call(this, hotInstance, { id: options.id, stateless: false }); _this.name = options.name; _this.elements.push(new _ui_multipleSelect_mjs__WEBPACK_IMPORTED_MODULE_23__["default"](_this.hot)); _this.registerHooks(); return _this; } /** * Register all necessary hooks. * * @private */ _createClass(ValueComponent, [{ key: "registerHooks", value: function registerHooks() { var _this2 = this; this.getMultipleSelectElement().addLocalHook('keydown', function (event) { return _this2.onInputKeyDown(event); }); } /** * Set state of the component. * * @param {object} value The component value. */ }, { key: "setState", value: function setState(value) { this.reset(); if (value && value.command.key === _constants_mjs__WEBPACK_IMPORTED_MODULE_24__["CONDITION_BY_VALUE"]) { var select = this.getMultipleSelectElement(); select.setItems(value.itemsSnapshot); select.setValue(value.args[0]); } } /** * Export state of the component (get selected filter and filter arguments). * * @returns {object} Returns object where `command` key keeps used condition filter and `args` key its arguments. */ }, { key: "getState", value: function getState() { var select = this.getMultipleSelectElement(); var availableItems = select.getItems(); return { command: { key: select.isSelectedAllValues() || !availableItems.length ? _constants_mjs__WEBPACK_IMPORTED_MODULE_24__["CONDITION_NONE"] : _constants_mjs__WEBPACK_IMPORTED_MODULE_24__["CONDITION_BY_VALUE"] }, args: [select.getValue()], itemsSnapshot: availableItems }; } /** * Update state of component. * * @param {object} stateInfo Information about state containing stack of edited column, * stack of dependent conditions, data factory and optional condition arguments change. It's described by object containing keys: * `editedConditionStack`, `dependentConditionStacks`, `visibleDataFactory` and `conditionArgsChange`. */ }, { key: "updateState", value: function updateState(stateInfo) { var _this3 = this; var updateColumnState = function updateColumnState(physicalColumn, conditions, conditionArgsChange, filteredRowsFactory, conditionsStack) { var _arrayFilter = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_18__["arrayFilter"])(conditions, function (condition) { return condition.name === _constants_mjs__WEBPACK_IMPORTED_MODULE_24__["CONDITION_BY_VALUE"]; }), _arrayFilter2 = _slicedToArray(_arrayFilter, 1), firstByValueCondition = _arrayFilter2[0]; var state = {}; var defaultBlankCellValue = _this3.hot.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_20__["FILTERS_VALUES_BLANK_CELLS"]); if (firstByValueCondition) { var rowValues = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_21__["unifyColumnValues"])(Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_18__["arrayMap"])(filteredRowsFactory(physicalColumn, conditionsStack), function (row) { return row.value; })); if (conditionArgsChange) { firstByValueCondition.args[0] = conditionArgsChange; } var selectedValues = []; var itemsSnapshot = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_21__["intersectValues"])(rowValues, firstByValueCondition.args[0], defaultBlankCellValue, function (item) { if (item.checked) { selectedValues.push(item.value); } }); state.args = [selectedValues]; state.command = Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_25__["getConditionDescriptor"])(_constants_mjs__WEBPACK_IMPORTED_MODULE_24__["CONDITION_BY_VALUE"]); state.itemsSnapshot = itemsSnapshot; } else { state.args = []; state.command = Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_25__["getConditionDescriptor"])(_constants_mjs__WEBPACK_IMPORTED_MODULE_24__["CONDITION_NONE"]); } _this3.state.setValueAtIndex(physicalColumn, state); }; updateColumnState(stateInfo.editedConditionStack.column, stateInfo.editedConditionStack.conditions, stateInfo.conditionArgsChange, stateInfo.filteredRowsFactory); // Update the next "by_value" component (filter column conditions added after this condition). // Its list of values has to be updated. As the new values by default are unchecked, // the further component update is unnecessary. if (stateInfo.dependentConditionStacks.length) { updateColumnState(stateInfo.dependentConditionStacks[0].column, stateInfo.dependentConditionStacks[0].conditions, stateInfo.conditionArgsChange, stateInfo.filteredRowsFactory, stateInfo.editedConditionStack); } } /** * Get multiple select element. * * @returns {MultipleSelectUI} */ }, { key: "getMultipleSelectElement", value: function getMultipleSelectElement() { return this.elements.filter(function (element) { return element instanceof _ui_multipleSelect_mjs__WEBPACK_IMPORTED_MODULE_23__["default"]; })[0]; } /** * Get object descriptor for menu item entry. * * @returns {object} */ }, { key: "getMenuItemDescriptor", value: function getMenuItemDescriptor() { var _this4 = this; return { key: this.id, name: this.name, isCommand: false, disableSelection: true, hidden: function hidden() { return _this4.isHidden(); }, renderer: function renderer(hot, wrapper, row, col, prop, value) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_16__["addClass"])(wrapper.parentNode, 'htFiltersMenuValue'); var label = _this4.hot.rootDocument.createElement('div'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_16__["addClass"])(label, 'htFiltersMenuLabel'); label.textContent = value; wrapper.appendChild(label); if (!wrapper.parentNode.hasAttribute('ghost-table')) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_18__["arrayEach"])(_this4.elements, function (ui) { return wrapper.appendChild(ui.element); }); } return wrapper; } }; } /** * Reset elements to their initial state. */ }, { key: "reset", value: function reset() { var defaultBlankCellValue = this.hot.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_20__["FILTERS_VALUES_BLANK_CELLS"]); var values = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_21__["unifyColumnValues"])(this._getColumnVisibleValues()); var items = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_21__["intersectValues"])(values, values, defaultBlankCellValue); this.getMultipleSelectElement().setItems(items); _get(_getPrototypeOf(ValueComponent.prototype), "reset", this).call(this); this.getMultipleSelectElement().setValue(values); } /** * Key down listener. * * @private * @param {Event} event The DOM event object. */ }, { key: "onInputKeyDown", value: function onInputKeyDown(event) { if (Object(_helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_19__["isKey"])(event.keyCode, 'ESCAPE')) { this.runLocalHooks('cancel'); Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_17__["stopImmediatePropagation"])(event); } } /** * Get data for currently selected column. * * @returns {Array} * @private */ }, { key: "_getColumnVisibleValues", value: function _getColumnVisibleValues() { var lastSelectedColumn = this.hot.getPlugin('filters').getSelectedColumn(); var visualIndex = lastSelectedColumn && lastSelectedColumn.visualIndex; return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_18__["arrayMap"])(this.hot.getDataAtCol(visualIndex), function (v) { return Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_21__["toEmptyString"])(v); }); } }]); return ValueComponent; }(_base_mjs__WEBPACK_IMPORTED_MODULE_22__["default"]); /* harmony default export */ __webpack_exports__["default"] = (ValueComponent); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/beginsWith.mjs": /*!****************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/beginsWith.mjs ***! \****************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.string.starts-with.js */ "./node_modules/core-js/modules/es.string.starts-with.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var CONDITION_NAME = 'begins_with'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @param {*} inputValues."0" Value to check if it occurs at the beginning. * @returns {boolean} */ function condition(dataRow, _ref) { var _ref2 = _slicedToArray(_ref, 1), value = _ref2[0]; return Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_12__["stringify"])(dataRow.value).toLowerCase().startsWith(Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_12__["stringify"])(value)); } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_13__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_11__["FILTERS_CONDITIONS_BEGINS_WITH"], inputsCount: 1, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/between.mjs": /*!*************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/between.mjs ***! \*************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); /* harmony import */ var _date_after_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./date/after.mjs */ "./node_modules/handsontable/plugins/filters/condition/date/after.mjs"); /* harmony import */ var _date_before_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./date/before.mjs */ "./node_modules/handsontable/plugins/filters/condition/date/before.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var CONDITION_NAME = 'between'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @param {number} inputValues."0" The minimum value of the range. * @param {number} inputValues."1" The maximum value of the range. * @returns {boolean} */ 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 = Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_11__["getCondition"])(_date_before_mjs__WEBPACK_IMPORTED_MODULE_13__["CONDITION_NAME"], [toValue]); var dateAfter = Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_11__["getCondition"])(_date_after_mjs__WEBPACK_IMPORTED_MODULE_12__["CONDITION_NAME"], [fromValue]); return dateBefore(dataRow) && dateAfter(dataRow); } return dataRow.value >= fromValue && dataRow.value <= toValue; } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_11__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__["FILTERS_CONDITIONS_BETWEEN"], inputsCount: 2, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/byValue.mjs": /*!*************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/byValue.mjs ***! \*************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils.mjs */ "./node_modules/handsontable/plugins/filters/utils.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var CONDITION_NAME = 'by_value'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @param {Function} inputValues."0" A function to compare row's data. * @returns {boolean} */ function condition(dataRow, _ref) { var _ref2 = _slicedToArray(_ref, 1), value = _ref2[0]; return value(dataRow.value); } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_10__["registerCondition"])(CONDITION_NAME, condition, { name: 'By value', inputsCount: 0, inputValuesDecorator: function inputValuesDecorator(_ref3) { var _ref4 = _slicedToArray(_ref3, 1), data = _ref4[0]; return [Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_11__["createArrayAssertion"])(data)]; }, showOperators: false }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/contains.mjs": /*!**************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/contains.mjs ***! \**************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var CONDITION_NAME = 'contains'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @param {*} inputValues."0" A value to check if it occurs in the row's data. * @returns {boolean} */ function condition(dataRow, _ref) { var _ref2 = _slicedToArray(_ref, 1), value = _ref2[0]; return Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_12__["stringify"])(dataRow.value).toLowerCase().indexOf(Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_12__["stringify"])(value)) >= 0; } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_13__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_11__["FILTERS_CONDITIONS_CONTAINS"], inputsCount: 1, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/date/after.mjs": /*!****************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/date/after.mjs ***! \****************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! moment */ "./node_modules/handsontable/node_modules/moment/moment.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var CONDITION_NAME = 'date_after'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @param {*} inputValues."0" Minimum date of a range. * @returns {boolean} */ function condition(dataRow, _ref) { var _ref2 = _slicedToArray(_ref, 1), value = _ref2[0]; var date = moment__WEBPACK_IMPORTED_MODULE_10__(dataRow.value, dataRow.meta.dateFormat); var inputDate = moment__WEBPACK_IMPORTED_MODULE_10__(value, dataRow.meta.dateFormat); if (!date.isValid() || !inputDate.isValid()) { return false; } return date.diff(inputDate) >= 0; } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_12__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_11__["FILTERS_CONDITIONS_AFTER"], inputsCount: 1, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/date/before.mjs": /*!*****************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/date/before.mjs ***! \*****************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! moment */ "./node_modules/handsontable/node_modules/moment/moment.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var CONDITION_NAME = 'date_before'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @param {*} inputValues."0" Maximum date of a range. * @returns {boolean} */ function condition(dataRow, _ref) { var _ref2 = _slicedToArray(_ref, 1), value = _ref2[0]; var date = moment__WEBPACK_IMPORTED_MODULE_10__(dataRow.value, dataRow.meta.dateFormat); var inputDate = moment__WEBPACK_IMPORTED_MODULE_10__(value, dataRow.meta.dateFormat); if (!date.isValid() || !inputDate.isValid()) { return false; } return date.diff(inputDate) <= 0; } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_12__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_11__["FILTERS_CONDITIONS_BEFORE"], inputsCount: 1, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/date/today.mjs": /*!****************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/date/today.mjs ***! \****************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "./node_modules/handsontable/node_modules/moment/moment.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); var CONDITION_NAME = 'date_today'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @returns {boolean} */ function condition(dataRow) { var date = moment__WEBPACK_IMPORTED_MODULE_0__(dataRow.value, dataRow.meta.dateFormat); if (!date.isValid()) { return false; } return date.isSame(moment__WEBPACK_IMPORTED_MODULE_0__().startOf('day'), 'd'); } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_2__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_1__["FILTERS_CONDITIONS_TODAY"], inputsCount: 0 }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/date/tomorrow.mjs": /*!*******************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/date/tomorrow.mjs ***! \*******************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "./node_modules/handsontable/node_modules/moment/moment.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); var CONDITION_NAME = 'date_tomorrow'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @returns {boolean} */ function condition(dataRow) { var date = moment__WEBPACK_IMPORTED_MODULE_0__(dataRow.value, dataRow.meta.dateFormat); if (!date.isValid()) { return false; } return date.isSame(moment__WEBPACK_IMPORTED_MODULE_0__().subtract(-1, 'days').startOf('day'), 'd'); } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_2__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_1__["FILTERS_CONDITIONS_TOMORROW"], inputsCount: 0 }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/date/yesterday.mjs": /*!********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/date/yesterday.mjs ***! \********************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "./node_modules/handsontable/node_modules/moment/moment.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); var CONDITION_NAME = 'date_yesterday'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @returns {boolean} */ function condition(dataRow) { var date = moment__WEBPACK_IMPORTED_MODULE_0__(dataRow.value, dataRow.meta.dateFormat); if (!date.isValid()) { return false; } return date.isSame(moment__WEBPACK_IMPORTED_MODULE_0__().subtract(1, 'days').startOf('day'), 'd'); } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_2__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_1__["FILTERS_CONDITIONS_YESTERDAY"], inputsCount: 0 }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/empty.mjs": /*!***********************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/empty.mjs ***! \***********************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); var CONDITION_NAME = 'empty'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @returns {boolean} */ function condition(dataRow) { return Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_2__["isEmpty"])(dataRow.value); } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["FILTERS_CONDITIONS_EMPTY"], inputsCount: 0, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/endsWith.mjs": /*!**************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/endsWith.mjs ***! \**************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var core_js_modules_es_string_ends_with_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.string.ends-with.js */ "./node_modules/core-js/modules/es.string.ends-with.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var CONDITION_NAME = 'ends_with'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @param {*} inputValues."0" Value to check if it occurs at the end. * @returns {boolean} */ function condition(dataRow, _ref) { var _ref2 = _slicedToArray(_ref, 1), value = _ref2[0]; return Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_12__["stringify"])(dataRow.value).toLowerCase().endsWith(Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_12__["stringify"])(value)); } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_13__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_11__["FILTERS_CONDITIONS_ENDS_WITH"], inputsCount: 1, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/equal.mjs": /*!***********************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/equal.mjs ***! \***********************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var CONDITION_NAME = 'eq'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @param {Array} inputValues."0" Value to check if it same as row's data. * @returns {boolean} */ function condition(dataRow, _ref) { var _ref2 = _slicedToArray(_ref, 1), value = _ref2[0]; return Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_11__["stringify"])(dataRow.value).toLowerCase() === Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_11__["stringify"])(value); } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_12__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__["FILTERS_CONDITIONS_EQUAL"], inputsCount: 1, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/false.mjs": /*!***********************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/false.mjs ***! \***********************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); var CONDITION_NAME = 'false'; /** * @returns {boolean} */ function condition() { return false; } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_0__["registerCondition"])(CONDITION_NAME, condition, { name: 'False' }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/greaterThan.mjs": /*!*****************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/greaterThan.mjs ***! \*****************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var CONDITION_NAME = 'gt'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @param {any} inputValues."0" Condition value to compare numbers. * @returns {boolean} */ function condition(dataRow, _ref) { var _ref2 = _slicedToArray(_ref, 1), value = _ref2[0]; var conditionValue = value; if (dataRow.meta.type === 'numeric') { conditionValue = parseFloat(conditionValue, 10); } return dataRow.value > conditionValue; } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_11__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__["FILTERS_CONDITIONS_GREATER_THAN"], inputsCount: 1, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/greaterThanOrEqual.mjs": /*!************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/greaterThanOrEqual.mjs ***! \************************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var CONDITION_NAME = 'gte'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @param {*} inputValues."0" Condition value to compare numbers. * @returns {boolean} */ function condition(dataRow, _ref) { var _ref2 = _slicedToArray(_ref, 1), value = _ref2[0]; var conditionValue = value; if (dataRow.meta.type === 'numeric') { conditionValue = parseFloat(conditionValue, 10); } return dataRow.value >= conditionValue; } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_11__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__["FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL"], inputsCount: 1, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/lessThan.mjs": /*!**************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/lessThan.mjs ***! \**************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var CONDITION_NAME = 'lt'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @param {*} inputValues."0" Condition value to compare numbers. * @returns {boolean} */ function condition(dataRow, _ref) { var _ref2 = _slicedToArray(_ref, 1), value = _ref2[0]; var conditionValue = value; if (dataRow.meta.type === 'numeric') { conditionValue = parseFloat(conditionValue, 10); } return dataRow.value < conditionValue; } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_11__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__["FILTERS_CONDITIONS_LESS_THAN"], inputsCount: 1, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/lessThanOrEqual.mjs": /*!*********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/lessThanOrEqual.mjs ***! \*********************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var CONDITION_NAME = 'lte'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @param {*} inputValues."0" Condition value to compare numbers. * @returns {boolean} */ function condition(dataRow, _ref) { var _ref2 = _slicedToArray(_ref, 1), value = _ref2[0]; var conditionValue = value; if (dataRow.meta.type === 'numeric') { conditionValue = parseFloat(conditionValue, 10); } return dataRow.value <= conditionValue; } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_11__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__["FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL"], inputsCount: 1, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/none.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/none.mjs ***! \**********************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); var CONDITION_NAME = 'none'; /** * @returns {boolean} */ function condition() { return true; } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["FILTERS_CONDITIONS_NONE"], inputsCount: 0, showOperators: false }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/notBetween.mjs": /*!****************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/notBetween.mjs ***! \****************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); /* harmony import */ var _between_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./between.mjs */ "./node_modules/handsontable/plugins/filters/condition/between.mjs"); var CONDITION_NAME = 'not_between'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @returns {boolean} */ function condition(dataRow, inputValues) { return !Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__["getCondition"])(_between_mjs__WEBPACK_IMPORTED_MODULE_2__["CONDITION_NAME"], inputValues)(dataRow); } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["FILTERS_CONDITIONS_NOT_BETWEEN"], inputsCount: 2, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/notContains.mjs": /*!*****************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/notContains.mjs ***! \*****************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); /* harmony import */ var _contains_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./contains.mjs */ "./node_modules/handsontable/plugins/filters/condition/contains.mjs"); var CONDITION_NAME = 'not_contains'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @returns {boolean} */ function condition(dataRow, inputValues) { return !Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__["getCondition"])(_contains_mjs__WEBPACK_IMPORTED_MODULE_2__["CONDITION_NAME"], inputValues)(dataRow); } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["FILTERS_CONDITIONS_NOT_CONTAIN"], inputsCount: 1, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/notEmpty.mjs": /*!**************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/notEmpty.mjs ***! \**************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); /* harmony import */ var _empty_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./empty.mjs */ "./node_modules/handsontable/plugins/filters/condition/empty.mjs"); var CONDITION_NAME = 'not_empty'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @returns {boolean} */ function condition(dataRow, inputValues) { return !Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__["getCondition"])(_empty_mjs__WEBPACK_IMPORTED_MODULE_2__["CONDITION_NAME"], inputValues)(dataRow); } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["FILTERS_CONDITIONS_NOT_EMPTY"], inputsCount: 0, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/notEqual.mjs": /*!**************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/notEqual.mjs ***! \**************************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); /* harmony import */ var _equal_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./equal.mjs */ "./node_modules/handsontable/plugins/filters/condition/equal.mjs"); var CONDITION_NAME = 'neq'; /** * @param {object} dataRow The object which holds and describes the single cell value. * @param {Array} inputValues An array of values to compare with. * @returns {boolean} */ function condition(dataRow, inputValues) { return !Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__["getCondition"])(_equal_mjs__WEBPACK_IMPORTED_MODULE_2__["CONDITION_NAME"], inputValues)(dataRow); } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__["registerCondition"])(CONDITION_NAME, condition, { name: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["FILTERS_CONDITIONS_NOT_EQUAL"], inputsCount: 1, showOperators: true }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/condition/true.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/condition/true.mjs ***! \**********************************************************************/ /*! exports provided: CONDITION_NAME, condition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NAME", function() { return CONDITION_NAME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "condition", function() { return condition; }); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); var CONDITION_NAME = 'true'; /** * @returns {boolean} */ function condition() { return true; } Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_0__["registerCondition"])(CONDITION_NAME, condition, { name: 'True' }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/conditionCollection.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/conditionCollection.mjs ***! \***************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.freeze.js */ "./node_modules/core-js/modules/es.object.freeze.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../helpers/templateLiteralTag.mjs */ "./node_modules/handsontable/helpers/templateLiteralTag.mjs"); /* harmony import */ var _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../mixins/localHooks.mjs */ "./node_modules/handsontable/mixins/localHooks.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); /* harmony import */ var _logicalOperations_conjunction_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./logicalOperations/conjunction.mjs */ "./node_modules/handsontable/plugins/filters/logicalOperations/conjunction.mjs"); /* harmony import */ var _logicalOperationRegisterer_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./logicalOperationRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/logicalOperationRegisterer.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _translations_index_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../translations/index.mjs */ "./node_modules/handsontable/translations/index.mjs"); var _templateObject, _templateObject2; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } 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"); } } 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; } var MAP_NAME = 'ConditionCollection.filteringStates'; /** * @class ConditionCollection * @plugin Filters */ var ConditionCollection = /*#__PURE__*/function () { function ConditionCollection(hot) { var isMapRegistrable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; _classCallCheck(this, ConditionCollection); /** * Handsontable instance. * * @type {Core} */ this.hot = hot; /** * Indicates whether the internal IndexMap should be registered or not. Generally, * registered Maps responds to the index changes. Within that collection, sometimes * this is not necessary. * * @type {boolean} */ this.isMapRegistrable = isMapRegistrable; /** * Index map storing filtering states for every column. ConditionCollection write and read to/from this element. * * @type {LinkedPhysicalIndexToValueMap} */ this.filteringStates = new _translations_index_mjs__WEBPACK_IMPORTED_MODULE_21__["LinkedPhysicalIndexToValueMap"](); if (this.isMapRegistrable === true) { this.hot.columnIndexMapper.registerMap(MAP_NAME, this.filteringStates); } else { this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes()); } } /** * Check if condition collection is empty (so no needed to filter data). * * @returns {boolean} */ _createClass(ConditionCollection, [{ key: "isEmpty", value: function isEmpty() { return this.getFilteredColumns().length === 0; } /** * Check if value is matched to the criteria of conditions chain. * * @param {object} value Object with `value` and `meta` keys. * @param {number} column The physical column index. * @returns {boolean} */ }, { key: "isMatch", value: function isMatch(value, column) { var _stateForColumn$condi; var stateForColumn = this.filteringStates.getValueAtIndex(column); var conditions = (_stateForColumn$condi = stateForColumn === null || stateForColumn === void 0 ? void 0 : stateForColumn.conditions) !== null && _stateForColumn$condi !== void 0 ? _stateForColumn$condi : []; var operation = stateForColumn === null || stateForColumn === void 0 ? void 0 : stateForColumn.operation; return this.isMatchInConditions(conditions, value, operation); } /** * 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} */ }, { key: "isMatchInConditions", value: function isMatchInConditions(conditions, value) { var operationType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _logicalOperations_conjunction_mjs__WEBPACK_IMPORTED_MODULE_18__["OPERATION_ID"]; if (conditions.length) { return Object(_logicalOperationRegisterer_mjs__WEBPACK_IMPORTED_MODULE_19__["getOperationFunc"])(operationType)(conditions, value); } return true; } /** * Add condition to the collection. * * @param {number} column The physical 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. * @param {number} [position] Position to which condition will be added. When argument is undefined * the condition will be processed as the last condition. * @fires ConditionCollection#beforeAdd * @fires ConditionCollection#afterAdd */ }, { key: "addCondition", value: function addCondition(column, conditionDefinition) { var operation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _logicalOperations_conjunction_mjs__WEBPACK_IMPORTED_MODULE_18__["OPERATION_ID"]; var position = arguments.length > 3 ? arguments[3] : undefined; var args = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayMap"])(conditionDefinition.args, function (v) { return typeof v === 'string' ? v.toLowerCase() : v; }); var name = conditionDefinition.name || conditionDefinition.command.key; this.runLocalHooks('beforeAdd', column); var columnType = this.getOperation(column); if (columnType) { if (columnType !== operation) { throw Error(Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_15__["toSingleLine"])(_templateObject || (_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 \\`", "\\`\\x20\n filter operation. Use \\`removeConditions\\` to clear the current conditions and then add new ones.\\x20\n Mind that you cannot mix different types of operations (for instance, if you use \\`conjunction\\`,\\x20\n use it consequently for a particular column)."])), column, columnType)); } } else if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_20__["isUndefined"])(_logicalOperationRegisterer_mjs__WEBPACK_IMPORTED_MODULE_19__["operations"][operation])) { throw new Error(Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_15__["toSingleLine"])(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Unexpected operation named `", "`. Possible ones are \n `disjunction` and `conjunction`."], ["Unexpected operation named \\`", "\\`. Possible ones are\\x20\n \\`disjunction\\` and \\`conjunction\\`."])), operation)); } var conditionsForColumn = this.getConditions(column); if (conditionsForColumn.length === 0) { // Create first condition for particular column. this.filteringStates.setValueAtIndex(column, { operation: operation, conditions: [{ name: name, args: args, func: Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_17__["getCondition"])(name, args) }] }, position); } else { // Add next condition for particular column (by reference). conditionsForColumn.push({ name: name, args: args, func: Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_17__["getCondition"])(name, args) }); } this.runLocalHooks('afterAdd', column); } /** * Get all added conditions from the collection at specified column index. * * @param {number} column The physical column index. * @returns {Array} Returns conditions collection as an array. */ }, { key: "getConditions", value: function getConditions(column) { var _this$filteringStates, _this$filteringStates2; return (_this$filteringStates = (_this$filteringStates2 = this.filteringStates.getValueAtIndex(column)) === null || _this$filteringStates2 === void 0 ? void 0 : _this$filteringStates2.conditions) !== null && _this$filteringStates !== void 0 ? _this$filteringStates : []; } /** * Get operation for particular column. * * @param {number} column The physical column index. * @returns {string|undefined} */ }, { key: "getOperation", value: function getOperation(column) { var _this$filteringStates3; return (_this$filteringStates3 = this.filteringStates.getValueAtIndex(column)) === null || _this$filteringStates3 === void 0 ? void 0 : _this$filteringStates3.operation; } /** * Get all filtered physical columns in the order in which actions are performed. * * @returns {Array} */ }, { key: "getFilteredColumns", value: function getFilteredColumns() { return this.filteringStates.getEntries().map(function (_ref) { var _ref2 = _slicedToArray(_ref, 1), physicalColumn = _ref2[0]; return physicalColumn; }); } /** * Gets position in the filtering states stack for the specific column. * * @param {number} column The physical column index. * @returns {number} Returns -1 when the column doesn't exist in the stack. */ }, { key: "getColumnStackPosition", value: function getColumnStackPosition(column) { return this.getFilteredColumns().indexOf(column); } /** * Export all previously added conditions. * * @returns {Array} */ }, { key: "exportAllConditions", value: function exportAllConditions() { return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayReduce"])(this.filteringStates.getEntries(), function (allConditions, _ref3) { var _ref4 = _slicedToArray(_ref3, 2), column = _ref4[0], _ref4$ = _ref4[1], operation = _ref4$.operation, conditions = _ref4$.conditions; allConditions.push({ column: column, operation: operation, conditions: Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayMap"])(conditions, function (_ref5) { var name = _ref5.name, args = _ref5.args; return { name: name, args: args }; }) }); return allConditions; }, []); } /** * Import conditions to the collection. * * @param {Array} conditions The collection of the conditions. */ }, { key: "importAllConditions", value: function importAllConditions(conditions) { var _this = this; this.clean(); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(conditions, function (stack) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(stack.conditions, function (condition) { return _this.addCondition(stack.column, condition); }); }); } /** * Remove conditions at given column index. * * @param {number} column The physical column index. * @fires ConditionCollection#beforeRemove * @fires ConditionCollection#afterRemove */ }, { key: "removeConditions", value: function removeConditions(column) { this.runLocalHooks('beforeRemove', column); this.filteringStates.clearValue(column); this.runLocalHooks('afterRemove', column); } /** * Clean all conditions collection and reset order stack. * * @fires ConditionCollection#beforeClean * @fires ConditionCollection#afterClean */ }, { key: "clean", value: function clean() { this.runLocalHooks('beforeClean'); this.filteringStates.clear(); this.runLocalHooks('afterClean'); } /** * 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 The physical column index. * @param {string} [name] Condition name. * @returns {boolean} */ }, { key: "hasConditions", value: function hasConditions(column, name) { var conditions = this.getConditions(column); if (name) { return conditions.some(function (condition) { return condition.name === name; }); } return conditions.length > 0; } /** * Destroy object. */ }, { key: "destroy", value: function destroy() { if (this.isMapRegistrable) { this.hot.columnIndexMapper.unregisterMap(MAP_NAME); } this.filteringStates = null; this.clearLocalHooks(); } }]); return ConditionCollection; }(); Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_14__["mixin"])(ConditionCollection, _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_16__["default"]); /* harmony default export */ __webpack_exports__["default"] = (ConditionCollection); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs ***! \***************************************************************************/ /*! exports provided: conditions, getCondition, getConditionDescriptor, registerCondition */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conditions", function() { return conditions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCondition", function() { return getCondition; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getConditionDescriptor", function() { return getConditionDescriptor; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerCondition", function() { return registerCondition; }); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); var conditions = {}; /** * Get condition closure with pre-bound arguments. * * @param {string} name Condition name. * @param {Array} args Condition arguments. * @returns {Function} */ function getCondition(name, args) { if (!conditions[name]) { throw Error("Filter condition \"".concat(name, "\" does not exist.")); } var _conditions$name = conditions[name], condition = _conditions$name.condition, descriptor = _conditions$name.descriptor; var conditionArguments = args; if (descriptor.inputValuesDecorator) { conditionArguments = descriptor.inputValuesDecorator(conditionArguments); } return function (dataRow) { return condition.apply(dataRow.meta.instance, [].concat([dataRow], [conditionArguments])); }; } /** * Get condition object descriptor which defines some additional informations about this condition. * * @param {string} name Condition name. * @returns {object} */ function getConditionDescriptor(name) { if (!conditions[name]) { throw Error("Filter condition \"".concat(name, "\" does not exist.")); } return conditions[name].descriptor; } /** * Condition registerer. * * @param {string} name Condition name. * @param {Function} condition Condition function. * @param {object} descriptor Condition descriptor. */ function registerCondition(name, condition, descriptor) { descriptor.key = name; conditions[name] = { condition: condition, descriptor: descriptor }; } /***/ }), /***/ "./node_modules/handsontable/plugins/filters/conditionUpdateObserver.mjs": /*!*******************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/conditionUpdateObserver.mjs ***! \*******************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_function_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../helpers/function.mjs */ "./node_modules/handsontable/helpers/function.mjs"); /* harmony import */ var _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/localHooks.mjs */ "./node_modules/handsontable/mixins/localHooks.mjs"); /* harmony import */ var _conditionCollection_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./conditionCollection.mjs */ "./node_modules/handsontable/plugins/filters/conditionCollection.mjs"); /* harmony import */ var _dataFilter_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dataFilter.mjs */ "./node_modules/handsontable/plugins/filters/dataFilter.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/handsontable/plugins/filters/utils.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * Class which is designed for observing changes in condition collection. When condition is changed by user at specified * column it's necessary to update all conditions defined after this edited one. * * Object fires `update` hook for every column conditions change. * * @class ConditionUpdateObserver * @plugin Filters */ var ConditionUpdateObserver = /*#__PURE__*/function () { function ConditionUpdateObserver(hot, conditionCollection) { var _this = this; var columnDataFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () { return []; }; _classCallCheck(this, ConditionUpdateObserver); /** * Handsontable instance. * * @type {Core} */ this.hot = hot; /** * Reference to the instance of {@link ConditionCollection}. * * @type {ConditionCollection} */ this.conditionCollection = conditionCollection; /** * Function which provide source data factory for specified column. * * @type {Function} */ this.columnDataFactory = columnDataFactory; /** * Collected changes when grouping is enabled. * * @type {Array} * @default [] */ this.changes = []; /** * Flag which determines if grouping events is enabled. * * @type {boolean} */ this.grouping = false; /** * The latest known position of edited conditions at specified column index. * * @type {number} * @default -1 */ this.latestEditedColumnPosition = -1; /** * The latest known order of conditions stack. * * @type {Array} */ this.latestOrderStack = []; this.conditionCollection.addLocalHook('beforeRemove', function (column) { return _this._onConditionBeforeModify(column); }); this.conditionCollection.addLocalHook('afterRemove', function (column) { return _this.updateStatesAtColumn(column); }); this.conditionCollection.addLocalHook('afterAdd', function (column) { return _this.updateStatesAtColumn(column); }); this.conditionCollection.addLocalHook('beforeClean', function () { return _this._onConditionBeforeClean(); }); this.conditionCollection.addLocalHook('afterClean', function () { return _this._onConditionAfterClean(); }); } /** * Enable grouping changes. Grouping is helpful in situations when a lot of conditions is added in one moment. Instead of * trigger `update` hook for every condition by adding/removing you can group this changes and call `flush` method to trigger * it once. */ _createClass(ConditionUpdateObserver, [{ key: "groupChanges", value: function groupChanges() { this.grouping = true; } /** * Flush all collected changes. This trigger `update` hook for every previously collected change from condition collection. */ }, { key: "flush", value: function flush() { var _this2 = this; this.grouping = false; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_4__["arrayEach"])(this.changes, function (column) { _this2.updateStatesAtColumn(column); }); this.changes.length = 0; } /** * On before modify condition (add or remove from collection),. * * @param {number} column Column index. * @private */ }, { key: "_onConditionBeforeModify", value: function _onConditionBeforeModify(column) { this.latestEditedColumnPosition = this.conditionCollection.getColumnStackPosition(column); } /** * Update all related states which should be changed after invoking changes applied to current column. * * @param {number} column The column index. * @param {object} conditionArgsChange Object describing condition changes which can be handled by filters on `update` hook. * It contains keys `conditionKey` and `conditionValue` which refers to change specified key of condition to specified value * based on referred keys. */ }, { key: "updateStatesAtColumn", value: function updateStatesAtColumn(column, conditionArgsChange) { var _this3 = this; if (this.grouping) { if (this.changes.indexOf(column) === -1) { this.changes.push(column); } return; } var allConditions = this.conditionCollection.exportAllConditions(); var editedColumnPosition = this.conditionCollection.getColumnStackPosition(column); if (editedColumnPosition === -1) { editedColumnPosition = this.latestEditedColumnPosition; } // Collection of all conditions defined before currently edited `column` (without edited one) var conditionsBefore = allConditions.slice(0, editedColumnPosition); // Collection of all conditions defined after currently edited `column` (with edited one) var conditionsAfter = allConditions.slice(editedColumnPosition); // Make sure that conditionAfter doesn't contain edited column conditions if (conditionsAfter.length && conditionsAfter[0].column === column) { conditionsAfter.shift(); } var visibleDataFactory = Object(_helpers_function_mjs__WEBPACK_IMPORTED_MODULE_6__["curry"])(function (curriedConditionsBefore, curriedColumn) { var conditionsStack = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; var splitConditionCollection = new _conditionCollection_mjs__WEBPACK_IMPORTED_MODULE_8__["default"](_this3.hot, false); var curriedConditionsBeforeArray = [].concat(curriedConditionsBefore, conditionsStack); // Create new condition collection to determine what rows should be visible in "filter by value" box // in the next conditions in the chain splitConditionCollection.importAllConditions(curriedConditionsBeforeArray); var allRows = _this3.columnDataFactory(curriedColumn); var visibleRows; if (splitConditionCollection.isEmpty()) { visibleRows = allRows; } else { visibleRows = new _dataFilter_mjs__WEBPACK_IMPORTED_MODULE_9__["default"](splitConditionCollection, function (columnData) { return _this3.columnDataFactory(columnData); }).filter(); } visibleRows = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_4__["arrayMap"])(visibleRows, function (rowData) { return rowData.meta.visualRow; }); var visibleRowsAssertion = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_10__["createArrayAssertion"])(visibleRows); splitConditionCollection.destroy(); return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_4__["arrayFilter"])(allRows, function (rowData) { return visibleRowsAssertion(rowData.meta.visualRow); }); })(conditionsBefore); var editedConditions = [].concat(this.conditionCollection.getConditions(column)); this.runLocalHooks('update', { editedConditionStack: { column: column, conditions: editedConditions }, dependentConditionStacks: conditionsAfter, filteredRowsFactory: visibleDataFactory, conditionArgsChange: conditionArgsChange }); } /** * On before conditions clean listener. * * @private */ }, { key: "_onConditionBeforeClean", value: function _onConditionBeforeClean() { this.latestOrderStack = this.conditionCollection.getFilteredColumns(); } /** * On after conditions clean listener. * * @private */ }, { key: "_onConditionAfterClean", value: function _onConditionAfterClean() { var _this4 = this; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_4__["arrayEach"])(this.latestOrderStack, function (column) { _this4.updateStatesAtColumn(column); }); } /** * Destroy instance. */ }, { key: "destroy", value: function destroy() { var _this5 = this; this.clearLocalHooks(); Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_5__["objectEach"])(this, function (value, property) { _this5[property] = null; }); } }]); return ConditionUpdateObserver; }(); Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_5__["mixin"])(ConditionUpdateObserver, _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]); /* harmony default export */ __webpack_exports__["default"] = (ConditionUpdateObserver); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/constants.mjs": /*!*****************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/constants.mjs ***! \*****************************************************************/ /*! exports provided: CONDITION_NONE, CONDITION_EMPTY, CONDITION_NOT_EMPTY, CONDITION_EQUAL, CONDITION_NOT_EQUAL, CONDITION_GREATER_THAN, CONDITION_GREATER_THAN_OR_EQUAL, CONDITION_LESS_THAN, CONDITION_LESS_THAN_OR_EQUAL, CONDITION_BETWEEN, CONDITION_NOT_BETWEEN, CONDITION_BEGINS_WITH, CONDITION_ENDS_WITH, CONDITION_CONTAINS, CONDITION_NOT_CONTAINS, CONDITION_DATE_BEFORE, CONDITION_DATE_AFTER, CONDITION_TOMORROW, CONDITION_TODAY, CONDITION_YESTERDAY, CONDITION_BY_VALUE, CONDITION_TRUE, CONDITION_FALSE, OPERATION_AND, OPERATION_OR, OPERATION_OR_THEN_VARIABLE, TYPE_NUMERIC, TYPE_TEXT, TYPE_DATE, TYPES, default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPE_NUMERIC", function() { return TYPE_NUMERIC; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPE_TEXT", function() { return TYPE_TEXT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPE_DATE", function() { return TYPE_DATE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPES", function() { return TYPES; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getOptionsList; }); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../contextMenu/predefinedItems.mjs */ "./node_modules/handsontable/plugins/contextMenu/predefinedItems.mjs"); /* harmony import */ var _conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conditionRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/conditionRegisterer.mjs"); /* harmony import */ var _condition_none_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./condition/none.mjs */ "./node_modules/handsontable/plugins/filters/condition/none.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NONE", function() { return _condition_none_mjs__WEBPACK_IMPORTED_MODULE_4__["CONDITION_NAME"]; }); /* harmony import */ var _condition_empty_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./condition/empty.mjs */ "./node_modules/handsontable/plugins/filters/condition/empty.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_EMPTY", function() { return _condition_empty_mjs__WEBPACK_IMPORTED_MODULE_5__["CONDITION_NAME"]; }); /* harmony import */ var _condition_notEmpty_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./condition/notEmpty.mjs */ "./node_modules/handsontable/plugins/filters/condition/notEmpty.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NOT_EMPTY", function() { return _condition_notEmpty_mjs__WEBPACK_IMPORTED_MODULE_6__["CONDITION_NAME"]; }); /* harmony import */ var _condition_equal_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./condition/equal.mjs */ "./node_modules/handsontable/plugins/filters/condition/equal.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_EQUAL", function() { return _condition_equal_mjs__WEBPACK_IMPORTED_MODULE_7__["CONDITION_NAME"]; }); /* harmony import */ var _condition_notEqual_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./condition/notEqual.mjs */ "./node_modules/handsontable/plugins/filters/condition/notEqual.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NOT_EQUAL", function() { return _condition_notEqual_mjs__WEBPACK_IMPORTED_MODULE_8__["CONDITION_NAME"]; }); /* harmony import */ var _condition_greaterThan_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./condition/greaterThan.mjs */ "./node_modules/handsontable/plugins/filters/condition/greaterThan.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_GREATER_THAN", function() { return _condition_greaterThan_mjs__WEBPACK_IMPORTED_MODULE_9__["CONDITION_NAME"]; }); /* harmony import */ var _condition_greaterThanOrEqual_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./condition/greaterThanOrEqual.mjs */ "./node_modules/handsontable/plugins/filters/condition/greaterThanOrEqual.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_GREATER_THAN_OR_EQUAL", function() { return _condition_greaterThanOrEqual_mjs__WEBPACK_IMPORTED_MODULE_10__["CONDITION_NAME"]; }); /* harmony import */ var _condition_lessThan_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./condition/lessThan.mjs */ "./node_modules/handsontable/plugins/filters/condition/lessThan.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_LESS_THAN", function() { return _condition_lessThan_mjs__WEBPACK_IMPORTED_MODULE_11__["CONDITION_NAME"]; }); /* harmony import */ var _condition_lessThanOrEqual_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./condition/lessThanOrEqual.mjs */ "./node_modules/handsontable/plugins/filters/condition/lessThanOrEqual.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_LESS_THAN_OR_EQUAL", function() { return _condition_lessThanOrEqual_mjs__WEBPACK_IMPORTED_MODULE_12__["CONDITION_NAME"]; }); /* harmony import */ var _condition_between_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./condition/between.mjs */ "./node_modules/handsontable/plugins/filters/condition/between.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_BETWEEN", function() { return _condition_between_mjs__WEBPACK_IMPORTED_MODULE_13__["CONDITION_NAME"]; }); /* harmony import */ var _condition_notBetween_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./condition/notBetween.mjs */ "./node_modules/handsontable/plugins/filters/condition/notBetween.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NOT_BETWEEN", function() { return _condition_notBetween_mjs__WEBPACK_IMPORTED_MODULE_14__["CONDITION_NAME"]; }); /* harmony import */ var _condition_beginsWith_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./condition/beginsWith.mjs */ "./node_modules/handsontable/plugins/filters/condition/beginsWith.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_BEGINS_WITH", function() { return _condition_beginsWith_mjs__WEBPACK_IMPORTED_MODULE_15__["CONDITION_NAME"]; }); /* harmony import */ var _condition_endsWith_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./condition/endsWith.mjs */ "./node_modules/handsontable/plugins/filters/condition/endsWith.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_ENDS_WITH", function() { return _condition_endsWith_mjs__WEBPACK_IMPORTED_MODULE_16__["CONDITION_NAME"]; }); /* harmony import */ var _condition_contains_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./condition/contains.mjs */ "./node_modules/handsontable/plugins/filters/condition/contains.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_CONTAINS", function() { return _condition_contains_mjs__WEBPACK_IMPORTED_MODULE_17__["CONDITION_NAME"]; }); /* harmony import */ var _condition_notContains_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./condition/notContains.mjs */ "./node_modules/handsontable/plugins/filters/condition/notContains.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_NOT_CONTAINS", function() { return _condition_notContains_mjs__WEBPACK_IMPORTED_MODULE_18__["CONDITION_NAME"]; }); /* harmony import */ var _condition_date_before_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./condition/date/before.mjs */ "./node_modules/handsontable/plugins/filters/condition/date/before.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_DATE_BEFORE", function() { return _condition_date_before_mjs__WEBPACK_IMPORTED_MODULE_19__["CONDITION_NAME"]; }); /* harmony import */ var _condition_date_after_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./condition/date/after.mjs */ "./node_modules/handsontable/plugins/filters/condition/date/after.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_DATE_AFTER", function() { return _condition_date_after_mjs__WEBPACK_IMPORTED_MODULE_20__["CONDITION_NAME"]; }); /* harmony import */ var _condition_date_tomorrow_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./condition/date/tomorrow.mjs */ "./node_modules/handsontable/plugins/filters/condition/date/tomorrow.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_TOMORROW", function() { return _condition_date_tomorrow_mjs__WEBPACK_IMPORTED_MODULE_21__["CONDITION_NAME"]; }); /* harmony import */ var _condition_date_today_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./condition/date/today.mjs */ "./node_modules/handsontable/plugins/filters/condition/date/today.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_TODAY", function() { return _condition_date_today_mjs__WEBPACK_IMPORTED_MODULE_22__["CONDITION_NAME"]; }); /* harmony import */ var _condition_date_yesterday_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./condition/date/yesterday.mjs */ "./node_modules/handsontable/plugins/filters/condition/date/yesterday.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_YESTERDAY", function() { return _condition_date_yesterday_mjs__WEBPACK_IMPORTED_MODULE_23__["CONDITION_NAME"]; }); /* harmony import */ var _condition_byValue_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./condition/byValue.mjs */ "./node_modules/handsontable/plugins/filters/condition/byValue.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_BY_VALUE", function() { return _condition_byValue_mjs__WEBPACK_IMPORTED_MODULE_24__["CONDITION_NAME"]; }); /* harmony import */ var _condition_true_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./condition/true.mjs */ "./node_modules/handsontable/plugins/filters/condition/true.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_TRUE", function() { return _condition_true_mjs__WEBPACK_IMPORTED_MODULE_25__["CONDITION_NAME"]; }); /* harmony import */ var _condition_false_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./condition/false.mjs */ "./node_modules/handsontable/plugins/filters/condition/false.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONDITION_FALSE", function() { return _condition_false_mjs__WEBPACK_IMPORTED_MODULE_26__["CONDITION_NAME"]; }); /* harmony import */ var _logicalOperations_conjunction_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./logicalOperations/conjunction.mjs */ "./node_modules/handsontable/plugins/filters/logicalOperations/conjunction.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OPERATION_AND", function() { return _logicalOperations_conjunction_mjs__WEBPACK_IMPORTED_MODULE_27__["OPERATION_ID"]; }); /* harmony import */ var _logicalOperations_disjunction_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./logicalOperations/disjunction.mjs */ "./node_modules/handsontable/plugins/filters/logicalOperations/disjunction.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OPERATION_OR", function() { return _logicalOperations_disjunction_mjs__WEBPACK_IMPORTED_MODULE_28__["OPERATION_ID"]; }); /* harmony import */ var _logicalOperations_disjunctionWithExtraCondition_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./logicalOperations/disjunctionWithExtraCondition.mjs */ "./node_modules/handsontable/plugins/filters/logicalOperations/disjunctionWithExtraCondition.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OPERATION_OR_THEN_VARIABLE", function() { return _logicalOperations_disjunctionWithExtraCondition_mjs__WEBPACK_IMPORTED_MODULE_29__["OPERATION_ID"]; }); var _TYPES; 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_NUMERIC = 'numeric'; var TYPE_TEXT = 'text'; var TYPE_DATE = 'date'; /** * Default types and order for filter conditions. * * @type {object} */ var TYPES = (_TYPES = {}, _defineProperty(_TYPES, TYPE_NUMERIC, [_condition_none_mjs__WEBPACK_IMPORTED_MODULE_4__["CONDITION_NAME"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"], _condition_empty_mjs__WEBPACK_IMPORTED_MODULE_5__["CONDITION_NAME"], _condition_notEmpty_mjs__WEBPACK_IMPORTED_MODULE_6__["CONDITION_NAME"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"], _condition_equal_mjs__WEBPACK_IMPORTED_MODULE_7__["CONDITION_NAME"], _condition_notEqual_mjs__WEBPACK_IMPORTED_MODULE_8__["CONDITION_NAME"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"], _condition_greaterThan_mjs__WEBPACK_IMPORTED_MODULE_9__["CONDITION_NAME"], _condition_greaterThanOrEqual_mjs__WEBPACK_IMPORTED_MODULE_10__["CONDITION_NAME"], _condition_lessThan_mjs__WEBPACK_IMPORTED_MODULE_11__["CONDITION_NAME"], _condition_lessThanOrEqual_mjs__WEBPACK_IMPORTED_MODULE_12__["CONDITION_NAME"], _condition_between_mjs__WEBPACK_IMPORTED_MODULE_13__["CONDITION_NAME"], _condition_notBetween_mjs__WEBPACK_IMPORTED_MODULE_14__["CONDITION_NAME"]]), _defineProperty(_TYPES, TYPE_TEXT, [_condition_none_mjs__WEBPACK_IMPORTED_MODULE_4__["CONDITION_NAME"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"], _condition_empty_mjs__WEBPACK_IMPORTED_MODULE_5__["CONDITION_NAME"], _condition_notEmpty_mjs__WEBPACK_IMPORTED_MODULE_6__["CONDITION_NAME"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"], _condition_equal_mjs__WEBPACK_IMPORTED_MODULE_7__["CONDITION_NAME"], _condition_notEqual_mjs__WEBPACK_IMPORTED_MODULE_8__["CONDITION_NAME"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"], _condition_beginsWith_mjs__WEBPACK_IMPORTED_MODULE_15__["CONDITION_NAME"], _condition_endsWith_mjs__WEBPACK_IMPORTED_MODULE_16__["CONDITION_NAME"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"], _condition_contains_mjs__WEBPACK_IMPORTED_MODULE_17__["CONDITION_NAME"], _condition_notContains_mjs__WEBPACK_IMPORTED_MODULE_18__["CONDITION_NAME"]]), _defineProperty(_TYPES, TYPE_DATE, [_condition_none_mjs__WEBPACK_IMPORTED_MODULE_4__["CONDITION_NAME"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"], _condition_empty_mjs__WEBPACK_IMPORTED_MODULE_5__["CONDITION_NAME"], _condition_notEmpty_mjs__WEBPACK_IMPORTED_MODULE_6__["CONDITION_NAME"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"], _condition_equal_mjs__WEBPACK_IMPORTED_MODULE_7__["CONDITION_NAME"], _condition_notEqual_mjs__WEBPACK_IMPORTED_MODULE_8__["CONDITION_NAME"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"], _condition_date_before_mjs__WEBPACK_IMPORTED_MODULE_19__["CONDITION_NAME"], _condition_date_after_mjs__WEBPACK_IMPORTED_MODULE_20__["CONDITION_NAME"], _condition_between_mjs__WEBPACK_IMPORTED_MODULE_13__["CONDITION_NAME"], _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"], _condition_date_tomorrow_mjs__WEBPACK_IMPORTED_MODULE_21__["CONDITION_NAME"], _condition_date_today_mjs__WEBPACK_IMPORTED_MODULE_22__["CONDITION_NAME"], _condition_date_yesterday_mjs__WEBPACK_IMPORTED_MODULE_23__["CONDITION_NAME"]]), _TYPES); /** * Get options list for conditional filter by data type (e.q: `'text'`, `'numeric'`, `'date'`). * * @param {string} type The data type. * @returns {object} */ function getOptionsList(type) { var items = []; var typeName = type; if (!TYPES[typeName]) { typeName = TYPE_TEXT; } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_1__["arrayEach"])(TYPES[typeName], function (typeValue) { var option; if (typeValue === _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"]) { option = { name: _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_2__["SEPARATOR"] }; } else { option = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_0__["clone"])(Object(_conditionRegisterer_mjs__WEBPACK_IMPORTED_MODULE_3__["getConditionDescriptor"])(typeValue)); } items.push(option); }); return items; } /***/ }), /***/ "./node_modules/handsontable/plugins/filters/dataFilter.mjs": /*!******************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/dataFilter.mjs ***! \******************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * @class DataFilter * @plugin Filters */ var DataFilter = /*#__PURE__*/function () { function DataFilter(conditionCollection) { var columnDataFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () { return []; }; _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; } /** * Filter data based on the conditions collection. * * @returns {Array} */ _createClass(DataFilter, [{ key: "filter", value: function filter() { var _this = this; var filteredData = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_0__["arrayEach"])(this.conditionCollection.getFilteredColumns(), function (physicalColumn, index) { var columnData = _this.columnDataFactory(physicalColumn); if (index) { columnData = _this._getIntersectData(columnData, filteredData); } filteredData = _this.filterByColumn(physicalColumn, columnData); }); return filteredData; } /** * Filter data based on specified physical column index. * * @param {number} column The physical 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; var dataSource = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var filteredData = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_0__["arrayEach"])(dataSource, function (dataRow) { if (dataRow !== void 0 && _this2.conditionCollection.isMatch(dataRow, column)) { filteredData.push(dataRow); } }); return filteredData; } /** * Intersect data. * * @private * @param {Array} data The data to intersect. * @param {Array} needles The collection intersected rows with the data. * @returns {Array} */ }, { key: "_getIntersectData", value: function _getIntersectData(data, needles) { var result = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_0__["arrayEach"])(needles, function (needleRow) { var row = needleRow.meta.visualRow; if (data[row] !== void 0) { result[row] = data[row]; } }); return result; } }]); return DataFilter; }(); /* harmony default export */ __webpack_exports__["default"] = (DataFilter); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/filters.mjs": /*!***************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/filters.mjs ***! \***************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, Filters */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Filters", function() { return Filters; }); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.freeze.js */ "./node_modules/core-js/modules/es.object.freeze.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../helpers/templateLiteralTag.mjs */ "./node_modules/handsontable/helpers/templateLiteralTag.mjs"); /* harmony import */ var _helpers_console_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../helpers/console.mjs */ "./node_modules/handsontable/helpers/console.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../contextMenu/predefinedItems.mjs */ "./node_modules/handsontable/plugins/contextMenu/predefinedItems.mjs"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _component_condition_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./component/condition.mjs */ "./node_modules/handsontable/plugins/filters/component/condition.mjs"); /* harmony import */ var _component_operators_mjs__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./component/operators.mjs */ "./node_modules/handsontable/plugins/filters/component/operators.mjs"); /* harmony import */ var _component_value_mjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./component/value.mjs */ "./node_modules/handsontable/plugins/filters/component/value.mjs"); /* harmony import */ var _component_actionBar_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./component/actionBar.mjs */ "./node_modules/handsontable/plugins/filters/component/actionBar.mjs"); /* harmony import */ var _conditionCollection_mjs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./conditionCollection.mjs */ "./node_modules/handsontable/plugins/filters/conditionCollection.mjs"); /* harmony import */ var _dataFilter_mjs__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./dataFilter.mjs */ "./node_modules/handsontable/plugins/filters/dataFilter.mjs"); /* harmony import */ var _conditionUpdateObserver_mjs__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./conditionUpdateObserver.mjs */ "./node_modules/handsontable/plugins/filters/conditionUpdateObserver.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/handsontable/plugins/filters/utils.mjs"); /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/handsontable/plugins/filters/constants.mjs"); /* harmony import */ var _translations_index_mjs__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../../translations/index.mjs */ "./node_modules/handsontable/translations/index.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var _templateObject; function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var PLUGIN_KEY = 'filters'; var PLUGIN_PRIORITY = 250; /** * @plugin Filters * @class Filters * * @description * The plugin allows filtering the table data either by the built-in component or with the API. * * See [the filtering demo](@/guides/columns/column-filter.md) for examples. * * @example * ```js * const container = document.getElementById('example'); * const hot = new Handsontable(container, { * data: getData(), * colHeaders: true, * rowHeaders: true, * dropdownMenu: true, * filters: true * }); * ``` */ var Filters = /*#__PURE__*/function (_BasePlugin) { _inherits(Filters, _BasePlugin); var _super = _createSuper(Filters); function Filters(hotInstance) { var _this; _classCallCheck(this, Filters); _this = _super.call(this, hotInstance); /** * Instance of {@link EventManager}. * * @private * @type {EventManager} */ _this.eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_25__["default"](_assertThisInitialized(_this)); /** * Instance of {@link DropdownMenu}. * * @private * @type {DropdownMenu} */ _this.dropdownMenuPlugin = null; /** * Instance of {@link ConditionCollection}. * * @private * @type {ConditionCollection} */ _this.conditionCollection = null; /** * Instance of {@link ConditionUpdateObserver}. * * @private * @type {ConditionUpdateObserver} */ _this.conditionUpdateObserver = null; /** * Map, where key is component identifier and value represent `BaseComponent` element or it derivatives. * * @private * @type {Map} */ _this.components = new Map([['filter_by_condition', null], ['filter_operators', null], ['filter_by_condition2', null], ['filter_by_value', null], ['filter_action_bar', null]]); /** * Object containing information about last selected column physical and visual index for added filter conditions. * * @private * @type {object} * @default null */ _this.lastSelectedColumn = null; /** * Map of skipped rows by plugin. * * @private * @type {null|TrimmingMap} */ _this.filtersRowsMap = null; // One listener for the 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 Filters#enablePlugin} method is called. * * @returns {boolean} */ _createClass(Filters, [{ key: "isEnabled", value: function isEnabled() { /* eslint-disable no-unneeded-ternary */ return this.hot.getSettings()[PLUGIN_KEY] ? true : false; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } this.filtersRowsMap = this.hot.rowIndexMapper.registerMap(this.pluginName, new _translations_index_mjs__WEBPACK_IMPORTED_MODULE_38__["TrimmingMap"]()); this.dropdownMenuPlugin = this.hot.getPlugin('dropdownMenu'); var dropdownSettings = this.hot.getSettings().dropdownMenu; var menuContainer = dropdownSettings && dropdownSettings.uiContainer || this.hot.rootDocument.body; var addConfirmationHooks = function addConfirmationHooks(component) { component.addLocalHook('accept', function () { return _this2.onActionBarSubmit('accept'); }); component.addLocalHook('cancel', function () { return _this2.onActionBarSubmit('cancel'); }); component.addLocalHook('change', function (command) { return _this2.onComponentChange(component, command); }); return component; }; var filterByConditionLabel = function filterByConditionLabel() { return "".concat(_this2.hot.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_28__["FILTERS_DIVS_FILTER_BY_CONDITION"]), ":"); }; var filterValueLabel = function filterValueLabel() { return "".concat(_this2.hot.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_28__["FILTERS_DIVS_FILTER_BY_VALUE"]), ":"); }; if (!this.components.get('filter_by_condition')) { var conditionComponent = new _component_condition_mjs__WEBPACK_IMPORTED_MODULE_29__["default"](this.hot, { id: 'filter_by_condition', name: filterByConditionLabel, addSeparator: false, menuContainer: menuContainer }); conditionComponent.addLocalHook('afterClose', function () { return _this2.onSelectUIClosed(); }); this.components.set('filter_by_condition', addConfirmationHooks(conditionComponent)); } if (!this.components.get('filter_operators')) { this.components.set('filter_operators', new _component_operators_mjs__WEBPACK_IMPORTED_MODULE_30__["default"](this.hot, { id: 'filter_operators', name: 'Operators' })); } if (!this.components.get('filter_by_condition2')) { var _conditionComponent = new _component_condition_mjs__WEBPACK_IMPORTED_MODULE_29__["default"](this.hot, { id: 'filter_by_condition2', name: '', addSeparator: true, menuContainer: menuContainer }); _conditionComponent.addLocalHook('afterClose', function () { return _this2.onSelectUIClosed(); }); this.components.set('filter_by_condition2', addConfirmationHooks(_conditionComponent)); } if (!this.components.get('filter_by_value')) { this.components.set('filter_by_value', addConfirmationHooks(new _component_value_mjs__WEBPACK_IMPORTED_MODULE_31__["default"](this.hot, { id: 'filter_by_value', name: filterValueLabel }))); } if (!this.components.get('filter_action_bar')) { this.components.set('filter_action_bar', addConfirmationHooks(new _component_actionBar_mjs__WEBPACK_IMPORTED_MODULE_32__["default"](this.hot, { id: 'filter_action_bar', name: 'Action bar' }))); } if (!this.conditionCollection) { this.conditionCollection = new _conditionCollection_mjs__WEBPACK_IMPORTED_MODULE_33__["default"](this.hot); } if (!this.conditionUpdateObserver) { this.conditionUpdateObserver = new _conditionUpdateObserver_mjs__WEBPACK_IMPORTED_MODULE_35__["default"](this.hot, this.conditionCollection, function (physicalColumn) { return _this2.getDataMapAtColumn(physicalColumn); }); this.conditionUpdateObserver.addLocalHook('update', function (conditionState) { return _this2.updateComponents(conditionState); }); } this.components.forEach(function (component) { return component.show(); }); this.registerEvents(); this.addHook('beforeDropdownMenuSetItems', function (items) { return _this2.onBeforeDropdownMenuSetItems(items); }); this.addHook('afterDropdownMenuDefaultOptions', function (defaultOptions) { return _this2.onAfterDropdownMenuDefaultOptions(defaultOptions); }); this.addHook('afterDropdownMenuShow', function () { return _this2.onAfterDropdownMenuShow(); }); this.addHook('afterDropdownMenuHide', function () { return _this2.onAfterDropdownMenuHide(); }); this.addHook('afterChange', function (changes) { return _this2.onAfterChange(changes); }); // Temp. solution (extending menu items bug in contextMenu/dropdownMenu) if (this.hot.getSettings().dropdownMenu && this.dropdownMenuPlugin) { this.dropdownMenuPlugin.disablePlugin(); this.dropdownMenuPlugin.enablePlugin(); } _get(_getPrototypeOf(Filters.prototype), "enablePlugin", this).call(this); } /** * Registers the DOM listeners. * * @private */ }, { key: "registerEvents", value: function registerEvents() { var _this3 = this; this.eventManager.addEventListener(this.hot.rootElement, 'click', function (event) { return _this3.onTableClick(event); }); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { var _this4 = this; if (this.enabled) { var _this$dropdownMenuPlu; if ((_this$dropdownMenuPlu = this.dropdownMenuPlugin) !== null && _this$dropdownMenuPlu !== void 0 && _this$dropdownMenuPlu.enabled) { this.dropdownMenuPlugin.menu.clearLocalHooks(); } this.components.forEach(function (component, key) { component.destroy(); _this4.components.set(key, null); }); this.conditionCollection.destroy(); this.conditionCollection = null; this.hot.rowIndexMapper.unregisterMap(this.pluginName); } _get(_getPrototypeOf(Filters.prototype), "disablePlugin", this).call(this); } /* eslint-disable jsdoc/require-description-complete-sentence */ /** * @memberof Filters# * @function addCondition * @description * Adds condition to the conditions collection at specified column index. * * Possible predefined conditions: * * `begins_with` - Begins with * * `between` - Between * * `by_value` - By value * * `contains` - Contains * * `empty` - Empty * * `ends_with` - Ends with * * `eq` - Equal * * `gt` - Greater than * * `gte` - Greater than or equal * * `lt` - Less than * * `lte` - Less than or equal * * `none` - None (no filter) * * `not_between` - Not between * * `not_contains` - Not contains * * `not_empty` - Not empty * * `neq` - Not equal. * * Possible operations on collection of conditions: * * `conjunction` - [**Conjunction**](https://en.wikipedia.org/wiki/Logical_conjunction) on conditions collection (by default), i.e. for such operation:
c1 AND c2 AND c3 AND c4 ... AND cn === TRUE, where c1 ... cn are conditions. * * `disjunction` - [**Disjunction**](https://en.wikipedia.org/wiki/Logical_disjunction) on conditions collection, i.e. for such operation:
c1 OR c2 OR c3 OR c4 ... OR cn === TRUE, where c1, c2, c3, c4 ... cn are conditions. * * `disjunctionWithExtraCondition` - **Disjunction** on first `n - 1`\* conditions from collection with an extra requirement computed from the last condition, i.e. for such operation:
c1 OR c2 OR c3 OR c4 ... OR cn-1 AND cn === TRUE, where c1, c2, c3, c4 ... cn are conditions. * * \* when `n` is collection size; it's used i.e. for one operation introduced from UI (when choosing from filter's drop-down menu two conditions with OR operator between them, mixed with choosing values from the multiple choice select) * * **Note**: Mind that you cannot mix different types of operations (for instance, if you use `conjunction`, use it consequently for a particular column). * * @example * ```js * const container = document.getElementById('example'); * const hot = new Handsontable(container, { * data: getData(), * filters: true * }); * * // access to filters plugin instance * const filtersPlugin = hot.getPlugin('filters'); * * // add filter "Greater than" 95 to column at index 1 * filtersPlugin.addCondition(1, 'gt', [95]); * filtersPlugin.filter(); * * // add filter "By value" to column at index 1 * // in this case all value's that don't match will be filtered. * filtersPlugin.addCondition(1, 'by_value', [['ing', 'ed', 'as', 'on']]); * filtersPlugin.filter(); * * // add filter "Begins with" with value "de" AND "Not contains" with value "ing" * filtersPlugin.addCondition(1, 'begins_with', ['de'], 'conjunction'); * filtersPlugin.addCondition(1, 'not_contains', ['ing'], 'conjunction'); * filtersPlugin.filter(); * * // add filter "Begins with" with value "de" OR "Not contains" with value "ing" * filtersPlugin.addCondition(1, 'begins_with', ['de'], 'disjunction'); * filtersPlugin.addCondition(1, 'not_contains', ['ing'], 'disjunction'); * filtersPlugin.filter(); * ``` * @param {number} column Visual column index. * @param {string} name Condition short name. * @param {Array} args Condition arguments. * @param {string} [operationId=conjunction] `id` of operation which is performed on the column. */ /* eslint-enable jsdoc/require-description-complete-sentence */ }, { key: "addCondition", value: function addCondition(column, name, args) { var operationId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["OPERATION_AND"]; var physicalColumn = this.hot.toPhysicalColumn(column); this.conditionCollection.addCondition(physicalColumn, { command: { key: name }, args: args }, operationId); } /** * Removes conditions at specified column index. * * @param {number} column Visual column index. */ }, { key: "removeConditions", value: function removeConditions(column) { var physicalColumn = this.hot.toPhysicalColumn(column); this.conditionCollection.removeConditions(physicalColumn); } /** * Clears all conditions previously added to the collection for the specified column index or, if the column index * was not passed, clear the conditions for all columns. * * @param {number} [column] Visual column index. */ }, { key: "clearConditions", value: function clearConditions(column) { if (column === void 0) { this.conditionCollection.clean(); } else { var physicalColumn = this.hot.toPhysicalColumn(column); this.conditionCollection.removeConditions(physicalColumn); } } /** * Filters data based on added filter conditions. * * @fires Hooks#beforeFilter * @fires Hooks#afterFilter */ }, { key: "filter", value: function filter() { var _this5 = this; var dataFilter = this._createDataFilter(); var needToFilter = !this.conditionCollection.isEmpty(); var visibleVisualRows = []; var conditions = this.conditionCollection.exportAllConditions(); var allowFiltering = this.hot.runHooks('beforeFilter', conditions); if (allowFiltering !== false) { if (needToFilter) { var trimmedRows = []; this.hot.batchExecution(function () { _this5.filtersRowsMap.clear(); visibleVisualRows = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayMap"])(dataFilter.filter(), function (rowData) { return rowData.meta.visualRow; }); var visibleVisualRowsAssertion = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_36__["createArrayAssertion"])(visibleVisualRows); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_24__["rangeEach"])(_this5.hot.countSourceRows() - 1, function (row) { if (!visibleVisualRowsAssertion(row)) { trimmedRows.push(row); } }); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(trimmedRows, function (physicalRow) { _this5.filtersRowsMap.setValueAtIndex(physicalRow, true); }); }, true); if (!visibleVisualRows.length) { this.hot.deselectCell(); } } else { this.filtersRowsMap.clear(); } } this.hot.runHooks('afterFilter', conditions); this.hot.view.adjustElementsSize(true); this.hot.render(); this.clearColumnSelection(); } /** * Gets last selected column index. * * @returns {object|null} Return `null` when column isn't selected otherwise * object containing information about selected column with keys `visualIndex` and `physicalIndex`. */ }, { key: "getSelectedColumn", value: function getSelectedColumn() { return this.lastSelectedColumn; } /** * Clears column selection. * * @private */ }, { key: "clearColumnSelection", value: function clearColumnSelection() { var _this$hot$getSelected; var coords = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.getTopLeftCorner(); if (coords !== void 0) { this.hot.selectCell(coords.row, coords.col); } } /** * Returns handsontable source data with cell meta based on current selection. * * @param {number} [column] The physical column index. By default column index accept the value of the selected column. * @returns {Array} Returns array of objects where keys as row index. */ }, { key: "getDataMapAtColumn", value: function getDataMapAtColumn(column) { var _this6 = this; var visualIndex = this.hot.toVisualColumn(column); var data = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(this.hot.getSourceDataAtCol(visualIndex), function (value, rowIndex) { var _this6$hot$getCellMet = _this6.hot.getCellMeta(rowIndex, visualIndex), row = _this6$hot$getCellMet.row, col = _this6$hot$getCellMet.col, visualCol = _this6$hot$getCellMet.visualCol, visualRow = _this6$hot$getCellMet.visualRow, type = _this6$hot$getCellMet.type, instance = _this6$hot$getCellMet.instance, dateFormat = _this6$hot$getCellMet.dateFormat; data.push({ meta: { row: row, col: col, visualCol: visualCol, visualRow: visualRow, type: type, instance: instance, dateFormat: dateFormat }, value: Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_36__["toEmptyString"])(value) }); }); return data; } /** * `afterChange` listener. * * @private * @param {Array} changes Array of changes. */ }, { key: "onAfterChange", value: function onAfterChange(changes) { var _this7 = this; if (changes) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(changes, function (change) { var _change = _slicedToArray(change, 2), prop = _change[1]; var columnIndex = _this7.hot.propToCol(prop); if (_this7.conditionCollection.hasConditions(columnIndex)) { _this7.updateValueComponentCondition(columnIndex); } }); } } /** * Update condition of ValueComponent basing on handled changes. * * @private * @param {number} columnIndex Column index of handled ValueComponent condition. */ }, { key: "updateValueComponentCondition", value: function updateValueComponentCondition(columnIndex) { var dataAtCol = this.hot.getDataAtCol(columnIndex); var selectedValues = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_36__["unifyColumnValues"])(dataAtCol); this.conditionUpdateObserver.updateStatesAtColumn(columnIndex, selectedValues); } /** * Restores components to its saved state. * * @private * @param {Array} components List of components. */ }, { key: "restoreComponents", value: function restoreComponents(components) { var _this$getSelectedColu; var physicalIndex = (_this$getSelectedColu = this.getSelectedColumn()) === null || _this$getSelectedColu === void 0 ? void 0 : _this$getSelectedColu.physicalIndex; components.forEach(function (component) { if (component.isHidden()) { return; } component.restoreState(physicalIndex); }); this.updateDependentComponentsVisibility(); } /** * After dropdown menu show listener. * * @private */ }, { key: "onAfterDropdownMenuShow", value: function onAfterDropdownMenuShow() { this.restoreComponents(Array.from(this.components.values())); } /** * After dropdown menu hide listener. * * @private */ }, { key: "onAfterDropdownMenuHide", value: function onAfterDropdownMenuHide() { this.components.get('filter_by_condition').getSelectElement().closeOptions(); this.components.get('filter_by_condition2').getSelectElement().closeOptions(); } /** * Before dropdown menu set menu items listener. * * @private */ }, { key: "onBeforeDropdownMenuSetItems", value: function onBeforeDropdownMenuSetItems() { var _this8 = this; if (this.dropdownMenuPlugin) { this.dropdownMenuPlugin.menu.addLocalHook('afterOpen', function () { _this8.dropdownMenuPlugin.menu.hotMenu.updateSettings({ hiddenRows: true }); }); } } /** * After dropdown menu default options listener. * * @private * @param {object} defaultOptions ContextMenu default item options. */ }, { key: "onAfterDropdownMenuDefaultOptions", value: function onAfterDropdownMenuDefaultOptions(defaultOptions) { defaultOptions.items.push({ name: _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_27__["SEPARATOR"] }); this.components.forEach(function (component) { defaultOptions.items.push(component.getMenuItemDescriptor()); }); } /** * Get operation basing on number and type of arguments (where arguments are states of components). * * @param {string} suggestedOperation Operation which was chosen by user from UI. * @param {object} byConditionState1 State of first condition component. * @param {object} byConditionState2 State of second condition component. * @param {object} byValueState State of value component. * @private * @returns {string} */ }, { key: "getOperationBasedOnArguments", value: function getOperationBasedOnArguments(suggestedOperation, byConditionState1, byConditionState2, byValueState) { var operation = suggestedOperation; if (operation === _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["OPERATION_OR"] && byConditionState1.command.key !== _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["CONDITION_NONE"] && byConditionState2.command.key !== _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["CONDITION_NONE"] && byValueState.command.key !== _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["CONDITION_NONE"]) { operation = _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["OPERATION_OR_THEN_VARIABLE"]; } else if (byValueState.command.key !== _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["CONDITION_NONE"]) { if (byConditionState1.command.key === _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["CONDITION_NONE"] || byConditionState2.command.key === _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["CONDITION_NONE"]) { operation = _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["OPERATION_AND"]; } } return operation; } /** * On action bar submit listener. * * @private * @param {string} submitType The submit type. */ }, { key: "onActionBarSubmit", value: function onActionBarSubmit(submitType) { if (submitType === 'accept') { var _this$getSelectedColu2; var physicalIndex = (_this$getSelectedColu2 = this.getSelectedColumn()) === null || _this$getSelectedColu2 === void 0 ? void 0 : _this$getSelectedColu2.physicalIndex; var byConditionState1 = this.components.get('filter_by_condition').getState(); var byConditionState2 = this.components.get('filter_by_condition2').getState(); var byValueState = this.components.get('filter_by_value').getState(); var operation = this.getOperationBasedOnArguments(this.components.get('filter_operators').getActiveOperationId(), byConditionState1, byConditionState2, byValueState); this.conditionUpdateObserver.groupChanges(); var columnStackPosition = this.conditionCollection.getColumnStackPosition(physicalIndex); if (columnStackPosition === -1) { columnStackPosition = void 0; } this.conditionCollection.removeConditions(physicalIndex); if (byConditionState1.command.key !== _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["CONDITION_NONE"]) { this.conditionCollection.addCondition(physicalIndex, byConditionState1, operation, columnStackPosition); if (byConditionState2.command.key !== _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["CONDITION_NONE"]) { this.conditionCollection.addCondition(physicalIndex, byConditionState2, operation, columnStackPosition); } } if (byValueState.command.key !== _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["CONDITION_NONE"]) { this.conditionCollection.addCondition(physicalIndex, byValueState, operation, columnStackPosition); } this.conditionUpdateObserver.flush(); this.components.forEach(function (component) { return component.saveState(physicalIndex); }); this.filtersRowsMap.clear(); this.filter(); } if (this.dropdownMenuPlugin) { this.dropdownMenuPlugin.close(); } } /** * On component change listener. * * @private * @param {BaseComponent} component Component inheriting BaseComponent. * @param {object} command Menu item object (command). */ }, { key: "onComponentChange", value: function onComponentChange(component, command) { this.updateDependentComponentsVisibility(); if (component.constructor === _component_condition_mjs__WEBPACK_IMPORTED_MODULE_29__["default"] && !command.inputsCount) { this.setListeningDropdownMenu(); } } /** * On component SelectUI closed listener. * * @private */ }, { key: "onSelectUIClosed", value: function onSelectUIClosed() { this.setListeningDropdownMenu(); } /** * Listen to the keyboard input on document body and forward events to instance of Handsontable * created by DropdownMenu plugin. * * @private */ }, { key: "setListeningDropdownMenu", value: function setListeningDropdownMenu() { if (this.dropdownMenuPlugin) { this.dropdownMenuPlugin.setListening(); } } /** * Updates visibility of the some of the components based on the state of the parent component. * * @private */ }, { key: "updateDependentComponentsVisibility", value: function updateDependentComponentsVisibility() { var component = this.components.get('filter_by_condition'); var _component$getState = component.getState(), command = _component$getState.command; var componentsToShow = [this.components.get('filter_by_condition2'), this.components.get('filter_operators')]; if (command.showOperators) { this.showComponents.apply(this, componentsToShow); } else { this.hideComponents.apply(this, componentsToShow); } } /** * On after get column header listener. * * @private * @param {number} col Visual column index. * @param {HTMLTableCellElement} TH Header's TH element. */ }, { key: "onAfterGetColHeader", value: function onAfterGetColHeader(col, TH) { var physicalColumn = this.hot.toPhysicalColumn(col); if (this.enabled && this.conditionCollection.hasConditions(physicalColumn)) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_26__["addClass"])(TH, 'htFiltersActive'); } else { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_26__["removeClass"])(TH, 'htFiltersActive'); } } /** * On table click listener. * * @private * @param {Event} event DOM Event. */ }, { key: "onTableClick", value: function onTableClick(event) { var th = Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_26__["closest"])(event.target, 'TH'); if (th) { var visualIndex = this.hot.getCoords(th).col; var physicalIndex = this.hot.toPhysicalColumn(visualIndex); this.lastSelectedColumn = { visualIndex: visualIndex, physicalIndex: physicalIndex }; } } /** * Creates DataFilter instance based on condition collection. * * @private * @param {ConditionCollection} conditionCollection Condition collection object. * @returns {DataFilter} */ }, { key: "_createDataFilter", value: function _createDataFilter() { var _this9 = this; var conditionCollection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.conditionCollection; return new _dataFilter_mjs__WEBPACK_IMPORTED_MODULE_34__["default"](conditionCollection, function (physicalColumn) { return _this9.getDataMapAtColumn(physicalColumn); }); } /** * It updates the components state. The state is triggered by ConditionUpdateObserver, which * reacts to any condition added to the condition collection. It may be added through the UI * components or by API call. * * @private * @param {object} conditionsState An object with the state generated by UI components. */ }, { key: "updateComponents", value: function updateComponents(conditionsState) { var _this$dropdownMenuPlu2; if (!((_this$dropdownMenuPlu2 = this.dropdownMenuPlugin) !== null && _this$dropdownMenuPlu2 !== void 0 && _this$dropdownMenuPlu2.enabled)) { return; } var _conditionsState$edit = conditionsState.editedConditionStack, conditions = _conditionsState$edit.conditions, column = _conditionsState$edit.column; var conditionsByValue = conditions.filter(function (condition) { return condition.name === _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["CONDITION_BY_VALUE"]; }); var conditionsWithoutByValue = conditions.filter(function (condition) { return condition.name !== _constants_mjs__WEBPACK_IMPORTED_MODULE_37__["CONDITION_BY_VALUE"]; }); if (conditionsByValue.length >= 2 || conditionsWithoutByValue.length >= 3) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_23__["warn"])(Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_22__["toSingleLine"])(_templateObject || (_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.\\x20\n The overall amount of conditions exceed the capability of the dropdown menu.\\x20\n For more details see the documentation."])))); } else { var operationType = this.conditionCollection.getOperation(column); this.components.get('filter_by_condition').updateState(conditionsWithoutByValue[0], column); this.components.get('filter_by_condition2').updateState(conditionsWithoutByValue[1], column); this.components.get('filter_operators').updateState(operationType, column); this.components.get('filter_by_value').updateState(conditionsState); } } /** * Returns indexes of passed components inside list of `dropdownMenu` items. * * @private * @param {...BaseComponent} components List of components. * @returns {Array} */ }, { key: "getIndexesOfComponents", value: function getIndexesOfComponents() { var indexes = []; if (!this.dropdownMenuPlugin) { return indexes; } var menu = this.dropdownMenuPlugin.menu; for (var _len = arguments.length, components = new Array(_len), _key = 0; _key < _len; _key++) { components[_key] = arguments[_key]; } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(components, function (component) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(menu.menuItems, function (item, index) { if (item.key === component.getMenuItemDescriptor().key) { indexes.push(index); } }); }); return indexes; } /** * Changes visibility of component. * * @private * @param {boolean} visible Determine if components should be visible. * @param {...BaseComponent} components List of components. */ }, { key: "changeComponentsVisibility", value: function changeComponentsVisibility() { var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; if (!this.dropdownMenuPlugin) { return; } var menu = this.dropdownMenuPlugin.menu; var hotMenu = menu.hotMenu; var hiddenRows = hotMenu.getPlugin('hiddenRows'); for (var _len2 = arguments.length, components = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { components[_key2 - 1] = arguments[_key2]; } var indexes = this.getIndexesOfComponents.apply(this, components); if (visible) { hiddenRows.showRows(indexes); } else { hiddenRows.hideRows(indexes); } hotMenu.render(); } /** * Hides components of filters `dropdownMenu`. * * @private * @param {...BaseComponent} components List of components. */ }, { key: "hideComponents", value: function hideComponents() { for (var _len3 = arguments.length, components = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { components[_key3] = arguments[_key3]; } this.changeComponentsVisibility.apply(this, [false].concat(components)); } /** * Shows components of filters `dropdownMenu`. * * @private * @param {...BaseComponent} components List of components. */ }, { key: "showComponents", value: function showComponents() { for (var _len4 = arguments.length, components = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { components[_key4] = arguments[_key4]; } this.changeComponentsVisibility.apply(this, [true].concat(components)); } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { var _this10 = this; if (this.enabled) { this.components.forEach(function (component, key) { if (component !== null) { component.destroy(); _this10.components.set(key, null); } }); this.conditionCollection.destroy(); this.conditionUpdateObserver.destroy(); this.hot.rowIndexMapper.unregisterMap(this.pluginName); } _get(_getPrototypeOf(Filters.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }, { key: "PLUGIN_DEPS", get: function get() { return ['plugin:DropdownMenu', 'plugin:HiddenRows', 'cell-type:checkbox']; } }]); return Filters; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_20__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/index.mjs": /*!*************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/index.mjs ***! \*************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, Filters */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _filters_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filters.mjs */ "./node_modules/handsontable/plugins/filters/filters.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _filters_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _filters_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Filters", function() { return _filters_mjs__WEBPACK_IMPORTED_MODULE_0__["Filters"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/logicalOperationRegisterer.mjs": /*!**********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/logicalOperationRegisterer.mjs ***! \**********************************************************************************/ /*! exports provided: operations, getOperationFunc, getOperationName, registerOperation */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "operations", function() { return operations; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOperationFunc", function() { return getOperationFunc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOperationName", function() { return getOperationName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerOperation", function() { return registerOperation; }); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); var operations = {}; /** * Get operation closure with pre-bound arguments. * * @param {string} id Operator `id`. * @returns {Function} */ function getOperationFunc(id) { if (!operations[id]) { throw Error("Operation with id \"".concat(id, "\" does not exist.")); } var func = operations[id].func; return function (conditions, value) { return func(conditions, value); }; } /** * Return name of operation which is displayed inside UI component, basing on it's `id`. * * @param {string} id `Id` of operation. * @returns {string} */ function getOperationName(id) { return operations[id].name; } /** * Operator registerer. * * @param {string} id Operation `id`. * @param {string} name Operation name which is displayed inside UI component. * @param {Function} func Operation function. */ function registerOperation(id, name, func) { operations[id] = { name: name, func: func }; } /***/ }), /***/ "./node_modules/handsontable/plugins/filters/logicalOperations/conjunction.mjs": /*!*************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/logicalOperations/conjunction.mjs ***! \*************************************************************************************/ /*! exports provided: OPERATION_ID, SHORT_NAME_FOR_COMPONENT, operationResult */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OPERATION_ID", function() { return OPERATION_ID; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SHORT_NAME_FOR_COMPONENT", function() { return SHORT_NAME_FOR_COMPONENT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "operationResult", function() { return operationResult; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _logicalOperationRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../logicalOperationRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/logicalOperationRegisterer.mjs"); var OPERATION_ID = 'conjunction'; var SHORT_NAME_FOR_COMPONENT = _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["FILTERS_LABELS_CONJUNCTION"]; // p AND q AND w AND x AND... === TRUE? /** * @param {Array} conditions An array with values to check. * @param {*} value The comparable value. * @returns {boolean} */ function operationResult(conditions, value) { return conditions.every(function (condition) { return condition.func(value); }); } Object(_logicalOperationRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__["registerOperation"])(OPERATION_ID, SHORT_NAME_FOR_COMPONENT, operationResult); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/logicalOperations/disjunction.mjs": /*!*************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/logicalOperations/disjunction.mjs ***! \*************************************************************************************/ /*! exports provided: OPERATION_ID, SHORT_NAME_FOR_COMPONENT, operationResult */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OPERATION_ID", function() { return OPERATION_ID; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SHORT_NAME_FOR_COMPONENT", function() { return SHORT_NAME_FOR_COMPONENT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "operationResult", function() { return operationResult; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _logicalOperationRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../logicalOperationRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/logicalOperationRegisterer.mjs"); var OPERATION_ID = 'disjunction'; var SHORT_NAME_FOR_COMPONENT = _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["FILTERS_LABELS_DISJUNCTION"]; // (p OR q OR w OR x OR...) === TRUE? /** * @param {Array} conditions An array with values to check. * @param {*} value The comparable value. * @returns {boolean} */ function operationResult(conditions, value) { return conditions.some(function (condition) { return condition.func(value); }); } Object(_logicalOperationRegisterer_mjs__WEBPACK_IMPORTED_MODULE_1__["registerOperation"])(OPERATION_ID, SHORT_NAME_FOR_COMPONENT, operationResult); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/logicalOperations/disjunctionWithExtraCondition.mjs": /*!*******************************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/logicalOperations/disjunctionWithExtraCondition.mjs ***! \*******************************************************************************************************/ /*! exports provided: OPERATION_ID, SHORT_NAME_FOR_COMPONENT, operationResult */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OPERATION_ID", function() { return OPERATION_ID; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SHORT_NAME_FOR_COMPONENT", function() { return SHORT_NAME_FOR_COMPONENT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "operationResult", function() { return operationResult; }); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _logicalOperationRegisterer_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../logicalOperationRegisterer.mjs */ "./node_modules/handsontable/plugins/filters/logicalOperationRegisterer.mjs"); var OPERATION_ID = 'disjunctionWithExtraCondition'; var SHORT_NAME_FOR_COMPONENT = _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_1__["FILTERS_LABELS_DISJUNCTION"]; // ((p OR q OR w OR x OR...) AND z) === TRUE? /** * @param {Array} conditions An array with values to check. * @param {*} value The comparable value. * @returns {boolean} */ function operationResult(conditions, value) { if (conditions.length < 3) { throw Error('Operation doesn\'t work on less then three conditions.'); } return conditions.slice(0, conditions.length - 1).some(function (condition) { return condition.func(value); }) && conditions[conditions.length - 1].func(value); } Object(_logicalOperationRegisterer_mjs__WEBPACK_IMPORTED_MODULE_2__["registerOperation"])(OPERATION_ID, SHORT_NAME_FOR_COMPONENT, operationResult); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/ui/_base.mjs": /*!****************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/ui/_base.mjs ***! \****************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.string.starts-with.js */ "./node_modules/core-js/modules/es.string.starts-with.js"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../mixins/localHooks.mjs */ "./node_modules/handsontable/mixins/localHooks.mjs"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var STATE_BUILT = 'built'; var STATE_BUILDING = 'building'; var EVENTS_TO_REGISTER = ['click', 'input', 'keydown', 'keypress', 'keyup', 'focus', 'blur', 'change']; /** * @class * @private */ var BaseUI = /*#__PURE__*/function () { function BaseUI(hotInstance, options) { _classCallCheck(this, BaseUI); /** * Instance of Handsontable. * * @type {Core} */ this.hot = hotInstance; /** * Instance of EventManager. * * @type {EventManager} */ this.eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_3__["default"](this); /** * List of element options. * * @type {object} */ this.options = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["extend"])(BaseUI.DEFAULTS, options); /** * Build root DOM element. * * @type {Element} * @private */ this._element = this.hot.rootDocument.createElement(this.options.wrapIt ? 'div' : this.options.tagName); /** * Flag which determines build state of element. * * @type {boolean} */ this.buildState = false; } /** * Set the element value. * * @param {*} value Set the component value. */ _createClass(BaseUI, [{ key: "setValue", value: function setValue(value) { this.options.value = value; this.update(); } /** * Get the element value. * * @returns {*} */ }, { key: "getValue", value: function getValue() { return this.options.value; } /** * Get element as a DOM object. * * @returns {Element} */ }, { key: "element", get: function get() { if (this.buildState === STATE_BUILDING) { return this._element; } if (this.buildState === STATE_BUILT) { this.update(); return this._element; } this.buildState = STATE_BUILDING; this.build(); this.buildState = STATE_BUILT; return this._element; } /** * Check if element was built (built whole DOM structure). * * @returns {boolean} */ }, { key: "isBuilt", value: function isBuilt() { return this.buildState === STATE_BUILT; } /** * Translate value if it is possible. It's checked if value belongs to namespace of translated phrases. * * @param {*} value Value which will may be translated. * @returns {*} Translated value if translation was possible, original value otherwise. */ }, { key: "translateIfPossible", value: function translateIfPossible(value) { if (typeof value === 'string' && value.startsWith(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_6__["FILTERS_NAMESPACE"])) { return this.hot.getTranslatedPhrase(value); } return value; } /** * Build DOM structure. */ }, { key: "build", value: function build() { var _this = this; var registerEvent = function registerEvent(element, eventName) { _this.eventManager.addEventListener(element, eventName, function (event) { return _this.runLocalHooks(eventName, event, _this); }); }; if (!this.buildState) { this.buildState = STATE_BUILDING; } if (this.options.className) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_4__["addClass"])(this._element, this.options.className); } if (this.options.children.length) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_5__["arrayEach"])(this.options.children, function (element) { return _this._element.appendChild(element.element); }); } else if (this.options.wrapIt) { var element = this.hot.rootDocument.createElement(this.options.tagName); Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["objectEach"])(this.options, function (value, key) { if (element[key] !== void 0 && key !== 'className' && key !== 'tagName' && key !== 'children') { element[key] = _this.translateIfPossible(value); } }); this._element.appendChild(element); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_5__["arrayEach"])(EVENTS_TO_REGISTER, function (eventName) { return registerEvent(element, eventName); }); } else { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_5__["arrayEach"])(EVENTS_TO_REGISTER, function (eventName) { return registerEvent(_this._element, eventName); }); } } /** * Update DOM structure. */ }, { key: "update", value: function update() {} /** * Reset to initial state. */ }, { key: "reset", value: function reset() { this.options.value = ''; this.update(); } /** * Show element. */ }, { key: "show", value: function show() { this.element.style.display = ''; } /** * Hide element. */ }, { key: "hide", value: function hide() { this.element.style.display = 'none'; } /** * Focus element. */ }, { key: "focus", value: function focus() {} }, { key: "destroy", value: function destroy() { this.eventManager.destroy(); this.eventManager = null; this.hot = null; if (this._element.parentNode) { this._element.parentNode.removeChild(this._element); } this._element = null; } }], [{ key: "DEFAULTS", get: function get() { return Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["clone"])({ className: '', value: '', tagName: 'div', children: [], wrapIt: true }); } }]); return BaseUI; }(); Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["mixin"])(BaseUI, _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]); /* harmony default export */ __webpack_exports__["default"] = (BaseUI); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/ui/input.mjs": /*!****************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/ui/input.mjs ***! \****************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/filters/ui/_base.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var privatePool = new WeakMap(); /** * @class InputUI * @util */ var InputUI = /*#__PURE__*/function (_BaseUI) { _inherits(InputUI, _BaseUI); var _super = _createSuper(InputUI); function InputUI(hotInstance, options) { var _this; _classCallCheck(this, InputUI); _this = _super.call(this, hotInstance, Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_14__["extend"])(InputUI.DEFAULTS, options)); privatePool.set(_assertThisInitialized(_this), {}); _this.registerHooks(); return _this; } /** * Register all necessary hooks. */ _createClass(InputUI, [{ key: "registerHooks", value: function registerHooks() { var _this2 = this; this.addLocalHook('click', function () { return _this2.onClick(); }); this.addLocalHook('keyup', function (event) { return _this2.onKeyup(event); }); } /** * Build DOM structure. */ }, { key: "build", value: function build() { _get(_getPrototypeOf(InputUI.prototype), "build", this).call(this); var priv = privatePool.get(this); var icon = this.hot.rootDocument.createElement('div'); priv.input = this._element.firstChild; Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(this._element, 'htUIInput'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(icon, 'htUIInputIcon'); this._element.appendChild(icon); this.update(); } /** * Update element. */ }, { key: "update", value: function update() { if (!this.isBuilt()) { return; } var input = privatePool.get(this).input; input.type = this.options.type; input.placeholder = this.translateIfPossible(this.options.placeholder); input.value = this.translateIfPossible(this.options.value); } /** * Focus element. */ }, { key: "focus", value: function focus() { if (this.isBuilt()) { privatePool.get(this).input.focus(); } } /** * OnClick listener. */ }, { key: "onClick", value: function onClick() {} /** * OnKeyup listener. * * @param {Event} event The mouse event object. */ }, { key: "onKeyup", value: function onKeyup(event) { this.options.value = event.target.value; } }], [{ key: "DEFAULTS", get: function get() { return Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_14__["clone"])({ placeholder: '', type: 'text', tagName: 'input' }); } }]); return InputUI; }(_base_mjs__WEBPACK_IMPORTED_MODULE_15__["default"]); /* harmony default export */ __webpack_exports__["default"] = (InputUI); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/ui/link.mjs": /*!***************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/ui/link.mjs ***! \***************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_string_link_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.link.js */ "./node_modules/core-js/modules/es.string.link.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/filters/ui/_base.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var privatePool = new WeakMap(); /** * @class LinkUI * @util */ var LinkUI = /*#__PURE__*/function (_BaseUI) { _inherits(LinkUI, _BaseUI); var _super = _createSuper(LinkUI); function LinkUI(hotInstance, options) { var _this; _classCallCheck(this, LinkUI); _this = _super.call(this, hotInstance, Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_14__["extend"])(LinkUI.DEFAULTS, options)); privatePool.set(_assertThisInitialized(_this), {}); return _this; } /** * Build DOM structure. */ _createClass(LinkUI, [{ key: "build", value: function build() { _get(_getPrototypeOf(LinkUI.prototype), "build", this).call(this); var priv = privatePool.get(this); priv.link = this._element.firstChild; } /** * Update element. */ }, { key: "update", value: function update() { if (!this.isBuilt()) { return; } privatePool.get(this).link.textContent = this.translateIfPossible(this.options.textContent); } }], [{ key: "DEFAULTS", get: function get() { return Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_14__["clone"])({ href: '#', tagName: 'a' }); } }]); return LinkUI; }(_base_mjs__WEBPACK_IMPORTED_MODULE_15__["default"]); /* harmony default export */ __webpack_exports__["default"] = (LinkUI); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/ui/multipleSelect.mjs": /*!*************************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/ui/multipleSelect.mjs ***! \*************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.timers.js */ "./node_modules/core-js/modules/web.timers.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../helpers/unicode.mjs */ "./node_modules/handsontable/helpers/unicode.mjs"); /* harmony import */ var _helpers_function_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../../helpers/function.mjs */ "./node_modules/handsontable/helpers/function.mjs"); /* harmony import */ var _helpers_data_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../helpers/data.mjs */ "./node_modules/handsontable/helpers/data.mjs"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../../helpers/dom/event.mjs */ "./node_modules/handsontable/helpers/dom/event.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/filters/ui/_base.mjs"); /* harmony import */ var _input_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./input.mjs */ "./node_modules/handsontable/plugins/filters/ui/input.mjs"); /* harmony import */ var _link_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./link.mjs */ "./node_modules/handsontable/plugins/filters/ui/link.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../utils.mjs */ "./node_modules/handsontable/plugins/filters/utils.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var privatePool = new WeakMap(); /** * @class MultipleSelectUI * @util */ var MultipleSelectUI = /*#__PURE__*/function (_BaseUI) { _inherits(MultipleSelectUI, _BaseUI); var _super = _createSuper(MultipleSelectUI); function MultipleSelectUI(hotInstance, options) { var _this; _classCallCheck(this, MultipleSelectUI); _this = _super.call(this, hotInstance, Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_19__["extend"])(MultipleSelectUI.DEFAULTS, options)); privatePool.set(_assertThisInitialized(_this), {}); /** * Input element. * * @type {InputUI} */ _this.searchInput = new _input_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](_this.hot, { placeholder: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_24__["FILTERS_BUTTONS_PLACEHOLDER_SEARCH"], className: 'htUIMultipleSelectSearch' }); /** * "Select all" UI element. * * @type {BaseUI} */ _this.selectAllUI = new _link_mjs__WEBPACK_IMPORTED_MODULE_28__["default"](_this.hot, { textContent: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_24__["FILTERS_BUTTONS_SELECT_ALL"], className: 'htUISelectAll' }); /** * "Clear" UI element. * * @type {BaseUI} */ _this.clearAllUI = new _link_mjs__WEBPACK_IMPORTED_MODULE_28__["default"](_this.hot, { textContent: _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_24__["FILTERS_BUTTONS_CLEAR"], className: 'htUIClearAll' }); /** * List of available select options. * * @type {Array} */ _this.items = []; /** * Handsontable instance used as items list element. * * @type {Handsontable} */ _this.itemsBox = null; _this.registerHooks(); return _this; } /** * Register all necessary hooks. */ _createClass(MultipleSelectUI, [{ key: "registerHooks", value: function registerHooks() { var _this2 = this; this.searchInput.addLocalHook('keydown', function (event) { return _this2.onInputKeyDown(event); }); this.searchInput.addLocalHook('input', function (event) { return _this2.onInput(event); }); this.selectAllUI.addLocalHook('click', function (event) { return _this2.onSelectAllClick(event); }); this.clearAllUI.addLocalHook('click', function (event) { return _this2.onClearAllClick(event); }); } /** * Set available options. * * @param {Array} items Array of objects with `checked` and `label` property. */ }, { key: "setItems", value: function setItems(items) { this.items = items; if (this.itemsBox) { this.itemsBox.loadData(this.items); } } /** * Get all available options. * * @returns {Array} */ }, { key: "getItems", value: function getItems() { return _toConsumableArray(this.items); } /** * Get element value. * * @returns {Array} Array of selected values. */ }, { key: "getValue", value: function getValue() { return itemsToValue(this.items); } /** * Check if all values listed in element are selected. * * @returns {boolean} */ }, { key: "isSelectedAllValues", value: function isSelectedAllValues() { return this.items.length === this.getValue().length; } /** * Build DOM structure. */ }, { key: "build", value: function build() { var _this3 = this; _get(_getPrototypeOf(MultipleSelectUI.prototype), "build", this).call(this); var rootDocument = this.hot.rootDocument; var itemsBoxWrapper = rootDocument.createElement('div'); var selectionControl = new _base_mjs__WEBPACK_IMPORTED_MODULE_26__["default"](this.hot, { className: 'htUISelectionControls', children: [this.selectAllUI, this.clearAllUI] }); this._element.appendChild(this.searchInput.element); this._element.appendChild(selectionControl.element); this._element.appendChild(itemsBoxWrapper); var hotInitializer = function hotInitializer(wrapper) { if (!_this3._element) { return; } if (_this3.itemsBox) { _this3.itemsBox.destroy(); } Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(wrapper, 'htUIMultipleSelectHot'); // Construct and initialise a new Handsontable _this3.itemsBox = new _this3.hot.constructor(wrapper, { data: _this3.items, columns: [{ data: 'checked', type: 'checkbox', label: { property: 'visualValue', position: 'after' } }], beforeRenderer: function beforeRenderer(TD, row, col, prop, value, cellProperties) { TD.title = cellProperties.instance.getDataAtRowProp(row, cellProperties.label.property); }, maxCols: 1, autoWrapCol: true, height: 110, // Workaround for #151. colWidths: function colWidths() { return _this3.itemsBox.container.scrollWidth - Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["getScrollbarWidth"])(rootDocument); }, copyPaste: false, disableVisualSelection: 'area', fillHandle: false, fragmentSelection: 'cell', tabMoves: { row: 1, col: 0 }, beforeKeyDown: function beforeKeyDown(event) { return _this3.onItemsBoxBeforeKeyDown(event); } }); _this3.itemsBox.init(); }; hotInitializer(itemsBoxWrapper); setTimeout(function () { return hotInitializer(itemsBoxWrapper); }, 100); } /** * Reset DOM structure. */ }, { key: "reset", value: function reset() { this.searchInput.reset(); this.selectAllUI.reset(); this.clearAllUI.reset(); } /** * Update DOM structure. */ }, { key: "update", value: function update() { if (!this.isBuilt()) { return; } this.itemsBox.loadData(valueToItems(this.items, this.options.value)); _get(_getPrototypeOf(MultipleSelectUI.prototype), "update", this).call(this); } /** * Destroy instance. */ }, { key: "destroy", value: function destroy() { if (this.itemsBox) { this.itemsBox.destroy(); } this.searchInput.destroy(); this.clearAllUI.destroy(); this.selectAllUI.destroy(); this.searchInput = null; this.clearAllUI = null; this.selectAllUI = null; this.itemsBox = null; this.items = null; _get(_getPrototypeOf(MultipleSelectUI.prototype), "destroy", this).call(this); } /** * 'input' event listener for input element. * * @private * @param {Event} event DOM event. */ }, { key: "onInput", value: function onInput(event) { var value = event.target.value.toLowerCase(); var filteredItems; if (value === '') { filteredItems = _toConsumableArray(this.items); } else { filteredItems = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayFilter"])(this.items, function (item) { return "".concat(item.value).toLowerCase().indexOf(value) >= 0; }); } this.itemsBox.loadData(filteredItems); } /** * 'keydown' event listener for input element. * * @private * @param {Event} event DOM event. */ }, { key: "onInputKeyDown", value: function onInputKeyDown(event) { this.runLocalHooks('keydown', event, this); var isKeyCode = Object(_helpers_function_mjs__WEBPACK_IMPORTED_MODULE_22__["partial"])(_helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_21__["isKey"], event.keyCode); if (isKeyCode('ARROW_DOWN|TAB') && !this.itemsBox.isListening()) { Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_25__["stopImmediatePropagation"])(event); this.itemsBox.listen(); this.itemsBox.selectCell(0, 0); } } /** * On before key down listener (internal Handsontable). * * @private * @param {Event} event DOM event. */ }, { key: "onItemsBoxBeforeKeyDown", value: function onItemsBoxBeforeKeyDown(event) { var isKeyCode = Object(_helpers_function_mjs__WEBPACK_IMPORTED_MODULE_22__["partial"])(_helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_21__["isKey"], event.keyCode); if (isKeyCode('ESCAPE')) { this.runLocalHooks('keydown', event, this); } // for keys different than below, unfocus Handsontable and focus search input if (!isKeyCode('ARROW_UP|ARROW_DOWN|ARROW_LEFT|ARROW_RIGHT|TAB|SPACE|ENTER')) { Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_25__["stopImmediatePropagation"])(event); this.itemsBox.unlisten(); this.itemsBox.deselectCell(); this.searchInput.focus(); } } /** * On click listener for "Select all" link. * * @private * @param {DOMEvent} event The mouse event object. */ }, { key: "onSelectAllClick", value: function onSelectAllClick(event) { var changes = []; event.preventDefault(); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.itemsBox.getSourceData(), function (row, rowIndex) { row.checked = true; changes.push(Object(_helpers_data_mjs__WEBPACK_IMPORTED_MODULE_23__["dataRowToChangesArray"])(row, rowIndex)[0]); }); this.itemsBox.setSourceDataAtCell(changes); } /** * On click listener for "Clear" link. * * @private * @param {DOMEvent} event The mouse event object. */ }, { key: "onClearAllClick", value: function onClearAllClick(event) { var changes = []; event.preventDefault(); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.itemsBox.getSourceData(), function (row, rowIndex) { row.checked = false; changes.push(Object(_helpers_data_mjs__WEBPACK_IMPORTED_MODULE_23__["dataRowToChangesArray"])(row, rowIndex)[0]); }); this.itemsBox.setSourceDataAtCell(changes); } }], [{ key: "DEFAULTS", get: function get() { return Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_19__["clone"])({ className: 'htUIMultipleSelect', value: [] }); } }]); return MultipleSelectUI; }(_base_mjs__WEBPACK_IMPORTED_MODULE_26__["default"]); /* harmony default export */ __webpack_exports__["default"] = (MultipleSelectUI); /** * Pick up object items based on selected values. * * @param {Array} availableItems Base collection to compare values. * @param {Array} selectedValue Flat array with selected values. * @returns {Array} */ function valueToItems(availableItems, selectedValue) { var arrayAssertion = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_29__["createArrayAssertion"])(selectedValue); return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayMap"])(availableItems, function (item) { item.checked = arrayAssertion(item.value); return item; }); } /** * Convert all checked items into flat array. * * @param {Array} availableItems Base collection. * @returns {Array} */ function itemsToValue(availableItems) { var items = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(availableItems, function (item) { if (item.checked) { items.push(item.value); } }); return items; } /***/ }), /***/ "./node_modules/handsontable/plugins/filters/ui/radioInput.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/ui/radioInput.mjs ***! \*********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/filters/ui/_base.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var privatePool = new WeakMap(); /** * @class RadioInputUI * @util */ var RadioInputUI = /*#__PURE__*/function (_BaseUI) { _inherits(RadioInputUI, _BaseUI); var _super = _createSuper(RadioInputUI); function RadioInputUI(hotInstance, options) { var _this; _classCallCheck(this, RadioInputUI); _this = _super.call(this, hotInstance, Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_13__["extend"])(RadioInputUI.DEFAULTS, options)); privatePool.set(_assertThisInitialized(_this), {}); return _this; } /** * Build DOM structure. */ _createClass(RadioInputUI, [{ key: "build", value: function build() { _get(_getPrototypeOf(RadioInputUI.prototype), "build", this).call(this); var priv = privatePool.get(this); priv.input = this._element.firstChild; var label = this.hot.rootDocument.createElement('label'); label.textContent = this.translateIfPossible(this.options.label.textContent); label.htmlFor = this.translateIfPossible(this.options.label.htmlFor); priv.label = label; this._element.appendChild(label); this.update(); } /** * Update element. */ }, { key: "update", value: function update() { if (!this.isBuilt()) { return; } var priv = privatePool.get(this); priv.input.checked = this.options.checked; priv.label.textContent = this.translateIfPossible(this.options.label.textContent); } /** * Check if radio button is checked. * * @returns {boolean} */ }, { key: "isChecked", value: function isChecked() { return this.options.checked; } /** * Set input checked attribute. * * @param {boolean} value Set the component state. */ }, { key: "setChecked", value: function setChecked() { var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; this.options.checked = value; this.update(); } /** * Focus element. */ }, { key: "focus", value: function focus() { if (this.isBuilt()) { privatePool.get(this).input.focus(); } } }], [{ key: "DEFAULTS", get: function get() { return Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_13__["clone"])({ type: 'radio', tagName: 'input', className: 'htUIRadio', label: {} }); } }]); return RadioInputUI; }(_base_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]); /* harmony default export */ __webpack_exports__["default"] = (RadioInputUI); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/ui/select.mjs": /*!*****************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/ui/select.mjs ***! \*****************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _plugins_contextMenu_menu_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../plugins/contextMenu/menu.mjs */ "./node_modules/handsontable/plugins/contextMenu/menu.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _plugins_contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../plugins/contextMenu/predefinedItems.mjs */ "./node_modules/handsontable/plugins/contextMenu/predefinedItems.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/filters/ui/_base.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var privatePool = new WeakMap(); /** * @class SelectUI * @util */ var SelectUI = /*#__PURE__*/function (_BaseUI) { _inherits(SelectUI, _BaseUI); var _super = _createSuper(SelectUI); function SelectUI(hotInstance, options) { var _this; _classCallCheck(this, SelectUI); _this = _super.call(this, hotInstance, Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_15__["extend"])(SelectUI.DEFAULTS, options)); privatePool.set(_assertThisInitialized(_this), {}); /** * Instance of {@link Menu}. * * @type {Menu} */ _this.menu = null; /** * List of available select options. * * @type {Array} */ _this.items = []; _this.registerHooks(); return _this; } /** * Register all necessary hooks. */ _createClass(SelectUI, [{ key: "registerHooks", value: function registerHooks() { var _this2 = this; this.addLocalHook('click', function () { return _this2.onClick(); }); } /** * Set options which can be selected in the list. * * @param {Array} items Array of objects with required keys `key` and `name`. */ }, { key: "setItems", value: function setItems(items) { this.items = this.translateNames(items); if (this.menu) { this.menu.setMenuItems(this.items); } } /** * Translate names of menu items. * * @param {Array} items Array of objects with required keys `key` and `name`. * @returns {Array} Items with translated `name` keys. */ }, { key: "translateNames", value: function translateNames(items) { var _this3 = this; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(items, function (item) { item.name = _this3.translateIfPossible(item.name); }); return items; } /** * Build DOM structure. */ }, { key: "build", value: function build() { var _this4 = this; _get(_getPrototypeOf(SelectUI.prototype), "build", this).call(this); this.menu = new _plugins_contextMenu_menu_mjs__WEBPACK_IMPORTED_MODULE_14__["default"](this.hot, { className: 'htSelectUI htFiltersConditionsMenu', keepInViewport: false, standalone: true, container: this.options.menuContainer }); this.menu.setMenuItems(this.items); var caption = new _base_mjs__WEBPACK_IMPORTED_MODULE_19__["default"](this.hot, { className: 'htUISelectCaption' }); var dropdown = new _base_mjs__WEBPACK_IMPORTED_MODULE_19__["default"](this.hot, { className: 'htUISelectDropdown' }); var priv = privatePool.get(this); priv.caption = caption; priv.captionElement = caption.element; priv.dropdown = dropdown; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])([caption, dropdown], function (element) { return _this4._element.appendChild(element.element); }); this.menu.addLocalHook('select', function (command) { return _this4.onMenuSelect(command); }); this.menu.addLocalHook('afterClose', function () { return _this4.onMenuClosed(); }); this.update(); } /** * Update DOM structure. */ }, { key: "update", value: function update() { if (!this.isBuilt()) { return; } var conditionName; if (this.options.value) { conditionName = this.options.value.name; } else { conditionName = this.menu.hot.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_17__["FILTERS_CONDITIONS_NONE"]); } privatePool.get(this).captionElement.textContent = conditionName; _get(_getPrototypeOf(SelectUI.prototype), "update", this).call(this); } /** * Open select dropdown menu with available options. */ }, { key: "openOptions", value: function openOptions() { var rect = this.element.getBoundingClientRect(); if (this.menu) { this.menu.open(); this.menu.setPosition({ left: rect.left - 5, top: rect.top - 1, width: rect.width, height: rect.height }); } } /** * Close select dropdown menu. */ }, { key: "closeOptions", value: function closeOptions() { if (this.menu) { this.menu.close(); } } /** * On menu selected listener. * * @private * @param {object} command Selected item. */ }, { key: "onMenuSelect", value: function onMenuSelect(command) { if (command.name !== _plugins_contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_18__["SEPARATOR"]) { this.options.value = command; this.update(); this.runLocalHooks('select', this.options.value); } } /** * On menu closed listener. * * @private */ }, { key: "onMenuClosed", value: function onMenuClosed() { this.runLocalHooks('afterClose'); } /** * On element click listener. * * @private */ }, { key: "onClick", value: function onClick() { this.openOptions(); } /** * Destroy instance. */ }, { key: "destroy", value: function destroy() { if (this.menu) { this.menu.destroy(); this.menu = null; } var _privatePool$get = privatePool.get(this), caption = _privatePool$get.caption, dropdown = _privatePool$get.dropdown; if (caption) { caption.destroy(); } if (dropdown) { dropdown.destroy(); } _get(_getPrototypeOf(SelectUI.prototype), "destroy", this).call(this); } }], [{ key: "DEFAULTS", get: function get() { return Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_15__["clone"])({ className: 'htUISelect', wrapIt: false }); } }]); return SelectUI; }(_base_mjs__WEBPACK_IMPORTED_MODULE_19__["default"]); /* harmony default export */ __webpack_exports__["default"] = (SelectUI); /***/ }), /***/ "./node_modules/handsontable/plugins/filters/utils.mjs": /*!*************************************************************!*\ !*** ./node_modules/handsontable/plugins/filters/utils.mjs ***! \*************************************************************/ /*! exports provided: sortComparison, toVisualValue, createArrayAssertion, toEmptyString, unifyColumnValues, intersectValues */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortComparison", function() { return sortComparison; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toVisualValue", function() { return toVisualValue; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createArrayAssertion", function() { return createArrayAssertion; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toEmptyString", function() { return toEmptyString; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unifyColumnValues", function() { return unifyColumnValues; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "intersectValues", function() { return intersectValues; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.sort.js */ "./node_modules/core-js/modules/es.array.sort.js"); /* harmony import */ var _helpers_feature_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../helpers/feature.mjs */ "./node_modules/handsontable/helpers/feature.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); var sortCompare = Object(_helpers_feature_mjs__WEBPACK_IMPORTED_MODULE_8__["getComparisonFunction"])(); /** * Comparison function for sorting purposes. * * @param {*} a The first value to compare. * @param {*} b The second value to compare. * @returns {number} Returns number from -1 to 1. */ function sortComparison(a, b) { if (typeof a === 'number' && typeof b === 'number') { return a - b; } return sortCompare(a, b); } /** * Convert raw value into visual value. * * @param {*} value The value to convert. * @param {string} defaultEmptyValue Default value for empty cells. * @returns {*} */ function toVisualValue(value, defaultEmptyValue) { var visualValue = value; if (visualValue === '') { visualValue = "(".concat(defaultEmptyValue, ")"); } return visualValue; } var SUPPORT_SET_CONSTRUCTOR = new Set([1]).has(1); var SUPPORT_FAST_DEDUPE = SUPPORT_SET_CONSTRUCTOR && typeof Array.from === 'function'; /** * Create an array assertion to compare if an element exists in that array (in a more efficient way than .indexOf). * * @param {Array} initialData Values to compare. * @returns {Function} */ function createArrayAssertion(initialData) { var dataset = initialData; if (SUPPORT_SET_CONSTRUCTOR) { dataset = new Set(dataset); } return function (value) { var result; if (SUPPORT_SET_CONSTRUCTOR) { result = dataset.has(value); } else { /* eslint-disable no-bitwise */ result = !!~dataset.indexOf(value); } return result; }; } /** * Convert empty-ish values like null and undefined to an empty string. * * @param {*} value Value to check. * @returns {string} */ function toEmptyString(value) { return value === null || value === void 0 ? '' : value; } /** * Unify column values (replace `null` and `undefined` values into empty string, unique values and sort them). * * @param {Array} values An array of values. * @returns {Array} */ function unifyColumnValues(values) { var unifiedValues = values; if (SUPPORT_FAST_DEDUPE) { unifiedValues = Array.from(new Set(unifiedValues)); } else { unifiedValues = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_9__["arrayUnique"])(unifiedValues); } unifiedValues = unifiedValues.sort(function (a, b) { if (typeof a === 'number' && typeof b === 'number') { return a - b; } if (a === b) { return 0; } return a > b ? 1 : -1; }); return unifiedValues; } /** * Intersect 'base' values with 'selected' values and return an array of object. * * @param {Array} base An array of base values. * @param {Array} selected An array of selected values. * @param {string} defaultEmptyValue Default value for empty cells. * @param {Function} [callback] A callback function which is invoked for every item in an array. * @returns {Array} */ function intersectValues(base, selected, defaultEmptyValue, callback) { var result = []; var same = base === selected; var selectedItemsAssertion; if (!same) { selectedItemsAssertion = createArrayAssertion(selected); } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_9__["arrayEach"])(base, function (value) { var checked = false; if (same || selectedItemsAssertion(value)) { checked = true; } var item = { checked: checked, value: value, visualValue: toVisualValue(value, defaultEmptyValue) }; if (callback) { callback(item); } result.push(item); }); return result; } /***/ }), /***/ "./node_modules/handsontable/plugins/formulas/autofill.mjs": /*!*****************************************************************!*\ !*** ./node_modules/handsontable/plugins/formulas/autofill.mjs ***! \*****************************************************************/ /*! exports provided: createAutofillHooks */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAutofillHooks", function() { return createAutofillHooks; }); /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ "./node_modules/core-js/modules/es.array.reduce.js"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /** * Creates hooks for autofill. * * @param {object} pluginInstance The formulas plugin instance. * @returns {object} */ var createAutofillHooks = function createAutofillHooks(pluginInstance) { // Blocks the autofill operation if at least one of the underlying's cell // contents cannot be set, e.g. if there's a matrix underneath. var beforeAutofill = function beforeAutofill(_, __, target) { var width = target.getWidth(); var height = target.getHeight(); var row = target.from.row; var col = target.from.col; if (!pluginInstance.engine.isItPossibleToSetCellContents({ sheet: pluginInstance.sheetId, row: row, col: col }, width, height)) { return false; } }; var afterAutofill = function afterAutofill(fillData, source, target, direction, hasFillDataChanged) { // Skip fill handle process when the fill data was changed by user. if (hasFillDataChanged) { return; } var sourceSize = { width: source.getWidth(), height: source.getHeight() }; var targetSize = { width: target.getWidth(), height: target.getHeight() }; var operations = []; switch (direction) { case 'right': { var pasteRow = source.from.row; for (var pasteCol = target.from.col; pasteCol <= target.to.col; pasteCol += sourceSize.width) { var remaining = target.to.col - pasteCol + 1; var width = Math.min(sourceSize.width, remaining); operations.push({ copy: { row: source.from.row, col: source.from.col, width: width, height: sourceSize.height }, paste: { row: pasteRow, col: pasteCol } }); } break; } case 'down': { var _pasteCol = source.from.col; for (var _pasteRow = target.from.row; _pasteRow <= target.to.row; _pasteRow += sourceSize.height) { var _remaining = target.to.row - _pasteRow + 1; var height = Math.min(sourceSize.height, _remaining); operations.push({ copy: { row: source.from.row, col: source.from.col, width: sourceSize.width, height: height }, paste: { row: _pasteRow, col: _pasteCol } }); } break; } case 'left': { var _pasteRow2 = source.from.row; for (var _pasteCol2 = target.from.col; _pasteCol2 <= target.to.col; _pasteCol2++) { var offset = targetSize.width % sourceSize.width; var copyCol = (sourceSize.width - offset + (_pasteCol2 - target.from.col)) % sourceSize.width + source.from.col; operations.push({ copy: { row: source.from.row, col: copyCol, width: 1, height: sourceSize.height }, paste: { row: _pasteRow2, col: _pasteCol2 } }); } break; } case 'up': { var _pasteCol3 = source.from.col; for (var _pasteRow3 = target.from.row; _pasteRow3 <= target.to.row; _pasteRow3++) { var _offset = targetSize.height % sourceSize.height; var copyRow = (sourceSize.height - _offset + (_pasteRow3 - target.from.row)) % sourceSize.height + source.from.row; operations.push({ copy: { row: copyRow, col: source.from.col, width: sourceSize.width, height: 1 }, paste: { row: _pasteRow3, col: _pasteCol3 } }); } break; } default: { throw new Error('Unexpected direction parameter'); } } var sheet = pluginInstance.sheetId; operations.reduce(function (previousCopy, operation) { if (!Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["isObjectEqual"])(previousCopy, operation.copy)) { pluginInstance.engine.copy({ sheet: sheet, row: operation.copy.row, col: operation.copy.col }, operation.copy.width, operation.copy.height); } pluginInstance.engine.paste({ sheet: sheet, row: operation.paste.row, col: operation.paste.col }); return operation.copy; }, {}); }; return { beforeAutofill: beforeAutofill, afterAutofill: afterAutofill }; }; /***/ }), /***/ "./node_modules/handsontable/plugins/formulas/engine/register.mjs": /*!************************************************************************!*\ !*** ./node_modules/handsontable/plugins/formulas/engine/register.mjs ***! \************************************************************************/ /*! exports provided: setupEngine, registerEngine, getRegisteredHotInstances, unregisterEngine, registerCustomFunctions, registerLanguage, registerNamedExpressions, setupSheet */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setupEngine", function() { return setupEngine; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerEngine", function() { return registerEngine; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRegisteredHotInstances", function() { return getRegisteredHotInstances; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unregisterEngine", function() { return unregisterEngine; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerCustomFunctions", function() { return registerCustomFunctions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerLanguage", function() { return registerLanguage; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerNamedExpressions", function() { return registerNamedExpressions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setupSheet", function() { return setupSheet; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _utils_staticRegister_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../utils/staticRegister.mjs */ "./node_modules/handsontable/utils/staticRegister.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _helpers_console_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../helpers/console.mjs */ "./node_modules/handsontable/helpers/console.mjs"); /* harmony import */ var _formulas_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../formulas.mjs */ "./node_modules/handsontable/plugins/formulas/formulas.mjs"); /* harmony import */ var _settings_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./settings.mjs */ "./node_modules/handsontable/plugins/formulas/engine/settings.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /** * Prepares and returns the collection for the engine relationship with the HoT instances. * * @returns {Map} */ function getEngineRelationshipRegistry() { var registryKey = 'engine_relationship'; var pluginStaticRegistry = Object(_utils_staticRegister_mjs__WEBPACK_IMPORTED_MODULE_16__["default"])(_formulas_mjs__WEBPACK_IMPORTED_MODULE_19__["PLUGIN_KEY"]); if (!pluginStaticRegistry.hasItem(registryKey)) { pluginStaticRegistry.register(registryKey, new Map()); } return pluginStaticRegistry.getItem(registryKey); } /** * Prepares and returns the collection for the engine shared usage. * * @returns {Map} */ function getSharedEngineUsageRegistry() { var registryKey = 'shared_engine_usage'; var pluginStaticRegistry = Object(_utils_staticRegister_mjs__WEBPACK_IMPORTED_MODULE_16__["default"])(_formulas_mjs__WEBPACK_IMPORTED_MODULE_19__["PLUGIN_KEY"]); if (!pluginStaticRegistry.hasItem(registryKey)) { pluginStaticRegistry.register(registryKey, new Map()); } return pluginStaticRegistry.getItem(registryKey); } /** * Setups the engine instance. It either creates a new (possibly shared) engine instance, or attaches * the plugin to an already-existing instance. * * @param {Handsontable} hotInstance Handsontable instance. * @returns {null|object} Returns the engine instance if everything worked right and `null` otherwise. */ function setupEngine(hotInstance) { var hotSettings = hotInstance.getSettings(); var pluginSettings = hotSettings[_formulas_mjs__WEBPACK_IMPORTED_MODULE_19__["PLUGIN_KEY"]]; var engineConfigItem = pluginSettings === null || pluginSettings === void 0 ? void 0 : pluginSettings.engine; if (pluginSettings === true) { return null; } if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_17__["isUndefined"])(engineConfigItem)) { return null; } // `engine.hyperformula` or `engine` is the engine class if (typeof engineConfigItem.hyperformula === 'function' || typeof engineConfigItem === 'function') { var _engineConfigItem$hyp; return registerEngine((_engineConfigItem$hyp = engineConfigItem.hyperformula) !== null && _engineConfigItem$hyp !== void 0 ? _engineConfigItem$hyp : engineConfigItem, hotSettings, hotInstance); // `engine` is the engine instance } else if (_typeof(engineConfigItem) === 'object' && Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_17__["isUndefined"])(engineConfigItem.hyperformula)) { var engineRelationship = getEngineRelationshipRegistry(); var sharedEngineUsage = getSharedEngineUsageRegistry().get(engineConfigItem); if (!engineRelationship.has(engineConfigItem)) { engineRelationship.set(engineConfigItem, []); } engineRelationship.get(engineConfigItem).push(hotInstance); if (sharedEngineUsage) { sharedEngineUsage.push(hotInstance.guid); } if (!engineConfigItem.getConfig().licenseKey) { engineConfigItem.updateConfig({ licenseKey: _settings_mjs__WEBPACK_IMPORTED_MODULE_20__["DEFAULT_LICENSE_KEY"] }); } return engineConfigItem; } return null; } /** * Registers the engine in the global register and attaches the needed event listeners. * * @param {Function} engineClass The engine class. * @param {object} hotSettings The Handsontable settings. * @param {Handsontable} hotInstance Handsontable instance. * @returns {object} Returns the engine instance. */ function registerEngine(engineClass, hotSettings, hotInstance) { var pluginSettings = hotSettings[_formulas_mjs__WEBPACK_IMPORTED_MODULE_19__["PLUGIN_KEY"]]; var engineSettings = Object(_settings_mjs__WEBPACK_IMPORTED_MODULE_20__["getEngineSettingsWithDefaultsAndOverrides"])(hotSettings); var engineRegistry = getEngineRelationshipRegistry(); var sharedEngineRegistry = getSharedEngineUsageRegistry(); registerCustomFunctions(engineClass, pluginSettings.functions); registerLanguage(engineClass, pluginSettings.language); // Create instance var engineInstance = engineClass.buildEmpty(engineSettings); // Add it to global registry engineRegistry.set(engineInstance, [hotInstance]); sharedEngineRegistry.set(engineInstance, [hotInstance.guid]); registerNamedExpressions(engineInstance, pluginSettings.namedExpressions); // Add hooks needed for cross-referencing sheets engineInstance.on('sheetAdded', function () { engineInstance.rebuildAndRecalculate(); }); engineInstance.on('sheetRemoved', function () { engineInstance.rebuildAndRecalculate(); }); return engineInstance; } /** * Returns the list of the Handsontable instances linked to the specific engine instance. * * @param {object} engine The engine instance. * @returns {Map} Returns Map with Handsontable instances. */ function getRegisteredHotInstances(engine) { var _engineRegistry$get; var engineRegistry = getEngineRelationshipRegistry(); var hotInstances = engineRegistry.size === 0 ? [] : Array.from((_engineRegistry$get = engineRegistry.get(engine)) !== null && _engineRegistry$get !== void 0 ? _engineRegistry$get : []); return new Map(hotInstances.map(function (hot) { return [hot.getPlugin('formulas').sheetId, hot]; })); } /** * Removes the HOT instance from the global register's engine usage array, and if there are no HOT instances left, * unregisters the engine itself. * * @param {object} engine The engine instance. * @param {string} hotInstance The Handsontable instance. */ function unregisterEngine(engine, hotInstance) { if (engine) { var engineRegistry = getEngineRelationshipRegistry(); var engineHotRelationship = engineRegistry.get(engine); var sharedEngineRegistry = getSharedEngineUsageRegistry(); var sharedEngineUsage = sharedEngineRegistry.get(engine); if (engineHotRelationship && engineHotRelationship.includes(hotInstance)) { engineHotRelationship.splice(engineHotRelationship.indexOf(hotInstance), 1); if (engineHotRelationship.length === 0) { engineRegistry.delete(engine); } } if (sharedEngineUsage && sharedEngineUsage.includes(hotInstance.guid)) { sharedEngineUsage.splice(sharedEngineUsage.indexOf(hotInstance.guid), 1); if (sharedEngineUsage.length === 0) { sharedEngineRegistry.delete(engine); engine.destroy(); } } } } /** * Registers the custom functions for the engine. * * @param {Function} engineClass The engine class. * @param {Array} customFunctions The custom functions array. */ function registerCustomFunctions(engineClass, customFunctions) { if (customFunctions) { customFunctions.forEach(function (func) { var name = func.name, plugin = func.plugin, translations = func.translations; try { engineClass.registerFunction(name, plugin, translations); } catch (e) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_18__["warn"])(e.message); } }); } } /** * Registers the provided language for the engine. * * @param {Function} engineClass The engine class. * @param {object} languageSetting The engine's language object. */ function registerLanguage(engineClass, languageSetting) { if (languageSetting) { var langCode = languageSetting.langCode; try { engineClass.registerLanguage(langCode, languageSetting); } catch (e) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_18__["warn"])(e.message); } } } /** * Registers the provided named expressions in the engine instance. * * @param {object} engineInstance The engine instance. * @param {Array} namedExpressions Array of the named expressions to be registered. */ function registerNamedExpressions(engineInstance, namedExpressions) { if (namedExpressions) { engineInstance.suspendEvaluation(); namedExpressions.forEach(function (namedExp) { var name = namedExp.name, expression = namedExp.expression, scope = namedExp.scope, options = namedExp.options; try { engineInstance.addNamedExpression(name, expression, scope, options); } catch (e) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_18__["warn"])(e.message); } }); engineInstance.resumeEvaluation(); } } /** * Sets up a new sheet. * * @param {object} engineInstance The engine instance. * @param {string} sheetName The new sheet name. * @returns {*} */ function setupSheet(engineInstance, sheetName) { if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_17__["isUndefined"])(sheetName) || !engineInstance.doesSheetExist(sheetName)) { sheetName = engineInstance.addSheet(sheetName); } return sheetName; } /***/ }), /***/ "./node_modules/handsontable/plugins/formulas/engine/settings.mjs": /*!************************************************************************!*\ !*** ./node_modules/handsontable/plugins/formulas/engine/settings.mjs ***! \************************************************************************/ /*! exports provided: DEFAULT_LICENSE_KEY, getEngineSettingsOverrides, getEngineSettingsWithDefaultsAndOverrides, getEngineSettingsWithOverrides */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_LICENSE_KEY", function() { return DEFAULT_LICENSE_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEngineSettingsOverrides", function() { return getEngineSettingsOverrides; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEngineSettingsWithDefaultsAndOverrides", function() { return getEngineSettingsWithDefaultsAndOverrides; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEngineSettingsWithOverrides", function() { return getEngineSettingsWithOverrides; }); /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ "./node_modules/core-js/modules/es.array.reduce.js"); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var _formulas_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../formulas.mjs */ "./node_modules/handsontable/plugins/formulas/formulas.mjs"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 DEFAULT_LICENSE_KEY = 'internal-use-in-handsontable'; var DEFAULT_SETTINGS = { licenseKey: DEFAULT_LICENSE_KEY, binarySearchThreshold: 20, matrixDetection: false, matrixDetectionThreshold: 100, useColumnIndex: false, useStats: false, evaluateNullToZero: true, precisionEpsilon: 1e-13, precisionRounding: 14, smartRounding: true, leapYear1900: true, nullDate: { year: 1899, month: 12, day: 31 }, nullYear: 30, dateFormats: ['DD/MM/YYYY', 'DD/MM/YY'], timeFormats: ['hh:mm', 'hh:mm:ss.sss'], matchWholeCell: true, useRegularExpressions: false, useWildcards: true, functionArgSeparator: ',', thousandSeparator: '', decimalSeparator: '.', language: 'enGB' }; /** * Gets a set of engine settings to be applied on top of the provided settings, based on user's Handsontable settings. * * @param {object} hotSettings Handsontable settings object. * @returns {object} Object containing the overriding options. */ function getEngineSettingsOverrides(hotSettings) { var _hotSettings$PLUGIN_K, _hotSettings$PLUGIN_K2; return { maxColumns: hotSettings.maxColumns, maxRows: hotSettings.maxRows, language: (_hotSettings$PLUGIN_K = hotSettings[_formulas_mjs__WEBPACK_IMPORTED_MODULE_7__["PLUGIN_KEY"]]) === null || _hotSettings$PLUGIN_K === void 0 ? void 0 : (_hotSettings$PLUGIN_K2 = _hotSettings$PLUGIN_K.language) === null || _hotSettings$PLUGIN_K2 === void 0 ? void 0 : _hotSettings$PLUGIN_K2.langCode }; } /** * Drop `hyperformula` key from object if it exists. * * @param {object} pluginSettings Formulas plugin settings. * @returns {object} */ function cleanEngineSettings(pluginSettings) { return Object.keys(pluginSettings).reduce(function (obj, key) { if (key !== 'hyperformula') { obj[key] = pluginSettings[key]; } return obj; }, {}); } /** * Takes the default, user and overriding settings and merges them into a single object to be passed to the engine. * * The final object gets its parameters in the following order, * with properties attached to objects listed in the lower levels of the list overriding the * ones above them: * * 1. Default settings * 2. User settings * 3. Overrides. * * Meant to be used during *initialization* of the engine. * * @param {object} hotSettings The Handsontable settings. * @returns {object} The final engine settings. */ function getEngineSettingsWithDefaultsAndOverrides(hotSettings) { var _pluginSettings$engin; var pluginSettings = hotSettings[_formulas_mjs__WEBPACK_IMPORTED_MODULE_7__["PLUGIN_KEY"]]; var userSettings = cleanEngineSettings(pluginSettings !== null && pluginSettings !== void 0 && (_pluginSettings$engin = pluginSettings.engine) !== null && _pluginSettings$engin !== void 0 && _pluginSettings$engin.hyperformula ? pluginSettings.engine : {}); var overrides = getEngineSettingsOverrides(hotSettings); return _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_SETTINGS), userSettings), overrides); } /** * Get engine settings from a Handsontable settings object with overrides. * * @param {object} hotSettings Handsontable settings object. * @returns {object} */ function getEngineSettingsWithOverrides(hotSettings) { var _pluginSettings$engin2; var pluginSettings = hotSettings[_formulas_mjs__WEBPACK_IMPORTED_MODULE_7__["PLUGIN_KEY"]]; var userSettings = cleanEngineSettings(pluginSettings !== null && pluginSettings !== void 0 && (_pluginSettings$engin2 = pluginSettings.engine) !== null && _pluginSettings$engin2 !== void 0 && _pluginSettings$engin2.hyperformula ? pluginSettings.engine : {}); var overrides = getEngineSettingsOverrides(hotSettings); return _objectSpread(_objectSpread({}, userSettings), overrides); } /***/ }), /***/ "./node_modules/handsontable/plugins/formulas/formulas.mjs": /*!*****************************************************************!*\ !*** ./node_modules/handsontable/plugins/formulas/formulas.mjs ***! \*****************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, Formulas */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Formulas", function() { return Formulas; }); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_array_reverse_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.reverse.js */ "./node_modules/core-js/modules/es.array.reverse.js"); /* harmony import */ var core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.sort.js */ "./node_modules/core-js/modules/es.array.sort.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _autofill_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./autofill.mjs */ "./node_modules/handsontable/plugins/formulas/autofill.mjs"); /* harmony import */ var _utils_staticRegister_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../utils/staticRegister.mjs */ "./node_modules/handsontable/utils/staticRegister.mjs"); /* harmony import */ var _helpers_console_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../helpers/console.mjs */ "./node_modules/handsontable/helpers/console.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _engine_register_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./engine/register.mjs */ "./node_modules/handsontable/plugins/formulas/engine/register.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/handsontable/plugins/formulas/utils.mjs"); /* harmony import */ var _engine_settings_mjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./engine/settings.mjs */ "./node_modules/handsontable/plugins/formulas/engine/settings.mjs"); /* harmony import */ var _helpers_data_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../helpers/data.mjs */ "./node_modules/handsontable/helpers/data.mjs"); /* harmony import */ var _helpers_string_mjs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../helpers/string.mjs */ "./node_modules/handsontable/helpers/string.mjs"); /* harmony import */ var _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../../pluginHooks.mjs */ "./node_modules/handsontable/pluginHooks.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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 _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } var PLUGIN_KEY = 'formulas'; var PLUGIN_PRIORITY = 260; _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_34__["default"].getSingleton().register('afterNamedExpressionAdded'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_34__["default"].getSingleton().register('afterNamedExpressionRemoved'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_34__["default"].getSingleton().register('afterSheetAdded'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_34__["default"].getSingleton().register('afterSheetRemoved'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_34__["default"].getSingleton().register('afterSheetRenamed'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_34__["default"].getSingleton().register('afterFormulasValuesUpdate'); /** * This plugin allows you to perform Excel-like calculations in your business applications. It does it by an * integration with our other product, [HyperFormula](https://github.com/handsontable/hyperformula/), which is a * powerful calculation engine with an extensive number of features. * * @plugin Formulas * @class Formulas */ var _internalOperationPending = /*#__PURE__*/new WeakMap(); var _hotWasInitializedWithEmptyData = /*#__PURE__*/new WeakMap(); var _engineListeners = /*#__PURE__*/new WeakMap(); var Formulas = /*#__PURE__*/function (_BasePlugin) { _inherits(Formulas, _BasePlugin); var _super = _createSuper(Formulas); function Formulas() { var _this; _classCallCheck(this, Formulas); for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) { _args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(_args)); _internalOperationPending.set(_assertThisInitialized(_this), { writable: true, value: false }); _hotWasInitializedWithEmptyData.set(_assertThisInitialized(_this), { writable: true, value: false }); _engineListeners.set(_assertThisInitialized(_this), { writable: true, value: [['valuesUpdated', function () { var _this2; return (_this2 = _this).onEngineValuesUpdated.apply(_this2, arguments); }], ['namedExpressionAdded', function () { var _this3; return (_this3 = _this).onEngineNamedExpressionsAdded.apply(_this3, arguments); }], ['namedExpressionRemoved', function () { var _this4; return (_this4 = _this).onEngineNamedExpressionsRemoved.apply(_this4, arguments); }], ['sheetAdded', function () { var _this5; return (_this5 = _this).onEngineSheetAdded.apply(_this5, arguments); }], ['sheetRenamed', function () { var _this6; return (_this6 = _this).onEngineSheetRenamed.apply(_this6, arguments); }], ['sheetRemoved', function () { var _this7; return (_this7 = _this).onEngineSheetRemoved.apply(_this7, arguments); }]] }); _defineProperty(_assertThisInitialized(_this), "staticRegister", Object(_utils_staticRegister_mjs__WEBPACK_IMPORTED_MODULE_26__["default"])('formulas')); _defineProperty(_assertThisInitialized(_this), "engine", null); _defineProperty(_assertThisInitialized(_this), "sheetName", null); return _this; } _createClass(Formulas, [{ key: "sheetId", get: /** * HyperFormula's sheet id. * * @type {number|null} */ function get() { return this.sheetName === null ? null : this.engine.getSheetId(this.sheetName); } /** * 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 Formulas#enablePlugin} method is called. * * @returns {boolean} */ }, { key: "isEnabled", value: function isEnabled() { /* eslint-disable no-unneeded-ternary */ return this.hot.getSettings()[PLUGIN_KEY] ? true : false; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _setupEngine, _this8 = this; if (this.enabled) { return; } this.engine = (_setupEngine = Object(_engine_register_mjs__WEBPACK_IMPORTED_MODULE_29__["setupEngine"])(this.hot)) !== null && _setupEngine !== void 0 ? _setupEngine : this.engine; if (!this.engine) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_27__["warn"])('Missing the required `engine` key in the Formulas settings. Please fill it with either an' + ' engine class or an engine instance.'); return; } // Useful for disabling -> enabling the plugin using `updateSettings` or the API. if (this.sheetName !== null && !this.engine.doesSheetExist(this.sheetName)) { this.sheetName = this.addSheet(this.sheetName, this.hot.getSourceDataArray()); } this.addHook('beforeLoadData', function () { return _this8.onBeforeLoadData.apply(_this8, arguments); }); this.addHook('afterLoadData', function () { return _this8.onAfterLoadData.apply(_this8, arguments); }); this.addHook('modifyData', function () { return _this8.onModifyData.apply(_this8, arguments); }); this.addHook('modifySourceData', function () { return _this8.onModifySourceData.apply(_this8, arguments); }); this.addHook('beforeValidate', function () { return _this8.onBeforeValidate.apply(_this8, arguments); }); this.addHook('afterSetSourceDataAtCell', function () { return _this8.onAfterSetSourceDataAtCell.apply(_this8, arguments); }); this.addHook('afterSetDataAtCell', function () { return _this8.onAfterSetDataAtCell.apply(_this8, arguments); }); this.addHook('afterSetDataAtRowProp', function () { return _this8.onAfterSetDataAtCell.apply(_this8, arguments); }); this.addHook('beforeCreateRow', function () { return _this8.onBeforeCreateRow.apply(_this8, arguments); }); this.addHook('beforeCreateCol', function () { return _this8.onBeforeCreateCol.apply(_this8, arguments); }); this.addHook('afterCreateRow', function () { return _this8.onAfterCreateRow.apply(_this8, arguments); }); this.addHook('afterCreateCol', function () { return _this8.onAfterCreateCol.apply(_this8, arguments); }); this.addHook('beforeRemoveRow', function () { return _this8.onBeforeRemoveRow.apply(_this8, arguments); }); this.addHook('beforeRemoveCol', function () { return _this8.onBeforeRemoveCol.apply(_this8, arguments); }); this.addHook('afterRemoveRow', function () { return _this8.onAfterRemoveRow.apply(_this8, arguments); }); this.addHook('afterRemoveCol', function () { return _this8.onAfterRemoveCol.apply(_this8, arguments); }); var autofillHooks = Object(_autofill_mjs__WEBPACK_IMPORTED_MODULE_25__["createAutofillHooks"])(this); this.addHook('beforeAutofill', autofillHooks.beforeAutofill); this.addHook('afterAutofill', autofillHooks.afterAutofill); _classPrivateFieldGet(this, _engineListeners).forEach(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), eventName = _ref2[0], listener = _ref2[1]; return _this8.engine.on(eventName, listener); }); _get(_getPrototypeOf(Formulas.prototype), "enablePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { var _this9 = this; _classPrivateFieldGet(this, _engineListeners).forEach(function (_ref3) { var _ref4 = _slicedToArray(_ref3, 2), eventName = _ref4[0], listener = _ref4[1]; return _this9.engine.off(eventName, listener); }); Object(_engine_register_mjs__WEBPACK_IMPORTED_MODULE_29__["unregisterEngine"])(this.engine, this.hot); _get(_getPrototypeOf(Formulas.prototype), "disablePlugin", this).call(this); } /** * Triggered on `updateSettings`. * * @private * @param {object} newSettings New set of settings passed to the `updateSettings` method. */ }, { key: "updatePlugin", value: function updatePlugin(newSettings) { this.engine.updateConfig(Object(_engine_settings_mjs__WEBPACK_IMPORTED_MODULE_31__["getEngineSettingsWithOverrides"])(this.hot.getSettings())); var pluginSettings = this.hot.getSettings()[PLUGIN_KEY]; if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_28__["isDefined"])(pluginSettings) && Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_28__["isDefined"])(pluginSettings.sheetName) && pluginSettings.sheetName !== this.sheetName) { this.switchSheet(pluginSettings.sheetName); } // If no data was passed to the `updateSettings` method and no sheet is connected to the instance -> create a // new sheet using the currently used data. Otherwise, it will be handled by the `afterLoadData` call. if (!newSettings.data && this.sheetName === null) { var sheetName = this.hot.getSettings()[PLUGIN_KEY].sheetName; if (sheetName && this.engine.doesSheetExist(sheetName)) { this.switchSheet(this.sheetName); } else { this.sheetName = this.addSheet(sheetName !== null && sheetName !== void 0 ? sheetName : void 0, this.hot.getSourceDataArray()); } } _get(_getPrototypeOf(Formulas.prototype), "updatePlugin", this).call(this, newSettings); } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { var _this10 = this; _classPrivateFieldGet(this, _engineListeners).forEach(function (_ref5) { var _this10$engine; var _ref6 = _slicedToArray(_ref5, 2), eventName = _ref6[0], listener = _ref6[1]; return (_this10$engine = _this10.engine) === null || _this10$engine === void 0 ? void 0 : _this10$engine.off(eventName, listener); }); _classPrivateFieldSet(this, _engineListeners, null); Object(_engine_register_mjs__WEBPACK_IMPORTED_MODULE_29__["unregisterEngine"])(this.engine, this.hot); _get(_getPrototypeOf(Formulas.prototype), "destroy", this).call(this); } /** * Helper function for `toPhysicalRowPosition` and `toPhysicalColumnPosition`. * * @private * @param {number} visualIndex Visual entry index. * @param {number} physicalIndex Physical entry index. * @param {number} entriesCount Visual entries count. * @param {number} sourceEntriesCount Source entries count. * @param {boolean} contained `true` if it should return only indexes within boundaries of the table (basically * `toPhysical` alias. * @returns {*} */ }, { key: "getPhysicalIndexPosition", value: function getPhysicalIndexPosition(visualIndex, physicalIndex, entriesCount, sourceEntriesCount, contained) { if (!contained) { if (visualIndex >= entriesCount) { return sourceEntriesCount + (visualIndex - entriesCount); } } return physicalIndex; } /** * Returns the physical row index. The difference between this and Core's `toPhysical` is that it doesn't return * `null` on rows with indexes higher than the number of rows. * * @private * @param {number} row Visual row index. * @param {boolean} [contained] `true` if it should return only indexes within boundaries of the table (basically * `toPhysical` alias. * @returns {number} The physical row index. */ }, { key: "toPhysicalRowPosition", value: function toPhysicalRowPosition(row) { var contained = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; return this.getPhysicalIndexPosition(row, this.hot.toPhysicalRow(row), this.hot.countRows(), this.hot.countSourceRows(), contained); } /** * Returns the physical column index. The difference between this and Core's `toPhysical` is that it doesn't return * `null` on columns with indexes higher than the number of columns. * * @private * @param {number} column Visual column index. * @param {boolean} [contained] `true` if it should return only indexes within boundaries of the table (basically * `toPhysical` alias. * @returns {number} The physical column index. */ }, { key: "toPhysicalColumnPosition", value: function toPhysicalColumnPosition(column) { var contained = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; return this.getPhysicalIndexPosition(column, this.hot.toPhysicalColumn(column), this.hot.countCols(), this.hot.countSourceCols(), contained); } /** * Add a sheet to the shared HyperFormula instance. * * @param {string|null} [sheetName] The new sheet name. If not provided (or a null is passed), will be * auto-generated by HyperFormula. * @param {Array} [sheetData] Data passed to the shared HyperFormula instance. Has to be declared as an array of * arrays - array of objects is not supported in this scenario. * @returns {boolean|string} `false` if the data format is unusable or it is impossible to add a new sheet to the * engine, the created sheet name otherwise. */ }, { key: "addSheet", value: function addSheet(sheetName, sheetData) { if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_28__["isDefined"])(sheetData) && !Object(_helpers_data_mjs__WEBPACK_IMPORTED_MODULE_32__["isArrayOfArrays"])(sheetData)) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_27__["warn"])('The provided data should be an array of arrays.'); return false; } if (sheetName !== void 0 && sheetName !== null && this.engine.doesSheetExist(sheetName)) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_27__["warn"])('Sheet with the provided name already exists.'); return false; } try { var actualSheetName = this.engine.addSheet(sheetName !== null && sheetName !== void 0 ? sheetName : void 0); if (sheetData) { this.engine.setSheetContent(actualSheetName, sheetData); } return actualSheetName; } catch (e) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_27__["warn"])(e.message); return false; } } /** * Switch the sheet used as data in the Handsontable instance (it loads the data from the shared HyperFormula * instance). * * @param {string} sheetName Sheet name used in the shared HyperFormula instance. */ }, { key: "switchSheet", value: function switchSheet(sheetName) { if (!this.engine.doesSheetExist(sheetName)) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_27__["error"])("The sheet named `".concat(sheetName, "` does not exist, switch aborted.")); return; } this.sheetName = sheetName; var serialized = this.engine.getSheetSerialized(this.sheetId); if (serialized.length > 0) { this.hot.loadData(serialized, "".concat(Object(_helpers_string_mjs__WEBPACK_IMPORTED_MODULE_33__["toUpperCaseFirst"])(PLUGIN_KEY), ".switchSheet")); } } /** * Get the cell type under specified visual coordinates. * * @param {number} row Visual row index. * @param {number} column Visual column index. * @param {number} [sheet] The target sheet id, defaults to the current sheet. * @returns {string} Possible values: 'FORMULA' | 'VALUE' | 'MATRIX' | 'EMPTY'. */ }, { key: "getCellType", value: function getCellType(row, column) { var sheet = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.sheetId; return this.engine.getCellType({ sheet: sheet, row: this.hot.toPhysicalRow(row), col: this.hot.toPhysicalColumn(column) }); } /** * Returns `true` if under specified visual coordinates is formula. * * @param {number} row Visual row index. * @param {number} column Visual column index. * @param {number} [sheet] The target sheet id, defaults to the current sheet. * @returns {boolean} */ }, { key: "isFormulaCellType", value: function isFormulaCellType(row, column) { var sheet = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.sheetId; var cellType = this.getCellType(row, column, sheet); return cellType === 'FORMULA' || cellType === 'MATRIX'; } /** * Renders dependent sheets (handsontable instances) based on the changes - list of the * recalculated dependent cells. * * @private * @param {object[]} dependentCells The values and location of applied changes within HF engine. * @param {boolean} [renderSelf] `true` if it's supposed to render itself, `false` otherwise. */ }, { key: "renderDependentSheets", value: function renderDependentSheets(dependentCells) { var _this11 = this; var renderSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var affectedSheetIds = new Set(); dependentCells.forEach(function (change) { var _change$address; // For the Named expression the address is empty, hence the `sheetId` is undefined. var sheetId = change === null || change === void 0 ? void 0 : (_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.sheet; if (sheetId !== void 0) { if (!affectedSheetIds.has(sheetId)) { affectedSheetIds.add(sheetId); } } }); Object(_engine_register_mjs__WEBPACK_IMPORTED_MODULE_29__["getRegisteredHotInstances"])(this.engine).forEach(function (relatedHot, sheetId) { if ((renderSelf || sheetId !== _this11.sheetId) && affectedSheetIds.has(sheetId)) { var _relatedHot$view; relatedHot.render(); (_relatedHot$view = relatedHot.view) === null || _relatedHot$view === void 0 ? void 0 : _relatedHot$view.adjustElementsSize(); } }); } /** * Validates dependent cells based on the cells that are modified by the change. * * @private * @param {object[]} dependentCells The values and location of applied changes within HF engine. * @param {object[]} [changedCells] The values and location of applied changes by developer (through API or UI). */ }, { key: "validateDependentCells", value: function validateDependentCells(dependentCells) { var _this12 = this; var changedCells = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var stringifyAddress = function stringifyAddress(change) { var _change$address2; var _ref7 = (_change$address2 = change === null || change === void 0 ? void 0 : change.address) !== null && _change$address2 !== void 0 ? _change$address2 : {}, row = _ref7.row, col = _ref7.col, sheet = _ref7.sheet; return Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_28__["isDefined"])(sheet) ? "".concat(sheet, ":").concat(row, "x").concat(col) : ''; }; var changedCellsSet = new Set(changedCells.map(function (change) { return stringifyAddress(change); })); dependentCells.forEach(function (change) { var _change$address3, _change$address4; var _ref8 = (_change$address3 = change.address) !== null && _change$address3 !== void 0 ? _change$address3 : {}, row = _ref8.row, col = _ref8.col; var visualRow = Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_28__["isDefined"])(row) ? _this12.hot.toVisualRow(row) : null; var visualColumn = Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_28__["isDefined"])(col) ? _this12.hot.toVisualColumn(col) : null; // Don't try to validate cells outside of the visual part of the table. if (visualRow === null || visualColumn === null) { return; } // For the Named expression the address is empty, hence the `sheetId` is undefined. var sheetId = change === null || change === void 0 ? void 0 : (_change$address4 = change.address) === null || _change$address4 === void 0 ? void 0 : _change$address4.sheet; var addressId = stringifyAddress(change); // Validate the cells that depend on the calculated formulas. Skip that cells // where the user directly changes the values - the Core triggers those validators. if (sheetId !== void 0 && !changedCellsSet.has(addressId)) { var hot = Object(_engine_register_mjs__WEBPACK_IMPORTED_MODULE_29__["getRegisteredHotInstances"])(_this12.engine).get(sheetId); // It will just re-render certain cell when necessary. hot.validateCell(hot.getDataAtCell(visualRow, visualColumn), hot.getCellMeta(visualRow, visualColumn), function () {}); } }); } /** * Sync a change from the change-related hooks with the engine. * * @private * @param {number} row Visual row index. * @param {number} column Visual column index. * @param {Handsontable.CellValue} newValue New value. * @returns {Array} Array of changes exported from the engine. */ }, { key: "syncChangeWithEngine", value: function syncChangeWithEngine(row, column, newValue) { var address = { row: this.toPhysicalRowPosition(row), col: this.toPhysicalColumnPosition(column), sheet: this.sheetId }; if (!this.engine.isItPossibleToSetCellContents(address)) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_27__["warn"])("Not possible to set cell data at ".concat(JSON.stringify(address))); return; } return this.engine.setCellContents(address, newValue); } /** * The hook allows to translate the formula value to calculated value before it goes to the * validator function. * * @private * @param {*} value The cell value to validate. * @param {number} visualRow The visual row index. * @param {number|string} prop The visual column index or property name of the column. * @returns {*} Returns value to validate. */ }, { key: "onBeforeValidate", value: function onBeforeValidate(value, visualRow, prop) { var visualColumn = this.hot.propToCol(prop); if (this.isFormulaCellType(visualRow, visualColumn)) { var address = { row: this.hot.toPhysicalRow(visualRow), col: this.hot.toPhysicalColumn(visualColumn), sheet: this.sheetId }; var cellValue = this.engine.getCellValue(address); // If `cellValue` is an object it is expected to be an error return _typeof(cellValue) === 'object' && cellValue !== null ? cellValue.value : cellValue; } return value; } /** * `beforeLoadData` hook callback. * * @param {Array} sourceData Array of arrays or array of objects containing data. * @param {boolean} initialLoad Flag that determines whether the data has been loaded during the initialization. * @param {string} [source] Source of the call. * @private */ }, { key: "onBeforeLoadData", value: function onBeforeLoadData(sourceData, initialLoad) { var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; if (source.includes(Object(_helpers_string_mjs__WEBPACK_IMPORTED_MODULE_33__["toUpperCaseFirst"])(PLUGIN_KEY))) { return; } // This flag needs to be defined, because not passing data to HOT results in HOT auto-generating a `null`-filled // initial dataset. _classPrivateFieldSet(this, _hotWasInitializedWithEmptyData, Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_28__["isUndefined"])(this.hot.getSettings().data)); } /** * `afterLoadData` hook callback. * * @param {Array} sourceData Array of arrays or array of objects containing data. * @param {boolean} initialLoad Flag that determines whether the data has been loaded during the initialization. * @param {string} [source] Source of the call. * @private */ }, { key: "onAfterLoadData", value: function onAfterLoadData(sourceData, initialLoad) { var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; if (source.includes(Object(_helpers_string_mjs__WEBPACK_IMPORTED_MODULE_33__["toUpperCaseFirst"])(PLUGIN_KEY))) { return; } this.sheetName = Object(_engine_register_mjs__WEBPACK_IMPORTED_MODULE_29__["setupSheet"])(this.engine, this.hot.getSettings()[PLUGIN_KEY].sheetName); if (!_classPrivateFieldGet(this, _hotWasInitializedWithEmptyData)) { var sourceDataArray = this.hot.getSourceDataArray(); if (this.engine.isItPossibleToReplaceSheetContent(this.sheetName, sourceDataArray)) { _classPrivateFieldSet(this, _internalOperationPending, true); var dependentCells = this.engine.setSheetContent(this.sheetName, this.hot.getSourceDataArray()); this.renderDependentSheets(dependentCells); _classPrivateFieldSet(this, _internalOperationPending, false); } } else { this.switchSheet(this.sheetName); } } /** * `modifyData` hook callback. * * @private * @param {number} row Physical row height. * @param {number} column Physical column index. * @param {object} valueHolder Object which contains original value which can be modified by overwriting `.value` * property. * @param {string} ioMode String which indicates for what operation hook is fired (`get` or `set`). */ }, { key: "onModifyData", value: function onModifyData(row, column, valueHolder, ioMode) { if (ioMode !== 'get' || _classPrivateFieldGet(this, _internalOperationPending) || this.sheetName === null || !this.engine.doesSheetExist(this.sheetName)) { return; } // `column` is here as visual index because of inconsistencies related to hook execution in `src/dataMap`. var isFormulaCellType = this.isFormulaCellType(this.hot.toVisualRow(row), column); if (!isFormulaCellType) { if (Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_30__["isEscapedFormulaExpression"])(valueHolder.value)) { valueHolder.value = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_30__["unescapeFormulaExpression"])(valueHolder.value); } return; } // `toPhysicalColumn` is here because of inconsistencies related to hook execution in `src/dataMap`. var address = { row: row, col: this.toPhysicalColumnPosition(column), sheet: this.sheetId }; var cellValue = this.engine.getCellValue(address); // If `cellValue` is an object it is expected to be an error var value = _typeof(cellValue) === 'object' && cellValue !== null ? cellValue.value : cellValue; valueHolder.value = value; } /** * `modifySourceData` hook callback. * * @private * @param {number} row Physical row index. * @param {number|string} columnOrProp Physical column index or prop. * @param {object} valueHolder Object which contains original value which can be modified by overwriting `.value` * property. * @param {string} ioMode String which indicates for what operation hook is fired (`get` or `set`). */ }, { key: "onModifySourceData", value: function onModifySourceData(row, columnOrProp, valueHolder, ioMode) { if (ioMode !== 'get' || _classPrivateFieldGet(this, _internalOperationPending) || this.sheetName === null || !this.engine.doesSheetExist(this.sheetName)) { return; } var visualColumn = this.hot.propToCol(columnOrProp); // `column` is here as visual index because of inconsistencies related to hook execution in `src/dataMap`. var isFormulaCellType = this.isFormulaCellType(this.hot.toVisualRow(row), visualColumn); if (!isFormulaCellType) { return; } var dimensions = this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName)); // Don't actually change the source data if HyperFormula is not // initialized yet. This is done to allow the `afterLoadData` hook to // load the existing source data with `Handsontable#getSourceDataArray` // properly. if (dimensions.width === 0 && dimensions.height === 0) { return; } var address = { row: row, // Workaround for inconsistencies in `src/dataSource.js` col: this.toPhysicalColumnPosition(visualColumn), sheet: this.sheetId }; valueHolder.value = this.engine.getCellSerialized(address); } /** * `onAfterSetDataAtCell` hook callback. * * @private * @param {Array[]} changes An array of changes in format [[row, prop, oldValue, value], ...]. */ }, { key: "onAfterSetDataAtCell", value: function onAfterSetDataAtCell(changes) { var _this13 = this; var dependentCells = []; var outOfBoundsChanges = []; var changedCells = []; changes.forEach(function (_ref9) { var _ref10 = _slicedToArray(_ref9, 4), row = _ref10[0], prop = _ref10[1], newValue = _ref10[3]; var column = _this13.hot.propToCol(prop); var physicalRow = _this13.hot.toPhysicalRow(row); var physicalColumn = _this13.hot.toPhysicalColumn(column); var address = { row: physicalRow, col: physicalColumn, sheet: _this13.sheetId }; if (physicalRow !== null && physicalColumn !== null) { dependentCells.push.apply(dependentCells, _toConsumableArray(_this13.syncChangeWithEngine(row, column, newValue))); } else { outOfBoundsChanges.push([row, column, newValue]); } changedCells.push({ address: address }); }); if (outOfBoundsChanges.length) { // Workaround for rows/columns being created two times (by HOT and the engine). // (unfortunately, this requires an extra re-render) this.hot.addHookOnce('afterChange', function () { var outOfBoundsDependentCells = []; outOfBoundsChanges.forEach(function (_ref11) { var _ref12 = _slicedToArray(_ref11, 3), row = _ref12[0], column = _ref12[1], newValue = _ref12[2]; outOfBoundsDependentCells.push.apply(outOfBoundsDependentCells, _toConsumableArray(_this13.syncChangeWithEngine(row, column, newValue))); }); _this13.renderDependentSheets(outOfBoundsDependentCells, true); }); } this.renderDependentSheets(dependentCells); this.validateDependentCells(dependentCells, changedCells); } /** * `onAfterSetSourceDataAtCell` hook callback. * * @private * @param {Array[]} changes An array of changes in format [[row, column, oldValue, value], ...]. */ }, { key: "onAfterSetSourceDataAtCell", value: function onAfterSetSourceDataAtCell(changes) { var _this14 = this; var dependentCells = []; var changedCells = []; changes.forEach(function (_ref13) { var _ref14 = _slicedToArray(_ref13, 4), row = _ref14[0], column = _ref14[1], newValue = _ref14[3]; var address = { row: row, col: _this14.toPhysicalColumnPosition(column), sheet: _this14.sheetId }; if (!_this14.engine.isItPossibleToSetCellContents(address)) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_27__["warn"])("Not possible to set source cell data at ".concat(JSON.stringify(address))); return; } changedCells.push({ address: address }); dependentCells.push.apply(dependentCells, _toConsumableArray(_this14.engine.setCellContents(address, newValue))); }); this.renderDependentSheets(dependentCells); this.validateDependentCells(dependentCells, changedCells); } /** * `beforeCreateRow` hook callback. * * @private * @param {number} row Represents the visual index of first newly created row in the data source array. * @param {number} amount Number of newly created rows in the data source array. * @returns {*|boolean} If false is returned the action is canceled. */ }, { key: "onBeforeCreateRow", value: function onBeforeCreateRow(row, amount) { if (!this.engine.isItPossibleToAddRows(this.sheetId, [this.toPhysicalRowPosition(row), amount])) { return false; } } /** * `beforeCreateCol` hook callback. * * @private * @param {number} col Represents the visual index of first newly created column in the data source. * @param {number} amount Number of newly created columns in the data source. * @returns {*|boolean} If false is returned the action is canceled. */ }, { key: "onBeforeCreateCol", value: function onBeforeCreateCol(col, amount) { if (!this.engine.isItPossibleToAddColumns(this.sheetId, [this.toPhysicalColumnPosition(col), amount])) { return false; } } /** * `beforeRemoveRow` hook callback. * * @private * @param {number} row Visual index of starter row. * @param {number} amount Amount of rows to be removed. * @param {number[]} physicalRows An array of physical rows removed from the data source. * @returns {*|boolean} If false is returned the action is canceled. */ }, { key: "onBeforeRemoveRow", value: function onBeforeRemoveRow(row, amount, physicalRows) { var _this15 = this; var possible = physicalRows.every(function (physicalRow) { return _this15.engine.isItPossibleToRemoveRows(_this15.sheetId, [physicalRow, 1]); }); return possible === false ? false : void 0; } /** * `beforeRemoveCol` hook callback. * * @private * @param {number} col Visual index of starter column. * @param {number} amount Amount of columns to be removed. * @param {number[]} physicalColumns An array of physical columns removed from the data source. * @returns {*|boolean} If false is returned the action is canceled. */ }, { key: "onBeforeRemoveCol", value: function onBeforeRemoveCol(col, amount, physicalColumns) { var _this16 = this; var possible = physicalColumns.every(function (physicalColumn) { return _this16.engine.isItPossibleToRemoveColumns(_this16.sheetId, [physicalColumn, 1]); }); return possible === false ? false : void 0; } /** * `afterCreateRow` hook callback. * * @private * @param {number} row Represents the visual index of first newly created row in the data source array. * @param {number} amount Number of newly created rows in the data source array. */ }, { key: "onAfterCreateRow", value: function onAfterCreateRow(row, amount) { var changes = this.engine.addRows(this.sheetId, [this.toPhysicalRowPosition(row), amount]); this.renderDependentSheets(changes); } /** * `afterCreateCol` hook callback. * * @private * @param {number} col Represents the visual index of first newly created column in the data source. * @param {number} amount Number of newly created columns in the data source. */ }, { key: "onAfterCreateCol", value: function onAfterCreateCol(col, amount) { var changes = this.engine.addColumns(this.sheetId, [this.toPhysicalColumnPosition(col), amount]); this.renderDependentSheets(changes); } /** * `afterRemoveRow` hook callback. * * @private * @param {number} row Visual index of starter row. * @param {number} amount An amount of removed rows. * @param {number[]} physicalRows An array of physical rows removed from the data source. */ }, { key: "onAfterRemoveRow", value: function onAfterRemoveRow(row, amount, physicalRows) { var _this17 = this; var descendingPhysicalRows = physicalRows.sort().reverse(); var changes = this.engine.batch(function () { descendingPhysicalRows.forEach(function (physicalRow) { _this17.engine.removeRows(_this17.sheetId, [physicalRow, 1]); }); }); this.renderDependentSheets(changes); } /** * `afterRemoveCol` hook callback. * * @private * @param {number} col Visual index of starter column. * @param {number} amount An amount of removed columns. * @param {number[]} physicalColumns An array of physical columns removed from the data source. */ }, { key: "onAfterRemoveCol", value: function onAfterRemoveCol(col, amount, physicalColumns) { var _this18 = this; var descendingPhysicalColumns = physicalColumns.sort().reverse(); var changes = this.engine.batch(function () { descendingPhysicalColumns.forEach(function (physicalColumn) { _this18.engine.removeColumns(_this18.sheetId, [physicalColumn, 1]); }); }); this.renderDependentSheets(changes); } /** * Called when a value is updated in the engine. * * @private * @fires Hooks#afterFormulasValuesUpdate * @param {Array} changes The values and location of applied changes. */ }, { key: "onEngineValuesUpdated", value: function onEngineValuesUpdated(changes) { this.hot.runHooks('afterFormulasValuesUpdate', changes); } /** * Called when a named expression is added to the engine instance. * * @private * @fires Hooks#afterNamedExpressionAdded * @param {string} namedExpressionName The name of the added expression. * @param {Array} changes The values and location of applied changes. */ }, { key: "onEngineNamedExpressionsAdded", value: function onEngineNamedExpressionsAdded(namedExpressionName, changes) { this.hot.runHooks('afterNamedExpressionAdded', namedExpressionName, changes); } /** * Called when a named expression is removed from the engine instance. * * @private * @fires Hooks#afterNamedExpressionRemoved * @param {string} namedExpressionName The name of the removed expression. * @param {Array} changes The values and location of applied changes. */ }, { key: "onEngineNamedExpressionsRemoved", value: function onEngineNamedExpressionsRemoved(namedExpressionName, changes) { this.hot.runHooks('afterNamedExpressionRemoved', namedExpressionName, changes); } /** * Called when a new sheet is added to the engine instance. * * @private * @fires Hooks#afterSheetAdded * @param {string} addedSheetDisplayName The name of the added sheet. */ }, { key: "onEngineSheetAdded", value: function onEngineSheetAdded(addedSheetDisplayName) { this.hot.runHooks('afterSheetAdded', addedSheetDisplayName); } /** * Called when a sheet in the engine instance is renamed. * * @private * @fires Hooks#afterSheetRenamed * @param {string} oldDisplayName The old name of the sheet. * @param {string} newDisplayName The new name of the sheet. */ }, { key: "onEngineSheetRenamed", value: function onEngineSheetRenamed(oldDisplayName, newDisplayName) { this.hot.runHooks('afterSheetRenamed', oldDisplayName, newDisplayName); } /** * Called when a sheet is removed from the engine instance. * * @private * @fires Hooks#afterSheetRemoved * @param {string} removedSheetDisplayName The removed sheet name. * @param {Array} changes The values and location of applied changes. */ }, { key: "onEngineSheetRemoved", value: function onEngineSheetRemoved(removedSheetDisplayName, changes) { this.hot.runHooks('afterSheetRemoved', removedSheetDisplayName, changes); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } /** * Flag used to bypass hooks in internal operations. * * @private * @type {boolean} */ }]); return Formulas; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_24__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/formulas/index.mjs": /*!**************************************************************!*\ !*** ./node_modules/handsontable/plugins/formulas/index.mjs ***! \**************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, Formulas */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _formulas_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./formulas.mjs */ "./node_modules/handsontable/plugins/formulas/formulas.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _formulas_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _formulas_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Formulas", function() { return _formulas_mjs__WEBPACK_IMPORTED_MODULE_0__["Formulas"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/formulas/utils.mjs": /*!**************************************************************!*\ !*** ./node_modules/handsontable/plugins/formulas/utils.mjs ***! \**************************************************************/ /*! exports provided: isEscapedFormulaExpression, unescapeFormulaExpression */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEscapedFormulaExpression", function() { return isEscapedFormulaExpression; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unescapeFormulaExpression", function() { return unescapeFormulaExpression; }); /** * Checks if provided formula expression is escaped. * * @param {*} expression Expression to check. * @returns {boolean} */ function isEscapedFormulaExpression(expression) { return typeof expression === 'string' && expression.charAt(0) === '\'' && expression.charAt(1) === '='; } /** * Replaces escaped formula expression into valid non-unescaped string. * * @param {string} expression Expression to process. * @returns {string} */ function unescapeFormulaExpression(expression) { return isEscapedFormulaExpression(expression) ? expression.substr(1) : expression; } /***/ }), /***/ "./node_modules/handsontable/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs": /*!****************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs ***! \****************************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return hideColumnItem; }); /* harmony import */ var core_js_modules_es_number_is_integer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.number.is-integer.js */ "./node_modules/core-js/modules/es.number.is-integer.js"); /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.number.constructor.js */ "./node_modules/core-js/modules/es.number.constructor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /** * @param {HiddenColumns} hiddenColumnsPlugin The plugin instance. * @returns {object} */ function hideColumnItem(hiddenColumnsPlugin) { return { key: 'hidden_columns_hide', name: function name() { var selection = this.getSelectedLast(); var pluralForm = 0; if (Array.isArray(selection)) { var _selection = _slicedToArray(selection, 4), fromColumn = _selection[1], toColumn = _selection[3]; if (fromColumn - toColumn !== 0) { pluralForm = 1; } } return this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_12__["CONTEXTMENU_ITEMS_HIDE_COLUMN"], pluralForm); }, callback: function callback() { var _this$getSelectedRang = this.getSelectedRangeLast(), from = _this$getSelectedRang.from, to = _this$getSelectedRang.to; var start = Math.max(Math.min(from.col, to.col), 0); var end = Math.max(from.col, to.col); var columnsToHide = []; for (var visualColumn = start; visualColumn <= end; visualColumn += 1) { columnsToHide.push(visualColumn); } var firstHiddenColumn = columnsToHide[0]; var lastHiddenColumn = columnsToHide[columnsToHide.length - 1]; // Looking for a visual index on the right and then (when not found) on the left. var columnToSelect = this.columnIndexMapper.getFirstNotHiddenIndex(lastHiddenColumn + 1, 1, true, firstHiddenColumn - 1); hiddenColumnsPlugin.hideColumns(columnsToHide); if (Number.isInteger(columnToSelect) && columnToSelect >= 0) { this.selectColumns(columnToSelect); } else { this.deselectCell(); } this.render(); this.view.adjustElementsSize(true); }, disabled: false, hidden: function hidden() { return !(this.selection.isSelectedByColumnHeader() || this.selection.isSelectedByCorner()); } }; } /***/ }), /***/ "./node_modules/handsontable/plugins/hiddenColumns/contextMenuItem/showColumn.mjs": /*!****************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/hiddenColumns/contextMenuItem/showColumn.mjs ***! \****************************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return showColumnItem; }); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /** * @param {HiddenColumns} hiddenColumnsPlugin The plugin instance. * @returns {object} */ function showColumnItem(hiddenColumnsPlugin) { var columns = []; return { key: 'hidden_columns_show', name: function name() { var pluralForm = columns.length > 1 ? 1 : 0; return this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_14__["CONTEXTMENU_ITEMS_SHOW_COLUMN"], pluralForm); }, callback: function callback() { var _this$columnIndexMapp, _this$columnIndexMapp2; if (columns.length === 0) { return; } var startVisualColumn = columns[0]; var endVisualColumn = columns[columns.length - 1]; // Add to the selection one more visual column on the left. startVisualColumn = (_this$columnIndexMapp = this.columnIndexMapper.getFirstNotHiddenIndex(startVisualColumn - 1, -1)) !== null && _this$columnIndexMapp !== void 0 ? _this$columnIndexMapp : 0; // Add to the selection one more visual column on the right. endVisualColumn = (_this$columnIndexMapp2 = this.columnIndexMapper.getFirstNotHiddenIndex(endVisualColumn + 1, 1)) !== null && _this$columnIndexMapp2 !== void 0 ? _this$columnIndexMapp2 : this.countCols() - 1; hiddenColumnsPlugin.showColumns(columns); // We render columns at first. It was needed for getting fixed columns. // Please take a look at #6864 for broader description. this.render(); this.view.adjustElementsSize(true); var allColumnsSelected = endVisualColumn - startVisualColumn + 1 === this.countCols(); // When all headers needs to be selected then do nothing. The header selection is // automatically handled by corner click. if (!allColumnsSelected) { this.selectColumns(startVisualColumn, endVisualColumn); } }, disabled: false, hidden: function hidden() { var _this = this; var hiddenPhysicalColumns = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayMap"])(hiddenColumnsPlugin.getHiddenColumns(), function (visualColumnIndex) { return _this.toPhysicalColumn(visualColumnIndex); }); if (!(this.selection.isSelectedByColumnHeader() || this.selection.isSelectedByCorner()) || hiddenPhysicalColumns.length < 1) { return true; } columns.length = 0; var selectedRangeLast = this.getSelectedRangeLast(); var visualStartColumn = selectedRangeLast.getTopLeftCorner().col; var visualEndColumn = selectedRangeLast.getBottomRightCorner().col; var columnIndexMapper = this.columnIndexMapper; var renderableStartColumn = columnIndexMapper.getRenderableFromVisualIndex(visualStartColumn); var renderableEndColumn = columnIndexMapper.getRenderableFromVisualIndex(visualEndColumn); var notTrimmedColumnIndexes = columnIndexMapper.getNotTrimmedIndexes(); var physicalColumnIndexes = []; if (visualStartColumn !== visualEndColumn) { var visualColumnsInRange = visualEndColumn - visualStartColumn + 1; var renderedColumnsInRange = renderableEndColumn - renderableStartColumn + 1; // Collect not trimmed columns if there are some hidden columns in the selection range. if (visualColumnsInRange > renderedColumnsInRange) { var physicalIndexesInRange = notTrimmedColumnIndexes.slice(visualStartColumn, visualEndColumn + 1); physicalColumnIndexes.push.apply(physicalColumnIndexes, _toConsumableArray(physicalIndexesInRange.filter(function (physicalIndex) { return hiddenPhysicalColumns.includes(physicalIndex); }))); } // Handled column is the first rendered index and there are some visual indexes before it. } else if (renderableStartColumn === 0 && renderableStartColumn < visualStartColumn) { // not trimmed indexes -> array of mappings from visual (native array's index) to physical indexes (value). physicalColumnIndexes.push.apply(physicalColumnIndexes, _toConsumableArray(notTrimmedColumnIndexes.slice(0, visualStartColumn))); // physical indexes // When all columns are hidden and the context menu is triggered using top-left corner. } else if (renderableStartColumn === null) { // Show all hidden columns. physicalColumnIndexes.push.apply(physicalColumnIndexes, _toConsumableArray(notTrimmedColumnIndexes.slice(0, this.countCols()))); } else { var lastVisualIndex = this.countCols() - 1; var lastRenderableIndex = columnIndexMapper.getRenderableFromVisualIndex(columnIndexMapper.getFirstNotHiddenIndex(lastVisualIndex, -1)); // Handled column is the last rendered index and there are some visual indexes after it. if (renderableEndColumn === lastRenderableIndex && lastVisualIndex > visualEndColumn) { physicalColumnIndexes.push.apply(physicalColumnIndexes, _toConsumableArray(notTrimmedColumnIndexes.slice(visualEndColumn + 1))); } } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(physicalColumnIndexes, function (physicalColumnIndex) { columns.push(_this.toVisualColumn(physicalColumnIndex)); }); return columns.length === 0; } }; } /***/ }), /***/ "./node_modules/handsontable/plugins/hiddenColumns/hiddenColumns.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/plugins/hiddenColumns/hiddenColumns.mjs ***! \***************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, HiddenColumns */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HiddenColumns", function() { return HiddenColumns; }); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_number_is_integer_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.number.is-integer.js */ "./node_modules/core-js/modules/es.number.is-integer.js"); /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.number.constructor.js */ "./node_modules/core-js/modules/es.number.constructor.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js"); /* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.string.split.js */ "./node_modules/core-js/modules/es.string.split.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../contextMenu/predefinedItems.mjs */ "./node_modules/handsontable/plugins/contextMenu/predefinedItems.mjs"); /* harmony import */ var _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../pluginHooks.mjs */ "./node_modules/handsontable/pluginHooks.mjs"); /* harmony import */ var _contextMenuItem_hideColumn_mjs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./contextMenuItem/hideColumn.mjs */ "./node_modules/handsontable/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs"); /* harmony import */ var _contextMenuItem_showColumn_mjs__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./contextMenuItem/showColumn.mjs */ "./node_modules/handsontable/plugins/hiddenColumns/contextMenuItem/showColumn.mjs"); /* harmony import */ var _translations_index_mjs__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../translations/index.mjs */ "./node_modules/handsontable/translations/index.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_32__["default"].getSingleton().register('beforeHideColumns'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_32__["default"].getSingleton().register('afterHideColumns'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_32__["default"].getSingleton().register('beforeUnhideColumns'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_32__["default"].getSingleton().register('afterUnhideColumns'); var PLUGIN_KEY = 'hiddenColumns'; var PLUGIN_PRIORITY = 310; /** * @plugin HiddenColumns * @class HiddenColumns * * @description * Plugin allows to hide certain columns. The hiding is achieved by not rendering the columns. The plugin not modifies * the source data and do not participate in data transformation (the shape of data returned by `getData*` methods stays intact). * * Possible plugin settings: * * `copyPasteEnabled` as `Boolean` (default `true`) * * `columns` as `Array` * * `indicators` as `Boolean` (default `false`). * * @example * * ```js * const container = document.getElementById('example'); * const hot = new Handsontable(container, { * data: getData(), * hiddenColumns: { * copyPasteEnabled: true, * indicators: true, * columns: [1, 2, 5] * } * }); * * // access to hiddenColumns plugin instance: * const hiddenColumnsPlugin = hot.getPlugin('hiddenColumns'); * * // show single column * hiddenColumnsPlugin.showColumn(1); * * // show multiple columns * hiddenColumnsPlugin.showColumn(1, 2, 9); * * // or as an array * hiddenColumnsPlugin.showColumns([1, 2, 9]); * * // hide single column * hiddenColumnsPlugin.hideColumn(1); * * // hide multiple columns * hiddenColumnsPlugin.hideColumn(1, 2, 9); * * // or as an array * hiddenColumnsPlugin.hideColumns([1, 2, 9]); * * // rerender the table to see all changes * hot.render(); * ``` */ var _settings = /*#__PURE__*/new WeakMap(); var _hiddenColumnsMap = /*#__PURE__*/new WeakMap(); var HiddenColumns = /*#__PURE__*/function (_BasePlugin) { _inherits(HiddenColumns, _BasePlugin); var _super = _createSuper(HiddenColumns); function HiddenColumns() { var _this; _classCallCheck(this, HiddenColumns); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); _settings.set(_assertThisInitialized(_this), { writable: true, value: {} }); _hiddenColumnsMap.set(_assertThisInitialized(_this), { writable: true, value: null }); return _this; } _createClass(HiddenColumns, [{ key: "isEnabled", value: /** * 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 HiddenColumns#enablePlugin} method is called. * * @returns {boolean} */ function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } var pluginSettings = this.hot.getSettings()[PLUGIN_KEY]; if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_29__["isObject"])(pluginSettings)) { _classPrivateFieldSet(this, _settings, pluginSettings); if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_30__["isUndefined"])(pluginSettings.copyPasteEnabled)) { pluginSettings.copyPasteEnabled = true; } } _classPrivateFieldSet(this, _hiddenColumnsMap, new _translations_index_mjs__WEBPACK_IMPORTED_MODULE_35__["HidingMap"]()); _classPrivateFieldGet(this, _hiddenColumnsMap).addLocalHook('init', function () { return _this2.onMapInit(); }); this.hot.columnIndexMapper.registerMap(this.pluginName, _classPrivateFieldGet(this, _hiddenColumnsMap)); this.addHook('afterContextMenuDefaultOptions', function () { return _this2.onAfterContextMenuDefaultOptions.apply(_this2, arguments); }); this.addHook('afterGetCellMeta', function (row, col, cellProperties) { return _this2.onAfterGetCellMeta(row, col, cellProperties); }); this.addHook('modifyColWidth', function (width, col) { return _this2.onModifyColWidth(width, col); }); this.addHook('afterGetColHeader', function () { return _this2.onAfterGetColHeader.apply(_this2, arguments); }); this.addHook('modifyCopyableRange', function (ranges) { return _this2.onModifyCopyableRange(ranges); }); _get(_getPrototypeOf(HiddenColumns.prototype), "enablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); _get(_getPrototypeOf(HiddenColumns.prototype), "updatePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { this.hot.columnIndexMapper.unregisterMap(this.pluginName); _classPrivateFieldSet(this, _settings, {}); _get(_getPrototypeOf(HiddenColumns.prototype), "disablePlugin", this).call(this); this.resetCellsMeta(); } /** * Shows the provided columns. * * @param {number[]} columns Array of visual column indexes. */ }, { key: "showColumns", value: function showColumns(columns) { var _this3 = this; var currentHideConfig = this.getHiddenColumns(); var isValidConfig = this.isValidConfig(columns); var destinationHideConfig = currentHideConfig; var hidingMapValues = _classPrivateFieldGet(this, _hiddenColumnsMap).getValues().slice(); var isAnyColumnShowed = columns.length > 0; if (isValidConfig && isAnyColumnShowed) { var physicalColumns = columns.map(function (visualColumn) { return _this3.hot.toPhysicalColumn(visualColumn); }); // Preparing new values for hiding map. Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__["arrayEach"])(physicalColumns, function (physicalColumn) { hidingMapValues[physicalColumn] = false; }); // Preparing new hiding config. destinationHideConfig = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__["arrayReduce"])(hidingMapValues, function (hiddenIndexes, isHidden, physicalIndex) { if (isHidden) { hiddenIndexes.push(_this3.hot.toVisualColumn(physicalIndex)); } return hiddenIndexes; }, []); } var continueHiding = this.hot.runHooks('beforeUnhideColumns', currentHideConfig, destinationHideConfig, isValidConfig && isAnyColumnShowed); if (continueHiding === false) { return; } if (isValidConfig && isAnyColumnShowed) { _classPrivateFieldGet(this, _hiddenColumnsMap).setValues(hidingMapValues); } // @TODO Should call once per render cycle, currently fired separately in different plugins this.hot.view.adjustElementsSize(); this.hot.runHooks('afterUnhideColumns', currentHideConfig, destinationHideConfig, isValidConfig && isAnyColumnShowed, isValidConfig && destinationHideConfig.length < currentHideConfig.length); } /** * Shows a single column. * * @param {...number} column Visual column index. */ }, { key: "showColumn", value: function showColumn() { for (var _len2 = arguments.length, column = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { column[_key2] = arguments[_key2]; } this.showColumns(column); } /** * Hides the columns provided in the array. * * @param {number[]} columns Array of visual column indexes. */ }, { key: "hideColumns", value: function hideColumns(columns) { var _this4 = this; var currentHideConfig = this.getHiddenColumns(); var isConfigValid = this.isValidConfig(columns); var destinationHideConfig = currentHideConfig; if (isConfigValid) { destinationHideConfig = Array.from(new Set(currentHideConfig.concat(columns))); } var continueHiding = this.hot.runHooks('beforeHideColumns', currentHideConfig, destinationHideConfig, isConfigValid); if (continueHiding === false) { return; } if (isConfigValid) { this.hot.batchExecution(function () { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__["arrayEach"])(columns, function (visualColumn) { _classPrivateFieldGet(_this4, _hiddenColumnsMap).setValueAtIndex(_this4.hot.toPhysicalColumn(visualColumn), true); }); }, true); } this.hot.runHooks('afterHideColumns', currentHideConfig, destinationHideConfig, isConfigValid, isConfigValid && destinationHideConfig.length > currentHideConfig.length); } /** * Hides a single column. * * @param {...number} column Visual column index. */ }, { key: "hideColumn", value: function hideColumn() { for (var _len3 = arguments.length, column = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { column[_key3] = arguments[_key3]; } this.hideColumns(column); } /** * Returns an array of visual indexes of hidden columns. * * @returns {number[]} */ }, { key: "getHiddenColumns", value: function getHiddenColumns() { var _this5 = this; return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__["arrayMap"])(_classPrivateFieldGet(this, _hiddenColumnsMap).getHiddenIndexes(), function (physicalColumnIndex) { return _this5.hot.toVisualColumn(physicalColumnIndex); }); } /** * Checks if the provided column is hidden. * * @param {number} column Visual column index. * @returns {boolean} */ }, { key: "isHidden", value: function isHidden(column) { return _classPrivateFieldGet(this, _hiddenColumnsMap).getValueAtIndex(this.hot.toPhysicalColumn(column)) || false; } /** * Get if trim config is valid. Check whether all of the provided column indexes are within the bounds of the table. * * @param {Array} hiddenColumns List of hidden column indexes. * @returns {boolean} */ }, { key: "isValidConfig", value: function isValidConfig(hiddenColumns) { var nrOfColumns = this.hot.countCols(); if (Array.isArray(hiddenColumns) && hiddenColumns.length > 0) { return hiddenColumns.every(function (visualColumn) { return Number.isInteger(visualColumn) && visualColumn >= 0 && visualColumn < nrOfColumns; }); } return false; } /** * Reset all rendered cells meta. * * @private */ }, { key: "resetCellsMeta", value: function resetCellsMeta() { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__["arrayEach"])(this.hot.getCellsMeta(), function (meta) { if (meta) { meta.skipColumnOnPaste = false; } }); } /** * Adds the additional column width for the hidden column indicators. * * @private * @param {number|undefined} width Column width. * @param {number} column Visual column index. * @returns {number} */ }, { key: "onModifyColWidth", value: function onModifyColWidth(width, column) { // Hook is triggered internally only for the visible columns. Conditional will be handled for the API // calls of the `getColWidth` function on not visible indexes. if (this.isHidden(column)) { return 0; } if (_classPrivateFieldGet(this, _settings).indicators && (this.isHidden(column + 1) || this.isHidden(column - 1))) { // Add additional space for hidden column indicator. if (typeof width === 'number' && this.hot.hasColHeaders()) { return width + 15; } } } /** * Sets the copy-related cell meta. * * @private * @param {number} row Visual row index. * @param {number} column Visual column index. * @param {object} cellProperties Object containing the cell properties. */ }, { key: "onAfterGetCellMeta", value: function onAfterGetCellMeta(row, column, cellProperties) { if (_classPrivateFieldGet(this, _settings).copyPasteEnabled === false && this.isHidden(column)) { // Cell property handled by the `Autofill` and the `CopyPaste` plugins. cellProperties.skipColumnOnPaste = true; } if (this.isHidden(column - 1)) { cellProperties.className = cellProperties.className || ''; if (cellProperties.className.indexOf('afterHiddenColumn') === -1) { cellProperties.className += ' afterHiddenColumn'; } } else if (cellProperties.className) { var classArr = cellProperties.className.split(' '); if (classArr.length > 0) { var containAfterHiddenColumn = classArr.indexOf('afterHiddenColumn'); if (containAfterHiddenColumn > -1) { classArr.splice(containAfterHiddenColumn, 1); } cellProperties.className = classArr.join(' '); } } } /** * Modifies the copyable range, accordingly to the provided config. * * @private * @param {Array} ranges An array of objects defining copyable cells. * @returns {Array} */ }, { key: "onModifyCopyableRange", value: function onModifyCopyableRange(ranges) { var _this6 = this; // Ranges shouldn't be modified when `copyPasteEnabled` option is set to `true` (by default). if (_classPrivateFieldGet(this, _settings).copyPasteEnabled) { return ranges; } var newRanges = []; var pushRange = function pushRange(startRow, endRow, startCol, endCol) { newRanges.push({ startRow: startRow, endRow: endRow, startCol: startCol, endCol: endCol }); }; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__["arrayEach"])(ranges, function (range) { var isHidden = true; var rangeStart = 0; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_27__["rangeEach"])(range.startCol, range.endCol, function (visualColumn) { if (_this6.isHidden(visualColumn)) { if (!isHidden) { pushRange(range.startRow, range.endRow, rangeStart, visualColumn - 1); } isHidden = true; } else { if (isHidden) { rangeStart = visualColumn; } if (visualColumn === range.endCol) { pushRange(range.startRow, range.endRow, rangeStart, visualColumn); } isHidden = false; } }); }); return newRanges; } /** * Adds the needed classes to the headers. * * @private * @param {number} column Visual column index. * @param {HTMLElement} TH Header's TH element. */ }, { key: "onAfterGetColHeader", value: function onAfterGetColHeader(column, TH) { if (!_classPrivateFieldGet(this, _settings).indicators || column < 0) { return; } var classList = []; if (column >= 1 && this.isHidden(column - 1)) { classList.push('afterHiddenColumn'); } if (column < this.hot.countCols() - 1 && this.isHidden(column + 1)) { classList.push('beforeHiddenColumn'); } Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_26__["addClass"])(TH, classList); } /** * Add Show-hide columns to context menu. * * @private * @param {object} options An array of objects containing information about the pre-defined Context Menu items. */ }, { key: "onAfterContextMenuDefaultOptions", value: function onAfterContextMenuDefaultOptions(options) { options.items.push({ name: _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_31__["SEPARATOR"] }, Object(_contextMenuItem_hideColumn_mjs__WEBPACK_IMPORTED_MODULE_33__["default"])(this), Object(_contextMenuItem_showColumn_mjs__WEBPACK_IMPORTED_MODULE_34__["default"])(this)); } /** * On map initialized hook callback. * * @private */ }, { key: "onMapInit", value: function onMapInit() { if (Array.isArray(_classPrivateFieldGet(this, _settings).columns)) { this.hideColumns(_classPrivateFieldGet(this, _settings).columns); } } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { _classPrivateFieldSet(this, _settings, null); _classPrivateFieldSet(this, _hiddenColumnsMap, null); _get(_getPrototypeOf(HiddenColumns.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } /** * Cached plugin settings. * * @private * @type {object} */ }]); return HiddenColumns; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_25__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/hiddenColumns/index.mjs": /*!*******************************************************************!*\ !*** ./node_modules/handsontable/plugins/hiddenColumns/index.mjs ***! \*******************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, HiddenColumns */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _hiddenColumns_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hiddenColumns.mjs */ "./node_modules/handsontable/plugins/hiddenColumns/hiddenColumns.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _hiddenColumns_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _hiddenColumns_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HiddenColumns", function() { return _hiddenColumns_mjs__WEBPACK_IMPORTED_MODULE_0__["HiddenColumns"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/hiddenRows/contextMenuItem/hideRow.mjs": /*!**********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/hiddenRows/contextMenuItem/hideRow.mjs ***! \**********************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return hideRowItem; }); /* harmony import */ var core_js_modules_es_number_is_integer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.number.is-integer.js */ "./node_modules/core-js/modules/es.number.is-integer.js"); /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.number.constructor.js */ "./node_modules/core-js/modules/es.number.constructor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /** * @param {HiddenRows} hiddenRowsPlugin The plugin instance. * @returns {object} */ function hideRowItem(hiddenRowsPlugin) { return { key: 'hidden_rows_hide', name: function name() { var selection = this.getSelectedLast(); var pluralForm = 0; if (Array.isArray(selection)) { var _selection = _slicedToArray(selection, 3), fromRow = _selection[0], toRow = _selection[2]; if (fromRow - toRow !== 0) { pluralForm = 1; } } return this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_12__["CONTEXTMENU_ITEMS_HIDE_ROW"], pluralForm); }, callback: function callback() { var _this$getSelectedRang = this.getSelectedRangeLast(), from = _this$getSelectedRang.from, to = _this$getSelectedRang.to; var start = Math.max(Math.min(from.row, to.row), 0); var end = Math.max(from.row, to.row); var rowsToHide = []; for (var visualRow = start; visualRow <= end; visualRow += 1) { rowsToHide.push(visualRow); } var firstHiddenRow = rowsToHide[0]; var lastHiddenRow = rowsToHide[rowsToHide.length - 1]; // Looking for a visual index on the top and then (when not found) on the bottom. var rowToSelect = this.rowIndexMapper.getFirstNotHiddenIndex(lastHiddenRow + 1, 1, true, firstHiddenRow - 1); hiddenRowsPlugin.hideRows(rowsToHide); if (Number.isInteger(rowToSelect) && rowToSelect >= 0) { this.selectRows(rowToSelect); } else { this.deselectCell(); } this.render(); this.view.adjustElementsSize(true); }, disabled: false, hidden: function hidden() { return !(this.selection.isSelectedByRowHeader() || this.selection.isSelectedByCorner()); } }; } /***/ }), /***/ "./node_modules/handsontable/plugins/hiddenRows/contextMenuItem/showRow.mjs": /*!**********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/hiddenRows/contextMenuItem/showRow.mjs ***! \**********************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return showRowItem; }); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /** * @param {HiddenRows} hiddenRowsPlugin The plugin instance. * @returns {object} */ function showRowItem(hiddenRowsPlugin) { var rows = []; return { key: 'hidden_rows_show', name: function name() { var pluralForm = rows.length > 1 ? 1 : 0; return this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_14__["CONTEXTMENU_ITEMS_SHOW_ROW"], pluralForm); }, callback: function callback() { var _this$rowIndexMapper$, _this$rowIndexMapper$2; if (rows.length === 0) { return; } var startVisualRow = rows[0]; var endVisualRow = rows[rows.length - 1]; // Add to the selection one more visual row on the top. startVisualRow = (_this$rowIndexMapper$ = this.rowIndexMapper.getFirstNotHiddenIndex(startVisualRow - 1, -1)) !== null && _this$rowIndexMapper$ !== void 0 ? _this$rowIndexMapper$ : 0; // Add to the selection one more visual row on the bottom. endVisualRow = (_this$rowIndexMapper$2 = this.rowIndexMapper.getFirstNotHiddenIndex(endVisualRow + 1, 1)) !== null && _this$rowIndexMapper$2 !== void 0 ? _this$rowIndexMapper$2 : this.countRows() - 1; hiddenRowsPlugin.showRows(rows); // We render rows at first. It was needed for getting fixed rows. // Please take a look at #6864 for broader description. this.render(); this.view.adjustElementsSize(true); var allRowsSelected = endVisualRow - startVisualRow + 1 === this.countRows(); // When all headers needs to be selected then do nothing. The header selection is // automatically handled by corner click. if (!allRowsSelected) { this.selectRows(startVisualRow, endVisualRow); } }, disabled: false, hidden: function hidden() { var _this = this; var hiddenPhysicalRows = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayMap"])(hiddenRowsPlugin.getHiddenRows(), function (visualRowIndex) { return _this.toPhysicalRow(visualRowIndex); }); if (!(this.selection.isSelectedByRowHeader() || this.selection.isSelectedByCorner()) || hiddenPhysicalRows.length < 1) { return true; } rows.length = 0; var selectedRangeLast = this.getSelectedRangeLast(); var visualStartRow = selectedRangeLast.getTopLeftCorner().row; var visualEndRow = selectedRangeLast.getBottomRightCorner().row; var rowIndexMapper = this.rowIndexMapper; var renderableStartRow = rowIndexMapper.getRenderableFromVisualIndex(visualStartRow); var renderableEndRow = rowIndexMapper.getRenderableFromVisualIndex(visualEndRow); var notTrimmedRowIndexes = rowIndexMapper.getNotTrimmedIndexes(); var physicalRowIndexes = []; if (visualStartRow !== visualEndRow) { var visualRowsInRange = visualEndRow - visualStartRow + 1; var renderedRowsInRange = renderableEndRow - renderableStartRow + 1; // Collect not trimmed rows if there are some hidden rows in the selection range. if (visualRowsInRange > renderedRowsInRange) { var physicalIndexesInRange = notTrimmedRowIndexes.slice(visualStartRow, visualEndRow + 1); physicalRowIndexes.push.apply(physicalRowIndexes, _toConsumableArray(physicalIndexesInRange.filter(function (physicalIndex) { return hiddenPhysicalRows.includes(physicalIndex); }))); } // Handled row is the first rendered index and there are some visual indexes before it. } else if (renderableStartRow === 0 && renderableStartRow < visualStartRow) { // not trimmed indexes -> array of mappings from visual (native array's index) to physical indexes (value). physicalRowIndexes.push.apply(physicalRowIndexes, _toConsumableArray(notTrimmedRowIndexes.slice(0, visualStartRow))); // physical indexes // When all rows are hidden and the context menu is triggered using top-left corner. } else if (renderableStartRow === null) { // Show all hidden rows. physicalRowIndexes.push.apply(physicalRowIndexes, _toConsumableArray(notTrimmedRowIndexes.slice(0, this.countRows()))); } else { var lastVisualIndex = this.countRows() - 1; var lastRenderableIndex = rowIndexMapper.getRenderableFromVisualIndex(rowIndexMapper.getFirstNotHiddenIndex(lastVisualIndex, -1)); // Handled row is the last rendered index and there are some visual indexes after it. if (renderableEndRow === lastRenderableIndex && lastVisualIndex > visualEndRow) { physicalRowIndexes.push.apply(physicalRowIndexes, _toConsumableArray(notTrimmedRowIndexes.slice(visualEndRow + 1))); } } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(physicalRowIndexes, function (physicalRowIndex) { rows.push(_this.toVisualRow(physicalRowIndex)); }); return rows.length === 0; } }; } /***/ }), /***/ "./node_modules/handsontable/plugins/hiddenRows/hiddenRows.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/plugins/hiddenRows/hiddenRows.mjs ***! \*********************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, HiddenRows */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HiddenRows", function() { return HiddenRows; }); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_number_is_integer_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.number.is-integer.js */ "./node_modules/core-js/modules/es.number.is-integer.js"); /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.number.constructor.js */ "./node_modules/core-js/modules/es.number.constructor.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js"); /* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.string.split.js */ "./node_modules/core-js/modules/es.string.split.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../contextMenu/predefinedItems.mjs */ "./node_modules/handsontable/plugins/contextMenu/predefinedItems.mjs"); /* harmony import */ var _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../pluginHooks.mjs */ "./node_modules/handsontable/pluginHooks.mjs"); /* harmony import */ var _contextMenuItem_hideRow_mjs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./contextMenuItem/hideRow.mjs */ "./node_modules/handsontable/plugins/hiddenRows/contextMenuItem/hideRow.mjs"); /* harmony import */ var _contextMenuItem_showRow_mjs__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./contextMenuItem/showRow.mjs */ "./node_modules/handsontable/plugins/hiddenRows/contextMenuItem/showRow.mjs"); /* harmony import */ var _translations_index_mjs__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../translations/index.mjs */ "./node_modules/handsontable/translations/index.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_32__["default"].getSingleton().register('beforeHideRows'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_32__["default"].getSingleton().register('afterHideRows'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_32__["default"].getSingleton().register('beforeUnhideRows'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_32__["default"].getSingleton().register('afterUnhideRows'); var PLUGIN_KEY = 'hiddenRows'; var PLUGIN_PRIORITY = 320; /** * @plugin HiddenRows * @class HiddenRows * * @description * Plugin allows to hide certain rows. The hiding is achieved by rendering the rows with height set as 0px. * The plugin not modifies the source data and do not participate in data transformation (the shape of data returned * by `getData*` methods stays intact). * * Possible plugin settings: * * `copyPasteEnabled` as `Boolean` (default `true`) * * `rows` as `Array` * * `indicators` as `Boolean` (default `false`). * * @example * * ```js * const container = document.getElementById('example'); * const hot = new Handsontable(container, { * data: getData(), * hiddenRows: { * copyPasteEnabled: true, * indicators: true, * rows: [1, 2, 5] * } * }); * * // access to hiddenRows plugin instance * const hiddenRowsPlugin = hot.getPlugin('hiddenRows'); * * // show single row * hiddenRowsPlugin.showRow(1); * * // show multiple rows * hiddenRowsPlugin.showRow(1, 2, 9); * * // or as an array * hiddenRowsPlugin.showRows([1, 2, 9]); * * // hide single row * hiddenRowsPlugin.hideRow(1); * * // hide multiple rows * hiddenRowsPlugin.hideRow(1, 2, 9); * * // or as an array * hiddenRowsPlugin.hideRows([1, 2, 9]); * * // rerender the table to see all changes * hot.render(); * ``` */ var _settings = /*#__PURE__*/new WeakMap(); var _hiddenRowsMap = /*#__PURE__*/new WeakMap(); var HiddenRows = /*#__PURE__*/function (_BasePlugin) { _inherits(HiddenRows, _BasePlugin); var _super = _createSuper(HiddenRows); function HiddenRows() { var _this; _classCallCheck(this, HiddenRows); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); _settings.set(_assertThisInitialized(_this), { writable: true, value: {} }); _hiddenRowsMap.set(_assertThisInitialized(_this), { writable: true, value: null }); return _this; } _createClass(HiddenRows, [{ key: "isEnabled", value: /** * 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 HiddenRows#enablePlugin} method is called. * * @returns {boolean} */ function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } var pluginSettings = this.hot.getSettings()[PLUGIN_KEY]; if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_29__["isObject"])(pluginSettings)) { _classPrivateFieldSet(this, _settings, pluginSettings); if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_30__["isUndefined"])(pluginSettings.copyPasteEnabled)) { pluginSettings.copyPasteEnabled = true; } } _classPrivateFieldSet(this, _hiddenRowsMap, new _translations_index_mjs__WEBPACK_IMPORTED_MODULE_35__["HidingMap"]()); _classPrivateFieldGet(this, _hiddenRowsMap).addLocalHook('init', function () { return _this2.onMapInit(); }); this.hot.rowIndexMapper.registerMap(this.pluginName, _classPrivateFieldGet(this, _hiddenRowsMap)); this.addHook('afterContextMenuDefaultOptions', function () { return _this2.onAfterContextMenuDefaultOptions.apply(_this2, arguments); }); this.addHook('afterGetCellMeta', function (row, col, cellProperties) { return _this2.onAfterGetCellMeta(row, col, cellProperties); }); this.addHook('modifyRowHeight', function (height, row) { return _this2.onModifyRowHeight(height, row); }); this.addHook('afterGetRowHeader', function () { return _this2.onAfterGetRowHeader.apply(_this2, arguments); }); this.addHook('modifyCopyableRange', function (ranges) { return _this2.onModifyCopyableRange(ranges); }); _get(_getPrototypeOf(HiddenRows.prototype), "enablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); _get(_getPrototypeOf(HiddenRows.prototype), "updatePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { this.hot.rowIndexMapper.unregisterMap(this.pluginName); _classPrivateFieldSet(this, _settings, {}); _get(_getPrototypeOf(HiddenRows.prototype), "disablePlugin", this).call(this); this.resetCellsMeta(); } /** * Shows the rows provided in the array. * * @param {number[]} rows Array of visual row indexes. */ }, { key: "showRows", value: function showRows(rows) { var _this3 = this; var currentHideConfig = this.getHiddenRows(); var isValidConfig = this.isValidConfig(rows); var destinationHideConfig = currentHideConfig; var hidingMapValues = _classPrivateFieldGet(this, _hiddenRowsMap).getValues().slice(); var isAnyRowShowed = rows.length > 0; if (isValidConfig && isAnyRowShowed) { var physicalRows = rows.map(function (visualRow) { return _this3.hot.toPhysicalRow(visualRow); }); // Preparing new values for hiding map. Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__["arrayEach"])(physicalRows, function (physicalRow) { hidingMapValues[physicalRow] = false; }); // Preparing new hiding config. destinationHideConfig = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__["arrayReduce"])(hidingMapValues, function (hiddenIndexes, isHidden, physicalIndex) { if (isHidden) { hiddenIndexes.push(_this3.hot.toVisualRow(physicalIndex)); } return hiddenIndexes; }, []); } var continueHiding = this.hot.runHooks('beforeUnhideRows', currentHideConfig, destinationHideConfig, isValidConfig && isAnyRowShowed); if (continueHiding === false) { return; } if (isValidConfig && isAnyRowShowed) { _classPrivateFieldGet(this, _hiddenRowsMap).setValues(hidingMapValues); } this.hot.runHooks('afterUnhideRows', currentHideConfig, destinationHideConfig, isValidConfig && isAnyRowShowed, isValidConfig && destinationHideConfig.length < currentHideConfig.length); } /** * Shows the row provided as row index (counting from 0). * * @param {...number} row Visual row index. */ }, { key: "showRow", value: function showRow() { for (var _len2 = arguments.length, row = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { row[_key2] = arguments[_key2]; } this.showRows(row); } /** * Hides the rows provided in the array. * * @param {number[]} rows Array of visual row indexes. */ }, { key: "hideRows", value: function hideRows(rows) { var _this4 = this; var currentHideConfig = this.getHiddenRows(); var isConfigValid = this.isValidConfig(rows); var destinationHideConfig = currentHideConfig; if (isConfigValid) { destinationHideConfig = Array.from(new Set(currentHideConfig.concat(rows))); } var continueHiding = this.hot.runHooks('beforeHideRows', currentHideConfig, destinationHideConfig, isConfigValid); if (continueHiding === false) { return; } if (isConfigValid) { this.hot.batchExecution(function () { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__["arrayEach"])(rows, function (visualRow) { _classPrivateFieldGet(_this4, _hiddenRowsMap).setValueAtIndex(_this4.hot.toPhysicalRow(visualRow), true); }); }, true); } this.hot.runHooks('afterHideRows', currentHideConfig, destinationHideConfig, isConfigValid, isConfigValid && destinationHideConfig.length > currentHideConfig.length); } /** * Hides the row provided as row index (counting from 0). * * @param {...number} row Visual row index. */ }, { key: "hideRow", value: function hideRow() { for (var _len3 = arguments.length, row = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { row[_key3] = arguments[_key3]; } this.hideRows(row); } /** * Returns an array of visual indexes of hidden rows. * * @returns {number[]} */ }, { key: "getHiddenRows", value: function getHiddenRows() { var _this5 = this; return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__["arrayMap"])(_classPrivateFieldGet(this, _hiddenRowsMap).getHiddenIndexes(), function (physicalRowIndex) { return _this5.hot.toVisualRow(physicalRowIndex); }); } /** * Checks if the provided row is hidden. * * @param {number} row Visual row index. * @returns {boolean} */ }, { key: "isHidden", value: function isHidden(row) { return _classPrivateFieldGet(this, _hiddenRowsMap).getValueAtIndex(this.hot.toPhysicalRow(row)) || false; } /** * Checks whether all of the provided row indexes are within the bounds of the table. * * @param {Array} hiddenRows List of hidden visual row indexes. * @returns {boolean} */ }, { key: "isValidConfig", value: function isValidConfig(hiddenRows) { var nrOfRows = this.hot.countRows(); if (Array.isArray(hiddenRows) && hiddenRows.length > 0) { return hiddenRows.every(function (visualRow) { return Number.isInteger(visualRow) && visualRow >= 0 && visualRow < nrOfRows; }); } return false; } /** * Resets all rendered cells meta. * * @private */ }, { key: "resetCellsMeta", value: function resetCellsMeta() { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__["arrayEach"])(this.hot.getCellsMeta(), function (meta) { if (meta) { meta.skipRowOnPaste = false; } }); } /** * Adds the additional row height for the hidden row indicators. * * @private * @param {number|undefined} height Row height. * @param {number} row Visual row index. * @returns {number} */ }, { key: "onModifyRowHeight", value: function onModifyRowHeight(height, row) { // Hook is triggered internally only for the visible rows. Conditional will be handled for the API // calls of the `getRowHeight` function on not visible indexes. if (this.isHidden(row)) { return 0; } return height; } /** * Sets the copy-related cell meta. * * @private * @param {number} row Visual row index. * @param {number} column Visual column index. * @param {object} cellProperties Object containing the cell properties. */ }, { key: "onAfterGetCellMeta", value: function onAfterGetCellMeta(row, column, cellProperties) { if (_classPrivateFieldGet(this, _settings).copyPasteEnabled === false && this.isHidden(row)) { // Cell property handled by the `Autofill` and the `CopyPaste` plugins. cellProperties.skipRowOnPaste = true; } if (this.isHidden(row - 1)) { cellProperties.className = cellProperties.className || ''; if (cellProperties.className.indexOf('afterHiddenRow') === -1) { cellProperties.className += ' afterHiddenRow'; } } else if (cellProperties.className) { var classArr = cellProperties.className.split(' '); if (classArr.length > 0) { var containAfterHiddenRow = classArr.indexOf('afterHiddenRow'); if (containAfterHiddenRow > -1) { classArr.splice(containAfterHiddenRow, 1); } cellProperties.className = classArr.join(' '); } } } /** * Modifies the copyable range, accordingly to the provided config. * * @private * @param {Array} ranges An array of objects defining copyable cells. * @returns {Array} */ }, { key: "onModifyCopyableRange", value: function onModifyCopyableRange(ranges) { var _this6 = this; // Ranges shouldn't be modified when `copyPasteEnabled` option is set to `true` (by default). if (_classPrivateFieldGet(this, _settings).copyPasteEnabled) { return ranges; } var newRanges = []; var pushRange = function pushRange(startRow, endRow, startCol, endCol) { newRanges.push({ startRow: startRow, endRow: endRow, startCol: startCol, endCol: endCol }); }; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_28__["arrayEach"])(ranges, function (range) { var isHidden = true; var rangeStart = 0; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_27__["rangeEach"])(range.startRow, range.endRow, function (visualRow) { if (_this6.isHidden(visualRow)) { if (!isHidden) { pushRange(rangeStart, visualRow - 1, range.startCol, range.endCol); } isHidden = true; } else { if (isHidden) { rangeStart = visualRow; } if (visualRow === range.endRow) { pushRange(rangeStart, visualRow, range.startCol, range.endCol); } isHidden = false; } }); }); return newRanges; } /** * Adds the needed classes to the headers. * * @private * @param {number} row Visual row index. * @param {HTMLElement} TH Header's TH element. */ }, { key: "onAfterGetRowHeader", value: function onAfterGetRowHeader(row, TH) { if (!_classPrivateFieldGet(this, _settings).indicators || row < 0) { return; } var classList = []; if (row >= 1 && this.isHidden(row - 1)) { classList.push('afterHiddenRow'); } if (row < this.hot.countRows() - 1 && this.isHidden(row + 1)) { classList.push('beforeHiddenRow'); } Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_26__["addClass"])(TH, classList); } /** * Add Show-hide rows to context menu. * * @private * @param {object} options An array of objects containing information about the pre-defined Context Menu items. */ }, { key: "onAfterContextMenuDefaultOptions", value: function onAfterContextMenuDefaultOptions(options) { options.items.push({ name: _contextMenu_predefinedItems_mjs__WEBPACK_IMPORTED_MODULE_31__["SEPARATOR"] }, Object(_contextMenuItem_hideRow_mjs__WEBPACK_IMPORTED_MODULE_33__["default"])(this), Object(_contextMenuItem_showRow_mjs__WEBPACK_IMPORTED_MODULE_34__["default"])(this)); } /** * On map initialized hook callback. * * @private */ }, { key: "onMapInit", value: function onMapInit() { if (Array.isArray(_classPrivateFieldGet(this, _settings).rows)) { this.hideRows(_classPrivateFieldGet(this, _settings).rows); } } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { _classPrivateFieldSet(this, _settings, null); _classPrivateFieldSet(this, _hiddenRowsMap, null); _get(_getPrototypeOf(HiddenRows.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } /** * Cached settings from Handsontable settings. * * @private * @type {object} */ }]); return HiddenRows; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_25__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/hiddenRows/index.mjs": /*!****************************************************************!*\ !*** ./node_modules/handsontable/plugins/hiddenRows/index.mjs ***! \****************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, HiddenRows */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _hiddenRows_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hiddenRows.mjs */ "./node_modules/handsontable/plugins/hiddenRows/hiddenRows.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _hiddenRows_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _hiddenRows_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HiddenRows", function() { return _hiddenRows_mjs__WEBPACK_IMPORTED_MODULE_0__["HiddenRows"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/index.mjs": /*!*****************************************************!*\ !*** ./node_modules/handsontable/plugins/index.mjs ***! \*****************************************************/ /*! exports provided: PersistentState, AutoColumnSize, Autofill, ManualRowResize, AutoRowSize, ColumnSorting, Comments, ContextMenu, CopyPaste, CustomBorders, DragToScroll, ManualColumnFreeze, ManualColumnMove, ManualColumnResize, ManualRowMove, MergeCells, MultipleSelectionHandles, MultiColumnSorting, Search, TouchScroll, UndoRedo, BasePlugin, BindRowsWithHeaders, ColumnSummary, DropdownMenu, ExportFile, Filters, Formulas, NestedHeaders, CollapsibleColumns, NestedRows, HiddenColumns, HiddenRows, TrimRows, getPlugin, getPluginsNames, registerPlugin */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _persistentState_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./persistentState/index.mjs */ "./node_modules/handsontable/plugins/persistentState/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PersistentState", function() { return _persistentState_index_mjs__WEBPACK_IMPORTED_MODULE_0__["PersistentState"]; }); /* harmony import */ var _autoColumnSize_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./autoColumnSize/index.mjs */ "./node_modules/handsontable/plugins/autoColumnSize/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AutoColumnSize", function() { return _autoColumnSize_index_mjs__WEBPACK_IMPORTED_MODULE_1__["AutoColumnSize"]; }); /* harmony import */ var _autofill_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./autofill/index.mjs */ "./node_modules/handsontable/plugins/autofill/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Autofill", function() { return _autofill_index_mjs__WEBPACK_IMPORTED_MODULE_2__["Autofill"]; }); /* harmony import */ var _manualRowResize_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./manualRowResize/index.mjs */ "./node_modules/handsontable/plugins/manualRowResize/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManualRowResize", function() { return _manualRowResize_index_mjs__WEBPACK_IMPORTED_MODULE_3__["ManualRowResize"]; }); /* harmony import */ var _autoRowSize_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./autoRowSize/index.mjs */ "./node_modules/handsontable/plugins/autoRowSize/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AutoRowSize", function() { return _autoRowSize_index_mjs__WEBPACK_IMPORTED_MODULE_4__["AutoRowSize"]; }); /* harmony import */ var _columnSorting_index_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./columnSorting/index.mjs */ "./node_modules/handsontable/plugins/columnSorting/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnSorting", function() { return _columnSorting_index_mjs__WEBPACK_IMPORTED_MODULE_5__["ColumnSorting"]; }); /* harmony import */ var _comments_index_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./comments/index.mjs */ "./node_modules/handsontable/plugins/comments/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Comments", function() { return _comments_index_mjs__WEBPACK_IMPORTED_MODULE_6__["Comments"]; }); /* harmony import */ var _contextMenu_index_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./contextMenu/index.mjs */ "./node_modules/handsontable/plugins/contextMenu/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextMenu", function() { return _contextMenu_index_mjs__WEBPACK_IMPORTED_MODULE_7__["ContextMenu"]; }); /* harmony import */ var _copyPaste_index_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./copyPaste/index.mjs */ "./node_modules/handsontable/plugins/copyPaste/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CopyPaste", function() { return _copyPaste_index_mjs__WEBPACK_IMPORTED_MODULE_8__["CopyPaste"]; }); /* harmony import */ var _customBorders_index_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./customBorders/index.mjs */ "./node_modules/handsontable/plugins/customBorders/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomBorders", function() { return _customBorders_index_mjs__WEBPACK_IMPORTED_MODULE_9__["CustomBorders"]; }); /* harmony import */ var _dragToScroll_index_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./dragToScroll/index.mjs */ "./node_modules/handsontable/plugins/dragToScroll/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragToScroll", function() { return _dragToScroll_index_mjs__WEBPACK_IMPORTED_MODULE_10__["DragToScroll"]; }); /* harmony import */ var _manualColumnFreeze_index_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./manualColumnFreeze/index.mjs */ "./node_modules/handsontable/plugins/manualColumnFreeze/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManualColumnFreeze", function() { return _manualColumnFreeze_index_mjs__WEBPACK_IMPORTED_MODULE_11__["ManualColumnFreeze"]; }); /* harmony import */ var _manualColumnMove_index_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./manualColumnMove/index.mjs */ "./node_modules/handsontable/plugins/manualColumnMove/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManualColumnMove", function() { return _manualColumnMove_index_mjs__WEBPACK_IMPORTED_MODULE_12__["ManualColumnMove"]; }); /* harmony import */ var _manualColumnResize_index_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./manualColumnResize/index.mjs */ "./node_modules/handsontable/plugins/manualColumnResize/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManualColumnResize", function() { return _manualColumnResize_index_mjs__WEBPACK_IMPORTED_MODULE_13__["ManualColumnResize"]; }); /* harmony import */ var _manualRowMove_index_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./manualRowMove/index.mjs */ "./node_modules/handsontable/plugins/manualRowMove/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManualRowMove", function() { return _manualRowMove_index_mjs__WEBPACK_IMPORTED_MODULE_14__["ManualRowMove"]; }); /* harmony import */ var _mergeCells_index_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./mergeCells/index.mjs */ "./node_modules/handsontable/plugins/mergeCells/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MergeCells", function() { return _mergeCells_index_mjs__WEBPACK_IMPORTED_MODULE_15__["MergeCells"]; }); /* harmony import */ var _multipleSelectionHandles_index_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./multipleSelectionHandles/index.mjs */ "./node_modules/handsontable/plugins/multipleSelectionHandles/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultipleSelectionHandles", function() { return _multipleSelectionHandles_index_mjs__WEBPACK_IMPORTED_MODULE_16__["MultipleSelectionHandles"]; }); /* harmony import */ var _multiColumnSorting_index_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./multiColumnSorting/index.mjs */ "./node_modules/handsontable/plugins/multiColumnSorting/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiColumnSorting", function() { return _multiColumnSorting_index_mjs__WEBPACK_IMPORTED_MODULE_17__["MultiColumnSorting"]; }); /* harmony import */ var _search_index_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./search/index.mjs */ "./node_modules/handsontable/plugins/search/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Search", function() { return _search_index_mjs__WEBPACK_IMPORTED_MODULE_18__["Search"]; }); /* harmony import */ var _touchScroll_index_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./touchScroll/index.mjs */ "./node_modules/handsontable/plugins/touchScroll/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchScroll", function() { return _touchScroll_index_mjs__WEBPACK_IMPORTED_MODULE_19__["TouchScroll"]; }); /* harmony import */ var _undoRedo_index_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./undoRedo/index.mjs */ "./node_modules/handsontable/plugins/undoRedo/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoRedo", function() { return _undoRedo_index_mjs__WEBPACK_IMPORTED_MODULE_20__["UndoRedo"]; }); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BasePlugin", function() { return _base_index_mjs__WEBPACK_IMPORTED_MODULE_21__["BasePlugin"]; }); /* harmony import */ var _bindRowsWithHeaders_index_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./bindRowsWithHeaders/index.mjs */ "./node_modules/handsontable/plugins/bindRowsWithHeaders/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BindRowsWithHeaders", function() { return _bindRowsWithHeaders_index_mjs__WEBPACK_IMPORTED_MODULE_22__["BindRowsWithHeaders"]; }); /* harmony import */ var _columnSummary_index_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./columnSummary/index.mjs */ "./node_modules/handsontable/plugins/columnSummary/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnSummary", function() { return _columnSummary_index_mjs__WEBPACK_IMPORTED_MODULE_23__["ColumnSummary"]; }); /* harmony import */ var _dropdownMenu_index_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./dropdownMenu/index.mjs */ "./node_modules/handsontable/plugins/dropdownMenu/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return _dropdownMenu_index_mjs__WEBPACK_IMPORTED_MODULE_24__["DropdownMenu"]; }); /* harmony import */ var _exportFile_index_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./exportFile/index.mjs */ "./node_modules/handsontable/plugins/exportFile/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ExportFile", function() { return _exportFile_index_mjs__WEBPACK_IMPORTED_MODULE_25__["ExportFile"]; }); /* harmony import */ var _filters_index_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./filters/index.mjs */ "./node_modules/handsontable/plugins/filters/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Filters", function() { return _filters_index_mjs__WEBPACK_IMPORTED_MODULE_26__["Filters"]; }); /* harmony import */ var _formulas_index_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./formulas/index.mjs */ "./node_modules/handsontable/plugins/formulas/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Formulas", function() { return _formulas_index_mjs__WEBPACK_IMPORTED_MODULE_27__["Formulas"]; }); /* harmony import */ var _nestedHeaders_index_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./nestedHeaders/index.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NestedHeaders", function() { return _nestedHeaders_index_mjs__WEBPACK_IMPORTED_MODULE_28__["NestedHeaders"]; }); /* harmony import */ var _collapsibleColumns_index_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./collapsibleColumns/index.mjs */ "./node_modules/handsontable/plugins/collapsibleColumns/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CollapsibleColumns", function() { return _collapsibleColumns_index_mjs__WEBPACK_IMPORTED_MODULE_29__["CollapsibleColumns"]; }); /* harmony import */ var _nestedRows_index_mjs__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./nestedRows/index.mjs */ "./node_modules/handsontable/plugins/nestedRows/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NestedRows", function() { return _nestedRows_index_mjs__WEBPACK_IMPORTED_MODULE_30__["NestedRows"]; }); /* harmony import */ var _hiddenColumns_index_mjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./hiddenColumns/index.mjs */ "./node_modules/handsontable/plugins/hiddenColumns/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HiddenColumns", function() { return _hiddenColumns_index_mjs__WEBPACK_IMPORTED_MODULE_31__["HiddenColumns"]; }); /* harmony import */ var _hiddenRows_index_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./hiddenRows/index.mjs */ "./node_modules/handsontable/plugins/hiddenRows/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HiddenRows", function() { return _hiddenRows_index_mjs__WEBPACK_IMPORTED_MODULE_32__["HiddenRows"]; }); /* harmony import */ var _trimRows_index_mjs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./trimRows/index.mjs */ "./node_modules/handsontable/plugins/trimRows/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TrimRows", function() { return _trimRows_index_mjs__WEBPACK_IMPORTED_MODULE_33__["TrimRows"]; }); /* harmony import */ var _registry_mjs__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./registry.mjs */ "./node_modules/handsontable/plugins/registry.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPlugin", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_34__["getPlugin"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPluginsNames", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_34__["getPluginsNames"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerPlugin", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_34__["registerPlugin"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs": /*!***********************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs ***! \***********************************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return freezeColumnItem; }); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /** * @param {ManualColumnFreeze} manualColumnFreezePlugin The plugin instance. * @returns {object} */ function freezeColumnItem(manualColumnFreezePlugin) { return { key: 'freeze_column', name: function name() { return this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__["CONTEXTMENU_ITEMS_FREEZE_COLUMN"]); }, callback: function callback(key, selected) { var _selected = _slicedToArray(selected, 1), selectedColumn = _selected[0].start.col; manualColumnFreezePlugin.freezeColumn(selectedColumn); this.render(); this.view.adjustElementsSize(true); }, hidden: function hidden() { var selection = this.getSelectedRange(); var hide = false; if (selection === void 0) { hide = true; } else if (selection.length > 1) { hide = true; } else if (selection[0].from.col !== selection[0].to.col || selection[0].from.col <= this.getSettings().fixedColumnsLeft - 1) { hide = true; } return hide; } }; } /***/ }), /***/ "./node_modules/handsontable/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs": /*!*************************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs ***! \*************************************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return unfreezeColumnItem; }); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /** * @param {ManualColumnFreeze} manualColumnFreezePlugin The plugin instance. * @returns {object} */ function unfreezeColumnItem(manualColumnFreezePlugin) { return { key: 'unfreeze_column', name: function name() { return this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_10__["CONTEXTMENU_ITEMS_UNFREEZE_COLUMN"]); }, callback: function callback(key, selected) { var _selected = _slicedToArray(selected, 1), selectedColumn = _selected[0].start.col; manualColumnFreezePlugin.unfreezeColumn(selectedColumn); this.render(); this.view.adjustElementsSize(true); }, hidden: function hidden() { var selection = this.getSelectedRange(); var hide = false; if (selection === void 0) { hide = true; } else if (selection.length > 1) { hide = true; } else if (selection[0].from.col !== selection[0].to.col || selection[0].from.col >= this.getSettings().fixedColumnsLeft) { hide = true; } return hide; } }; } /***/ }), /***/ "./node_modules/handsontable/plugins/manualColumnFreeze/index.mjs": /*!************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualColumnFreeze/index.mjs ***! \************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, ManualColumnFreeze */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _manualColumnFreeze_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./manualColumnFreeze.mjs */ "./node_modules/handsontable/plugins/manualColumnFreeze/manualColumnFreeze.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _manualColumnFreeze_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _manualColumnFreeze_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManualColumnFreeze", function() { return _manualColumnFreeze_mjs__WEBPACK_IMPORTED_MODULE_0__["ManualColumnFreeze"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/manualColumnFreeze/manualColumnFreeze.mjs": /*!*************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualColumnFreeze/manualColumnFreeze.mjs ***! \*************************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, ManualColumnFreeze */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManualColumnFreeze", function() { return ManualColumnFreeze; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _contextMenuItem_freezeColumn_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./contextMenuItem/freezeColumn.mjs */ "./node_modules/handsontable/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs"); /* harmony import */ var _contextMenuItem_unfreezeColumn_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./contextMenuItem/unfreezeColumn.mjs */ "./node_modules/handsontable/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var PLUGIN_KEY = 'manualColumnFreeze'; var PLUGIN_PRIORITY = 110; var privatePool = new WeakMap(); /** * @plugin ManualColumnFreeze * @class ManualColumnFreeze * * @description * This plugin allows to manually "freeze" and "unfreeze" a column using an entry in the Context Menu or using API. * You can turn it on by setting a {@link options#manualcolumnfreeze Options#manualColumnFreeze} property to `true`. * * @example * ```js * // Enables the plugin * manualColumnFreeze: true, * ``` */ var ManualColumnFreeze = /*#__PURE__*/function (_BasePlugin) { _inherits(ManualColumnFreeze, _BasePlugin); var _super = _createSuper(ManualColumnFreeze); function ManualColumnFreeze(hotInstance) { var _this; _classCallCheck(this, ManualColumnFreeze); _this = _super.call(this, hotInstance); privatePool.set(_assertThisInitialized(_this), { afterFirstUse: false }); 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 ManualColumnFreeze#enablePlugin} method is called. * * @returns {boolean} */ _createClass(ManualColumnFreeze, [{ key: "isEnabled", value: function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } this.addHook('afterContextMenuDefaultOptions', function (options) { return _this2.addContextMenuEntry(options); }); this.addHook('beforeColumnMove', function (columns, finalIndex) { return _this2.onBeforeColumnMove(columns, finalIndex); }); _get(_getPrototypeOf(ManualColumnFreeze.prototype), "enablePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { var priv = privatePool.get(this); priv.afterFirstUse = false; _get(_getPrototypeOf(ManualColumnFreeze.prototype), "disablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); _get(_getPrototypeOf(ManualColumnFreeze.prototype), "updatePlugin", this).call(this); } /** * Freezes the given column (add it to fixed columns). * * @param {number} column Visual column index. */ }, { key: "freezeColumn", value: function freezeColumn(column) { var priv = privatePool.get(this); var settings = this.hot.getSettings(); if (!priv.afterFirstUse) { priv.afterFirstUse = true; } if (settings.fixedColumnsLeft === this.hot.countCols() || column <= settings.fixedColumnsLeft - 1) { return; // already fixed } this.hot.columnIndexMapper.moveIndexes(column, settings.fixedColumnsLeft); settings.fixedColumnsLeft += 1; } /** * Unfreezes the given column (remove it from fixed columns and bring to it's previous position). * * @param {number} column Visual column index. */ }, { key: "unfreezeColumn", value: function unfreezeColumn(column) { var priv = privatePool.get(this); var settings = this.hot.getSettings(); if (!priv.afterFirstUse) { priv.afterFirstUse = true; } if (settings.fixedColumnsLeft <= 0 || column > settings.fixedColumnsLeft - 1) { return; // not fixed } settings.fixedColumnsLeft -= 1; this.hot.columnIndexMapper.moveIndexes(column, settings.fixedColumnsLeft); } /** * Adds the manualColumnFreeze context menu entries. * * @private * @param {object} options Context menu options. */ }, { key: "addContextMenuEntry", value: function addContextMenuEntry(options) { options.items.push({ name: '---------' }, Object(_contextMenuItem_freezeColumn_mjs__WEBPACK_IMPORTED_MODULE_14__["default"])(this), Object(_contextMenuItem_unfreezeColumn_mjs__WEBPACK_IMPORTED_MODULE_15__["default"])(this)); } /** * Prevents moving the columns from/to fixed area. * * @private * @param {Array} columns Array of visual column indexes to be moved. * @param {number} finalIndex Visual column index, being a start index for the moved columns. Points to where the elements will be placed after the moving action. * @returns {boolean|undefined} */ }, { key: "onBeforeColumnMove", value: function onBeforeColumnMove(columns, finalIndex) { var priv = privatePool.get(this); if (priv.afterFirstUse) { var freezeLine = this.hot.getSettings().fixedColumnsLeft; // Moving any column before the "freeze line" isn't possible. if (finalIndex < freezeLine) { return false; } // Moving frozen column isn't possible. if (columns.some(function (column) { return column < freezeLine; })) { return false; } } } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return ManualColumnFreeze; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_13__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/manualColumnMove/index.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualColumnMove/index.mjs ***! \**********************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, ManualColumnMove */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _manualColumnMove_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./manualColumnMove.mjs */ "./node_modules/handsontable/plugins/manualColumnMove/manualColumnMove.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _manualColumnMove_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _manualColumnMove_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManualColumnMove", function() { return _manualColumnMove_mjs__WEBPACK_IMPORTED_MODULE_0__["ManualColumnMove"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/manualColumnMove/manualColumnMove.mjs": /*!*********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualColumnMove/manualColumnMove.mjs ***! \*********************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, ManualColumnMove */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManualColumnMove", function() { return ManualColumnMove; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.timers.js */ "./node_modules/core-js/modules/web.timers.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../pluginHooks.mjs */ "./node_modules/handsontable/pluginHooks.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _ui_backlight_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./ui/backlight.mjs */ "./node_modules/handsontable/plugins/manualColumnMove/ui/backlight.mjs"); /* harmony import */ var _ui_guideline_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./ui/guideline.mjs */ "./node_modules/handsontable/plugins/manualColumnMove/ui/guideline.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_16__["default"].getSingleton().register('beforeColumnMove'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_16__["default"].getSingleton().register('afterColumnMove'); var PLUGIN_KEY = 'manualColumnMove'; var PLUGIN_PRIORITY = 120; var privatePool = new WeakMap(); var CSS_PLUGIN = 'ht__manualColumnMove'; var CSS_SHOW_UI = 'show-ui'; var CSS_ON_MOVING = 'on-moving--columns'; var CSS_AFTER_SELECTION = 'after-selection--columns'; /** * @plugin ManualColumnMove * @class ManualColumnMove * * @description * This plugin allows to change columns order. To make columns order persistent the {@link options#persistentstate Options#persistentState} * plugin should be enabled. * * API: * - `moveColumn` - move single column to the new position. * - `moveColumns` - move many columns (as an array of indexes) to the new position. * - `dragColumn` - drag single column to the new position. * - `dragColumns` - drag many columns (as an array of indexes) to the new position. * * [Documentation](@/guides/columns/column-moving.md) explain differences between drag and move actions. * Please keep in mind that if you want apply visual changes, * you have to call manually the `render` method on the instance of Handsontable. * * The plugin creates additional components to make moving possibly using user interface: * - backlight - highlight of selected columns. * - guideline - line which shows where columns has been moved. * * @class ManualColumnMove * @plugin ManualColumnMove */ var ManualColumnMove = /*#__PURE__*/function (_BasePlugin) { _inherits(ManualColumnMove, _BasePlugin); var _super = _createSuper(ManualColumnMove); function ManualColumnMove(hotInstance) { var _this; _classCallCheck(this, ManualColumnMove); _this = _super.call(this, hotInstance); /** * Set up WeakMap of plugin to sharing private parameters;. */ privatePool.set(_assertThisInitialized(_this), { columnsToMove: [], countCols: 0, fixedColumns: 0, pressed: void 0, target: { eventPageX: void 0, coords: void 0, TD: void 0, col: void 0 }, cachedDropIndex: void 0 }); /** * Event Manager object. * * @private * @type {object} */ _this.eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_20__["default"](_assertThisInitialized(_this)); /** * Backlight UI object. * * @private * @type {object} */ _this.backlight = new _ui_backlight_mjs__WEBPACK_IMPORTED_MODULE_21__["default"](hotInstance); /** * Guideline UI object. * * @private * @type {object} */ _this.guideline = new _ui_guideline_mjs__WEBPACK_IMPORTED_MODULE_22__["default"](hotInstance); return _this; } /** * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link hooks#beforeInit Hooks#beforeInit} * hook and if it returns `true` than the {@link manual-column-move#enableplugin ManualColumnMove#enablePlugin} method is called. * * @returns {boolean} */ _createClass(ManualColumnMove, [{ key: "isEnabled", value: function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } this.addHook('beforeOnCellMouseDown', function (event, coords, TD, blockCalculations) { return _this2.onBeforeOnCellMouseDown(event, coords, TD, blockCalculations); }); this.addHook('beforeOnCellMouseOver', function (event, coords, TD, blockCalculations) { return _this2.onBeforeOnCellMouseOver(event, coords, TD, blockCalculations); }); this.addHook('afterScrollVertically', function () { return _this2.onAfterScrollVertically(); }); this.addHook('afterLoadData', function () { return _this2.onAfterLoadData(); }); this.buildPluginUI(); this.registerEvents(); // TODO: move adding plugin classname to BasePlugin. Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(this.hot.rootElement, CSS_PLUGIN); _get(_getPrototypeOf(ManualColumnMove.prototype), "enablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link core#updatesettings Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); this.moveBySettingsOrLoad(); _get(_getPrototypeOf(ManualColumnMove.prototype), "updatePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.hot.rootElement, CSS_PLUGIN); this.unregisterEvents(); this.backlight.destroy(); this.guideline.destroy(); _get(_getPrototypeOf(ManualColumnMove.prototype), "disablePlugin", this).call(this); } /** * Moves a single column. * * @param {number} column Visual column index to be moved. * @param {number} finalIndex Visual column index, being a start index for the moved columns. Points to where the elements will be placed after the moving action. * To check the visualization of the final index, please take a look at [documentation](@/guides/columns/column-moving.md#drag-and-move-actions-of-manualcolumnmove-plugin). * @fires Hooks#beforeColumnMove * @fires Hooks#afterColumnMove * @returns {boolean} */ }, { key: "moveColumn", value: function moveColumn(column, finalIndex) { return this.moveColumns([column], finalIndex); } /** * Moves a multiple columns. * * @param {Array} columns Array of visual column indexes to be moved. * @param {number} finalIndex Visual column index, being a start index for the moved columns. Points to where the elements will be placed after the moving action. * To check the visualization of the final index, please take a look at [documentation](@/guides/columns/column-moving.md#drag-and-move-actions-of-manualcolumnmove-plugin). * @fires Hooks#beforeColumnMove * @fires Hooks#afterColumnMove * @returns {boolean} */ }, { key: "moveColumns", value: function moveColumns(columns, finalIndex) { var priv = privatePool.get(this); var dropIndex = priv.cachedDropIndex; var movePossible = this.isMovePossible(columns, finalIndex); var beforeMoveHook = this.hot.runHooks('beforeColumnMove', columns, finalIndex, dropIndex, movePossible); priv.cachedDropIndex = void 0; if (beforeMoveHook === false) { return; } if (movePossible) { this.hot.columnIndexMapper.moveIndexes(columns, finalIndex); } var movePerformed = movePossible && this.isColumnOrderChanged(columns, finalIndex); this.hot.runHooks('afterColumnMove', columns, finalIndex, dropIndex, movePossible, movePerformed); return movePerformed; } /** * Drag a single column to drop index position. * * @param {number} column Visual column index to be dragged. * @param {number} dropIndex Visual column index, being a drop index for the moved columns. Points to where we are going to drop the moved elements. * To check visualization of drop index please take a look at [documentation](@/guides/columns/column-moving.md#drag-and-move-actions-of-manualcolumnmove-plugin). * @fires Hooks#beforeColumnMove * @fires Hooks#afterColumnMove * @returns {boolean} */ }, { key: "dragColumn", value: function dragColumn(column, dropIndex) { return this.dragColumns([column], dropIndex); } /** * Drag multiple columns to drop index position. * * @param {Array} columns Array of visual column indexes to be dragged. * @param {number} dropIndex Visual column index, being a drop index for the moved columns. Points to where we are going to drop the moved elements. * To check visualization of drop index please take a look at [documentation](@/guides/columns/column-moving.md#drag-and-move-actions-of-manualcolumnmove-plugin). * @fires Hooks#beforeColumnMove * @fires Hooks#afterColumnMove * @returns {boolean} */ }, { key: "dragColumns", value: function dragColumns(columns, dropIndex) { var finalIndex = this.countFinalIndex(columns, dropIndex); var priv = privatePool.get(this); priv.cachedDropIndex = dropIndex; return this.moveColumns(columns, finalIndex); } /** * Indicates if it's possible to move columns to the desired position. Some of the actions aren't * possible, i.e. You can’t move more than one element to the last position. * * @param {Array} movedColumns Array of visual column indexes to be moved. * @param {number} finalIndex Visual column index, being a start index for the moved columns. Points to where the elements will be placed after the moving action. * To check the visualization of the final index, please take a look at [documentation](@/guides/columns/column-moving.md#drag-and-move-actions-of-manualcolumnmove-plugin). * @returns {boolean} */ }, { key: "isMovePossible", value: function isMovePossible(movedColumns, finalIndex) { var length = this.hot.columnIndexMapper.getNotTrimmedIndexesLength(); // An attempt to transfer more columns to start destination than is possible (only when moving from the top to the bottom). var tooHighDestinationIndex = movedColumns.length + finalIndex > length; var tooLowDestinationIndex = finalIndex < 0; var tooLowMovedColumnIndex = movedColumns.some(function (movedColumn) { return movedColumn < 0; }); var tooHighMovedColumnIndex = movedColumns.some(function (movedColumn) { return movedColumn >= length; }); if (tooHighDestinationIndex || tooLowDestinationIndex || tooLowMovedColumnIndex || tooHighMovedColumnIndex) { return false; } return true; } /** * Indicates if order of columns was changed. * * @private * @param {Array} movedColumns Array of visual column indexes to be moved. * @param {number} finalIndex Visual column index, being a start index for the moved columns. Points to where the elements will be placed after the moving action. * To check the visualization of the final index, please take a look at [documentation](@/guides/columns/column-moving.md#drag-and-move-actions-of-manualcolumnmove-plugin). * @returns {boolean} */ }, { key: "isColumnOrderChanged", value: function isColumnOrderChanged(movedColumns, finalIndex) { return movedColumns.some(function (column, nrOfMovedElement) { return column - nrOfMovedElement !== finalIndex; }); } /** * Count the final column index from the drop index. * * @private * @param {Array} movedColumns Array of visual column indexes to be moved. * @param {number} dropIndex Visual column index, being a drop index for the moved columns. * @returns {number} Visual column index, being a start index for the moved columns. */ }, { key: "countFinalIndex", value: function countFinalIndex(movedColumns, dropIndex) { var numberOfColumnsLowerThanDropIndex = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayReduce"])(movedColumns, function (numberOfColumns, currentColumnIndex) { if (currentColumnIndex < dropIndex) { numberOfColumns += 1; } return numberOfColumns; }, 0); return dropIndex - numberOfColumnsLowerThanDropIndex; } /** * Gets the sum of the widths of columns in the provided range. * * @private * @param {number} fromColumn Visual column index. * @param {number} toColumn Visual column index. * @returns {number} */ }, { key: "getColumnsWidth", value: function getColumnsWidth(fromColumn, toColumn) { var columnMapper = this.hot.columnIndexMapper; var columnsWidth = 0; for (var visualColumnIndex = fromColumn; visualColumnIndex <= toColumn; visualColumnIndex += 1) { // We can't use just `getColWidth` (even without indexes translation) as it doesn't return proper values // when column is stretched. var renderableIndex = columnMapper.getRenderableFromVisualIndex(visualColumnIndex); if (visualColumnIndex < 0) { columnsWidth += this.hot.view.wt.wtViewport.getRowHeaderWidth() || 0; } else if (renderableIndex !== null) { columnsWidth += this.hot.view.wt.wtTable.getStretchedColumnWidth(renderableIndex) || 0; } } return columnsWidth; } /** * Loads initial settings when persistent state is saved or when plugin was initialized as an array. * * @private */ }, { key: "moveBySettingsOrLoad", value: function moveBySettingsOrLoad() { var pluginSettings = this.hot.getSettings()[PLUGIN_KEY]; if (Array.isArray(pluginSettings)) { this.moveColumns(pluginSettings, 0); } else if (pluginSettings !== void 0) { var persistentState = this.persistentStateLoad(); if (persistentState.length) { this.moveColumns(persistentState, 0); } } } /** * Checks if the provided column is in the fixedColumnsTop section. * * @private * @param {number} column Visual column index to check. * @returns {boolean} */ }, { key: "isFixedColumnsLeft", value: function isFixedColumnsLeft(column) { return column < this.hot.getSettings().fixedColumnsLeft; } /** * Saves the manual column positions to the persistent state (the {@link options#persistentstate Options#persistentState} option has to be enabled). * * @private * @fires Hooks#persistentStateSave */ }, { key: "persistentStateSave", value: function persistentStateSave() { this.hot.runHooks('persistentStateSave', 'manualColumnMove', this.hot.columnIndexMapper.getIndexesSequence()); // The `PersistentState` plugin should be refactored. } /** * Loads the manual column positions from the persistent state (the {@link options#persistentstate Options#persistentState} option has to be enabled). * * @private * @fires Hooks#persistentStateLoad * @returns {Array} Stored state. */ }, { key: "persistentStateLoad", value: function persistentStateLoad() { var storedState = {}; this.hot.runHooks('persistentStateLoad', 'manualColumnMove', storedState); return storedState.value ? storedState.value : []; } /** * Prepares an array of indexes based on actual selection. * * @private * @param {number} start The start index. * @param {number} end The end index. * @returns {Array} */ }, { key: "prepareColumnsToMoving", value: function prepareColumnsToMoving(start, end) { var selectedColumns = []; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_19__["rangeEach"])(start, end, function (i) { selectedColumns.push(i); }); return selectedColumns; } /** * Update the UI visual position. * * @private */ }, { key: "refreshPositions", value: function refreshPositions() { var priv = privatePool.get(this); var firstVisible = this.hot.view.wt.wtTable.getFirstVisibleColumn(); var lastVisible = this.hot.view.wt.wtTable.getLastVisibleColumn(); var wtTable = this.hot.view.wt.wtTable; var scrollableElement = this.hot.view.wt.wtOverlays.scrollableElement; var scrollLeft = typeof scrollableElement.scrollX === 'number' ? scrollableElement.scrollX : scrollableElement.scrollLeft; var tdOffsetLeft = this.hot.view.THEAD.offsetLeft + this.getColumnsWidth(0, priv.coords - 1); var mouseOffsetLeft = priv.target.eventPageX - (priv.rootElementOffset - (scrollableElement.scrollX === void 0 ? scrollLeft : 0)); // eslint-disable-line max-len var hiderWidth = wtTable.hider.offsetWidth; var tbodyOffsetLeft = wtTable.TBODY.offsetLeft; var backlightElemMarginLeft = this.backlight.getOffset().left; var backlightElemWidth = this.backlight.getSize().width; var rowHeaderWidth = 0; if (priv.rootElementOffset + wtTable.holder.offsetWidth + scrollLeft < priv.target.eventPageX) { if (priv.coords < priv.countCols) { priv.coords += 1; } } if (priv.hasRowHeaders) { rowHeaderWidth = this.hot.view.wt.wtOverlays.leftOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth; } if (this.isFixedColumnsLeft(priv.coords)) { tdOffsetLeft += scrollLeft; } tdOffsetLeft += rowHeaderWidth; if (priv.coords < 0) { // if hover on rowHeader if (priv.fixedColumns > 0) { priv.target.col = 0; } else { priv.target.col = firstVisible > 0 ? firstVisible - 1 : firstVisible; } } else if (priv.target.TD.offsetWidth / 2 + tdOffsetLeft <= mouseOffsetLeft) { var newCoordsCol = priv.coords >= priv.countCols ? priv.countCols - 1 : priv.coords; // if hover on right part of TD priv.target.col = newCoordsCol + 1; // unfortunately first column is bigger than rest tdOffsetLeft += priv.target.TD.offsetWidth; if (priv.target.col > lastVisible && lastVisible < priv.countCols) { this.hot.scrollViewportTo(void 0, lastVisible + 1, void 0, true); } } else { // elsewhere on table priv.target.col = priv.coords; if (priv.target.col <= firstVisible && priv.target.col >= priv.fixedColumns && firstVisible > 0) { this.hot.scrollViewportTo(void 0, firstVisible - 1); } } if (priv.target.col <= firstVisible && priv.target.col >= priv.fixedColumns && firstVisible > 0) { this.hot.scrollViewportTo(void 0, firstVisible - 1); } var backlightLeft = mouseOffsetLeft; var guidelineLeft = tdOffsetLeft; if (mouseOffsetLeft + backlightElemWidth + backlightElemMarginLeft >= hiderWidth) { // prevent display backlight on the right side of the table backlightLeft = hiderWidth - backlightElemWidth - backlightElemMarginLeft; } else if (mouseOffsetLeft + backlightElemMarginLeft < tbodyOffsetLeft + rowHeaderWidth) { // prevent display backlight on the left side of the table backlightLeft = tbodyOffsetLeft + rowHeaderWidth + Math.abs(backlightElemMarginLeft); } if (tdOffsetLeft >= hiderWidth - 1) { // prevent display guideline outside the table guidelineLeft = hiderWidth - 1; } else if (guidelineLeft === 0) { // guideline has got `margin-left: -1px` as default guidelineLeft = 1; } else if (scrollableElement.scrollX !== void 0 && priv.coords < priv.fixedColumns) { guidelineLeft -= priv.rootElementOffset <= scrollableElement.scrollX ? priv.rootElementOffset : 0; } this.backlight.setPosition(null, backlightLeft); this.guideline.setPosition(null, guidelineLeft); } /** * Binds the events used by the plugin. * * @private */ }, { key: "registerEvents", value: function registerEvents() { var _this3 = this; var documentElement = this.hot.rootDocument.documentElement; this.eventManager.addEventListener(documentElement, 'mousemove', function (event) { return _this3.onMouseMove(event); }); this.eventManager.addEventListener(documentElement, 'mouseup', function () { return _this3.onMouseUp(); }); } /** * Unbinds the events used by the plugin. * * @private */ }, { key: "unregisterEvents", value: function unregisterEvents() { this.eventManager.clear(); } /** * Change the behavior of selection / dragging. * * @private * @param {MouseEvent} event `mousedown` event properties. * @param {CellCoords} coords Visual cell coordinates where was fired event. * @param {HTMLElement} TD Cell represented as HTMLElement. * @param {object} blockCalculations Object which contains information about blockCalculation for row, column or cells. */ }, { key: "onBeforeOnCellMouseDown", value: function onBeforeOnCellMouseDown(event, coords, TD, blockCalculations) { var wtTable = this.hot.view.wt.wtTable; var isHeaderSelection = this.hot.selection.isSelectedByColumnHeader(); var selection = this.hot.getSelectedRangeLast(); var priv = privatePool.get(this); // This block action shouldn't be handled below. var isSortingElement = Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["hasClass"])(event.target, 'sortAction'); if (!selection || !isHeaderSelection || priv.pressed || event.button !== 0 || isSortingElement) { priv.pressed = false; priv.columnsToMove.length = 0; Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]); return; } var guidelineIsNotReady = this.guideline.isBuilt() && !this.guideline.isAppended(); var backlightIsNotReady = this.backlight.isBuilt() && !this.backlight.isAppended(); if (guidelineIsNotReady && backlightIsNotReady) { this.guideline.appendTo(wtTable.hider); this.backlight.appendTo(wtTable.hider); } var from = selection.from, to = selection.to; var start = Math.min(from.col, to.col); var end = Math.max(from.col, to.col); if (coords.row < 0 && coords.col >= start && coords.col <= end) { blockCalculations.column = true; priv.pressed = true; priv.target.eventPageX = event.pageX; priv.coords = coords.col; priv.target.TD = TD; priv.target.col = coords.col; priv.columnsToMove = this.prepareColumnsToMoving(start, end); priv.hasRowHeaders = !!this.hot.getSettings().rowHeaders; priv.countCols = this.hot.countCols(); priv.fixedColumns = this.hot.getSettings().fixedColumnsLeft; priv.rootElementOffset = Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["offset"])(this.hot.rootElement).left; var countColumnsFrom = priv.hasRowHeaders ? -1 : 0; var topPos = wtTable.holder.scrollTop + wtTable.getColumnHeaderHeight(0) + 1; var fixedColumns = coords.col < priv.fixedColumns; var scrollableElement = this.hot.view.wt.wtOverlays.scrollableElement; var wrapperIsWindow = scrollableElement.scrollX ? scrollableElement.scrollX - priv.rootElementOffset : 0; var mouseOffset = event.offsetX - (fixedColumns ? wrapperIsWindow : 0); var leftOffset = Math.abs(this.getColumnsWidth(start, coords.col - 1) + mouseOffset); this.backlight.setPosition(topPos, this.getColumnsWidth(countColumnsFrom, start - 1) + leftOffset); this.backlight.setSize(this.getColumnsWidth(start, end), wtTable.hider.offsetHeight - topPos); this.backlight.setOffset(null, leftOffset * -1); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(this.hot.rootElement, CSS_ON_MOVING); } else { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.hot.rootElement, CSS_AFTER_SELECTION); priv.pressed = false; priv.columnsToMove.length = 0; } } /** * 'mouseMove' event callback. Fired when pointer move on document.documentElement. * * @private * @param {MouseEvent} event `mousemove` event properties. */ }, { key: "onMouseMove", value: function onMouseMove(event) { var priv = privatePool.get(this); if (!priv.pressed) { return; } // callback for browser which doesn't supports CSS pointer-event: none if (event.target === this.backlight.element) { var width = this.backlight.getSize().width; this.backlight.setSize(0); setTimeout(function () { this.backlight.setPosition(width); }); } priv.target.eventPageX = event.pageX; this.refreshPositions(); } /** * 'beforeOnCellMouseOver' hook callback. Fired when pointer was over cell. * * @private * @param {MouseEvent} event `mouseover` event properties. * @param {CellCoords} coords Visual cell coordinates where was fired event. * @param {HTMLElement} TD Cell represented as HTMLElement. * @param {object} blockCalculations Object which contains information about blockCalculation for column, column or cells. */ }, { key: "onBeforeOnCellMouseOver", value: function onBeforeOnCellMouseOver(event, coords, TD, blockCalculations) { var selectedRange = this.hot.getSelectedRangeLast(); var priv = privatePool.get(this); if (!selectedRange || !priv.pressed) { return; } if (priv.columnsToMove.indexOf(coords.col) > -1) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.hot.rootElement, CSS_SHOW_UI); } else { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(this.hot.rootElement, CSS_SHOW_UI); } blockCalculations.row = true; blockCalculations.column = true; blockCalculations.cell = true; priv.coords = coords.col; priv.target.TD = TD; } /** * `onMouseUp` hook callback. * * @private */ }, { key: "onMouseUp", value: function onMouseUp() { var priv = privatePool.get(this); var target = priv.target.col; var columnsLen = priv.columnsToMove.length; priv.coords = void 0; priv.pressed = false; priv.backlightWidth = 0; Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI, CSS_AFTER_SELECTION]); if (this.hot.selection.isSelectedByColumnHeader()) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(this.hot.rootElement, CSS_AFTER_SELECTION); } if (columnsLen < 1 || target === void 0) { return; } var firstMovedVisualColumn = priv.columnsToMove[0]; var firstMovedPhysicalColumn = this.hot.toPhysicalColumn(firstMovedVisualColumn); var movePerformed = this.dragColumns(priv.columnsToMove, target); priv.columnsToMove.length = 0; if (movePerformed === true) { this.persistentStateSave(); this.hot.render(); this.hot.view.adjustElementsSize(true); var selectionStart = this.hot.toVisualColumn(firstMovedPhysicalColumn); var selectionEnd = selectionStart + columnsLen - 1; this.hot.selectColumns(selectionStart, selectionEnd); } } /** * `afterScrollHorizontally` hook callback. Fired the table was scrolled horizontally. * * @private */ }, { key: "onAfterScrollVertically", value: function onAfterScrollVertically() { var wtTable = this.hot.view.wt.wtTable; var headerHeight = wtTable.getColumnHeaderHeight(0) + 1; var scrollTop = wtTable.holder.scrollTop; var posTop = headerHeight + scrollTop; this.backlight.setPosition(posTop); this.backlight.setSize(null, wtTable.hider.offsetHeight - posTop); } /** * Builds the plugin's UI. * * @private */ }, { key: "buildPluginUI", value: function buildPluginUI() { this.backlight.build(); this.guideline.build(); } /** * Callback for the `afterLoadData` hook. * * @private */ }, { key: "onAfterLoadData", value: function onAfterLoadData() { this.moveBySettingsOrLoad(); } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { this.backlight.destroy(); this.guideline.destroy(); _get(_getPrototypeOf(ManualColumnMove.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return ManualColumnMove; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_15__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/manualColumnMove/ui/_base.mjs": /*!*************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualColumnMove/ui/_base.mjs ***! \*************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var STATE_INITIALIZED = 0; var STATE_BUILT = 1; var STATE_APPENDED = 2; var UNIT = 'px'; /** * @class * @private */ var BaseUI = /*#__PURE__*/function () { function BaseUI(hotInstance) { _classCallCheck(this, BaseUI); /** * 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; } /** * Add created UI elements to table. * * @param {HTMLElement} wrapper Element which are parent for our UI element. */ _createClass(BaseUI, [{ key: "appendTo", value: function appendTo(wrapper) { wrapper.appendChild(this._element); this.state = STATE_APPENDED; } /** * Method for create UI element. Only create, without append to table. */ }, { key: "build", value: function build() { if (this.state !== STATE_INITIALIZED) { return; } this._element = this.hot.rootDocument.createElement('div'); this.state = STATE_BUILT; } /** * Method for remove UI element. */ }, { key: "destroy", value: function destroy() { if (this.isAppended()) { this._element.parentElement.removeChild(this._element); } this._element = null; this.state = STATE_INITIALIZED; } /** * Check if UI element are appended. * * @returns {boolean} */ }, { key: "isAppended", value: function isAppended() { return this.state === STATE_APPENDED; } /** * Check if UI element are built. * * @returns {boolean} */ }, { key: "isBuilt", value: function isBuilt() { return this.state >= STATE_BUILT; } /** * Setter for position. * * @param {number} top New top position of the element. * @param {number} left New left position of the element. */ }, { key: "setPosition", value: function setPosition(top, left) { if (Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_0__["isNumeric"])(top)) { this._element.style.top = top + UNIT; } if (Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_0__["isNumeric"])(left)) { this._element.style.left = left + UNIT; } } /** * Getter for the element position. * * @returns {object} Object contains left and top position of the element. */ }, { 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. */ }, { key: "setSize", value: function setSize(width, height) { if (Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_0__["isNumeric"])(width)) { this._element.style.width = width + UNIT; } if (Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_0__["isNumeric"])(height)) { this._element.style.height = height + UNIT; } } /** * Getter for the element position. * * @returns {object} Object contains height and width of the element. */ }, { 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 }; } /** * 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. */ }, { key: "setOffset", value: function setOffset(top, left) { if (Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_0__["isNumeric"])(top)) { this._element.style.marginTop = top + UNIT; } if (Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_0__["isNumeric"])(left)) { this._element.style.marginLeft = left + UNIT; } } /** * Getter for the element offset. * * @returns {object} Object contains top and left offset of the element. */ }, { 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 BaseUI; }(); /* harmony default export */ __webpack_exports__["default"] = (BaseUI); /***/ }), /***/ "./node_modules/handsontable/plugins/manualColumnMove/ui/backlight.mjs": /*!*****************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualColumnMove/ui/backlight.mjs ***! \*****************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/manualColumnMove/ui/_base.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var CSS_CLASSNAME = 'ht__manualColumnMove--backlight'; /** * @class BacklightUI * @util */ var BacklightUI = /*#__PURE__*/function (_BaseUI) { _inherits(BacklightUI, _BaseUI); var _super = _createSuper(BacklightUI); function BacklightUI() { _classCallCheck(this, BacklightUI); return _super.apply(this, arguments); } _createClass(BacklightUI, [{ key: "build", value: /** * Custom className on build process. */ function build() { _get(_getPrototypeOf(BacklightUI.prototype), "build", this).call(this); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(this._element, CSS_CLASSNAME); } }]); return BacklightUI; }(_base_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]); /* harmony default export */ __webpack_exports__["default"] = (BacklightUI); /***/ }), /***/ "./node_modules/handsontable/plugins/manualColumnMove/ui/guideline.mjs": /*!*****************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualColumnMove/ui/guideline.mjs ***! \*****************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/manualColumnMove/ui/_base.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var CSS_CLASSNAME = 'ht__manualColumnMove--guideline'; /** * @class GuidelineUI * @util */ var GuidelineUI = /*#__PURE__*/function (_BaseUI) { _inherits(GuidelineUI, _BaseUI); var _super = _createSuper(GuidelineUI); function GuidelineUI() { _classCallCheck(this, GuidelineUI); return _super.apply(this, arguments); } _createClass(GuidelineUI, [{ key: "build", value: /** * Custom className on build process. */ function build() { _get(_getPrototypeOf(GuidelineUI.prototype), "build", this).call(this); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(this._element, CSS_CLASSNAME); } }]); return GuidelineUI; }(_base_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]); /* harmony default export */ __webpack_exports__["default"] = (GuidelineUI); /***/ }), /***/ "./node_modules/handsontable/plugins/manualColumnResize/index.mjs": /*!************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualColumnResize/index.mjs ***! \************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, ManualColumnResize */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _manualColumnResize_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./manualColumnResize.mjs */ "./node_modules/handsontable/plugins/manualColumnResize/manualColumnResize.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _manualColumnResize_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _manualColumnResize_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManualColumnResize", function() { return _manualColumnResize_mjs__WEBPACK_IMPORTED_MODULE_0__["ManualColumnResize"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/manualColumnResize/manualColumnResize.mjs": /*!*************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualColumnResize/manualColumnResize.mjs ***! \*************************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, ManualColumnResize */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManualColumnResize", function() { return ManualColumnResize; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.timers.js */ "./node_modules/core-js/modules/web.timers.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _translations_index_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../translations/index.mjs */ "./node_modules/handsontable/translations/index.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } // Developer note! Whenever you make a change in this file, make an analogous change in manualRowResize.js var PLUGIN_KEY = 'manualColumnResize'; var PLUGIN_PRIORITY = 130; var PERSISTENT_STATE_KEY = 'manualColumnWidths'; var privatePool = new WeakMap(); /** * @plugin ManualColumnResize * @class ManualColumnResize * * @description * This plugin allows to change columns width. To make columns width persistent the {@link options#persistentstate Options#persistentState} * plugin should be enabled. * * The plugin creates additional components to make resizing possibly using user interface: * - handle - the draggable element that sets the desired width of the column. * - guide - the helper guide that shows the desired width as a vertical guide. */ var ManualColumnResize = /*#__PURE__*/function (_BasePlugin) { _inherits(ManualColumnResize, _BasePlugin); var _super = _createSuper(ManualColumnResize); function ManualColumnResize(hotInstance) { var _this; _classCallCheck(this, ManualColumnResize); _this = _super.call(this, hotInstance); var rootDocument = _this.hot.rootDocument; _this.currentTH = null; _this.currentCol = null; _this.selectedCols = []; _this.currentWidth = null; _this.newSize = null; _this.startY = null; _this.startWidth = null; _this.startOffset = null; _this.handle = rootDocument.createElement('DIV'); _this.guide = rootDocument.createElement('DIV'); _this.eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_19__["default"](_assertThisInitialized(_this)); _this.pressed = null; _this.dblclick = 0; _this.autoresizeTimeout = null; /** * PhysicalIndexToValueMap to keep and track widths for physical column indexes. * * @private * @type {PhysicalIndexToValueMap} */ _this.columnWidthsMap = void 0; /** * Private pool to save configuration from updateSettings. */ privatePool.set(_assertThisInitialized(_this), { config: void 0 }); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(_this.handle, 'manualColumnResizer'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(_this.guide, 'manualColumnResizerGuide'); 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 ManualColumnResize#enablePlugin} method is called. * * @returns {boolean} */ _createClass(ManualColumnResize, [{ key: "isEnabled", value: function isEnabled() { return this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } this.columnWidthsMap = new _translations_index_mjs__WEBPACK_IMPORTED_MODULE_22__["PhysicalIndexToValueMap"](); this.columnWidthsMap.addLocalHook('init', function () { return _this2.onMapInit(); }); this.hot.columnIndexMapper.registerMap(this.pluginName, this.columnWidthsMap); this.addHook('modifyColWidth', function (width, col) { return _this2.onModifyColWidth(width, col); }); this.addHook('beforeStretchingColumnWidth', function (stretchedWidth, column) { return _this2.onBeforeStretchingColumnWidth(stretchedWidth, column); }); this.addHook('beforeColumnResize', function (newSize, column, isDoubleClick) { return _this2.onBeforeColumnResize(newSize, column, isDoubleClick); }); this.bindEvents(); _get(_getPrototypeOf(ManualColumnResize.prototype), "enablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); _get(_getPrototypeOf(ManualColumnResize.prototype), "updatePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { var priv = privatePool.get(this); priv.config = this.columnWidthsMap.getValues(); this.hot.columnIndexMapper.unregisterMap(this.pluginName); _get(_getPrototypeOf(ManualColumnResize.prototype), "disablePlugin", this).call(this); } /** * Saves the current sizes using the persistentState plugin (the {@link options#persistentstate Options#persistentState} option has to be enabled). * * @fires Hooks#persistentStateSave */ }, { key: "saveManualColumnWidths", value: function saveManualColumnWidths() { this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, this.columnWidthsMap.getValues()); } /** * Loads the previously saved sizes using the persistentState plugin (the {@link options#persistentstate Options#persistentState} option has to be enabled). * * @returns {Array} * @fires Hooks#persistentStateLoad */ }, { key: "loadManualColumnWidths", value: function loadManualColumnWidths() { var storedState = {}; this.hot.runHooks('persistentStateLoad', PERSISTENT_STATE_KEY, storedState); return storedState.value; } /** * Sets the new width for specified column index. * * @param {number} column Visual column index. * @param {number} width Column width (no less than 20px). * @returns {number} Returns new width. */ }, { key: "setManualSize", value: function setManualSize(column, width) { var newWidth = Math.max(width, 20); var physicalColumn = this.hot.toPhysicalColumn(column); this.columnWidthsMap.setValueAtIndex(physicalColumn, newWidth); return newWidth; } /** * Clears the cache for the specified column index. * * @param {number} column Visual column index. */ }, { key: "clearManualSize", value: function clearManualSize(column) { var physicalColumn = this.hot.toPhysicalColumn(column); this.columnWidthsMap.setValueAtIndex(physicalColumn, null); } /** * Callback to call on map's `init` local hook. * * @private */ }, { key: "onMapInit", value: function onMapInit() { var _this3 = this; var priv = privatePool.get(this); var initialSetting = this.hot.getSettings()[PLUGIN_KEY]; var loadedManualColumnWidths = this.loadManualColumnWidths(); if (typeof loadedManualColumnWidths !== 'undefined') { this.hot.batchExecution(function () { loadedManualColumnWidths.forEach(function (width, physicalIndex) { _this3.columnWidthsMap.setValueAtIndex(physicalIndex, width); }); }, true); } else if (Array.isArray(initialSetting)) { this.hot.batchExecution(function () { initialSetting.forEach(function (width, physicalIndex) { _this3.columnWidthsMap.setValueAtIndex(physicalIndex, width); }); }, true); priv.config = initialSetting; } else if (initialSetting === true && Array.isArray(priv.config)) { this.hot.batchExecution(function () { priv.config.forEach(function (width, physicalIndex) { _this3.columnWidthsMap.setValueAtIndex(physicalIndex, width); }); }, true); } } /** * Set the resize handle position. * * @private * @param {HTMLCellElement} TH TH HTML element. */ }, { key: "setupHandlePosition", value: function setupHandlePosition(TH) { var _this4 = this; if (!TH.parentNode) { return; } this.currentTH = TH; var wt = this.hot.view.wt; var cellCoords = wt.wtTable.getCoords(this.currentTH); var col = cellCoords.col; // Ignore column headers. if (col < 0) { return; } var headerHeight = Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["outerHeight"])(this.currentTH); var box = this.currentTH.getBoundingClientRect(); // Read "fixedColumnsLeft" through the Walkontable as in that context, the fixed columns // are modified (reduced by the number of hidden columns) by TableView module. var fixedColumn = col < wt.getSetting('fixedColumnsLeft'); var relativeHeaderPosition; if (fixedColumn) { relativeHeaderPosition = wt.wtOverlays.topLeftCornerOverlay.getRelativeCellPosition(this.currentTH, cellCoords.row, cellCoords.col); } // If the TH is not a child of the top-left overlay, recalculate using // the top overlay - as this overlay contains the rest of the headers. if (!relativeHeaderPosition) { relativeHeaderPosition = wt.wtOverlays.topOverlay.getRelativeCellPosition(this.currentTH, cellCoords.row, cellCoords.col); } this.currentCol = this.hot.columnIndexMapper.getVisualFromRenderableIndex(col); this.selectedCols = []; var isFullColumnSelected = this.hot.selection.isSelectedByCorner() || this.hot.selection.isSelectedByColumnHeader(); if (this.hot.selection.isSelected() && isFullColumnSelected) { var selectionRanges = this.hot.getSelectedRange(); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(selectionRanges, function (selectionRange) { var fromColumn = selectionRange.getTopLeftCorner().col; var toColumn = selectionRange.getBottomRightCorner().col; // Add every selected column for resize action. Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_21__["rangeEach"])(fromColumn, toColumn, function (columnIndex) { if (!_this4.selectedCols.includes(columnIndex)) { _this4.selectedCols.push(columnIndex); } }); }); } // Resizing element beyond the current selection (also when there is no selection). if (!this.selectedCols.includes(this.currentCol)) { this.selectedCols = [this.currentCol]; } this.startOffset = relativeHeaderPosition.left - 6; this.startWidth = parseInt(box.width, 10); this.handle.style.top = "".concat(relativeHeaderPosition.top, "px"); this.handle.style.left = "".concat(this.startOffset + this.startWidth, "px"); this.handle.style.height = "".concat(headerHeight, "px"); this.hot.rootElement.appendChild(this.handle); } /** * Refresh the resize handle position. * * @private */ }, { key: "refreshHandlePosition", value: function refreshHandlePosition() { this.handle.style.left = "".concat(this.startOffset + this.currentWidth, "px"); } /** * Sets the resize guide position. * * @private */ }, { key: "setupGuidePosition", value: function setupGuidePosition() { var handleHeight = parseInt(Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["outerHeight"])(this.handle), 10); var handleBottomPosition = parseInt(this.handle.style.top, 10) + handleHeight; var maximumVisibleElementHeight = parseInt(this.hot.view.maximumVisibleElementHeight(0), 10); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(this.handle, 'active'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(this.guide, 'active'); this.guide.style.top = "".concat(handleBottomPosition, "px"); this.guide.style.left = this.handle.style.left; this.guide.style.height = "".concat(maximumVisibleElementHeight - handleHeight, "px"); this.hot.rootElement.appendChild(this.guide); } /** * Refresh the resize guide position. * * @private */ }, { key: "refreshGuidePosition", value: function refreshGuidePosition() { this.guide.style.left = this.handle.style.left; } /** * Hides both the resize handle and resize guide. * * @private */ }, { key: "hideHandleAndGuide", value: function hideHandleAndGuide() { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.handle, 'active'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.guide, 'active'); } /** * Checks if provided element is considered a column header. * * @private * @param {HTMLElement} element HTML element. * @returns {boolean} */ }, { key: "checkIfColumnHeader", value: function checkIfColumnHeader(element) { return !!Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["closest"])(element, ['THEAD'], this.hot.rootElement); } /** * Gets the TH element from the provided element. * * @private * @param {HTMLElement} element HTML element. * @returns {HTMLElement} */ }, { key: "getClosestTHParent", value: function getClosestTHParent(element) { if (element.tagName !== 'TABLE') { if (element.tagName === 'TH') { return element; } return this.getClosestTHParent(element.parentNode); } return null; } /** * 'mouseover' event callback - set the handle position. * * @private * @param {MouseEvent} event The mouse event. */ }, { key: "onMouseOver", value: function onMouseOver(event) { // Workaround for #6926 - if the `event.target` is temporarily detached, we can skip this callback and wait for // the next `onmouseover`. if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["isDetached"])(event.target)) { return; } if (this.checkIfColumnHeader(event.target)) { var th = this.getClosestTHParent(event.target); if (!th) { return; } var colspan = th.getAttribute('colspan'); if (th && (colspan === null || colspan === 1)) { if (!this.pressed) { this.setupHandlePosition(th); } } } } /** * Auto-size row after doubleclick - callback. * * @private * @fires Hooks#beforeColumnResize * @fires Hooks#afterColumnResize */ }, { key: "afterMouseDownTimeout", value: function afterMouseDownTimeout() { var _this5 = this; var render = function render() { _this5.hot.forceFullRender = true; _this5.hot.view.render(); // updates all _this5.hot.view.adjustElementsSize(true); }; var resize = function resize(column, forceRender) { var hookNewSize = _this5.hot.runHooks('beforeColumnResize', _this5.newSize, column, true); if (hookNewSize !== void 0) { _this5.newSize = hookNewSize; } if (_this5.hot.getSettings().stretchH === 'all') { _this5.clearManualSize(column); } else { _this5.setManualSize(column, _this5.newSize); // double click sets by auto row size plugin } _this5.saveManualColumnWidths(); _this5.hot.runHooks('afterColumnResize', _this5.newSize, column, true); if (forceRender) { render(); } }; if (this.dblclick >= 2) { var selectedColsLength = this.selectedCols.length; if (selectedColsLength > 1) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.selectedCols, function (selectedCol) { resize(selectedCol); }); render(); } else { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.selectedCols, function (selectedCol) { resize(selectedCol, true); }); } } this.dblclick = 0; this.autoresizeTimeout = null; } /** * 'mousedown' event callback. * * @private * @param {MouseEvent} event The mouse event. */ }, { key: "onMouseDown", value: function onMouseDown(event) { var _this6 = this; if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["hasClass"])(event.target, 'manualColumnResizer')) { this.setupHandlePosition(this.currentTH); this.setupGuidePosition(); this.pressed = true; if (this.autoresizeTimeout === null) { this.autoresizeTimeout = setTimeout(function () { return _this6.afterMouseDownTimeout(); }, 500); this.hot._registerTimeout(this.autoresizeTimeout); } this.dblclick += 1; this.startX = event.pageX; this.newSize = this.startWidth; } } /** * 'mousemove' event callback - refresh the handle and guide positions, cache the new column width. * * @private * @param {MouseEvent} event The mouse event. */ }, { key: "onMouseMove", value: function onMouseMove(event) { var _this7 = this; if (this.pressed) { this.currentWidth = this.startWidth + (event.pageX - this.startX); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.selectedCols, function (selectedCol) { _this7.newSize = _this7.setManualSize(selectedCol, _this7.currentWidth); }); this.refreshHandlePosition(); this.refreshGuidePosition(); } } /** * 'mouseup' event callback - apply the column resizing. * * @private * * @fires Hooks#beforeColumnResize * @fires Hooks#afterColumnResize */ }, { key: "onMouseUp", value: function onMouseUp() { var _this8 = this; var render = function render() { _this8.hot.forceFullRender = true; _this8.hot.view.render(); // updates all _this8.hot.view.adjustElementsSize(true); }; var resize = function resize(column, forceRender) { _this8.hot.runHooks('beforeColumnResize', _this8.newSize, column, false); if (forceRender) { render(); } _this8.saveManualColumnWidths(); _this8.hot.runHooks('afterColumnResize', _this8.newSize, column, false); }; if (this.pressed) { this.hideHandleAndGuide(); this.pressed = false; if (this.newSize !== this.startWidth) { var selectedColsLength = this.selectedCols.length; if (selectedColsLength > 1) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.selectedCols, function (selectedCol) { resize(selectedCol); }); render(); } else { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.selectedCols, function (selectedCol) { resize(selectedCol, true); }); } } this.setupHandlePosition(this.currentTH); } } /** * Binds the mouse events. * * @private */ }, { key: "bindEvents", value: function bindEvents() { var _this9 = this; var _this$hot = this.hot, rootWindow = _this$hot.rootWindow, rootElement = _this$hot.rootElement; this.eventManager.addEventListener(rootElement, 'mouseover', function (e) { return _this9.onMouseOver(e); }); this.eventManager.addEventListener(rootElement, 'mousedown', function (e) { return _this9.onMouseDown(e); }); this.eventManager.addEventListener(rootWindow, 'mousemove', function (e) { return _this9.onMouseMove(e); }); this.eventManager.addEventListener(rootWindow, 'mouseup', function () { return _this9.onMouseUp(); }); } /** * Modifies the provided column width, based on the plugin settings. * * @private * @param {number} width Column width. * @param {number} column Visual column index. * @returns {number} */ }, { key: "onModifyColWidth", value: function onModifyColWidth(width, column) { var newWidth = width; if (this.enabled) { var physicalColumn = this.hot.toPhysicalColumn(column); var columnWidth = this.columnWidthsMap.getValueAtIndex(physicalColumn); if (this.hot.getSettings()[PLUGIN_KEY] && columnWidth) { newWidth = columnWidth; } } return newWidth; } /** * Modifies the provided column stretched width. This hook decides if specified column should be stretched or not. * * @private * @param {number} stretchedWidth Stretched width. * @param {number} column Visual column index. * @returns {number} */ }, { key: "onBeforeStretchingColumnWidth", value: function onBeforeStretchingColumnWidth(stretchedWidth, column) { var width = this.columnWidthsMap.getValueAtIndex(column); if (width === null) { width = stretchedWidth; } return width; } /** * `beforeColumnResize` hook callback. * * @private */ }, { key: "onBeforeColumnResize", value: function onBeforeColumnResize() { // clear the header height cache information this.hot.view.wt.wtViewport.resetHasOversizedColumnHeadersMarked(); } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { _get(_getPrototypeOf(ManualColumnResize.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return ManualColumnResize; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_17__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/manualRowMove/index.mjs": /*!*******************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualRowMove/index.mjs ***! \*******************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, ManualRowMove */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _manualRowMove_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./manualRowMove.mjs */ "./node_modules/handsontable/plugins/manualRowMove/manualRowMove.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _manualRowMove_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _manualRowMove_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManualRowMove", function() { return _manualRowMove_mjs__WEBPACK_IMPORTED_MODULE_0__["ManualRowMove"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/manualRowMove/manualRowMove.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualRowMove/manualRowMove.mjs ***! \***************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, ManualRowMove */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManualRowMove", function() { return ManualRowMove; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.timers.js */ "./node_modules/core-js/modules/web.timers.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../pluginHooks.mjs */ "./node_modules/handsontable/pluginHooks.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _ui_backlight_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./ui/backlight.mjs */ "./node_modules/handsontable/plugins/manualRowMove/ui/backlight.mjs"); /* harmony import */ var _ui_guideline_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./ui/guideline.mjs */ "./node_modules/handsontable/plugins/manualRowMove/ui/guideline.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_16__["default"].getSingleton().register('beforeRowMove'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_16__["default"].getSingleton().register('afterRowMove'); var PLUGIN_KEY = 'manualRowMove'; var PLUGIN_PRIORITY = 140; var privatePool = new WeakMap(); var CSS_PLUGIN = 'ht__manualRowMove'; var CSS_SHOW_UI = 'show-ui'; var CSS_ON_MOVING = 'on-moving--rows'; var CSS_AFTER_SELECTION = 'after-selection--rows'; /** * @plugin ManualRowMove * @class ManualRowMove * * @description * This plugin allows to change rows order. To make rows order persistent the {@link options#persistentstate Options#persistentState} * plugin should be enabled. * * API: * - `moveRow` - move single row to the new position. * - `moveRows` - move many rows (as an array of indexes) to the new position. * - `dragRow` - drag single row to the new position. * - `dragRows` - drag many rows (as an array of indexes) to the new position. * * [Documentation](@/guides/rows/row-moving.md) explain differences between drag and move actions. Please keep in mind that if you want apply visual changes, * you have to call manually the `render` method on the instance of Handsontable. * * The plugin creates additional components to make moving possibly using user interface: * - backlight - highlight of selected rows. * - guideline - line which shows where rows has been moved. * * @class ManualRowMove * @plugin ManualRowMove */ var ManualRowMove = /*#__PURE__*/function (_BasePlugin) { _inherits(ManualRowMove, _BasePlugin); var _super = _createSuper(ManualRowMove); function ManualRowMove(hotInstance) { var _this; _classCallCheck(this, ManualRowMove); _this = _super.call(this, hotInstance); /** * Set up WeakMap of plugin to sharing private parameters;. */ privatePool.set(_assertThisInitialized(_this), { rowsToMove: [], pressed: void 0, target: { eventPageY: void 0, coords: void 0, TD: void 0, row: void 0 }, cachedDropIndex: void 0 }); /** * Event Manager object. * * @private * @type {object} */ _this.eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_20__["default"](_assertThisInitialized(_this)); /** * Backlight UI object. * * @private * @type {object} */ _this.backlight = new _ui_backlight_mjs__WEBPACK_IMPORTED_MODULE_21__["default"](hotInstance); /** * Guideline UI object. * * @private * @type {object} */ _this.guideline = new _ui_guideline_mjs__WEBPACK_IMPORTED_MODULE_22__["default"](hotInstance); 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 ManualRowMove#enablePlugin} method is called. * * @returns {boolean} */ _createClass(ManualRowMove, [{ key: "isEnabled", value: function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } this.addHook('beforeOnCellMouseDown', function (event, coords, TD, blockCalculations) { return _this2.onBeforeOnCellMouseDown(event, coords, TD, blockCalculations); }); this.addHook('beforeOnCellMouseOver', function (event, coords, TD, blockCalculations) { return _this2.onBeforeOnCellMouseOver(event, coords, TD, blockCalculations); }); this.addHook('afterScrollHorizontally', function () { return _this2.onAfterScrollHorizontally(); }); this.addHook('afterLoadData', function () { return _this2.onAfterLoadData(); }); this.buildPluginUI(); this.registerEvents(); // TODO: move adding plugin classname to BasePlugin. Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(this.hot.rootElement, CSS_PLUGIN); _get(_getPrototypeOf(ManualRowMove.prototype), "enablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); this.moveBySettingsOrLoad(); _get(_getPrototypeOf(ManualRowMove.prototype), "updatePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.hot.rootElement, CSS_PLUGIN); this.unregisterEvents(); this.backlight.destroy(); this.guideline.destroy(); _get(_getPrototypeOf(ManualRowMove.prototype), "disablePlugin", this).call(this); } /** * Moves a single row. * * @param {number} row Visual row index to be moved. * @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements will be placed after the moving action. * To check the visualization of the final index, please take a look at [documentation](@/guides/rows/row-moving.md#drag-and-move-actions-of-manualrowmove-plugin). * @fires Hooks#beforeRowMove * @fires Hooks#afterRowMove * @returns {boolean} */ }, { key: "moveRow", value: function moveRow(row, finalIndex) { return this.moveRows([row], finalIndex); } /** * Moves a multiple rows. * * @param {Array} rows Array of visual row indexes to be moved. * @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements will be placed after the moving action. * To check the visualization of the final index, please take a look at [documentation](@/guides/rows/row-moving.md#drag-and-move-actions-of-manualrowmove-plugin). * @fires Hooks#beforeRowMove * @fires Hooks#afterRowMove * @returns {boolean} */ }, { key: "moveRows", value: function moveRows(rows, finalIndex) { var priv = privatePool.get(this); var dropIndex = priv.cachedDropIndex; var movePossible = this.isMovePossible(rows, finalIndex); var beforeMoveHook = this.hot.runHooks('beforeRowMove', rows, finalIndex, dropIndex, movePossible); priv.cachedDropIndex = void 0; if (beforeMoveHook === false) { return; } if (movePossible) { this.hot.rowIndexMapper.moveIndexes(rows, finalIndex); } var movePerformed = movePossible && this.isRowOrderChanged(rows, finalIndex); this.hot.runHooks('afterRowMove', rows, finalIndex, dropIndex, movePossible, movePerformed); return movePerformed; } /** * Drag a single row to drop index position. * * @param {number} row Visual row index to be dragged. * @param {number} dropIndex Visual row index, being a drop index for the moved rows. Points to where we are going to drop the moved elements. * To check visualization of drop index please take a look at [documentation](@/guides/rows/row-moving.md#drag-and-move-actions-of-manualrowmove-plugin). * @fires Hooks#beforeRowMove * @fires Hooks#afterRowMove * @returns {boolean} */ }, { key: "dragRow", value: function dragRow(row, dropIndex) { return this.dragRows([row], dropIndex); } /** * Drag multiple rows to drop index position. * * @param {Array} rows Array of visual row indexes to be dragged. * @param {number} dropIndex Visual row index, being a drop index for the moved rows. Points to where we are going to drop the moved elements. * To check visualization of drop index please take a look at [documentation](@/guides/rows/row-moving.md#drag-and-move-actions-of-manualrowmove-plugin). * @fires Hooks#beforeRowMove * @fires Hooks#afterRowMove * @returns {boolean} */ }, { key: "dragRows", value: function dragRows(rows, dropIndex) { var finalIndex = this.countFinalIndex(rows, dropIndex); var priv = privatePool.get(this); priv.cachedDropIndex = dropIndex; return this.moveRows(rows, finalIndex); } /** * Indicates if it's possible to move rows to the desired position. Some of the actions aren't possible, i.e. You can’t move more than one element to the last position. * * @param {Array} movedRows Array of visual row indexes to be moved. * @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements will be placed after the moving action. * To check the visualization of the final index, please take a look at [documentation](@/guides/rows/row-moving.md#drag-and-move-actions-of-manualrowmove-plugin). * @returns {boolean} */ }, { key: "isMovePossible", value: function isMovePossible(movedRows, finalIndex) { var length = this.hot.rowIndexMapper.getNotTrimmedIndexesLength(); // An attempt to transfer more rows to start destination than is possible (only when moving from the top to the bottom). var tooHighDestinationIndex = movedRows.length + finalIndex > length; var tooLowDestinationIndex = finalIndex < 0; var tooLowMovedRowIndex = movedRows.some(function (movedRow) { return movedRow < 0; }); var tooHighMovedRowIndex = movedRows.some(function (movedRow) { return movedRow >= length; }); if (tooHighDestinationIndex || tooLowDestinationIndex || tooLowMovedRowIndex || tooHighMovedRowIndex) { return false; } return true; } /** * Indicates if order of rows was changed. * * @private * @param {Array} movedRows Array of visual row indexes to be moved. * @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements will be placed after the moving action. * To check the visualization of the final index, please take a look at [documentation](@/guides/rows/row-moving.md#drag-and-move-actions-of-manualrowmove-plugin). * @returns {boolean} */ }, { key: "isRowOrderChanged", value: function isRowOrderChanged(movedRows, finalIndex) { return movedRows.some(function (row, nrOfMovedElement) { return row - nrOfMovedElement !== finalIndex; }); } /** * Count the final row index from the drop index. * * @private * @param {Array} movedRows Array of visual row indexes to be moved. * @param {number} dropIndex Visual row index, being a drop index for the moved rows. * @returns {number} Visual row index, being a start index for the moved rows. */ }, { key: "countFinalIndex", value: function countFinalIndex(movedRows, dropIndex) { var numberOfRowsLowerThanDropIndex = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayReduce"])(movedRows, function (numberOfRows, currentRowIndex) { if (currentRowIndex < dropIndex) { numberOfRows += 1; } return numberOfRows; }, 0); return dropIndex - numberOfRowsLowerThanDropIndex; } /** * Gets the sum of the heights of rows in the provided range. * * @private * @param {number} fromRow Visual row index. * @param {number} toRow Visual row index. * @returns {number} */ }, { key: "getRowsHeight", value: function getRowsHeight(fromRow, toRow) { var rowMapper = this.hot.rowIndexMapper; var rowsHeight = 0; for (var visualRowIndex = fromRow; visualRowIndex <= toRow; visualRowIndex++) { var renderableIndex = rowMapper.getRenderableFromVisualIndex(visualRowIndex); if (renderableIndex !== null) { rowsHeight += this.hot.view.wt.wtTable.getRowHeight(renderableIndex) || 23; } } return rowsHeight; } /** * Loads initial settings when persistent state is saved or when plugin was initialized as an array. * * @private */ }, { key: "moveBySettingsOrLoad", value: function moveBySettingsOrLoad() { var pluginSettings = this.hot.getSettings()[PLUGIN_KEY]; if (Array.isArray(pluginSettings)) { this.moveRows(pluginSettings, 0); } else if (pluginSettings !== void 0) { var persistentState = this.persistentStateLoad(); if (persistentState.length) { this.moveRows(persistentState, 0); } } } /** * Checks if the provided row is in the fixedRowsTop section. * * @private * @param {number} row Visual row index to check. * @returns {boolean} */ }, { key: "isFixedRowTop", value: function isFixedRowTop(row) { return row < this.hot.getSettings().fixedRowsTop; } /** * Checks if the provided row is in the fixedRowsBottom section. * * @private * @param {number} row Visual row index to check. * @returns {boolean} */ }, { key: "isFixedRowBottom", value: function isFixedRowBottom(row) { return row > this.hot.getSettings().fixedRowsBottom; } /** * Saves the manual row positions to the persistent state (the {@link options#persistentstate Options#persistentState} option has to be enabled). * * @private * @fires Hooks#persistentStateSave */ }, { key: "persistentStateSave", value: function persistentStateSave() { // The `PersistentState` plugin should be refactored. this.hot.runHooks('persistentStateSave', 'manualRowMove', this.hot.rowIndexMapper.getIndexesSequence()); } /** * Loads the manual row positions from the persistent state (the {@link options#persistentstate Options#persistentState} option has to be enabled). * * @private * @fires Hooks#persistentStateLoad * @returns {Array} Stored state. */ }, { key: "persistentStateLoad", value: function persistentStateLoad() { var storedState = {}; this.hot.runHooks('persistentStateLoad', 'manualRowMove', storedState); return storedState.value ? storedState.value : []; } /** * Prepares an array of indexes based on actual selection. * * @private * @returns {Array} */ }, { key: "prepareRowsToMoving", value: function prepareRowsToMoving() { var selection = this.hot.getSelectedRangeLast(); var selectedRows = []; if (!selection) { return selectedRows; } var from = selection.from, to = selection.to; var start = Math.min(from.row, to.row); var end = Math.max(from.row, to.row); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_19__["rangeEach"])(start, end, function (i) { selectedRows.push(i); }); return selectedRows; } /** * Update the UI visual position. * * @private */ }, { key: "refreshPositions", value: function refreshPositions() { var priv = privatePool.get(this); var coords = priv.target.coords; var firstVisible = this.hot.view.wt.wtTable.getFirstVisibleRow(); var lastVisible = this.hot.view.wt.wtTable.getLastVisibleRow(); var fixedRows = this.hot.getSettings().fixedRowsTop; var countRows = this.hot.countRows(); if (coords.row < fixedRows && firstVisible > 0) { this.hot.scrollViewportTo(firstVisible - 1); } if (coords.row >= lastVisible && lastVisible < countRows) { this.hot.scrollViewportTo(lastVisible + 1, undefined, true); } var wtTable = this.hot.view.wt.wtTable; var TD = priv.target.TD; var rootElementOffset = Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["offset"])(this.hot.rootElement); var tdOffsetTop = this.hot.view.THEAD.offsetHeight + this.getRowsHeight(0, coords.row - 1); var mouseOffsetTop = priv.target.eventPageY - rootElementOffset.top + wtTable.holder.scrollTop; var hiderHeight = wtTable.hider.offsetHeight; var tbodyOffsetTop = wtTable.TBODY.offsetTop; var backlightElemMarginTop = this.backlight.getOffset().top; var backlightElemHeight = this.backlight.getSize().height; if (this.isFixedRowTop(coords.row)) { tdOffsetTop += wtTable.holder.scrollTop; } // todo: fixedRowsBottom // if (this.isFixedRowBottom(coords.row)) { // // } if (coords.row < 0) { // if hover on colHeader priv.target.row = firstVisible > 0 ? firstVisible - 1 : firstVisible; } else if (TD.offsetHeight / 2 + tdOffsetTop <= mouseOffsetTop) { // if hover on lower part of TD priv.target.row = coords.row + 1; // unfortunately first row is bigger than rest tdOffsetTop += coords.row === 0 ? TD.offsetHeight - 1 : TD.offsetHeight; } else { // elsewhere on table priv.target.row = coords.row; } var backlightTop = mouseOffsetTop; var guidelineTop = tdOffsetTop; if (mouseOffsetTop + backlightElemHeight + backlightElemMarginTop >= hiderHeight) { // prevent display backlight below table backlightTop = hiderHeight - backlightElemHeight - backlightElemMarginTop; } else if (mouseOffsetTop + backlightElemMarginTop < tbodyOffsetTop) { // prevent display above below table backlightTop = tbodyOffsetTop + Math.abs(backlightElemMarginTop); } if (tdOffsetTop >= hiderHeight - 1) { // prevent display guideline below table guidelineTop = hiderHeight - 1; } var topOverlayHeight = 0; if (this.hot.view.wt.wtOverlays.topOverlay) { topOverlayHeight = this.hot.view.wt.wtOverlays.topOverlay.clone.wtTable.TABLE.offsetHeight; } if (coords.row >= fixedRows && guidelineTop - wtTable.holder.scrollTop < topOverlayHeight) { this.hot.scrollViewportTo(coords.row); } this.backlight.setPosition(backlightTop); this.guideline.setPosition(guidelineTop); } /** * Binds the events used by the plugin. * * @private */ }, { key: "registerEvents", value: function registerEvents() { var _this3 = this; var documentElement = this.hot.rootDocument.documentElement; this.eventManager.addEventListener(documentElement, 'mousemove', function (event) { return _this3.onMouseMove(event); }); this.eventManager.addEventListener(documentElement, 'mouseup', function () { return _this3.onMouseUp(); }); } /** * Unbinds the events used by the plugin. * * @private */ }, { key: "unregisterEvents", value: function unregisterEvents() { this.eventManager.clear(); } /** * Change the behavior of selection / dragging. * * @private * @param {MouseEvent} event `mousedown` event properties. * @param {CellCoords} coords Visual cell coordinates where was fired event. * @param {HTMLElement} TD Cell represented as HTMLElement. * @param {object} blockCalculations Object which contains information about blockCalculation for row, column or cells. */ }, { key: "onBeforeOnCellMouseDown", value: function onBeforeOnCellMouseDown(event, coords, TD, blockCalculations) { var _this$hot$view$wt = this.hot.view.wt, wtTable = _this$hot$view$wt.wtTable, wtViewport = _this$hot$view$wt.wtViewport; var isHeaderSelection = this.hot.selection.isSelectedByRowHeader(); var selection = this.hot.getSelectedRangeLast(); var priv = privatePool.get(this); if (!selection || !isHeaderSelection || priv.pressed || event.button !== 0) { priv.pressed = false; priv.rowsToMove.length = 0; Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]); return; } var guidelineIsNotReady = this.guideline.isBuilt() && !this.guideline.isAppended(); var backlightIsNotReady = this.backlight.isBuilt() && !this.backlight.isAppended(); if (guidelineIsNotReady && backlightIsNotReady) { this.guideline.appendTo(wtTable.hider); this.backlight.appendTo(wtTable.hider); } var from = selection.from, to = selection.to; var start = Math.min(from.row, to.row); var end = Math.max(from.row, to.row); if (coords.col < 0 && coords.row >= start && coords.row <= end) { blockCalculations.row = true; priv.pressed = true; priv.target.eventPageY = event.pageY; priv.target.coords = coords; priv.target.TD = TD; priv.rowsToMove = this.prepareRowsToMoving(); var leftPos = wtTable.holder.scrollLeft + wtViewport.getRowHeaderWidth(); this.backlight.setPosition(null, leftPos); this.backlight.setSize(wtTable.hider.offsetWidth - leftPos, this.getRowsHeight(start, end)); this.backlight.setOffset((this.getRowsHeight(start, coords.row - 1) + event.offsetY) * -1, null); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(this.hot.rootElement, CSS_ON_MOVING); this.refreshPositions(); } else { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.hot.rootElement, CSS_AFTER_SELECTION); priv.pressed = false; priv.rowsToMove.length = 0; } } /** * 'mouseMove' event callback. Fired when pointer move on document.documentElement. * * @private * @param {MouseEvent} event `mousemove` event properties. */ }, { key: "onMouseMove", value: function onMouseMove(event) { var priv = privatePool.get(this); if (!priv.pressed) { return; } // callback for browser which doesn't supports CSS pointer-event: none if (event.target === this.backlight.element) { var height = this.backlight.getSize().height; this.backlight.setSize(null, 0); setTimeout(function () { this.backlight.setPosition(null, height); }); } priv.target.eventPageY = event.pageY; this.refreshPositions(); } /** * 'beforeOnCellMouseOver' hook callback. Fired when pointer was over cell. * * @private * @param {MouseEvent} event `mouseover` event properties. * @param {CellCoords} coords Visual cell coordinates where was fired event. * @param {HTMLElement} TD Cell represented as HTMLElement. * @param {object} blockCalculations Object which contains information about blockCalculation for row, column or cells. */ }, { key: "onBeforeOnCellMouseOver", value: function onBeforeOnCellMouseOver(event, coords, TD, blockCalculations) { var selectedRange = this.hot.getSelectedRangeLast(); var priv = privatePool.get(this); if (!selectedRange || !priv.pressed) { return; } if (priv.rowsToMove.indexOf(coords.row) > -1) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.hot.rootElement, CSS_SHOW_UI); } else { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(this.hot.rootElement, CSS_SHOW_UI); } blockCalculations.row = true; blockCalculations.column = true; blockCalculations.cell = true; priv.target.coords = coords; priv.target.TD = TD; } /** * `onMouseUp` hook callback. * * @private */ }, { key: "onMouseUp", value: function onMouseUp() { var priv = privatePool.get(this); var target = priv.target.row; var rowsLen = priv.rowsToMove.length; priv.pressed = false; priv.backlightHeight = 0; Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI, CSS_AFTER_SELECTION]); if (this.hot.selection.isSelectedByRowHeader()) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(this.hot.rootElement, CSS_AFTER_SELECTION); } if (rowsLen < 1 || target === void 0) { return; } var firstMovedVisualRow = priv.rowsToMove[0]; var firstMovedPhysicalRow = this.hot.toPhysicalRow(firstMovedVisualRow); var movePerformed = this.dragRows(priv.rowsToMove, target); priv.rowsToMove.length = 0; if (movePerformed === true) { this.persistentStateSave(); this.hot.render(); this.hot.view.adjustElementsSize(true); var selectionStart = this.hot.toVisualRow(firstMovedPhysicalRow); var selectionEnd = selectionStart + rowsLen - 1; this.hot.selectRows(selectionStart, selectionEnd); } } /** * `afterScrollHorizontally` hook callback. Fired the table was scrolled horizontally. * * @private */ }, { key: "onAfterScrollHorizontally", value: function onAfterScrollHorizontally() { var wtTable = this.hot.view.wt.wtTable; var headerWidth = this.hot.view.wt.wtViewport.getRowHeaderWidth(); var scrollLeft = wtTable.holder.scrollLeft; var posLeft = headerWidth + scrollLeft; this.backlight.setPosition(null, posLeft); this.backlight.setSize(wtTable.hider.offsetWidth - posLeft); } /** * Builds the plugin's UI. * * @private */ }, { key: "buildPluginUI", value: function buildPluginUI() { this.backlight.build(); this.guideline.build(); } /** * Callback for the `afterLoadData` hook. * * @private */ }, { key: "onAfterLoadData", value: function onAfterLoadData() { this.moveBySettingsOrLoad(); } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { this.backlight.destroy(); this.guideline.destroy(); _get(_getPrototypeOf(ManualRowMove.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return ManualRowMove; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_15__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/manualRowMove/ui/_base.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualRowMove/ui/_base.mjs ***! \**********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var STATE_INITIALIZED = 0; var STATE_BUILT = 1; var STATE_APPENDED = 2; var UNIT = 'px'; /** * @class * @private */ var BaseUI = /*#__PURE__*/function () { function BaseUI(hotInstance) { _classCallCheck(this, BaseUI); /** * 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; } /** * Add created UI elements to table. * * @param {HTMLElement} wrapper Element which are parent for our UI element. */ _createClass(BaseUI, [{ key: "appendTo", value: function appendTo(wrapper) { wrapper.appendChild(this._element); this.state = STATE_APPENDED; } /** * Method for create UI element. Only create, without append to table. */ }, { key: "build", value: function build() { if (this.state !== STATE_INITIALIZED) { return; } this._element = this.hot.rootDocument.createElement('div'); this.state = STATE_BUILT; } /** * Method for remove UI element. */ }, { key: "destroy", value: function destroy() { if (this.isAppended()) { this._element.parentElement.removeChild(this._element); } this._element = null; this.state = STATE_INITIALIZED; } /** * Check if UI element are appended. * * @returns {boolean} */ }, { key: "isAppended", value: function isAppended() { return this.state === STATE_APPENDED; } /** * Check if UI element are built. * * @returns {boolean} */ }, { key: "isBuilt", value: function isBuilt() { return this.state >= STATE_BUILT; } /** * Setter for position. * * @param {number} top New top position of the element. * @param {number} left New left position of the element. */ }, { 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; } } /** * Getter for the element position. * * @returns {object} Object contains left and top position of the element. */ }, { 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. */ }, { key: "setSize", value: function setSize(width, height) { if (width) { this._element.style.width = width + UNIT; } if (height) { this._element.style.height = height + UNIT; } } /** * Getter for the element position. * * @returns {object} Object contains height and width of the element. */ }, { 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 }; } /** * 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. */ }, { key: "setOffset", value: function setOffset(top, left) { if (top) { this._element.style.marginTop = top + UNIT; } if (left) { this._element.style.marginLeft = left + UNIT; } } /** * Getter for the element offset. * * @returns {object} Object contains top and left offset of the element. */ }, { 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 BaseUI; }(); /* harmony default export */ __webpack_exports__["default"] = (BaseUI); /***/ }), /***/ "./node_modules/handsontable/plugins/manualRowMove/ui/backlight.mjs": /*!**************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualRowMove/ui/backlight.mjs ***! \**************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/manualRowMove/ui/_base.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var CSS_CLASSNAME = 'ht__manualRowMove--backlight'; /** * @class BacklightUI * @util */ var BacklightUI = /*#__PURE__*/function (_BaseUI) { _inherits(BacklightUI, _BaseUI); var _super = _createSuper(BacklightUI); function BacklightUI() { _classCallCheck(this, BacklightUI); return _super.apply(this, arguments); } _createClass(BacklightUI, [{ key: "build", value: /** * Custom className on build process. */ function build() { _get(_getPrototypeOf(BacklightUI.prototype), "build", this).call(this); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(this._element, CSS_CLASSNAME); } }]); return BacklightUI; }(_base_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]); /* harmony default export */ __webpack_exports__["default"] = (BacklightUI); /***/ }), /***/ "./node_modules/handsontable/plugins/manualRowMove/ui/guideline.mjs": /*!**************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualRowMove/ui/guideline.mjs ***! \**************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/manualRowMove/ui/_base.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var CSS_CLASSNAME = 'ht__manualRowMove--guideline'; /** * @class GuidelineUI * @util */ var GuidelineUI = /*#__PURE__*/function (_BaseUI) { _inherits(GuidelineUI, _BaseUI); var _super = _createSuper(GuidelineUI); function GuidelineUI() { _classCallCheck(this, GuidelineUI); return _super.apply(this, arguments); } _createClass(GuidelineUI, [{ key: "build", value: /** * Custom className on build process. */ function build() { _get(_getPrototypeOf(GuidelineUI.prototype), "build", this).call(this); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(this._element, CSS_CLASSNAME); } }]); return GuidelineUI; }(_base_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]); /* harmony default export */ __webpack_exports__["default"] = (GuidelineUI); /***/ }), /***/ "./node_modules/handsontable/plugins/manualRowResize/index.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualRowResize/index.mjs ***! \*********************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, ManualRowResize */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _manualRowResize_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./manualRowResize.mjs */ "./node_modules/handsontable/plugins/manualRowResize/manualRowResize.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _manualRowResize_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _manualRowResize_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManualRowResize", function() { return _manualRowResize_mjs__WEBPACK_IMPORTED_MODULE_0__["ManualRowResize"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/manualRowResize/manualRowResize.mjs": /*!*******************************************************************************!*\ !*** ./node_modules/handsontable/plugins/manualRowResize/manualRowResize.mjs ***! \*******************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, ManualRowResize */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManualRowResize", function() { return ManualRowResize; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/web.timers.js */ "./node_modules/core-js/modules/web.timers.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _translations_index_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../translations/index.mjs */ "./node_modules/handsontable/translations/index.mjs"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } // Developer note! Whenever you make a change in this file, make an analogous change in manualColumnResize.js var PLUGIN_KEY = 'manualRowResize'; var PLUGIN_PRIORITY = 30; var PERSISTENT_STATE_KEY = 'manualRowHeights'; var privatePool = new WeakMap(); /** * @plugin ManualRowResize * @class ManualRowResize * * @description * This plugin allows to change rows height. To make rows height persistent the {@link Options#persistentState} * plugin should be enabled. * * The plugin creates additional components to make resizing possibly using user interface: * - handle - the draggable element that sets the desired height of the row. * - guide - the helper guide that shows the desired height as a horizontal guide. */ var ManualRowResize = /*#__PURE__*/function (_BasePlugin) { _inherits(ManualRowResize, _BasePlugin); var _super = _createSuper(ManualRowResize); function ManualRowResize(hotInstance) { var _this; _classCallCheck(this, ManualRowResize); _this = _super.call(this, hotInstance); var rootDocument = _this.hot.rootDocument; _this.currentTH = null; _this.currentRow = null; _this.selectedRows = []; _this.currentHeight = null; _this.newSize = null; _this.startY = null; _this.startHeight = null; _this.startOffset = null; _this.handle = rootDocument.createElement('DIV'); _this.guide = rootDocument.createElement('DIV'); _this.eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_19__["default"](_assertThisInitialized(_this)); _this.pressed = null; _this.dblclick = 0; _this.autoresizeTimeout = null; /** * PhysicalIndexToValueMap to keep and track widths for physical row indexes. * * @private * @type {PhysicalIndexToValueMap} */ _this.rowHeightsMap = void 0; /** * Private pool to save configuration from updateSettings. */ privatePool.set(_assertThisInitialized(_this), { config: void 0 }); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(_this.handle, 'manualRowResizer'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(_this.guide, 'manualRowResizerGuide'); 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 ManualRowResize#enablePlugin} method is called. * * @returns {boolean} */ _createClass(ManualRowResize, [{ key: "isEnabled", value: function isEnabled() { return this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } this.rowHeightsMap = new _translations_index_mjs__WEBPACK_IMPORTED_MODULE_22__["PhysicalIndexToValueMap"](); this.rowHeightsMap.addLocalHook('init', function () { return _this2.onMapInit(); }); this.hot.rowIndexMapper.registerMap(this.pluginName, this.rowHeightsMap); this.addHook('modifyRowHeight', function (height, row) { return _this2.onModifyRowHeight(height, row); }); this.bindEvents(); _get(_getPrototypeOf(ManualRowResize.prototype), "enablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); _get(_getPrototypeOf(ManualRowResize.prototype), "updatePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { var priv = privatePool.get(this); priv.config = this.rowHeightsMap.getValues(); this.hot.rowIndexMapper.unregisterMap(this.pluginName); _get(_getPrototypeOf(ManualRowResize.prototype), "disablePlugin", this).call(this); } /** * Saves the current sizes using the persistentState plugin (the {@link Options#persistentState} option has to be * enabled). * * @fires Hooks#persistentStateSave */ }, { key: "saveManualRowHeights", value: function saveManualRowHeights() { this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, this.rowHeightsMap.getValues()); } /** * Loads the previously saved sizes using the persistentState plugin (the {@link Options#persistentState} option * has be enabled). * * @returns {Array} * @fires Hooks#persistentStateLoad */ }, { key: "loadManualRowHeights", value: function loadManualRowHeights() { var storedState = {}; this.hot.runHooks('persistentStateLoad', PERSISTENT_STATE_KEY, storedState); return storedState.value; } /** * Sets the new height for specified row index. * * @param {number} row Visual row index. * @param {number} height Row height. * @returns {number} Returns new height. */ }, { key: "setManualSize", value: function setManualSize(row, height) { var physicalRow = this.hot.toPhysicalRow(row); var newHeight = Math.max(height, _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_23__["ViewportRowsCalculator"].DEFAULT_HEIGHT); this.rowHeightsMap.setValueAtIndex(physicalRow, newHeight); return newHeight; } /** * Sets the resize handle position. * * @private * @param {HTMLCellElement} TH TH HTML element. */ }, { key: "setupHandlePosition", value: function setupHandlePosition(TH) { var _this3 = this; this.currentTH = TH; var view = this.hot.view; var wt = view.wt; var cellCoords = view.wt.wtTable.getCoords(this.currentTH); var row = cellCoords.row; // Ignore row headers. if (row < 0) { return; } var headerWidth = Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["outerWidth"])(this.currentTH); var box = this.currentTH.getBoundingClientRect(); // Read "fixedRowsTop" and "fixedRowsBottom" through the Walkontable as in that context, the fixed // rows are modified (reduced by the number of hidden rows) by TableView module. var fixedRowTop = row < wt.getSetting('fixedRowsTop'); var fixedRowBottom = row >= view.countNotHiddenRowIndexes(0, 1) - wt.getSetting('fixedRowsBottom'); var relativeHeaderPosition; if (fixedRowTop) { relativeHeaderPosition = wt.wtOverlays.topLeftCornerOverlay.getRelativeCellPosition(this.currentTH, cellCoords.row, cellCoords.col); } else if (fixedRowBottom) { relativeHeaderPosition = wt.wtOverlays.bottomLeftCornerOverlay.getRelativeCellPosition(this.currentTH, cellCoords.row, cellCoords.col); } // If the TH is not a child of the top-left/bottom-left overlay, recalculate using // the left overlay - as this overlay contains the rest of the headers. if (!relativeHeaderPosition) { relativeHeaderPosition = wt.wtOverlays.leftOverlay.getRelativeCellPosition(this.currentTH, cellCoords.row, cellCoords.col); } this.currentRow = this.hot.rowIndexMapper.getVisualFromRenderableIndex(row); this.selectedRows = []; var isFullRowSelected = this.hot.selection.isSelectedByCorner() || this.hot.selection.isSelectedByRowHeader(); if (this.hot.selection.isSelected() && isFullRowSelected) { var selectionRanges = this.hot.getSelectedRange(); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(selectionRanges, function (selectionRange) { var fromRow = selectionRange.getTopLeftCorner().row; var toRow = selectionRange.getBottomLeftCorner().row; // Add every selected row for resize action. Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_21__["rangeEach"])(fromRow, toRow, function (rowIndex) { if (!_this3.selectedRows.includes(rowIndex)) { _this3.selectedRows.push(rowIndex); } }); }); } // Resizing element beyond the current selection (also when there is no selection). if (!this.selectedRows.includes(this.currentRow)) { this.selectedRows = [this.currentRow]; } this.startOffset = relativeHeaderPosition.top - 6; this.startHeight = parseInt(box.height, 10); this.handle.style.top = "".concat(this.startOffset + this.startHeight, "px"); this.handle.style.left = "".concat(relativeHeaderPosition.left, "px"); this.handle.style.width = "".concat(headerWidth, "px"); this.hot.rootElement.appendChild(this.handle); } /** * Refresh the resize handle position. * * @private */ }, { key: "refreshHandlePosition", value: function refreshHandlePosition() { this.handle.style.top = "".concat(this.startOffset + this.currentHeight, "px"); } /** * Sets the resize guide position. * * @private */ }, { key: "setupGuidePosition", value: function setupGuidePosition() { var handleWidth = parseInt(Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["outerWidth"])(this.handle), 10); var handleRightPosition = parseInt(this.handle.style.left, 10) + handleWidth; var maximumVisibleElementWidth = parseInt(this.hot.view.maximumVisibleElementWidth(0), 10); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(this.handle, 'active'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(this.guide, 'active'); this.guide.style.top = this.handle.style.top; this.guide.style.left = "".concat(handleRightPosition, "px"); this.guide.style.width = "".concat(maximumVisibleElementWidth - handleWidth, "px"); this.hot.rootElement.appendChild(this.guide); } /** * Refresh the resize guide position. * * @private */ }, { key: "refreshGuidePosition", value: function refreshGuidePosition() { this.guide.style.top = this.handle.style.top; } /** * Hides both the resize handle and resize guide. * * @private */ }, { key: "hideHandleAndGuide", value: function hideHandleAndGuide() { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.handle, 'active'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(this.guide, 'active'); } /** * Checks if provided element is considered as a row header. * * @private * @param {HTMLElement} element HTML element. * @returns {boolean} */ }, { key: "checkIfRowHeader", value: function checkIfRowHeader(element) { var _element$parentNode, _element$parentNode$p; var thElement = Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["closest"])(element, ['TH'], this.hot.rootElement); return thElement && ((_element$parentNode = element.parentNode) === null || _element$parentNode === void 0 ? void 0 : (_element$parentNode$p = _element$parentNode.parentNode) === null || _element$parentNode$p === void 0 ? void 0 : _element$parentNode$p.tagName) === 'TBODY'; } /** * Gets the TH element from the provided element. * * @private * @param {HTMLElement} element HTML element. * @returns {HTMLElement} */ }, { key: "getClosestTHParent", value: function getClosestTHParent(element) { if (element.tagName !== 'TABLE') { if (element.tagName === 'TH') { return element; } return this.getClosestTHParent(element.parentNode); } return null; } /** * Returns the actual height for the provided row index. * * @private * @param {number} row Visual row index. * @returns {number} Actual row height. */ }, { key: "getActualRowHeight", value: function getActualRowHeight(row) { // TODO: this should utilize `this.hot.getRowHeight` after it's fixed and working properly. var walkontableHeight = this.hot.view.wt.wtTable.getRowHeight(row); if (walkontableHeight !== void 0 && this.newSize < walkontableHeight) { return walkontableHeight; } return this.newSize; } /** * 'mouseover' event callback - set the handle position. * * @private * @param {MouseEvent} event The mouse event. */ }, { key: "onMouseOver", value: function onMouseOver(event) { // Workaround for #6926 - if the `event.target` is temporarily detached, we can skip this callback and wait for // the next `onmouseover`. if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["isDetached"])(event.target)) { return; } if (this.checkIfRowHeader(event.target)) { var th = this.getClosestTHParent(event.target); if (th) { if (!this.pressed) { this.setupHandlePosition(th); } } } } /** * Auto-size row after doubleclick - callback. * * @private * @fires Hooks#beforeRowResize * @fires Hooks#afterRowResize */ }, { key: "afterMouseDownTimeout", value: function afterMouseDownTimeout() { var _this4 = this; var render = function render() { _this4.hot.forceFullRender = true; _this4.hot.view.render(); // updates all _this4.hot.view.adjustElementsSize(true); }; var resize = function resize(row, forceRender) { var hookNewSize = _this4.hot.runHooks('beforeRowResize', _this4.getActualRowHeight(row), row, true); if (hookNewSize !== void 0) { _this4.newSize = hookNewSize; } _this4.setManualSize(row, _this4.newSize); // double click sets auto row size _this4.hot.runHooks('afterRowResize', _this4.getActualRowHeight(row), row, true); if (forceRender) { render(); } }; if (this.dblclick >= 2) { var selectedRowsLength = this.selectedRows.length; if (selectedRowsLength > 1) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.selectedRows, function (selectedRow) { resize(selectedRow); }); render(); } else { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.selectedRows, function (selectedRow) { resize(selectedRow, true); }); } } this.dblclick = 0; this.autoresizeTimeout = null; } /** * 'mousedown' event callback. * * @private * @param {MouseEvent} event The mouse event. */ }, { key: "onMouseDown", value: function onMouseDown(event) { var _this5 = this; if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["hasClass"])(event.target, 'manualRowResizer')) { this.setupHandlePosition(this.currentTH); this.setupGuidePosition(); this.pressed = true; if (this.autoresizeTimeout === null) { this.autoresizeTimeout = setTimeout(function () { return _this5.afterMouseDownTimeout(); }, 500); this.hot._registerTimeout(this.autoresizeTimeout); } this.dblclick += 1; this.startY = event.pageY; this.newSize = this.startHeight; } } /** * 'mousemove' event callback - refresh the handle and guide positions, cache the new row height. * * @private * @param {MouseEvent} event The mouse event. */ }, { key: "onMouseMove", value: function onMouseMove(event) { var _this6 = this; if (this.pressed) { this.currentHeight = this.startHeight + (event.pageY - this.startY); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.selectedRows, function (selectedRow) { _this6.newSize = _this6.setManualSize(selectedRow, _this6.currentHeight); }); this.refreshHandlePosition(); this.refreshGuidePosition(); } } /** * 'mouseup' event callback - apply the row resizing. * * @private * * @fires Hooks#beforeRowResize * @fires Hooks#afterRowResize */ }, { key: "onMouseUp", value: function onMouseUp() { var _this7 = this; var render = function render() { _this7.hot.forceFullRender = true; _this7.hot.view.render(); // updates all _this7.hot.view.adjustElementsSize(true); }; var runHooks = function runHooks(row, forceRender) { _this7.hot.runHooks('beforeRowResize', _this7.getActualRowHeight(row), row, false); if (forceRender) { render(); } _this7.saveManualRowHeights(); _this7.hot.runHooks('afterRowResize', _this7.getActualRowHeight(row), row, false); }; if (this.pressed) { this.hideHandleAndGuide(); this.pressed = false; if (this.newSize !== this.startHeight) { var selectedRowsLength = this.selectedRows.length; if (selectedRowsLength > 1) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.selectedRows, function (selectedRow) { runHooks(selectedRow); }); render(); } else { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(this.selectedRows, function (selectedRow) { runHooks(selectedRow, true); }); } } this.setupHandlePosition(this.currentTH); } } /** * Binds the mouse events. * * @private */ }, { key: "bindEvents", value: function bindEvents() { var _this8 = this; var _this$hot = this.hot, rootElement = _this$hot.rootElement, rootWindow = _this$hot.rootWindow; this.eventManager.addEventListener(rootElement, 'mouseover', function (e) { return _this8.onMouseOver(e); }); this.eventManager.addEventListener(rootElement, 'mousedown', function (e) { return _this8.onMouseDown(e); }); this.eventManager.addEventListener(rootWindow, 'mousemove', function (e) { return _this8.onMouseMove(e); }); this.eventManager.addEventListener(rootWindow, 'mouseup', function () { return _this8.onMouseUp(); }); } /** * Modifies the provided row height, based on the plugin settings. * * @private * @param {number} height Row height. * @param {number} row Visual row index. * @returns {number} */ }, { key: "onModifyRowHeight", value: function onModifyRowHeight(height, row) { var newHeight = height; if (this.enabled) { var physicalRow = this.hot.toPhysicalRow(row); var rowHeight = this.rowHeightsMap.getValueAtIndex(physicalRow); if (this.hot.getSettings()[PLUGIN_KEY] && rowHeight) { newHeight = rowHeight; } } return newHeight; } /** * Callback to call on map's `init` local hook. * * @private */ }, { key: "onMapInit", value: function onMapInit() { var _this9 = this; var priv = privatePool.get(this); var initialSetting = this.hot.getSettings()[PLUGIN_KEY]; var loadedManualRowHeights = this.loadManualRowHeights(); this.hot.batchExecution(function () { if (typeof loadedManualRowHeights !== 'undefined') { loadedManualRowHeights.forEach(function (height, index) { _this9.rowHeightsMap.setValueAtIndex(index, height); }); } else if (Array.isArray(initialSetting)) { initialSetting.forEach(function (height, index) { _this9.rowHeightsMap.setValueAtIndex(index, height); }); priv.config = initialSetting; } else if (initialSetting === true && Array.isArray(priv.config)) { priv.config.forEach(function (height, index) { _this9.rowHeightsMap.setValueAtIndex(index, height); }); } }, true); } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { _get(_getPrototypeOf(ManualRowResize.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return ManualRowResize; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_17__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/mergeCells/calculations/autofill.mjs": /*!********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/mergeCells/calculations/autofill.mjs ***! \********************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * Class responsible for all of the Autofill-related operations on merged cells. * * @class AutofillCalculations * @plugin MergeCells * @util */ var AutofillCalculations = /*#__PURE__*/function () { function AutofillCalculations(plugin) { _classCallCheck(this, AutofillCalculations); /** * Reference to the Merge Cells plugin. * * @type {MergeCells} */ this.plugin = plugin; /** * Reference to the MergedCellsCollection class instance. * * @type {MergedCellsCollection} */ this.mergedCellsCollection = this.plugin.mergedCellsCollection; /** * Cache of the currently processed autofill data. * * @private * @type {object} */ this.currentFillData = null; } /** * Correct the provided selection area, so it's not selecting only a part of a merged cell. * * @param {Array} selectionArea The selection to correct. */ _createClass(AutofillCalculations, [{ key: "correctSelectionAreaSize", value: function correctSelectionAreaSize(selectionArea) { if (selectionArea[0] === selectionArea[2] && selectionArea[1] === selectionArea[3]) { var mergedCell = this.mergedCellsCollection.get(selectionArea[0], selectionArea[1]); if (mergedCell) { selectionArea[2] = selectionArea[0] + mergedCell.rowspan - 1; selectionArea[3] = selectionArea[1] + mergedCell.colspan - 1; } } } /** * Get the direction of the autofill process. * * @param {Array} selectionArea The selection area. * @param {Array} finalArea The final area (base + drag). * @returns {string} `up`, `down`, `left` or `right`. */ }, { key: "getDirection", value: function getDirection(selectionArea, finalArea) { var direction = null; if (finalArea[0] === selectionArea[0] && finalArea[1] === selectionArea[1] && finalArea[3] === selectionArea[3]) { direction = 'down'; } else if (finalArea[2] === selectionArea[2] && finalArea[1] === selectionArea[1] && finalArea[3] === selectionArea[3]) { direction = 'up'; } else if (finalArea[1] === selectionArea[1] && finalArea[2] === selectionArea[2]) { direction = 'right'; } else { direction = 'left'; } return direction; } /** * Snap the drag area to the farthest merged cell, so it won't clip any of the merged cells. * * @param {Array} baseArea The base selected area. * @param {Array} dragArea The drag area. * @param {string} dragDirection The autofill drag direction. * @param {Array} foundMergedCells MergeCellCoords found in the base selection area. * @returns {Array} The new drag area. */ }, { key: "snapDragArea", value: function snapDragArea(baseArea, dragArea, dragDirection, foundMergedCells) { var newDragArea = dragArea.slice(0); var fillSize = this.getAutofillSize(baseArea, dragArea, dragDirection); var _baseArea = _slicedToArray(baseArea, 4), baseAreaStartRow = _baseArea[0], baseAreaStartColumn = _baseArea[1], baseAreaEndRow = _baseArea[2], baseAreaEndColumn = _baseArea[3]; var verticalDirection = ['up', 'down'].indexOf(dragDirection) > -1; var fullCycle = verticalDirection ? baseAreaEndRow - baseAreaStartRow + 1 : baseAreaEndColumn - baseAreaStartColumn + 1; var fulls = Math.floor(fillSize / fullCycle) * fullCycle; var partials = fillSize - fulls; var farthestCollection = this.getFarthestCollection(baseArea, dragArea, dragDirection, foundMergedCells); if (farthestCollection) { if (dragDirection === 'down') { var fill = farthestCollection.row + farthestCollection.rowspan - baseAreaStartRow - partials; var newLimit = newDragArea[2] + fill; if (newLimit >= this.plugin.hot.countRows()) { newDragArea[2] -= partials; } else { newDragArea[2] += partials ? fill : 0; } } else if (dragDirection === 'right') { var _fill = farthestCollection.col + farthestCollection.colspan - baseAreaStartColumn - partials; var _newLimit = newDragArea[3] + _fill; if (_newLimit >= this.plugin.hot.countCols()) { newDragArea[3] -= partials; } else { newDragArea[3] += partials ? _fill : 0; } } else if (dragDirection === 'up') { var _fill2 = baseAreaEndRow - partials - farthestCollection.row + 1; var _newLimit2 = newDragArea[0] + _fill2; if (_newLimit2 < 0) { newDragArea[0] += partials; } else { newDragArea[0] -= partials ? _fill2 : 0; } } else if (dragDirection === 'left') { var _fill3 = baseAreaEndColumn - partials - farthestCollection.col + 1; var _newLimit3 = newDragArea[1] + _fill3; if (_newLimit3 < 0) { newDragArea[1] += partials; } else { newDragArea[1] -= partials ? _fill3 : 0; } } } this.updateCurrentFillCache({ baseArea: baseArea, dragDirection: dragDirection, foundMergedCells: foundMergedCells, fillSize: fillSize, dragArea: newDragArea, cycleLength: fullCycle }); return newDragArea; } /** * Update the current fill cache with the provided object. * * @private * @param {object} updateObject The current filled object cache. */ }, { key: "updateCurrentFillCache", value: function updateCurrentFillCache(updateObject) { if (!this.currentFillData) { this.currentFillData = {}; } Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_11__["extend"])(this.currentFillData, updateObject); } /** * Get the "length" of the drag area. * * @private * @param {Array} baseArea The base selection area. * @param {Array} dragArea The drag area (containing the base area). * @param {string} direction The drag direction. * @returns {number|null} The "length" (height or width, depending on the direction) of the drag. */ }, { key: "getAutofillSize", value: function getAutofillSize(baseArea, dragArea, direction) { var _baseArea2 = _slicedToArray(baseArea, 4), baseAreaStartRow = _baseArea2[0], baseAreaStartColumn = _baseArea2[1], baseAreaEndRow = _baseArea2[2], baseAreaEndColumn = _baseArea2[3]; var _dragArea = _slicedToArray(dragArea, 4), dragAreaStartRow = _dragArea[0], dragAreaStartColumn = _dragArea[1], dragAreaEndRow = _dragArea[2], dragAreaEndColumn = _dragArea[3]; switch (direction) { case 'up': return baseAreaStartRow - dragAreaStartRow; case 'down': return dragAreaEndRow - baseAreaEndRow; case 'left': return baseAreaStartColumn - dragAreaStartColumn; case 'right': return dragAreaEndColumn - baseAreaEndColumn; default: return null; } } /** * Trim the default drag area (containing the selection area) to the drag-only area. * * @private * @param {Array} baseArea The base selection area. * @param {Array} dragArea The base selection area extended by the drag area. * @param {string} direction Drag direction. * @returns {Array|null} Array representing the drag area coordinates. */ }, { key: "getDragArea", value: function getDragArea(baseArea, dragArea, direction) { var _baseArea3 = _slicedToArray(baseArea, 4), baseAreaStartRow = _baseArea3[0], baseAreaStartColumn = _baseArea3[1], baseAreaEndRow = _baseArea3[2], baseAreaEndColumn = _baseArea3[3]; var _dragArea2 = _slicedToArray(dragArea, 4), dragAreaStartRow = _dragArea2[0], dragAreaStartColumn = _dragArea2[1], dragAreaEndRow = _dragArea2[2], dragAreaEndColumn = _dragArea2[3]; switch (direction) { case 'up': return [dragAreaStartRow, dragAreaStartColumn, baseAreaStartRow - 1, baseAreaEndColumn]; case 'down': return [baseAreaEndRow + 1, baseAreaStartColumn, dragAreaEndRow, baseAreaEndColumn]; case 'left': return [dragAreaStartRow, dragAreaStartColumn, baseAreaEndRow, baseAreaStartColumn - 1]; case 'right': return [baseAreaStartRow, baseAreaEndColumn + 1, dragAreaEndRow, dragAreaEndColumn]; default: return null; } } /** * Get the to-be-farthest merged cell in the newly filled area. * * @private * @param {Array} baseArea The base selection area. * @param {Array} dragArea The drag area (containing the base area). * @param {string} direction The drag direction. * @param {Array} mergedCellArray Array of the merged cells found in the base area. * @returns {MergedCellCoords|null} */ }, { key: "getFarthestCollection", value: function getFarthestCollection(baseArea, dragArea, direction, mergedCellArray) { var _baseArea4 = _slicedToArray(baseArea, 4), baseAreaStartRow = _baseArea4[0], baseAreaStartColumn = _baseArea4[1], baseAreaEndRow = _baseArea4[2], baseAreaEndColumn = _baseArea4[3]; var verticalDirection = ['up', 'down'].indexOf(direction) > -1; var baseEnd = verticalDirection ? baseAreaEndRow : baseAreaEndColumn; var baseStart = verticalDirection ? baseAreaStartRow : baseAreaStartColumn; var fillSize = this.getAutofillSize(baseArea, dragArea, direction); var fullCycle = verticalDirection ? baseAreaEndRow - baseAreaStartRow + 1 : baseAreaEndColumn - baseAreaStartColumn + 1; var fulls = Math.floor(fillSize / fullCycle) * fullCycle; var partials = fillSize - fulls; var inclusionFunctionName = null; var farthestCollection = null; var endOfDragRecreationIndex = null; switch (direction) { case 'up': inclusionFunctionName = 'includesVertically'; endOfDragRecreationIndex = baseEnd - partials + 1; break; case 'left': inclusionFunctionName = 'includesHorizontally'; endOfDragRecreationIndex = baseEnd - partials + 1; break; case 'down': inclusionFunctionName = 'includesVertically'; endOfDragRecreationIndex = baseStart + partials - 1; break; case 'right': inclusionFunctionName = 'includesHorizontally'; endOfDragRecreationIndex = baseStart + partials - 1; break; default: } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(mergedCellArray, function (currentCollection) { if (currentCollection[inclusionFunctionName](endOfDragRecreationIndex) && currentCollection.isFarther(farthestCollection, direction)) { farthestCollection = currentCollection; } }); return farthestCollection; } /** * Recreate the merged cells after the autofill process. * * @param {Array} changes Changes made. */ }, { key: "recreateAfterDataPopulation", value: function recreateAfterDataPopulation(changes) { if (!this.currentFillData) { return; } var fillRange = this.getRangeFromChanges(changes); var foundMergedCells = this.currentFillData.foundMergedCells; var dragDirection = this.currentFillData.dragDirection; var inBounds = function inBounds(current, offset) { switch (dragDirection) { case 'up': return current.row - offset >= fillRange.from.row; case 'down': return current.row + current.rowspan - 1 + offset <= fillRange.to.row; case 'left': return current.col - offset >= fillRange.from.column; case 'right': return current.col + current.colspan - 1 + offset <= fillRange.to.column; default: return null; } }; var fillOffset = 0; var current = null; var multiplier = 1; do { for (var j = 0; j < foundMergedCells.length; j += 1) { current = foundMergedCells[j]; fillOffset = multiplier * this.currentFillData.cycleLength; if (inBounds(current, fillOffset)) { switch (dragDirection) { case 'up': this.plugin.mergedCellsCollection.add({ row: current.row - fillOffset, rowspan: current.rowspan, col: current.col, colspan: current.colspan }); break; case 'down': this.plugin.mergedCellsCollection.add({ row: current.row + fillOffset, rowspan: current.rowspan, col: current.col, colspan: current.colspan }); break; case 'left': this.plugin.mergedCellsCollection.add({ row: current.row, rowspan: current.rowspan, col: current.col - fillOffset, colspan: current.colspan }); break; case 'right': this.plugin.mergedCellsCollection.add({ row: current.row, rowspan: current.rowspan, col: current.col + fillOffset, colspan: current.colspan }); break; default: } } if (j === foundMergedCells.length - 1) { multiplier += 1; } } } while (inBounds(current, fillOffset)); this.currentFillData = null; this.plugin.hot.render(); } /** * Get the drag range from the changes made. * * @private * @param {Array} changes The changes made. * @returns {object} Object with `from` and `to` properties, both containing `row` and `column` keys. */ }, { key: "getRangeFromChanges", value: function getRangeFromChanges(changes) { var _this = this; var rows = { min: null, max: null }; var columns = { min: null, max: null }; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(changes, function (change) { var rowIndex = change[0]; var columnIndex = _this.plugin.hot.propToCol(change[1]); if (rows.min === null || rowIndex < rows.min) { rows.min = rowIndex; } if (rows.max === null || rowIndex > rows.max) { rows.max = rowIndex; } if (columns.min === null || columnIndex < columns.min) { columns.min = columnIndex; } if (columns.max === null || columnIndex > columns.max) { columns.max = columnIndex; } }); return { from: { row: rows.min, column: columns.min }, to: { row: rows.max, column: columns.max } }; } /** * Check if the drag area contains any merged cells. * * @param {Array} baseArea The base selection area. * @param {Array} fullArea The base area extended by the drag area. * @param {string} direction Drag direction. * @returns {boolean} */ }, { key: "dragAreaOverlapsCollections", value: function dragAreaOverlapsCollections(baseArea, fullArea, direction) { var dragArea = this.getDragArea(baseArea, fullArea, direction); var _dragArea3 = _slicedToArray(dragArea, 4), dragAreaStartRow = _dragArea3[0], dragAreaStartColumn = _dragArea3[1], dragAreaEndRow = _dragArea3[2], dragAreaEndColumn = _dragArea3[3]; var topLeft = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_12__["CellCoords"](dragAreaStartRow, dragAreaStartColumn); var bottomRight = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_12__["CellCoords"](dragAreaEndRow, dragAreaEndColumn); var dragRange = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_12__["CellRange"](topLeft, topLeft, bottomRight); return !!this.mergedCellsCollection.getWithinRange(dragRange, true); } }]); return AutofillCalculations; }(); /* harmony default export */ __webpack_exports__["default"] = (AutofillCalculations); /***/ }), /***/ "./node_modules/handsontable/plugins/mergeCells/calculations/selection.mjs": /*!*********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/mergeCells/calculations/selection.mjs ***! \*********************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * Class responsible for all of the Selection-related operations on merged cells. * * @class SelectionCalculations * @plugin MergeCells * @util */ var SelectionCalculations = /*#__PURE__*/function () { function SelectionCalculations(plugin) { _classCallCheck(this, SelectionCalculations); /** * Reference to the Merge Cells plugin. * * @type {MergeCells} */ this.plugin = plugin; /** * Class name used for fully selected merged cells. * * @type {string} */ this.fullySelectedMergedCellClassName = 'fullySelectedMergedCell'; } /** * "Snap" the delta value according to defined merged cells. (In other words, compensate the rowspan - * e.g. Going up with `delta.row = -1` over a merged cell with `rowspan = 3`, `delta.row` should change to `-3`.). * * @param {object} delta The delta object containing `row` and `col` properties. * @param {CellRange} selectionRange The selection range. * @param {object} mergedCell A merged cell object. */ _createClass(SelectionCalculations, [{ key: "snapDelta", value: function snapDelta(delta, selectionRange, mergedCell) { var cellCoords = selectionRange.to; var newRow = cellCoords.row + delta.row; var newColumn = cellCoords.col + delta.col; if (delta.row) { this.jumpOverMergedCell(delta, mergedCell, newRow); } else if (delta.col) { this.jumpOverMergedCell(delta, mergedCell, newColumn); } } /** * "Jump" over the merged cell (compensate for the indexes within the merged cell to get past it). * * @private * @param {object} delta The delta object. * @param {MergedCellCoords} mergedCell The merge cell object. * @param {number} newIndex New row/column index, created with the delta. */ }, { key: "jumpOverMergedCell", value: function jumpOverMergedCell(delta, mergedCell, newIndex) { var flatDelta = delta.row || delta.col; var includesIndex = null; var firstIndex = null; var lastIndex = null; if (delta.row) { includesIndex = mergedCell.includesVertically(newIndex); firstIndex = mergedCell.row; lastIndex = mergedCell.getLastRow(); } else if (delta.col) { includesIndex = mergedCell.includesHorizontally(newIndex); firstIndex = mergedCell.col; lastIndex = mergedCell.getLastColumn(); } if (flatDelta === 0) { return; } else if (flatDelta > 0) { if (includesIndex && newIndex !== firstIndex) { flatDelta += lastIndex - newIndex + 1; } } else if (includesIndex && newIndex !== lastIndex) { flatDelta -= newIndex - firstIndex + 1; } if (delta.row) { delta.row = flatDelta; } else if (delta.col) { delta.col = flatDelta; } } /** * Get a selection range with `to` property incremented by the provided delta. * * @param {CellRange} oldSelectionRange The base selection range. * @param {object} delta The delta object with `row` and `col` properties. * @returns {CellRange} A new `CellRange` object. */ }, { key: "getUpdatedSelectionRange", value: function getUpdatedSelectionRange(oldSelectionRange, delta) { return new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_3__["CellRange"](oldSelectionRange.highlight, oldSelectionRange.from, new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_3__["CellCoords"](oldSelectionRange.to.row + delta.row, oldSelectionRange.to.col + delta.col)); } /** * Generate an additional class name for the entirely-selected merged cells. * * @param {number} currentRow Visual row index of the currently processed cell. * @param {number} currentColumn Visual column index of the currently cell. * @param {Array} cornersOfSelection Array of the current selection in a form of `[startRow, startColumn, endRow, endColumn]`. * @param {number|undefined} layerLevel Number indicating which layer of selection is currently processed. * @returns {string|undefined} A `String`, which will act as an additional `className` to be added to the currently processed cell. */ }, { key: "getSelectedMergedCellClassName", value: function getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel) { var startRow = Math.min(cornersOfSelection[0], cornersOfSelection[2]); var startColumn = Math.min(cornersOfSelection[1], cornersOfSelection[3]); var endRow = Math.max(cornersOfSelection[0], cornersOfSelection[2]); var endColumn = Math.max(cornersOfSelection[1], cornersOfSelection[3]); if (layerLevel === void 0) { return; } var isFirstRenderableMergedCell = this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(currentRow, currentColumn); // We add extra classes just to the first renderable merged cell. if (!isFirstRenderableMergedCell) { return; } var mergedCell = this.plugin.mergedCellsCollection.get(currentRow, currentColumn); if (!mergedCell) { return; } var mergeRowEnd = mergedCell.getLastRow(); var mergeColumnEnd = mergedCell.getLastColumn(); var fullMergeAreaWithinSelection = startRow <= mergedCell.row && startColumn <= mergedCell.col && endRow >= mergeRowEnd && endColumn >= mergeColumnEnd; if (fullMergeAreaWithinSelection) { return "".concat(this.fullySelectedMergedCellClassName, "-").concat(layerLevel); } else if (this.plugin.selectionCalculations.isMergeCellFullySelected(mergedCell, this.plugin.hot.getSelectedRange())) { // eslint-disable-line max-len return "".concat(this.fullySelectedMergedCellClassName, "-multiple"); } } /** * Check if the provided merged cell is fully selected (by one or many layers of selection). * * @param {MergedCellCoords} mergedCell The merged cell to be processed. * @param {CellRange[]} selectionRangesArray Array of selection ranges. * @returns {boolean} */ }, { key: "isMergeCellFullySelected", value: function isMergeCellFullySelected(mergedCell, selectionRangesArray) { var mergedCellIndividualCoords = []; if (!selectionRangesArray || !mergedCell) { return false; } for (var r = 0; r < mergedCell.rowspan; r += 1) { for (var c = 0; c < mergedCell.colspan; c += 1) { mergedCellIndividualCoords.push(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_3__["CellCoords"](mergedCell.row + r, mergedCell.col + c)); } } for (var i = 0; i < mergedCellIndividualCoords.length; i += 1) { var insideSelections = []; for (var s = 0; s < selectionRangesArray.length; s += 1) { insideSelections[s] = selectionRangesArray[s].includes(mergedCellIndividualCoords[i]); } if (!insideSelections.includes(true)) { return false; } } return true; } /** * Generate an array of the entirely-selected merged cells' class names. * * @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from all the cells in the table. */ }, { key: "getSelectedMergedCellClassNameToRemove", value: function getSelectedMergedCellClassNameToRemove() { var classNames = []; for (var i = 0; i <= 7; i += 1) { classNames.push("".concat(this.fullySelectedMergedCellClassName, "-").concat(i)); } classNames.push("".concat(this.fullySelectedMergedCellClassName, "-multiple")); return classNames; } }]); return SelectionCalculations; }(); /* harmony default export */ __webpack_exports__["default"] = (SelectionCalculations); /***/ }), /***/ "./node_modules/handsontable/plugins/mergeCells/cellCoords.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/plugins/mergeCells/cellCoords.mjs ***! \*********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.freeze.js */ "./node_modules/core-js/modules/es.object.freeze.js"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); /* harmony import */ var _helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers/templateLiteralTag.mjs */ "./node_modules/handsontable/helpers/templateLiteralTag.mjs"); var _templateObject, _templateObject2, _templateObject3, _templateObject4; function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } 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"); } } 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; } /** * The `MergedCellCoords` class represents a single merged cell. * * @class MergedCellCoords * @plugin MergeCells */ var MergedCellCoords = /*#__PURE__*/function () { function MergedCellCoords(row, column, rowspan, colspan) { _classCallCheck(this, MergedCellCoords); /** * The index of the topmost merged cell row. * * @type {number} */ this.row = row; /** * The index of the leftmost column. * * @type {number} */ this.col = column; /** * The `rowspan` value of the merged cell. * * @type {number} */ this.rowspan = rowspan; /** * The `colspan` value of the merged cell. * * @type {number} */ this.colspan = colspan; /** * `true` only if the merged cell is bound to be removed. * * @type {boolean} */ this.removed = false; } /** * Get a warning message for when the declared merged cell data contains negative values. * * @param {object} newMergedCell Object containg information about the merged cells that was about to be added. * @returns {string} */ _createClass(MergedCellCoords, [{ key: "normalize", value: /** * Sanitize (prevent from going outside the boundaries) the merged cell. * * @param {Core} hotInstance The Handsontable instance. */ function normalize(hotInstance) { var totalRows = hotInstance.countRows(); var totalColumns = hotInstance.countCols(); if (this.row < 0) { this.row = 0; } else if (this.row > totalRows - 1) { this.row = totalRows - 1; } if (this.col < 0) { this.col = 0; } else if (this.col > totalColumns - 1) { this.col = totalColumns - 1; } if (this.row + this.rowspan > totalRows - 1) { this.rowspan = totalRows - this.row; } if (this.col + this.colspan > totalColumns - 1) { this.colspan = totalColumns - this.col; } } /** * Returns `true` if the provided coordinates are inside the merged cell. * * @param {number} row The row index. * @param {number} column The column index. * @returns {boolean} */ }, { key: "includes", value: function includes(row, column) { return this.row <= row && this.col <= column && this.row + this.rowspan - 1 >= row && this.col + this.colspan - 1 >= column; } /** * Returns `true` if the provided `column` property is within the column span of the merged cell. * * @param {number} column The column index. * @returns {boolean} */ }, { key: "includesHorizontally", value: function includesHorizontally(column) { return this.col <= column && this.col + this.colspan - 1 >= column; } /** * Returns `true` if the provided `row` property is within the row span of the merged cell. * * @param {number} row Row index. * @returns {boolean} */ }, { key: "includesVertically", value: function includesVertically(row) { return this.row <= row && this.row + this.rowspan - 1 >= row; } /** * Shift (and possibly resize, if needed) the merged cell. * * @param {Array} shiftVector 2-element array containing the information on the shifting in the `x` and `y` axis. * @param {number} indexOfChange Index of the preceding change. * @returns {boolean} Returns `false` if the whole merged cell was removed. */ }, { key: "shift", value: function shift(shiftVector, indexOfChange) { var shiftValue = shiftVector[0] || shiftVector[1]; var shiftedIndex = indexOfChange + Math.abs(shiftVector[0] || shiftVector[1]) - 1; var span = shiftVector[0] ? 'colspan' : 'rowspan'; var index = shiftVector[0] ? 'col' : 'row'; var changeStart = Math.min(indexOfChange, shiftedIndex); var changeEnd = Math.max(indexOfChange, shiftedIndex); var mergeStart = this[index]; var mergeEnd = this[index] + this[span] - 1; if (mergeStart >= indexOfChange) { this[index] += shiftValue; } // adding rows/columns if (shiftValue > 0) { if (indexOfChange <= mergeEnd && indexOfChange > mergeStart) { this[span] += shiftValue; } // removing rows/columns } else if (shiftValue < 0) { // removing the whole merge if (changeStart <= mergeStart && changeEnd >= mergeEnd) { this.removed = true; return false; // removing the merge partially, including the beginning } else if (mergeStart >= changeStart && mergeStart <= changeEnd) { var removedOffset = changeEnd - mergeStart + 1; var preRemovedOffset = Math.abs(shiftValue) - removedOffset; this[index] -= preRemovedOffset + shiftValue; this[span] -= removedOffset; // removing the middle part of the merge } else if (mergeStart <= changeStart && mergeEnd >= changeEnd) { this[span] += shiftValue; // removing the end part of the merge } else if (mergeStart <= changeStart && mergeEnd >= changeStart && mergeEnd < changeEnd) { var removedPart = mergeEnd - changeStart + 1; this[span] -= removedPart; } } return true; } /** * Check if the second provided merged cell is "farther" in the provided direction. * * @param {MergedCellCoords} mergedCell The merged cell to check. * @param {string} direction Drag direction. * @returns {boolean|null} `true` if the second provided merged cell is "farther". */ }, { key: "isFarther", value: function isFarther(mergedCell, direction) { if (!mergedCell) { return true; } if (direction === 'down') { return mergedCell.row + mergedCell.rowspan - 1 < this.row + this.rowspan - 1; } else if (direction === 'up') { return mergedCell.row > this.row; } else if (direction === 'right') { return mergedCell.col + mergedCell.colspan - 1 < this.col + this.colspan - 1; } else if (direction === 'left') { return mergedCell.col > this.col; } return null; } /** * Get the bottom row index of the merged cell. * * @returns {number} */ }, { key: "getLastRow", value: function getLastRow() { return this.row + this.rowspan - 1; } /** * Get the rightmost column index of the merged cell. * * @returns {number} */ }, { key: "getLastColumn", value: function getLastColumn() { return this.col + this.colspan - 1; } /** * Get the range coordinates of the merged cell. * * @returns {CellRange} */ }, { key: "getRange", value: function getRange() { return new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_2__["CellRange"](new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_2__["CellCoords"](this.row, this.col), new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_2__["CellCoords"](this.row, this.col), new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_2__["CellCoords"](this.getLastRow(), this.getLastColumn())); } }], [{ key: "NEGATIVE_VALUES_WARNING", value: function NEGATIVE_VALUES_WARNING(newMergedCell) { return Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_3__["toSingleLine"])(_templateObject || (_templateObject = _taggedTemplateLiteral(["The merged cell declared with {row: ", ", col: ", ", \n rowspan: ", ", colspan: ", "} contains negative values, which is \n not supported. It will not be added to the collection."], ["The merged cell declared with {row: ", ", col: ", ",\\x20\n rowspan: ", ", colspan: ", "} contains negative values, which is\\x20\n not supported. It will not be added to the collection."])), newMergedCell.row, newMergedCell.col, newMergedCell.rowspan, newMergedCell.colspan); } /** * Get a warning message for when the declared merged cell data contains values exceeding the table limits. * * @param {object} newMergedCell Object containg information about the merged cells that was about to be added. * @returns {string} */ }, { key: "IS_OUT_OF_BOUNDS_WARNING", value: function IS_OUT_OF_BOUNDS_WARNING(newMergedCell) { return Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_3__["toSingleLine"])(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["The merged cell declared at [", ", ", "] is positioned \n (or positioned partially) outside of the table range. It was not added to the table, please fix your setup."], ["The merged cell declared at [", ", ", "] is positioned\\x20\n (or positioned partially) outside of the table range. It was not added to the table, please fix your setup."])), newMergedCell.row, newMergedCell.col); } /** * Get a warning message for when the declared merged cell data represents a single cell. * * @param {object} newMergedCell Object containg information about the merged cells that was about to be added. * @returns {string} */ }, { key: "IS_SINGLE_CELL", value: function IS_SINGLE_CELL(newMergedCell) { return Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_3__["toSingleLine"])(_templateObject3 || (_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\"\\x20\n and \"colspan\" declared as \"1\", which makes it a single cell. It cannot be added to the collection."])), newMergedCell.row, newMergedCell.col); } /** * Get a warning message for when the declared merged cell data contains "colspan" or "rowspan", that equals 0. * * @param {object} newMergedCell Object containg information about the merged cells that was about to be added. * @returns {string} */ }, { key: "ZERO_SPAN_WARNING", value: function ZERO_SPAN_WARNING(newMergedCell) { return Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_3__["toSingleLine"])(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["The merged cell declared at [", ", ", "] has \"rowspan\" \n or \"colspan\" declared as \"0\", which is not supported. It cannot be added to the collection."], ["The merged cell declared at [", ", ", "] has \"rowspan\"\\x20\n or \"colspan\" declared as \"0\", which is not supported. It cannot be added to the collection."])), newMergedCell.row, newMergedCell.col); } /** * Check whether the values provided for a merged cell contain any negative values. * * @param {object} mergedCellInfo Object containing the `row`, `col`, `rowspan` and `colspan` properties. * @returns {boolean} */ }, { key: "containsNegativeValues", value: function containsNegativeValues(mergedCellInfo) { return mergedCellInfo.row < 0 || mergedCellInfo.col < 0 || mergedCellInfo.rowspan < 0 || mergedCellInfo.colspan < 0; } /** * Check whether the provided merged cell information object represents a single cell. * * @private * @param {object} mergedCellInfo An object with `row`, `col`, `rowspan` and `colspan` properties. * @returns {boolean} */ }, { key: "isSingleCell", value: function isSingleCell(mergedCellInfo) { return mergedCellInfo.colspan === 1 && mergedCellInfo.rowspan === 1; } /** * Check whether the provided merged cell information object contains a rowspan or colspan of 0. * * @private * @param {object} mergedCellInfo An object with `row`, `col`, `rowspan` and `colspan` properties. * @returns {boolean} */ }, { key: "containsZeroSpan", value: function containsZeroSpan(mergedCellInfo) { return mergedCellInfo.colspan === 0 || mergedCellInfo.rowspan === 0; } /** * Check whether the provided merged cell object is to be declared out of bounds of the table. * * @param {object} mergeCell Object containing the `row`, `col`, `rowspan` and `colspan` properties. * @param {number} rowCount Number of rows in the table. * @param {number} columnCount Number of rows in the table. * @returns {boolean} */ }, { key: "isOutOfBounds", value: function isOutOfBounds(mergeCell, rowCount, columnCount) { return mergeCell.row < 0 || mergeCell.col < 0 || mergeCell.row >= rowCount || mergeCell.row + mergeCell.rowspan - 1 >= rowCount || mergeCell.col >= columnCount || mergeCell.col + mergeCell.colspan - 1 >= columnCount; } }]); return MergedCellCoords; }(); /* harmony default export */ __webpack_exports__["default"] = (MergedCellCoords); /***/ }), /***/ "./node_modules/handsontable/plugins/mergeCells/cellsCollection.mjs": /*!**************************************************************************!*\ !*** ./node_modules/handsontable/plugins/mergeCells/cellsCollection.mjs ***! \**************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.object.freeze.js */ "./node_modules/core-js/modules/es.object.freeze.js"); /* harmony import */ var _cellCoords_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./cellCoords.mjs */ "./node_modules/handsontable/plugins/mergeCells/cellCoords.mjs"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_console_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../helpers/console.mjs */ "./node_modules/handsontable/helpers/console.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/handsontable/plugins/mergeCells/utils.mjs"); /* harmony import */ var _helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../helpers/templateLiteralTag.mjs */ "./node_modules/handsontable/helpers/templateLiteralTag.mjs"); var _templateObject; function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * Defines a container object for the merged cells. * * @class MergedCellsCollection * @plugin MergeCells */ var MergedCellsCollection = /*#__PURE__*/function () { function MergedCellsCollection(plugin) { _classCallCheck(this, MergedCellsCollection); /** * Reference to the Merge Cells plugin. * * @type {MergeCells} */ this.plugin = plugin; /** * Array of merged cells. * * @type {Array} */ this.mergedCells = []; /** * The Handsontable instance. * * @type {Handsontable} */ this.hot = plugin.hot; } /** * Get a warning message for when the declared merged cell data overlaps already existing merged cells. * * @param {object} newMergedCell Object containg information about the merged cells that was about to be added. * @returns {string} */ _createClass(MergedCellsCollection, [{ key: "get", value: /** * Get a merged cell from the container, based on the provided arguments. You can provide either the "starting coordinates" * of a merged cell, or any coordinates from the body of the merged cell. * * @param {number} row Row index. * @param {number} column Column index. * @returns {MergedCellCoords|boolean} Returns a wanted merged cell on success and `false` on failure. */ function get(row, column) { var mergedCells = this.mergedCells; var result = false; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayEach"])(mergedCells, function (mergedCell) { if (mergedCell.row <= row && mergedCell.row + mergedCell.rowspan - 1 >= row && mergedCell.col <= column && mergedCell.col + mergedCell.colspan - 1 >= column) { result = mergedCell; return false; } return true; }); return result; } /** * Get a merged cell containing the provided range. * * @param {CellRange|object} range The range to search merged cells for. * @returns {MergedCellCoords|boolean} */ }, { key: "getByRange", value: function getByRange(range) { var mergedCells = this.mergedCells; var result = false; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayEach"])(mergedCells, function (mergedCell) { if (mergedCell.row <= range.from.row && mergedCell.row + mergedCell.rowspan - 1 >= range.to.row && mergedCell.col <= range.from.col && mergedCell.col + mergedCell.colspan - 1 >= range.to.col) { result = mergedCell; return result; } return true; }); return result; } /** * Get a merged cell contained in the provided range. * * @param {CellRange|object} range The range to search merged cells in. * @param {boolean} [countPartials=false] If set to `true`, all the merged cells overlapping the range will be taken into calculation. * @returns {Array|boolean} Array of found merged cells of `false` if none were found. */ }, { key: "getWithinRange", value: function getWithinRange(range) { var countPartials = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var mergedCells = this.mergedCells; var foundMergedCells = []; var testedRange = range; if (!testedRange.includesRange) { var from = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellCoords"](testedRange.from.row, testedRange.from.col); var to = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellCoords"](testedRange.to.row, testedRange.to.col); testedRange = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellRange"](from, from, to); } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayEach"])(mergedCells, function (mergedCell) { var mergedCellTopLeft = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellCoords"](mergedCell.row, mergedCell.col); var mergedCellBottomRight = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellCoords"](mergedCell.row + mergedCell.rowspan - 1, mergedCell.col + mergedCell.colspan - 1); var mergedCellRange = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellRange"](mergedCellTopLeft, mergedCellTopLeft, mergedCellBottomRight); if (countPartials) { if (testedRange.overlaps(mergedCellRange)) { foundMergedCells.push(mergedCell); } } else if (testedRange.includesRange(mergedCellRange)) { foundMergedCells.push(mergedCell); } }); return foundMergedCells.length ? foundMergedCells : false; } /** * Add a merged cell to the container. * * @param {object} mergedCellInfo The merged cell information object. Has to contain `row`, `col`, `colspan` and `rowspan` properties. * @returns {MergedCellCoords|boolean} Returns the new merged cell on success and `false` on failure. */ }, { key: "add", value: function add(mergedCellInfo) { var mergedCells = this.mergedCells; var row = mergedCellInfo.row; var column = mergedCellInfo.col; var rowspan = mergedCellInfo.rowspan; var colspan = mergedCellInfo.colspan; var newMergedCell = new _cellCoords_mjs__WEBPACK_IMPORTED_MODULE_13__["default"](row, column, rowspan, colspan); var alreadyExists = this.get(row, column); var isOverlapping = this.isOverlapping(newMergedCell); if (!alreadyExists && !isOverlapping) { if (this.hot) { newMergedCell.normalize(this.hot); } mergedCells.push(newMergedCell); return newMergedCell; } Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_16__["warn"])(MergedCellsCollection.IS_OVERLAPPING_WARNING(newMergedCell)); return false; } /** * Remove a merged cell from the container. You can provide either the "starting coordinates" * of a merged cell, or any coordinates from the body of the merged cell. * * @param {number} row Row index. * @param {number} column Column index. * @returns {MergedCellCoords|boolean} Returns the removed merged cell on success and `false` on failure. */ }, { key: "remove", value: function remove(row, column) { var mergedCells = this.mergedCells; var wantedCollection = this.get(row, column); var wantedCollectionIndex = wantedCollection ? this.mergedCells.indexOf(wantedCollection) : null; if (wantedCollection && wantedCollectionIndex !== false) { mergedCells.splice(wantedCollectionIndex, 1); return wantedCollection; } return false; } /** * Clear all the merged cells. */ }, { key: "clear", value: function clear() { var _this = this; var mergedCells = this.mergedCells; var mergedCellParentsToClear = []; var hiddenCollectionElements = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayEach"])(mergedCells, function (mergedCell) { var TD = _this.hot.getCell(mergedCell.row, mergedCell.col); if (TD) { mergedCellParentsToClear.push([TD, _this.get(mergedCell.row, mergedCell.col), mergedCell.row, mergedCell.col]); } }); this.mergedCells.length = 0; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayEach"])(mergedCellParentsToClear, function (mergedCell, i) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_15__["rangeEach"])(0, mergedCell.rowspan - 1, function (j) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_15__["rangeEach"])(0, mergedCell.colspan - 1, function (k) { if (k !== 0 || j !== 0) { var TD = _this.hot.getCell(mergedCell.row + j, mergedCell.col + k); if (TD) { hiddenCollectionElements.push([TD, null, null, null]); } } }); }); mergedCellParentsToClear[i][1] = null; }); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayEach"])(mergedCellParentsToClear, function (mergedCellParents) { _utils_mjs__WEBPACK_IMPORTED_MODULE_18__["applySpanProperties"].apply(void 0, _toConsumableArray(mergedCellParents)); }); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayEach"])(hiddenCollectionElements, function (hiddenCollectionElement) { _utils_mjs__WEBPACK_IMPORTED_MODULE_18__["applySpanProperties"].apply(void 0, _toConsumableArray(hiddenCollectionElement)); }); } /** * Check if the provided merged cell overlaps with the others in the container. * * @param {MergedCellCoords} mergedCell The merged cell to check against all others in the container. * @returns {boolean} `true` if the provided merged cell overlaps with the others, `false` otherwise. */ }, { key: "isOverlapping", value: function isOverlapping(mergedCell) { var mergedCellRange = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellRange"](new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellCoords"](0, 0), new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellCoords"](mergedCell.row, mergedCell.col), new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellCoords"](mergedCell.row + mergedCell.rowspan - 1, mergedCell.col + mergedCell.colspan - 1)); var result = false; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayEach"])(this.mergedCells, function (col) { var currentRange = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellRange"](new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellCoords"](0, 0), new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellCoords"](col.row, col.col), new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellCoords"](col.row + col.rowspan - 1, col.col + col.colspan - 1)); if (currentRange.overlaps(mergedCellRange)) { result = true; return false; } return true; }); return result; } /** * Check whether the provided row/col coordinates direct to a first not hidden cell within merge area. * * @param {number} row Visual row index. * @param {number} column Visual column index. * @returns {boolean} */ }, { key: "isFirstRenderableMergedCell", value: function isFirstRenderableMergedCell(row, column) { var mergeParent = this.get(row, column); // Return if row and column indexes are within merge area and if they are first rendered indexes within the area. return mergeParent && this.hot.rowIndexMapper.getFirstNotHiddenIndex(mergeParent.row, 1) === row && this.hot.columnIndexMapper.getFirstNotHiddenIndex(mergeParent.col, 1) === column; } /** * Get the first renderable coords of the merged cell at the provided coordinates. * * @param {number} row Visual row index. * @param {number} column Visual column index. * @returns {CellCoords} A `CellCoords` object with the coordinates to the first renderable cell within the * merged cell. */ }, { key: "getFirstRenderableCoords", value: function getFirstRenderableCoords(row, column) { var mergeParent = this.get(row, column); if (!mergeParent || this.isFirstRenderableMergedCell(row, column)) { return new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellCoords"](row, column); } var firstRenderableRow = this.hot.rowIndexMapper.getFirstNotHiddenIndex(mergeParent.row, 1); var firstRenderableColumn = this.hot.columnIndexMapper.getFirstNotHiddenIndex(mergeParent.col, 1); return new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellCoords"](firstRenderableRow, firstRenderableColumn); } /** * Shift the merged cell in the direction and by an offset defined in the arguments. * * @param {string} direction `right`, `left`, `up` or `down`. * @param {number} index Index where the change, which caused the shifting took place. * @param {number} count Number of rows/columns added/removed in the preceding action. */ }, { key: "shiftCollections", value: function shiftCollections(direction, index, count) { var _this2 = this; var shiftVector = [0, 0]; switch (direction) { case 'right': shiftVector[0] += count; break; case 'left': shiftVector[0] -= count; break; case 'down': shiftVector[1] += count; break; case 'up': shiftVector[1] -= count; break; default: } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayEach"])(this.mergedCells, function (currentMerge) { currentMerge.shift(shiftVector, index); }); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_15__["rangeEachReverse"])(this.mergedCells.length - 1, 0, function (i) { var currentMerge = _this2.mergedCells[i]; if (currentMerge && currentMerge.removed) { _this2.mergedCells.splice(_this2.mergedCells.indexOf(currentMerge), 1); } }); } }], [{ key: "IS_OVERLAPPING_WARNING", value: function IS_OVERLAPPING_WARNING(newMergedCell) { return Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_19__["toSingleLine"])(_templateObject || (_templateObject = _taggedTemplateLiteral(["The merged cell declared at [", ", ", "], overlaps \n with the other declared merged cell. The overlapping merged cell was not added to the table, please \n fix your setup."], ["The merged cell declared at [", ", ", "], overlaps\\x20\n with the other declared merged cell. The overlapping merged cell was not added to the table, please\\x20\n fix your setup."])), newMergedCell.row, newMergedCell.col); } }]); return MergedCellsCollection; }(); /* harmony default export */ __webpack_exports__["default"] = (MergedCellsCollection); /***/ }), /***/ "./node_modules/handsontable/plugins/mergeCells/contextMenuItem/toggleMerge.mjs": /*!**************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/mergeCells/contextMenuItem/toggleMerge.mjs ***! \**************************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toggleMergeItem; }); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _cellCoords_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../cellCoords.mjs */ "./node_modules/handsontable/plugins/mergeCells/cellCoords.mjs"); /** * @param {*} plugin The plugin instance. * @returns {object} */ function toggleMergeItem(plugin) { return { key: 'mergeCells', name: function name() { var sel = this.getSelectedLast(); if (sel) { var info = plugin.mergedCellsCollection.get(sel[0], sel[1]); if (info.row === sel[0] && info.col === sel[1] && info.row + info.rowspan - 1 === sel[2] && info.col + info.colspan - 1 === sel[3]) { return this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["CONTEXTMENU_ITEMS_UNMERGE_CELLS"]); } } return this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_0__["CONTEXTMENU_ITEMS_MERGE_CELLS"]); }, callback: function callback() { plugin.toggleMergeOnSelection(); }, disabled: function disabled() { var sel = this.getSelectedLast(); if (!sel) { return true; } var isSingleCell = _cellCoords_mjs__WEBPACK_IMPORTED_MODULE_1__["default"].isSingleCell({ row: sel[0], col: sel[1], rowspan: sel[2] - sel[0] + 1, colspan: sel[3] - sel[1] + 1 }); return isSingleCell || this.selection.isSelectedByCorner(); }, hidden: false }; } /***/ }), /***/ "./node_modules/handsontable/plugins/mergeCells/index.mjs": /*!****************************************************************!*\ !*** ./node_modules/handsontable/plugins/mergeCells/index.mjs ***! \****************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, MergeCells */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _mergeCells_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeCells.mjs */ "./node_modules/handsontable/plugins/mergeCells/mergeCells.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _mergeCells_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _mergeCells_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MergeCells", function() { return _mergeCells_mjs__WEBPACK_IMPORTED_MODULE_0__["MergeCells"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/mergeCells/mergeCells.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/plugins/mergeCells/mergeCells.mjs ***! \*********************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, MergeCells */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeCells", function() { return MergeCells; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../pluginHooks.mjs */ "./node_modules/handsontable/pluginHooks.mjs"); /* harmony import */ var _helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../helpers/dom/event.mjs */ "./node_modules/handsontable/helpers/dom/event.mjs"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); /* harmony import */ var _cellsCollection_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./cellsCollection.mjs */ "./node_modules/handsontable/plugins/mergeCells/cellsCollection.mjs"); /* harmony import */ var _cellCoords_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./cellCoords.mjs */ "./node_modules/handsontable/plugins/mergeCells/cellCoords.mjs"); /* harmony import */ var _calculations_autofill_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./calculations/autofill.mjs */ "./node_modules/handsontable/plugins/mergeCells/calculations/autofill.mjs"); /* harmony import */ var _calculations_selection_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./calculations/selection.mjs */ "./node_modules/handsontable/plugins/mergeCells/calculations/selection.mjs"); /* harmony import */ var _contextMenuItem_toggleMerge_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./contextMenuItem/toggleMerge.mjs */ "./node_modules/handsontable/plugins/mergeCells/contextMenuItem/toggleMerge.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_console_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../helpers/console.mjs */ "./node_modules/handsontable/helpers/console.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/handsontable/plugins/mergeCells/utils.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_22__["default"].getSingleton().register('beforeMergeCells'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_22__["default"].getSingleton().register('afterMergeCells'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_22__["default"].getSingleton().register('beforeUnmergeCells'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_22__["default"].getSingleton().register('afterUnmergeCells'); var PLUGIN_KEY = 'mergeCells'; var PLUGIN_PRIORITY = 150; var privatePool = new WeakMap(); /** * @plugin MergeCells * @class MergeCells * * @description * Plugin, which allows merging cells in the table (using the initial configuration, API or context menu). * * @example * * ```js * const hot = new Handsontable(document.getElementById('example'), { * data: getData(), * mergeCells: [ * {row: 0, col: 3, rowspan: 3, colspan: 3}, * {row: 2, col: 6, rowspan: 2, colspan: 2}, * {row: 4, col: 8, rowspan: 3, colspan: 3} * ], * ``` */ var MergeCells = /*#__PURE__*/function (_BasePlugin) { _inherits(MergeCells, _BasePlugin); var _super = _createSuper(MergeCells); function MergeCells(hotInstance) { var _this; _classCallCheck(this, MergeCells); _this = _super.call(this, hotInstance); privatePool.set(_assertThisInitialized(_this), { lastDesiredCoords: null }); /** * A container for all the merged cells. * * @private * @type {MergedCellsCollection} */ _this.mergedCellsCollection = null; /** * Instance of the class responsible for all the autofill-related calculations. * * @private * @type {AutofillCalculations} */ _this.autofillCalculations = null; /** * Instance of the class responsible for the selection-related calculations. * * @private * @type {SelectionCalculations} */ _this.selectionCalculations = 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 MergeCells#enablePlugin} method is called. * * @returns {boolean} */ _createClass(MergeCells, [{ key: "isEnabled", value: function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } this.mergedCellsCollection = new _cellsCollection_mjs__WEBPACK_IMPORTED_MODULE_25__["default"](this); this.autofillCalculations = new _calculations_autofill_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](this); this.selectionCalculations = new _calculations_selection_mjs__WEBPACK_IMPORTED_MODULE_28__["default"](this); this.addHook('afterInit', function () { return _this2.onAfterInit.apply(_this2, arguments); }); this.addHook('beforeKeyDown', function () { return _this2.onBeforeKeyDown.apply(_this2, arguments); }); this.addHook('modifyTransformStart', function () { return _this2.onModifyTransformStart.apply(_this2, arguments); }); this.addHook('afterModifyTransformStart', function () { return _this2.onAfterModifyTransformStart.apply(_this2, arguments); }); this.addHook('modifyTransformEnd', function () { return _this2.onModifyTransformEnd.apply(_this2, arguments); }); this.addHook('modifyGetCellCoords', function () { return _this2.onModifyGetCellCoords.apply(_this2, arguments); }); this.addHook('beforeSetRangeStart', function () { return _this2.onBeforeSetRangeStart.apply(_this2, arguments); }); this.addHook('beforeSetRangeStartOnly', function () { return _this2.onBeforeSetRangeStart.apply(_this2, arguments); }); this.addHook('beforeSetRangeEnd', function () { return _this2.onBeforeSetRangeEnd.apply(_this2, arguments); }); this.addHook('afterIsMultipleSelection', function () { return _this2.onAfterIsMultipleSelection.apply(_this2, arguments); }); this.addHook('afterRenderer', function () { return _this2.onAfterRenderer.apply(_this2, arguments); }); this.addHook('afterContextMenuDefaultOptions', function () { return _this2.addMergeActionsToContextMenu.apply(_this2, arguments); }); this.addHook('afterGetCellMeta', function () { return _this2.onAfterGetCellMeta.apply(_this2, arguments); }); this.addHook('afterViewportRowCalculatorOverride', function () { return _this2.onAfterViewportRowCalculatorOverride.apply(_this2, arguments); }); this.addHook('afterViewportColumnCalculatorOverride', function () { return _this2.onAfterViewportColumnCalculatorOverride.apply(_this2, arguments); }); this.addHook('modifyAutofillRange', function () { return _this2.onModifyAutofillRange.apply(_this2, arguments); }); this.addHook('afterCreateCol', function () { return _this2.onAfterCreateCol.apply(_this2, arguments); }); this.addHook('afterRemoveCol', function () { return _this2.onAfterRemoveCol.apply(_this2, arguments); }); this.addHook('afterCreateRow', function () { return _this2.onAfterCreateRow.apply(_this2, arguments); }); this.addHook('afterRemoveRow', function () { return _this2.onAfterRemoveRow.apply(_this2, arguments); }); this.addHook('afterChange', function () { return _this2.onAfterChange.apply(_this2, arguments); }); this.addHook('beforeDrawBorders', function () { return _this2.onBeforeDrawAreaBorders.apply(_this2, arguments); }); this.addHook('afterDrawSelection', function () { return _this2.onAfterDrawSelection.apply(_this2, arguments); }); this.addHook('beforeRemoveCellClassNames', function () { return _this2.onBeforeRemoveCellClassNames.apply(_this2, arguments); }); this.addHook('beforeUndoStackChange', function (action, source) { if (source === 'MergeCells') { return false; } }); _get(_getPrototypeOf(MergeCells.prototype), "enablePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { this.clearCollections(); this.hot.render(); _get(_getPrototypeOf(MergeCells.prototype), "disablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { var settings = this.hot.getSettings()[PLUGIN_KEY]; this.disablePlugin(); this.enablePlugin(); this.generateFromSettings(settings); _get(_getPrototypeOf(MergeCells.prototype), "updatePlugin", this).call(this); } /** * Validates a single setting object, represented by a single merged cell information object. * * @private * @param {object} setting An object with `row`, `col`, `rowspan` and `colspan` properties. * @returns {boolean} */ }, { key: "validateSetting", value: function validateSetting(setting) { var valid = true; if (!setting) { return false; } if (_cellCoords_mjs__WEBPACK_IMPORTED_MODULE_26__["default"].containsNegativeValues(setting)) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_32__["warn"])(_cellCoords_mjs__WEBPACK_IMPORTED_MODULE_26__["default"].NEGATIVE_VALUES_WARNING(setting)); valid = false; } else if (_cellCoords_mjs__WEBPACK_IMPORTED_MODULE_26__["default"].isOutOfBounds(setting, this.hot.countRows(), this.hot.countCols())) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_32__["warn"])(_cellCoords_mjs__WEBPACK_IMPORTED_MODULE_26__["default"].IS_OUT_OF_BOUNDS_WARNING(setting)); valid = false; } else if (_cellCoords_mjs__WEBPACK_IMPORTED_MODULE_26__["default"].isSingleCell(setting)) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_32__["warn"])(_cellCoords_mjs__WEBPACK_IMPORTED_MODULE_26__["default"].IS_SINGLE_CELL(setting)); valid = false; } else if (_cellCoords_mjs__WEBPACK_IMPORTED_MODULE_26__["default"].containsZeroSpan(setting)) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_32__["warn"])(_cellCoords_mjs__WEBPACK_IMPORTED_MODULE_26__["default"].ZERO_SPAN_WARNING(setting)); valid = false; } return valid; } /** * Generates the merged cells from the settings provided to the plugin. * * @private * @param {Array|boolean} settings The settings provided to the plugin. */ }, { key: "generateFromSettings", value: function generateFromSettings(settings) { var _this3 = this; if (Array.isArray(settings)) { var _this$hot; var populationArgumentsList = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_30__["arrayEach"])(settings, function (setting) { if (!_this3.validateSetting(setting)) { return; } var highlight = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](setting.row, setting.col); var rangeEnd = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](setting.row + setting.rowspan - 1, setting.col + setting.colspan - 1); var mergeRange = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellRange"](highlight, highlight, rangeEnd); populationArgumentsList.push(_this3.mergeRange(mergeRange, true, true)); }); // remove 'empty' setting objects, caused by improper merge range declarations populationArgumentsList = populationArgumentsList.filter(function (value) { return value !== true; }); var bulkPopulationData = this.getBulkCollectionData(populationArgumentsList); (_this$hot = this.hot).populateFromArray.apply(_this$hot, _toConsumableArray(bulkPopulationData)); } } /** * Generates a bulk set of all the data to be populated to fill the data "under" the added merged cells. * * @private * @param {Array} populationArgumentsList Array in a form of `[row, column, dataUnderCollection]`. * @returns {Array} Array in a form of `[row, column, dataOfAllCollections]`. */ }, { key: "getBulkCollectionData", value: function getBulkCollectionData(populationArgumentsList) { var _this$hot2; var populationDataRange = this.getBulkCollectionDataRange(populationArgumentsList); var dataAtRange = (_this$hot2 = this.hot).getData.apply(_this$hot2, _toConsumableArray(populationDataRange)); var newDataAtRange = dataAtRange.splice(0); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_30__["arrayEach"])(populationArgumentsList, function (mergedCellArguments) { var _mergedCellArguments = _slicedToArray(mergedCellArguments, 3), mergedCellRowIndex = _mergedCellArguments[0], mergedCellColumnIndex = _mergedCellArguments[1], mergedCellData = _mergedCellArguments[2]; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_30__["arrayEach"])(mergedCellData, function (mergedCellRow, rowIndex) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_30__["arrayEach"])(mergedCellRow, function (mergedCellElement, columnIndex) { newDataAtRange[mergedCellRowIndex - populationDataRange[0] + rowIndex][mergedCellColumnIndex - populationDataRange[1] + columnIndex] = mergedCellElement; // eslint-disable-line max-len }); }); }); return [populationDataRange[0], populationDataRange[1], newDataAtRange]; } /** * Gets the range of combined data ranges provided in a form of an array of arrays ([row, column, dataUnderCollection]). * * @private * @param {Array} populationArgumentsList Array containing argument lists for the `populateFromArray` method - row, column and data for population. * @returns {Array[]} Start and end coordinates of the merged cell range. (in a form of [rowIndex, columnIndex]). */ }, { key: "getBulkCollectionDataRange", value: function getBulkCollectionDataRange(populationArgumentsList) { var start = [0, 0]; var end = [0, 0]; var mergedCellRow = null; var mergedCellColumn = null; var mergedCellData = null; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_30__["arrayEach"])(populationArgumentsList, function (mergedCellArguments) { mergedCellRow = mergedCellArguments[0]; mergedCellColumn = mergedCellArguments[1]; mergedCellData = mergedCellArguments[2]; start[0] = Math.min(mergedCellRow, start[0]); start[1] = Math.min(mergedCellColumn, start[1]); end[0] = Math.max(mergedCellRow + mergedCellData.length - 1, end[0]); end[1] = Math.max(mergedCellColumn + mergedCellData[0].length - 1, end[1]); }); return [].concat(start, end); } /** * Clears the merged cells from the merged cell container. */ }, { key: "clearCollections", value: function clearCollections() { this.mergedCellsCollection.clear(); } /** * Returns `true` if a range is mergeable. * * @private * @param {object} newMergedCellInfo Merged cell information object to test. * @param {boolean} [auto=false] `true` if triggered at initialization. * @returns {boolean} */ }, { key: "canMergeRange", value: function canMergeRange(newMergedCellInfo) { var auto = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; return auto ? true : this.validateSetting(newMergedCellInfo); } /** * Merge or unmerge, based on last selected range. * * @private */ }, { key: "toggleMergeOnSelection", value: function toggleMergeOnSelection() { var currentRange = this.hot.getSelectedRangeLast(); if (!currentRange) { return; } currentRange.setDirection('NW-SE'); var from = currentRange.from, to = currentRange.to; this.toggleMerge(currentRange); this.hot.selectCell(from.row, from.col, to.row, to.col, false); } /** * Merges the selection provided as a cell range. * * @param {CellRange} [cellRange] Selection cell range. */ }, { key: "mergeSelection", value: function mergeSelection() { var cellRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.hot.getSelectedRangeLast(); if (!cellRange) { return; } cellRange.setDirection('NW-SE'); var from = cellRange.from, to = cellRange.to; this.unmergeRange(cellRange, true); this.mergeRange(cellRange); this.hot.selectCell(from.row, from.col, to.row, to.col, false); } /** * Unmerges the selection provided as a cell range. * * @param {CellRange} [cellRange] Selection cell range. */ }, { key: "unmergeSelection", value: function unmergeSelection() { var cellRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.hot.getSelectedRangeLast(); if (!cellRange) { return; } var from = cellRange.from, to = cellRange.to; this.unmergeRange(cellRange, true); this.hot.selectCell(from.row, from.col, to.row, to.col, false); } /** * Merges cells in the provided cell range. * * @private * @param {CellRange} cellRange Cell range to merge. * @param {boolean} [auto=false] `true` if is called automatically, e.g. At initialization. * @param {boolean} [preventPopulation=false] `true`, if the method should not run `populateFromArray` at the end, but rather return its arguments. * @returns {Array|boolean} Returns an array of [row, column, dataUnderCollection] if preventPopulation is set to true. If the the merging process went successful, it returns `true`, otherwise - `false`. * @fires Hooks#beforeMergeCells * @fires Hooks#afterMergeCells */ }, { key: "mergeRange", value: function mergeRange(cellRange) { var _this4 = this; var auto = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var preventPopulation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var topLeft = cellRange.getTopLeftCorner(); var bottomRight = cellRange.getBottomRightCorner(); var mergeParent = { row: topLeft.row, col: topLeft.col, rowspan: bottomRight.row - topLeft.row + 1, colspan: bottomRight.col - topLeft.col + 1 }; var clearedData = []; var populationInfo = null; if (!this.canMergeRange(mergeParent, auto)) { return false; } this.hot.runHooks('beforeMergeCells', cellRange, auto); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_33__["rangeEach"])(0, mergeParent.rowspan - 1, function (i) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_33__["rangeEach"])(0, mergeParent.colspan - 1, function (j) { var clearedValue = null; if (!clearedData[i]) { clearedData[i] = []; } if (i === 0 && j === 0) { clearedValue = _this4.hot.getDataAtCell(mergeParent.row, mergeParent.col); } else { _this4.hot.setCellMeta(mergeParent.row + i, mergeParent.col + j, 'hidden', true); } clearedData[i][j] = clearedValue; }); }); this.hot.setCellMeta(mergeParent.row, mergeParent.col, 'spanned', true); var mergedCellAdded = this.mergedCellsCollection.add(mergeParent); if (mergedCellAdded) { if (preventPopulation) { populationInfo = [mergeParent.row, mergeParent.col, clearedData]; } else { this.hot.populateFromArray(mergeParent.row, mergeParent.col, clearedData, void 0, void 0, this.pluginName); } this.hot.runHooks('afterMergeCells', cellRange, mergeParent, auto); return populationInfo; } return true; } /** * Unmerges the selection provided as a cell range. If no cell range is provided, it uses the current selection. * * @private * @param {CellRange} cellRange Selection cell range. * @param {boolean} [auto=false] `true` if called automatically by the plugin. * * @fires Hooks#beforeUnmergeCells * @fires Hooks#afterUnmergeCells */ }, { key: "unmergeRange", value: function unmergeRange(cellRange) { var _this5 = this; var auto = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var mergedCells = this.mergedCellsCollection.getWithinRange(cellRange); if (!mergedCells) { return; } this.hot.runHooks('beforeUnmergeCells', cellRange, auto); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_30__["arrayEach"])(mergedCells, function (currentCollection) { _this5.mergedCellsCollection.remove(currentCollection.row, currentCollection.col); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_33__["rangeEach"])(0, currentCollection.rowspan - 1, function (i) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_33__["rangeEach"])(0, currentCollection.colspan - 1, function (j) { _this5.hot.removeCellMeta(currentCollection.row + i, currentCollection.col + j, 'hidden'); }); }); _this5.hot.removeCellMeta(currentCollection.row, currentCollection.col, 'spanned'); }); this.hot.runHooks('afterUnmergeCells', cellRange, auto); this.hot.render(); } /** * Merges or unmerges, based on the cell range provided as `cellRange`. * * @private * @param {CellRange} cellRange The cell range to merge or unmerged. */ }, { key: "toggleMerge", value: function toggleMerge(cellRange) { var mergedCell = this.mergedCellsCollection.get(cellRange.from.row, cellRange.from.col); var mergedCellCoversWholeRange = mergedCell.row === cellRange.from.row && mergedCell.col === cellRange.from.col && mergedCell.row + mergedCell.rowspan - 1 === cellRange.to.row && mergedCell.col + mergedCell.colspan - 1 === cellRange.to.col; if (mergedCellCoversWholeRange) { this.unmergeRange(cellRange); } else { this.mergeSelection(cellRange); } } /** * Merges the specified range. * * @param {number} startRow Start row of the merged cell. * @param {number} startColumn Start column of the merged cell. * @param {number} endRow End row of the merged cell. * @param {number} endColumn End column of the merged cell. * @fires Hooks#beforeMergeCells * @fires Hooks#afterMergeCells */ }, { key: "merge", value: function merge(startRow, startColumn, endRow, endColumn) { var start = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](startRow, startColumn); var end = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](endRow, endColumn); this.mergeRange(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellRange"](start, start, end)); } /** * Unmerges the merged cell in the provided range. * * @param {number} startRow Start row of the merged cell. * @param {number} startColumn Start column of the merged cell. * @param {number} endRow End row of the merged cell. * @param {number} endColumn End column of the merged cell. * @fires Hooks#beforeUnmergeCells * @fires Hooks#afterUnmergeCells */ }, { key: "unmerge", value: function unmerge(startRow, startColumn, endRow, endColumn) { var start = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](startRow, startColumn); var end = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](endRow, endColumn); this.unmergeRange(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellRange"](start, start, end)); } /** * `afterInit` hook callback. * * @private */ }, { key: "onAfterInit", value: function onAfterInit() { this.generateFromSettings(this.hot.getSettings()[PLUGIN_KEY]); this.hot.render(); } /** * `beforeKeyDown` hook callback. * * @private * @param {KeyboardEvent} event The `keydown` event object. */ }, { key: "onBeforeKeyDown", value: function onBeforeKeyDown(event) { var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; if (ctrlDown && event.keyCode === 77) { // CTRL + M this.toggleMerge(this.hot.getSelectedRangeLast()); this.hot.render(); Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_23__["stopImmediatePropagation"])(event); } } /** * Modifies the information on whether the current selection contains multiple cells. The `afterIsMultipleSelection` hook callback. * * @private * @param {boolean} isMultiple Determines whether the current selection contains multiple cells. * @returns {boolean} */ }, { key: "onAfterIsMultipleSelection", value: function onAfterIsMultipleSelection(isMultiple) { if (isMultiple) { var mergedCells = this.mergedCellsCollection.mergedCells; var selectionRange = this.hot.getSelectedRangeLast(); for (var group = 0; group < mergedCells.length; group += 1) { if (selectionRange.from.row === mergedCells[group].row && selectionRange.from.col === mergedCells[group].col && selectionRange.to.row === mergedCells[group].row + mergedCells[group].rowspan - 1 && selectionRange.to.col === mergedCells[group].col + mergedCells[group].colspan - 1) { return false; } } } return isMultiple; } /** * `modifyTransformStart` hook callback. * * @private * @param {object} delta The transformation delta. */ }, { key: "onModifyTransformStart", value: function onModifyTransformStart(delta) { var priv = privatePool.get(this); var currentlySelectedRange = this.hot.getSelectedRangeLast(); var newDelta = { row: delta.row, col: delta.col }; var nextPosition = null; var currentPosition = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](currentlySelectedRange.highlight.row, currentlySelectedRange.highlight.col); var mergedParent = this.mergedCellsCollection.get(currentPosition.row, currentPosition.col); if (!priv.lastDesiredCoords) { priv.lastDesiredCoords = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](null, null); } if (mergedParent) { // only merge selected var mergeTopLeft = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](mergedParent.row, mergedParent.col); var mergeBottomRight = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](mergedParent.row + mergedParent.rowspan - 1, mergedParent.col + mergedParent.colspan - 1); var mergeRange = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellRange"](mergeTopLeft, mergeTopLeft, mergeBottomRight); if (!mergeRange.includes(priv.lastDesiredCoords)) { priv.lastDesiredCoords = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](null, null); // reset outdated version of lastDesiredCoords } newDelta.row = priv.lastDesiredCoords.row ? priv.lastDesiredCoords.row - currentPosition.row : newDelta.row; newDelta.col = priv.lastDesiredCoords.col ? priv.lastDesiredCoords.col - currentPosition.col : newDelta.col; if (delta.row > 0) { // moving down newDelta.row = mergedParent.row + mergedParent.rowspan - 1 - currentPosition.row + delta.row; } else if (delta.row < 0) { // moving up newDelta.row = currentPosition.row - mergedParent.row + delta.row; } if (delta.col > 0) { // moving right newDelta.col = mergedParent.col + mergedParent.colspan - 1 - currentPosition.col + delta.col; } else if (delta.col < 0) { // moving left newDelta.col = currentPosition.col - mergedParent.col + delta.col; } } nextPosition = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](currentlySelectedRange.highlight.row + newDelta.row, currentlySelectedRange.highlight.col + newDelta.col); var nextPositionMergedCell = this.mergedCellsCollection.get(nextPosition.row, nextPosition.col); if (nextPositionMergedCell) { // skipping the invisible cells in the merge range var firstRenderableCoords = this.mergedCellsCollection.getFirstRenderableCoords(nextPositionMergedCell.row, nextPositionMergedCell.col); priv.lastDesiredCoords = nextPosition; newDelta = { row: firstRenderableCoords.row - currentPosition.row, col: firstRenderableCoords.col - currentPosition.col }; } if (newDelta.row !== 0) { delta.row = newDelta.row; } if (newDelta.col !== 0) { delta.col = newDelta.col; } } /** * `modifyTransformEnd` hook callback. Needed to handle "jumping over" merged merged cells, while selecting. * * @private * @param {object} delta The transformation delta. */ }, { key: "onModifyTransformEnd", value: function onModifyTransformEnd(delta) { var _this6 = this; var currentSelectionRange = this.hot.getSelectedRangeLast(); var newDelta = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_31__["clone"])(delta); var newSelectionRange = this.selectionCalculations.getUpdatedSelectionRange(currentSelectionRange, delta); var tempDelta = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_31__["clone"])(newDelta); var mergedCellsWithinRange = this.mergedCellsCollection.getWithinRange(newSelectionRange, true); do { tempDelta = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_31__["clone"])(newDelta); this.selectionCalculations.getUpdatedSelectionRange(currentSelectionRange, newDelta); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_30__["arrayEach"])(mergedCellsWithinRange, function (mergedCell) { _this6.selectionCalculations.snapDelta(newDelta, currentSelectionRange, mergedCell); }); } while (newDelta.row !== tempDelta.row || newDelta.col !== tempDelta.col); delta.row = newDelta.row; delta.col = newDelta.col; } /** * `modifyGetCellCoords` hook callback. Swaps the `getCell` coords with the merged parent coords. * * @private * @param {number} row Row index. * @param {number} column Visual column index. * @returns {Array|undefined} Visual coordinates of the merge. */ }, { key: "onModifyGetCellCoords", value: function onModifyGetCellCoords(row, column) { if (row < 0 || column < 0) { return; } var mergeParent = this.mergedCellsCollection.get(row, column); if (!mergeParent) { return; } var mergeRow = mergeParent.row, mergeColumn = mergeParent.col, colspan = mergeParent.colspan, rowspan = mergeParent.rowspan; return [// Most top-left merged cell coords. mergeRow, mergeColumn, // Most bottom-right merged cell coords. mergeRow + rowspan - 1, mergeColumn + colspan - 1]; } /** * `afterContextMenuDefaultOptions` hook callback. * * @private * @param {object} defaultOptions The default context menu options. */ }, { key: "addMergeActionsToContextMenu", value: function addMergeActionsToContextMenu(defaultOptions) { defaultOptions.items.push({ name: '---------' }, Object(_contextMenuItem_toggleMerge_mjs__WEBPACK_IMPORTED_MODULE_29__["default"])(this)); } /** * `afterRenderer` hook callback. * * @private * @param {HTMLElement} TD The cell to be modified. * @param {number} row Row index. * @param {number} col Visual column index. */ }, { key: "onAfterRenderer", value: function onAfterRenderer(TD, row, col) { var mergedCell = this.mergedCellsCollection.get(row, col); // We shouldn't override data in the collection. var mergedCellCopy = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_31__["isObject"])(mergedCell) ? Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_31__["clone"])(mergedCell) : void 0; if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_31__["isObject"])(mergedCellCopy)) { var _this$hot3 = this.hot, rowMapper = _this$hot3.rowIndexMapper, columnMapper = _this$hot3.columnIndexMapper; var mergeRow = mergedCellCopy.row, mergeColumn = mergedCellCopy.col, colspan = mergedCellCopy.colspan, rowspan = mergedCellCopy.rowspan; var _this$translateMerged = this.translateMergedCellToRenderable(mergeRow, rowspan, mergeColumn, colspan), _this$translateMerged2 = _slicedToArray(_this$translateMerged, 2), lastMergedRowIndex = _this$translateMerged2[0], lastMergedColumnIndex = _this$translateMerged2[1]; var renderedRowIndex = rowMapper.getRenderableFromVisualIndex(row); var renderedColumnIndex = columnMapper.getRenderableFromVisualIndex(col); var maxRowSpan = lastMergedRowIndex - renderedRowIndex + 1; // Number of rendered columns. var maxColSpan = lastMergedColumnIndex - renderedColumnIndex + 1; // Number of rendered columns. // We just try to determine some values basing on the actual number of rendered indexes (some columns may be hidden). mergedCellCopy.row = rowMapper.getFirstNotHiddenIndex(mergedCellCopy.row, 1); // We just try to determine some values basing on the actual number of rendered indexes (some columns may be hidden). mergedCellCopy.col = columnMapper.getFirstNotHiddenIndex(mergedCellCopy.col, 1); // The `rowSpan` property for a `TD` element should be at most equal to number of rendered rows in the merge area. mergedCellCopy.rowspan = Math.min(mergedCellCopy.rowspan, maxRowSpan); // The `colSpan` property for a `TD` element should be at most equal to number of rendered columns in the merge area. mergedCellCopy.colspan = Math.min(mergedCellCopy.colspan, maxColSpan); } Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_34__["applySpanProperties"])(TD, mergedCellCopy, row, col); } /** * `beforeSetRangeStart` and `beforeSetRangeStartOnly` hook callback. * A selection within merge area should be rewritten to the start of merge area. * * @private * @param {object} coords Cell coords. */ }, { key: "onBeforeSetRangeStart", value: function onBeforeSetRangeStart(coords) { // TODO: It is a workaround, but probably this hook may be needed. Every selection on the merge area // could set start point of the selection to the start of the merge area. However, logic inside `expandByRange` need // an initial start point. Click on the merge cell when there are some hidden indexes break the logic in some cases. // Please take a look at #7010 for more information. I'm not sure if selection directions are calculated properly // and what was idea for flipping direction inside `expandByRange` method. if (this.mergedCellsCollection.isFirstRenderableMergedCell(coords.row, coords.col)) { var mergeParent = this.mergedCellsCollection.get(coords.row, coords.col); var _ref = [mergeParent.row, mergeParent.col]; coords.row = _ref[0]; coords.col = _ref[1]; } } /** * `beforeSetRangeEnd` hook callback. * While selecting cells with keyboard or mouse, make sure that rectangular area is expanded to the extent of the merged cell. * * Note: Please keep in mind that callback may modify both start and end range coordinates by the reference. * * @private * @param {object} coords Cell coords. */ }, { key: "onBeforeSetRangeEnd", value: function onBeforeSetRangeEnd(coords) { var selRange = this.hot.getSelectedRangeLast(); selRange.highlight = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_24__["CellCoords"](selRange.highlight.row, selRange.highlight.col); // clone in case we will modify its reference selRange.to = coords; var rangeExpanded = false; if (this.hot.selection.isSelectedByColumnHeader() || this.hot.selection.isSelectedByRowHeader()) { return; } do { rangeExpanded = false; for (var i = 0; i < this.mergedCellsCollection.mergedCells.length; i += 1) { var cellInfo = this.mergedCellsCollection.mergedCells[i]; var mergedCellRange = cellInfo.getRange(); if (selRange.expandByRange(mergedCellRange)) { coords.row = selRange.to.row; coords.col = selRange.to.col; rangeExpanded = true; } } } while (rangeExpanded); } /** * The `afterGetCellMeta` hook callback. * * @private * @param {number} row Row index. * @param {number} col Column index. * @param {object} cellProperties The cell properties object. */ }, { key: "onAfterGetCellMeta", value: function onAfterGetCellMeta(row, col, cellProperties) { var mergeParent = this.mergedCellsCollection.get(row, col); if (mergeParent) { if (mergeParent.row !== row || mergeParent.col !== col) { cellProperties.copyable = false; } else { cellProperties.rowspan = mergeParent.rowspan; cellProperties.colspan = mergeParent.colspan; } } } /** * `afterViewportRowCalculatorOverride` hook callback. * * @private * @param {object} calc The row calculator object. */ }, { key: "onAfterViewportRowCalculatorOverride", value: function onAfterViewportRowCalculatorOverride(calc) { var nrOfColumns = this.hot.countCols(); this.modifyViewportRowStart(calc, nrOfColumns); this.modifyViewportRowEnd(calc, nrOfColumns); } /** * Modify viewport start when needed. We extend viewport when merged cells aren't fully visible. * * @private * @param {object} calc The row calculator object. * @param {number} nrOfColumns Number of visual columns. */ }, { key: "modifyViewportRowStart", value: function modifyViewportRowStart(calc, nrOfColumns) { var rowMapper = this.hot.rowIndexMapper; var visualStartRow = rowMapper.getVisualFromRenderableIndex(calc.startRow); for (var visualColumnIndex = 0; visualColumnIndex < nrOfColumns; visualColumnIndex += 1) { var mergeParentForViewportStart = this.mergedCellsCollection.get(visualStartRow, visualColumnIndex); if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_31__["isObject"])(mergeParentForViewportStart)) { var renderableIndexAtMergeStart = rowMapper.getRenderableFromVisualIndex(rowMapper.getFirstNotHiddenIndex(mergeParentForViewportStart.row, 1)); // Merge start is out of the viewport (i.e. when we scrolled to the bottom and we can see just part of a merge). if (renderableIndexAtMergeStart < calc.startRow) { // We extend viewport when some rows have been merged. calc.startRow = renderableIndexAtMergeStart; // We are looking for next merges inside already extended viewport (starting again from row equal to 0). this.modifyViewportRowStart(calc, nrOfColumns); // recursively search upwards return; // Finish the current loop. Everything will be checked from the beginning by above recursion. } } } } /** * Modify viewport end when needed. We extend viewport when merged cells aren't fully visible. * * @private * @param {object} calc The row calculator object. * @param {number} nrOfColumns Number of visual columns. */ }, { key: "modifyViewportRowEnd", value: function modifyViewportRowEnd(calc, nrOfColumns) { var rowMapper = this.hot.rowIndexMapper; var visualEndRow = rowMapper.getVisualFromRenderableIndex(calc.endRow); for (var visualColumnIndex = 0; visualColumnIndex < nrOfColumns; visualColumnIndex += 1) { var mergeParentForViewportEnd = this.mergedCellsCollection.get(visualEndRow, visualColumnIndex); if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_31__["isObject"])(mergeParentForViewportEnd)) { var mergeEnd = mergeParentForViewportEnd.row + mergeParentForViewportEnd.rowspan - 1; var renderableIndexAtMergeEnd = rowMapper.getRenderableFromVisualIndex(rowMapper.getFirstNotHiddenIndex(mergeEnd, -1)); // Merge end is out of the viewport. if (renderableIndexAtMergeEnd > calc.endRow) { // We extend the viewport when some rows have been merged. calc.endRow = renderableIndexAtMergeEnd; // We are looking for next merges inside already extended viewport (starting again from row equal to 0). this.modifyViewportRowEnd(calc, nrOfColumns); // recursively search upwards return; // Finish the current loop. Everything will be checked from the beginning by above recursion. } } } } /** * `afterViewportColumnCalculatorOverride` hook callback. * * @private * @param {object} calc The column calculator object. */ }, { key: "onAfterViewportColumnCalculatorOverride", value: function onAfterViewportColumnCalculatorOverride(calc) { var nrOfRows = this.hot.countRows(); this.modifyViewportColumnStart(calc, nrOfRows); this.modifyViewportColumnEnd(calc, nrOfRows); } /** * Modify viewport start when needed. We extend viewport when merged cells aren't fully visible. * * @private * @param {object} calc The column calculator object. * @param {number} nrOfRows Number of visual rows. */ }, { key: "modifyViewportColumnStart", value: function modifyViewportColumnStart(calc, nrOfRows) { var columnMapper = this.hot.columnIndexMapper; var visualStartCol = columnMapper.getVisualFromRenderableIndex(calc.startColumn); for (var visualRowIndex = 0; visualRowIndex < nrOfRows; visualRowIndex += 1) { var mergeParentForViewportStart = this.mergedCellsCollection.get(visualRowIndex, visualStartCol); if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_31__["isObject"])(mergeParentForViewportStart)) { var renderableIndexAtMergeStart = columnMapper.getRenderableFromVisualIndex(columnMapper.getFirstNotHiddenIndex(mergeParentForViewportStart.col, 1)); // Merge start is out of the viewport (i.e. when we scrolled to the right and we can see just part of a merge). if (renderableIndexAtMergeStart < calc.startColumn) { // We extend viewport when some columns have been merged. calc.startColumn = renderableIndexAtMergeStart; // We are looking for next merges inside already extended viewport (starting again from column equal to 0). this.modifyViewportColumnStart(calc, nrOfRows); // recursively search upwards return; // Finish the current loop. Everything will be checked from the beginning by above recursion. } } } } /** * Modify viewport end when needed. We extend viewport when merged cells aren't fully visible. * * @private * @param {object} calc The column calculator object. * @param {number} nrOfRows Number of visual rows. */ }, { key: "modifyViewportColumnEnd", value: function modifyViewportColumnEnd(calc, nrOfRows) { var columnMapper = this.hot.columnIndexMapper; var visualEndCol = columnMapper.getVisualFromRenderableIndex(calc.endColumn); for (var visualRowIndex = 0; visualRowIndex < nrOfRows; visualRowIndex += 1) { var mergeParentForViewportEnd = this.mergedCellsCollection.get(visualRowIndex, visualEndCol); if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_31__["isObject"])(mergeParentForViewportEnd)) { var mergeEnd = mergeParentForViewportEnd.col + mergeParentForViewportEnd.colspan - 1; var renderableIndexAtMergeEnd = columnMapper.getRenderableFromVisualIndex(columnMapper.getFirstNotHiddenIndex(mergeEnd, -1)); // Merge end is out of the viewport. if (renderableIndexAtMergeEnd > calc.endColumn) { // We extend the viewport when some columns have been merged. calc.endColumn = renderableIndexAtMergeEnd; // We are looking for next merges inside already extended viewport (starting again from column equal to 0). this.modifyViewportColumnEnd(calc, nrOfRows); // recursively search upwards return; // Finish the current loop. Everything will be checked from the beginning by above recursion. } } } } /** * Translates merged cell coordinates to renderable indexes. * * @private * @param {number} parentRow Visual row index. * @param {number} rowspan Rowspan which describes shift which will be applied to parent row * to calculate renderable index which points to the most bottom * index position. Pass rowspan as `0` to calculate the most top * index position. * @param {number} parentColumn Visual column index. * @param {number} colspan Colspan which describes shift which will be applied to parent column * to calculate renderable index which points to the most right * index position. Pass colspan as `0` to calculate the most left * index position. * @returns {number[]} */ }, { key: "translateMergedCellToRenderable", value: function translateMergedCellToRenderable(parentRow, rowspan, parentColumn, colspan) { var _this$hot4 = this.hot, rowMapper = _this$hot4.rowIndexMapper, columnMapper = _this$hot4.columnIndexMapper; var firstNonHiddenRow; var firstNonHiddenColumn; if (rowspan === 0) { firstNonHiddenRow = rowMapper.getFirstNotHiddenIndex(parentRow, 1); } else { firstNonHiddenRow = rowMapper.getFirstNotHiddenIndex(parentRow + rowspan - 1, -1); } if (colspan === 0) { firstNonHiddenColumn = columnMapper.getFirstNotHiddenIndex(parentColumn, 1); } else { firstNonHiddenColumn = columnMapper.getFirstNotHiddenIndex(parentColumn + colspan - 1, -1); } var renderableRow = parentRow >= 0 ? rowMapper.getRenderableFromVisualIndex(firstNonHiddenRow) : parentRow; var renderableColumn = parentColumn >= 0 ? columnMapper.getRenderableFromVisualIndex(firstNonHiddenColumn) : parentColumn; return [renderableRow, renderableColumn]; } /** * The `modifyAutofillRange` hook callback. * * @private * @param {Array} drag The drag area coordinates. * @param {Array} select The selection information. * @returns {Array} The new drag area. */ }, { key: "onModifyAutofillRange", value: function onModifyAutofillRange(drag, select) { this.autofillCalculations.correctSelectionAreaSize(select); var dragDirection = this.autofillCalculations.getDirection(select, drag); var dragArea = drag; if (this.autofillCalculations.dragAreaOverlapsCollections(select, dragArea, dragDirection)) { dragArea = select; return dragArea; } var mergedCellsWithinSelectionArea = this.mergedCellsCollection.getWithinRange({ from: { row: select[0], col: select[1] }, to: { row: select[2], col: select[3] } }); if (!mergedCellsWithinSelectionArea) { return dragArea; } dragArea = this.autofillCalculations.snapDragArea(select, dragArea, dragDirection, mergedCellsWithinSelectionArea); return dragArea; } /** * `afterCreateCol` hook callback. * * @private * @param {number} column Column index. * @param {number} count Number of created columns. */ }, { key: "onAfterCreateCol", value: function onAfterCreateCol(column, count) { this.mergedCellsCollection.shiftCollections('right', column, count); } /** * `afterRemoveCol` hook callback. * * @private * @param {number} column Column index. * @param {number} count Number of removed columns. */ }, { key: "onAfterRemoveCol", value: function onAfterRemoveCol(column, count) { this.mergedCellsCollection.shiftCollections('left', column, count); } /** * `afterCreateRow` hook callback. * * @private * @param {number} row Row index. * @param {number} count Number of created rows. * @param {string} source Source of change. */ }, { key: "onAfterCreateRow", value: function onAfterCreateRow(row, count, source) { if (source === 'auto') { return; } this.mergedCellsCollection.shiftCollections('down', row, count); } /** * `afterRemoveRow` hook callback. * * @private * @param {number} row Row index. * @param {number} count Number of removed rows. */ }, { key: "onAfterRemoveRow", value: function onAfterRemoveRow(row, count) { this.mergedCellsCollection.shiftCollections('up', row, count); } /** * `afterChange` hook callback. Used to propagate merged cells after using Autofill. * * @private * @param {Array} changes The changes array. * @param {string} source Determines the source of the change. */ }, { key: "onAfterChange", value: function onAfterChange(changes, source) { if (source !== 'Autofill.fill') { return; } this.autofillCalculations.recreateAfterDataPopulation(changes); } /** * `beforeDrawAreaBorders` hook callback. * * @private * @param {Array} corners Visual coordinates of the area corners. * @param {string} className Class name for the area. */ }, { key: "onBeforeDrawAreaBorders", value: function onBeforeDrawAreaBorders(corners, className) { if (className && className === 'area') { var selectedRange = this.hot.getSelectedRangeLast(); var mergedCellsWithinRange = this.mergedCellsCollection.getWithinRange(selectedRange); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_30__["arrayEach"])(mergedCellsWithinRange, function (mergedCell) { if (selectedRange.getBottomRightCorner().row === mergedCell.getLastRow() && selectedRange.getBottomRightCorner().col === mergedCell.getLastColumn()) { corners[2] = mergedCell.row; corners[3] = mergedCell.col; } }); } } /** * `afterModifyTransformStart` hook callback. Fixes a problem with navigating through merged cells at the edges of the table * with the ENTER/SHIFT+ENTER/TAB/SHIFT+TAB keys. * * @private * @param {CellCoords} coords Coordinates of the to-be-selected cell. * @param {number} rowTransformDir Row transformation direction (negative value = up, 0 = none, positive value = down). * @param {number} colTransformDir Column transformation direction (negative value = up, 0 = none, positive value = down). */ }, { key: "onAfterModifyTransformStart", value: function onAfterModifyTransformStart(coords, rowTransformDir, colTransformDir) { if (!this.enabled) { return; } var mergedCellAtCoords = this.mergedCellsCollection.get(coords.row, coords.col); if (!mergedCellAtCoords) { return; } var goingDown = rowTransformDir > 0; var goingUp = rowTransformDir < 0; var goingLeft = colTransformDir < 0; var goingRight = colTransformDir > 0; var mergedCellOnBottomEdge = mergedCellAtCoords.row + mergedCellAtCoords.rowspan - 1 === this.hot.countRows() - 1; var mergedCellOnTopEdge = mergedCellAtCoords.row === 0; var mergedCellOnRightEdge = mergedCellAtCoords.col + mergedCellAtCoords.colspan - 1 === this.hot.countCols() - 1; var mergedCellOnLeftEdge = mergedCellAtCoords.col === 0; if (goingDown && mergedCellOnBottomEdge || goingUp && mergedCellOnTopEdge || goingRight && mergedCellOnRightEdge || goingLeft && mergedCellOnLeftEdge) { coords.row = mergedCellAtCoords.row; coords.col = mergedCellAtCoords.col; } } /** * `afterDrawSelection` hook callback. Used to add the additional class name for the entirely-selected merged cells. * * @private * @param {number} currentRow Visual row index of the currently processed cell. * @param {number} currentColumn Visual column index of the currently cell. * @param {Array} cornersOfSelection Array of the current selection in a form of `[startRow, startColumn, endRow, endColumn]`. * @param {number|undefined} layerLevel Number indicating which layer of selection is currently processed. * @returns {string|undefined} A `String`, which will act as an additional `className` to be added to the currently processed cell. */ }, { key: "onAfterDrawSelection", value: function onAfterDrawSelection(currentRow, currentColumn, cornersOfSelection, layerLevel) { // Nothing's selected (hook might be triggered by the custom borders) if (!cornersOfSelection) { return; } return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel); } /** * `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table. * * @private * @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from all the cells in the table. */ }, { key: "onBeforeRemoveCellClassNames", value: function onBeforeRemoveCellClassNames() { return this.selectionCalculations.getSelectedMergedCellClassNameToRemove(); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return MergeCells; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_21__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/mergeCells/utils.mjs": /*!****************************************************************!*\ !*** ./node_modules/handsontable/plugins/mergeCells/utils.mjs ***! \****************************************************************/ /*! exports provided: applySpanProperties */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applySpanProperties", function() { return applySpanProperties; }); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js"); /** * Apply the `colspan`/`rowspan` properties. * * @param {HTMLElement} TD The soon-to-be-modified cell. * @param {MergedCellCoords} mergedCellInfo The merged cell in question. * @param {number} row Row index. * @param {number} col Column index. */ 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'); TD.style.display = ''; } } /***/ }), /***/ "./node_modules/handsontable/plugins/multiColumnSorting/domHelpers.mjs": /*!*****************************************************************************!*\ !*** ./node_modules/handsontable/plugins/multiColumnSorting/domHelpers.mjs ***! \*****************************************************************************/ /*! exports provided: getClassesToAdd, getClassesToRemove */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClassesToAdd", function() { return getClassesToAdd; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClassesToRemove", function() { return getClassesToRemove; }); /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js"); /* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.string.split.js */ "./node_modules/core-js/modules/es.string.split.js"); /* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.regexp.constructor.js */ "./node_modules/core-js/modules/es.regexp.constructor.js"); /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); var COLUMN_ORDER_PREFIX = 'sort'; /** * Get CSS classes which should be added to particular column header. * * @param {object} columnStatesManager Instance of column state manager. * @param {number} column Visual column index. * @param {boolean} showSortIndicator Indicates if indicator should be shown for the particular column. * @returns {Array} Array of CSS classes. */ function getClassesToAdd(columnStatesManager, column, showSortIndicator) { var cssClasses = []; if (showSortIndicator === false) { return cssClasses; } if (columnStatesManager.isColumnSorted(column) && columnStatesManager.getNumberOfSortedColumns() > 1) { cssClasses.push("".concat(COLUMN_ORDER_PREFIX, "-").concat(columnStatesManager.getIndexOfColumnInSortQueue(column) + 1)); } return cssClasses; } /** * Get CSS classes which should be removed from column header. * * @param {HTMLElement} htmlElement An element to process. * @returns {Array} Array of CSS classes. */ function getClassesToRemove(htmlElement) { var cssClasses = htmlElement.className.split(' '); var sortSequenceRegExp = new RegExp("^".concat(COLUMN_ORDER_PREFIX, "-[0-9]{1,2}$")); return cssClasses.filter(function (cssClass) { return sortSequenceRegExp.test(cssClass); }); } /***/ }), /***/ "./node_modules/handsontable/plugins/multiColumnSorting/index.mjs": /*!************************************************************************!*\ !*** ./node_modules/handsontable/plugins/multiColumnSorting/index.mjs ***! \************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, MultiColumnSorting */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _multiColumnSorting_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./multiColumnSorting.mjs */ "./node_modules/handsontable/plugins/multiColumnSorting/multiColumnSorting.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _multiColumnSorting_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _multiColumnSorting_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiColumnSorting", function() { return _multiColumnSorting_mjs__WEBPACK_IMPORTED_MODULE_0__["MultiColumnSorting"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/multiColumnSorting/multiColumnSorting.mjs": /*!*************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/multiColumnSorting/multiColumnSorting.mjs ***! \*************************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, MultiColumnSorting */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiColumnSorting", function() { return MultiColumnSorting; }); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.sort.js */ "./node_modules/core-js/modules/es.array.sort.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _columnSorting_index_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../columnSorting/index.mjs */ "./node_modules/handsontable/plugins/columnSorting/index.mjs"); /* harmony import */ var _columnSorting_sortService_index_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../columnSorting/sortService/index.mjs */ "./node_modules/handsontable/plugins/columnSorting/sortService/index.mjs"); /* harmony import */ var _columnSorting_utils_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../columnSorting/utils.mjs */ "./node_modules/handsontable/plugins/columnSorting/utils.mjs"); /* harmony import */ var _utils_keyStateObserver_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../utils/keyStateObserver.mjs */ "./node_modules/handsontable/utils/keyStateObserver.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _rootComparator_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./rootComparator.mjs */ "./node_modules/handsontable/plugins/multiColumnSorting/rootComparator.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/handsontable/plugins/multiColumnSorting/utils.mjs"); /* harmony import */ var _domHelpers_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./domHelpers.mjs */ "./node_modules/handsontable/plugins/multiColumnSorting/domHelpers.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var PLUGIN_KEY = 'multiColumnSorting'; var PLUGIN_PRIORITY = 170; var APPEND_COLUMN_CONFIG_STRATEGY = 'append'; var CONFLICTED_PLUGIN_KEY = 'columnSorting'; Object(_columnSorting_sortService_index_mjs__WEBPACK_IMPORTED_MODULE_15__["registerRootComparator"])(PLUGIN_KEY, _rootComparator_mjs__WEBPACK_IMPORTED_MODULE_19__["rootComparator"]); /** * @plugin MultiColumnSorting * @class MultiColumnSorting * * @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: {@link Options#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) * } * } * } * }] * ``` */ var MultiColumnSorting = /*#__PURE__*/function (_ColumnSorting) { _inherits(MultiColumnSorting, _ColumnSorting); var _super = _createSuper(MultiColumnSorting); function MultiColumnSorting(hotInstance) { var _this; _classCallCheck(this, MultiColumnSorting); _this = _super.call(this, hotInstance); /** * Main settings key designed for the plugin. * * @private * @type {string} */ _this.pluginKey = PLUGIN_KEY; 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} */ _createClass(MultiColumnSorting, [{ key: "isEnabled", value: function isEnabled() { return _get(_getPrototypeOf(MultiColumnSorting.prototype), "isEnabled", this).call(this); } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { if (!this.enabled && this.hot.getSettings()[this.pluginKey] && this.hot.getSettings()[CONFLICTED_PLUGIN_KEY]) { Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_20__["warnAboutPluginsConflict"])(); } _get(_getPrototypeOf(MultiColumnSorting.prototype), "enablePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { _get(_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' * }]); * ``` * * @fires Hooks#beforeColumnSort * @fires Hooks#afterColumnSort */ }, { key: "sort", value: function sort(sortConfig) { _get(_getPrototypeOf(MultiColumnSorting.prototype), "sort", this).call(this, sortConfig); } /** * Clear the sort performed on the table. */ }, { key: "clearSort", value: function clearSort() { _get(_getPrototypeOf(MultiColumnSorting.prototype), "clearSort", this).call(this); } /** * Checks if the table is sorted (any column have to be sorted). * * @returns {boolean} */ }, { key: "isSorted", value: function isSorted() { return _get(_getPrototypeOf(MultiColumnSorting.prototype), "isSorted", this).call(this); } /** * 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} */ }, { key: "getSortConfig", value: function getSortConfig(column) { return _get(_getPrototypeOf(MultiColumnSorting.prototype), "getSortConfig", this).call(this, column); } /** * @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. * Note: Please keep in mind that this method doesn't re-render the table. * * @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 and re-render the table. * * 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: "setSortConfig", value: function setSortConfig(sortConfig) { _get(_getPrototypeOf(MultiColumnSorting.prototype), "setSortConfig", this).call(this, sortConfig); } /** * 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: "getNormalizedSortConfigs", value: function getNormalizedSortConfigs() { var sortConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; if (Array.isArray(sortConfig)) { return sortConfig; } return [sortConfig]; } /** * Update header classes. * * @private * @param {HTMLElement} headerSpanElement Header span element. * @param {...*} args Extra arguments for helpers. */ }, { key: "updateHeaderClasses", value: function updateHeaderClasses(headerSpanElement) { var _get2; for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } (_get2 = _get(_getPrototypeOf(MultiColumnSorting.prototype), "updateHeaderClasses", this)).call.apply(_get2, [this, headerSpanElement].concat(args)); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["removeClass"])(headerSpanElement, Object(_domHelpers_mjs__WEBPACK_IMPORTED_MODULE_21__["getClassesToRemove"])(headerSpanElement)); if (this.enabled !== false) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["addClass"])(headerSpanElement, _domHelpers_mjs__WEBPACK_IMPORTED_MODULE_21__["getClassesToAdd"].apply(void 0, args)); } } /** * 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. */ }, { key: "onUpdateSettings", value: function onUpdateSettings(newSettings) { if (this.hot.getSettings()[this.pluginKey] && this.hot.getSettings()[CONFLICTED_PLUGIN_KEY]) { Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_20__["warnAboutPluginsConflict"])(); } _get(_getPrototypeOf(MultiColumnSorting.prototype), "onUpdateSettings", this).call(this, newSettings); } /** * 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: "onAfterOnCellMouseDown", value: function onAfterOnCellMouseDown(event, coords) { if (Object(_columnSorting_utils_mjs__WEBPACK_IMPORTED_MODULE_16__["wasHeaderClickedProperly"])(coords.row, coords.col, event) === false) { return; } if (this.wasClickableHeaderClicked(event, coords.col)) { if (Object(_utils_keyStateObserver_mjs__WEBPACK_IMPORTED_MODULE_17__["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)); } } } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return MultiColumnSorting; }(_columnSorting_index_mjs__WEBPACK_IMPORTED_MODULE_14__["ColumnSorting"]); /***/ }), /***/ "./node_modules/handsontable/plugins/multiColumnSorting/rootComparator.mjs": /*!*********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/multiColumnSorting/rootComparator.mjs ***! \*********************************************************************************/ /*! exports provided: rootComparator */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rootComparator", function() { return rootComparator; }); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _columnSorting_sortService_index_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../columnSorting/sortService/index.mjs */ "./node_modules/handsontable/plugins/columnSorting/sortService/index.mjs"); function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /** * Sort comparator handled by conventional sort algorithm. * * @param {Array} sortingOrders 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 _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 pluginSettings = columnMeta.multiColumnSorting; var compareFunctionFactory = pluginSettings.compareFunctionFactory ? pluginSettings.compareFunctionFactory : Object(_columnSorting_sortService_index_mjs__WEBPACK_IMPORTED_MODULE_10__["getCompareFunctionFactory"])(columnMeta.type); var compareResult = compareFunctionFactory(sortingOrder, columnMeta, pluginSettings)(value, nextValue); if (compareResult === _columnSorting_sortService_index_mjs__WEBPACK_IMPORTED_MODULE_10__["DO_NOT_SWAP"]) { var nextSortedColumn = column + 1; if (typeof columnMetas[nextSortedColumn] !== 'undefined') { return getCompareResult(nextSortedColumn); } } return compareResult; }(0); }; } /***/ }), /***/ "./node_modules/handsontable/plugins/multiColumnSorting/utils.mjs": /*!************************************************************************!*\ !*** ./node_modules/handsontable/plugins/multiColumnSorting/utils.mjs ***! \************************************************************************/ /*! exports provided: warnAboutPluginsConflict */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "warnAboutPluginsConflict", function() { return warnAboutPluginsConflict; }); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.freeze.js */ "./node_modules/core-js/modules/es.object.freeze.js"); /* harmony import */ var _helpers_console_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/console.mjs */ "./node_modules/handsontable/helpers/console.mjs"); /* harmony import */ var _helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers/templateLiteralTag.mjs */ "./node_modules/handsontable/helpers/templateLiteralTag.mjs"); var _templateObject; function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } /** * Warn users about problems when using `columnSorting` and `multiColumnSorting` plugins simultaneously. */ function warnAboutPluginsConflict() { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_2__["warn"])(Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_3__["toSingleLine"])(_templateObject || (_templateObject = _taggedTemplateLiteral(["Plugins `columnSorting` and `multiColumnSorting` should not be enabled simultaneously. \n Only `multiColumnSorting` will work."], ["Plugins \\`columnSorting\\` and \\`multiColumnSorting\\` should not be enabled simultaneously. \n Only \\`multiColumnSorting\\` will work."])))); } /***/ }), /***/ "./node_modules/handsontable/plugins/multipleSelectionHandles/index.mjs": /*!******************************************************************************!*\ !*** ./node_modules/handsontable/plugins/multipleSelectionHandles/index.mjs ***! \******************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, MultipleSelectionHandles */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _multipleSelectionHandles_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./multipleSelectionHandles.mjs */ "./node_modules/handsontable/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _multipleSelectionHandles_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _multipleSelectionHandles_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultipleSelectionHandles", function() { return _multipleSelectionHandles_mjs__WEBPACK_IMPORTED_MODULE_0__["MultipleSelectionHandles"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs": /*!*************************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs ***! \*************************************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, MultipleSelectionHandles */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultipleSelectionHandles", function() { return MultipleSelectionHandles; }); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_browser_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../helpers/browser.mjs */ "./node_modules/handsontable/helpers/browser.mjs"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var PLUGIN_KEY = 'multipleSelectionHandles'; var PLUGIN_PRIORITY = 160; /** * @private * @plugin MultipleSelectionHandles * @class MultipleSelectionHandles */ var MultipleSelectionHandles = /*#__PURE__*/function (_BasePlugin) { _inherits(MultipleSelectionHandles, _BasePlugin); var _super = _createSuper(MultipleSelectionHandles); /** * @param {object} hotInstance The handsontable instance. */ function MultipleSelectionHandles(hotInstance) { var _this2; _classCallCheck(this, MultipleSelectionHandles); _this2 = _super.call(this, hotInstance); /** * @type {Array} */ _this2.dragged = []; /** * Instance of EventManager. * * @type {EventManager} */ _this2.eventManager = null; /** * @type {null} */ _this2.lastSetCell = null; return _this2; } /** * Check if the plugin is enabled in the handsontable settings. * * @returns {boolean} */ _createClass(MultipleSelectionHandles, [{ key: "isEnabled", value: function isEnabled() { return Object(_helpers_browser_mjs__WEBPACK_IMPORTED_MODULE_16__["isMobileBrowser"])(); } /** * Enable plugin for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { if (this.enabled) { return; } if (!this.eventManager) { this.eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_18__["default"](this); } this.registerListeners(); _get(_getPrototypeOf(MultipleSelectionHandles.prototype), "enablePlugin", this).call(this); } /** * Bind the touch events. * * @private */ }, { key: "registerListeners", value: function registerListeners() { var _this3 = this; var _this = this; var rootElement = this.hot.rootElement; /** * @param {string} query Query for the position. * @returns {boolean} */ function removeFromDragged(query) { if (_this.dragged.length === 1) { // clear array _this.dragged.splice(0, _this.dragged.length); return true; } var entryPosition = _this.dragged.indexOf(query); if (entryPosition === -1) { return false; } else if (entryPosition === 0) { _this.dragged = _this.dragged.slice(0, 1); } else if (entryPosition === 1) { _this.dragged = _this.dragged.slice(-1); } } this.eventManager.addEventListener(rootElement, 'touchstart', function (event) { var selectedRange; if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["hasClass"])(event.target, 'topLeftSelectionHandle-HitArea')) { selectedRange = _this.hot.getSelectedRangeLast(); _this.dragged.push('topLeft'); _this.touchStartRange = { width: selectedRange.getWidth(), height: selectedRange.getHeight(), direction: selectedRange.getDirection() }; event.preventDefault(); return false; } else if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["hasClass"])(event.target, 'bottomRightSelectionHandle-HitArea')) { selectedRange = _this.hot.getSelectedRangeLast(); _this.dragged.push('bottomRight'); _this.touchStartRange = { width: selectedRange.getWidth(), height: selectedRange.getHeight(), direction: selectedRange.getDirection() }; event.preventDefault(); return false; } }); this.eventManager.addEventListener(rootElement, 'touchend', function (event) { if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["hasClass"])(event.target, 'topLeftSelectionHandle-HitArea')) { removeFromDragged.call(_this, 'topLeft'); _this.touchStartRange = void 0; event.preventDefault(); return false; } else if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["hasClass"])(event.target, 'bottomRightSelectionHandle-HitArea')) { removeFromDragged.call(_this, 'bottomRight'); _this.touchStartRange = void 0; event.preventDefault(); return false; } }); this.eventManager.addEventListener(rootElement, 'touchmove', function (event) { var _this3$hot = _this3.hot, rootWindow = _this3$hot.rootWindow, rootDocument = _this3$hot.rootDocument; var scrollTop = Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["getWindowScrollTop"])(rootWindow); var scrollLeft = Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["getWindowScrollLeft"])(rootWindow); var targetCoords; var selectedRange; var rangeWidth; var rangeHeight; var rangeDirection; var newRangeCoords; if (_this.dragged.length === 0) { return; } var endTarget = rootDocument.elementFromPoint(event.touches[0].screenX - scrollLeft, event.touches[0].screenY - scrollTop); if (!endTarget || endTarget === _this.lastSetCell) { return; } if (endTarget.nodeName === 'TD' || endTarget.nodeName === 'TH') { targetCoords = _this.hot.getCoords(endTarget); if (targetCoords.col === -1) { targetCoords.col = 0; } selectedRange = _this.hot.getSelectedRangeLast(); rangeWidth = selectedRange.getWidth(); rangeHeight = selectedRange.getHeight(); rangeDirection = selectedRange.getDirection(); if (rangeWidth === 1 && rangeHeight === 1) { _this.hot.selection.setRangeEnd(targetCoords); } newRangeCoords = _this.getCurrentRangeCoords(selectedRange, targetCoords, _this.touchStartRange.direction, rangeDirection, _this.dragged[0]); if (newRangeCoords.start !== null) { _this.hot.selection.setRangeStart(newRangeCoords.start); } _this.hot.selection.setRangeEnd(newRangeCoords.end); _this.lastSetCell = endTarget; } event.preventDefault(); }); } }, { key: "getCurrentRangeCoords", value: function getCurrentRangeCoords(selectedRange, currentTouch, touchStartDirection, currentDirection, draggedHandle) { var topLeftCorner = selectedRange.getTopLeftCorner(); var bottomRightCorner = selectedRange.getBottomRightCorner(); var bottomLeftCorner = selectedRange.getBottomLeftCorner(); var topRightCorner = selectedRange.getTopRightCorner(); var newCoords = { start: null, end: null }; switch (touchStartDirection) { case 'NE-SW': switch (currentDirection) { case 'NE-SW': case 'NW-SE': if (draggedHandle === 'topLeft') { newCoords = { start: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](currentTouch.row, selectedRange.highlight.col), end: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](bottomLeftCorner.row, currentTouch.col) }; } else { newCoords = { start: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](selectedRange.highlight.row, currentTouch.col), end: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](currentTouch.row, topLeftCorner.col) }; } break; case 'SE-NW': if (draggedHandle === 'bottomRight') { newCoords = { start: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](bottomRightCorner.row, currentTouch.col), end: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](currentTouch.row, topLeftCorner.col) }; } break; default: break; } break; case 'NW-SE': switch (currentDirection) { case 'NE-SW': if (draggedHandle === 'topLeft') { newCoords = { start: currentTouch, end: bottomLeftCorner }; } else { newCoords.end = currentTouch; } break; case 'NW-SE': if (draggedHandle === 'topLeft') { newCoords = { start: currentTouch, end: bottomRightCorner }; } else { newCoords.end = currentTouch; } break; case 'SE-NW': if (draggedHandle === 'topLeft') { newCoords = { start: currentTouch, end: topLeftCorner }; } else { newCoords.end = currentTouch; } break; case 'SW-NE': if (draggedHandle === 'topLeft') { newCoords = { start: currentTouch, end: topRightCorner }; } else { newCoords.end = currentTouch; } break; default: break; } break; case 'SW-NE': switch (currentDirection) { case 'NW-SE': if (draggedHandle === 'bottomRight') { newCoords = { start: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](currentTouch.row, topLeftCorner.col), end: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](bottomLeftCorner.row, currentTouch.col) }; } else { newCoords = { start: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](topLeftCorner.row, currentTouch.col), end: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](currentTouch.row, bottomRightCorner.col) }; } break; // case 'NE-SW': // // break; case 'SW-NE': if (draggedHandle === 'topLeft') { newCoords = { start: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](selectedRange.highlight.row, currentTouch.col), end: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](currentTouch.row, bottomRightCorner.col) }; } else { newCoords = { start: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](currentTouch.row, topLeftCorner.col), end: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](topLeftCorner.row, currentTouch.col) }; } break; case 'SE-NW': if (draggedHandle === 'bottomRight') { newCoords = { start: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](currentTouch.row, topRightCorner.col), end: new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_19__["CellCoords"](topLeftCorner.row, currentTouch.col) }; } else if (draggedHandle === 'topLeft') { newCoords = { start: bottomLeftCorner, end: currentTouch }; } break; default: break; } break; case 'SE-NW': switch (currentDirection) { case 'NW-SE': case 'NE-SW': case 'SW-NE': if (draggedHandle === 'topLeft') { newCoords.end = currentTouch; } break; case 'SE-NW': if (draggedHandle === 'topLeft') { newCoords.end = currentTouch; } else { newCoords = { start: currentTouch, end: topLeftCorner }; } break; default: break; } break; default: break; } return newCoords; } /** * Check if user is currently dragging the handle. * * @returns {boolean} Dragging state. */ }, { key: "isDragged", value: function isDragged() { return this.dragged.length > 0; } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return MultipleSelectionHandles; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_17__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/index.mjs": /*!*******************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/index.mjs ***! \*******************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, NestedHeaders */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _nestedHeaders_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./nestedHeaders.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/nestedHeaders.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _nestedHeaders_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _nestedHeaders_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NestedHeaders", function() { return _nestedHeaders_mjs__WEBPACK_IMPORTED_MODULE_0__["NestedHeaders"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/nestedHeaders.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/nestedHeaders.mjs ***! \***************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, NestedHeaders */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NestedHeaders", function() { return NestedHeaders; }); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.freeze.js */ "./node_modules/core-js/modules/es.object.freeze.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../helpers/dom/event.mjs */ "./node_modules/handsontable/helpers/dom/event.mjs"); /* harmony import */ var _helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../helpers/templateLiteralTag.mjs */ "./node_modules/handsontable/helpers/templateLiteralTag.mjs"); /* harmony import */ var _helpers_console_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../helpers/console.mjs */ "./node_modules/handsontable/helpers/console.mjs"); /* harmony import */ var _selection_index_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../selection/index.mjs */ "./node_modules/handsontable/selection/index.mjs"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _stateManager_index_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./stateManager/index.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/index.mjs"); /* harmony import */ var _utils_ghostTable_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./utils/ghostTable.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/utils/ghostTable.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var _templateObject, _templateObject2; function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } 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"); } } 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; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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 _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } var PLUGIN_KEY = 'nestedHeaders'; var PLUGIN_PRIORITY = 280; /** * @plugin NestedHeaders * @class NestedHeaders * * @description * The plugin allows to create a nested header structure, using the HTML's colspan attribute. * * To make any header wider (covering multiple table columns), it's corresponding configuration array element should be * provided as an object with `label` and `colspan` properties. The `label` property defines the header's label, * while the `colspan` property defines a number of columns that the header should cover. * * __Note__ that the plugin supports a *nested* structure, which means, any header cannot be wider than it's "parent". In * other words, headers cannot overlap each other. * @example * * ```js * const container = document.getElementById('example'); * const hot = new Handsontable(container, { * data: getData(), * nestedHeaders: [ * ['A', {label: 'B', colspan: 8}, 'C'], * ['D', {label: 'E', colspan: 4}, {label: 'F', colspan: 4}, 'G'], * ['H', {label: 'I', colspan: 2}, {label: 'J', colspan: 2}, {label: 'K', colspan: 2}, {label: 'L', colspan: 2}, 'M'], * ['N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W'] * ], * ``` */ var _stateManager = /*#__PURE__*/new WeakMap(); var _hidingIndexMapObserver = /*#__PURE__*/new WeakMap(); var NestedHeaders = /*#__PURE__*/function (_BasePlugin) { _inherits(NestedHeaders, _BasePlugin); var _super = _createSuper(NestedHeaders); function NestedHeaders() { var _this; _classCallCheck(this, NestedHeaders); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); _stateManager.set(_assertThisInitialized(_this), { writable: true, value: new _stateManager_index_mjs__WEBPACK_IMPORTED_MODULE_24__["default"]() }); _hidingIndexMapObserver.set(_assertThisInitialized(_this), { writable: true, value: null }); _defineProperty(_assertThisInitialized(_this), "ghostTable", new _utils_ghostTable_mjs__WEBPACK_IMPORTED_MODULE_25__["default"](_assertThisInitialized(_this))); _defineProperty(_assertThisInitialized(_this), "detectedOverlappedHeaders", false); return _this; } _createClass(NestedHeaders, [{ key: "isEnabled", value: /** * Check if plugin is enabled. * * @returns {boolean} */ function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } var _this$hot$getSettings = this.hot.getSettings(), nestedHeaders = _this$hot$getSettings.nestedHeaders; if (!Array.isArray(nestedHeaders) || !Array.isArray(nestedHeaders[0])) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_21__["warn"])(Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_20__["toSingleLine"])(_templateObject || (_templateObject = _taggedTemplateLiteral(["Your Nested Headers plugin configuration is invalid. The settings has to be \n passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]"], ["Your Nested Headers plugin configuration is invalid. The settings has to be\\x20\n passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]"])))); } this.addHook('init', function () { return _this2.onInit(); }); this.addHook('afterLoadData', function () { return _this2.onAfterLoadData.apply(_this2, arguments); }); this.addHook('beforeOnCellMouseDown', function () { return _this2.onBeforeOnCellMouseDown.apply(_this2, arguments); }); this.addHook('afterOnCellMouseDown', function () { return _this2.onAfterOnCellMouseDown.apply(_this2, arguments); }); this.addHook('beforeOnCellMouseOver', function () { return _this2.onBeforeOnCellMouseOver.apply(_this2, arguments); }); this.addHook('afterGetColumnHeaderRenderers', function (array) { return _this2.onAfterGetColumnHeaderRenderers(array); }); this.addHook('modifyColWidth', function () { return _this2.onModifyColWidth.apply(_this2, arguments); }); this.addHook('beforeHighlightingColumnHeader', function () { return _this2.onBeforeHighlightingColumnHeader.apply(_this2, arguments); }); this.addHook('afterViewportColumnCalculatorOverride', function () { return _this2.onAfterViewportColumnCalculatorOverride.apply(_this2, arguments); }); _get(_getPrototypeOf(NestedHeaders.prototype), "enablePlugin", this).call(this); this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction. } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { var _this3 = this; if (!this.hot.view) { // @TODO: Workaround for broken plugin initialization abstraction. return; } var _this$hot$getSettings2 = this.hot.getSettings(), nestedHeaders = _this$hot$getSettings2.nestedHeaders; _classPrivateFieldGet(this, _stateManager).setColumnsLimit(this.hot.countSourceCols()); if (Array.isArray(nestedHeaders)) { this.detectedOverlappedHeaders = _classPrivateFieldGet(this, _stateManager).setState(nestedHeaders); } if (this.detectedOverlappedHeaders) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_21__["warn"])(Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_20__["toSingleLine"])(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Your Nested Headers plugin setup contains overlapping headers. This kind of configuration \n is currently not supported."], ["Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\\x20\n is currently not supported."])))); } if (this.enabled) { // This line covers the case when a developer uses the external hiding maps to manipulate // the columns' visibility. The tree state built from the settings - which is always built // as if all the columns are visible, needs to be modified to be in sync with a dataset. this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach(function (isColumnHidden, physicalColumnIndex) { var actionName = isColumnHidden === true ? 'hide-column' : 'show-column'; _classPrivateFieldGet(_this3, _stateManager).triggerColumnModification(actionName, physicalColumnIndex); }); } if (!_classPrivateFieldGet(this, _hidingIndexMapObserver) && this.enabled) { _classPrivateFieldSet(this, _hidingIndexMapObserver, this.hot.columnIndexMapper.createChangesObserver('hiding').subscribe(function (changes) { changes.forEach(function (_ref) { var op = _ref.op, columnIndex = _ref.index, newValue = _ref.newValue; if (op === 'replace') { var actionName = newValue === true ? 'hide-column' : 'show-column'; _classPrivateFieldGet(_this3, _stateManager).triggerColumnModification(actionName, columnIndex); } }); })); } this.ghostTable.buildWidthsMapper(); _get(_getPrototypeOf(NestedHeaders.prototype), "updatePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { this.clearColspans(); _classPrivateFieldGet(this, _stateManager).clear(); _classPrivateFieldGet(this, _hidingIndexMapObserver).unsubscribe(); _classPrivateFieldSet(this, _hidingIndexMapObserver, null); this.ghostTable.clear(); _get(_getPrototypeOf(NestedHeaders.prototype), "disablePlugin", this).call(this); } /** * Returns an instance of the internal state manager of the plugin. * * @private * @returns {StateManager} */ }, { key: "getStateManager", value: function getStateManager() { return _classPrivateFieldGet(this, _stateManager); } /** * Gets a total number of headers levels. * * @private * @returns {number} */ }, { key: "getLayersCount", value: function getLayersCount() { return _classPrivateFieldGet(this, _stateManager).getLayersCount(); } /** * Gets column settings for a specified header. The returned object contains * information about the header label, its colspan length, or if it is hidden * in the header renderers. * * @private * @param {number} headerLevel Header level (0 = most distant to the table). * @param {number} columnIndex A visual column index. * @returns {object} */ }, { key: "getHeaderSettings", value: function getHeaderSettings(headerLevel, columnIndex) { return _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, columnIndex); } /** * Clear the colspans remaining after plugin usage. * * @private */ }, { key: "clearColspans", value: function clearColspans() { if (!this.hot.view) { return; } var wt = this.hot.view.wt; var headerLevels = wt.getSetting('columnHeaders').length; var mainHeaders = wt.wtTable.THEAD; var topHeaders = wt.wtOverlays.topOverlay.clone.wtTable.THEAD; var topLeftCornerHeaders = wt.wtOverlays.topLeftCornerOverlay ? wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.THEAD : null; for (var i = 0; i < headerLevels; i++) { var masterLevel = mainHeaders.childNodes[i]; if (!masterLevel) { break; } var topLevel = topHeaders.childNodes[i]; var topLeftCornerLevel = topLeftCornerHeaders ? topLeftCornerHeaders.childNodes[i] : null; for (var j = 0, masterNodes = masterLevel.childNodes.length; j < masterNodes; j++) { masterLevel.childNodes[j].removeAttribute('colspan'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_17__["removeClass"])(masterLevel.childNodes[j], 'hiddenHeader'); if (topLevel && topLevel.childNodes[j]) { topLevel.childNodes[j].removeAttribute('colspan'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_17__["removeClass"])(topLevel.childNodes[j], 'hiddenHeader'); } if (topLeftCornerHeaders && topLeftCornerLevel && topLeftCornerLevel.childNodes[j]) { topLeftCornerLevel.childNodes[j].removeAttribute('colspan'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_17__["removeClass"])(topLeftCornerLevel.childNodes[j], 'hiddenHeader'); } } } } /** * Generates the appropriate header renderer for a header row. * * @private * @param {number} headerLevel The index of header level counting from the top (positive * values counting from 0 to N). * @returns {Function} * @fires Hooks#afterGetColHeader */ }, { key: "headerRendererFactory", value: function headerRendererFactory(headerLevel) { var _this4 = this; var fixedColumnsLeft = this.hot.view.wt.getSetting('fixedColumnsLeft'); return function (renderedColumnIndex, TH) { var _classPrivateFieldGet2; var _this4$hot = _this4.hot, rootDocument = _this4$hot.rootDocument, columnIndexMapper = _this4$hot.columnIndexMapper, view = _this4$hot.view; var visualColumnsIndex = columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex); if (visualColumnsIndex === null) { visualColumnsIndex = renderedColumnIndex; } TH.removeAttribute('colspan'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_17__["removeClass"])(TH, 'hiddenHeader'); var _ref2 = (_classPrivateFieldGet2 = _classPrivateFieldGet(_this4, _stateManager).getHeaderSettings(headerLevel, visualColumnsIndex)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : { label: '' }, colspan = _ref2.colspan, label = _ref2.label, isHidden = _ref2.isHidden, isPlaceholder = _ref2.isPlaceholder; if (isPlaceholder || isHidden) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_17__["addClass"])(TH, 'hiddenHeader'); } else if (colspan > 1) { var _view$wt$wtOverlays$t, _view$wt$wtOverlays$l; var isTopLeftOverlay = (_view$wt$wtOverlays$t = view.wt.wtOverlays.topLeftCornerOverlay) === null || _view$wt$wtOverlays$t === void 0 ? void 0 : _view$wt$wtOverlays$t.clone.wtTable.THEAD.contains(TH); var isLeftOverlay = (_view$wt$wtOverlays$l = view.wt.wtOverlays.leftOverlay) === null || _view$wt$wtOverlays$l === void 0 ? void 0 : _view$wt$wtOverlays$l.clone.wtTable.THEAD.contains(TH); // Check if there is a fixed column enabled, if so then reduce colspan to fixed column width. var correctedColspan = isTopLeftOverlay || isLeftOverlay ? Math.min(colspan, fixedColumnsLeft - renderedColumnIndex) : colspan; if (correctedColspan > 1) { TH.setAttribute('colspan', correctedColspan); } } var divEl = rootDocument.createElement('div'); var spanEl = rootDocument.createElement('span'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_17__["addClass"])(divEl, 'relative'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_17__["addClass"])(spanEl, 'colHeader'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_17__["fastInnerHTML"])(spanEl, label); divEl.appendChild(spanEl); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_17__["empty"])(TH); TH.appendChild(divEl); _this4.hot.runHooks('afterGetColHeader', visualColumnsIndex, TH); }; } /** * Allows to control which header DOM element will be used to highlight. * * @private * @param {number} visualColumn A visual column index of the highlighted row header. * @param {number} headerLevel A row header level that is currently highlighted. * @param {object} highlightMeta An object with meta data that describes the highlight state. * @returns {number} */ }, { key: "onBeforeHighlightingColumnHeader", value: function onBeforeHighlightingColumnHeader(visualColumn, headerLevel, highlightMeta) { var headerNodeData = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumn); if (!headerNodeData) { return visualColumn; } var classNames = highlightMeta.classNames, columnCursor = highlightMeta.columnCursor, selectionType = highlightMeta.selectionType, selectionWidth = highlightMeta.selectionWidth; var _classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn), isRoot = _classPrivateFieldGet3.isRoot, colspan = _classPrivateFieldGet3.colspan; if (selectionType === _selection_index_mjs__WEBPACK_IMPORTED_MODULE_22__["HEADER_TYPE"]) { if (!isRoot) { return headerNodeData.columnIndex; } } else if (selectionType === _selection_index_mjs__WEBPACK_IMPORTED_MODULE_22__["ACTIVE_HEADER_TYPE"]) { if (colspan > selectionWidth - columnCursor || !isRoot) { // Reset the class names array so the generated TH element won't be modified. classNames.length = 0; } } return visualColumn; } /** * Allows to block the column selection that is controlled by the core Selection module. * * @private * @param {MouseEvent} event Mouse event. * @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell. * @param {CellCoords} TD The table cell or header element. * @param {object} blockCalculations An object with keys `row`, `column` and `cell` which contains boolean values. * This object allows or disallows changing the selection for the particular axies. */ }, { key: "onBeforeOnCellMouseDown", value: function onBeforeOnCellMouseDown(event, coords, TD, blockCalculations) { var headerNodeData = this._getHeaderTreeNodeDataByCoords(coords); if (headerNodeData) { // Block the Selection module in controlling how the columns are selected. Pass the // responsibility of the column selection to this plugin (see "onAfterOnCellMouseDown" hook). blockCalculations.column = true; } } /** * Allows to control how the column selection based on the coordinates and the nested headers is made. * * @private * @param {MouseEvent} event Mouse event. * @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell. */ }, { key: "onAfterOnCellMouseDown", value: function onAfterOnCellMouseDown(event, coords) { var headerNodeData = this._getHeaderTreeNodeDataByCoords(coords); if (!headerNodeData) { return; } var selection = this.hot.selection; var currentSelection = selection.isSelected() ? selection.getSelectedRange().current() : null; var columnsToSelect = []; var columnIndex = headerNodeData.columnIndex, origColspan = headerNodeData.origColspan; // The Selection module doesn't allow it to extend its behavior easily. That's why here we need // to re-implement the "click" and "shift" behavior. As a workaround, the logic for the nested // headers must implement a similar logic as in the original Selection handler // (see src/selection/mouseEventHandler.js). var allowRightClickSelection = !selection.inInSelection(coords); if (event.shiftKey && currentSelection) { if (coords.col < currentSelection.from.col) { columnsToSelect.push(currentSelection.getTopRightCorner().col, columnIndex, coords.row); } else if (coords.col > currentSelection.from.col) { columnsToSelect.push(currentSelection.getTopLeftCorner().col, columnIndex + origColspan - 1, coords.row); } else { columnsToSelect.push(columnIndex, columnIndex + origColspan - 1, coords.row); } } else if (Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_19__["isLeftClick"])(event) || Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_19__["isRightClick"])(event) && allowRightClickSelection) { columnsToSelect.push(columnIndex, columnIndex + origColspan - 1, coords.row); } // The plugin takes control of the how the columns are selected. selection.selectColumns.apply(selection, columnsToSelect); } /** * Makes the header-selection properly select the nested headers. * * @private * @param {MouseEvent} event Mouse event. * @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell. * @param {HTMLElement} TD The cell element. * @param {object} blockCalculations An object with keys `row`, `column` and `cell` which contains boolean values. * This object allows or disallows changing the selection for the particular axies. */ }, { key: "onBeforeOnCellMouseOver", value: function onBeforeOnCellMouseOver(event, coords, TD, blockCalculations) { var _this$hot; if (!this.hot.view.isMouseDown()) { return; } var headerNodeData = this._getHeaderTreeNodeDataByCoords(coords); if (!headerNodeData) { return; } var columnIndex = headerNodeData.columnIndex, origColspan = headerNodeData.origColspan; var selectedRange = this.hot.getSelectedRangeLast(); var topLeftCoords = selectedRange.getTopLeftCorner(); var bottomRightCoords = selectedRange.getBottomRightCorner(); var from = selectedRange.from; // Block the Selection module in controlling how the columns and cells are selected. // From now on, the plugin is responsible for the selection. blockCalculations.column = true; blockCalculations.cell = true; var columnsToSelect = []; if (coords.col < from.col) { columnsToSelect.push(bottomRightCoords.col, columnIndex); } else if (coords.col > from.col) { columnsToSelect.push(topLeftCoords.col, columnIndex + origColspan - 1); } else { columnsToSelect.push(columnIndex, columnIndex + origColspan - 1); } (_this$hot = this.hot).selectColumns.apply(_this$hot, columnsToSelect); } /** * `afterGetColumnHeader` hook callback - prepares the header structure. * * @private * @param {Array} renderersArray Array of renderers. */ }, { key: "onAfterGetColumnHeaderRenderers", value: function onAfterGetColumnHeaderRenderers(renderersArray) { if (renderersArray) { renderersArray.length = 0; for (var headerLayer = 0; headerLayer < _classPrivateFieldGet(this, _stateManager).getLayersCount(); headerLayer++) { renderersArray.push(this.headerRendererFactory(headerLayer)); } } } /** * Make the renderer render the first nested column in its entirety. * * @private * @param {object} calc Viewport column calculator. */ }, { key: "onAfterViewportColumnCalculatorOverride", value: function onAfterViewportColumnCalculatorOverride(calc) { var headerLayersCount = _classPrivateFieldGet(this, _stateManager).getLayersCount(); var newStartColumn = calc.startColumn; var nonRenderable = !!headerLayersCount; for (var headerLayer = 0; headerLayer < headerLayersCount; headerLayer++) { var startColumn = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(headerLayer, calc.startColumn); var renderedStartColumn = this.hot.columnIndexMapper.getRenderableFromVisualIndex(startColumn); // If any of the headers for that column index is rendered, all of them should be rendered properly, see // comment below. if (startColumn >= 0) { nonRenderable = false; } // `renderedStartColumn` can be `null` if the leftmost columns are hidden. In that case -> ignore that header // level, as it should be handled by the "parent" header if (Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_18__["isNumeric"])(renderedStartColumn) && renderedStartColumn < calc.startColumn) { newStartColumn = renderedStartColumn; break; } } // If no headers for the provided column index are renderable, start rendering from the beginning of the upmost // header for that position. calc.startColumn = nonRenderable ? _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(0, newStartColumn).columnIndex : newStartColumn; } /** * `modifyColWidth` hook callback - returns width from cache, when is greater than incoming from hook. * * @private * @param {number} width Width from hook. * @param {number} column Visual index of an column. * @returns {number} */ }, { key: "onModifyColWidth", value: function onModifyColWidth(width, column) { var cachedWidth = this.ghostTable.widthsCache[column]; return width > cachedWidth ? width : cachedWidth; } /** * Updates the plugin state after HoT initialization. * * @private */ }, { key: "onInit", value: function onInit() { // @TODO: Workaround for broken plugin initialization abstraction. this.updatePlugin(); } /** * Updates the plugin state after new dataset load. * * @private * @param {Array[]} sourceData Array of arrays or array of objects containing data. * @param {boolean} initialLoad Flag that determines whether the data has been loaded * during the initialization. */ }, { key: "onAfterLoadData", value: function onAfterLoadData(sourceData, initialLoad) { if (!initialLoad) { this.updatePlugin(); } } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { _classPrivateFieldSet(this, _stateManager, null); if (_classPrivateFieldGet(this, _hidingIndexMapObserver) !== null) { _classPrivateFieldGet(this, _hidingIndexMapObserver).unsubscribe(); _classPrivateFieldSet(this, _hidingIndexMapObserver, null); } _get(_getPrototypeOf(NestedHeaders.prototype), "destroy", this).call(this); } /** * Gets the tree data that belongs to the column headers pointed by the passed coordinates. * * @private * @param {CellCoords} coords The CellCoords instance. * @returns {object|undefined} */ }, { key: "_getHeaderTreeNodeDataByCoords", value: function _getHeaderTreeNodeDataByCoords(coords) { if (coords.row >= 0 || coords.col < 0) { return; } return _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(coords.row, coords.col); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } /** * The state manager for the nested headers. * * @private * @type {StateManager} */ }]); return NestedHeaders; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_23__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/headersTree.mjs": /*!**************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/stateManager/headersTree.mjs ***! \**************************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadersTree; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _utils_dataStructures_tree_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../utils/dataStructures/tree.mjs */ "./node_modules/handsontable/utils/dataStructures/tree.mjs"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } /* eslint-disable jsdoc/require-description-complete-sentence */ /** * @class HeadersTree * * The header tree class keeps nested header settings in the tree * structure for easier node manipulation (e.q collapse or expand column). * That trees represent the current state of the nested headers. From the * trees, the matrix is generated for nested header renderers. * * The second role of the module is validation. While building the tree, * there is check whether the configuration contains overlapping * headers. If true, then the exception is thrown. * * The tree is static; it means that its column indexing never changes * even when a collapsing header is performed. The structure is based * on visual column indexes. * * For example, for that header configuration: * +----+----+----+----+----+ * │ A1 │ A2 │ * +----+----+----+----+----+ * │ B1 │ B2 │ B3 │ * +----+----+----+----+----+ * │ C1 │ C2 │ C3 │ C4 │ * +----+----+----+----+----+ * * The tree structures look like: * (0) (4) // a visual column index * │ │ * .------(A1)------. (A2)--. * .--(B1)--. (B2)--. (B3)--. * (C1) (C2) (C3) (C4) * * @plugin NestedHeaders */ /* eslint-enable jsdoc/require-description-complete-sentence */ var _rootNodes = /*#__PURE__*/new WeakMap(); var _rootsIndex = /*#__PURE__*/new WeakMap(); var _sourceSettings = /*#__PURE__*/new WeakMap(); var HeadersTree = /*#__PURE__*/function () { /** * The collection of nested headers settings structured into trees. The root trees are stored * under the visual column index. * * @private * @type {Map} */ /** * A map that translates the visual column indexes that intersect the range * defined by the header colspan width to the root index. * * @private * @type {Map} */ /** * The instance of the SourceSettings class. * * @private * @type {SourceSettings} */ function HeadersTree(sourceSettings) { _classCallCheck(this, HeadersTree); _rootNodes.set(this, { writable: true, value: new Map() }); _rootsIndex.set(this, { writable: true, value: new Map() }); _sourceSettings.set(this, { writable: true, value: null }); _classPrivateFieldSet(this, _sourceSettings, sourceSettings); } /** * Gets an array of the all root nodes. * * @returns {TreeNode[]} */ _createClass(HeadersTree, [{ key: "getRoots", value: function getRoots() { return Array.from(_classPrivateFieldGet(this, _rootNodes).values()); } /** * Gets a root node by specified visual column index. * * @param {number} columnIndex A visual column index. * @returns {TreeNode|undefined} */ }, { key: "getRootByColumn", value: function getRootByColumn(columnIndex) { var node; if (_classPrivateFieldGet(this, _rootsIndex).has(columnIndex)) { node = _classPrivateFieldGet(this, _rootNodes).get(_classPrivateFieldGet(this, _rootsIndex).get(columnIndex)); } return node; } /** * Gets a tree node by its position in the grid settings. * * @param {number} headerLevel Header level index (there is support only for positive values). * @param {number} columnIndex A visual column index. * @returns {TreeNode|undefined} */ }, { key: "getNode", value: function getNode(headerLevel, columnIndex) { var rootNode = this.getRootByColumn(columnIndex); if (!rootNode) { return; } // Normalize the visual column index to a 0-based system for a specific "box" defined // by root node colspan width. var normColumnIndex = columnIndex - _classPrivateFieldGet(this, _rootsIndex).get(columnIndex); var columnCursor = 0; var treeNode; // Collect all parent nodes that depend on the collapsed node. rootNode.walkDown(function (node) { var _node$data = node.data, origColspan = _node$data.origColspan, nodeHeaderLevel = _node$data.headerLevel; if (headerLevel === nodeHeaderLevel) { if (normColumnIndex >= columnCursor && normColumnIndex <= columnCursor + origColspan - 1) { treeNode = node; return false; // Cancel tree traversing. } columnCursor += origColspan; } }); return treeNode; } /** * Builds (or rebuilds if called again) root nodes indexes. */ }, { key: "rebuildTreeIndex", value: function rebuildTreeIndex() { var _this = this; var columnIndex = 0; _classPrivateFieldGet(this, _rootsIndex).clear(); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayEach"])(_classPrivateFieldGet(this, _rootNodes), function (_ref) { var _ref2 = _slicedToArray(_ref, 2), colspan = _ref2[1].data.colspan; // Map tree range (colspan range/width) into visual column index of the root node. for (var i = columnIndex; i < columnIndex + colspan; i++) { _classPrivateFieldGet(_this, _rootsIndex).set(i, columnIndex); } columnIndex += colspan; }); } /** * Builds trees based on SourceSettings class. Calling a method causes clearing the tree state built * from the previous call. */ }, { key: "buildTree", value: function buildTree() { this.clear(); var columnsCount = _classPrivateFieldGet(this, _sourceSettings).getColumnsCount(); var columnIndex = 0; while (columnIndex < columnsCount) { var columnSettings = _classPrivateFieldGet(this, _sourceSettings).getHeaderSettings(0, columnIndex); var rootNode = new _utils_dataStructures_tree_mjs__WEBPACK_IMPORTED_MODULE_18__["default"](); _classPrivateFieldGet(this, _rootNodes).set(columnIndex, rootNode); this.buildLeaves(rootNode, columnIndex, 0, columnSettings.origColspan); columnIndex += columnSettings.origColspan; } this.rebuildTreeIndex(); } /** * Builds leaves for specified tree node. * * @param {TreeNode} parentNode A node to which the leaves applies. * @param {number} columnIndex A visual column index. * @param {number} headerLevel Currently processed header level. * @param {number} [extractionLength=1] Determines column extraction length for node children. */ }, { key: "buildLeaves", value: function buildLeaves(parentNode, columnIndex, headerLevel) { var _this2 = this; var extractionLength = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; var columnsSettings = _classPrivateFieldGet(this, _sourceSettings).getHeadersSettings(headerLevel, columnIndex, extractionLength); headerLevel += 1; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_17__["arrayEach"])(columnsSettings, function (columnSettings) { var nodeData = _objectSpread(_objectSpread({}, columnSettings), {}, { /** * The header level (tree node depth level). * * @type {number} */ headerLevel: headerLevel - 1, /** * A visual column index. * * @type {number} */ columnIndex: columnIndex }); var node; if (headerLevel === 1) { // fill the root node parentNode.data = nodeData; node = parentNode; } else { node = new _utils_dataStructures_tree_mjs__WEBPACK_IMPORTED_MODULE_18__["default"](nodeData); parentNode.addChild(node); } if (headerLevel < _classPrivateFieldGet(_this2, _sourceSettings).getLayersCount()) { _this2.buildLeaves(node, columnIndex, headerLevel, columnSettings.origColspan); } columnIndex += columnSettings.origColspan; }); } /** * Clears the tree to the initial state. */ }, { key: "clear", value: function clear() { _classPrivateFieldGet(this, _rootNodes).clear(); _classPrivateFieldGet(this, _rootsIndex).clear(); } }]); return HeadersTree; }(); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/index.mjs": /*!********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/stateManager/index.mjs ***! \********************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StateManager; }); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _sourceSettings_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sourceSettings.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/sourceSettings.mjs"); /* harmony import */ var _headersTree_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./headersTree.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/headersTree.mjs"); /* harmony import */ var _nodeModifiers_index_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./nodeModifiers/index.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/index.mjs"); /* harmony import */ var _matrixGenerator_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./matrixGenerator.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/matrixGenerator.mjs"); var _excluded = ["row"]; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } /** * The state manager is a source of truth for nested headers configuration. * The state generation process is divided into three stages. * * +---------------------+ 1. User-defined configuration normalization; * │ │ The source settings class normalizes and shares API for * │ SourceSettings │ raw settings passed by the developer. It is only consumed by * │ │ the header tree module. * +---------------------+ * │ * \│/ * +---------------------+ 2. Building a tree structure for validation and easier node manipulation; * │ │ The header tree generates a tree based on source settings for future * │ HeadersTree │ node manipulation (such as collapsible columns feature). While generating a tree * │ │ the source settings is checked to see if the configuration has overlapping headers. * +---------------------+ If `true` the colspan matrix generation is skipped, overlapped headers are not supported. * │ * \│/ * +---------------------+ 3. Matrix generation; * │ │ Based on built trees the matrix generation is performed. That part of code * │ matrix generation │ generates an array structure similar to normalized data from the SourceSettings * │ │ but with the difference that this structure contains column settings which changed * +---------------------+ during runtime (after the tree manipulation) e.q after collapse or expand column. * That settings describes how the TH element should be modified (colspan attribute, * CSS classes, etc) for a specific column and layer level. * * @class StateManager * @plugin NestedHeaders */ var _sourceSettings = /*#__PURE__*/new WeakMap(); var _headersTree = /*#__PURE__*/new WeakMap(); var _stateMatrix = /*#__PURE__*/new WeakMap(); var StateManager = /*#__PURE__*/function () { function StateManager() { _classCallCheck(this, StateManager); _sourceSettings.set(this, { writable: true, value: new _sourceSettings_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]() }); _headersTree.set(this, { writable: true, value: new _headersTree_mjs__WEBPACK_IMPORTED_MODULE_15__["default"](_classPrivateFieldGet(this, _sourceSettings)) }); _stateMatrix.set(this, { writable: true, value: [[]] }); } _createClass(StateManager, [{ key: "setState", value: /** * Sets a new state for the nested headers plugin based on settings passed * directly to the plugin. * * @param {Array[]} nestedHeadersSettings The user-defined settings. * @returns {boolean} Returns `true` if the settings are processed correctly, `false` otherwise. */ function setState(nestedHeadersSettings) { _classPrivateFieldGet(this, _sourceSettings).setData(nestedHeadersSettings); var hasError = false; try { _classPrivateFieldGet(this, _headersTree).buildTree(); } catch (ex) { _classPrivateFieldGet(this, _headersTree).clear(); _classPrivateFieldGet(this, _sourceSettings).clear(); hasError = true; } _classPrivateFieldSet(this, _stateMatrix, Object(_matrixGenerator_mjs__WEBPACK_IMPORTED_MODULE_17__["generateMatrix"])(_classPrivateFieldGet(this, _headersTree).getRoots())); return hasError; } /** * Sets columns limit to the state will be trimmed. All headers (colspans) which * overlap the column limit will be reduced to keep the structure solid. * * @param {number} columnsCount The number of columns to limit to. */ }, { key: "setColumnsLimit", value: function setColumnsLimit(columnsCount) { _classPrivateFieldGet(this, _sourceSettings).setColumnsLimit(columnsCount); } /** * Merges settings with current plugin state. * * By default only foreign keys are merged with source state and passed to the tree. But only * known keys are exported to matrix. * * @param {object[]} settings An array of objects to merge with the current source settings. * It is a requirement that every object has `row` and `col` properties * which points to the specific header settings object. */ }, { key: "mergeStateWith", value: function mergeStateWith(settings) { var _this = this; var transformedSettings = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayMap"])(settings, function (_ref) { var row = _ref.row, rest = _objectWithoutProperties(_ref, _excluded); return _objectSpread({ row: row < 0 ? _this.rowCoordsToLevel(row) : row }, rest); }); _classPrivateFieldGet(this, _sourceSettings).mergeWith(transformedSettings); _classPrivateFieldGet(this, _headersTree).buildTree(); _classPrivateFieldSet(this, _stateMatrix, Object(_matrixGenerator_mjs__WEBPACK_IMPORTED_MODULE_17__["generateMatrix"])(_classPrivateFieldGet(this, _headersTree).getRoots())); } /** * Maps the current state with a callback. For each header settings the callback function * is called. If the function returns value that value is merged with the state. * * By default only foreign keys are merged with source state and passed to the tree. But only * known keys are exported to matrix. * * @param {Function} callback A function that is called for every header source settings. * Each time the callback is called, the returned value extends * header settings. */ }, { key: "mapState", value: function mapState(callback) { _classPrivateFieldGet(this, _sourceSettings).map(callback); _classPrivateFieldGet(this, _headersTree).buildTree(); _classPrivateFieldSet(this, _stateMatrix, Object(_matrixGenerator_mjs__WEBPACK_IMPORTED_MODULE_17__["generateMatrix"])(_classPrivateFieldGet(this, _headersTree).getRoots())); } /** * Maps the current tree nodes with a callback. For each node the callback function * is called. If the function returns value that value is added to returned array. * * @param {Function} callback A function that is called for every tree node. * Each time the callback is called, the returned value is * added to returned array. * @returns {Array} */ }, { key: "mapNodes", value: function mapNodes(callback) { return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayReduce"])(_classPrivateFieldGet(this, _headersTree).getRoots(), function (acc, rootNode) { rootNode.walkDown(function (node) { var result = callback(node.data); if (result !== void 0) { acc.push(result); } }); return acc; }, []); } /** * Triggers an action (e.g. "collapse") from the NodeModifiers module. The module * modifies a tree structure in such a way as to obtain the correct structure consistent with the * called action. * * @param {string} action An action name to trigger. * @param {number} headerLevel Header level index (there is support for negative and positive values). * @param {number} columnIndex A visual column index. * @returns {object|undefined} */ }, { key: "triggerNodeModification", value: function triggerNodeModification(action, headerLevel, columnIndex) { if (headerLevel < 0) { headerLevel = this.rowCoordsToLevel(headerLevel); } var nodeToProcess = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex); var actionResult; if (nodeToProcess) { actionResult = Object(_nodeModifiers_index_mjs__WEBPACK_IMPORTED_MODULE_16__["triggerNodeModification"])(action, nodeToProcess, columnIndex); // TODO (perf-tip): Trigger matrix generation once after multiple node modifications. _classPrivateFieldSet(this, _stateMatrix, Object(_matrixGenerator_mjs__WEBPACK_IMPORTED_MODULE_17__["generateMatrix"])(_classPrivateFieldGet(this, _headersTree).getRoots())); } return actionResult; } /** * Triggers an action (e.g. "hide-column") from the NodeModifiers module. The action is * triggered starting from the lowest header. The module modifies a tree structure in * such a way as to obtain the correct structure consistent with the called action. * * @param {string} action An action name to trigger. * @param {number} columnIndex A visual column index. * @returns {object|undefined} */ }, { key: "triggerColumnModification", value: function triggerColumnModification(action, columnIndex) { return this.triggerNodeModification(action, -1, columnIndex); } /* eslint-disable jsdoc/require-description-complete-sentence */ /** * @memberof StateManager# * @function rowCoordsToLevel * * Translates row coordinates into header level. The row coordinates counts from -1 to -N * and describes headers counting from most closest to most distant from the table. * The header levels are counted from 0 to N where 0 describes most distant header * from the table. * * Row coords Header level * +--------------+ * -3 │ A1 │ A1 │ 0 * +--------------+ * -2 │ B1 │ B2 │ B3 │ 1 * +--------------+ * -1 │ C1 │ C2 │ C3 │ 2 * +==============+ * │ │ │ │ * +--------------+ * │ │ │ │ * * @param {number} rowIndex A visual row index. * @returns {number} Returns unsigned number. */ /* eslint-enable jsdoc/require-description-complete-sentence */ }, { key: "rowCoordsToLevel", value: function rowCoordsToLevel(rowIndex) { var layersCount = Math.max(this.getLayersCount(), 1); var highestPossibleLevel = layersCount - 1; var lowestPossibleLevel = 0; return Math.min(Math.max(rowIndex + layersCount, lowestPossibleLevel), highestPossibleLevel); } /* eslint-disable jsdoc/require-description-complete-sentence */ /** * @memberof StateManager# * @function levelToRowCoords * * Translates header level into row coordinates. The row coordinates counts from -1 to -N * and describes headers counting from most closest to most distant from the table. * The header levels are counted from 0 to N where 0 describes most distant header * from the table. * * Header level Row coords * +--------------+ * 0 │ A1 │ A1 │ -3 * +--------------+ * 1 │ B1 │ B2 │ B3 │ -2 * +--------------+ * 2 │ C1 │ C2 │ C3 │ -1 * +==============+ * │ │ │ │ * +--------------+ * │ │ │ │ * * @param {number} headerLevel Header level index. * @returns {number} Returns negative number. */ /* eslint-enable jsdoc/require-description-complete-sentence */ }, { key: "levelToRowCoords", value: function levelToRowCoords(headerLevel) { var layersCount = Math.max(this.getLayersCount(), 1); var highestPossibleRow = -1; var lowestPossibleRow = -layersCount; return Math.min(Math.max(headerLevel - layersCount, lowestPossibleRow), highestPossibleRow); } /** * Gets column header settings for a specified column and header index. The returned object contains * all information necessary for header renderers. It contains header label, colspan length, or hidden * flag. * * @param {number} headerLevel Header level (there is support for negative and positive values). * @param {number} columnIndex A visual column index. * @returns {object|null} */ }, { key: "getHeaderSettings", value: function getHeaderSettings(headerLevel, columnIndex) { var _classPrivateFieldGet2, _classPrivateFieldGet3; if (headerLevel < 0) { headerLevel = this.rowCoordsToLevel(headerLevel); } if (headerLevel >= this.getLayersCount()) { return null; } return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateMatrix)[headerLevel]) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3[columnIndex]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : null; } /** * Gets tree data that is connected to the column header. The returned object contains all information * necessary for modifying tree structure (column collapsing, hiding, etc.). It contains a header * label, colspan length, or visual column index that indicates which column index the node is rendered from. * * @param {number} headerLevel Header level (there is support for negative and positive values). * @param {number} columnIndex A visual column index. * @returns {object|null} */ }, { key: "getHeaderTreeNodeData", value: function getHeaderTreeNodeData(headerLevel, columnIndex) { if (headerLevel < 0) { headerLevel = this.rowCoordsToLevel(headerLevel); } var node = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex); if (!node) { return null; } return _objectSpread({}, node.data); } /** * The method is helpful in cases where the column index targets in-between currently * collapsed column. In that case, the method returns the left-most column index * where the nested header begins. * * @param {number} headerLevel Header level (there is support for negative and positive values). * @param {number} columnIndex A visual column index. * @returns {number} */ }, { key: "findLeftMostColumnIndex", value: function findLeftMostColumnIndex(headerLevel, columnIndex) { var _this$getHeaderSettin; var _ref2 = (_this$getHeaderSettin = this.getHeaderSettings(headerLevel, columnIndex)) !== null && _this$getHeaderSettin !== void 0 ? _this$getHeaderSettin : { isRoot: true }, isRoot = _ref2.isRoot; if (isRoot) { return columnIndex; } var stepBackColumn = columnIndex - 1; while (stepBackColumn >= 0) { var _this$getHeaderSettin2; var _ref3 = (_this$getHeaderSettin2 = this.getHeaderSettings(headerLevel, stepBackColumn)) !== null && _this$getHeaderSettin2 !== void 0 ? _this$getHeaderSettin2 : { isRoot: true }, isRootNode = _ref3.isRoot; if (isRootNode) { break; } stepBackColumn -= 1; } return stepBackColumn; } /** * Gets a total number of headers levels. * * @returns {number} */ }, { key: "getLayersCount", value: function getLayersCount() { return _classPrivateFieldGet(this, _sourceSettings).getLayersCount(); } /** * Gets a total number of columns count. * * @returns {number} */ }, { key: "getColumnsCount", value: function getColumnsCount() { return _classPrivateFieldGet(this, _sourceSettings).getColumnsCount(); } /** * Clears the column state manager to the initial state. */ }, { key: "clear", value: function clear() { _classPrivateFieldSet(this, _stateMatrix, []); _classPrivateFieldGet(this, _sourceSettings).clear(); _classPrivateFieldGet(this, _headersTree).clear(); } }]); return StateManager; }(); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/matrixGenerator.mjs": /*!******************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/stateManager/matrixGenerator.mjs ***! \******************************************************************************************/ /*! exports provided: generateMatrix */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generateMatrix", function() { return generateMatrix; }); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/utils.mjs"); var _excluded = ["crossHiddenColumns"]; function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /* eslint-disable jsdoc/require-description-complete-sentence */ /** * A function that dump a tree structure into multidimensional array. That structure is * later processed by header renderers to modify TH elements to achieve a proper * DOM structure. * * That structure contains settings object for every TH element generated by Walkontable. * The matrix operates on visual column index. * * Output example: * [ * [ * { label: 'A1', colspan: 2, origColspan: 2, isHidden: false, ... }, * { label: '', colspan: 1, origColspan: 1, isHidden: true, ... }, * { label: '', colspan: 1, origColspan: 1, isHidden: false, ... }, * ], * [ * { label: 'true', colspan: 1, origColspan: 1, isHidden: false, ... }, * { label: 'B2', colspan: 1, origColspan: 1, isHidden: false, ... }, * { label: '4', colspan: 1, origColspan: 1, isHidden: false, ... }, * ], * [ * { label: '', colspan: 1, origColspan: 1, isHidden: false, ... }, * { label: '', colspan: 1, origColspan: 1, isHidden: false, ... }, * { label: '', colspan: 1, origColspan: 1, isHidden: false, ... }, * ], * ] * * @param {TreeNode[]} headerRoots An array of root nodes. * @returns {Array[]} */ function generateMatrix(headerRoots) { var matrix = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_5__["arrayEach"])(headerRoots, function (rootNode) { rootNode.walkDown(function (node) { var nodeData = node.data; var origColspan = nodeData.origColspan, columnIndex = nodeData.columnIndex, headerLevel = nodeData.headerLevel, crossHiddenColumns = nodeData.crossHiddenColumns; var colspanHeaderLayer = createNestedArrayIfNecessary(matrix, headerLevel); var isRootSettingsFound = false; for (var i = columnIndex; i < columnIndex + origColspan; i++) { var isColumnHidden = crossHiddenColumns.includes(i); if (isColumnHidden || isRootSettingsFound) { colspanHeaderLayer.push(Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_6__["createPlaceholderHeaderSettings"])(nodeData)); } else { var headerRootSettings = createHeaderSettings(nodeData); headerRootSettings.isRoot = true; colspanHeaderLayer.push(headerRootSettings); isRootSettingsFound = true; } } }); }); return matrix; } /** * Creates header settings object. * * @param {object} nodeData The tree data object. * @returns {object} */ function createHeaderSettings(nodeData) { // For the matrix module we do not need to export "crossHiddenColumns" key. It's redundant here. var _createDefaultHeaderS = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_6__["createDefaultHeaderSettings"])(nodeData), crossHiddenColumns = _createDefaultHeaderS.crossHiddenColumns, headerRootSettings = _objectWithoutProperties(_createDefaultHeaderS, _excluded); return headerRootSettings; } /** * Internal helper which ensures that subarray exists under specified index. * * @param {Array[]} array An array to check. * @param {number} index An array index under the subarray should be checked. * @returns {Array} */ function createNestedArrayIfNecessary(array, index) { var subArray; if (Array.isArray(array[index])) { subArray = array[index]; } else { subArray = []; array[index] = subArray; } return subArray; } /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs": /*!*************************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs ***! \*************************************************************************************************/ /*! exports provided: collapseNode */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "collapseNode", function() { return collapseNode; }); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _expand_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./expand.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs"); /* harmony import */ var _utils_tree_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/tree.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/utils/tree.mjs"); /** * Collapsing a node is a process where the processing node is collapsed * to the colspan width of the first child. All node children, except the * first one, are hidden. To prevent losing a current state of node children * on the right, all nodes are cloned (and restored while expanding), and * only then original nodes are modified (hidden in this case). * * @param {TreeNode} nodeToProcess A tree node to process. * @returns {object} Returns an object with properties: * - rollbackModification: The function that rollbacks * the tree to the previous state. * - affectedColumns: The list of the visual column * indexes which are affected. That list is passed * to the hiddens column logic. * - colspanCompensation: The number of colspan by * which the processed node colspan was reduced. */ function collapseNode(nodeToProcess) { var _getFirstChildPropert; var nodeData = nodeToProcess.data, nodeChilds = nodeToProcess.childs; if (nodeData.isCollapsed || nodeData.isHidden || nodeData.origColspan <= 1) { return { rollbackModification: function rollbackModification() {}, affectedColumns: [], colspanCompensation: 0 }; } var isNodeReflected = Object(_utils_tree_mjs__WEBPACK_IMPORTED_MODULE_9__["isNodeReflectsFirstChildColspan"])(nodeToProcess); if (isNodeReflected) { return collapseNode(nodeChilds[0]); } nodeData.isCollapsed = true; var allLeavesExceptMostLeft = nodeChilds.slice(1); var affectedColumns = new Set(); if (allLeavesExceptMostLeft.length > 0) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_7__["arrayEach"])(allLeavesExceptMostLeft, function (node) { Object(_utils_tree_mjs__WEBPACK_IMPORTED_MODULE_9__["traverseHiddenNodeColumnIndexes"])(node, function (gridColumnIndex) { affectedColumns.add(gridColumnIndex); }); // Clone the tree to preserve original tree state after header expanding. node.data.clonedTree = node.cloneTree(); // Hide all leaves except the first leaf on the left (on headers context hide all // headers on the right). node.walkDown(function (_ref) { var data = _ref.data; data.isHidden = true; }); }); } else { var origColspan = nodeData.origColspan, columnIndex = nodeData.columnIndex; // Add column to "affected" started from 1. The header without children can not be // collapsed so the first have to be visible (untouched). for (var i = 1; i < origColspan; i++) { var gridColumnIndex = columnIndex + i; affectedColumns.add(gridColumnIndex); } } // Calculate by how many colspan it needs to reduce the headings to match them to // the first child colspan width. var colspanCompensation = nodeData.colspan - ((_getFirstChildPropert = Object(_utils_tree_mjs__WEBPACK_IMPORTED_MODULE_9__["getFirstChildProperty"])(nodeToProcess, 'colspan')) !== null && _getFirstChildPropert !== void 0 ? _getFirstChildPropert : 1); nodeToProcess.walkUp(function (node) { var data = node.data; data.colspan -= colspanCompensation; if (data.colspan <= 1) { data.colspan = 1; data.isCollapsed = true; } else if (Object(_utils_tree_mjs__WEBPACK_IMPORTED_MODULE_9__["isNodeReflectsFirstChildColspan"])(node)) { data.isCollapsed = Object(_utils_tree_mjs__WEBPACK_IMPORTED_MODULE_9__["getFirstChildProperty"])(node, 'isCollapsed'); } }); return { rollbackModification: function rollbackModification() { return Object(_expand_mjs__WEBPACK_IMPORTED_MODULE_8__["expandNode"])(nodeToProcess); }, affectedColumns: Array.from(affectedColumns), colspanCompensation: colspanCompensation }; } /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs": /*!***********************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs ***! \***********************************************************************************************/ /*! exports provided: expandNode */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expandNode", function() { return expandNode; }); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _collapse_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./collapse.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs"); /* harmony import */ var _utils_tree_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/tree.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/utils/tree.mjs"); /** * Expanding a node is a process where the processing node is expanded to * its original colspan width. To restore an original state of all node * children on the right, the modified nodes are replaced with the cloned * nodes (they were cloned while collapsing). * * @param {TreeNode} nodeToProcess A tree node to process. * @returns {object} Returns an object with properties: * - rollbackModification: The function that rollbacks * the tree to the previous state. * - affectedColumns: The list of the visual column * indexes which are affected. That list is passed * to the hiddens column logic. * - colspanCompensation: The number of colspan by * which the processed node colspan was increased. */ function expandNode(nodeToProcess) { var nodeData = nodeToProcess.data, nodeChilds = nodeToProcess.childs; if (!nodeData.isCollapsed || nodeData.isHidden || nodeData.origColspan <= 1) { return { rollbackModification: function rollbackModification() {}, affectedColumns: [], colspanCompensation: 0 }; } var isNodeReflected = Object(_utils_tree_mjs__WEBPACK_IMPORTED_MODULE_9__["isNodeReflectsFirstChildColspan"])(nodeToProcess); if (isNodeReflected) { return expandNode(nodeChilds[0]); } nodeData.isCollapsed = false; var allLeavesExceptMostLeft = nodeChilds.slice(1); var affectedColumns = new Set(); var colspanCompensation = 0; if (allLeavesExceptMostLeft.length > 0) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_7__["arrayEach"])(allLeavesExceptMostLeft, function (node) { // Restore original state of the collapsed headers. node.replaceTreeWith(node.data.clonedTree); node.data.clonedTree = null; var leafData = node.data; // Calculate by how many colspan it needs to increase the headings to match them to // the colspan width of all its children. colspanCompensation += leafData.colspan; Object(_utils_tree_mjs__WEBPACK_IMPORTED_MODULE_9__["traverseHiddenNodeColumnIndexes"])(node, function (gridColumnIndex) { affectedColumns.add(gridColumnIndex); }); }); } else { var colspan = nodeData.colspan, origColspan = nodeData.origColspan, columnIndex = nodeData.columnIndex; // In a case when the node doesn't have any children restore the colspan width to // its original state. colspanCompensation = origColspan - colspan; // Add column to "affected" started from 1. The header without children can not be // collapsed so the first column is already visible and we shouldn't touch it. for (var i = 1; i < origColspan; i++) { affectedColumns.add(columnIndex + i); } } nodeToProcess.walkUp(function (node) { var data = node.data; data.colspan += colspanCompensation; if (data.colspan >= data.origColspan) { data.colspan = data.origColspan; data.isCollapsed = false; } else if (Object(_utils_tree_mjs__WEBPACK_IMPORTED_MODULE_9__["isNodeReflectsFirstChildColspan"])(node)) { data.isCollapsed = Object(_utils_tree_mjs__WEBPACK_IMPORTED_MODULE_9__["getFirstChildProperty"])(node, 'isCollapsed'); } }); return { rollbackModification: function rollbackModification() { return Object(_collapse_mjs__WEBPACK_IMPORTED_MODULE_8__["collapseNode"])(nodeToProcess); }, affectedColumns: Array.from(affectedColumns), colspanCompensation: colspanCompensation }; } /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/hideColumn.mjs": /*!***************************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/hideColumn.mjs ***! \***************************************************************************************************/ /*! exports provided: hideColumn */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hideColumn", function() { return hideColumn; }); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.freeze.js */ "./node_modules/core-js/modules/es.object.freeze.js"); /* harmony import */ var core_js_modules_es_number_is_integer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.number.is-integer.js */ "./node_modules/core-js/modules/es.number.is-integer.js"); /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.number.constructor.js */ "./node_modules/core-js/modules/es.number.constructor.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var _helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../helpers/templateLiteralTag.mjs */ "./node_modules/handsontable/helpers/templateLiteralTag.mjs"); var _templateObject; function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } /** * @param {TreeNode} nodeToProcess A tree node to process. * @param {number} gridColumnIndex The visual column index that triggers the node modification. * The index can be between the root node column index and * column index plus node colspan length. */ function hideColumn(nodeToProcess, gridColumnIndex) { if (!Number.isInteger(gridColumnIndex)) { throw new Error('The passed gridColumnIndex argument has invalid type.'); } if (nodeToProcess.childs.length > 0) { throw new Error(Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_6__["toSingleLine"])(_templateObject || (_templateObject = _taggedTemplateLiteral(["The passed node is not the last node on the tree. Only for \nthe last node, the hide column modification can be applied."], ["The passed node is not the last node on the tree. Only for\\x20\nthe last node, the hide column modification can be applied."])))); } var crossHiddenColumns = nodeToProcess.data.crossHiddenColumns; if (crossHiddenColumns.includes(gridColumnIndex)) { return; } var isCollapsibleNode = false; nodeToProcess.walkUp(function (node) { var collapsible = node.data.collapsible; if (collapsible) { isCollapsibleNode = true; return false; // Cancel tree traversing } }); // TODO: When the node is collapsible do not hide the column. Currently collapsible headers // does not work with hidden columns (hidden index map types). if (isCollapsibleNode) { return; } nodeToProcess.walkUp(function (node) { var data = node.data; data.crossHiddenColumns.push(gridColumnIndex); if (data.colspan > 1) { data.colspan -= 1; } else { data.isHidden = true; } }); } /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/index.mjs": /*!**********************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/index.mjs ***! \**********************************************************************************************/ /*! exports provided: triggerNodeModification */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "triggerNodeModification", function() { return triggerNodeModification; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _collapse_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./collapse.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs"); /* harmony import */ var _expand_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./expand.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs"); /* harmony import */ var _hideColumn_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./hideColumn.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/hideColumn.mjs"); /* harmony import */ var _showColumn_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./showColumn.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/showColumn.mjs"); /** * The NodeModifiers module is responsible for the modification of a tree structure * in a way to achieve new column headers state. */ var availableModifiers = new Map([['collapse', _collapse_mjs__WEBPACK_IMPORTED_MODULE_5__["collapseNode"]], ['expand', _expand_mjs__WEBPACK_IMPORTED_MODULE_6__["expandNode"]], ['hide-column', _hideColumn_mjs__WEBPACK_IMPORTED_MODULE_7__["hideColumn"]], ['show-column', _showColumn_mjs__WEBPACK_IMPORTED_MODULE_8__["showColumn"]]]); /** * An entry point for triggering a node modifiers. If the triggered action * does not exist the exception is thrown. * * @param {string} actionName An action name to trigger. * @param {TreeNode} nodeToProcess A tree node to process. * @param {number} gridColumnIndex The visual column index that comes from the nested headers grid. * The index, as opposed to the `columnIndex` in the tree node * (which describes the column index of the root node of the header * element), describes the index passed from the grid. Hence, the * index can be between the column index of the node and its colspan * width. * @returns {object} */ function triggerNodeModification(actionName, nodeToProcess, gridColumnIndex) { if (!availableModifiers.has(actionName)) { throw new Error("The node modifier action (\"".concat(actionName, "\") does not exist.")); } return availableModifiers.get(actionName)(nodeToProcess, gridColumnIndex); } /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/showColumn.mjs": /*!***************************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/showColumn.mjs ***! \***************************************************************************************************/ /*! exports provided: showColumn */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showColumn", function() { return showColumn; }); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.freeze.js */ "./node_modules/core-js/modules/es.object.freeze.js"); /* harmony import */ var core_js_modules_es_number_is_integer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.number.is-integer.js */ "./node_modules/core-js/modules/es.number.is-integer.js"); /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.number.constructor.js */ "./node_modules/core-js/modules/es.number.constructor.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var _helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../helpers/templateLiteralTag.mjs */ "./node_modules/handsontable/helpers/templateLiteralTag.mjs"); var _templateObject; function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } /** * @param {TreeNode} nodeToProcess A tree node to process. * @param {number} gridColumnIndex The visual column index that triggers the node modification. * The index can be between the root node column index and * column index plus node colspan length. */ function showColumn(nodeToProcess, gridColumnIndex) { if (!Number.isInteger(gridColumnIndex)) { throw new Error('The passed gridColumnIndex argument has invalid type.'); } if (nodeToProcess.childs.length > 0) { throw new Error(Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_8__["toSingleLine"])(_templateObject || (_templateObject = _taggedTemplateLiteral(["The passed node is not the last node on the tree. Only for \nthe last node, the show column modification can be applied."], ["The passed node is not the last node on the tree. Only for\\x20\nthe last node, the show column modification can be applied."])))); } var crossHiddenColumns = nodeToProcess.data.crossHiddenColumns; if (!crossHiddenColumns.includes(gridColumnIndex)) { return; } var isCollapsibleNode = false; nodeToProcess.walkUp(function (node) { var collapsible = node.data.collapsible; if (collapsible) { isCollapsibleNode = true; return false; // Cancel tree traversing } }); // TODO: When the node is collapsible do not show the column. Currently collapsible headers // does not work with hidden columns (hidden index map types). if (isCollapsibleNode) { return; } nodeToProcess.walkUp(function (node) { var data = node.data; data.crossHiddenColumns.splice(data.crossHiddenColumns.indexOf(gridColumnIndex), 1); if (!data.isHidden && data.colspan < data.origColspan) { data.colspan += 1; } data.isHidden = false; }); } /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/utils/tree.mjs": /*!***************************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/stateManager/nodeModifiers/utils/tree.mjs ***! \***************************************************************************************************/ /*! exports provided: traverseHiddenNodeColumnIndexes, getFirstChildProperty, isNodeReflectsFirstChildColspan */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "traverseHiddenNodeColumnIndexes", function() { return traverseHiddenNodeColumnIndexes; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFirstChildProperty", function() { return getFirstChildProperty; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeReflectsFirstChildColspan", function() { return isNodeReflectsFirstChildColspan; }); /** * Traverses the tree nodes and calls a callback when no hidden node is found. The callback * is called with visual column index then. * * @param {TreeNode} node A tree node to traverse. * @param {Function} callback The callback function which will be called for each node. */ function traverseHiddenNodeColumnIndexes(node, callback) { node.walkDown(function (_ref) { var data = _ref.data, childs = _ref.childs; if (!data.isHidden) { callback(data.columnIndex); if (childs.length === 0) { for (var i = 1; i < data.colspan; i++) { callback(data.columnIndex + i); } } } }); } /** * A tree helper for retrieving a data from the first child. * * @param {TreeNode} node A tree node to check. * @param {string} propertyName A name of the property whose value you want to get. * @returns {*} */ function getFirstChildProperty(_ref2, propertyName) { var childs = _ref2.childs; if (childs.length === 0) { return; } return childs[0].data[propertyName]; } /** * A tree helper which checks if passed node has the same original colspan as its * first child. In that case the node is treated as "mirrored" or "reflected" every * action performed on one of that nodes should be reflected to other "mirrored" node. * * In that case nodes A1 and A2 are "reflected" * +----+----+----+----+ * | A1 | B1 | * +----+----+----+----+ * | A2 | B2 | B3 | * +----+----+----+----+. * * @param {TreeNode} node A tree node to check. * @returns {boolean} */ function isNodeReflectsFirstChildColspan(node) { return getFirstChildProperty(node, 'origColspan') === node.data.origColspan; } /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/settingsNormalizer.mjs": /*!*********************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/stateManager/settingsNormalizer.mjs ***! \*********************************************************************************************/ /*! exports provided: normalizeSettings */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSettings", function() { return normalizeSettings; }); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/utils.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /* eslint-disable jsdoc/require-description-complete-sentence */ /** * A function that normalizes user-defined settings into one predictable * structure. Currently, the developer can declare nested headers by passing * the following unstructured (and sometimes uncompleted) array. * [ * [{ label: 'A1', colspan: 2 }], * [{ label: true }, 'B2', 4], * [], * ] * * The normalization process equalizes the length of columns to each header * layers to the same length and generates object settings with a common shape. * So the above mentioned example will be normalized into this: * [ * [ * { label: 'A1', colspan: 2, isHidden: false, ... }, * { label: '', colspan: 1, isHidden: true, ... }, * { label: '', colspan: 1, isHidden: false, ... }, * ], * [ * { label: 'true', colspan: 1, isHidden: false, ... }, * { label: 'B2', colspan: 1, isHidden: false, ... }, * { label: '4', colspan: 1, isHidden: false, ... }, * ], * [ * { label: '', colspan: 1, isHidden: false, ... }, * { label: '', colspan: 1, isHidden: false, ... }, * { label: '', colspan: 1, isHidden: false, ... }, * ], * ] * * @param {Array[]} sourceSettings An array with defined nested headers settings. * @param {number} [columnsLimit=Infinity] A number of columns to which the structure * will be trimmed. While trimming the colspan * values are adjusted to preserve the original * structure. * @returns {Array[]} */ function normalizeSettings(sourceSettings) { var columnsLimit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity; var normalizedSettings = []; if (columnsLimit === 0) { return normalizedSettings; } // Normalize array items (header settings) into one shape - literal object with default props. Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_12__["arrayEach"])(sourceSettings, function (headersSettings) { var columns = []; var columnIndex = 0; normalizedSettings.push(columns); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_12__["arrayEach"])(headersSettings, function (sourceHeaderSettings) { var headerSettings = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_15__["createDefaultHeaderSettings"])(); if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_13__["isObject"])(sourceHeaderSettings)) { var label = sourceHeaderSettings.label, colspan = sourceHeaderSettings.colspan; headerSettings.label = Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_14__["stringify"])(label); if (typeof colspan === 'number' && colspan > 1) { headerSettings.colspan = colspan; headerSettings.origColspan = colspan; } } else { headerSettings.label = Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_14__["stringify"])(sourceHeaderSettings); } columnIndex += headerSettings.origColspan; var cancelProcessing = false; if (columnIndex >= columnsLimit) { // Adjust the colspan value to not overlap the columns limit. headerSettings.colspan = headerSettings.origColspan - (columnIndex - columnsLimit); headerSettings.origColspan = headerSettings.colspan; cancelProcessing = true; } columns.push(headerSettings); if (headerSettings.colspan > 1) { for (var i = 0; i < headerSettings.colspan - 1; i++) { columns.push(Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_15__["createPlaceholderHeaderSettings"])()); } } return !cancelProcessing; }); }); var columnsLength = Math.max.apply(Math, _toConsumableArray(Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_12__["arrayMap"])(normalizedSettings, function (headersSettings) { return headersSettings.length; }))); // Normalize the length of each header layer to the same columns length. Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_12__["arrayEach"])(normalizedSettings, function (headersSettings) { if (headersSettings.length < columnsLength) { var defaultSettings = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_12__["arrayMap"])(new Array(columnsLength - headersSettings.length), function () { return Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_15__["createDefaultHeaderSettings"])(); }); headersSettings.splice.apply(headersSettings, [headersSettings.length, 0].concat(_toConsumableArray(defaultSettings))); } }); return normalizedSettings; } /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/sourceSettings.mjs": /*!*****************************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/stateManager/sourceSettings.mjs ***! \*****************************************************************************************/ /*! exports provided: HEADER_CONFIGURABLE_PROPS, default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HEADER_CONFIGURABLE_PROPS", function() { return HEADER_CONFIGURABLE_PROPS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SourceSettings; }); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _settingsNormalizer_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./settingsNormalizer.mjs */ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/settingsNormalizer.mjs"); var _excluded = ["row", "col"]; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } /** * List of properties which are configurable. That properties can be changed using public API. * * @type {string[]} */ var HEADER_CONFIGURABLE_PROPS = ['label', 'collapsible']; /** * The class manages and normalizes settings passed by the developer * into the nested headers plugin. The SourceSettings class is a * source of truth for tree builder (HeaderTree) module. * * @class SourceSettings * @plugin NestedHeaders */ var _data = /*#__PURE__*/new WeakMap(); var _dataLength = /*#__PURE__*/new WeakMap(); var _columnsLimit = /*#__PURE__*/new WeakMap(); var SourceSettings = /*#__PURE__*/function () { function SourceSettings() { _classCallCheck(this, SourceSettings); _data.set(this, { writable: true, value: [] }); _dataLength.set(this, { writable: true, value: 0 }); _columnsLimit.set(this, { writable: true, value: Infinity }); } _createClass(SourceSettings, [{ key: "setColumnsLimit", value: /** * Sets columns limit to the source settings will be trimmed. All headers which * overlap the column limit will be reduced to keep the structure solid. * * @param {number} columnsCount The number of columns to limit to. */ function setColumnsLimit(columnsCount) { _classPrivateFieldSet(this, _columnsLimit, columnsCount); } /** * Sets a new nested header configuration. * * @param {Array[]} [nestedHeadersSettings=[]] The user-defined nested headers settings. */ }, { key: "setData", value: function setData() { var nestedHeadersSettings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; _classPrivateFieldSet(this, _data, Object(_settingsNormalizer_mjs__WEBPACK_IMPORTED_MODULE_14__["normalizeSettings"])(nestedHeadersSettings, _classPrivateFieldGet(this, _columnsLimit))); _classPrivateFieldSet(this, _dataLength, _classPrivateFieldGet(this, _data).length); } /** * Gets normalized source settings. * * @returns {Array[]} */ }, { key: "getData", value: function getData() { return _classPrivateFieldGet(this, _data); } /** * Merges settings with current source settings. * * @param {object[]} additionalSettings An array of objects with `row`, `col` and additional * properties to merge with current source settings. */ }, { key: "mergeWith", value: function mergeWith(additionalSettings) { var _this = this; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(additionalSettings, function (_ref) { var row = _ref.row, col = _ref.col, rest = _objectWithoutProperties(_ref, _excluded); var headerSettings = _this.getHeaderSettings(row, col); if (headerSettings !== null) { Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_12__["extend"])(headerSettings, rest, HEADER_CONFIGURABLE_PROPS); } }); } /** * Maps the current state with a callback. For each source settings the callback function * is called. If the function returns value that value is merged with the source settings. * * @param {Function} callback A function that is called for every header settings. * Each time the callback is called, the returned value extends * header settings. */ }, { key: "map", value: function map(callback) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(_classPrivateFieldGet(this, _data), function (header) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(header, function (headerSettings) { var propsToExtend = callback(_objectSpread({}, headerSettings)); if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_12__["isObject"])(propsToExtend)) { Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_12__["extend"])(headerSettings, propsToExtend, HEADER_CONFIGURABLE_PROPS); } }); }); } /** * Gets source column header settings for a specified header. The returned * object contains information about the header label, its colspan length, * or if it is hidden in the header renderers. * * @param {number} headerLevel Header level (0 = most distant to the table). * @param {number} columnIndex A visual column index. * @returns {object|null} */ }, { key: "getHeaderSettings", value: function getHeaderSettings(headerLevel, columnIndex) { var _headersSettings$colu; if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) { return null; } var headersSettings = _classPrivateFieldGet(this, _data)[headerLevel]; if (columnIndex >= headersSettings.length) { return null; } return (_headersSettings$colu = headersSettings[columnIndex]) !== null && _headersSettings$colu !== void 0 ? _headersSettings$colu : null; } /** * Gets source of column headers settings for specified headers. If the retrieved column * settings overlap the range "box" determined by "columnIndex" and "columnsLength" * the exception will be thrown. * * @param {number} headerLevel Header level (0 = most distant to the table). * @param {number} columnIndex A visual column index from which the settings will be extracted. * @param {number} [columnsLength=1] The number of columns involved in the extraction of settings. * @returns {object} */ }, { key: "getHeadersSettings", value: function getHeadersSettings(headerLevel, columnIndex) { var columnsLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; var headersSettingsChunks = []; if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) { return headersSettingsChunks; } var headersSettings = _classPrivateFieldGet(this, _data)[headerLevel]; var currentLength = 0; for (var i = columnIndex; i < headersSettings.length; i++) { var headerSettings = headersSettings[i]; if (headerSettings.isPlaceholder) { throw new Error('The first column settings cannot overlap the other header layers'); } currentLength += headerSettings.colspan; headersSettingsChunks.push(headerSettings); if (headerSettings.colspan > 1) { i += headerSettings.colspan - 1; } // We met the current sum of the child colspans if (currentLength === columnsLength) { break; } // We exceeds the current sum of the child colspans, the last columns colspan overlaps the "columnsLength" length. if (currentLength > columnsLength) { throw new Error('The last column settings cannot overlap the other header layers'); } } return headersSettingsChunks; } /** * Gets a total number of headers levels. * * @returns {number} */ }, { key: "getLayersCount", value: function getLayersCount() { return _classPrivateFieldGet(this, _dataLength); } /** * Gets a total number of columns count. * * @returns {number} */ }, { key: "getColumnsCount", value: function getColumnsCount() { return _classPrivateFieldGet(this, _dataLength) > 0 ? _classPrivateFieldGet(this, _data)[0].length : 0; } /** * Clears the data. */ }, { key: "clear", value: function clear() { _classPrivateFieldSet(this, _data, []); _classPrivateFieldSet(this, _dataLength, 0); } }]); return SourceSettings; }(); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/stateManager/utils.mjs": /*!********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/stateManager/utils.mjs ***! \********************************************************************************/ /*! exports provided: createDefaultHeaderSettings, createPlaceholderHeaderSettings */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDefaultHeaderSettings", function() { return createDefaultHeaderSettings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPlaceholderHeaderSettings", function() { return createPlaceholderHeaderSettings; }); /** * @typedef {object} DefaultHeaderSettings * @property {string} label The name/label of the column header. * @property {number} colspan Current calculated colspan value of the rendered column header element. * @property {number} origColspan Original colspan value, set once while parsing user-defined nested header settings. * @property {boolean} collapsible The flag determines whether the node is collapsible (can be collpased/expanded). * @property {number[]} crossHiddenColumns The list of visual column indexes which indicates that the specified columns within * the header settings are hidden. * @property {boolean} isCollapsed The flag determines whether the node is collapsed. * @property {boolean} isHidden The flag determines whether the column header at specified index is hidden. If true * the TH element will be rendered as hidden (display: none). * @property {boolean} isRoot The flag which determines whether the column header settings is accually not renderable. That kind * of objects are generated after colspaned header to fill an array to correct size. * * For example for header with colspan = 8 the 7 blank objects are generated to fill the array settings * to length = 8. * @property {boolean} isPlaceholder The flag determines whether the column header at the specified index is non-renderable. */ /** * Creates the header settings object with default values. * * @param {DefaultHeaderSettings} initialValues The initial values for the header settings object. * @returns {DefaultHeaderSettings} */ function createDefaultHeaderSettings() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref$label = _ref.label, label = _ref$label === void 0 ? '' : _ref$label, _ref$colspan = _ref.colspan, colspan = _ref$colspan === void 0 ? 1 : _ref$colspan, _ref$origColspan = _ref.origColspan, origColspan = _ref$origColspan === void 0 ? 1 : _ref$origColspan, _ref$collapsible = _ref.collapsible, collapsible = _ref$collapsible === void 0 ? false : _ref$collapsible, _ref$crossHiddenColum = _ref.crossHiddenColumns, crossHiddenColumns = _ref$crossHiddenColum === void 0 ? [] : _ref$crossHiddenColum, _ref$isCollapsed = _ref.isCollapsed, isCollapsed = _ref$isCollapsed === void 0 ? false : _ref$isCollapsed, _ref$isHidden = _ref.isHidden, isHidden = _ref$isHidden === void 0 ? false : _ref$isHidden, _ref$isRoot = _ref.isRoot, isRoot = _ref$isRoot === void 0 ? false : _ref$isRoot, _ref$isPlaceholder = _ref.isPlaceholder, isPlaceholder = _ref$isPlaceholder === void 0 ? false : _ref$isPlaceholder; return { label: label, colspan: colspan, origColspan: origColspan, collapsible: collapsible, isCollapsed: isCollapsed, crossHiddenColumns: crossHiddenColumns, isHidden: isHidden, isRoot: isRoot, isPlaceholder: isPlaceholder }; } /** * Creates the header settings placeholder object. Those settings tell the header renderers * that this TH element should not be rendered (the node will be overlapped by the previously * created node with colspan bigger than 1). * * @returns {object} */ function createPlaceholderHeaderSettings() { return { label: '', isPlaceholder: true }; } /***/ }), /***/ "./node_modules/handsontable/plugins/nestedHeaders/utils/ghostTable.mjs": /*!******************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedHeaders/utils/ghostTable.mjs ***! \******************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var GhostTable = /*#__PURE__*/function () { function GhostTable(plugin) { _classCallCheck(this, GhostTable); /** * Reference to NestedHeaders plugin. * * @type {NestedHeaders} */ this.nestedHeaders = plugin; /** * Temporary element created to get minimal headers widths. * * @type {*} */ this.container = void 0; /** * Cached the headers widths. * * @type {Array} */ this.widthsCache = []; } /** * Build cache of the headers widths. * * @private */ _createClass(GhostTable, [{ key: "buildWidthsMapper", value: function buildWidthsMapper() { this.container = this.nestedHeaders.hot.rootDocument.createElement('div'); this.buildGhostTable(this.container); this.nestedHeaders.hot.rootElement.appendChild(this.container); var columns = this.container.querySelectorAll('tr:last-of-type th'); var maxColumns = columns.length; this.widthsCache.length = 0; for (var i = 0; i < maxColumns; i++) { this.widthsCache.push(columns[i].offsetWidth); } this.container.parentNode.removeChild(this.container); this.container = null; this.nestedHeaders.hot.render(); } /** * Build temporary table for getting minimal columns widths. * * @private * @param {HTMLElement} container The element where the DOM nodes are injected. */ }, { key: "buildGhostTable", value: function buildGhostTable(container) { var rootDocument = this.nestedHeaders.hot.rootDocument; var fragment = rootDocument.createDocumentFragment(); var table = rootDocument.createElement('table'); var lastRowColspan = false; var isDropdownEnabled = !!this.nestedHeaders.hot.getSettings().dropdownMenu; var maxRows = this.nestedHeaders.getLayersCount(); var maxCols = this.nestedHeaders.hot.countCols(); var lastRowIndex = maxRows - 1; for (var row = 0; row < maxRows; row++) { var tr = rootDocument.createElement('tr'); lastRowColspan = false; for (var col = 0; col < maxCols; col++) { var td = rootDocument.createElement('th'); var headerObj = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["clone"])(this.nestedHeaders.getHeaderSettings(row, col)); if (headerObj && !headerObj.isHidden) { if (row === lastRowIndex) { if (headerObj.colspan > 1) { lastRowColspan = true; } if (isDropdownEnabled) { headerObj.label += ''; } } Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_0__["fastInnerHTML"])(td, headerObj.label); // The guard here is needed because on IE11 an error is thrown if you // try to assign an incorrect value to `td.colSpan` here. if (headerObj.colspan !== undefined) { td.colSpan = headerObj.colspan; } tr.appendChild(td); } } table.appendChild(tr); } // We have to be sure the last row contains only the single columns. if (lastRowColspan) { { var _tr = rootDocument.createElement('tr'); for (var _col = 0; _col < maxCols; _col++) { var _td = rootDocument.createElement('th'); _tr.appendChild(_td); } table.appendChild(_tr); } } fragment.appendChild(table); container.appendChild(fragment); } /** * Clear the widths cache. */ }, { key: "clear", value: function clear() { this.container = null; this.widthsCache.length = 0; } }]); return GhostTable; }(); /* harmony default export */ __webpack_exports__["default"] = (GhostTable); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedRows/data/dataManager.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedRows/data/dataManager.mjs ***! \***************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * Class responsible for making data operations. * * @class * @private */ var DataManager = /*#__PURE__*/function () { function DataManager(nestedRowsPlugin, hotInstance) { _classCallCheck(this, DataManager); /** * Main Handsontable instance reference. * * @type {object} */ this.hot = hotInstance; /** * Reference to the source data object. * * @type {Handsontable.CellValue[][]|Handsontable.RowObject[]} */ this.data = null; /** * Reference to the NestedRows plugin. * * @type {object} */ this.plugin = nestedRowsPlugin; /** * Map of row object parents. * * @type {WeakMap} */ this.parentReference = new WeakMap(); /** * Nested structure cache. * * @type {object} */ this.cache = { levels: [], levelCount: 0, rows: [], nodeInfo: new WeakMap() }; } /** * Set the data for the manager. * * @param {Handsontable.CellValue[][]|Handsontable.RowObject[]} data Data for the manager. */ _createClass(DataManager, [{ key: "setData", value: function setData(data) { this.data = data; } /** * Get the data cached in the manager. * * @returns {Handsontable.CellValue[][]|Handsontable.RowObject[]} */ }, { key: "getData", value: function getData() { return this.data; } /** * Load the "raw" source data, without NestedRows' modifications. * * @returns {Handsontable.CellValue[][]|Handsontable.RowObject[]} */ }, { key: "getRawSourceData", value: function getRawSourceData() { var rawSourceData = null; this.plugin.disableCoreAPIModifiers(); rawSourceData = this.hot.getSourceData(); this.plugin.enableCoreAPIModifiers(); return rawSourceData; } /** * Update the Data Manager with new data and refresh cache. * * @param {Handsontable.CellValue[][]|Handsontable.RowObject[]} data Data for the manager. */ }, { key: "updateWithData", value: function updateWithData(data) { this.setData(data); this.rewriteCache(); } /** * Rewrite the nested structure cache. * * @private */ }, { key: "rewriteCache", value: function rewriteCache() { var _this = this; this.cache = { levels: [], levelCount: 0, rows: [], nodeInfo: new WeakMap() }; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_14__["rangeEach"])(0, this.data.length - 1, function (i) { _this.cacheNode(_this.data[i], 0, null); }); } /** * Cache a data node. * * @private * @param {object} node Node to cache. * @param {number} level Level of the node. * @param {object} parent Parent of the node. */ }, { key: "cacheNode", value: function cacheNode(node, level, parent) { var _this2 = this; if (!this.cache.levels[level]) { this.cache.levels[level] = []; this.cache.levelCount += 1; } this.cache.levels[level].push(node); this.cache.rows.push(node); this.cache.nodeInfo.set(node, { parent: parent, row: this.cache.rows.length - 1, level: level }); if (this.hasChildren(node)) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(node.__children, function (elem) { _this2.cacheNode(elem, level + 1, node); }); } } /** * Get the date for the provided visual row number. * * @param {number} row Row index. * @returns {object} */ }, { key: "getDataObject", value: function getDataObject(row) { return row === null || row === void 0 ? null : this.cache.rows[row]; } /** * Read the row tree in search for a specific row index or row object. * * @private * @param {object} parent The initial parent object. * @param {number} readCount Number of read nodes. * @param {number} neededIndex The row index we search for. * @param {object} neededObject The row object we search for. * @returns {number|object} */ }, { key: "readTreeNodes", value: function readTreeNodes(parent, readCount, neededIndex, neededObject) { var _this3 = this; var rootLevel = false; var readNodesCount = readCount; if (isNaN(readNodesCount) && readNodesCount.end) { return readNodesCount; } var parentObj = parent; if (!parentObj) { parentObj = { __children: this.data }; rootLevel = true; readNodesCount -= 1; } if (neededIndex !== null && neededIndex !== void 0 && readNodesCount === neededIndex) { return { result: parentObj, end: true }; } if (neededObject !== null && neededObject !== void 0 && parentObj === neededObject) { return { result: readNodesCount, end: true }; } readNodesCount += 1; if (parentObj.__children) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(parentObj.__children, function (val) { _this3.parentReference.set(val, rootLevel ? null : parentObj); readNodesCount = _this3.readTreeNodes(val, readNodesCount, neededIndex, neededObject); if (isNaN(readNodesCount) && readNodesCount.end) { return false; } }); } return readNodesCount; } /** * Mock a parent node. * * @private * @returns {*} */ }, { key: "mockParent", value: function mockParent() { var fakeParent = this.mockNode(); fakeParent.__children = this.data; return fakeParent; } /** * Mock a data node. * * @private * @returns {{}} */ }, { key: "mockNode", value: function mockNode() { var fakeNode = {}; Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_15__["objectEach"])(this.data[0], function (val, key) { fakeNode[key] = null; }); return fakeNode; } /** * Get the row index for the provided row object. * * @param {object} rowObj The row object. * @returns {number} Row index. */ }, { key: "getRowIndex", value: function getRowIndex(rowObj) { return rowObj === null || rowObj === void 0 ? null : this.cache.nodeInfo.get(rowObj).row; } /** * Get the index of the provided row index/row object within its parent. * * @param {number|object} row Row index / row object. * @returns {number} */ }, { key: "getRowIndexWithinParent", value: function getRowIndexWithinParent(row) { var rowObj = null; if (isNaN(row)) { rowObj = row; } else { rowObj = this.getDataObject(row); } var parent = this.getRowParent(row); if (parent === null || parent === void 0) { return this.data.indexOf(rowObj); } return parent.__children.indexOf(rowObj); } /** * Count all rows (including all parents and children). * * @returns {number} */ }, { key: "countAllRows", value: function countAllRows() { var rootNodeMock = { __children: this.data }; return this.countChildren(rootNodeMock); } /** * Count children of the provided parent. * * @param {object|number} parent Parent node. * @returns {number} Children count. */ }, { key: "countChildren", value: function countChildren(parent) { var _this4 = this; var rowCount = 0; var parentNode = parent; if (!isNaN(parentNode)) { parentNode = this.getDataObject(parentNode); } if (!parentNode || !parentNode.__children) { return 0; } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(parentNode.__children, function (elem) { rowCount += 1; if (elem.__children) { rowCount += _this4.countChildren(elem); } }); return rowCount; } /** * Get the parent of the row at the provided index. * * @param {number|object} row Physical row index. * @returns {object} */ }, { key: "getRowParent", value: function getRowParent(row) { var rowObject; if (isNaN(row)) { rowObject = row; } else { rowObject = this.getDataObject(row); } return this.getRowObjectParent(rowObject); } /** * Get the parent of the provided row object. * * @private * @param {object} rowObject The row object (tree node). * @returns {object|null} */ }, { key: "getRowObjectParent", value: function getRowObjectParent(rowObject) { if (!rowObject || _typeof(rowObject) !== 'object') { return null; } return this.cache.nodeInfo.get(rowObject).parent; } /** * Get the nesting level for the row with the provided row index. * * @param {number} row Row index. * @returns {number|null} Row level or null, when row doesn't exist. */ }, { key: "getRowLevel", value: function getRowLevel(row) { var rowObject = null; if (isNaN(row)) { rowObject = row; } else { rowObject = this.getDataObject(row); } return rowObject ? this.getRowObjectLevel(rowObject) : null; } /** * Get the nesting level for the row with the provided row index. * * @private * @param {object} rowObject Row object. * @returns {number} Row level. */ }, { key: "getRowObjectLevel", value: function getRowObjectLevel(rowObject) { return rowObject === null || rowObject === void 0 ? null : this.cache.nodeInfo.get(rowObject).level; } /** * Check if the provided row/row element has children. * * @param {number|object} row Row number or row element. * @returns {boolean} */ }, { key: "hasChildren", value: function hasChildren(row) { var rowObj = row; if (!isNaN(rowObj)) { rowObj = this.getDataObject(rowObj); } return !!(rowObj.__children && rowObj.__children.length); } /** * Returns `true` if the row at the provided index has a parent. * * @param {number} index Row index. * @returns {boolean} `true` if the row at the provided index has a parent, `false` otherwise. */ }, { key: "isChild", value: function isChild(index) { return this.getRowParent(index) !== null; } /** * Return `true` of the row at the provided index is located at the topmost level. * * @param {number} index Row index. * @returns {boolean} `true` of the row at the provided index is located at the topmost level, `false` otherwise. */ }, { key: "isRowHighestLevel", value: function isRowHighestLevel(index) { return !this.isChild(index); } /** * Return `true` if the provided row index / row object represents a parent in the nested structure. * * @param {number|object} row Row index / row object. * @returns {boolean} `true` if the row is a parent, `false` otherwise. */ }, { key: "isParent", value: function isParent(row) { var _rowObj$__children; var rowObj = row; if (!isNaN(rowObj)) { rowObj = this.getDataObject(rowObj); } return rowObj && !!rowObj.__children && ((_rowObj$__children = rowObj.__children) === null || _rowObj$__children === void 0 ? void 0 : _rowObj$__children.length) !== 0; } /** * Add a child to the provided parent. It's optional to add a row object as the "element". * * @param {object} parent The parent row object. * @param {object} [element] The element to add as a child. */ }, { key: "addChild", value: function addChild(parent, element) { var childElement = element; this.hot.runHooks('beforeAddChild', parent, childElement); var parentIndex = null; if (parent) { parentIndex = this.getRowIndex(parent); } this.hot.runHooks('beforeCreateRow', parentIndex + this.countChildren(parent) + 1, 1); var functionalParent = parent; if (!parent) { functionalParent = this.mockParent(); } if (!functionalParent.__children) { functionalParent.__children = []; } if (!childElement) { childElement = this.mockNode(); } functionalParent.__children.push(childElement); this.rewriteCache(); var newRowIndex = this.getRowIndex(childElement); this.hot.rowIndexMapper.insertIndexes(newRowIndex, 1); this.hot.runHooks('afterCreateRow', newRowIndex, 1); this.hot.runHooks('afterAddChild', parent, childElement); } /** * Add a child node to the provided parent at a specified index. * * @param {object} parent Parent node. * @param {number} index Index to insert the child element at. * @param {object} [element] Element (node) to insert. */ }, { key: "addChildAtIndex", value: function addChildAtIndex(parent, index, element) { var childElement = element; if (!childElement) { childElement = this.mockNode(); } this.hot.runHooks('beforeAddChild', parent, childElement, index); if (parent) { this.hot.runHooks('beforeCreateRow', index, 1); parent.__children.splice(index, null, childElement); this.plugin.disableCoreAPIModifiers(); this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(parent), '__children', parent.__children, 'NestedRows.addChildAtIndex'); this.plugin.enableCoreAPIModifiers(); this.hot.runHooks('afterCreateRow', index, 1); } else { this.plugin.disableCoreAPIModifiers(); this.hot.alter('insert_row', index, 1, 'NestedRows.addChildAtIndex'); this.plugin.enableCoreAPIModifiers(); } this.updateWithData(this.getRawSourceData()); // Workaround for refreshing cache losing the reference to the mocked row. childElement = this.getDataObject(index); this.hot.runHooks('afterAddChild', parent, childElement, index); } /** * Add a sibling element at the specified index. * * @param {number} index New element sibling's index. * @param {('above'|'below')} where Direction in which the sibling is to be created. */ }, { key: "addSibling", value: function addSibling(index) { var where = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'below'; var translatedIndex = this.translateTrimmedRow(index); var parent = this.getRowParent(translatedIndex); var indexWithinParent = this.getRowIndexWithinParent(translatedIndex); switch (where) { case 'below': this.addChildAtIndex(parent, indexWithinParent + 1, null); break; case 'above': this.addChildAtIndex(parent, indexWithinParent, null); break; default: break; } } /** * Detach the provided element from its parent and add it right after it. * * @param {object|Array} elements Row object or an array of selected coordinates. * @param {boolean} [forceRender=true] If true (default), it triggers render after finished. */ }, { key: "detachFromParent", value: function detachFromParent(elements) { var _this5 = this; var forceRender = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var element = null; var rowObjects = []; if (Array.isArray(elements)) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_14__["rangeEach"])(elements[0], elements[2], function (i) { var translatedIndex = _this5.translateTrimmedRow(i); rowObjects.push(_this5.getDataObject(translatedIndex)); }); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_14__["rangeEach"])(0, rowObjects.length - 2, function (i) { _this5.detachFromParent(rowObjects[i], false); }); element = rowObjects[rowObjects.length - 1]; } else { element = elements; } var childRowIndex = this.getRowIndex(element); var indexWithinParent = this.getRowIndexWithinParent(element); var parent = this.getRowParent(element); var grandparent = this.getRowParent(parent); var grandparentRowIndex = this.getRowIndex(grandparent); var movedElementRowIndex = null; this.hot.runHooks('beforeDetachChild', parent, element); if (indexWithinParent !== null && indexWithinParent !== void 0) { this.hot.runHooks('beforeRemoveRow', childRowIndex, 1, [childRowIndex], this.plugin.pluginName); parent.__children.splice(indexWithinParent, 1); this.rewriteCache(); this.hot.runHooks('afterRemoveRow', childRowIndex, 1, [childRowIndex], this.plugin.pluginName); if (grandparent) { movedElementRowIndex = grandparentRowIndex + this.countChildren(grandparent); this.hot.runHooks('beforeCreateRow', movedElementRowIndex, 1, this.plugin.pluginName); grandparent.__children.push(element); } else { movedElementRowIndex = this.hot.countRows() + 1; this.hot.runHooks('beforeCreateRow', movedElementRowIndex, 1, this.plugin.pluginName); this.data.push(element); } } this.rewriteCache(); this.hot.runHooks('afterCreateRow', movedElementRowIndex, 1, this.plugin.pluginName); this.hot.runHooks('afterDetachChild', parent, element); if (forceRender) { this.hot.render(); } } /** * Filter the data by the `logicRows` array. * * @private * @param {number} index Index of the first row to remove. * @param {number} amount Number of elements to remove. * @param {Array} logicRows Array of indexes to remove. */ }, { key: "filterData", value: function filterData(index, amount, logicRows) { var _this6 = this; // TODO: why are the first 2 arguments not used? var elementsToRemove = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(logicRows, function (elem) { elementsToRemove.push(_this6.getDataObject(elem)); }); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(elementsToRemove, function (elem) { var indexWithinParent = _this6.getRowIndexWithinParent(elem); var tempParent = _this6.getRowParent(elem); if (tempParent === null) { _this6.data.splice(indexWithinParent, 1); } else { tempParent.__children.splice(indexWithinParent, 1); } }); this.rewriteCache(); } /** * Used to splice the source data. Needed to properly modify the nested structure, which wouldn't work with the * default script. * * @private * @param {number} index Physical index of the element at the splice beginning. * @param {number} amount Number of elements to be removed. * @param {object[]} elements Array of row objects to add. */ }, { key: "spliceData", value: function spliceData(index, amount, elements) { var previousElement = this.getDataObject(index - 1); var newRowParent = null; var indexWithinParent = index; if (previousElement && previousElement.__children && previousElement.__children.length === 0) { newRowParent = previousElement; indexWithinParent = 0; } else if (index < this.countAllRows()) { newRowParent = this.getRowParent(index); indexWithinParent = this.getRowIndexWithinParent(index); } if (newRowParent) { if (elements) { var _newRowParent$__child; (_newRowParent$__child = newRowParent.__children).splice.apply(_newRowParent$__child, [indexWithinParent, amount].concat(_toConsumableArray(elements))); } else { newRowParent.__children.splice(indexWithinParent, amount); } } else if (elements) { var _this$data; (_this$data = this.data).splice.apply(_this$data, [indexWithinParent, amount].concat(_toConsumableArray(elements))); } else { this.data.splice(indexWithinParent, amount); } this.rewriteCache(); } /** * Update the `__children` key of the upmost parent of the provided row object. * * @private * @param {object} rowElement Row object. */ }, { key: "syncRowWithRawSource", value: function syncRowWithRawSource(rowElement) { var upmostParent = rowElement; var tempParent = null; do { tempParent = this.getRowParent(tempParent); if (tempParent !== null) { upmostParent = tempParent; } } while (tempParent !== null); this.plugin.disableCoreAPIModifiers(); this.hot.setSourceDataAtCell(this.getRowIndex(upmostParent), '__children', upmostParent.__children, 'NestedRows.syncRowWithRawSource'); this.plugin.enableCoreAPIModifiers(); } /* eslint-disable jsdoc/require-param */ /** * Move a single row. * * @param {number} fromIndex Index of the row to be moved. * @param {number} toIndex Index of the destination. * @param {boolean} moveToCollapsed `true` if moving a row to a collapsed parent. * @param {boolean} moveToLastChild `true` if moving a row to be a last child of the new parent. */ /* eslint-enable jsdoc/require-param */ }, { key: "moveRow", value: function moveRow(fromIndex, toIndex, moveToCollapsed, moveToLastChild) { var moveToLastRow = toIndex === this.hot.countRows(); var fromParent = this.getRowParent(fromIndex); var indexInFromParent = this.getRowIndexWithinParent(fromIndex); var elemToMove = fromParent.__children.slice(indexInFromParent, indexInFromParent + 1); var movingUp = fromIndex > toIndex; var toParent = moveToLastRow ? this.getRowParent(toIndex - 1) : this.getRowParent(toIndex); if (toParent === null || toParent === void 0) { toParent = this.getRowParent(toIndex - 1); } if (toParent === null || toParent === void 0) { toParent = this.getDataObject(toIndex - 1); } if (!toParent) { toParent = this.getDataObject(toIndex); toParent.__children = []; } else if (!toParent.__children) { toParent.__children = []; } var indexInTargetParent = moveToLastRow || moveToCollapsed || moveToLastChild ? toParent.__children.length : this.getRowIndexWithinParent(toIndex); var sameParent = fromParent === toParent; toParent.__children.splice(indexInTargetParent, 0, elemToMove[0]); fromParent.__children.splice(indexInFromParent + (movingUp && sameParent ? 1 : 0), 1); // Sync the changes in the cached data with the actual data stored in HOT. this.syncRowWithRawSource(fromParent); if (!sameParent) { this.syncRowWithRawSource(toParent); } } /** * Translate the visual row index to the physical index, taking into consideration the state of collapsed rows. * * @private * @param {number} row Row index. * @returns {number} */ }, { key: "translateTrimmedRow", value: function translateTrimmedRow(row) { if (this.plugin.collapsingUI) { return this.plugin.collapsingUI.translateTrimmedRow(row); } return row; } /** * Translate the physical row index to the visual index, taking into consideration the state of collapsed rows. * * @private * @param {number} row Row index. * @returns {number} */ }, { key: "untranslateTrimmedRow", value: function untranslateTrimmedRow(row) { if (this.plugin.collapsingUI) { return this.plugin.collapsingUI.untranslateTrimmedRow(row); } return row; } }]); return DataManager; }(); /* harmony default export */ __webpack_exports__["default"] = (DataManager); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedRows/index.mjs": /*!****************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedRows/index.mjs ***! \****************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, NestedRows */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _nestedRows_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./nestedRows.mjs */ "./node_modules/handsontable/plugins/nestedRows/nestedRows.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _nestedRows_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _nestedRows_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NestedRows", function() { return _nestedRows_mjs__WEBPACK_IMPORTED_MODULE_0__["NestedRows"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedRows/nestedRows.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedRows/nestedRows.mjs ***! \*********************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, NestedRows */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NestedRows", function() { return NestedRows; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.timers.js */ "./node_modules/core-js/modules/web.timers.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ "./node_modules/core-js/modules/es.array.reduce.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _data_dataManager_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./data/dataManager.mjs */ "./node_modules/handsontable/plugins/nestedRows/data/dataManager.mjs"); /* harmony import */ var _ui_collapsing_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./ui/collapsing.mjs */ "./node_modules/handsontable/plugins/nestedRows/ui/collapsing.mjs"); /* harmony import */ var _ui_headers_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./ui/headers.mjs */ "./node_modules/handsontable/plugins/nestedRows/ui/headers.mjs"); /* harmony import */ var _ui_contextMenu_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./ui/contextMenu.mjs */ "./node_modules/handsontable/plugins/nestedRows/ui/contextMenu.mjs"); /* harmony import */ var _helpers_console_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../helpers/console.mjs */ "./node_modules/handsontable/helpers/console.mjs"); /* harmony import */ var _helpers_data_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../helpers/data.mjs */ "./node_modules/handsontable/helpers/data.mjs"); /* harmony import */ var _translations_index_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../translations/index.mjs */ "./node_modules/handsontable/translations/index.mjs"); /* harmony import */ var _utils_rowMoveController_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./utils/rowMoveController.mjs */ "./node_modules/handsontable/plugins/nestedRows/utils/rowMoveController.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var PLUGIN_KEY = 'nestedRows'; var PLUGIN_PRIORITY = 300; var privatePool = new WeakMap(); /** * Error message for the wrong data type error. */ var WRONG_DATA_TYPE_ERROR = 'The Nested Rows plugin requires an Array of Objects as a dataset to be' + ' provided. The plugin has been disabled.'; /** * @plugin NestedRows * @class NestedRows * * @description * Plugin responsible for displaying and operating on data sources with nested structures. */ var NestedRows = /*#__PURE__*/function (_BasePlugin) { _inherits(NestedRows, _BasePlugin); var _super = _createSuper(NestedRows); function NestedRows(hotInstance) { var _this; _classCallCheck(this, NestedRows); _this = _super.call(this, hotInstance); /** * Reference to the DataManager instance. * * @private * @type {object} */ _this.dataManager = null; /** * Reference to the HeadersUI instance. * * @private * @type {object} */ _this.headersUI = null; /** * Map of skipped rows by plugin. * * @private * @type {null|TrimmingMap} */ _this.collapsedRowsMap = null; privatePool.set(_assertThisInitialized(_this), { movedToCollapsed: false, skipRender: null, skipCoreAPIModifiers: false }); 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 NestedRows#enablePlugin} method is called. * * @returns {boolean} */ _createClass(NestedRows, [{ key: "isEnabled", value: function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } this.collapsedRowsMap = this.hot.rowIndexMapper.registerMap('nestedRows', new _translations_index_mjs__WEBPACK_IMPORTED_MODULE_27__["TrimmingMap"]()); this.dataManager = new _data_dataManager_mjs__WEBPACK_IMPORTED_MODULE_21__["default"](this, this.hot); this.collapsingUI = new _ui_collapsing_mjs__WEBPACK_IMPORTED_MODULE_22__["default"](this, this.hot); this.headersUI = new _ui_headers_mjs__WEBPACK_IMPORTED_MODULE_23__["default"](this, this.hot); this.contextMenuUI = new _ui_contextMenu_mjs__WEBPACK_IMPORTED_MODULE_24__["default"](this, this.hot); this.rowMoveController = new _utils_rowMoveController_mjs__WEBPACK_IMPORTED_MODULE_28__["default"](this); this.addHook('afterInit', function () { return _this2.onAfterInit.apply(_this2, arguments); }); this.addHook('beforeRender', function () { return _this2.onBeforeRender.apply(_this2, arguments); }); this.addHook('modifyRowData', function () { return _this2.onModifyRowData.apply(_this2, arguments); }); this.addHook('modifySourceLength', function () { return _this2.onModifySourceLength.apply(_this2, arguments); }); this.addHook('beforeDataSplice', function () { return _this2.onBeforeDataSplice.apply(_this2, arguments); }); this.addHook('beforeDataFilter', function () { return _this2.onBeforeDataFilter.apply(_this2, arguments); }); this.addHook('afterContextMenuDefaultOptions', function () { return _this2.onAfterContextMenuDefaultOptions.apply(_this2, arguments); }); this.addHook('afterGetRowHeader', function () { return _this2.onAfterGetRowHeader.apply(_this2, arguments); }); this.addHook('beforeOnCellMouseDown', function () { return _this2.onBeforeOnCellMouseDown.apply(_this2, arguments); }); this.addHook('beforeRemoveRow', function () { return _this2.onBeforeRemoveRow.apply(_this2, arguments); }); this.addHook('afterRemoveRow', function () { return _this2.onAfterRemoveRow.apply(_this2, arguments); }); this.addHook('beforeAddChild', function () { return _this2.onBeforeAddChild.apply(_this2, arguments); }); this.addHook('afterAddChild', function () { return _this2.onAfterAddChild.apply(_this2, arguments); }); this.addHook('beforeDetachChild', function () { return _this2.onBeforeDetachChild.apply(_this2, arguments); }); this.addHook('afterDetachChild', function () { return _this2.onAfterDetachChild.apply(_this2, arguments); }); this.addHook('modifyRowHeaderWidth', function () { return _this2.onModifyRowHeaderWidth.apply(_this2, arguments); }); this.addHook('afterCreateRow', function () { return _this2.onAfterCreateRow.apply(_this2, arguments); }); this.addHook('beforeRowMove', function () { return _this2.onBeforeRowMove.apply(_this2, arguments); }); this.addHook('beforeLoadData', function (data) { return _this2.onBeforeLoadData(data); }); _get(_getPrototypeOf(NestedRows.prototype), "enablePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { this.hot.rowIndexMapper.unregisterMap('nestedRows'); _get(_getPrototypeOf(NestedRows.prototype), "disablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); var vanillaSourceData = this.hot.getSourceData(); this.enablePlugin(); this.dataManager.updateWithData(vanillaSourceData); _get(_getPrototypeOf(NestedRows.prototype), "updatePlugin", this).call(this); } /** * `beforeRowMove` hook callback. * * @private * @param {Array} rows Array of visual row indexes to be moved. * @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements * will be placed after the moving action. To check the visualization of the final index, please take a look at * [documentation](@/guides/rows/row-summary.md). * @param {undefined|number} dropIndex Visual row index, being a drop index for the moved rows. Points to where we * are going to drop the moved elements. To check visualization of drop index please take a look at * [documentation](@/guides/rows/row-summary.md). * @param {boolean} movePossible Indicates if it's possible to move rows to the desired position. * @fires Hooks#afterRowMove * @returns {boolean} */ }, { key: "onBeforeRowMove", value: function onBeforeRowMove(rows, finalIndex, dropIndex, movePossible) { return this.rowMoveController.onBeforeRowMove(rows, finalIndex, dropIndex, movePossible); } /** * Enable the modify hook skipping flag - allows retrieving the data from Handsontable without this plugin's * modifications. */ }, { key: "disableCoreAPIModifiers", value: function disableCoreAPIModifiers() { var priv = privatePool.get(this); priv.skipCoreAPIModifiers = true; } /** * Disable the modify hook skipping flag. */ }, { key: "enableCoreAPIModifiers", value: function enableCoreAPIModifiers() { var priv = privatePool.get(this); priv.skipCoreAPIModifiers = false; } /** * `beforeOnCellMousedown` hook callback. * * @private * @param {MouseEvent} event Mousedown event. * @param {object} coords Cell coords. * @param {HTMLElement} TD Clicked cell. */ }, { key: "onBeforeOnCellMouseDown", value: function onBeforeOnCellMouseDown(event, coords, TD) { this.collapsingUI.toggleState(event, coords, TD); } /** * The modifyRowData hook callback. * * @private * @param {number} row Visual row index. * @returns {boolean} */ }, { key: "onModifyRowData", value: function onModifyRowData(row) { var priv = privatePool.get(this); if (priv.skipCoreAPIModifiers) { return; } return this.dataManager.getDataObject(row); } /** * Modify the source data length to match the length of the nested structure. * * @private * @returns {number} */ }, { key: "onModifySourceLength", value: function onModifySourceLength() { var priv = privatePool.get(this); if (priv.skipCoreAPIModifiers) { return; } return this.dataManager.countAllRows(); } /** * @private * @param {number} index The index where the data was spliced. * @param {number} amount An amount of items to remove. * @param {object} element An element to add. * @returns {boolean} */ }, { key: "onBeforeDataSplice", value: function onBeforeDataSplice(index, amount, element) { var priv = privatePool.get(this); if (priv.skipCoreAPIModifiers || this.dataManager.isRowHighestLevel(index)) { return true; } this.dataManager.spliceData(index, amount, element); return false; } /** * Called before the source data filtering. Returning `false` stops the native filtering. * * @private * @param {number} index The index where the data filtering starts. * @param {number} amount An amount of rows which filtering applies to. * @param {number} physicalRows Physical row indexes. * @returns {boolean} */ }, { key: "onBeforeDataFilter", value: function onBeforeDataFilter(index, amount, physicalRows) { var priv = privatePool.get(this); this.collapsingUI.collapsedRowsStash.stash(); this.collapsingUI.collapsedRowsStash.trimStash(physicalRows[0], amount); this.collapsingUI.collapsedRowsStash.shiftStash(physicalRows[0], null, -1 * amount); this.dataManager.filterData(index, amount, physicalRows); priv.skipRender = true; return false; } /** * `afterContextMenuDefaultOptions` hook callback. * * @private * @param {object} defaultOptions The default context menu items order. * @returns {boolean} */ }, { key: "onAfterContextMenuDefaultOptions", value: function onAfterContextMenuDefaultOptions(defaultOptions) { return this.contextMenuUI.appendOptions(defaultOptions); } /** * `afterGetRowHeader` hook callback. * * @private * @param {number} row Row index. * @param {HTMLElement} TH Row header element. */ }, { key: "onAfterGetRowHeader", value: function onAfterGetRowHeader(row, TH) { this.headersUI.appendLevelIndicators(row, TH); } /** * `modifyRowHeaderWidth` hook callback. * * @private * @param {number} rowHeaderWidth The initial row header width(s). * @returns {number} */ }, { key: "onModifyRowHeaderWidth", value: function onModifyRowHeaderWidth(rowHeaderWidth) { return this.headersUI.rowHeaderWidthCache || rowHeaderWidth; } /** * `onAfterRemoveRow` hook callback. * * @private * @param {number} index Removed row. * @param {number} amount Amount of removed rows. * @param {Array} logicRows An array of the removed physical rows. * @param {string} source Source of action. */ }, { key: "onAfterRemoveRow", value: function onAfterRemoveRow(index, amount, logicRows, source) { var _this3 = this; if (source === this.pluginName) { return; } var priv = privatePool.get(this); setTimeout(function () { priv.skipRender = null; _this3.headersUI.updateRowHeaderWidth(); _this3.collapsingUI.collapsedRowsStash.applyStash(); }, 0); } /** * Callback for the `beforeRemoveRow` change list of removed physical indexes by reference. Removing parent node * has effect in removing children nodes. * * @private * @param {number} index Visual index of starter row. * @param {number} amount Amount of rows to be removed. * @param {Array} physicalRows List of physical indexes. */ }, { key: "onBeforeRemoveRow", value: function onBeforeRemoveRow(index, amount, physicalRows) { var _this4 = this; var modifiedPhysicalRows = Array.from(physicalRows.reduce(function (removedRows, physicalIndex) { if (_this4.dataManager.isParent(physicalIndex)) { var children = _this4.dataManager.getDataObject(physicalIndex).__children; // Preserve a parent in the list of removed rows. removedRows.add(physicalIndex); if (Array.isArray(children)) { // Add a children to the list of removed rows. children.forEach(function (child) { return removedRows.add(_this4.dataManager.getRowIndex(child)); }); } return removedRows; } // Don't modify list of removed rows when already checked element isn't a parent. return removedRows.add(physicalIndex); }, new Set())); // Modifying hook's argument by the reference. physicalRows.length = 0; physicalRows.push.apply(physicalRows, _toConsumableArray(modifiedPhysicalRows)); } /** * `beforeAddChild` hook callback. * * @private */ }, { key: "onBeforeAddChild", value: function onBeforeAddChild() { this.collapsingUI.collapsedRowsStash.stash(); } /** * `afterAddChild` hook callback. * * @private * @param {object} parent Parent element. * @param {object} element New child element. */ }, { key: "onAfterAddChild", value: function onAfterAddChild(parent, element) { this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(element)); this.collapsingUI.collapsedRowsStash.applyStash(); this.headersUI.updateRowHeaderWidth(); } /** * `beforeDetachChild` hook callback. * * @private */ }, { key: "onBeforeDetachChild", value: function onBeforeDetachChild() { this.collapsingUI.collapsedRowsStash.stash(); } /** * `afterDetachChild` hook callback. * * @private * @param {object} parent Parent element. * @param {object} element New child element. */ }, { key: "onAfterDetachChild", value: function onAfterDetachChild(parent, element) { this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(element), null, -1); this.collapsingUI.collapsedRowsStash.applyStash(); this.headersUI.updateRowHeaderWidth(); } /** * `afterCreateRow` hook callback. * * @private * @param {number} index Represents the visual index of first newly created row in the data source array. * @param {number} amount Number of newly created rows in the data source array. * @param {string} source String that identifies source of hook call. */ }, { key: "onAfterCreateRow", value: function onAfterCreateRow(index, amount, source) { if (source === this.pluginName) { return; } this.dataManager.updateWithData(this.dataManager.getRawSourceData()); } /** * `afterInit` hook callback. * * @private */ }, { key: "onAfterInit", value: function onAfterInit() { var deepestLevel = Math.max.apply(Math, _toConsumableArray(this.dataManager.cache.levels)); if (deepestLevel > 0) { this.headersUI.updateRowHeaderWidth(deepestLevel); } } /** * `beforeRender` hook callback. * * @param {boolean} force Indicates if the render call was trigered by a change of settings or data. * @param {object} skipRender An object, holder for skipRender functionality. * @private */ }, { key: "onBeforeRender", value: function onBeforeRender(force, skipRender) { var priv = privatePool.get(this); if (priv.skipRender) { skipRender.skipRender = true; } } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { _get(_getPrototypeOf(NestedRows.prototype), "destroy", this).call(this); } /** * `beforeLoadData` hook callback. * * @param {Array} data The source data. * @private */ }, { key: "onBeforeLoadData", value: function onBeforeLoadData(data) { if (!Object(_helpers_data_mjs__WEBPACK_IMPORTED_MODULE_26__["isArrayOfObjects"])(data)) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_25__["error"])(WRONG_DATA_TYPE_ERROR); this.disablePlugin(); return; } this.dataManager.setData(data); this.dataManager.rewriteCache(); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return NestedRows; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_20__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedRows/ui/_base.mjs": /*!*******************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedRows/ui/_base.mjs ***! \*******************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * Base class for the Nested Rows' UI sub-classes. * * @class * @util * @private */ var BaseUI = function BaseUI(pluginInstance, hotInstance) { _classCallCheck(this, BaseUI); /** * Instance of Handsontable. * * @type {Core} */ this.hot = hotInstance; /** * Reference to the main plugin instance. */ this.plugin = pluginInstance; }; /* harmony default export */ __webpack_exports__["default"] = (BaseUI); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedRows/ui/collapsing.mjs": /*!************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedRows/ui/collapsing.mjs ***! \************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../helpers/dom/event.mjs */ "./node_modules/handsontable/helpers/dom/event.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/nestedRows/ui/_base.mjs"); /* harmony import */ var _headers_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./headers.mjs */ "./node_modules/handsontable/plugins/nestedRows/ui/headers.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /** * Class responsible for the UI for collapsing and expanding groups. * * @class * @util * @private * @augments BaseUI */ var CollapsingUI = /*#__PURE__*/function (_BaseUI) { _inherits(CollapsingUI, _BaseUI); var _super = _createSuper(CollapsingUI); function CollapsingUI(nestedRowsPlugin, hotInstance) { var _this; _classCallCheck(this, CollapsingUI); _this = _super.call(this, nestedRowsPlugin, hotInstance); /** * Reference to the TrimRows plugin. */ _this.dataManager = _this.plugin.dataManager; _this.collapsedRows = []; _this.collapsedRowsStash = { stash: function stash() { var forceRender = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; _this.lastCollapsedRows = _this.collapsedRows.slice(0); // Workaround for wrong indexes being set in the trimRows plugin _this.expandMultipleChildren(_this.lastCollapsedRows, forceRender); }, shiftStash: function shiftStash(baseIndex, targetIndex) { var delta = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; if (targetIndex === null || targetIndex === void 0) { targetIndex = Infinity; } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(_this.lastCollapsedRows, function (elem, i) { if (elem >= baseIndex && elem < targetIndex) { _this.lastCollapsedRows[i] = elem + delta; } }); }, applyStash: function applyStash() { var forceRender = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; _this.collapseMultipleChildren(_this.lastCollapsedRows, forceRender); _this.lastCollapsedRows = void 0; }, trimStash: function trimStash(realElementIndex, amount) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_17__["rangeEach"])(realElementIndex, realElementIndex + amount - 1, function (i) { var indexOfElement = _this.lastCollapsedRows.indexOf(i); if (indexOfElement > -1) { _this.lastCollapsedRows.splice(indexOfElement, 1); } }); } }; return _this; } /** * Collapse the children of the row passed as an argument. * * @param {number|object} row The parent row. * @param {boolean} [forceRender=true] Whether to render the table after the function ends. * @param {boolean} [doTrimming=true] I determine whether collapsing should envolve trimming rows. * @returns {Array} */ _createClass(CollapsingUI, [{ key: "collapseChildren", value: function collapseChildren(row) { var _this2 = this; var forceRender = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var doTrimming = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var rowsToCollapse = []; var rowObject = null; var rowIndex = null; var rowsToTrim = null; if (isNaN(row)) { rowObject = row; rowIndex = this.dataManager.getRowIndex(rowObject); } else { rowObject = this.dataManager.getDataObject(row); rowIndex = row; } if (this.dataManager.hasChildren(rowObject)) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(rowObject.__children, function (elem) { rowsToCollapse.push(_this2.dataManager.getRowIndex(elem)); }); } rowsToTrim = this.collapseRows(rowsToCollapse, true, false); if (doTrimming) { this.trimRows(rowsToTrim); } if (forceRender) { this.renderAndAdjust(); } if (this.collapsedRows.indexOf(rowIndex) === -1) { this.collapsedRows.push(rowIndex); } return rowsToTrim; } /** * Collapse multiple children. * * @param {Array} rows Rows to collapse (including their children). * @param {boolean} [forceRender=true] `true` if the table should be rendered after finishing the function. * @param {boolean} [doTrimming=true] I determine whether collapsing should envolve trimming rows. */ }, { key: "collapseMultipleChildren", value: function collapseMultipleChildren(rows) { var _this3 = this; var forceRender = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var doTrimming = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var rowsToTrim = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(rows, function (elem) { rowsToTrim.push.apply(rowsToTrim, _toConsumableArray(_this3.collapseChildren(elem, false, false))); }); if (doTrimming) { this.trimRows(rowsToTrim); } if (forceRender) { this.renderAndAdjust(); } } /** * Collapse a single row. * * @param {number} rowIndex Index of the row to collapse. * @param {boolean} [recursive=true] `true` if it should collapse the row's children. */ }, { key: "collapseRow", value: function collapseRow(rowIndex) { var recursive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; this.collapseRows([rowIndex], recursive); } /** * Collapse multiple rows. * * @param {Array} rowIndexes Array of row indexes to collapse. * @param {boolean} [recursive=true] `true` if it should collapse the rows' children. * @param {boolean} [doTrimming=true] I determine whether collapsing should envolve trimming rows. * @returns {Array} Rows prepared for trimming (or trimmed, if doTrimming == true). */ }, { key: "collapseRows", value: function collapseRows(rowIndexes) { var _this4 = this; var recursive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var doTrimming = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var rowsToTrim = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(rowIndexes, function (elem) { rowsToTrim.push(elem); if (recursive) { _this4.collapseChildRows(elem, rowsToTrim); } }); if (doTrimming) { this.trimRows(rowsToTrim); } return rowsToTrim; } /** * Collapse child rows of the row at the provided index. * * @param {number} parentIndex Index of the parent node. * @param {Array} [rowsToTrim=[]] Array of rows to trim. Defaults to an empty array. * @param {boolean} [recursive] `true` if the collapsing process should be recursive. * @param {boolean} [doTrimming=true] I determine whether collapsing should envolve trimming rows. */ }, { key: "collapseChildRows", value: function collapseChildRows(parentIndex) { var _this5 = this; var rowsToTrim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var recursive = arguments.length > 2 ? arguments[2] : undefined; var doTrimming = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; if (this.dataManager.hasChildren(parentIndex)) { var parentObject = this.dataManager.getDataObject(parentIndex); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(parentObject.__children, function (elem) { var elemIndex = _this5.dataManager.getRowIndex(elem); rowsToTrim.push(elemIndex); _this5.collapseChildRows(elemIndex, rowsToTrim); }); } if (doTrimming) { this.trimRows(rowsToTrim); } } /** * Expand a single row. * * @param {number} rowIndex Index of the row to expand. * @param {boolean} [recursive=true] `true` if it should expand the row's children recursively. */ }, { key: "expandRow", value: function expandRow(rowIndex) { var recursive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; this.expandRows([rowIndex], recursive); } /** * Expand multiple rows. * * @param {Array} rowIndexes Array of indexes of the rows to expand. * @param {boolean} [recursive=true] `true` if it should expand the rows' children recursively. * @param {boolean} [doTrimming=true] I determine whether collapsing should envolve trimming rows. * @returns {Array} Array of row indexes to be untrimmed. */ }, { key: "expandRows", value: function expandRows(rowIndexes) { var _this6 = this; var recursive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var doTrimming = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var rowsToUntrim = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(rowIndexes, function (elem) { rowsToUntrim.push(elem); if (recursive) { _this6.expandChildRows(elem, rowsToUntrim); } }); if (doTrimming) { this.untrimRows(rowsToUntrim); } return rowsToUntrim; } /** * Expand child rows of the provided index. * * @param {number} parentIndex Index of the parent row. * @param {Array} [rowsToUntrim=[]] Array of the rows to be untrimmed. * @param {boolean} [recursive] `true` if it should expand the rows' children recursively. * @param {boolean} [doTrimming=false] I determine whether collapsing should envolve trimming rows. */ }, { key: "expandChildRows", value: function expandChildRows(parentIndex) { var _this7 = this; var rowsToUntrim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var recursive = arguments.length > 2 ? arguments[2] : undefined; var doTrimming = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; if (this.dataManager.hasChildren(parentIndex)) { var parentObject = this.dataManager.getDataObject(parentIndex); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(parentObject.__children, function (elem) { if (!_this7.isAnyParentCollapsed(elem)) { var elemIndex = _this7.dataManager.getRowIndex(elem); rowsToUntrim.push(elemIndex); _this7.expandChildRows(elemIndex, rowsToUntrim); } }); } if (doTrimming) { this.untrimRows(rowsToUntrim); } } /** * Expand the children of the row passed as an argument. * * @param {number|object} row Parent row. * @param {boolean} [forceRender=true] Whether to render the table after the function ends. * @param {boolean} [doTrimming=true] If set to `true`, the trimming will be applied when the function finishes. * @returns {number[]} */ }, { key: "expandChildren", value: function expandChildren(row) { var _this8 = this; var forceRender = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var doTrimming = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var rowsToExpand = []; var rowObject = null; var rowIndex = null; var rowsToUntrim = null; if (isNaN(row)) { rowObject = row; rowIndex = this.dataManager.getRowIndex(row); } else { rowObject = this.dataManager.getDataObject(row); rowIndex = row; } this.collapsedRows.splice(this.collapsedRows.indexOf(rowIndex), 1); if (this.dataManager.hasChildren(rowObject)) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(rowObject.__children, function (elem) { var childIndex = _this8.dataManager.getRowIndex(elem); rowsToExpand.push(childIndex); }); } rowsToUntrim = this.expandRows(rowsToExpand, true, false); if (doTrimming) { this.untrimRows(rowsToUntrim); } if (forceRender) { this.renderAndAdjust(); } return rowsToUntrim; } /** * Expand multiple rows' children. * * @param {Array} rows Array of rows which children are about to be expanded. * @param {boolean} [forceRender=true] `true` if the table should render after finishing the function. * @param {boolean} [doTrimming=true] `true` if the rows should be untrimmed after finishing the function. */ }, { key: "expandMultipleChildren", value: function expandMultipleChildren(rows) { var _this9 = this; var forceRender = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var doTrimming = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var rowsToUntrim = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(rows, function (elem) { rowsToUntrim.push.apply(rowsToUntrim, _toConsumableArray(_this9.expandChildren(elem, false, false))); }); if (doTrimming) { this.untrimRows(rowsToUntrim); } if (forceRender) { this.renderAndAdjust(); } } /** * Collapse all collapsable rows. */ }, { key: "collapseAll", value: function collapseAll() { var _this10 = this; var data = this.dataManager.getData(); var parentsToCollapse = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(data, function (elem) { if (_this10.dataManager.hasChildren(elem)) { parentsToCollapse.push(elem); } }); this.collapseMultipleChildren(parentsToCollapse); this.renderAndAdjust(); } /** * Expand all collapsable rows. */ }, { key: "expandAll", value: function expandAll() { var _this11 = this; var data = this.dataManager.getData(); var parentsToExpand = []; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(data, function (elem) { if (_this11.dataManager.hasChildren(elem)) { parentsToExpand.push(elem); } }); this.expandMultipleChildren(parentsToExpand); this.renderAndAdjust(); } /** * Trim rows. * * @param {Array} rows Physical row indexes. */ }, { key: "trimRows", value: function trimRows(rows) { var _this12 = this; this.hot.batchExecution(function () { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(rows, function (physicalRow) { _this12.plugin.collapsedRowsMap.setValueAtIndex(physicalRow, true); }); }, true); } /** * Untrim rows. * * @param {Array} rows Physical row indexes. */ }, { key: "untrimRows", value: function untrimRows(rows) { var _this13 = this; this.hot.batchExecution(function () { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(rows, function (physicalRow) { _this13.plugin.collapsedRowsMap.setValueAtIndex(physicalRow, false); }); }, true); } /** * Check if all child rows are collapsed. * * @private * @param {number|object|null} row The parent row. `null` for the top level. * @returns {boolean} */ }, { key: "areChildrenCollapsed", value: function areChildrenCollapsed(row) { var _this14 = this; var rowObj = isNaN(row) ? row : this.dataManager.getDataObject(row); var allCollapsed = true; // Checking the children of the top-level "parent" if (rowObj === null) { rowObj = { __children: this.dataManager.data }; } if (this.dataManager.hasChildren(rowObj)) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayEach"])(rowObj.__children, function (elem) { var rowIndex = _this14.dataManager.getRowIndex(elem); if (!_this14.plugin.collapsedRowsMap.getValueAtIndex(rowIndex)) { allCollapsed = false; return false; } }); } return allCollapsed; } /** * Check if any of the row object parents are collapsed. * * @private * @param {object} rowObj Row object. * @returns {boolean} */ }, { key: "isAnyParentCollapsed", value: function isAnyParentCollapsed(rowObj) { var parent = rowObj; while (parent !== null) { parent = this.dataManager.getRowParent(parent); var parentIndex = this.dataManager.getRowIndex(parent); if (this.collapsedRows.indexOf(parentIndex) > -1) { return true; } } return false; } /** * Toggle collapsed state. Callback for the `beforeOnCellMousedown` hook. * * @private * @param {MouseEvent} event `mousedown` event. * @param {object} coords Coordinates of the clicked cell/header. */ }, { key: "toggleState", value: function toggleState(event, coords) { if (coords.col >= 0) { return; } var row = this.translateTrimmedRow(coords.row); if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_18__["hasClass"])(event.target, _headers_mjs__WEBPACK_IMPORTED_MODULE_20__["default"].CSS_CLASSES.button)) { if (this.areChildrenCollapsed(row)) { this.expandChildren(row); } else { this.collapseChildren(row); } Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_15__["stopImmediatePropagation"])(event); } } /** * Translate visual row after trimming to physical base row index. * * @private * @param {number} row Row index. * @returns {number} Base row index. */ }, { key: "translateTrimmedRow", value: function translateTrimmedRow(row) { return this.hot.toPhysicalRow(row); } /** * Translate physical row after trimming to visual base row index. * * @private * @param {number} row Row index. * @returns {number} Base row index. */ }, { key: "untranslateTrimmedRow", value: function untranslateTrimmedRow(row) { return this.hot.toVisualRow(row); } /** * Helper function to render the table and call the `adjustElementsSize` method. * * @private */ }, { key: "renderAndAdjust", value: function renderAndAdjust() { this.hot.render(); // Dirty workaround to prevent scroll height not adjusting to the table height. Needs refactoring in the future. this.hot.view.adjustElementsSize(); } }]); return CollapsingUI; }(_base_mjs__WEBPACK_IMPORTED_MODULE_19__["default"]); /* harmony default export */ __webpack_exports__["default"] = (CollapsingUI); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedRows/ui/contextMenu.mjs": /*!*************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedRows/ui/contextMenu.mjs ***! \*************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../i18n/constants.mjs */ "./node_modules/handsontable/i18n/constants.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/nestedRows/ui/_base.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var privatePool = new WeakMap(); /** * Class responsible for the Context Menu entries for the Nested Rows plugin. * * @class ContextMenuUI * @util * @private * @augments BaseUI */ var ContextMenuUI = /*#__PURE__*/function (_BaseUI) { _inherits(ContextMenuUI, _BaseUI); var _super = _createSuper(ContextMenuUI); function ContextMenuUI(nestedRowsPlugin, hotInstance) { var _this; _classCallCheck(this, ContextMenuUI); _this = _super.call(this, nestedRowsPlugin, hotInstance); privatePool.set(_assertThisInitialized(_this), { row_above: function row_above(key, selection) { var lastSelection = selection[selection.length - 1]; _this.dataManager.addSibling(lastSelection.start.row, 'above'); }, row_below: function row_below(key, selection) { var lastSelection = selection[selection.length - 1]; _this.dataManager.addSibling(lastSelection.start.row, 'below'); } }); /** * Reference to the DataManager instance connected with the Nested Rows plugin. * * @type {DataManager} */ _this.dataManager = _this.plugin.dataManager; return _this; } /** * Append options to the context menu. (Propagated from the `afterContextMenuDefaultOptions` hook callback) * f. * * @private * @param {object} defaultOptions Default context menu options. * @returns {*} */ _createClass(ContextMenuUI, [{ key: "appendOptions", value: function appendOptions(defaultOptions) { var _this2 = this; var newEntries = [{ key: 'add_child', name: function name() { return this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_14__["CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD"]); }, callback: function callback() { var translatedRowIndex = _this2.dataManager.translateTrimmedRow(_this2.hot.getSelectedLast()[0]); var parent = _this2.dataManager.getDataObject(translatedRowIndex); _this2.dataManager.addChild(parent); }, disabled: function disabled() { var selected = _this2.hot.getSelectedLast(); return !selected || selected[0] < 0 || _this2.hot.selection.isSelectedByColumnHeader() || _this2.hot.countRows() >= _this2.hot.getSettings().maxRows; } }, { key: 'detach_from_parent', name: function name() { return this.getTranslatedPhrase(_i18n_constants_mjs__WEBPACK_IMPORTED_MODULE_14__["CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD"]); }, callback: function callback() { _this2.dataManager.detachFromParent(_this2.hot.getSelectedLast()); }, disabled: function disabled() { var selected = _this2.hot.getSelectedLast(); var translatedRowIndex = _this2.dataManager.translateTrimmedRow(selected[0]); var parent = _this2.dataManager.getRowParent(translatedRowIndex); return !parent || !selected || selected[0] < 0 || _this2.hot.selection.isSelectedByColumnHeader() || _this2.hot.countRows() >= _this2.hot.getSettings().maxRows; } }, { name: '---------' }]; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_12__["rangeEach"])(0, defaultOptions.items.length - 1, function (i) { if (i === 0) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(newEntries, function (val, j) { defaultOptions.items.splice(i + j, 0, val); }); return false; } }); return this.modifyRowInsertingOptions(defaultOptions); } /** * Modify how the row inserting options work. * * @private * @param {object} defaultOptions Default context menu items. * @returns {*} */ }, { key: "modifyRowInsertingOptions", value: function modifyRowInsertingOptions(defaultOptions) { var priv = privatePool.get(this); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_12__["rangeEach"])(0, defaultOptions.items.length - 1, function (i) { var option = priv[defaultOptions.items[i].key]; if (option !== null && option !== void 0) { defaultOptions.items[i].callback = option; } }); return defaultOptions; } }]); return ContextMenuUI; }(_base_mjs__WEBPACK_IMPORTED_MODULE_15__["default"]); /* harmony default export */ __webpack_exports__["default"] = (ContextMenuUI); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedRows/ui/headers.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedRows/ui/headers.mjs ***! \*********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _base_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_base.mjs */ "./node_modules/handsontable/plugins/nestedRows/ui/_base.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /** * Class responsible for the UI in the Nested Rows' row headers. * * @class HeadersUI * @private * @util * @augments BaseUI */ var HeadersUI = /*#__PURE__*/function (_BaseUI) { _inherits(HeadersUI, _BaseUI); var _super = _createSuper(HeadersUI); function HeadersUI(nestedRowsPlugin, hotInstance) { var _this; _classCallCheck(this, HeadersUI); _this = _super.call(this, nestedRowsPlugin, hotInstance); /** * Reference to the DataManager instance connected with the Nested Rows plugin. * * @type {DataManager} */ _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; 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.hot.toPhysicalRow(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"]'); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_11__["arrayEach"])(previousIndicators, function (elem) { if (elem) { innerDiv.removeChild(elem); } }); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(TH, HeadersUI.CSS_CLASSES.indicatorContainer); if (rowLevel) { var rootDocument = this.hot.rootDocument; var initialContent = innerSpan.cloneNode(true); innerDiv.innerHTML = ''; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_12__["rangeEach"])(0, rowLevel - 1, function () { var levelIndicator = rootDocument.createElement('SPAN'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(levelIndicator, HeadersUI.CSS_CLASSES.emptyIndicator); innerDiv.appendChild(levelIndicator); }); innerDiv.appendChild(initialContent); } if (this.dataManager.hasChildren(rowObject)) { var buttonsContainer = this.hot.rootDocument.createElement('DIV'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(TH, HeadersUI.CSS_CLASSES.parent); if (this.collapsingUI.areChildrenCollapsed(rowIndex)) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(buttonsContainer, "".concat(HeadersUI.CSS_CLASSES.button, " ").concat(HeadersUI.CSS_CLASSES.expandButton)); } else { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(buttonsContainer, "".concat(HeadersUI.CSS_CLASSES.button, " ").concat(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(); } }], [{ key: "CSS_CLASSES", get: /** * CSS classes used in the row headers. * * @type {object} */ 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' }; } }]); return HeadersUI; }(_base_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]); /* harmony default export */ __webpack_exports__["default"] = (HeadersUI); /***/ }), /***/ "./node_modules/handsontable/plugins/nestedRows/utils/rowMoveController.mjs": /*!**********************************************************************************!*\ !*** ./node_modules/handsontable/plugins/nestedRows/utils/rowMoveController.mjs ***! \**********************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RowMoveController; }); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.freeze.js */ "./node_modules/core-js/modules/es.object.freeze.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _helpers_console_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../helpers/console.mjs */ "./node_modules/handsontable/helpers/console.mjs"); /* harmony import */ var _helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../helpers/templateLiteralTag.mjs */ "./node_modules/handsontable/helpers/templateLiteralTag.mjs"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); var _templateObject; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } 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"); } } 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; } /** * Helper class for the row-move-related operations. * * @class RowMoveController * @plugin NestedRows * @private */ var RowMoveController = /*#__PURE__*/function () { function RowMoveController(plugin) { _classCallCheck(this, RowMoveController); /** * Reference to the Nested Rows plugin instance. * * @type {NestedRows} */ this.plugin = plugin; /** * Reference to the Handsontable instance. * * @type {Handsontable.Core} */ this.hot = plugin.hot; /** * Reference to the Data Manager class instance. * * @type {DataManager} */ this.dataManager = plugin.dataManager; /** * Reference to the Collapsing UI class instance. * * @type {CollapsingUI} */ this.collapsingUI = plugin.collapsingUI; } /** * `beforeRowMove` hook callback. * * @param {Array} rows Array of visual row indexes to be moved. * @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements * will be placed after the moving action. To check the visualization of the final index, please take a look at * [documentation](@/guides/rows/row-moving.md). * @param {undefined|number} dropIndex Visual row index, being a drop index for the moved rows. Points to where we * are going to drop the moved elements. To check visualization of drop index please take a look at * [documentation](@/guides/rows/row-moving.md). * @param {boolean} movePossible Indicates if it's possible to move rows to the desired position. * @fires Hooks#afterRowMove * @returns {boolean} */ _createClass(RowMoveController, [{ key: "onBeforeRowMove", value: function onBeforeRowMove(rows, finalIndex, dropIndex, movePossible) { var _this = this; var improperUsage = this.displayAPICompatibilityWarning({ rows: rows, finalIndex: finalIndex, dropIndex: dropIndex, movePossible: movePossible }); if (improperUsage) { return false; } this.movedToCollapsed = false; var dropToLastRow = dropIndex === this.hot.countRows(); var physicalDropIndex = dropToLastRow ? this.hot.countSourceRows() : this.dataManager.translateTrimmedRow(dropIndex); var allowMove = true; var physicalStartIndexes = rows.map(function (rowIndex) { // Don't do the logic for the rest of the rows, as it's bound to fail anyway. if (!allowMove) { return false; } var physicalRowIndex = _this.dataManager.translateTrimmedRow(rowIndex); allowMove = _this.shouldAllowMoving(physicalRowIndex, physicalDropIndex); return physicalRowIndex; }); var willDataChange = physicalStartIndexes.indexOf(physicalDropIndex) === -1; if (!allowMove || !willDataChange) { return false; } var baseParent = this.getBaseParent(physicalStartIndexes); var targetParent = this.getTargetParent(dropToLastRow, physicalDropIndex); var sameParent = baseParent === targetParent; this.movedToCollapsed = this.collapsingUI.areChildrenCollapsed(targetParent); // Stash the current state of collapsed rows this.collapsingUI.collapsedRowsStash.stash(); this.shiftCollapsibleParentsLocations(physicalStartIndexes, physicalDropIndex, sameParent); this.moveRows(physicalStartIndexes, physicalDropIndex, targetParent); this.dataManager.updateWithData(this.dataManager.getRawSourceData()); this.moveCellsMeta(physicalStartIndexes, physicalDropIndex); this.collapsingUI.collapsedRowsStash.applyStash(false); // TODO: Trying to mock real work of the `ManualRowMove` plugin. It was blocked by returning `false` below. this.hot.runHooks('afterRowMove', rows, finalIndex, dropIndex, movePossible, movePossible && this.isRowOrderChanged(rows, finalIndex)); // Not necessary - added to keep compatibility with other plugins (namely: columnSummary). this.hot.render(); this.selectCells(rows, dropIndex); return false; } /** * Display a `dragRows`/`moveRows` method compatibility warning if needed. * * @param {object} beforeMoveRowHookArgs A set of arguments from the `beforeMoveRow` hook. * @returns {boolean} `true` if is a result of an improper usage of the moving API. */ }, { key: "displayAPICompatibilityWarning", value: function displayAPICompatibilityWarning(beforeMoveRowHookArgs) { var rows = beforeMoveRowHookArgs.rows, finalIndex = beforeMoveRowHookArgs.finalIndex, dropIndex = beforeMoveRowHookArgs.dropIndex, movePossible = beforeMoveRowHookArgs.movePossible; var shouldTerminate = false; if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_15__["isUndefined"])(dropIndex)) { Object(_helpers_console_mjs__WEBPACK_IMPORTED_MODULE_16__["warn"])(Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_17__["toSingleLine"])(_templateObject || (_templateObject = _taggedTemplateLiteral(["Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows \n when the NestedRows plugin is enabled. Please use the 'dragRows' method instead."], ["Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\\x20\n when the NestedRows plugin is enabled. Please use the 'dragRows' method instead."])))); // TODO: Trying to mock real work of the `ManualRowMove` plugin. It was blocked by returning `false` below. this.hot.runHooks('afterRowMove', rows, finalIndex, dropIndex, movePossible, false); shouldTerminate = true; } return shouldTerminate; } /** * Check if the moving action should be allowed. * * @param {number} physicalRowIndex Physical start row index. * @param {number} physicalDropIndex Physical drop index. * @returns {boolean} `true` if it should continue with the moving action. */ }, { key: "shouldAllowMoving", value: function shouldAllowMoving(physicalRowIndex, physicalDropIndex) { /* We can't move rows when any of them is: - a parent - a top-level element - is being moved to the top level - is being moved to the position of any of the moved rows (not changing position) */ return !(this.dataManager.isParent(physicalRowIndex) || this.dataManager.isRowHighestLevel(physicalRowIndex) || physicalRowIndex === physicalDropIndex || physicalDropIndex === 0); } /** * Get the base row parent. * * @param {number} physicalStartIndexes Physical start row index. * @returns {object|null} The base row parent. */ }, { key: "getBaseParent", value: function getBaseParent(physicalStartIndexes) { return this.dataManager.getRowParent(physicalStartIndexes[0]); } /** * Get the target row parent. * * @param {boolean} dropToLastRow `true` if the row is moved to the last row of the table. * @param {number} physicalDropIndex Physical drop row index. * @returns {object|null} The target row parent. */ }, { key: "getTargetParent", value: function getTargetParent(dropToLastRow, physicalDropIndex) { var targetParent = this.dataManager.getRowParent(dropToLastRow ? physicalDropIndex - 1 : physicalDropIndex); // If we try to move an element to the place of a top-level parent, snap the element to the previous top-level // parent's children instead if (targetParent === null || targetParent === void 0) { targetParent = this.dataManager.getRowParent(physicalDropIndex - 1); } return targetParent; } /** * Shift the cached collapsible rows position according to the move action. * * @param {number[]} physicalStartIndexes Physical start row indexes. * @param {number} physicalDropIndex Physical drop index. * @param {boolean} sameParent `true` if the row's being moved between siblings of the same parent. */ }, { key: "shiftCollapsibleParentsLocations", value: function shiftCollapsibleParentsLocations(physicalStartIndexes, physicalDropIndex, sameParent) { if (!sameParent) { if (Math.max.apply(Math, _toConsumableArray(physicalStartIndexes)) <= physicalDropIndex) { this.collapsingUI.collapsedRowsStash.shiftStash(physicalStartIndexes[0], physicalDropIndex, -1 * physicalStartIndexes.length); } else { this.collapsingUI.collapsedRowsStash.shiftStash(physicalDropIndex, physicalStartIndexes[0], physicalStartIndexes.length); } } } /** * Move the rows at the provided coordinates. * * @param {number[]} physicalStartIndexes Physical indexes of the rows about to be moved. * @param {number} physicalDropIndex Physical drop index. * @param {object} targetParent Parent of the destination row. */ }, { key: "moveRows", value: function moveRows(physicalStartIndexes, physicalDropIndex, targetParent) { var _this2 = this; var moveToLastChild = physicalDropIndex === this.dataManager.getRowIndex(targetParent) + this.dataManager.countChildren(targetParent) + 1; this.hot.batchRender(function () { physicalStartIndexes.forEach(function (physicalStartIndex) { _this2.dataManager.moveRow(physicalStartIndex, physicalDropIndex, _this2.movedToCollapsed, moveToLastChild); }); }); } /** * Move the cell meta for multiple rows. * * @param {number[]} baseIndexes Array of indexes for the rows being moved. * @param {number} targetIndex Index of the destination of the move. */ }, { key: "moveCellsMeta", value: function moveCellsMeta(baseIndexes, targetIndex) { var _this3 = this, _this$hot; var rowsOfMeta = []; var movingDown = Math.max.apply(Math, _toConsumableArray(baseIndexes)) < targetIndex; baseIndexes.forEach(function (baseIndex) { rowsOfMeta.push(_this3.hot.getCellMetaAtRow(baseIndex)); }); this.hot.spliceCellsMeta(baseIndexes[0], baseIndexes.length); (_this$hot = this.hot).spliceCellsMeta.apply(_this$hot, [targetIndex - (movingDown ? rowsOfMeta.length : 0), 0].concat(rowsOfMeta)); } /** * Select cells after the move. * * @param {Array} rows Array of visual row indexes to be moved. * @param {undefined|number} dropIndex Visual row index, being a drop index for the moved rows. Points to where we * are going to drop the moved elements. To check visualization of drop index please take a look at * [documentation](@/guides/rows/row-moving.md). */ }, { key: "selectCells", value: function selectCells(rows, dropIndex) { var rowsLen = rows.length; var startRow = 0; var endRow = 0; var selection = null; var lastColIndex = null; if (this.movedToCollapsed) { var physicalDropIndex = null; if (rows[rowsLen - 1] < dropIndex) { physicalDropIndex = this.dataManager.translateTrimmedRow(dropIndex - rowsLen); } else { physicalDropIndex = this.dataManager.translateTrimmedRow(dropIndex); } var parentObject = this.dataManager.getRowParent(physicalDropIndex === null ? this.hot.countSourceRows() - 1 : physicalDropIndex - 1); var parentIndex = this.dataManager.getRowIndex(parentObject); startRow = this.dataManager.untranslateTrimmedRow(parentIndex); endRow = startRow; } else if (rows[rowsLen - 1] < dropIndex) { endRow = dropIndex - 1; startRow = endRow - rowsLen + 1; } else { startRow = dropIndex; endRow = startRow + rowsLen - 1; } selection = this.hot.selection; lastColIndex = this.hot.countCols() - 1; selection.setRangeStart(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_18__["CellCoords"](startRow, 0)); selection.setRangeEnd(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_18__["CellCoords"](endRow, lastColIndex), true); } // TODO: Reimplementation of function which is inside the `ManualRowMove` plugin. /** * Indicates if order of rows was changed. * * @param {Array} movedRows Array of visual row indexes to be moved. * @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements * will be placed after the moving action. To check the visualization of the final index, please take a look at * [documentation](@/guides/rows/row-moving.md). * @returns {boolean} */ }, { key: "isRowOrderChanged", value: function isRowOrderChanged(movedRows, finalIndex) { return movedRows.some(function (row, nrOfMovedElement) { return row - nrOfMovedElement !== finalIndex; }); } }]); return RowMoveController; }(); /***/ }), /***/ "./node_modules/handsontable/plugins/persistentState/index.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/plugins/persistentState/index.mjs ***! \*********************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, PersistentState */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _persistentState_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./persistentState.mjs */ "./node_modules/handsontable/plugins/persistentState/persistentState.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _persistentState_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _persistentState_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PersistentState", function() { return _persistentState_mjs__WEBPACK_IMPORTED_MODULE_0__["PersistentState"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/persistentState/persistentState.mjs": /*!*******************************************************************************!*\ !*** ./node_modules/handsontable/plugins/persistentState/persistentState.mjs ***! \*******************************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, PersistentState */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PersistentState", function() { return PersistentState; }); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _storage_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./storage.mjs */ "./node_modules/handsontable/plugins/persistentState/storage.mjs"); /* harmony import */ var _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../pluginHooks.mjs */ "./node_modules/handsontable/pluginHooks.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_14__["default"].getSingleton().register('persistentStateSave'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_14__["default"].getSingleton().register('persistentStateLoad'); _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_14__["default"].getSingleton().register('persistentStateReset'); var PLUGIN_KEY = 'persistentState'; var PLUGIN_PRIORITY = 0; /** * @plugin PersistentState * @class PersistentState * * @description * Save the state of column sorting, column positions and column sizes in local storage to preserve table state * between page reloads. * * In order to enable data storage mechanism, {@link Options#persistentState} option must be set to `true`. * * When persistentState is enabled it exposes 3 hooks: * - {@link Hooks#persistentStateSave} - Saves value under given key in browser local storage. * - {@link Hooks#persistentStateLoad} - Loads value, saved under given key, from browser local storage. The loaded * value will be saved in `saveTo.value`. * - {@link Hooks#persistentStateReset} - Clears the value saved under key. If no key is given, all values associated * with table will be cleared. */ var PersistentState = /*#__PURE__*/function (_BasePlugin) { _inherits(PersistentState, _BasePlugin); var _super = _createSuper(PersistentState); function PersistentState(hotInstance) { var _this; _classCallCheck(this, PersistentState); _this = _super.call(this, hotInstance); /** * Instance of {@link Storage}. * * @private * @type {Storage} */ _this.storage = void 0; 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 PersistentState#enablePlugin} method is called. * * @returns {boolean} */ _createClass(PersistentState, [{ key: "isEnabled", value: function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } if (!this.storage) { this.storage = new _storage_mjs__WEBPACK_IMPORTED_MODULE_13__["default"](this.hot.rootElement.id, this.hot.rootWindow); } this.addHook('persistentStateSave', function (key, value) { return _this2.saveValue(key, value); }); this.addHook('persistentStateLoad', function (key, saveTo) { return _this2.loadValue(key, saveTo); }); this.addHook('persistentStateReset', function () { return _this2.resetValue(); }); _get(_getPrototypeOf(PersistentState.prototype), "enablePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { this.storage = void 0; _get(_getPrototypeOf(PersistentState.prototype), "disablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); _get(_getPrototypeOf(PersistentState.prototype), "updatePlugin", this).call(this); } /** * Loads the value from local storage. * * @param {string} key Storage key. * @param {object} saveTo Saved value from local storage. */ }, { key: "loadValue", value: function loadValue(key, saveTo) { saveTo.value = this.storage.loadValue(key); } /** * Saves the data to local storage. * * @param {string} key Storage key. * @param {Mixed} value Value to save. */ }, { key: "saveValue", value: function saveValue(key, value) { this.storage.saveValue(key, value); } /** * Resets the data or all data from local storage. * * @param {string} key [optional] Storage key. */ }, { key: "resetValue", value: function resetValue(key) { if (typeof key === 'undefined') { this.storage.resetAll(); } else { this.storage.reset(key); } } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { _get(_getPrototypeOf(PersistentState.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return PersistentState; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_12__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/persistentState/storage.mjs": /*!***********************************************************************!*\ !*** ./node_modules/handsontable/plugins/persistentState/storage.mjs ***! \***********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * @class Storage * @plugin PersistentState */ var Storage = /*#__PURE__*/function () { // eslint-disable-next-line no-restricted-globals function Storage(prefix) { var rootWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window; _classCallCheck(this, Storage); /** * Reference to proper window. * * @type {Window} */ this.rootWindow = rootWindow; /** * Prefix for key (id element). * * @type {string} */ this.prefix = prefix; /** * Saved keys. * * @type {Array} */ this.savedKeys = []; this.loadSavedKeys(); } /** * Save data to localStorage. * * @param {string} key Key string. * @param {Mixed} value Value to save. */ _createClass(Storage, [{ key: "saveValue", value: function saveValue(key, value) { this.rootWindow.localStorage.setItem("".concat(this.prefix, "_").concat(key), JSON.stringify(value)); if (this.savedKeys.indexOf(key) === -1) { this.savedKeys.push(key); this.saveSavedKeys(); } } /** * Load data from localStorage. * * @param {string} key Key string. * @param {object} defaultValue Object containing the loaded data. * * @returns {object|undefined} */ }, { key: "loadValue", value: function loadValue(key, defaultValue) { var itemKey = typeof key === 'undefined' ? defaultValue : key; var value = this.rootWindow.localStorage.getItem("".concat(this.prefix, "_").concat(itemKey)); return value === null ? void 0 : JSON.parse(value); } /** * Reset given data from localStorage. * * @param {string} key Key string. */ }, { key: "reset", value: function reset(key) { this.rootWindow.localStorage.removeItem("".concat(this.prefix, "_").concat(key)); } /** * Reset all data from localStorage. * */ }, { key: "resetAll", value: function resetAll() { var _this = this; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_2__["arrayEach"])(this.savedKeys, function (value, index) { _this.rootWindow.localStorage.removeItem("".concat(_this.prefix, "_").concat(_this.savedKeys[index])); }); this.clearSavedKeys(); } /** * Load and save all keys from localStorage. * * @private */ }, { key: "loadSavedKeys", value: function loadSavedKeys() { var keysJSON = this.rootWindow.localStorage.getItem("".concat(this.prefix, "__persistentStateKeys")); var keys = typeof keysJSON === 'string' ? JSON.parse(keysJSON) : void 0; this.savedKeys = keys || []; } /** * Save saved key in localStorage. * * @private */ }, { key: "saveSavedKeys", value: function saveSavedKeys() { this.rootWindow.localStorage.setItem("".concat(this.prefix, "__persistentStateKeys"), JSON.stringify(this.savedKeys)); } /** * Clear saved key from localStorage. * * @private */ }, { key: "clearSavedKeys", value: function clearSavedKeys() { this.savedKeys.length = 0; this.saveSavedKeys(); } }]); return Storage; }(); /* harmony default export */ __webpack_exports__["default"] = (Storage); /***/ }), /***/ "./node_modules/handsontable/plugins/registry.mjs": /*!********************************************************!*\ !*** ./node_modules/handsontable/plugins/registry.mjs ***! \********************************************************/ /*! exports provided: getPluginsNames, getPlugin, hasPlugin, registerPlugin */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPluginsNames", function() { return getPluginsNames; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPlugin", function() { return getPlugin; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasPlugin", function() { return hasPlugin; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerPlugin", function() { return registerPlugin; }); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _helpers_string_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../helpers/string.mjs */ "./node_modules/handsontable/helpers/string.mjs"); /* harmony import */ var _utils_dataStructures_priorityMap_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/dataStructures/priorityMap.mjs */ "./node_modules/handsontable/utils/dataStructures/priorityMap.mjs"); /* harmony import */ var _utils_dataStructures_uniqueMap_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/dataStructures/uniqueMap.mjs */ "./node_modules/handsontable/utils/dataStructures/uniqueMap.mjs"); /* harmony import */ var _utils_dataStructures_uniqueSet_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utils/dataStructures/uniqueSet.mjs */ "./node_modules/handsontable/utils/dataStructures/uniqueSet.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /** * Utility to register plugins and common namespace for keeping the reference to all plugins classes. */ var ERROR_PLUGIN_REGISTERED = function ERROR_PLUGIN_REGISTERED(pluginName) { return "There is already registered \"".concat(pluginName, "\" plugin."); }; var ERROR_PRIORITY_REGISTERED = function ERROR_PRIORITY_REGISTERED(priority) { return "There is already registered plugin on priority \"".concat(priority, "\"."); }; var ERROR_PRIORITY_NAN = function ERROR_PRIORITY_NAN(priority) { return "The priority \"".concat(priority, "\" is not a number."); }; /** * Stores plugins' names' queue with their priorities. */ var priorityPluginsQueue = Object(_utils_dataStructures_priorityMap_mjs__WEBPACK_IMPORTED_MODULE_12__["createPriorityMap"])({ errorPriorityExists: ERROR_PRIORITY_REGISTERED, errorPriorityNaN: ERROR_PRIORITY_NAN }); /** * Stores plugins names' queue by registration order. */ var uniquePluginsQueue = Object(_utils_dataStructures_uniqueSet_mjs__WEBPACK_IMPORTED_MODULE_14__["createUniqueSet"])({ errorItemExists: ERROR_PLUGIN_REGISTERED }); /** * Stores plugins references between their name and class. */ var uniquePluginsList = Object(_utils_dataStructures_uniqueMap_mjs__WEBPACK_IMPORTED_MODULE_13__["createUniqueMap"])({ errorIdExists: ERROR_PLUGIN_REGISTERED }); /** * Gets registered plugins' names in the following order: * 1) Plugins registered with a defined priority attribute, in the ascending order of priority. * 2) Plugins registered without a defined priority attribute, in the registration order. * * @returns {string[]} */ function getPluginsNames() { return [].concat(_toConsumableArray(priorityPluginsQueue.getItems()), _toConsumableArray(uniquePluginsQueue.getItems())); } /** * Gets registered plugin's class based on the given name. * * @param {string} pluginName Plugin's name. * @returns {BasePlugin} */ function getPlugin(pluginName) { var unifiedPluginName = Object(_helpers_string_mjs__WEBPACK_IMPORTED_MODULE_11__["toUpperCaseFirst"])(pluginName); return uniquePluginsList.getItem(unifiedPluginName); } /** * Checks if the plugin under the name is already registered. * * @param {string} pluginName Plugin's name. * @returns {boolean} */ function hasPlugin(pluginName) { /* eslint-disable no-unneeded-ternary */ return getPlugin(pluginName) ? true : false; } /** * Registers plugin under the given name only once. * * @param {string|Function} pluginName The plugin name or plugin class. * @param {Function} [pluginClass] The plugin class. * @param {number} [priority] The plugin priority. */ function registerPlugin(pluginName, pluginClass, priority) { var _unifyPluginArguments = unifyPluginArguments(pluginName, pluginClass, priority); var _unifyPluginArguments2 = _slicedToArray(_unifyPluginArguments, 3); pluginName = _unifyPluginArguments2[0]; pluginClass = _unifyPluginArguments2[1]; priority = _unifyPluginArguments2[2]; if (getPlugin(pluginName) === void 0) { _registerPlugin(pluginName, pluginClass, priority); } } /** * Registers plugin under the given name. * * @param {string|Function} pluginName The plugin name or plugin class. * @param {Function} [pluginClass] The plugin class. * @param {number} [priority] The plugin priority. */ function _registerPlugin(pluginName, pluginClass, priority) { var unifiedPluginName = Object(_helpers_string_mjs__WEBPACK_IMPORTED_MODULE_11__["toUpperCaseFirst"])(pluginName); if (uniquePluginsList.hasItem(unifiedPluginName)) { throw new Error(ERROR_PLUGIN_REGISTERED(unifiedPluginName)); } if (priority === void 0) { uniquePluginsQueue.addItem(unifiedPluginName); } else { priorityPluginsQueue.addItem(priority, unifiedPluginName); } uniquePluginsList.addItem(unifiedPluginName, pluginClass); } /** * Unifies arguments to register the plugin. * * @param {string|Function} pluginName The plugin name or plugin class. * @param {Function} [pluginClass] The plugin class. * @param {number} [priority] The plugin priority. * @returns {Array} */ function unifyPluginArguments(pluginName, pluginClass, priority) { if (typeof pluginName === 'function') { pluginClass = pluginName; pluginName = pluginClass.PLUGIN_KEY; priority = pluginClass.PLUGIN_PRIORITY; } return [pluginName, pluginClass, priority]; } /***/ }), /***/ "./node_modules/handsontable/plugins/search/index.mjs": /*!************************************************************!*\ !*** ./node_modules/handsontable/plugins/search/index.mjs ***! \************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, Search */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _search_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./search.mjs */ "./node_modules/handsontable/plugins/search/search.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _search_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _search_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Search", function() { return _search_mjs__WEBPACK_IMPORTED_MODULE_0__["Search"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/search/search.mjs": /*!*************************************************************!*\ !*** ./node_modules/handsontable/plugins/search/search.mjs ***! \*************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, Search */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Search", function() { return Search; }); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js"); /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js"); /* harmony import */ var core_js_modules_es_string_search_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.search.js */ "./node_modules/core-js/modules/es.string.search.js"); /* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.split.js */ "./node_modules/core-js/modules/es.string.split.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var PLUGIN_KEY = 'search'; var PLUGIN_PRIORITY = 190; var DEFAULT_SEARCH_RESULT_CLASS = 'htSearchResult'; var DEFAULT_CALLBACK = function DEFAULT_CALLBACK(instance, row, col, data, testResult) { instance.getCellMeta(row, col).isSearchResult = testResult; }; var DEFAULT_QUERY_METHOD = function DEFAULT_QUERY_METHOD(query, value) { if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_27__["isUndefined"])(query) || query === null || !query.toLowerCase || query.length === 0) { return false; } if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_27__["isUndefined"])(value) || value === null) { return false; } return value.toString().toLowerCase().indexOf(query.toLowerCase()) !== -1; }; /** * @plugin Search * @class Search * * @description * The search plugin provides an easy interface to search data across Handsontable. * * In order to enable search mechanism, {@link Options#search} option must be set to `true`. * * @example * ```js * // as boolean * search: true * // as a object with one or more options * search: { * callback: myNewCallbackFunction, * queryMethod: myNewQueryMethod, * searchResultClass: 'customClass' * } * * // Access to search plugin instance: * const searchPlugin = hot.getPlugin('search'); * * // Set callback programmatically: * searchPlugin.setCallback(myNewCallbackFunction); * // Set query method programmatically: * searchPlugin.setQueryMethod(myNewQueryMethod); * // Set search result cells class programmatically: * searchPlugin.setSearchResultClass(customClass); * ``` */ var Search = /*#__PURE__*/function (_BasePlugin) { _inherits(Search, _BasePlugin); var _super = _createSuper(Search); function Search(hotInstance) { var _this; _classCallCheck(this, Search); _this = _super.call(this, hotInstance); /** * Function called during querying for each cell from the {@link DataMap}. * * @private * @type {Function} */ _this.callback = DEFAULT_CALLBACK; /** * Query function is responsible for determining whether a query matches the value stored in a cell. * * @private * @type {Function} */ _this.queryMethod = DEFAULT_QUERY_METHOD; /** * Class name added to each cell that belongs to the searched query. * * @private * @type {string} */ _this.searchResultClass = DEFAULT_SEARCH_RESULT_CLASS; 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 auto-row-size#enableplugin AutoRowSize#enablePlugin} method is called. * * @returns {boolean} */ _createClass(Search, [{ key: "isEnabled", value: function isEnabled() { return this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } var searchSettings = this.hot.getSettings()[PLUGIN_KEY]; this.updatePluginSettings(searchSettings); this.addHook('beforeRenderer', function () { return _this2.onBeforeRenderer.apply(_this2, arguments); }); _get(_getPrototypeOf(Search.prototype), "enablePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { var _this3 = this; var beforeRendererCallback = function beforeRendererCallback() { return _this3.onBeforeRenderer.apply(_this3, arguments); }; this.hot.addHook('beforeRenderer', beforeRendererCallback); this.hot.addHookOnce('afterRender', function () { _this3.hot.removeHook('beforeRenderer', beforeRendererCallback); }); _get(_getPrototypeOf(Search.prototype), "disablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { this.disablePlugin(); this.enablePlugin(); _get(_getPrototypeOf(Search.prototype), "updatePlugin", this).call(this); } /** * Makes the query. * * @param {string} queryStr Value to be search. * @param {Function} [callback] Callback function performed on cells with values which matches to the searched query. * @param {Function} [queryMethod] Query function responsible for determining whether a query matches the value stored in a cell. * @returns {object[]} Return an array of objects with `row`, `col`, `data` properties or empty array. */ }, { key: "query", value: function query(queryStr) { var _this4 = this; var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getCallback(); var queryMethod = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getQueryMethod(); var rowCount = this.hot.countRows(); var colCount = this.hot.countCols(); var queryResult = []; var instance = this.hot; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_26__["rangeEach"])(0, rowCount - 1, function (rowIndex) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_26__["rangeEach"])(0, colCount - 1, function (colIndex) { var cellData = _this4.hot.getDataAtCell(rowIndex, colIndex); var cellProperties = _this4.hot.getCellMeta(rowIndex, colIndex); var cellCallback = cellProperties.search.callback || callback; var cellQueryMethod = cellProperties.search.queryMethod || queryMethod; var testResult = cellQueryMethod(queryStr, cellData, cellProperties); if (testResult) { var singleResult = { row: rowIndex, col: colIndex, data: cellData }; queryResult.push(singleResult); } if (cellCallback) { cellCallback(instance, rowIndex, colIndex, cellData, testResult); } }); }); return queryResult; } /** * Gets the callback function. * * @returns {Function} Return the callback function. */ }, { key: "getCallback", value: function getCallback() { return this.callback; } /** * Sets the callback function. This function will be called during querying for each cell. * * @param {Function} newCallback A callback function. */ }, { key: "setCallback", value: function setCallback(newCallback) { this.callback = newCallback; } /** * Gets the query method function. * * @returns {Function} Return the query method. */ }, { key: "getQueryMethod", value: function getQueryMethod() { return this.queryMethod; } /** * Sets the query method function. The function is responsible for determining whether a query matches the value stored in a cell. * * @param {Function} newQueryMethod A function with specific match logic. */ }, { key: "setQueryMethod", value: function setQueryMethod(newQueryMethod) { this.queryMethod = newQueryMethod; } /** * Gets search result cells class name. * * @returns {string} Return the cell class name. */ }, { key: "getSearchResultClass", value: function getSearchResultClass() { return this.searchResultClass; } /** * Sets search result cells class name. This class name will be added to each cell that belongs to the searched query. * * @param {string} newElementClass CSS class name. */ }, { key: "setSearchResultClass", value: function setSearchResultClass(newElementClass) { this.searchResultClass = newElementClass; } /** * Updates the settings of the plugin. * * @param {object} searchSettings The plugin settings, taken from Handsontable configuration. * @private */ }, { key: "updatePluginSettings", value: function updatePluginSettings(searchSettings) { if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_25__["isObject"])(searchSettings)) { if (searchSettings.searchResultClass) { this.setSearchResultClass(searchSettings.searchResultClass); } if (searchSettings.queryMethod) { this.setQueryMethod(searchSettings.queryMethod); } if (searchSettings.callback) { this.setCallback(searchSettings.callback); } } } /** * The `beforeRenderer` hook callback. * * @private * @param {HTMLTableCellElement} TD The rendered `TD` element. * @param {number} row Visual row index. * @param {number} col Visual column index. * @param {string|number} prop Column property name or a column index, if datasource is an array of arrays. * @param {string} value Value of the rendered cell. * @param {object} cellProperties Object containing the cell's properties. */ }, { key: "onBeforeRenderer", value: function onBeforeRenderer(TD, row, col, prop, value, cellProperties) { // TODO: #4972 var className = cellProperties.className || []; var classArray = []; if (typeof className === 'string') { classArray = className.split(' '); } else { var _classArray; (_classArray = classArray).push.apply(_classArray, _toConsumableArray(className)); } if (this.isEnabled() && cellProperties.isSearchResult) { if (!classArray.includes(this.searchResultClass)) { classArray.push("".concat(this.searchResultClass)); } } else if (classArray.includes(this.searchResultClass)) { classArray.splice(classArray.indexOf(this.searchResultClass), 1); } cellProperties.className = classArray.join(' '); } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { _get(_getPrototypeOf(Search.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return Search; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_24__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/touchScroll/index.mjs": /*!*****************************************************************!*\ !*** ./node_modules/handsontable/plugins/touchScroll/index.mjs ***! \*****************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, TouchScroll */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _touchScroll_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./touchScroll.mjs */ "./node_modules/handsontable/plugins/touchScroll/touchScroll.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _touchScroll_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _touchScroll_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchScroll", function() { return _touchScroll_mjs__WEBPACK_IMPORTED_MODULE_0__["TouchScroll"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/touchScroll/touchScroll.mjs": /*!***********************************************************************!*\ !*** ./node_modules/handsontable/plugins/touchScroll/touchScroll.mjs ***! \***********************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, TouchScroll */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TouchScroll", function() { return TouchScroll; }); /* harmony import */ var core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/web.timers.js */ "./node_modules/core-js/modules/web.timers.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _helpers_feature_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../helpers/feature.mjs */ "./node_modules/handsontable/helpers/feature.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var PLUGIN_KEY = 'touchScroll'; var PLUGIN_PRIORITY = 200; /** * @private * @plugin TouchScroll * @class TouchScroll */ var TouchScroll = /*#__PURE__*/function (_BasePlugin) { _inherits(TouchScroll, _BasePlugin); var _super = _createSuper(TouchScroll); function TouchScroll(hotInstance) { var _this; _classCallCheck(this, TouchScroll); _this = _super.call(this, hotInstance); /** * Collection of scrollbars to update. * * @type {Array} */ _this.scrollbars = []; /** * Collection of overlays to update. * * @type {Array} */ _this.clones = []; /** * Flag which determines if collection of overlays should be refilled on every table render. * * @type {boolean} * @default false */ _this.lockedCollection = false; /** * Flag which determines if walkontable should freeze overlays while scrolling. * * @type {boolean} * @default false */ _this.freezeOverlays = false; return _this; } /** * Check if plugin is enabled. * * @returns {boolean} */ _createClass(TouchScroll, [{ key: "isEnabled", value: function isEnabled() { return Object(_helpers_feature_mjs__WEBPACK_IMPORTED_MODULE_16__["isTouchSupported"])(); } /** * Enable the plugin. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } this.addHook('afterRender', function () { return _this2.onAfterRender(); }); this.registerEvents(); _get(_getPrototypeOf(TouchScroll.prototype), "enablePlugin", this).call(this); } /** * Updates the plugin to use the latest options you have specified. */ }, { key: "updatePlugin", value: function updatePlugin() { this.lockedCollection = false; _get(_getPrototypeOf(TouchScroll.prototype), "updatePlugin", this).call(this); } /** * Disable plugin for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { _get(_getPrototypeOf(TouchScroll.prototype), "disablePlugin", this).call(this); } /** * Register all necessary events. * * @private */ }, { key: "registerEvents", value: function registerEvents() { var _this3 = this; this.addHook('beforeTouchScroll', function () { return _this3.onBeforeTouchScroll(); }); this.addHook('afterMomentumScroll', function () { return _this3.onAfterMomentumScroll(); }); } /** * After render listener. * * @private */ }, { key: "onAfterRender", value: function onAfterRender() { if (this.lockedCollection) { return; } var _this$hot$view$wt$wtO = this.hot.view.wt.wtOverlays, topOverlay = _this$hot$view$wt$wtO.topOverlay, bottomOverlay = _this$hot$view$wt$wtO.bottomOverlay, leftOverlay = _this$hot$view$wt$wtO.leftOverlay, topLeftCornerOverlay = _this$hot$view$wt$wtO.topLeftCornerOverlay, bottomLeftCornerOverlay = _this$hot$view$wt$wtO.bottomLeftCornerOverlay; this.lockedCollection = true; this.scrollbars.length = 0; this.scrollbars.push(topOverlay); if (bottomOverlay.clone) { this.scrollbars.push(bottomOverlay); } this.scrollbars.push(leftOverlay); if (topLeftCornerOverlay) { this.scrollbars.push(topLeftCornerOverlay); } if (bottomLeftCornerOverlay && bottomLeftCornerOverlay.clone) { this.scrollbars.push(bottomLeftCornerOverlay); } this.clones.length = 0; if (topOverlay.needFullRender) { this.clones.push(topOverlay.clone.wtTable.holder.parentNode); } if (bottomOverlay.needFullRender) { this.clones.push(bottomOverlay.clone.wtTable.holder.parentNode); } if (leftOverlay.needFullRender) { this.clones.push(leftOverlay.clone.wtTable.holder.parentNode); } if (topLeftCornerOverlay) { this.clones.push(topLeftCornerOverlay.clone.wtTable.holder.parentNode); } if (bottomLeftCornerOverlay && bottomLeftCornerOverlay.clone) { this.clones.push(bottomLeftCornerOverlay.clone.wtTable.holder.parentNode); } } /** * Touch scroll listener. * * @private */ }, { key: "onBeforeTouchScroll", value: function onBeforeTouchScroll() { this.freezeOverlays = true; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_14__["arrayEach"])(this.clones, function (clone) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(clone, 'hide-tween'); }); } /** * After momentum scroll listener. * * @private */ }, { key: "onAfterMomentumScroll", value: function onAfterMomentumScroll() { var _this4 = this; this.freezeOverlays = false; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_14__["arrayEach"])(this.clones, function (clone) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["removeClass"])(clone, 'hide-tween'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["addClass"])(clone, 'show-tween'); }); setTimeout(function () { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_14__["arrayEach"])(_this4.clones, function (clone) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_13__["removeClass"])(clone, 'show-tween'); }); }, 400); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_14__["arrayEach"])(this.scrollbars, function (scrollbar) { scrollbar.refresh(); scrollbar.resetFixedPosition(); }); this.hot.view.wt.wtOverlays.syncScrollWithMaster(); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return TouchScroll; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_15__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/trimRows/index.mjs": /*!**************************************************************!*\ !*** ./node_modules/handsontable/plugins/trimRows/index.mjs ***! \**************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, TrimRows */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _trimRows_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./trimRows.mjs */ "./node_modules/handsontable/plugins/trimRows/trimRows.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _trimRows_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return _trimRows_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_PRIORITY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TrimRows", function() { return _trimRows_mjs__WEBPACK_IMPORTED_MODULE_0__["TrimRows"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/trimRows/trimRows.mjs": /*!*****************************************************************!*\ !*** ./node_modules/handsontable/plugins/trimRows/trimRows.mjs ***! \*****************************************************************/ /*! exports provided: PLUGIN_KEY, PLUGIN_PRIORITY, TrimRows */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_PRIORITY", function() { return PLUGIN_PRIORITY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrimRows", function() { return TrimRows; }); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_number_is_integer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.number.is-integer.js */ "./node_modules/core-js/modules/es.number.is-integer.js"); /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.number.constructor.js */ "./node_modules/core-js/modules/es.number.constructor.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var _base_index_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../base/index.mjs */ "./node_modules/handsontable/plugins/base/index.mjs"); /* harmony import */ var _translations_index_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../translations/index.mjs */ "./node_modules/handsontable/translations/index.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var PLUGIN_KEY = 'trimRows'; var PLUGIN_PRIORITY = 330; /** * @plugin TrimRows * @class TrimRows * * @description * The plugin allows to trim certain rows. The trimming is achieved by applying the transformation algorithm to the data * transformation. In this case, when the row is trimmed it is not accessible using `getData*` methods thus the trimmed * data is not visible to other plugins. * * @example * ```js * const container = document.getElementById('example'); * const hot = new Handsontable(container, { * data: getData(), * // hide selected rows on table initialization * trimRows: [1, 2, 5] * }); * * // access the trimRows plugin instance * const trimRowsPlugin = hot.getPlugin('trimRows'); * * // hide single row * trimRowsPlugin.trimRow(1); * * // hide multiple rows * trimRowsPlugin.trimRow(1, 2, 9); * * // or as an array * trimRowsPlugin.trimRows([1, 2, 9]); * * // show single row * trimRowsPlugin.untrimRow(1); * * // show multiple rows * trimRowsPlugin.untrimRow(1, 2, 9); * * // or as an array * trimRowsPlugin.untrimRows([1, 2, 9]); * * // rerender table to see the changes * hot.render(); * ``` */ var TrimRows = /*#__PURE__*/function (_BasePlugin) { _inherits(TrimRows, _BasePlugin); var _super = _createSuper(TrimRows); function TrimRows(hotInstance) { var _this; _classCallCheck(this, TrimRows); _this = _super.call(this, hotInstance); /** * Map of skipped rows by the plugin. * * @private * @type {null|TrimmingMap} */ _this.trimmedRowsMap = 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 auto-row-size#enableplugin AutoRowSize#enablePlugin} method is called. * * @returns {boolean} */ _createClass(TrimRows, [{ key: "isEnabled", value: function isEnabled() { return !!this.hot.getSettings()[PLUGIN_KEY]; } /** * Enables the plugin functionality for this Handsontable instance. */ }, { key: "enablePlugin", value: function enablePlugin() { var _this2 = this; if (this.enabled) { return; } this.trimmedRowsMap = this.hot.rowIndexMapper.registerMap('trimRows', new _translations_index_mjs__WEBPACK_IMPORTED_MODULE_19__["TrimmingMap"]()); this.trimmedRowsMap.addLocalHook('init', function () { return _this2.onMapInit(); }); _get(_getPrototypeOf(TrimRows.prototype), "enablePlugin", this).call(this); } /** * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked. */ }, { key: "updatePlugin", value: function updatePlugin() { var _this3 = this; var trimmedRows = this.hot.getSettings()[PLUGIN_KEY]; if (Array.isArray(trimmedRows)) { this.hot.batchExecution(function () { _this3.trimmedRowsMap.clear(); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(trimmedRows, function (physicalRow) { _this3.trimmedRowsMap.setValueAtIndex(physicalRow, true); }); }, true); } _get(_getPrototypeOf(TrimRows.prototype), "updatePlugin", this).call(this); } /** * Disables the plugin functionality for this Handsontable instance. */ }, { key: "disablePlugin", value: function disablePlugin() { this.hot.rowIndexMapper.unregisterMap('trimRows'); _get(_getPrototypeOf(TrimRows.prototype), "disablePlugin", this).call(this); } /** * Get list of trimmed rows. * * @returns {Array} Physical rows. */ }, { key: "getTrimmedRows", value: function getTrimmedRows() { return this.trimmedRowsMap.getTrimmedIndexes(); } /** * Trims the rows provided in the array. * * @param {number[]} rows Array of physical row indexes. * @fires Hooks#beforeTrimRow * @fires Hooks#afterTrimRow */ }, { key: "trimRows", value: function trimRows(rows) { var _this4 = this; var currentTrimConfig = this.getTrimmedRows(); var isValidConfig = this.isValidConfig(rows); var destinationTrimConfig = currentTrimConfig; if (isValidConfig) { destinationTrimConfig = Array.from(new Set(currentTrimConfig.concat(rows))); } var allowTrimRow = this.hot.runHooks('beforeTrimRow', currentTrimConfig, destinationTrimConfig, isValidConfig); if (allowTrimRow === false) { return; } if (isValidConfig) { this.hot.batchExecution(function () { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(rows, function (physicalRow) { _this4.trimmedRowsMap.setValueAtIndex(physicalRow, true); }); }, true); } this.hot.runHooks('afterTrimRow', currentTrimConfig, destinationTrimConfig, isValidConfig, isValidConfig && destinationTrimConfig.length > currentTrimConfig.length); } /** * Trims the row provided as physical row index (counting from 0). * * @param {...number} row Physical row index. */ }, { key: "trimRow", value: function trimRow() { for (var _len = arguments.length, row = new Array(_len), _key = 0; _key < _len; _key++) { row[_key] = arguments[_key]; } this.trimRows(row); } /** * Untrims the rows provided in the array. * * @param {number[]} rows Array of physical row indexes. * @fires Hooks#beforeUntrimRow * @fires Hooks#afterUntrimRow */ }, { key: "untrimRows", value: function untrimRows(rows) { var currentTrimConfig = this.getTrimmedRows(); var isValidConfig = this.isValidConfig(rows); var destinationTrimConfig = currentTrimConfig; var trimmingMapValues = this.trimmedRowsMap.getValues().slice(); var isAnyRowUntrimmed = rows.length > 0; if (isValidConfig && isAnyRowUntrimmed) { // Preparing new values for trimming map. Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(rows, function (physicalRow) { trimmingMapValues[physicalRow] = false; }); // Preparing new trimming config. destinationTrimConfig = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayReduce"])(trimmingMapValues, function (trimmedIndexes, isTrimmed, physicalIndex) { if (isTrimmed) { trimmedIndexes.push(physicalIndex); } return trimmedIndexes; }, []); } var allowUntrimRow = this.hot.runHooks('beforeUntrimRow', currentTrimConfig, destinationTrimConfig, isValidConfig && isAnyRowUntrimmed); if (allowUntrimRow === false) { return; } if (isValidConfig && isAnyRowUntrimmed) { this.trimmedRowsMap.setValues(trimmingMapValues); } this.hot.runHooks('afterUntrimRow', currentTrimConfig, destinationTrimConfig, isValidConfig && isAnyRowUntrimmed, isValidConfig && destinationTrimConfig.length < currentTrimConfig.length); } /** * Untrims the row provided as row index (counting from 0). * * @param {...number} row Physical row index. */ }, { key: "untrimRow", value: function untrimRow() { for (var _len2 = arguments.length, row = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { row[_key2] = arguments[_key2]; } this.untrimRows(row); } /** * Checks if given row is hidden. * * @param {number} physicalRow Physical row index. * @returns {boolean} */ }, { key: "isTrimmed", value: function isTrimmed(physicalRow) { return this.trimmedRowsMap.getValueAtIndex(physicalRow) || false; } /** * Untrims all trimmed rows. */ }, { key: "untrimAll", value: function untrimAll() { this.untrimRows(this.getTrimmedRows()); } /** * Get if trim config is valid. Check whether all of the provided row indexes are within source data. * * @param {Array} trimmedRows List of physical row indexes. * @returns {boolean} */ }, { key: "isValidConfig", value: function isValidConfig(trimmedRows) { var sourceRows = this.hot.countSourceRows(); return trimmedRows.every(function (trimmedRow) { return Number.isInteger(trimmedRow) && trimmedRow >= 0 && trimmedRow < sourceRows; }); } /** * On map initialized hook callback. * * @private */ }, { key: "onMapInit", value: function onMapInit() { var _this5 = this; var trimmedRows = this.hot.getSettings()[PLUGIN_KEY]; if (Array.isArray(trimmedRows)) { this.hot.batchExecution(function () { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_20__["arrayEach"])(trimmedRows, function (physicalRow) { _this5.trimmedRowsMap.setValueAtIndex(physicalRow, true); }); }, true); } } /** * Destroys the plugin instance. */ }, { key: "destroy", value: function destroy() { _get(_getPrototypeOf(TrimRows.prototype), "destroy", this).call(this); } }], [{ key: "PLUGIN_KEY", get: function get() { return PLUGIN_KEY; } }, { key: "PLUGIN_PRIORITY", get: function get() { return PLUGIN_PRIORITY; } }]); return TrimRows; }(_base_index_mjs__WEBPACK_IMPORTED_MODULE_18__["BasePlugin"]); /***/ }), /***/ "./node_modules/handsontable/plugins/undoRedo/index.mjs": /*!**************************************************************!*\ !*** ./node_modules/handsontable/plugins/undoRedo/index.mjs ***! \**************************************************************/ /*! exports provided: PLUGIN_KEY, UndoRedo */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _undoRedo_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./undoRedo.mjs */ "./node_modules/handsontable/plugins/undoRedo/undoRedo.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return _undoRedo_mjs__WEBPACK_IMPORTED_MODULE_0__["PLUGIN_KEY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoRedo", function() { return _undoRedo_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]; }); /***/ }), /***/ "./node_modules/handsontable/plugins/undoRedo/undoRedo.mjs": /*!*****************************************************************!*\ !*** ./node_modules/handsontable/plugins/undoRedo/undoRedo.mjs ***! \*****************************************************************/ /*! exports provided: PLUGIN_KEY, default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLUGIN_KEY", function() { return PLUGIN_KEY; }); /* harmony import */ var core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.find.js */ "./node_modules/core-js/modules/es.array.find.js"); /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ "./node_modules/core-js/modules/es.array.reduce.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.sort.js */ "./node_modules/core-js/modules/es.array.sort.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../pluginHooks.mjs */ "./node_modules/handsontable/pluginHooks.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../helpers/dom/event.mjs */ "./node_modules/handsontable/helpers/dom/event.mjs"); /* harmony import */ var _contextMenu_utils_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../contextMenu/utils.mjs */ "./node_modules/handsontable/plugins/contextMenu/utils.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var PLUGIN_KEY = 'undoRedo'; /** * @description * Handsontable UndoRedo plugin allows to undo and redo certain actions done in the table. * * __Note__, that not all actions are currently undo-able. The UndoRedo plugin is enabled by default. * @example * ```js * undo: true * ``` * @class UndoRedo * @plugin UndoRedo * @param {Core} instance The Handsontable instance. */ function UndoRedo(instance) { var plugin = this; this.instance = instance; this.doneActions = []; this.undoneActions = []; this.ignoreNewActions = false; this.enabled = false; instance.addHook('afterChange', function (changes, source) { var _this = this; var changesLen = changes && changes.length; if (!changesLen) { return; } var hasDifferences = changes.find(function (change) { var _change = _slicedToArray(change, 4), oldValue = _change[2], newValue = _change[3]; return oldValue !== newValue; }); if (!hasDifferences) { return; } var wrappedAction = function wrappedAction() { var clonedChanges = changes.reduce(function (arr, change) { arr.push(_toConsumableArray(change)); return arr; }, []); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(clonedChanges, function (change) { change[1] = instance.propToCol(change[1]); }); var selected = changesLen > 1 ? _this.getSelected() : [[clonedChanges[0][0], clonedChanges[0][1]]]; return new UndoRedo.ChangeAction(clonedChanges, selected); }; plugin.done(wrappedAction, source); }); instance.addHook('afterCreateRow', function (index, amount, source) { plugin.done(function () { return new UndoRedo.CreateRowAction(index, amount); }, source); }); instance.addHook('beforeRemoveRow', function (index, amount, logicRows, source) { var wrappedAction = function wrappedAction() { var originalData = plugin.instance.getSourceDataArray(); var rowIndex = (originalData.length + index) % originalData.length; var physicalRowIndex = instance.toPhysicalRow(rowIndex); var removedData = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["deepClone"])(originalData.slice(physicalRowIndex, physicalRowIndex + amount)); return new UndoRedo.RemoveRowAction(rowIndex, removedData, instance.getSettings().fixedRowsBottom, instance.getSettings().fixedRowsTop); }; plugin.done(wrappedAction, source); }); instance.addHook('afterCreateCol', function (index, amount, source) { plugin.done(function () { return new UndoRedo.CreateColumnAction(index, amount); }, source); }); instance.addHook('beforeRemoveCol', function (index, amount, logicColumns, source) { var wrappedAction = function wrappedAction() { var originalData = plugin.instance.getSourceDataArray(); var columnIndex = (plugin.instance.countCols() + index) % plugin.instance.countCols(); var removedData = []; var headers = []; var indexes = []; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(originalData.length - 1, function (i) { var column = []; var origRow = originalData[i]; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(columnIndex, columnIndex + (amount - 1), function (j) { column.push(origRow[instance.toPhysicalColumn(j)]); }); removedData.push(column); }); Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(amount - 1, function (i) { indexes.push(instance.toPhysicalColumn(columnIndex + i)); }); if (Array.isArray(instance.getSettings().colHeaders)) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_22__["rangeEach"])(amount - 1, function (i) { headers.push(instance.getSettings().colHeaders[instance.toPhysicalColumn(columnIndex + i)] || null); }); } var columnsMap = instance.columnIndexMapper.getIndexesSequence(); var rowsMap = instance.rowIndexMapper.getIndexesSequence(); return new UndoRedo.RemoveColumnAction(columnIndex, indexes, removedData, headers, columnsMap, rowsMap, instance.getSettings().fixedColumnsLeft); }; plugin.done(wrappedAction, source); }); instance.addHook('beforeCellAlignment', function (stateBefore, range, type, alignment) { plugin.done(function () { return new UndoRedo.CellAlignmentAction(stateBefore, range, type, alignment); }); }); instance.addHook('beforeFilter', function (conditionsStack) { plugin.done(function () { return new UndoRedo.FiltersAction(conditionsStack); }); }); instance.addHook('beforeRowMove', function (rows, finalIndex) { if (rows === false) { return; } plugin.done(function () { return new UndoRedo.RowMoveAction(rows, finalIndex); }); }); instance.addHook('beforeMergeCells', function (cellRange, auto) { if (auto) { return; } plugin.done(function () { return new UndoRedo.MergeCellsAction(instance, cellRange); }); }); instance.addHook('afterUnmergeCells', function (cellRange, auto) { if (auto) { return; } plugin.done(function () { return new UndoRedo.UnmergeCellsAction(instance, cellRange); }); }); // TODO: Why this callback is needed? One test doesn't pass after calling method right after plugin creation (outside the callback). instance.addHook('afterInit', function () { plugin.init(); }); } /** * Stash information about performed actions. * * @function done * @memberof UndoRedo# * @fires Hooks#beforeUndoStackChange * @fires Hooks#afterUndoStackChange * @fires Hooks#beforeRedoStackChange * @fires Hooks#afterRedoStackChange * @param {Function} wrappedAction The action descriptor wrapped in a closure. * @param {string} [source] Source of the action. It is defined just for more general actions (not related to plugins). */ UndoRedo.prototype.done = function (wrappedAction, source) { if (this.ignoreNewActions) { return; } var isBlockedByDefault = source === 'UndoRedo.undo' || source === 'UndoRedo.redo' || source === 'auto'; if (isBlockedByDefault) { return; } var doneActionsCopy = this.doneActions.slice(); var continueAction = this.instance.runHooks('beforeUndoStackChange', doneActionsCopy, source); if (continueAction === false) { return; } var newAction = wrappedAction(); var undoneActionsCopy = this.undoneActions.slice(); this.doneActions.push(newAction); this.instance.runHooks('afterUndoStackChange', doneActionsCopy, this.doneActions.slice()); this.instance.runHooks('beforeRedoStackChange', undoneActionsCopy); this.undoneActions.length = 0; this.instance.runHooks('afterRedoStackChange', undoneActionsCopy, this.undoneActions.slice()); }; /** * Undo the last action performed to the table. * * @function undo * @memberof UndoRedo# * @fires Hooks#beforeUndoStackChange * @fires Hooks#afterUndoStackChange * @fires Hooks#beforeRedoStackChange * @fires Hooks#afterRedoStackChange * @fires Hooks#beforeUndo * @fires Hooks#afterUndo */ UndoRedo.prototype.undo = function () { if (this.isUndoAvailable()) { var doneActionsCopy = this.doneActions.slice(); this.instance.runHooks('beforeUndoStackChange', doneActionsCopy); var action = this.doneActions.pop(); this.instance.runHooks('afterUndoStackChange', doneActionsCopy, this.doneActions.slice()); var actionClone = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["deepClone"])(action); var continueAction = this.instance.runHooks('beforeUndo', actionClone); if (continueAction === false) { return; } this.ignoreNewActions = true; var that = this; var undoneActionsCopy = this.undoneActions.slice(); this.instance.runHooks('beforeRedoStackChange', undoneActionsCopy); action.undo(this.instance, function () { that.ignoreNewActions = false; that.undoneActions.push(action); }); this.instance.runHooks('afterRedoStackChange', undoneActionsCopy, this.undoneActions.slice()); this.instance.runHooks('afterUndo', actionClone); } }; /** * Redo the previous action performed to the table (used to reverse an undo). * * @function redo * @memberof UndoRedo# * @fires Hooks#beforeUndoStackChange * @fires Hooks#afterUndoStackChange * @fires Hooks#beforeRedoStackChange * @fires Hooks#afterRedoStackChange * @fires Hooks#beforeRedo * @fires Hooks#afterRedo */ UndoRedo.prototype.redo = function () { if (this.isRedoAvailable()) { var undoneActionsCopy = this.undoneActions.slice(); this.instance.runHooks('beforeRedoStackChange', undoneActionsCopy); var action = this.undoneActions.pop(); this.instance.runHooks('afterRedoStackChange', undoneActionsCopy, this.undoneActions.slice()); var actionClone = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["deepClone"])(action); var continueAction = this.instance.runHooks('beforeRedo', actionClone); if (continueAction === false) { return; } this.ignoreNewActions = true; var that = this; var doneActionsCopy = this.doneActions.slice(); this.instance.runHooks('beforeUndoStackChange', doneActionsCopy); action.redo(this.instance, function () { that.ignoreNewActions = false; that.doneActions.push(action); }); this.instance.runHooks('afterUndoStackChange', doneActionsCopy, this.doneActions.slice()); this.instance.runHooks('afterRedo', actionClone); } }; /** * Checks if undo action is available. * * @function isUndoAvailable * @memberof UndoRedo# * @returns {boolean} Return `true` if undo can be performed, `false` otherwise. */ UndoRedo.prototype.isUndoAvailable = function () { return this.doneActions.length > 0; }; /** * Checks if redo action is available. * * @function isRedoAvailable * @memberof UndoRedo# * @returns {boolean} Return `true` if redo can be performed, `false` otherwise. */ UndoRedo.prototype.isRedoAvailable = function () { return this.undoneActions.length > 0; }; /** * Clears undo history. * * @function clear * @memberof UndoRedo# */ UndoRedo.prototype.clear = function () { this.doneActions.length = 0; this.undoneActions.length = 0; }; /** * Checks if the plugin is enabled. * * @function isEnabled * @memberof UndoRedo# * @returns {boolean} */ UndoRedo.prototype.isEnabled = function () { return this.enabled; }; /** * Enables the plugin. * * @function enable * @memberof UndoRedo# */ UndoRedo.prototype.enable = function () { if (this.isEnabled()) { return; } var hot = this.instance; this.enabled = true; exposeUndoRedoMethods(hot); hot.addHook('beforeKeyDown', onBeforeKeyDown); hot.addHook('afterChange', onAfterChange); }; /** * Disables the plugin. * * @function disable * @memberof UndoRedo# */ UndoRedo.prototype.disable = function () { if (!this.isEnabled()) { return; } var hot = this.instance; this.enabled = false; removeExposedUndoRedoMethods(hot); hot.removeHook('beforeKeyDown', onBeforeKeyDown); hot.removeHook('afterChange', onAfterChange); }; /** * Destroys the instance. * * @function destroy * @memberof UndoRedo# */ UndoRedo.prototype.destroy = function () { this.clear(); this.instance = null; this.doneActions = null; this.undoneActions = null; }; UndoRedo.Action = function () {}; UndoRedo.Action.prototype.undo = function () {}; UndoRedo.Action.prototype.redo = function () {}; /** * Change action. * * @private * @param {Array} changes 2D array containing information about each of the edited cells. * @param {number[]} selected The cell selection. */ UndoRedo.ChangeAction = function (changes, selected) { this.changes = changes; this.selected = selected; this.actionType = 'change'; }; Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["inherit"])(UndoRedo.ChangeAction, UndoRedo.Action); UndoRedo.ChangeAction.prototype.undo = function (instance, undoneCallback) { var data = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["deepClone"])(this.changes); var emptyRowsAtTheEnd = instance.countEmptyRows(true); var emptyColsAtTheEnd = instance.countEmptyCols(true); for (var i = 0, len = data.length; i < len; i++) { data[i].splice(3, 1); } instance.addHookOnce('afterChange', undoneCallback); instance.setDataAtCell(data, null, null, 'UndoRedo.undo'); for (var _i2 = 0, _len = data.length; _i2 < _len; _i2++) { var _data$_i = _slicedToArray(data[_i2], 2), row = _data$_i[0], column = _data$_i[1]; if (instance.getSettings().minSpareRows && row + 1 + instance.getSettings().minSpareRows === instance.countRows() && emptyRowsAtTheEnd === instance.getSettings().minSpareRows) { instance.alter('remove_row', parseInt(row + 1, 10), instance.getSettings().minSpareRows); instance.undoRedo.doneActions.pop(); } if (instance.getSettings().minSpareCols && column + 1 + instance.getSettings().minSpareCols === instance.countCols() && emptyColsAtTheEnd === instance.getSettings().minSpareCols) { instance.alter('remove_col', parseInt(column + 1, 10), instance.getSettings().minSpareCols); instance.undoRedo.doneActions.pop(); } } instance.selectCells(this.selected, false, false); }; UndoRedo.ChangeAction.prototype.redo = function (instance, onFinishCallback) { var data = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["deepClone"])(this.changes); for (var i = 0, len = data.length; i < len; i++) { data[i].splice(2, 1); } instance.addHookOnce('afterChange', onFinishCallback); instance.setDataAtCell(data, null, null, 'UndoRedo.redo'); if (this.selected) { instance.selectCells(this.selected, false, false); } }; /** * Create row action. * * @private * @param {number} index The visual row index. * @param {number} amount The number of created rows. */ UndoRedo.CreateRowAction = function (index, amount) { this.index = index; this.amount = amount; this.actionType = 'insert_row'; }; Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["inherit"])(UndoRedo.CreateRowAction, UndoRedo.Action); UndoRedo.CreateRowAction.prototype.undo = function (instance, undoneCallback) { var rowCount = instance.countRows(); var minSpareRows = instance.getSettings().minSpareRows; if (this.index >= rowCount && this.index - minSpareRows < rowCount) { this.index -= minSpareRows; // work around the situation where the needed row was removed due to an 'undo' of a made change } instance.addHookOnce('afterRemoveRow', undoneCallback); instance.alter('remove_row', this.index, this.amount, 'UndoRedo.undo'); }; UndoRedo.CreateRowAction.prototype.redo = function (instance, redoneCallback) { instance.addHookOnce('afterCreateRow', redoneCallback); instance.alter('insert_row', this.index, this.amount, 'UndoRedo.redo'); }; /** * Remove row action. * * @private * @param {number} index The visual row index. * @param {Array} data The removed data. * @param {number} fixedRowsBottom Number of fixed rows on the bottom. Remove row action change it sometimes. * @param {number} fixedRowsTop Number of fixed rows on the top. Remove row action change it sometimes. */ UndoRedo.RemoveRowAction = function (index, data, fixedRowsBottom, fixedRowsTop) { this.index = index; this.data = data; this.actionType = 'remove_row'; this.fixedRowsBottom = fixedRowsBottom; this.fixedRowsTop = fixedRowsTop; }; Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["inherit"])(UndoRedo.RemoveRowAction, UndoRedo.Action); UndoRedo.RemoveRowAction.prototype.undo = function (instance, undoneCallback) { var settings = instance.getSettings(); // Changing by the reference as `updateSettings` doesn't work the best. settings.fixedRowsBottom = this.fixedRowsBottom; settings.fixedRowsTop = this.fixedRowsTop; instance.alter('insert_row', this.index, this.data.length, 'UndoRedo.undo'); instance.addHookOnce('afterRender', undoneCallback); instance.populateFromArray(this.index, 0, this.data, void 0, void 0, 'UndoRedo.undo'); }; UndoRedo.RemoveRowAction.prototype.redo = function (instance, redoneCallback) { instance.addHookOnce('afterRemoveRow', redoneCallback); instance.alter('remove_row', this.index, this.data.length, 'UndoRedo.redo'); }; /** * Create column action. * * @private * @param {number} index The visual column index. * @param {number} amount The number of created columns. */ UndoRedo.CreateColumnAction = function (index, amount) { this.index = index; this.amount = amount; this.actionType = 'insert_col'; }; Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["inherit"])(UndoRedo.CreateColumnAction, UndoRedo.Action); UndoRedo.CreateColumnAction.prototype.undo = function (instance, undoneCallback) { instance.addHookOnce('afterRemoveCol', undoneCallback); instance.alter('remove_col', this.index, this.amount, 'UndoRedo.undo'); }; UndoRedo.CreateColumnAction.prototype.redo = function (instance, redoneCallback) { instance.addHookOnce('afterCreateCol', redoneCallback); instance.alter('insert_col', this.index, this.amount, 'UndoRedo.redo'); }; /** * Remove column action. * * @private * @param {number} index The visual column index. * @param {number[]} indexes The visual column indexes. * @param {Array} data The removed data. * @param {Array} headers The header values. * @param {number[]} columnPositions The column position. * @param {number[]} rowPositions The row position. * @param {number} fixedColumnsLeft Number of fixed columns on the left. Remove column action change it sometimes. */ UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPositions, rowPositions, fixedColumnsLeft) { this.index = index; this.indexes = indexes; this.data = data; this.amount = this.data[0].length; this.headers = headers; this.columnPositions = columnPositions.slice(0); this.rowPositions = rowPositions.slice(0); this.actionType = 'remove_col'; this.fixedColumnsLeft = fixedColumnsLeft; }; Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["inherit"])(UndoRedo.RemoveColumnAction, UndoRedo.Action); UndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback) { var _this2 = this; var settings = instance.getSettings(); // Changing by the reference as `updateSettings` doesn't work the best. settings.fixedColumnsLeft = this.fixedColumnsLeft; var ascendingIndexes = this.indexes.slice(0).sort(); var sortByIndexes = function sortByIndexes(elem, j, arr) { return arr[_this2.indexes.indexOf(ascendingIndexes[j])]; }; var removedDataLength = this.data.length; var sortedData = []; for (var rowIndex = 0; rowIndex < removedDataLength; rowIndex++) { sortedData.push(Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayMap"])(this.data[rowIndex], sortByIndexes)); } var sortedHeaders = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayMap"])(this.headers, sortByIndexes); var changes = []; instance.alter('insert_col', this.indexes[0], this.indexes.length, 'UndoRedo.undo'); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(instance.getSourceDataArray(), function (rowData, rowIndex) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(ascendingIndexes, function (changedIndex, contiquesIndex) { rowData[changedIndex] = sortedData[rowIndex][contiquesIndex]; changes.push([rowIndex, changedIndex, rowData[changedIndex]]); }); }); instance.setSourceDataAtCell(changes); instance.columnIndexMapper.insertIndexes(ascendingIndexes[0], ascendingIndexes.length); if (typeof this.headers !== 'undefined') { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(sortedHeaders, function (headerData, columnIndex) { instance.getSettings().colHeaders[ascendingIndexes[columnIndex]] = headerData; }); } instance.batchExecution(function () { // Restore row sequence in a case when all columns are removed. the original // row sequence is lost in that case. instance.rowIndexMapper.setIndexesSequence(_this2.rowPositions); instance.columnIndexMapper.setIndexesSequence(_this2.columnPositions); }, true); instance.addHookOnce('afterRender', undoneCallback); instance.render(); }; UndoRedo.RemoveColumnAction.prototype.redo = function (instance, redoneCallback) { instance.addHookOnce('afterRemoveCol', redoneCallback); instance.alter('remove_col', this.index, this.amount, 'UndoRedo.redo'); }; /** * Cell alignment action. * * @private * @param {Array} stateBefore The previous state. * @param {object} range The cell range. * @param {string} type The type of the alignment ("top", "left", "bottom" or "right"). * @param {string} alignment The alignment CSS class. */ UndoRedo.CellAlignmentAction = function (stateBefore, range, type, alignment) { this.stateBefore = stateBefore; this.range = range; this.type = type; this.alignment = alignment; }; UndoRedo.CellAlignmentAction.prototype.undo = function (instance, undoneCallback) { var _this3 = this; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_21__["arrayEach"])(this.range, function (range) { range.forAll(function (row, col) { // Alignment classes should only collected within cell ranges. We skip header coordinates. if (row >= 0 && col >= 0) { instance.setCellMeta(row, col, 'className', _this3.stateBefore[row][col] || ' htLeft'); } }); }); instance.addHookOnce('afterRender', undoneCallback); instance.render(); }; UndoRedo.CellAlignmentAction.prototype.redo = function (instance, undoneCallback) { Object(_contextMenu_utils_mjs__WEBPACK_IMPORTED_MODULE_25__["align"])(this.range, this.type, this.alignment, function (row, col) { return instance.getCellMeta(row, col); }, function (row, col, key, value) { return instance.setCellMeta(row, col, key, value); }); instance.addHookOnce('afterRender', undoneCallback); instance.render(); }; /** * Filters action. * * @private * @param {Array} conditionsStack An array of the filter condition. */ UndoRedo.FiltersAction = function (conditionsStack) { this.conditionsStack = conditionsStack; this.actionType = 'filter'; }; Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["inherit"])(UndoRedo.FiltersAction, UndoRedo.Action); UndoRedo.FiltersAction.prototype.undo = function (instance, undoneCallback) { var filters = instance.getPlugin('filters'); instance.addHookOnce('afterRender', undoneCallback); filters.conditionCollection.importAllConditions(this.conditionsStack.slice(0, this.conditionsStack.length - 1)); filters.filter(); }; UndoRedo.FiltersAction.prototype.redo = function (instance, redoneCallback) { var filters = instance.getPlugin('filters'); instance.addHookOnce('afterRender', redoneCallback); filters.conditionCollection.importAllConditions(this.conditionsStack); filters.filter(); }; /** * Merge Cells action. * * @util */ var MergeCellsAction = /*#__PURE__*/function (_UndoRedo$Action) { _inherits(MergeCellsAction, _UndoRedo$Action); var _super = _createSuper(MergeCellsAction); function MergeCellsAction(instance, cellRange) { var _this4; _classCallCheck(this, MergeCellsAction); _this4 = _super.call(this); _this4.cellRange = cellRange; var topLeftCorner = _this4.cellRange.getTopLeftCorner(); var bottomRightCorner = _this4.cellRange.getBottomRightCorner(); _this4.rangeData = instance.getData(topLeftCorner.row, topLeftCorner.col, bottomRightCorner.row, bottomRightCorner.col); return _this4; } _createClass(MergeCellsAction, [{ key: "undo", value: function undo(instance, undoneCallback) { var mergeCellsPlugin = instance.getPlugin('mergeCells'); instance.addHookOnce('afterRender', undoneCallback); mergeCellsPlugin.unmergeRange(this.cellRange, true); var topLeftCorner = this.cellRange.getTopLeftCorner(); instance.populateFromArray(topLeftCorner.row, topLeftCorner.col, this.rangeData, void 0, void 0, 'MergeCells'); } }, { key: "redo", value: function redo(instance, redoneCallback) { var mergeCellsPlugin = instance.getPlugin('mergeCells'); instance.addHookOnce('afterRender', redoneCallback); mergeCellsPlugin.mergeRange(this.cellRange); } }]); return MergeCellsAction; }(UndoRedo.Action); UndoRedo.MergeCellsAction = MergeCellsAction; /** * Unmerge Cells action. * * @util */ var UnmergeCellsAction = /*#__PURE__*/function (_UndoRedo$Action2) { _inherits(UnmergeCellsAction, _UndoRedo$Action2); var _super2 = _createSuper(UnmergeCellsAction); function UnmergeCellsAction(instance, cellRange) { var _this5; _classCallCheck(this, UnmergeCellsAction); _this5 = _super2.call(this); _this5.cellRange = cellRange; return _this5; } _createClass(UnmergeCellsAction, [{ key: "undo", value: function undo(instance, undoneCallback) { var mergeCellsPlugin = instance.getPlugin('mergeCells'); instance.addHookOnce('afterRender', undoneCallback); mergeCellsPlugin.mergeRange(this.cellRange, true); } }, { key: "redo", value: function redo(instance, redoneCallback) { var mergeCellsPlugin = instance.getPlugin('mergeCells'); instance.addHookOnce('afterRender', redoneCallback); mergeCellsPlugin.unmergeRange(this.cellRange, true); instance.render(); } }]); return UnmergeCellsAction; }(UndoRedo.Action); UndoRedo.UnmergeCellsAction = UnmergeCellsAction; /** * ManualRowMove action. * * @TODO removeRow undo should works on logical index * @private * @param {number[]} rows An array with moved rows. * @param {number} finalIndex The destination index. */ UndoRedo.RowMoveAction = function (rows, finalIndex) { this.rows = rows.slice(); this.finalIndex = finalIndex; }; Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["inherit"])(UndoRedo.RowMoveAction, UndoRedo.Action); UndoRedo.RowMoveAction.prototype.undo = function (instance, undoneCallback) { var _this6 = this; var manualRowMove = instance.getPlugin('manualRowMove'); var copyOfRows = [].concat(this.rows); var rowsMovedUp = copyOfRows.filter(function (a) { return a > _this6.finalIndex; }); var rowsMovedDown = copyOfRows.filter(function (a) { return a <= _this6.finalIndex; }); var allMovedRows = rowsMovedUp.sort(function (a, b) { return b - a; }).concat(rowsMovedDown.sort(function (a, b) { return a - b; })); instance.addHookOnce('afterRender', undoneCallback); // Moving rows from those with higher indexes to those with lower indexes when action was performed from bottom to top // Moving rows from those with lower indexes to those with higher indexes when action was performed from top to bottom for (var i = 0; i < allMovedRows.length; i += 1) { var newPhysicalRow = instance.toVisualRow(allMovedRows[i]); manualRowMove.moveRow(newPhysicalRow, allMovedRows[i]); } instance.render(); instance.deselectCell(); instance.selectRows(this.rows[0], this.rows[0] + this.rows.length - 1); }; UndoRedo.RowMoveAction.prototype.redo = function (instance, redoneCallback) { var manualRowMove = instance.getPlugin('manualRowMove'); instance.addHookOnce('afterRender', redoneCallback); manualRowMove.moveRows(this.rows.slice(), this.finalIndex); instance.render(); instance.deselectCell(); instance.selectRows(this.finalIndex, this.finalIndex + this.rows.length - 1); }; /** * Enabling and disabling plugin and attaching its to an instance. * * @private */ UndoRedo.prototype.init = function () { var settings = this.instance.getSettings().undo; var pluginEnabled = typeof settings === 'undefined' || settings; if (!this.instance.undoRedo) { /** * Instance of Handsontable.UndoRedo Plugin {@link Handsontable.UndoRedo}. * * @alias undoRedo * @memberof! Handsontable.Core# * @type {UndoRedo} */ this.instance.undoRedo = this; } if (pluginEnabled) { this.instance.undoRedo.enable(); } else { this.instance.undoRedo.disable(); } }; /** * @param {Event} event The keyboard event object. */ function onBeforeKeyDown(event) { if (Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_24__["isImmediatePropagationStopped"])(event)) { return; } var instance = this; var editor = instance.getActiveEditor(); if (editor && editor.isOpened()) { return; } var altKey = event.altKey, ctrlKey = event.ctrlKey, keyCode = event.keyCode, metaKey = event.metaKey, shiftKey = event.shiftKey; var isCtrlDown = (ctrlKey || metaKey) && !altKey; if (!isCtrlDown) { return; } var isRedoHotkey = keyCode === 89 || shiftKey && keyCode === 90; if (isRedoHotkey) { // CTRL + Y or CTRL + SHIFT + Z instance.undoRedo.redo(); Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_24__["stopImmediatePropagation"])(event); } else if (keyCode === 90) { // CTRL + Z instance.undoRedo.undo(); Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_24__["stopImmediatePropagation"])(event); } } /** * @param {Array} changes 2D array containing information about each of the edited cells. * @param {string} source String that identifies source of hook call. * @returns {boolean} */ function onAfterChange(changes, source) { var instance = this; if (source === 'loadData') { return instance.undoRedo.clear(); } } /** * @param {Core} instance The Handsontable instance. */ function exposeUndoRedoMethods(instance) { /** * {@link UndoRedo#undo}. * * @alias undo * @memberof! Handsontable.Core# * @returns {boolean} */ instance.undo = function () { return instance.undoRedo.undo(); }; /** * {@link UndoRedo#redo}. * * @alias redo * @memberof! Handsontable.Core# * @returns {boolean} */ instance.redo = function () { return instance.undoRedo.redo(); }; /** * {@link UndoRedo#isUndoAvailable}. * * @alias isUndoAvailable * @memberof! Handsontable.Core# * @returns {boolean} */ instance.isUndoAvailable = function () { return instance.undoRedo.isUndoAvailable(); }; /** * {@link UndoRedo#isRedoAvailable}. * * @alias isRedoAvailable * @memberof! Handsontable.Core# * @returns {boolean} */ instance.isRedoAvailable = function () { return instance.undoRedo.isRedoAvailable(); }; /** * {@link UndoRedo#clear}. * * @alias clearUndo * @memberof! Handsontable.Core# * @returns {boolean} */ instance.clearUndo = function () { return instance.undoRedo.clear(); }; } /** * @param {Core} instance The Handsontable instance. */ function removeExposedUndoRedoMethods(instance) { delete instance.undo; delete instance.redo; delete instance.isUndoAvailable; delete instance.isRedoAvailable; delete instance.clearUndo; } var hook = _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_20__["default"].getSingleton(); hook.add('afterUpdateSettings', function () { this.getPlugin('undoRedo').init(); }); hook.register('beforeUndo'); hook.register('afterUndo'); hook.register('beforeRedo'); hook.register('afterRedo'); UndoRedo.PLUGIN_KEY = PLUGIN_KEY; /* harmony default export */ __webpack_exports__["default"] = (UndoRedo); /***/ }), /***/ "./node_modules/handsontable/renderers/autocompleteRenderer/autocompleteRenderer.mjs": /*!*******************************************************************************************!*\ !*** ./node_modules/handsontable/renderers/autocompleteRenderer/autocompleteRenderer.mjs ***! \*******************************************************************************************/ /*! exports provided: RENDERER_TYPE, autocompleteRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return RENDERER_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autocompleteRenderer", function() { return autocompleteRenderer; }); /* harmony import */ var _htmlRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../htmlRenderer/index.mjs */ "./node_modules/handsontable/renderers/htmlRenderer/index.mjs"); /* harmony import */ var _textRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../textRenderer/index.mjs */ "./node_modules/handsontable/renderers/textRenderer/index.mjs"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); var RENDERER_TYPE = 'autocomplete'; /** * Autocomplete renderer. * * @private * @param {Core} instance The Handsontable instance. * @param {HTMLTableCellElement} TD The rendered cell element. * @param {number} row The visual row index. * @param {number} col The visual column index. * @param {number|string} prop The column property (passed when datasource is an array of objects). * @param {*} value The rendered value. * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}). */ function autocompleteRenderer(instance, TD, row, col, prop, value, cellProperties) { var rootDocument = instance.rootDocument; var rendererFunc = cellProperties.allowHtml ? _htmlRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_0__["htmlRenderer"] : _textRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_1__["textRenderer"]; var ARROW = rootDocument.createElement('DIV'); ARROW.className = 'htAutocompleteArrow'; ARROW.appendChild(rootDocument.createTextNode(String.fromCharCode(9660))); rendererFunc.apply(this, [instance, TD, row, col, prop, value, cellProperties]); if (!TD.firstChild) { // http://jsperf.com/empty-node-if-needed // otherwise empty fields appear borderless in demo/renderers.html (IE) TD.appendChild(rootDocument.createTextNode(String.fromCharCode(160))); // workaround for https://github.com/handsontable/handsontable/issues/1946 // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips } TD.insertBefore(ARROW, TD.firstChild); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_4__["addClass"])(TD, 'htAutocomplete'); if (!instance.acArrowListener) { var eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_3__["default"](instance); // not very elegant but easy and fast instance.acArrowListener = function (event) { if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_4__["hasClass"])(event.target, 'htAutocompleteArrow')) { instance.view.wt.getSetting('onCellDblClick', null, new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_2__["CellCoords"](row, col), TD); } }; eventManager.addEventListener(instance.rootElement, 'mousedown', instance.acArrowListener); // We need to unbind the listener after the table has been destroyed instance.addHookOnce('afterDestroy', function () { eventManager.destroy(); }); } } autocompleteRenderer.RENDERER_TYPE = RENDERER_TYPE; /***/ }), /***/ "./node_modules/handsontable/renderers/autocompleteRenderer/index.mjs": /*!****************************************************************************!*\ !*** ./node_modules/handsontable/renderers/autocompleteRenderer/index.mjs ***! \****************************************************************************/ /*! exports provided: RENDERER_TYPE, autocompleteRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _autocompleteRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./autocompleteRenderer.mjs */ "./node_modules/handsontable/renderers/autocompleteRenderer/autocompleteRenderer.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return _autocompleteRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["RENDERER_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autocompleteRenderer", function() { return _autocompleteRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["autocompleteRenderer"]; }); /***/ }), /***/ "./node_modules/handsontable/renderers/baseRenderer/baseRenderer.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/renderers/baseRenderer/baseRenderer.mjs ***! \***************************************************************************/ /*! exports provided: RENDERER_TYPE, baseRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return RENDERER_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "baseRenderer", function() { return baseRenderer; }); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /** * Adds appropriate CSS class to table cell, based on cellProperties. */ var RENDERER_TYPE = 'base'; /** * @param {Core} instance The Handsontable instance. * @param {HTMLTableCellElement} TD The rendered cell element. * @param {number} row The visual row index. * @param {number} col The visual column index. * @param {number|string} prop The column property (passed when datasource is an array of objects). * @param {*} value The rendered value. * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}). */ function baseRenderer(instance, TD, row, col, prop, value, cellProperties) { var classesToAdd = []; var classesToRemove = []; if (cellProperties.className) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_0__["addClass"])(TD, cellProperties.className); } if (cellProperties.readOnly) { classesToAdd.push(cellProperties.readOnlyCellClassName); } if (cellProperties.valid === false && cellProperties.invalidCellClassName) { classesToAdd.push(cellProperties.invalidCellClassName); } else { classesToRemove.push(cellProperties.invalidCellClassName); } if (cellProperties.wordWrap === false && cellProperties.noWordWrapClassName) { classesToAdd.push(cellProperties.noWordWrapClassName); } if (!value && cellProperties.placeholder) { classesToAdd.push(cellProperties.placeholderCellClassName); } Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(TD, classesToRemove); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_0__["addClass"])(TD, classesToAdd); } baseRenderer.RENDERER_TYPE = RENDERER_TYPE; /***/ }), /***/ "./node_modules/handsontable/renderers/baseRenderer/index.mjs": /*!********************************************************************!*\ !*** ./node_modules/handsontable/renderers/baseRenderer/index.mjs ***! \********************************************************************/ /*! exports provided: RENDERER_TYPE, baseRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _baseRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseRenderer.mjs */ "./node_modules/handsontable/renderers/baseRenderer/baseRenderer.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return _baseRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["RENDERER_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "baseRenderer", function() { return _baseRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["baseRenderer"]; }); /***/ }), /***/ "./node_modules/handsontable/renderers/checkboxRenderer/checkboxRenderer.mjs": /*!***********************************************************************************!*\ !*** ./node_modules/handsontable/renderers/checkboxRenderer/checkboxRenderer.mjs ***! \***********************************************************************************/ /*! exports provided: RENDERER_TYPE, checkboxRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return RENDERER_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkboxRenderer", function() { return checkboxRenderer; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js"); /* harmony import */ var core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.timers.js */ "./node_modules/core-js/modules/web.timers.js"); /* harmony import */ var _baseRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../baseRenderer/index.mjs */ "./node_modules/handsontable/renderers/baseRenderer/index.mjs"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../helpers/dom/event.mjs */ "./node_modules/handsontable/helpers/dom/event.mjs"); /* harmony import */ var _helpers_function_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../helpers/function.mjs */ "./node_modules/handsontable/helpers/function.mjs"); /* harmony import */ var _helpers_string_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../helpers/string.mjs */ "./node_modules/handsontable/helpers/string.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../helpers/unicode.mjs */ "./node_modules/handsontable/helpers/unicode.mjs"); /* harmony import */ var _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../pluginHooks.mjs */ "./node_modules/handsontable/pluginHooks.mjs"); var isListeningKeyDownEvent = new WeakMap(); var isCheckboxListenerAdded = new WeakMap(); var BAD_VALUE_CLASS = 'htBadValue'; var ATTR_ROW = 'data-row'; var ATTR_COLUMN = 'data-col'; var RENDERER_TYPE = 'checkbox'; _pluginHooks_mjs__WEBPACK_IMPORTED_MODULE_17__["default"].getSingleton().add('modifyAutoColumnSizeSeed', function (bundleSeed, cellMeta, cellValue) { var label = cellMeta.label, type = cellMeta.type, row = cellMeta.row, column = cellMeta.column, prop = cellMeta.prop; if (type !== RENDERER_TYPE) { return; } if (label) { var labelValue = label.value, labelProperty = label.property; var labelText = cellValue; if (labelValue) { labelText = typeof labelValue === 'function' ? labelValue(row, column, prop, cellValue) : labelValue; } else if (labelProperty) { var labelData = this.getDataAtRowProp(row, labelProperty); labelText = labelData !== null ? labelData : cellValue; } bundleSeed = labelText; } return bundleSeed; }); /** * Checkbox renderer. * * @private * @param {Core} instance The Handsontable instance. * @param {HTMLTableCellElement} TD The rendered cell element. * @param {number} row The visual row index. * @param {number} col The visual column index. * @param {number|string} prop The column property (passed when datasource is an array of objects). * @param {*} value The rendered value. * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}). */ function checkboxRenderer(instance, TD, row, col, prop, value, cellProperties) { var rootDocument = instance.rootDocument; _baseRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_9__["baseRenderer"].apply(this, [instance, TD, row, col, prop, value, cellProperties]); registerEvents(instance); var input = createInput(rootDocument); var labelOptions = cellProperties.label; var badValue = false; if (typeof cellProperties.checkedTemplate === 'undefined') { cellProperties.checkedTemplate = true; } if (typeof cellProperties.uncheckedTemplate === 'undefined') { cellProperties.uncheckedTemplate = false; } Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_11__["empty"])(TD); // TODO identify under what circumstances this line can be removed if (value === cellProperties.checkedTemplate || Object(_helpers_string_mjs__WEBPACK_IMPORTED_MODULE_14__["equalsIgnoreCase"])(value, cellProperties.checkedTemplate)) { input.checked = true; } else if (value === cellProperties.uncheckedTemplate || Object(_helpers_string_mjs__WEBPACK_IMPORTED_MODULE_14__["equalsIgnoreCase"])(value, cellProperties.uncheckedTemplate)) { input.checked = false; } else if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_15__["isEmpty"])(value)) { // default value Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_11__["addClass"])(input, 'noValue'); } else { input.style.display = 'none'; Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_11__["addClass"])(input, BAD_VALUE_CLASS); badValue = true; } input.setAttribute(ATTR_ROW, row); input.setAttribute(ATTR_COLUMN, col); if (!badValue && labelOptions) { var labelText = ''; if (labelOptions.value) { labelText = typeof labelOptions.value === 'function' ? labelOptions.value.call(this, row, col, prop, value) : labelOptions.value; } else if (labelOptions.property) { var labelValue = instance.getDataAtRowProp(row, labelOptions.property); labelText = labelValue !== null ? labelValue : ''; } var label = createLabel(rootDocument, labelText, labelOptions.separated !== true); if (labelOptions.position === 'before') { if (labelOptions.separated) { TD.appendChild(label); TD.appendChild(input); } else { label.appendChild(input); input = label; } } else if (!labelOptions.position || labelOptions.position === 'after') { if (labelOptions.separated) { TD.appendChild(input); TD.appendChild(label); } else { label.insertBefore(input, label.firstChild); input = label; } } } if (!labelOptions || labelOptions && !labelOptions.separated) { TD.appendChild(input); } if (badValue) { TD.appendChild(rootDocument.createTextNode('#bad-value#')); } if (!isListeningKeyDownEvent.has(instance)) { isListeningKeyDownEvent.set(instance, true); instance.addHook('beforeKeyDown', onBeforeKeyDown); } /** * On before key down DOM listener. * * @private * @param {Event} event The keyboard event object. */ function onBeforeKeyDown(event) { var toggleKeys = 'SPACE|ENTER'; var switchOffKeys = 'DELETE|BACKSPACE'; var isKeyCode = Object(_helpers_function_mjs__WEBPACK_IMPORTED_MODULE_13__["partial"])(_helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_16__["isKey"], event.keyCode); if (!instance.getSettings().enterBeginsEditing && isKeyCode('ENTER')) { return; } if (isKeyCode("".concat(toggleKeys, "|").concat(switchOffKeys)) && !Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_12__["isImmediatePropagationStopped"])(event)) { eachSelectedCheckboxCell(function () { Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_12__["stopImmediatePropagation"])(event); event.preventDefault(); }); } if (isKeyCode(toggleKeys)) { changeSelectedCheckboxesState(); } if (isKeyCode(switchOffKeys)) { changeSelectedCheckboxesState(true); } } /** * Change checkbox checked property. * * @private * @param {boolean} [uncheckCheckbox=false] The new "checked" state for the checkbox elements. */ function changeSelectedCheckboxesState() { var uncheckCheckbox = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var selRange = instance.getSelectedRange(); if (!selRange) { return; } for (var key = 0; key < selRange.length; key++) { var _selRange$key$getTopL = selRange[key].getTopLeftCorner(), startRow = _selRange$key$getTopL.row, startColumn = _selRange$key$getTopL.col; var _selRange$key$getBott = selRange[key].getBottomRightCorner(), endRow = _selRange$key$getBott.row, endColumn = _selRange$key$getBott.col; var changes = []; for (var visualRow = startRow; visualRow <= endRow; visualRow += 1) { for (var visualColumn = startColumn; visualColumn <= endColumn; visualColumn += 1) { var cachedCellProperties = instance.getCellMeta(visualRow, visualColumn); if (cachedCellProperties.type !== 'checkbox') { return; } /* eslint-disable no-continue */ if (cachedCellProperties.readOnly === true) { continue; } if (typeof cachedCellProperties.checkedTemplate === 'undefined') { cachedCellProperties.checkedTemplate = true; } if (typeof cachedCellProperties.uncheckedTemplate === 'undefined') { cachedCellProperties.uncheckedTemplate = false; } var dataAtCell = instance.getDataAtCell(visualRow, visualColumn); if (uncheckCheckbox === false) { if ([cachedCellProperties.checkedTemplate, cachedCellProperties.checkedTemplate.toString()].includes(dataAtCell)) { // eslint-disable-line max-len changes.push([visualRow, visualColumn, cachedCellProperties.uncheckedTemplate]); } else if ([cachedCellProperties.uncheckedTemplate, cachedCellProperties.uncheckedTemplate.toString(), null, void 0].includes(dataAtCell)) { // eslint-disable-line max-len changes.push([visualRow, visualColumn, cachedCellProperties.checkedTemplate]); } } else { changes.push([visualRow, visualColumn, cachedCellProperties.uncheckedTemplate]); } } } if (changes.length > 0) { instance.setDataAtCell(changes); } } } /** * Call callback for each found selected cell with checkbox type. * * @private * @param {Function} callback The callback function. */ function eachSelectedCheckboxCell(callback) { var selRange = instance.getSelectedRange(); if (!selRange) { return; } for (var key = 0; key < selRange.length; key++) { var topLeft = selRange[key].getTopLeftCorner(); var bottomRight = selRange[key].getBottomRightCorner(); for (var visualRow = topLeft.row; visualRow <= bottomRight.row; visualRow++) { for (var visualColumn = topLeft.col; visualColumn <= bottomRight.col; visualColumn++) { var cachedCellProperties = instance.getCellMeta(visualRow, visualColumn); if (cachedCellProperties.type !== 'checkbox') { return; } var cell = instance.getCell(visualRow, visualColumn); if (cell === null || cell === void 0) { callback(visualRow, visualColumn, cachedCellProperties); } else { var checkboxes = cell.querySelectorAll('input[type=checkbox]'); if (checkboxes.length > 0 && !cachedCellProperties.readOnly) { callback(checkboxes); } } } } } } } checkboxRenderer.RENDERER_TYPE = RENDERER_TYPE; /** * Register checkbox listeners. * * @param {Core} instance The Handsontable instance. * @returns {EventManager} */ function registerEvents(instance) { var eventManager = isCheckboxListenerAdded.get(instance); if (!eventManager) { var rootElement = instance.rootElement; eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_10__["default"](instance); eventManager.addEventListener(rootElement, 'click', function (event) { return onClick(event, instance); }); eventManager.addEventListener(rootElement, 'mouseup', function (event) { return onMouseUp(event, instance); }); eventManager.addEventListener(rootElement, 'change', function (event) { return onChange(event, instance); }); isCheckboxListenerAdded.set(instance, eventManager); } return eventManager; } /** * Create input element. * * @param {Document} rootDocument The document owner. * @returns {Node} */ function createInput(rootDocument) { var input = rootDocument.createElement('input'); input.className = 'htCheckboxRendererInput'; input.type = 'checkbox'; input.setAttribute('autocomplete', 'off'); input.setAttribute('tabindex', '-1'); return input.cloneNode(false); } /** * Create label element. * * @param {Document} rootDocument The document owner. * @param {string} text The label text. * @param {boolean} fullWidth Determines whether label should have full width. * @returns {Node} */ function createLabel(rootDocument, text, fullWidth) { var label = rootDocument.createElement('label'); label.className = "htCheckboxRendererLabel ".concat(fullWidth ? 'fullWidth' : ''); label.appendChild(rootDocument.createTextNode(text)); return label.cloneNode(true); } /** * `mouseup` callback. * * @private * @param {Event} event `mouseup` event. * @param {Core} instance The Handsontable instance. */ function onMouseUp(event, instance) { var target = event.target; if (!isCheckboxInput(target)) { return; } if (!target.hasAttribute(ATTR_ROW) || !target.hasAttribute(ATTR_COLUMN)) { return; } setTimeout(instance.listen, 10); } /** * `click` callback. * * @private * @param {MouseEvent} event `click` event. * @param {Core} instance The Handsontable instance. */ function onClick(event, instance) { var target = event.target; if (!isCheckboxInput(target)) { return; } if (!target.hasAttribute(ATTR_ROW) || !target.hasAttribute(ATTR_COLUMN)) { return; } var row = parseInt(target.getAttribute(ATTR_ROW), 10); var col = parseInt(target.getAttribute(ATTR_COLUMN), 10); var cellProperties = instance.getCellMeta(row, col); if (cellProperties.readOnly) { event.preventDefault(); } } /** * `change` callback. * * @param {Event} event `change` event. * @param {Core} instance The Handsontable instance. */ function onChange(event, instance) { var target = event.target; if (!isCheckboxInput(target)) { return; } if (!target.hasAttribute(ATTR_ROW) || !target.hasAttribute(ATTR_COLUMN)) { return; } var row = parseInt(target.getAttribute(ATTR_ROW), 10); var col = parseInt(target.getAttribute(ATTR_COLUMN), 10); var cellProperties = instance.getCellMeta(row, col); if (!cellProperties.readOnly) { var newCheckboxValue = null; if (event.target.checked) { newCheckboxValue = cellProperties.uncheckedTemplate === void 0 ? true : cellProperties.checkedTemplate; } else { newCheckboxValue = cellProperties.uncheckedTemplate === void 0 ? false : cellProperties.uncheckedTemplate; } instance.setDataAtCell(row, col, newCheckboxValue); } } /** * Check if the provided element is the checkbox input. * * @private * @param {HTMLElement} element The element in question. * @returns {boolean} */ function isCheckboxInput(element) { return element.tagName === 'INPUT' && element.getAttribute('type') === 'checkbox'; } /***/ }), /***/ "./node_modules/handsontable/renderers/checkboxRenderer/index.mjs": /*!************************************************************************!*\ !*** ./node_modules/handsontable/renderers/checkboxRenderer/index.mjs ***! \************************************************************************/ /*! exports provided: RENDERER_TYPE, checkboxRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _checkboxRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./checkboxRenderer.mjs */ "./node_modules/handsontable/renderers/checkboxRenderer/checkboxRenderer.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return _checkboxRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["RENDERER_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "checkboxRenderer", function() { return _checkboxRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["checkboxRenderer"]; }); /***/ }), /***/ "./node_modules/handsontable/renderers/htmlRenderer/htmlRenderer.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/renderers/htmlRenderer/htmlRenderer.mjs ***! \***************************************************************************/ /*! exports provided: RENDERER_TYPE, htmlRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return RENDERER_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "htmlRenderer", function() { return htmlRenderer; }); /* harmony import */ var _baseRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../baseRenderer/index.mjs */ "./node_modules/handsontable/renderers/baseRenderer/index.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); var RENDERER_TYPE = 'html'; /** * @private * @param {Core} instance The Handsontable instance. * @param {HTMLTableCellElement} TD The rendered cell element. * @param {number} row The visual row index. * @param {number} col The visual column index. * @param {number|string} prop The column property (passed when datasource is an array of objects). * @param {*} value The rendered value. * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}). */ function htmlRenderer(instance, TD, row, col, prop, value, cellProperties) { _baseRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_0__["baseRenderer"].apply(this, [instance, TD, row, col, prop, value, cellProperties]); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_1__["fastInnerHTML"])(TD, value === null || value === void 0 ? '' : value, false); } htmlRenderer.RENDERER_TYPE = RENDERER_TYPE; /***/ }), /***/ "./node_modules/handsontable/renderers/htmlRenderer/index.mjs": /*!********************************************************************!*\ !*** ./node_modules/handsontable/renderers/htmlRenderer/index.mjs ***! \********************************************************************/ /*! exports provided: RENDERER_TYPE, htmlRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _htmlRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./htmlRenderer.mjs */ "./node_modules/handsontable/renderers/htmlRenderer/htmlRenderer.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return _htmlRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["RENDERER_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "htmlRenderer", function() { return _htmlRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["htmlRenderer"]; }); /***/ }), /***/ "./node_modules/handsontable/renderers/index.mjs": /*!*******************************************************!*\ !*** ./node_modules/handsontable/renderers/index.mjs ***! \*******************************************************/ /*! exports provided: autocompleteRenderer, AUTOCOMPLETE_RENDERER, baseRenderer, BASE_RENDERER, checkboxRenderer, CHECKBOX_RENDERER, htmlRenderer, HTML_RENDERER, numericRenderer, NUMERIC_RENDERER, passwordRenderer, PASSWORD_RENDERER, textRenderer, TEXT_RENDERER, getRegisteredRendererNames, getRegisteredRenderers, getRenderer, hasRenderer, registerRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _autocompleteRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./autocompleteRenderer/index.mjs */ "./node_modules/handsontable/renderers/autocompleteRenderer/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autocompleteRenderer", function() { return _autocompleteRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_0__["autocompleteRenderer"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AUTOCOMPLETE_RENDERER", function() { return _autocompleteRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_0__["RENDERER_TYPE"]; }); /* harmony import */ var _baseRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./baseRenderer/index.mjs */ "./node_modules/handsontable/renderers/baseRenderer/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "baseRenderer", function() { return _baseRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_1__["baseRenderer"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BASE_RENDERER", function() { return _baseRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_1__["RENDERER_TYPE"]; }); /* harmony import */ var _checkboxRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./checkboxRenderer/index.mjs */ "./node_modules/handsontable/renderers/checkboxRenderer/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "checkboxRenderer", function() { return _checkboxRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_2__["checkboxRenderer"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CHECKBOX_RENDERER", function() { return _checkboxRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_2__["RENDERER_TYPE"]; }); /* harmony import */ var _htmlRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./htmlRenderer/index.mjs */ "./node_modules/handsontable/renderers/htmlRenderer/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "htmlRenderer", function() { return _htmlRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_3__["htmlRenderer"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HTML_RENDERER", function() { return _htmlRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_3__["RENDERER_TYPE"]; }); /* harmony import */ var _numericRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./numericRenderer/index.mjs */ "./node_modules/handsontable/renderers/numericRenderer/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "numericRenderer", function() { return _numericRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_4__["numericRenderer"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NUMERIC_RENDERER", function() { return _numericRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_4__["RENDERER_TYPE"]; }); /* harmony import */ var _passwordRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./passwordRenderer/index.mjs */ "./node_modules/handsontable/renderers/passwordRenderer/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "passwordRenderer", function() { return _passwordRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_5__["passwordRenderer"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PASSWORD_RENDERER", function() { return _passwordRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_5__["RENDERER_TYPE"]; }); /* harmony import */ var _textRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./textRenderer/index.mjs */ "./node_modules/handsontable/renderers/textRenderer/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "textRenderer", function() { return _textRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_6__["textRenderer"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TEXT_RENDERER", function() { return _textRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_6__["RENDERER_TYPE"]; }); /* harmony import */ var _registry_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./registry.mjs */ "./node_modules/handsontable/renderers/registry.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRegisteredRendererNames", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_7__["getRegisteredRendererNames"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRegisteredRenderers", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_7__["getRegisteredRenderers"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRenderer", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_7__["getRenderer"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasRenderer", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_7__["hasRenderer"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerRenderer", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_7__["registerRenderer"]; }); /***/ }), /***/ "./node_modules/handsontable/renderers/numericRenderer/index.mjs": /*!***********************************************************************!*\ !*** ./node_modules/handsontable/renderers/numericRenderer/index.mjs ***! \***********************************************************************/ /*! exports provided: RENDERER_TYPE, numericRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _numericRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./numericRenderer.mjs */ "./node_modules/handsontable/renderers/numericRenderer/numericRenderer.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return _numericRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["RENDERER_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "numericRenderer", function() { return _numericRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["numericRenderer"]; }); /***/ }), /***/ "./node_modules/handsontable/renderers/numericRenderer/numericRenderer.mjs": /*!*********************************************************************************!*\ !*** ./node_modules/handsontable/renderers/numericRenderer/numericRenderer.mjs ***! \*********************************************************************************/ /*! exports provided: RENDERER_TYPE, numericRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return RENDERER_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "numericRenderer", function() { return numericRenderer; }); /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js"); /* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.string.split.js */ "./node_modules/core-js/modules/es.string.split.js"); /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.replace.js */ "./node_modules/core-js/modules/es.string.replace.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js"); /* harmony import */ var numbro__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! numbro */ "./node_modules/handsontable/node_modules/numbro/dist/numbro.min.js"); /* harmony import */ var _textRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../textRenderer/index.mjs */ "./node_modules/handsontable/renderers/textRenderer/index.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); var RENDERER_TYPE = 'numeric'; /** * Numeric cell renderer. * * @private * @param {Core} instance The Handsontable instance. * @param {HTMLTableCellElement} TD The rendered cell element. * @param {number} row The visual row index. * @param {number} col The visual column index. * @param {number|string} prop The column property (passed when datasource is an array of objects). * @param {*} value The rendered value. * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}). */ function numericRenderer(instance, TD, row, col, prop, value, cellProperties) { var newValue = value; if (Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_7__["isNumeric"])(newValue)) { var numericFormat = cellProperties.numericFormat; var cellCulture = numericFormat && numericFormat.culture || '-'; var cellFormatPattern = numericFormat && numericFormat.pattern; var className = cellProperties.className || ''; var classArr = className.length ? className.split(' ') : []; if (typeof cellCulture !== 'undefined' && !numbro__WEBPACK_IMPORTED_MODULE_5__.languages()[cellCulture]) { var shortTag = cellCulture.replace('-', ''); var langData = numbro__WEBPACK_IMPORTED_MODULE_5__.allLanguages ? numbro__WEBPACK_IMPORTED_MODULE_5__.allLanguages[cellCulture] : numbro__WEBPACK_IMPORTED_MODULE_5__[shortTag]; if (langData) { numbro__WEBPACK_IMPORTED_MODULE_5__.registerLanguage(langData); } } numbro__WEBPACK_IMPORTED_MODULE_5__.setLanguage(cellCulture); newValue = numbro__WEBPACK_IMPORTED_MODULE_5__(newValue).format(cellFormatPattern || '0'); if (classArr.indexOf('htLeft') < 0 && classArr.indexOf('htCenter') < 0 && classArr.indexOf('htRight') < 0 && classArr.indexOf('htJustify') < 0) { classArr.push('htRight'); } if (classArr.indexOf('htNumeric') < 0) { classArr.push('htNumeric'); } cellProperties.className = classArr.join(' '); } Object(_textRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_6__["textRenderer"])(instance, TD, row, col, prop, newValue, cellProperties); } numericRenderer.RENDERER_TYPE = RENDERER_TYPE; /***/ }), /***/ "./node_modules/handsontable/renderers/passwordRenderer/index.mjs": /*!************************************************************************!*\ !*** ./node_modules/handsontable/renderers/passwordRenderer/index.mjs ***! \************************************************************************/ /*! exports provided: RENDERER_TYPE, passwordRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _passwordRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./passwordRenderer.mjs */ "./node_modules/handsontable/renderers/passwordRenderer/passwordRenderer.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return _passwordRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["RENDERER_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "passwordRenderer", function() { return _passwordRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["passwordRenderer"]; }); /***/ }), /***/ "./node_modules/handsontable/renderers/passwordRenderer/passwordRenderer.mjs": /*!***********************************************************************************!*\ !*** ./node_modules/handsontable/renderers/passwordRenderer/passwordRenderer.mjs ***! \***********************************************************************************/ /*! exports provided: RENDERER_TYPE, passwordRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return RENDERER_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "passwordRenderer", function() { return passwordRenderer; }); /* harmony import */ var _textRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../textRenderer/index.mjs */ "./node_modules/handsontable/renderers/textRenderer/index.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); var RENDERER_TYPE = 'password'; /** * @private * @param {Core} instance The Handsontable instance. * @param {HTMLTableCellElement} TD The rendered cell element. * @param {number} row The visual row index. * @param {number} col The visual column index. * @param {number|string} prop The column property (passed when datasource is an array of objects). * @param {*} value The rendered value. * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}). */ function passwordRenderer(instance, TD, row, col, prop, value, cellProperties) { _textRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_0__["textRenderer"].apply(this, [instance, TD, row, col, prop, value, cellProperties]); var hashLength = cellProperties.hashLength || TD.innerHTML.length; var hashSymbol = cellProperties.hashSymbol || '*'; var hash = ''; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_2__["rangeEach"])(hashLength - 1, function () { hash += hashSymbol; }); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_1__["fastInnerHTML"])(TD, hash); } passwordRenderer.RENDERER_TYPE = RENDERER_TYPE; /***/ }), /***/ "./node_modules/handsontable/renderers/registry.mjs": /*!**********************************************************!*\ !*** ./node_modules/handsontable/renderers/registry.mjs ***! \**********************************************************/ /*! exports provided: registerRenderer, getRenderer, hasRenderer, getRegisteredRendererNames, getRegisteredRenderers */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerRenderer", function() { return _register; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRenderer", function() { return _getItem; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasRenderer", function() { return hasItem; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRegisteredRendererNames", function() { return getNames; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRegisteredRenderers", function() { return getValues; }); /* harmony import */ var _utils_staticRegister_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/staticRegister.mjs */ "./node_modules/handsontable/utils/staticRegister.mjs"); var _staticRegister = Object(_utils_staticRegister_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])('renderers'), register = _staticRegister.register, getItem = _staticRegister.getItem, hasItem = _staticRegister.hasItem, getNames = _staticRegister.getNames, getValues = _staticRegister.getValues; /** * Retrieve renderer function. * * @param {string} name Renderer identification. * @returns {Function} Returns renderer function. */ function _getItem(name) { if (typeof name === 'function') { return name; } if (!hasItem(name)) { throw Error("No registered renderer found under \"".concat(name, "\" name")); } return getItem(name); } /** * Register renderer under its alias. * * @param {string|Function} name Renderer's alias or renderer function with its descriptor. * @param {Function} [renderer] Renderer function. */ function _register(name, renderer) { if (typeof name !== 'string') { renderer = name; name = renderer.RENDERER_TYPE; } register(name, renderer); } /***/ }), /***/ "./node_modules/handsontable/renderers/textRenderer/index.mjs": /*!********************************************************************!*\ !*** ./node_modules/handsontable/renderers/textRenderer/index.mjs ***! \********************************************************************/ /*! exports provided: RENDERER_TYPE, textRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _textRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./textRenderer.mjs */ "./node_modules/handsontable/renderers/textRenderer/textRenderer.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return _textRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["RENDERER_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "textRenderer", function() { return _textRenderer_mjs__WEBPACK_IMPORTED_MODULE_0__["textRenderer"]; }); /***/ }), /***/ "./node_modules/handsontable/renderers/textRenderer/textRenderer.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/renderers/textRenderer/textRenderer.mjs ***! \***************************************************************************/ /*! exports provided: RENDERER_TYPE, textRenderer */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RENDERER_TYPE", function() { return RENDERER_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "textRenderer", function() { return textRenderer; }); /* harmony import */ var core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.string.trim.js */ "./node_modules/core-js/modules/es.string.trim.js"); /* harmony import */ var _baseRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../baseRenderer/index.mjs */ "./node_modules/handsontable/renderers/baseRenderer/index.mjs"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); var RENDERER_TYPE = 'text'; /** * Default text renderer. * * @private * @param {Core} instance The Handsontable instance. * @param {HTMLTableCellElement} TD The rendered cell element. * @param {number} row The visual row index. * @param {number} col The visual column index. * @param {number|string} prop The column property (passed when datasource is an array of objects). * @param {*} value The rendered value. * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}). */ function textRenderer(instance, TD, row, col, prop, value, cellProperties) { _baseRenderer_index_mjs__WEBPACK_IMPORTED_MODULE_1__["baseRenderer"].apply(this, [instance, TD, row, col, prop, value, cellProperties]); var escaped = value; if (!escaped && cellProperties.placeholder) { escaped = cellProperties.placeholder; } escaped = Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_3__["stringify"])(escaped); if (instance.getSettings().trimWhitespace) { escaped = escaped.trim(); } if (cellProperties.rendererTemplate) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_2__["empty"])(TD); var TEMPLATE = instance.rootDocument.createElement('TEMPLATE'); TEMPLATE.setAttribute('bind', '{{}}'); TEMPLATE.innerHTML = cellProperties.rendererTemplate; HTMLTemplateElement.decorate(TEMPLATE); TEMPLATE.model = instance.getSourceDataAtRow(row); TD.appendChild(TEMPLATE); } else { // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_2__["fastInnerText"])(TD, escaped); } } textRenderer.RENDERER_TYPE = RENDERER_TYPE; /***/ }), /***/ "./node_modules/handsontable/selection/highlight/constants.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/selection/highlight/constants.mjs ***! \*********************************************************************/ /*! exports provided: ACTIVE_HEADER_TYPE, AREA_TYPE, CELL_TYPE, FILL_TYPE, HEADER_TYPE, CUSTOM_SELECTION_TYPE */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ACTIVE_HEADER_TYPE", function() { return ACTIVE_HEADER_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AREA_TYPE", function() { return AREA_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CELL_TYPE", function() { return CELL_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FILL_TYPE", function() { return FILL_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HEADER_TYPE", function() { return HEADER_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CUSTOM_SELECTION_TYPE", function() { return CUSTOM_SELECTION_TYPE; }); var ACTIVE_HEADER_TYPE = 'active-header'; var AREA_TYPE = 'area'; var CELL_TYPE = 'cell'; var FILL_TYPE = 'fill'; var HEADER_TYPE = 'header'; var CUSTOM_SELECTION_TYPE = 'custom-selection'; /***/ }), /***/ "./node_modules/handsontable/selection/highlight/highlight.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/selection/highlight/highlight.mjs ***! \*********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.fill.js */ "./node_modules/core-js/modules/es.array.fill.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _types_index_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./types/index.mjs */ "./node_modules/handsontable/selection/highlight/types/index.mjs"); /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/handsontable/selection/highlight/constants.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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"); } } 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; } /** * Highlight class responsible for managing Walkontable Selection classes. * * With Highlight object you can manipulate four different highlight types: * - `cell` can be added only to a single cell at a time and it defines currently selected cell; * - `fill` can occur only once and its highlight defines selection of autofill functionality (managed by the plugin with the same name); * - `areas` can be added to multiple cells at a time. This type highlights selected cell or multiple cells. * The multiple cells have to be defined as an uninterrupted order (regular shape). Otherwise, the new layer of * that type should be created to manage not-consecutive selection; * - `header` can occur multiple times. This type is designed to highlight only headers. Like `area` type it * can appear with multiple highlights (accessed under different level layers). * * @class Highlight * @util */ var Highlight = /*#__PURE__*/function () { function Highlight(options) { _classCallCheck(this, Highlight); /** * Options consumed by Highlight class and Walkontable Selection classes. * * @type {object} */ this.options = options; /** * The property which describes which layer level of the visual selection will be modified. * This option is valid only for `area` and `header` highlight types which occurs multiple times on * the table (as a non-consecutive selection). * * An order of the layers is the same as the order of added new non-consecutive selections. * * @type {number} * @default 0 */ this.layerLevel = 0; /** * `cell` highlight object which describes attributes for the currently selected cell. * It can only occur only once on the table. * * @type {Selection} */ this.cell = Object(_types_index_mjs__WEBPACK_IMPORTED_MODULE_20__["createHighlight"])(_constants_mjs__WEBPACK_IMPORTED_MODULE_21__["CELL_TYPE"], options); /** * `fill` highlight object which describes attributes for the borders for autofill functionality. * It can only occur only once on the table. * * @type {Selection} */ this.fill = Object(_types_index_mjs__WEBPACK_IMPORTED_MODULE_20__["createHighlight"])(_constants_mjs__WEBPACK_IMPORTED_MODULE_21__["FILL_TYPE"], options); /** * Collection of the `area` highlights. That objects describes attributes for the borders and selection of * the multiple selected cells. It can occur multiple times on the table. * * @type {Map.} */ this.areas = new Map(); /** * Collection of the `header` highlights. That objects describes attributes for the selection of * the multiple selected rows and columns in the table header. It can occur multiple times on the table. * * @type {Map.} */ this.headers = new Map(); /** * Collection of the `active-header` highlights. That objects describes attributes for the selection of * the multiple selected rows and columns in the table header. The table headers which have selected all items in * a row will be marked as `active-header`. * * @type {Map.} */ this.activeHeaders = new Map(); /** * Collection of the `custom-selection`, holder for example borders added through CustomBorders plugin. * * @type {Selection[]} */ this.customSelections = []; } /** * Check if highlight cell rendering is disabled for specified highlight type. * * @param {string} highlightType Highlight type. Possible values are: `cell`, `area`, `fill` or `header`. * @param {CellCoords} coords The CellCoords instance with defined visual coordinates. * @returns {boolean} */ _createClass(Highlight, [{ key: "isEnabledFor", value: function isEnabledFor(highlightType, coords) { var type = highlightType; // Legacy compatibility. if (highlightType === _constants_mjs__WEBPACK_IMPORTED_MODULE_21__["CELL_TYPE"]) { type = 'current'; // One from settings for `disableVisualSelection` up to Handsontable 0.36/Handsontable Pro 1.16.0. } var disableHighlight = this.options.disabledCellSelection(coords.row, coords.col); if (typeof disableHighlight === 'string') { disableHighlight = [disableHighlight]; } return disableHighlight === false || Array.isArray(disableHighlight) && !disableHighlight.includes(type); } /** * Set a new layer level to make access to the desire `area` and `header` highlights. * * @param {number} [level=0] Layer level to use. * @returns {Highlight} */ }, { key: "useLayerLevel", value: function useLayerLevel() { var level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; this.layerLevel = level; return this; } /** * Get Walkontable Selection instance created for controlling highlight of the currently selected/edited cell. * * @returns {Selection} */ }, { key: "getCell", value: function getCell() { return this.cell; } /** * Get Walkontable Selection instance created for controlling highlight of the autofill functionality. * * @returns {Selection} */ }, { key: "getFill", value: function getFill() { return this.fill; } /** * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight * of the multiple selected cells. * * @returns {Selection} */ }, { key: "createOrGetArea", value: function createOrGetArea() { var layerLevel = this.layerLevel; var area; if (this.areas.has(layerLevel)) { area = this.areas.get(layerLevel); } else { area = Object(_types_index_mjs__WEBPACK_IMPORTED_MODULE_20__["createHighlight"])(_constants_mjs__WEBPACK_IMPORTED_MODULE_21__["AREA_TYPE"], _objectSpread({ layerLevel: layerLevel }, this.options)); this.areas.set(layerLevel, area); } return area; } /** * Get all Walkontable Selection instances which describes the state of the visual highlight of the cells. * * @returns {Selection[]} */ }, { key: "getAreas", value: function getAreas() { return _toConsumableArray(this.areas.values()); } /** * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight * of the multiple selected header cells. * * @returns {Selection} */ }, { key: "createOrGetHeader", value: function createOrGetHeader() { var layerLevel = this.layerLevel; var header; if (this.headers.has(layerLevel)) { header = this.headers.get(layerLevel); } else { header = Object(_types_index_mjs__WEBPACK_IMPORTED_MODULE_20__["createHighlight"])(_constants_mjs__WEBPACK_IMPORTED_MODULE_21__["HEADER_TYPE"], _objectSpread({}, this.options)); this.headers.set(layerLevel, header); } return header; } /** * Get all Walkontable Selection instances which describes the state of the visual highlight of the headers. * * @returns {Selection[]} */ }, { key: "getHeaders", value: function getHeaders() { return _toConsumableArray(this.headers.values()); } /** * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight * of the multiple selected active header cells. * * @returns {Selection} */ }, { key: "createOrGetActiveHeader", value: function createOrGetActiveHeader() { var layerLevel = this.layerLevel; var header; if (this.activeHeaders.has(layerLevel)) { header = this.activeHeaders.get(layerLevel); } else { header = Object(_types_index_mjs__WEBPACK_IMPORTED_MODULE_20__["createHighlight"])(_constants_mjs__WEBPACK_IMPORTED_MODULE_21__["ACTIVE_HEADER_TYPE"], _objectSpread({}, this.options)); this.activeHeaders.set(layerLevel, header); } return header; } /** * Get all Walkontable Selection instances which describes the state of the visual highlight of the active headers. * * @returns {Selection[]} */ }, { key: "getActiveHeaders", value: function getActiveHeaders() { return _toConsumableArray(this.activeHeaders.values()); } /** * Get Walkontable Selection instance created for controlling highlight of the custom selection functionality. * * @returns {Selection} */ }, { key: "getCustomSelections", value: function getCustomSelections() { return _toConsumableArray(this.customSelections.values()); } /** * Add selection to the custom selection instance. The new selection are added to the end of the selection collection. * * @param {object} selectionInstance The selection instance. */ }, { key: "addCustomSelection", value: function addCustomSelection(selectionInstance) { this.customSelections.push(Object(_types_index_mjs__WEBPACK_IMPORTED_MODULE_20__["createHighlight"])(_constants_mjs__WEBPACK_IMPORTED_MODULE_21__["CUSTOM_SELECTION_TYPE"], _objectSpread(_objectSpread({}, this.options), selectionInstance))); } /** * Perform cleaning visual highlights for the whole table. */ }, { key: "clear", value: function clear() { this.cell.clear(); this.fill.clear(); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_22__["arrayEach"])(this.areas.values(), function (highlight) { return void highlight.clear(); }); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_22__["arrayEach"])(this.headers.values(), function (highlight) { return void highlight.clear(); }); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_22__["arrayEach"])(this.activeHeaders.values(), function (highlight) { return void highlight.clear(); }); } /** * This object can be iterate over using `for of` syntax or using internal `arrayEach` helper. * * @returns {Selection[]} */ }, { key: Symbol.iterator, value: function value() { return [this.cell, this.fill].concat(_toConsumableArray(this.areas.values()), _toConsumableArray(this.headers.values()), _toConsumableArray(this.activeHeaders.values()), _toConsumableArray(this.customSelections))[Symbol.iterator](); } }]); return Highlight; }(); /* harmony default export */ __webpack_exports__["default"] = (Highlight); /***/ }), /***/ "./node_modules/handsontable/selection/highlight/types/activeHeader.mjs": /*!******************************************************************************!*\ !*** ./node_modules/handsontable/selection/highlight/types/activeHeader.mjs ***! \******************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/handsontable/selection/highlight/constants.mjs"); /* harmony import */ var _visualSelection_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../visualSelection.mjs */ "./node_modules/handsontable/selection/highlight/visualSelection.mjs"); var _excluded = ["activeHeaderClassName"]; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * @param {object} highlightParams A configuration object to create a highlight. * @param {string} highlightParams.activeHeaderClassName Highlighted headers' class name. * @returns {Selection} */ function createHighlight(_ref) { var activeHeaderClassName = _ref.activeHeaderClassName, restOptions = _objectWithoutProperties(_ref, _excluded); var s = new _visualSelection_mjs__WEBPACK_IMPORTED_MODULE_8__["default"](_objectSpread(_objectSpread({ highlightHeaderClassName: activeHeaderClassName }, restOptions), {}, { selectionType: _constants_mjs__WEBPACK_IMPORTED_MODULE_7__["ACTIVE_HEADER_TYPE"] })); return s; } /* harmony default export */ __webpack_exports__["default"] = (createHighlight); /***/ }), /***/ "./node_modules/handsontable/selection/highlight/types/area.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/selection/highlight/types/area.mjs ***! \**********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/handsontable/selection/highlight/constants.mjs"); /* harmony import */ var _visualSelection_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../visualSelection.mjs */ "./node_modules/handsontable/selection/highlight/visualSelection.mjs"); var _excluded = ["layerLevel", "areaCornerVisible"]; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * Creates the new instance of Selection responsible for highlighting area of the selected multiple cells. * * @param {object} highlightParams A configuration object to create a highlight. * @param {number} highlightParams.layerLevel Layer level. * @param {object} highlightParams.areaCornerVisible Function to determine if area's corner should be visible. * @returns {Selection} */ function createHighlight(_ref) { var layerLevel = _ref.layerLevel, areaCornerVisible = _ref.areaCornerVisible, restOptions = _objectWithoutProperties(_ref, _excluded); var s = new _visualSelection_mjs__WEBPACK_IMPORTED_MODULE_8__["default"](_objectSpread(_objectSpread({ className: 'area', markIntersections: true, layerLevel: Math.min(layerLevel, 7), border: { width: 1, color: '#4b89ff', cornerVisible: areaCornerVisible } }, restOptions), {}, { selectionType: _constants_mjs__WEBPACK_IMPORTED_MODULE_7__["AREA_TYPE"] })); return s; } /* harmony default export */ __webpack_exports__["default"] = (createHighlight); /***/ }), /***/ "./node_modules/handsontable/selection/highlight/types/cell.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/selection/highlight/types/cell.mjs ***! \**********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/handsontable/selection/highlight/constants.mjs"); /* harmony import */ var _visualSelection_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../visualSelection.mjs */ "./node_modules/handsontable/selection/highlight/visualSelection.mjs"); var _excluded = ["cellCornerVisible"]; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * Creates the new instance of Selection responsible for highlighting currently selected cell. This type of selection * can present on the table only one at the time. * * @param {object} highlightParams A configuration object to create a highlight. * @param {Function} highlightParams.cellCornerVisible Function to determine if cell's corner should be visible. * @returns {Selection} */ function createHighlight(_ref) { var cellCornerVisible = _ref.cellCornerVisible, restOptions = _objectWithoutProperties(_ref, _excluded); var s = new _visualSelection_mjs__WEBPACK_IMPORTED_MODULE_8__["default"](_objectSpread(_objectSpread({ className: 'current', border: { width: 2, color: '#4b89ff', cornerVisible: cellCornerVisible } }, restOptions), {}, { selectionType: _constants_mjs__WEBPACK_IMPORTED_MODULE_7__["CELL_TYPE"] })); return s; } /* harmony default export */ __webpack_exports__["default"] = (createHighlight); /***/ }), /***/ "./node_modules/handsontable/selection/highlight/types/customSelection.mjs": /*!*********************************************************************************!*\ !*** ./node_modules/handsontable/selection/highlight/types/customSelection.mjs ***! \*********************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/handsontable/selection/highlight/constants.mjs"); /* harmony import */ var _visualSelection_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../visualSelection.mjs */ "./node_modules/handsontable/selection/highlight/visualSelection.mjs"); var _excluded = ["border", "visualCellRange"]; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * Creates the new instance of Selection responsible for highlighting currently selected cell. This type of selection * can present on the table only one at the time. * * @param {object} highlightParams A configuration object to create a highlight. * @param {object} highlightParams.border Border configuration. * @param {object} highlightParams.visualCellRange Function to translate visual to renderable coords. * @returns {Selection} */ function createHighlight(_ref) { var border = _ref.border, visualCellRange = _ref.visualCellRange, restOptions = _objectWithoutProperties(_ref, _excluded); var s = new _visualSelection_mjs__WEBPACK_IMPORTED_MODULE_8__["default"](_objectSpread(_objectSpread(_objectSpread({}, border), restOptions), {}, { selectionType: _constants_mjs__WEBPACK_IMPORTED_MODULE_7__["CUSTOM_SELECTION_TYPE"] }), visualCellRange); return s; } /* harmony default export */ __webpack_exports__["default"] = (createHighlight); /***/ }), /***/ "./node_modules/handsontable/selection/highlight/types/fill.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/selection/highlight/types/fill.mjs ***! \**********************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_object_assign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.assign.js */ "./node_modules/core-js/modules/es.object.assign.js"); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/handsontable/selection/highlight/constants.mjs"); /* harmony import */ var _visualSelection_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../visualSelection.mjs */ "./node_modules/handsontable/selection/highlight/visualSelection.mjs"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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; } /** * Creates the new instance of Selection, responsible for highlighting cells which are covered by fill handle * functionality. This type of selection can present on the table only one at the time. * * @param {object} highlightParams A configuration object to create a highlight. * @returns {Selection} */ function createHighlight(_ref) { var restOptions = Object.assign({}, _ref); var s = new _visualSelection_mjs__WEBPACK_IMPORTED_MODULE_8__["default"](_objectSpread(_objectSpread({ className: 'fill', border: { width: 1, color: '#ff0000' } }, restOptions), {}, { selectionType: _constants_mjs__WEBPACK_IMPORTED_MODULE_7__["FILL_TYPE"] })); return s; } /* harmony default export */ __webpack_exports__["default"] = (createHighlight); /***/ }), /***/ "./node_modules/handsontable/selection/highlight/types/header.mjs": /*!************************************************************************!*\ !*** ./node_modules/handsontable/selection/highlight/types/header.mjs ***! \************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/handsontable/selection/highlight/constants.mjs"); /* harmony import */ var _visualSelection_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../visualSelection.mjs */ "./node_modules/handsontable/selection/highlight/visualSelection.mjs"); var _excluded = ["headerClassName", "rowClassName", "columnClassName"]; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * Creates the new instance of Selection, responsible for highlighting row and column headers. This type of selection * can occur multiple times. * * @param {object} highlightParams A configuration object to create a highlight. * @param {string} highlightParams.headerClassName Highlighted headers' class name. * @param {string} highlightParams.rowClassName Highlighted row' class name. * @param {string} highlightParams.columnClassName Highlighted column' class name. * @returns {Selection} */ function createHighlight(_ref) { var headerClassName = _ref.headerClassName, rowClassName = _ref.rowClassName, columnClassName = _ref.columnClassName, restOptions = _objectWithoutProperties(_ref, _excluded); var s = new _visualSelection_mjs__WEBPACK_IMPORTED_MODULE_8__["default"](_objectSpread(_objectSpread({ className: 'highlight', highlightHeaderClassName: headerClassName, highlightRowClassName: rowClassName, highlightColumnClassName: columnClassName }, restOptions), {}, { highlightOnlyClosestHeader: true, selectionType: _constants_mjs__WEBPACK_IMPORTED_MODULE_7__["HEADER_TYPE"] })); return s; } /* harmony default export */ __webpack_exports__["default"] = (createHighlight); /***/ }), /***/ "./node_modules/handsontable/selection/highlight/types/index.mjs": /*!***********************************************************************!*\ !*** ./node_modules/handsontable/selection/highlight/types/index.mjs ***! \***********************************************************************/ /*! exports provided: createHighlight */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createHighlight", function() { return createHighlight; }); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var _utils_staticRegister_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../../utils/staticRegister.mjs */ "./node_modules/handsontable/utils/staticRegister.mjs"); /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/handsontable/selection/highlight/constants.mjs"); /* harmony import */ var _activeHeader_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./activeHeader.mjs */ "./node_modules/handsontable/selection/highlight/types/activeHeader.mjs"); /* harmony import */ var _area_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./area.mjs */ "./node_modules/handsontable/selection/highlight/types/area.mjs"); /* harmony import */ var _cell_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./cell.mjs */ "./node_modules/handsontable/selection/highlight/types/cell.mjs"); /* harmony import */ var _customSelection_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./customSelection.mjs */ "./node_modules/handsontable/selection/highlight/types/customSelection.mjs"); /* harmony import */ var _fill_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./fill.mjs */ "./node_modules/handsontable/selection/highlight/types/fill.mjs"); /* harmony import */ var _header_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./header.mjs */ "./node_modules/handsontable/selection/highlight/types/header.mjs"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _staticRegister = Object(_utils_staticRegister_mjs__WEBPACK_IMPORTED_MODULE_6__["default"])('highlight/types'), register = _staticRegister.register, getItem = _staticRegister.getItem; register(_constants_mjs__WEBPACK_IMPORTED_MODULE_7__["ACTIVE_HEADER_TYPE"], _activeHeader_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]); register(_constants_mjs__WEBPACK_IMPORTED_MODULE_7__["AREA_TYPE"], _area_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]); register(_constants_mjs__WEBPACK_IMPORTED_MODULE_7__["CELL_TYPE"], _cell_mjs__WEBPACK_IMPORTED_MODULE_10__["default"]); register(_constants_mjs__WEBPACK_IMPORTED_MODULE_7__["CUSTOM_SELECTION_TYPE"], _customSelection_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]); register(_constants_mjs__WEBPACK_IMPORTED_MODULE_7__["FILL_TYPE"], _fill_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]); register(_constants_mjs__WEBPACK_IMPORTED_MODULE_7__["HEADER_TYPE"], _header_mjs__WEBPACK_IMPORTED_MODULE_13__["default"]); /** * @param {string} highlightType The selection type. * @param {object} options The selection options. * @returns {Selection} */ function createHighlight(highlightType, options) { return getItem(highlightType)(_objectSpread({ type: highlightType }, options)); } /***/ }), /***/ "./node_modules/handsontable/selection/highlight/visualSelection.mjs": /*!***************************************************************************!*\ !*** ./node_modules/handsontable/selection/highlight/visualSelection.mjs ***! \***************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var VisualSelection = /*#__PURE__*/function (_Selection) { _inherits(VisualSelection, _Selection); var _super = _createSuper(VisualSelection); function VisualSelection(settings, visualCellRange) { var _this; _classCallCheck(this, VisualSelection); _this = _super.call(this, settings, null); /** * Range of selection visually. Visual representation may have representation in a rendered selection. * * @type {null|CellRange} */ _this.visualCellRange = visualCellRange || null; _this.commit(); return _this; } /** * Adds a cell coords to the selection. * * @param {CellCoords} coords Visual coordinates of a cell. * @returns {VisualSelection} */ _createClass(VisualSelection, [{ key: "add", value: function add(coords) { if (this.visualCellRange === null) { this.visualCellRange = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_15__["CellRange"](coords); } else { this.visualCellRange.expand(coords); } return this; } /** * Clears visual and renderable selection. * * @returns {VisualSelection} */ }, { key: "clear", value: function clear() { this.visualCellRange = null; return _get(_getPrototypeOf(VisualSelection.prototype), "clear", this).call(this); } /** * Search for the first visible coordinates in the range as range may start and/or end with the hidden index. * * @private * @param {CellCoords} startCoords Visual start coordinates for the range. Starting point for finding destination coordinates * with visible coordinates (we are going from the starting coordinates to the end coordinates until the criteria are met). * @param {CellCoords} endCoords Visual end coordinates for the range. * @param {number} incrementByRow We are searching for a next visible rows by increasing (to be precise, or decreasing) indexes. * This variable represent indexes shift. We are looking for an index: * - for rows: from the left to the right (increasing indexes, then variable should have value 1) or * other way around (decreasing indexes, then variable should have the value -1) * - for columns: from the top to the bottom (increasing indexes, then variable should have value 1) * or other way around (decreasing indexes, then variable should have the value -1). * @param {number} incrementByColumn As above, just indexes shift for columns. * @returns {null|CellCoords} Visual cell coordinates. */ }, { key: "findVisibleCoordsInRange", value: function findVisibleCoordsInRange(startCoords, endCoords, incrementByRow) { var incrementByColumn = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : incrementByRow; var nextVisibleRow = this.findVisibleCoordsInRowsRange(startCoords.row, endCoords.row, incrementByRow); // There are no more visual rows in the range. if (nextVisibleRow === null) { return null; } var nextVisibleColumn = this.findVisibleCoordsInColumnsRange(startCoords.col, endCoords.col, incrementByColumn); // There are no more visual columns in the range. if (nextVisibleColumn === null) { return null; } return new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_15__["CellCoords"](nextVisibleRow, nextVisibleColumn); } /** * Searches the nearest visible row index, which is not hidden (is renderable). * * @private * @param {CellCoords} startVisibleRow Visual row index which starts the range. Starting point for finding * destination coordinates with visible coordinates (we are going from the starting coordinates to the end * coordinates until the criteria are met). * @param {CellCoords} endVisibleRow Visual row index which ends the range. * @param {number} incrementBy We are searching for a next visible rows by increasing (to be precise, or decreasing) * indexes. This variable represent indexes shift. From the left to the right (increasing indexes, then variable * should have value 1) or other way around (decreasing indexes, then variable should have the value -1). * @returns {number|null} The visual row index. */ }, { key: "findVisibleCoordsInRowsRange", value: function findVisibleCoordsInRowsRange(startVisibleRow, endVisibleRow, incrementBy) { var _this$settings$visual = this.settings.visualToRenderableCoords({ row: startVisibleRow, col: -1 }), startRowRenderable = _this$settings$visual.row; // There are no more visual rows in the range. if (endVisibleRow === startVisibleRow && startRowRenderable === null) { return null; } // We are looking for a next visible row in the range. if (startRowRenderable === null) { return this.findVisibleCoordsInRowsRange(startVisibleRow + incrementBy, endVisibleRow, incrementBy); } // We found visible row index in the range. return startVisibleRow; } /** * Searches the nearest visible column index, which is not hidden (is renderable). * * @private * @param {CellCoords} startVisibleColumn Visual column index which starts the range. Starting point for finding * destination coordinates with visible coordinates (we are going from the starting coordinates to the end * coordinates until the criteria are met). * @param {CellCoords} endVisibleColumn Visual column index which ends the range. * @param {number} incrementBy We are searching for a next visible columns by increasing (to be precise, or decreasing) * indexes. This variable represent indexes shift. From the top to the bottom (increasing indexes, then variable * should have value 1) or other way around (decreasing indexes, then variable should have the value -1). * @returns {number|null} The visual column index. */ }, { key: "findVisibleCoordsInColumnsRange", value: function findVisibleCoordsInColumnsRange(startVisibleColumn, endVisibleColumn, incrementBy) { var _this$settings$visual2 = this.settings.visualToRenderableCoords({ row: -1, col: startVisibleColumn }), startColumnRenderable = _this$settings$visual2.col; // There are no more visual columns in the range. if (endVisibleColumn === startVisibleColumn && startColumnRenderable === null) { return null; } // We are looking for a next visible column in the range. if (startColumnRenderable === null) { return this.findVisibleCoordsInColumnsRange(startVisibleColumn + incrementBy, endVisibleColumn, incrementBy); } // We found visible column index in the range. return startVisibleColumn; } /** * Searches the nearest visible column and row index, which is not hidden (is renderable). If one * of the axes' range is entirely hidden, then created CellCoords object will hold the `null` value * under a specific axis. For example, when we select the hidden column, then the calculated `col` * prop will be `null`. In that case, rows are calculated further (regardless of the column result) * to make rows header highlightable. * * @private * @param {CellCoords} visualFromCoords Visual start coordinates for the range. Starting point for finding destination coordinates * with visible coordinates (we are going from the starting coordinates to the end coordinates until the criteria are met). * @param {CellCoords} visualToCoords Visual end coordinates for the range. * @param {number} incrementByRow We are searching for a next visible rows by increasing (to be precise, or decreasing) indexes. * This variable represent indexes shift. We are looking for an index: * - for rows: from the left to the right (increasing indexes, then variable should have value 1) or * other way around (decreasing indexes, then variable should have the value -1) * - for columns: from the top to the bottom (increasing indexes, then variable should have value 1) * or other way around (decreasing indexes, then variable should have the value -1). * @param {number} incrementByColumn As above, just indexes shift for columns. * @returns {CellCoords[]|null} Visual cell coordinates. */ }, { key: "findVisibleHeaderRange", value: function findVisibleHeaderRange(visualFromCoords, visualToCoords, incrementByRow, incrementByColumn) { var fromRangeVisualRow = this.findVisibleCoordsInRowsRange(visualFromCoords.row, visualToCoords.row, incrementByRow); var toRangeVisualRow = this.findVisibleCoordsInRowsRange(visualToCoords.row, visualFromCoords.row, -incrementByRow); var fromRangeVisualColumn = this.findVisibleCoordsInColumnsRange(visualFromCoords.col, visualToCoords.col, incrementByColumn); var toRangeVisualColumn = this.findVisibleCoordsInColumnsRange(visualToCoords.col, visualFromCoords.col, -incrementByColumn); // All rows and columns ranges are hidden. if (fromRangeVisualRow === null && toRangeVisualRow === null && fromRangeVisualColumn === null && toRangeVisualColumn === null) { return null; } return [new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_15__["CellCoords"](fromRangeVisualRow, fromRangeVisualColumn), new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_15__["CellCoords"](toRangeVisualRow, toRangeVisualColumn)]; } /** * Override internally stored visual indexes added by the Selection's `add` function. It should be executed * at the end of process of adding visual selection coordinates. * * @returns {VisualSelection} */ }, { key: "commit", value: function commit() { // There is no information about visual ranges, thus no selection may be displayed. if (this.visualCellRange === null) { return this; } var _this$visualCellRange = this.visualCellRange, visualFromCoords = _this$visualCellRange.from, visualToCoords = _this$visualCellRange.to; // We may move in two different directions while searching for visible rows and visible columns. var incrementByRow = this.getRowSearchDirection(this.visualCellRange); var incrementByColumn = this.getColumnSearchDirection(this.visualCellRange); var fromRangeVisual = this.findVisibleCoordsInRange(visualFromCoords, visualToCoords, incrementByRow, incrementByColumn); var toRangeVisual = this.findVisibleCoordsInRange(visualToCoords, visualFromCoords, -incrementByRow, -incrementByColumn); // There is no visual start point (and also visual end point) in the range. // We are looking for the first visible cell in a broader range. if (fromRangeVisual === null || toRangeVisual === null) { var isHeaderSelectionType = this.settings.type === 'header'; var cellRange = null; // For the "header" selection type, find rows and column indexes, which should be // highlighted, although one of the axes is completely hidden. if (isHeaderSelectionType) { var _this$findVisibleHead = this.findVisibleHeaderRange(visualFromCoords, visualToCoords, incrementByRow, incrementByColumn), _this$findVisibleHead2 = _slicedToArray(_this$findVisibleHead, 2), fromRangeVisualHeader = _this$findVisibleHead2[0], toRangeVisualHeader = _this$findVisibleHead2[1]; cellRange = this.createRenderableCellRange(fromRangeVisualHeader, toRangeVisualHeader); } this.cellRange = cellRange; } else { this.cellRange = this.createRenderableCellRange(fromRangeVisual, toRangeVisual); } return this; } /** * Some selection may be a part of broader cell range. This function adjusting coordinates of current selection * and the broader cell range when needed (current selection can't be presented visually). * * @param {CellRange} broaderCellRange Visual range. Actual cell range may be contained in the broader cell range. * When there is no way to represent some cell range visually we try to find range containing just the first visible cell. * * Warn: Please keep in mind that this function may change coordinates of the handled broader range. * * @returns {VisualSelection} */ }, { key: "adjustCoordinates", value: function adjustCoordinates(broaderCellRange) { // We may move in two different directions while searching for visible rows and visible columns. var incrementByRow = this.getRowSearchDirection(broaderCellRange); var incrementByColumn = this.getColumnSearchDirection(broaderCellRange); var normFromCoords = broaderCellRange.from.clone().normalize(); var normToCoords = broaderCellRange.to.clone().normalize(); var singleCellRangeVisual = this.findVisibleCoordsInRange(normFromCoords, normToCoords, incrementByRow, incrementByColumn); if (singleCellRangeVisual !== null) { // We can't show selection visually now, but we found fist visible range in the broader cell range. if (this.cellRange === null) { var singleCellRangeRenderable = this.settings.visualToRenderableCoords(singleCellRangeVisual); this.cellRange = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_15__["CellRange"](singleCellRangeRenderable); } // We set new highlight as it might change (for example, when showing/hiding some cells from the broader selection range) // TODO: It is also handled by the `MergeCells` plugin while adjusting already modified coordinates. Should it? broaderCellRange.setHighlight(singleCellRangeVisual); return this; } // Fallback to the start of the range. It resets the previous highlight (for example, when all columns have been hidden). broaderCellRange.setHighlight(broaderCellRange.from); return this; } /** * Returns the top left (TL) and bottom right (BR) selection coordinates (renderable indexes). * The method overwrites the original method to support header selection for hidden cells. * To make the header selection working, the CellCoords and CellRange have to support not * complete coordinates (`null` values for example, `row: null`, `col: 2`). * * @returns {Array} Returns array of coordinates for example `[1, 1, 5, 5]`. */ }, { key: "getCorners", value: function getCorners() { var _this$cellRange = this.cellRange, from = _this$cellRange.from, to = _this$cellRange.to; var isRowUndefined = from.row === null || to.row === null; var isColumnUndefined = from.col === null || to.col === null; var topLeftCorner = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_15__["CellCoords"](isRowUndefined ? null : Math.min(from.row, to.row), isColumnUndefined ? null : Math.min(from.col, to.col)); var bottomRightCorner = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_15__["CellCoords"](isRowUndefined ? null : Math.max(from.row, to.row), isColumnUndefined ? null : Math.max(from.col, to.col)); return [topLeftCorner.row, topLeftCorner.col, bottomRightCorner.row, bottomRightCorner.col]; } /** * Returns the top left (TL) and bottom right (BR) selection coordinates (visual indexes). * * @returns {Array} Returns array of coordinates for example `[1, 1, 5, 5]`. */ }, { key: "getVisualCorners", value: function getVisualCorners() { var topLeft = this.settings.renderableToVisualCoords(this.cellRange.getTopLeftCorner()); var bottomRight = this.settings.renderableToVisualCoords(this.cellRange.getBottomRightCorner()); return [topLeft.row, topLeft.col, bottomRight.row, bottomRight.col]; } /** * Creates a new CellRange object based on visual coordinates which before object creation are * translated to renderable indexes. * * @param {CellCoords} visualFromCoords The CellCoords object which contains coordinates that * points to the begining of the selection. * @param {CellCoords} visualToCoords The CellCoords object which contains coordinates that * points to the end of the selection. * @returns {CellRange} */ }, { key: "createRenderableCellRange", value: function createRenderableCellRange(visualFromCoords, visualToCoords) { var renderableFromCoords = this.settings.visualToRenderableCoords(visualFromCoords); var renderableToCoords = this.settings.visualToRenderableCoords(visualToCoords); return new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_15__["CellRange"](renderableFromCoords, renderableFromCoords, renderableToCoords); } /** * It returns rows shift needed for searching visual row. * * @private * @param {CellRange} cellRange Selection range. * @returns {number} Rows shift. It return 1 when we should increase indexes (moving from the top to the bottom) or * -1 when we should decrease indexes (moving other way around). */ }, { key: "getRowSearchDirection", value: function getRowSearchDirection(cellRange) { if (cellRange.from.row < cellRange.to.row) { return 1; // Increasing row indexes. } return -1; // Decreasing row indexes. } /** * It returns columns shift needed for searching visual column. * * @private * @param {CellRange} cellRange Selection range. * @returns {number} Columns shift. It return 1 when we should increase indexes (moving from the left to the right) or * -1 when we should decrease indexes (moving other way around). */ }, { key: "getColumnSearchDirection", value: function getColumnSearchDirection(cellRange) { if (cellRange.from.col < cellRange.to.col) { return 1; // Increasing column indexes. } return -1; // Decreasing column indexes. } }]); return VisualSelection; }(_3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_15__["Selection"]); /* harmony default export */ __webpack_exports__["default"] = (VisualSelection); /***/ }), /***/ "./node_modules/handsontable/selection/index.mjs": /*!*******************************************************!*\ !*** ./node_modules/handsontable/selection/index.mjs ***! \*******************************************************/ /*! exports provided: ACTIVE_HEADER_TYPE, AREA_TYPE, CELL_TYPE, FILL_TYPE, HEADER_TYPE, CUSTOM_SELECTION_TYPE, handleMouseEvent, Highlight, Selection, detectSelectionType, normalizeSelectionFactory */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _highlight_highlight_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./highlight/highlight.mjs */ "./node_modules/handsontable/selection/highlight/highlight.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Highlight", function() { return _highlight_highlight_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]; }); /* harmony import */ var _selection_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selection.mjs */ "./node_modules/handsontable/selection/selection.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return _selection_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]; }); /* harmony import */ var _mouseEventHandler_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mouseEventHandler.mjs */ "./node_modules/handsontable/selection/mouseEventHandler.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "handleMouseEvent", function() { return _mouseEventHandler_mjs__WEBPACK_IMPORTED_MODULE_2__["handleMouseEvent"]; }); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/handsontable/selection/utils.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "detectSelectionType", function() { return _utils_mjs__WEBPACK_IMPORTED_MODULE_3__["detectSelectionType"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeSelectionFactory", function() { return _utils_mjs__WEBPACK_IMPORTED_MODULE_3__["normalizeSelectionFactory"]; }); /* harmony import */ var _highlight_constants_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./highlight/constants.mjs */ "./node_modules/handsontable/selection/highlight/constants.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ACTIVE_HEADER_TYPE", function() { return _highlight_constants_mjs__WEBPACK_IMPORTED_MODULE_4__["ACTIVE_HEADER_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AREA_TYPE", function() { return _highlight_constants_mjs__WEBPACK_IMPORTED_MODULE_4__["AREA_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CELL_TYPE", function() { return _highlight_constants_mjs__WEBPACK_IMPORTED_MODULE_4__["CELL_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FILL_TYPE", function() { return _highlight_constants_mjs__WEBPACK_IMPORTED_MODULE_4__["FILL_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HEADER_TYPE", function() { return _highlight_constants_mjs__WEBPACK_IMPORTED_MODULE_4__["HEADER_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CUSTOM_SELECTION_TYPE", function() { return _highlight_constants_mjs__WEBPACK_IMPORTED_MODULE_4__["CUSTOM_SELECTION_TYPE"]; }); /***/ }), /***/ "./node_modules/handsontable/selection/mouseEventHandler.mjs": /*!*******************************************************************!*\ !*** ./node_modules/handsontable/selection/mouseEventHandler.mjs ***! \*******************************************************************/ /*! exports provided: mouseDown, mouseOver, handleMouseEvent */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mouseDown", function() { return mouseDown; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mouseOver", function() { return mouseOver; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleMouseEvent", function() { return handleMouseEvent; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../helpers/dom/event.mjs */ "./node_modules/handsontable/helpers/dom/event.mjs"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); /** * MouseDown handler. * * @param {object} options The handler options. * @param {boolean} options.isShiftKey The flag which indicates if the shift key is pressed. * @param {boolean} options.isLeftClick The flag which indicates if the left mouse button is pressed. * @param {boolean} options.isRightClick The flag which indicates if the right mouse button is pressed. * @param {CellRange} options.coords The CellCoords object with defined visual coordinates. * @param {Selection} options.selection The Selection class instance. * @param {object} options.controller An object with keys `row`, `column`, `cell` which indicate what * operation will be performed in later selection stages. */ function mouseDown(_ref) { var isShiftKey = _ref.isShiftKey, isLeftClick = _ref.isLeftClick, isRightClick = _ref.isRightClick, coords = _ref.coords, selection = _ref.selection, controller = _ref.controller; var currentSelection = selection.isSelected() ? selection.getSelectedRange().current() : null; var selectedCorner = selection.isSelectedByCorner(); var selectedRow = selection.isSelectedByRowHeader(); if (isShiftKey && currentSelection) { if (coords.row >= 0 && coords.col >= 0 && !controller.cells) { selection.setRangeEnd(coords); } else if ((selectedCorner || selectedRow) && coords.row >= 0 && coords.col >= 0 && !controller.cells) { selection.setRangeEnd(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_6__["CellCoords"](coords.row, coords.col)); } else if (selectedCorner && coords.row < 0 && !controller.column) { selection.setRangeEnd(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_6__["CellCoords"](currentSelection.to.row, coords.col)); } else if (selectedRow && coords.col < 0 && !controller.row) { selection.setRangeEnd(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_6__["CellCoords"](coords.row, currentSelection.to.col)); } else if ((!selectedCorner && !selectedRow && coords.col < 0 || selectedCorner && coords.col < 0) && !controller.row) { selection.selectRows(Math.max(currentSelection.from.row, 0), coords.row, coords.col); } else if ((!selectedCorner && !selectedRow && coords.row < 0 || selectedRow && coords.row < 0) && !controller.column) { selection.selectColumns(Math.max(currentSelection.from.col, 0), coords.col, coords.row); } } else { var allowRightClickSelection = !selection.inInSelection(coords); var performSelection = isLeftClick || isRightClick && allowRightClickSelection; // clicked row header and when some column was selected if (coords.row < 0 && coords.col >= 0 && !controller.column) { if (performSelection) { selection.selectColumns(coords.col, coords.col, coords.row); } // clicked column header and when some row was selected } else if (coords.col < 0 && coords.row >= 0 && !controller.row) { if (performSelection) { selection.selectRows(coords.row, coords.row, coords.col); } } else if (coords.col >= 0 && coords.row >= 0 && !controller.cells) { if (performSelection) { selection.setRangeStart(coords); } } else if (coords.col < 0 && coords.row < 0) { selection.selectAll(true, true); } } } /** * MouseOver handler. * * @param {object} options The handler options. * @param {boolean} options.isLeftClick Indicates that event was fired using the left mouse button. * @param {CellRange} options.coords The CellCoords object with defined visual coordinates. * @param {Selection} options.selection The Selection class instance. * @param {object} options.controller An object with keys `row`, `column`, `cell` which indicate what * operation will be performed in later selection stages. */ function mouseOver(_ref2) { var isLeftClick = _ref2.isLeftClick, coords = _ref2.coords, selection = _ref2.selection, controller = _ref2.controller; if (!isLeftClick) { return; } var selectedRow = selection.isSelectedByRowHeader(); var selectedColumn = selection.isSelectedByColumnHeader(); var countCols = selection.tableProps.countCols(); var countRows = selection.tableProps.countRows(); if (selectedColumn && !controller.column) { selection.setRangeEnd(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_6__["CellCoords"](countRows - 1, coords.col)); } else if (selectedRow && !controller.row) { selection.setRangeEnd(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_6__["CellCoords"](coords.row, countCols - 1)); } else if (!controller.cell) { selection.setRangeEnd(coords); } } var handlers = new Map([['mousedown', mouseDown], ['mouseover', mouseOver], ['touchstart', mouseDown]]); /** * Mouse handler for selection functionality. * * @param {Event} event An native event to handle. * @param {object} options The handler options. * @param {CellRange} options.coords The CellCoords object with defined visual coordinates. * @param {Selection} options.selection The Selection class instance. * @param {object} options.controller An object with keys `row`, `column`, `cell` which indicate what * operation will be performed in later selection stages. */ function handleMouseEvent(event, _ref3) { var coords = _ref3.coords, selection = _ref3.selection, controller = _ref3.controller; handlers.get(event.type)({ coords: coords, selection: selection, controller: controller, isShiftKey: event.shiftKey, isLeftClick: Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_5__["isLeftClick"])(event) || event.type === 'touchstart', isRightClick: Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_5__["isRightClick"])(event) }); } /***/ }), /***/ "./node_modules/handsontable/selection/range.mjs": /*!*******************************************************!*\ !*** ./node_modules/handsontable/selection/range.mjs ***! \*******************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * The SelectionRange class is a simple CellRanges collection designed for easy manipulation of the multiple * consecutive and non-consecutive selections. * * @class SelectionRange * @util */ var SelectionRange = /*#__PURE__*/function () { function SelectionRange() { _classCallCheck(this, SelectionRange); /** * List of all CellRanges added to the class instance. * * @type {CellRange[]} */ this.ranges = []; } /** * Check if selected range is empty. * * @returns {boolean} */ _createClass(SelectionRange, [{ key: "isEmpty", value: function isEmpty() { return this.size() === 0; } /** * Set coordinates to the class instance. It clears all previously added coordinates and push `coords` * to the collection. * * @param {CellCoords} coords The CellCoords instance with defined visual coordinates. * @returns {SelectionRange} */ }, { key: "set", value: function set(coords) { this.clear(); this.ranges.push(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_9__["CellRange"](coords)); return this; } /** * Add coordinates to the class instance. The new coordinates are added to the end of the range collection. * * @param {CellCoords} coords The CellCoords instance with defined visual coordinates. * @returns {SelectionRange} */ }, { key: "add", value: function add(coords) { this.ranges.push(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_9__["CellRange"](coords)); return this; } /** * Removes from the stack the last added coordinates. * * @returns {SelectionRange} */ }, { key: "pop", value: function pop() { this.ranges.pop(); return this; } /** * Get last added coordinates from ranges, it returns a CellRange instance. * * @returns {CellRange|undefined} */ }, { key: "current", value: function current() { return this.peekByIndex(0); } /** * Get previously added coordinates from ranges, it returns a CellRange instance. * * @returns {CellRange|undefined} */ }, { key: "previous", value: function previous() { return this.peekByIndex(-1); } /** * Returns `true` if coords is within selection coords. This method iterates through all selection layers to check if * the coords object is within selection range. * * @param {CellCoords} coords The CellCoords instance with defined visual coordinates. * @returns {boolean} */ }, { key: "includes", value: function includes(coords) { return this.ranges.some(function (cellRange) { return cellRange.includes(coords); }); } /** * Clear collection. * * @returns {SelectionRange} */ }, { key: "clear", value: function clear() { this.ranges.length = 0; return this; } /** * Get count of added all coordinates added to the selection. * * @returns {number} */ }, { key: "size", value: function size() { return this.ranges.length; } /** * Peek the coordinates based on the offset where that coordinate resides in the collection. * * @param {number} [offset=0] An offset where the coordinate will be retrieved from. * @returns {CellRange|undefined} */ }, { key: "peekByIndex", value: function peekByIndex() { var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var rangeIndex = this.size() + offset - 1; var cellRange; if (rangeIndex >= 0) { cellRange = this.ranges[rangeIndex]; } return cellRange; } }, { key: Symbol.iterator, value: function value() { return this.ranges[Symbol.iterator](); } }]); return SelectionRange; }(); /* harmony default export */ __webpack_exports__["default"] = (SelectionRange); /***/ }), /***/ "./node_modules/handsontable/selection/selection.mjs": /*!***********************************************************!*\ !*** ./node_modules/handsontable/selection/selection.mjs ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_object_freeze_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.freeze.js */ "./node_modules/core-js/modules/es.object.freeze.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_number_is_integer_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.number.is-integer.js */ "./node_modules/core-js/modules/es.number.is-integer.js"); /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.number.constructor.js */ "./node_modules/core-js/modules/es.number.constructor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var _highlight_highlight_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./highlight/highlight.mjs */ "./node_modules/handsontable/selection/highlight/highlight.mjs"); /* harmony import */ var _highlight_constants_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./highlight/constants.mjs */ "./node_modules/handsontable/selection/highlight/constants.mjs"); /* harmony import */ var _range_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./range.mjs */ "./node_modules/handsontable/selection/range.mjs"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); /* harmony import */ var _utils_keyStateObserver_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./../utils/keyStateObserver.mjs */ "./node_modules/handsontable/utils/keyStateObserver.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./../mixins/localHooks.mjs */ "./node_modules/handsontable/mixins/localHooks.mjs"); /* harmony import */ var _transformation_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./transformation.mjs */ "./node_modules/handsontable/selection/transformation.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/handsontable/selection/utils.mjs"); /* harmony import */ var _helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./../helpers/templateLiteralTag.mjs */ "./node_modules/handsontable/helpers/templateLiteralTag.mjs"); var _templateObject; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } 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"); } } 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; } /** * @class Selection * @util */ var Selection = /*#__PURE__*/function () { function Selection(settings, tableProps) { var _this = this; _classCallCheck(this, Selection); /** * Handsontable settings instance. * * @type {GridSettings} */ this.settings = settings; /** * An additional object with dynamically defined properties which describes table state. * * @type {object} */ this.tableProps = tableProps; /** * The flag which determines if the selection is in progress. * * @type {boolean} */ this.inProgress = false; /** * The flag indicates that selection was performed by clicking the corner overlay. * * @type {boolean} */ this.selectedByCorner = false; /** * The collection of the selection layer levels where the whole row was selected using the row header or * the corner header. * * @type {Set.} */ this.selectedByRowHeader = new Set(); /** * The collection of the selection layer levels where the whole column was selected using the column header or * the corner header. * * @type {Set.} */ this.selectedByColumnHeader = new Set(); /** * Selection data layer (handle visual coordinates). * * @type {SelectionRange} */ this.selectedRange = new _range_mjs__WEBPACK_IMPORTED_MODULE_20__["default"](); /** * Visualization layer. * * @type {Highlight} */ this.highlight = new _highlight_highlight_mjs__WEBPACK_IMPORTED_MODULE_18__["default"]({ headerClassName: settings.currentHeaderClassName, activeHeaderClassName: settings.activeHeaderClassName, rowClassName: settings.currentRowClassName, columnClassName: settings.currentColClassName, disabledCellSelection: function disabledCellSelection(row, column) { return _this.tableProps.isDisabledCellSelection(row, column); }, cellCornerVisible: function cellCornerVisible() { return _this.isCellCornerVisible.apply(_this, arguments); }, areaCornerVisible: function areaCornerVisible() { return _this.isAreaCornerVisible.apply(_this, arguments); }, visualToRenderableCoords: function visualToRenderableCoords(coords) { return _this.tableProps.visualToRenderableCoords(coords); }, renderableToVisualCoords: function renderableToVisualCoords(coords) { return _this.tableProps.renderableToVisualCoords(coords); } }); /** * The module for modifying coordinates. * * @type {Transformation} */ this.transformation = new _transformation_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](this.selectedRange, { countRows: function countRows() { return _this.tableProps.countRowsTranslated(); }, countCols: function countCols() { return _this.tableProps.countColsTranslated(); }, visualToRenderableCoords: function visualToRenderableCoords(coords) { return _this.tableProps.visualToRenderableCoords(coords); }, renderableToVisualCoords: function renderableToVisualCoords(coords) { return _this.tableProps.renderableToVisualCoords(coords); }, fixedRowsBottom: function fixedRowsBottom() { return settings.fixedRowsBottom; }, minSpareRows: function minSpareRows() { return settings.minSpareRows; }, minSpareCols: function minSpareCols() { return settings.minSpareCols; }, autoWrapRow: function autoWrapRow() { return settings.autoWrapRow; }, autoWrapCol: function autoWrapCol() { return settings.autoWrapCol; } }); this.transformation.addLocalHook('beforeTransformStart', function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _this.runLocalHooks.apply(_this, ['beforeModifyTransformStart'].concat(args)); }); this.transformation.addLocalHook('afterTransformStart', function () { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return _this.runLocalHooks.apply(_this, ['afterModifyTransformStart'].concat(args)); }); this.transformation.addLocalHook('beforeTransformEnd', function () { for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } return _this.runLocalHooks.apply(_this, ['beforeModifyTransformEnd'].concat(args)); }); this.transformation.addLocalHook('afterTransformEnd', function () { for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } return _this.runLocalHooks.apply(_this, ['afterModifyTransformEnd'].concat(args)); }); this.transformation.addLocalHook('insertRowRequire', function () { for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { args[_key5] = arguments[_key5]; } return _this.runLocalHooks.apply(_this, ['insertRowRequire'].concat(args)); }); this.transformation.addLocalHook('insertColRequire', function () { for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { args[_key6] = arguments[_key6]; } return _this.runLocalHooks.apply(_this, ['insertColRequire'].concat(args)); }); } /** * Get data layer for current selection. * * @returns {SelectionRange} */ _createClass(Selection, [{ key: "getSelectedRange", value: function getSelectedRange() { return this.selectedRange; } /** * Indicate that selection process began. It sets internaly `.inProgress` property to `true`. */ }, { key: "begin", value: function begin() { this.inProgress = true; } /** * Indicate that selection process finished. It sets internaly `.inProgress` property to `false`. */ }, { key: "finish", value: function finish() { this.runLocalHooks('afterSelectionFinished', Array.from(this.selectedRange)); this.inProgress = false; } /** * Check if the process of selecting the cell/cells is in progress. * * @returns {boolean} */ }, { key: "isInProgress", value: function isInProgress() { return this.inProgress; } /** * Starts selection range on given coordinate object. * * @param {CellCoords} coords Visual coords. * @param {boolean} [multipleSelection] If `true`, selection will be worked in 'multiple' mode. This option works * only when 'selectionMode' is set as 'multiple'. If the argument is not defined * the default trigger will be used (isPressedCtrlKey() helper). * @param {boolean} [fragment=false] If `true`, the selection will be treated as a partial selection where the * `setRangeEnd` method won't be called on every `setRangeStart` call. */ }, { key: "setRangeStart", value: function setRangeStart(coords, multipleSelection) { var fragment = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var isMultipleMode = this.settings.selectionMode === 'multiple'; var isMultipleSelection = Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_24__["isUndefined"])(multipleSelection) ? Object(_utils_keyStateObserver_mjs__WEBPACK_IMPORTED_MODULE_22__["isPressedCtrlKey"])() : multipleSelection; var isRowNegative = coords.row < 0; var isColumnNegative = coords.col < 0; var selectedByCorner = isRowNegative && isColumnNegative; this.selectedByCorner = selectedByCorner; this.runLocalHooks("beforeSetRangeStart".concat(fragment ? 'Only' : ''), coords); if (!isMultipleMode || isMultipleMode && !isMultipleSelection && Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_24__["isUndefined"])(multipleSelection)) { this.selectedRange.clear(); } this.selectedRange.add(coords); if (this.getLayerLevel() === 0) { this.selectedByRowHeader.clear(); this.selectedByColumnHeader.clear(); } if (!selectedByCorner && isColumnNegative) { this.selectedByRowHeader.add(this.getLayerLevel()); } if (!selectedByCorner && isRowNegative) { this.selectedByColumnHeader.add(this.getLayerLevel()); } if (!fragment) { this.setRangeEnd(coords); } } /** * Starts selection range on given coordinate object. * * @param {CellCoords} coords Visual coords. * @param {boolean} [multipleSelection] If `true`, selection will be worked in 'multiple' mode. This option works * only when 'selectionMode' is set as 'multiple'. If the argument is not defined * the default trigger will be used (isPressedCtrlKey() helper). */ }, { key: "setRangeStartOnly", value: function setRangeStartOnly(coords, multipleSelection) { this.setRangeStart(coords, multipleSelection, true); } /** * Ends selection range on given coordinate object. * * @param {CellCoords} coords Visual coords. */ }, { key: "setRangeEnd", value: function setRangeEnd(coords) { if (this.selectedRange.isEmpty()) { return; } this.runLocalHooks('beforeSetRangeEnd', coords); this.begin(); var cellRange = this.selectedRange.current(); if (this.settings.selectionMode !== 'single') { cellRange.setTo(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](coords.row, coords.col)); } // Set up current selection. this.highlight.getCell().clear(); if (this.highlight.isEnabledFor(_highlight_constants_mjs__WEBPACK_IMPORTED_MODULE_19__["CELL_TYPE"], cellRange.highlight)) { this.highlight.getCell().add(this.selectedRange.current().highlight).commit().adjustCoordinates(cellRange); } var layerLevel = this.getLayerLevel(); // If the next layer level is lower than previous then clear all area and header highlights. This is the // indication that the new selection is performing. if (layerLevel < this.highlight.layerLevel) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_25__["arrayEach"])(this.highlight.getAreas(), function (highlight) { return void highlight.clear(); }); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_25__["arrayEach"])(this.highlight.getHeaders(), function (highlight) { return void highlight.clear(); }); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_25__["arrayEach"])(this.highlight.getActiveHeaders(), function (highlight) { return void highlight.clear(); }); } this.highlight.useLayerLevel(layerLevel); var areaHighlight = this.highlight.createOrGetArea(); var headerHighlight = this.highlight.createOrGetHeader(); var activeHeaderHighlight = this.highlight.createOrGetActiveHeader(); areaHighlight.clear(); headerHighlight.clear(); activeHeaderHighlight.clear(); if (this.highlight.isEnabledFor(_highlight_constants_mjs__WEBPACK_IMPORTED_MODULE_19__["AREA_TYPE"], cellRange.highlight) && (this.isMultiple() || layerLevel >= 1)) { areaHighlight.add(cellRange.from).add(cellRange.to).commit(); if (layerLevel === 1) { // For single cell selection in the same layer, we do not create area selection to prevent blue background. // When non-consecutive selection is performed we have to add that missing area selection to the previous layer // based on previous coordinates. It only occurs when the previous selection wasn't select multiple cells. var previousRange = this.selectedRange.previous(); this.highlight.useLayerLevel(layerLevel - 1).createOrGetArea().add(previousRange.from).commit() // Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords). .adjustCoordinates(previousRange); this.highlight.useLayerLevel(layerLevel); } } if (this.highlight.isEnabledFor(_highlight_constants_mjs__WEBPACK_IMPORTED_MODULE_19__["HEADER_TYPE"], cellRange.highlight)) { // The header selection generally contains cell selection. In a case when all rows (or columns) // are hidden that visual coordinates are translated to renderable coordinates that do not exist. // Hence no header highlight is generated. In that case, to make a column (or a row) header // highlight, the row and column index has to point to the header (the negative value). See #7052. var areAnyRowsRendered = this.tableProps.countRowsTranslated() === 0; var areAnyColumnsRendered = this.tableProps.countColsTranslated() === 0; var headerCellRange = cellRange; if (areAnyRowsRendered || areAnyColumnsRendered) { headerCellRange = cellRange.clone(); } if (areAnyRowsRendered) { headerCellRange.from.row = -1; } if (areAnyColumnsRendered) { headerCellRange.from.col = -1; } if (this.settings.selectionMode === 'single') { if (this.isSelectedByAnyHeader()) { headerCellRange.from.normalize(); } headerHighlight.add(headerCellRange.from).commit(); } else { headerHighlight.add(headerCellRange.from).add(headerCellRange.to).commit(); } if (this.isEntireRowSelected()) { var isRowSelected = this.tableProps.countCols() === cellRange.getWidth(); // Make sure that the whole row is selected (in case where selectionMode is set to 'single') if (isRowSelected) { activeHeaderHighlight.add(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](cellRange.from.row, -1)).add(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](cellRange.to.row, -1)).commit(); } } if (this.isEntireColumnSelected()) { var isColumnSelected = this.tableProps.countRows() === cellRange.getHeight(); // Make sure that the whole column is selected (in case where selectionMode is set to 'single') if (isColumnSelected) { activeHeaderHighlight.add(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](-1, cellRange.from.col)).add(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](-1, cellRange.to.col)).commit(); } } } this.runLocalHooks('afterSetRangeEnd', coords); } /** * Returns information if we have a multiselection. This method check multiselection only on the latest layer of * the selection. * * @returns {boolean} */ }, { key: "isMultiple", value: function isMultiple() { var isMultipleListener = Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["createObjectPropListener"])(!this.selectedRange.current().isSingle()); this.runLocalHooks('afterIsMultipleSelection', isMultipleListener); return isMultipleListener.value; } /** * Selects cell relative to the current cell (if possible). * * @param {number} rowDelta Rows number to move, value can be passed as negative number. * @param {number} colDelta Columns number to move, value can be passed as negative number. * @param {boolean} force If `true` the new rows/columns will be created if necessary. Otherwise, row/column will * be created according to `minSpareRows/minSpareCols` settings of Handsontable. */ }, { key: "transformStart", value: function transformStart(rowDelta, colDelta, force) { this.setRangeStart(this.transformation.transformStart(rowDelta, colDelta, force)); } /** * Sets selection end cell relative to the current selection end cell (if possible). * * @param {number} rowDelta Rows number to move, value can be passed as negative number. * @param {number} colDelta Columns number to move, value can be passed as negative number. */ }, { key: "transformEnd", value: function transformEnd(rowDelta, colDelta) { this.setRangeEnd(this.transformation.transformEnd(rowDelta, colDelta)); } /** * Returns currently used layer level. * * @returns {number} Returns layer level starting from 0. If no selection was added to the table -1 is returned. */ }, { key: "getLayerLevel", value: function getLayerLevel() { return this.selectedRange.size() - 1; } /** * Returns `true` if currently there is a selection on the screen, `false` otherwise. * * @returns {boolean} */ }, { key: "isSelected", value: function isSelected() { return !this.selectedRange.isEmpty(); } /** * Returns `true` if the selection was applied by clicking to the row header. If the `layerLevel` * argument is passed then only that layer will be checked. Otherwise, it checks if any row header * was clicked on any selection layer level. * * @param {number} [layerLevel=this.getLayerLevel()] Selection layer level to check. * @returns {boolean} */ }, { key: "isSelectedByRowHeader", value: function isSelectedByRowHeader() { var layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel(); return !this.isSelectedByCorner(layerLevel) && this.isEntireRowSelected(layerLevel); } /** * Returns `true` if the selection consists of entire rows (including their headers). If the `layerLevel` * argument is passed then only that layer will be checked. Otherwise, it checks the selection for all layers. * * @param {number} [layerLevel=this.getLayerLevel()] Selection layer level to check. * @returns {boolean} */ }, { key: "isEntireRowSelected", value: function isEntireRowSelected() { var layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel(); return layerLevel === -1 ? this.selectedByRowHeader.size > 0 : this.selectedByRowHeader.has(layerLevel); } /** * Returns `true` if the selection was applied by clicking to the column header. If the `layerLevel` * argument is passed then only that layer will be checked. Otherwise, it checks if any column header * was clicked on any selection layer level. * * @param {number} [layerLevel=this.getLayerLevel()] Selection layer level to check. * @returns {boolean} */ }, { key: "isSelectedByColumnHeader", value: function isSelectedByColumnHeader() { var layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel(); return !this.isSelectedByCorner() && this.isEntireColumnSelected(layerLevel); } /** * Returns `true` if the selection consists of entire columns (including their headers). If the `layerLevel` * argument is passed then only that layer will be checked. Otherwise, it checks the selection for all layers. * * @param {number} [layerLevel=this.getLayerLevel()] Selection layer level to check. * @returns {boolean} */ }, { key: "isEntireColumnSelected", value: function isEntireColumnSelected() { var layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel(); return layerLevel === -1 ? this.selectedByColumnHeader.size > 0 : this.selectedByColumnHeader.has(layerLevel); } /** * Returns `true` if the selection was applied by clicking on the row or column header on any layer level. * * @returns {boolean} */ }, { key: "isSelectedByAnyHeader", value: function isSelectedByAnyHeader() { return this.isSelectedByRowHeader(-1) || this.isSelectedByColumnHeader(-1) || this.isSelectedByCorner(); } /** * Returns `true` if the selection was applied by clicking on the left-top corner overlay. * * @returns {boolean} */ }, { key: "isSelectedByCorner", value: function isSelectedByCorner() { return this.selectedByCorner; } /** * Returns `true` if coords is within selection coords. This method iterates through all selection layers to check if * the coords object is within selection range. * * @param {CellCoords} coords The CellCoords instance with defined visual coordinates. * @returns {boolean} */ }, { key: "inInSelection", value: function inInSelection(coords) { return this.selectedRange.includes(coords); } /** * Returns `true` if the cell corner should be visible. * * @private * @returns {boolean} `true` if the corner element has to be visible, `false` otherwise. */ }, { key: "isCellCornerVisible", value: function isCellCornerVisible() { return this.settings.fillHandle && !this.tableProps.isEditorOpened() && !this.isMultiple(); } /** * Returns `true` if the area corner should be visible. * * @param {number} layerLevel The layer level. * @returns {boolean} `true` if the corner element has to be visible, `false` otherwise. */ }, { key: "isAreaCornerVisible", value: function isAreaCornerVisible(layerLevel) { if (Number.isInteger(layerLevel) && layerLevel !== this.getLayerLevel()) { return false; } return this.settings.fillHandle && !this.tableProps.isEditorOpened() && this.isMultiple(); } /** * Clear the selection by resetting the collected ranges and highlights. */ }, { key: "clear", value: function clear() { // TODO: collections selectedByColumnHeader and selectedByRowHeader should be clear too. this.selectedRange.clear(); this.highlight.clear(); } /** * Deselects all selected cells. */ }, { key: "deselect", value: function deselect() { if (!this.isSelected()) { return; } this.inProgress = false; this.clear(); this.runLocalHooks('afterDeselect'); } /** * Select all cells. * * @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers, `false` * otherwise. * @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column headers, `false` * otherwise. */ }, { key: "selectAll", value: function selectAll() { var includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var nrOfRows = this.tableProps.countRows(); var nrOfColumns = this.tableProps.countCols(); // We can't select cells when there is no data. if (!includeRowHeaders && !includeColumnHeaders && (nrOfRows === 0 || nrOfColumns === 0)) { return; } var startCoords = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](includeColumnHeaders ? -1 : 0, includeRowHeaders ? -1 : 0); this.clear(); this.setRangeStartOnly(startCoords); this.selectedByRowHeader.add(this.getLayerLevel()); this.selectedByColumnHeader.add(this.getLayerLevel()); this.setRangeEnd(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](nrOfRows - 1, nrOfColumns - 1)); this.finish(); } /** * Make multiple, non-contiguous selection specified by `row` and `column` values or a range of cells * finishing at `endRow`, `endColumn`. The method supports two input formats, first as an array of arrays such * as `[[rowStart, columnStart, rowEnd, columnEnd]]` and second format as an array of CellRange objects. * If the passed ranges have another format the exception will be thrown. * * @param {Array[]|CellRange[]} selectionRanges The coordinates which define what the cells should be selected. * @returns {boolean} Returns `true` if selection was successful, `false` otherwise. */ }, { key: "selectCells", value: function selectCells(selectionRanges) { var _this2 = this; var selectionType = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_28__["detectSelectionType"])(selectionRanges); if (selectionType === _utils_mjs__WEBPACK_IMPORTED_MODULE_28__["SELECTION_TYPE_EMPTY"]) { return false; } else if (selectionType === _utils_mjs__WEBPACK_IMPORTED_MODULE_28__["SELECTION_TYPE_UNRECOGNIZED"]) { throw new Error(Object(_helpers_templateLiteralTag_mjs__WEBPACK_IMPORTED_MODULE_29__["toSingleLine"])(_templateObject || (_templateObject = _taggedTemplateLiteral(["Unsupported format of the selection ranges was passed. To select cells pass \n the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd, \n columnEnd/columnPropEnd]]) or as an array of CellRange objects."], ["Unsupported format of the selection ranges was passed. To select cells pass\\x20\n the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\\x20\n columnEnd/columnPropEnd]]) or as an array of CellRange objects."])))); } var selectionSchemaNormalizer = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_28__["normalizeSelectionFactory"])(selectionType, { propToCol: function propToCol(prop) { return _this2.tableProps.propToCol(prop); }, keepDirection: true }); var nrOfRows = this.tableProps.countRows(); var nrOfColumns = this.tableProps.countCols(); // Check if every layer of the coordinates are valid. var isValid = !selectionRanges.some(function (selection) { var _selectionSchemaNorma = selectionSchemaNormalizer(selection), _selectionSchemaNorma2 = _slicedToArray(_selectionSchemaNorma, 4), rowStart = _selectionSchemaNorma2[0], columnStart = _selectionSchemaNorma2[1], rowEnd = _selectionSchemaNorma2[2], columnEnd = _selectionSchemaNorma2[3]; var _isValid = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_28__["isValidCoord"])(rowStart, nrOfRows) && Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_28__["isValidCoord"])(columnStart, nrOfColumns) && Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_28__["isValidCoord"])(rowEnd, nrOfRows) && Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_28__["isValidCoord"])(columnEnd, nrOfColumns); return !_isValid; }); if (isValid) { this.clear(); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_25__["arrayEach"])(selectionRanges, function (selection) { var _selectionSchemaNorma3 = selectionSchemaNormalizer(selection), _selectionSchemaNorma4 = _slicedToArray(_selectionSchemaNorma3, 4), rowStart = _selectionSchemaNorma4[0], columnStart = _selectionSchemaNorma4[1], rowEnd = _selectionSchemaNorma4[2], columnEnd = _selectionSchemaNorma4[3]; _this2.setRangeStartOnly(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](rowStart, columnStart), false); _this2.setRangeEnd(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](rowEnd, columnEnd)); _this2.finish(); }); } return isValid; } /** * Select column specified by `startColumn` visual index or column property or a range of columns finishing at * `endColumn`. * * @param {number|string} startColumn Visual column index or column property from which the selection starts. * @param {number|string} [endColumn] Visual column index or column property from to the selection finishes. * @param {number} [headerLevel=-1] A row header index that triggers the column selection. The value can * take -1 to -N, where -1 means the header closest to the cells. * * @returns {boolean} Returns `true` if selection was successful, `false` otherwise. */ }, { key: "selectColumns", value: function selectColumns(startColumn) { var endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn; var headerLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1; var start = typeof startColumn === 'string' ? this.tableProps.propToCol(startColumn) : startColumn; var end = typeof endColumn === 'string' ? this.tableProps.propToCol(endColumn) : endColumn; var nrOfColumns = this.tableProps.countCols(); var nrOfRows = this.tableProps.countRows(); var isValid = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_28__["isValidCoord"])(start, nrOfColumns) && Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_28__["isValidCoord"])(end, nrOfColumns); if (isValid) { this.setRangeStartOnly(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](headerLevel, start)); this.setRangeEnd(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](nrOfRows - 1, end)); this.finish(); } return isValid; } /** * Select row specified by `startRow` visual index or a range of rows finishing at `endRow`. * * @param {number} startRow Visual row index from which the selection starts. * @param {number} [endRow] Visual row index from to the selection finishes. * @param {number} [headerLevel=-1] A column header index that triggers the row selection. * The value can take -1 to -N, where -1 means the header * closest to the cells. * @returns {boolean} Returns `true` if selection was successful, `false` otherwise. */ }, { key: "selectRows", value: function selectRows(startRow) { var endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow; var headerLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1; var nrOfRows = this.tableProps.countRows(); var nrOfColumns = this.tableProps.countCols(); var isValid = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_28__["isValidCoord"])(startRow, nrOfRows) && Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_28__["isValidCoord"])(endRow, nrOfRows); if (isValid) { this.setRangeStartOnly(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](startRow, headerLevel)); this.setRangeEnd(new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_21__["CellCoords"](endRow, nrOfColumns - 1)); this.finish(); } return isValid; } /** * Rewrite the rendered state of the selection as visual selection may have a new representation in the DOM. */ }, { key: "refresh", value: function refresh() { var customSelections = this.highlight.getCustomSelections(); customSelections.forEach(function (customSelection) { customSelection.commit(); }); if (!this.isSelected()) { return; } var cellHighlight = this.highlight.getCell(); var currentLayer = this.getLayerLevel(); cellHighlight.commit().adjustCoordinates(this.selectedRange.current()); // Rewriting rendered ranges going through all layers. for (var layerLevel = 0; layerLevel < this.selectedRange.size(); layerLevel += 1) { this.highlight.useLayerLevel(layerLevel); var areaHighlight = this.highlight.createOrGetArea(); var headerHighlight = this.highlight.createOrGetHeader(); var activeHeaderHighlight = this.highlight.createOrGetActiveHeader(); areaHighlight.commit(); headerHighlight.commit(); activeHeaderHighlight.commit(); } // Reverting starting layer for the Highlight. this.highlight.useLayerLevel(currentLayer); } }]); return Selection; }(); Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_23__["mixin"])(Selection, _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_26__["default"]); /* harmony default export */ __webpack_exports__["default"] = (Selection); /***/ }), /***/ "./node_modules/handsontable/selection/transformation.mjs": /*!****************************************************************!*\ !*** ./node_modules/handsontable/selection/transformation.mjs ***! \****************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../mixins/localHooks.mjs */ "./node_modules/handsontable/mixins/localHooks.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * The Transformation class implements algorithms for transforming coordinates based on current settings * passed to the Handsontable. * * Transformation is always applied relative to the current selection. * * @class Transformation * @util */ var Transformation = /*#__PURE__*/function () { function Transformation(range, options) { _classCallCheck(this, Transformation); /** * Instance of the SelectionRange, holder for visual coordinates applied to the table. * * @type {SelectionRange} */ this.range = range; /** * Additional options which define the state of the settings which can infer transformation and * give the possibility to translate indexes. * * @type {object} */ this.options = options; } /** * Selects cell relative to current cell (if possible). * * @param {number} rowDelta Rows number to move, value can be passed as negative number. * @param {number} colDelta Columns number to move, value can be passed as negative number. * @param {boolean} force If `true` the new rows/columns will be created if necessary. Otherwise, row/column will * be created according to `minSpareRows/minSpareCols` settings of Handsontable. * @returns {CellCoords} Visual coordinates after transformation. */ _createClass(Transformation, [{ key: "transformStart", value: function transformStart(rowDelta, colDelta, force) { var delta = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_0__["CellCoords"](rowDelta, colDelta); var highlightCoords = this.range.current().highlight; var _this$options$visualT = this.options.visualToRenderableCoords(highlightCoords), renderableRow = _this$options$visualT.row, renderableColumn = _this$options$visualT.col; var visualCoords = highlightCoords; var rowTransformDir = 0; var colTransformDir = 0; this.runLocalHooks('beforeTransformStart', delta); if (renderableRow !== null && renderableColumn !== null) { var totalRows = this.options.countRows(); var totalCols = this.options.countCols(); var fixedRowsBottom = this.options.fixedRowsBottom(); var minSpareRows = this.options.minSpareRows(); var minSpareCols = this.options.minSpareCols(); var autoWrapRow = this.options.autoWrapRow(); var autoWrapCol = this.options.autoWrapCol(); if (renderableRow + rowDelta > totalRows - 1) { if (force && minSpareRows > 0 && !(fixedRowsBottom && renderableRow >= totalRows - fixedRowsBottom - 1)) { this.runLocalHooks('insertRowRequire', totalRows); totalRows = this.options.countRows(); } else if (autoWrapCol) { delta.row = 1 - totalRows; delta.col = renderableColumn + delta.col === totalCols - 1 ? 1 - totalCols : 1; } } else if (autoWrapCol && renderableRow + delta.row < 0 && renderableColumn + delta.col >= 0) { delta.row = totalRows - 1; delta.col = renderableColumn + delta.col === 0 ? totalCols - 1 : -1; } if (renderableColumn + delta.col > totalCols - 1) { if (force && minSpareCols > 0) { this.runLocalHooks('insertColRequire', totalCols); totalCols = this.options.countCols(); } else if (autoWrapRow) { delta.row = renderableRow + delta.row === totalRows - 1 ? 1 - totalRows : 1; delta.col = 1 - totalCols; } } else if (autoWrapRow && renderableColumn + delta.col < 0 && renderableRow + delta.row >= 0) { delta.row = renderableRow + delta.row === 0 ? totalRows - 1 : -1; delta.col = totalCols - 1; } var coords = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_0__["CellCoords"](renderableRow + delta.row, renderableColumn + delta.col); rowTransformDir = 0; colTransformDir = 0; if (coords.row < 0) { rowTransformDir = -1; coords.row = 0; } else if (coords.row > 0 && coords.row >= totalRows) { rowTransformDir = 1; coords.row = totalRows - 1; } if (coords.col < 0) { colTransformDir = -1; coords.col = 0; } else if (coords.col > 0 && coords.col >= totalCols) { colTransformDir = 1; coords.col = totalCols - 1; } visualCoords = this.options.renderableToVisualCoords(coords); } this.runLocalHooks('afterTransformStart', visualCoords, rowTransformDir, colTransformDir); return visualCoords; } /** * Sets selection end cell relative to current selection end cell (if possible). * * @param {number} rowDelta Rows number to move, value can be passed as negative number. * @param {number} colDelta Columns number to move, value can be passed as negative number. * @returns {CellCoords} Visual coordinates after transformation. */ }, { key: "transformEnd", value: function transformEnd(rowDelta, colDelta) { var delta = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_0__["CellCoords"](rowDelta, colDelta); var cellRange = this.range.current(); var visualCoords = cellRange.to; var rowTransformDir = 0; var colTransformDir = 0; this.runLocalHooks('beforeTransformEnd', delta); var _this$options$visualT2 = this.options.visualToRenderableCoords(cellRange.highlight), rowHighlight = _this$options$visualT2.row, colHighlight = _this$options$visualT2.col; // We have highlight (start point for the selection). if (rowHighlight !== null && colHighlight !== null) { var totalRows = this.options.countRows(); var totalCols = this.options.countCols(); var _this$options$visualT3 = this.options.visualToRenderableCoords(cellRange.to), rowTo = _this$options$visualT3.row, colTo = _this$options$visualT3.col; var coords = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_0__["CellCoords"](rowTo + delta.row, colTo + delta.col); rowTransformDir = 0; colTransformDir = 0; if (coords.row < 0) { rowTransformDir = -1; coords.row = 0; } else if (coords.row > 0 && coords.row >= totalRows) { rowTransformDir = 1; coords.row = totalRows - 1; } if (coords.col < 0) { colTransformDir = -1; coords.col = 0; } else if (coords.col > 0 && coords.col >= totalCols) { colTransformDir = 1; coords.col = totalCols - 1; } visualCoords = this.options.renderableToVisualCoords(coords); } this.runLocalHooks('afterTransformEnd', visualCoords, rowTransformDir, colTransformDir); return visualCoords; } }]); return Transformation; }(); Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_1__["mixin"])(Transformation, _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]); /* harmony default export */ __webpack_exports__["default"] = (Transformation); /***/ }), /***/ "./node_modules/handsontable/selection/utils.mjs": /*!*******************************************************!*\ !*** ./node_modules/handsontable/selection/utils.mjs ***! \*******************************************************/ /*! exports provided: SELECTION_TYPE_UNRECOGNIZED, SELECTION_TYPE_EMPTY, SELECTION_TYPE_ARRAY, SELECTION_TYPE_OBJECT, SELECTION_TYPES, detectSelectionType, normalizeSelectionFactory, transformSelectionToColumnDistance, transformSelectionToRowDistance, isValidCoord */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SELECTION_TYPE_UNRECOGNIZED", function() { return SELECTION_TYPE_UNRECOGNIZED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SELECTION_TYPE_EMPTY", function() { return SELECTION_TYPE_EMPTY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SELECTION_TYPE_ARRAY", function() { return SELECTION_TYPE_ARRAY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SELECTION_TYPE_OBJECT", function() { return SELECTION_TYPE_OBJECT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SELECTION_TYPES", function() { return SELECTION_TYPES; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectSelectionType", function() { return detectSelectionType; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSelectionFactory", function() { return normalizeSelectionFactory; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformSelectionToColumnDistance", function() { return transformSelectionToColumnDistance; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformSelectionToRowDistance", function() { return transformSelectionToRowDistance; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidCoord", function() { return isValidCoord; }); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.sort.js */ "./node_modules/core-js/modules/es.array.sort.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var SELECTION_TYPE_UNRECOGNIZED = 0; var SELECTION_TYPE_EMPTY = 1; var SELECTION_TYPE_ARRAY = 2; var SELECTION_TYPE_OBJECT = 3; var SELECTION_TYPES = [SELECTION_TYPE_OBJECT, SELECTION_TYPE_ARRAY]; var ARRAY_TYPE_PATTERN = [['number'], ['number', 'string'], ['number', 'undefined'], ['number', 'string', 'undefined']]; var rootCall = Symbol('root'); var childCall = Symbol('child'); /** * Detect selection schema structure. * * @param {*} selectionRanges The selected range or and array of selected ranges. This type of data is produced by * `hot.getSelected()`, `hot.getSelectedLast()`, `hot.getSelectedRange()` * and `hot.getSelectedRangeLast()` methods. * @param {symbol} _callSymbol The symbol object which indicates source of the helper invocation. * @returns {number} Returns a number that specifies the type of detected selection schema. If selection schema type * is unrecognized than it returns `0`. */ function detectSelectionType(selectionRanges) { var _callSymbol = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : rootCall; if (_callSymbol !== rootCall && _callSymbol !== childCall) { throw new Error('The second argument is used internally only and cannot be overwritten.'); } var isArray = Array.isArray(selectionRanges); var isRootCall = _callSymbol === rootCall; var result = SELECTION_TYPE_UNRECOGNIZED; if (isArray) { var firstItem = selectionRanges[0]; if (selectionRanges.length === 0) { result = SELECTION_TYPE_EMPTY; } else if (isRootCall && firstItem instanceof _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_14__["CellRange"]) { result = SELECTION_TYPE_OBJECT; } else if (isRootCall && Array.isArray(firstItem)) { result = detectSelectionType(firstItem, childCall); } else if (selectionRanges.length >= 2 && selectionRanges.length <= 4) { var isArrayType = !selectionRanges.some(function (value, index) { return !ARRAY_TYPE_PATTERN[index].includes(_typeof(value)); }); if (isArrayType) { result = SELECTION_TYPE_ARRAY; } } } return result; } /** * Factory function designed for normalization data schema from different data structures of the selection ranges. * * @param {string} type Selection type which will be processed. * @param {object} [options] The normalization options. * @param {boolean} [options.keepDirection=false] If `true`, the coordinates which contain the direction of the * selected cells won't be changed. Otherwise, the selection will be * normalized to values starting from top-left to bottom-right. * @param {Function} [options.propToCol] Pass the converting function (usually `datamap.propToCol`) if the column * defined as props should be normalized to the numeric values. * @returns {number[]} Returns normalized data about selected range as an array (`[rowStart, columnStart, rowEnd, columnEnd]`). */ function normalizeSelectionFactory(type) { var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$keepDirection = _ref.keepDirection, keepDirection = _ref$keepDirection === void 0 ? false : _ref$keepDirection, propToCol = _ref.propToCol; if (!SELECTION_TYPES.includes(type)) { throw new Error('Unsupported selection ranges schema type was provided.'); } return function (selection) { var isObjectType = type === SELECTION_TYPE_OBJECT; var rowStart = isObjectType ? selection.from.row : selection[0]; var columnStart = isObjectType ? selection.from.col : selection[1]; var rowEnd = isObjectType ? selection.to.row : selection[2]; var columnEnd = isObjectType ? selection.to.col : selection[3]; if (typeof propToCol === 'function') { if (typeof columnStart === 'string') { columnStart = propToCol(columnStart); } if (typeof columnEnd === 'string') { columnEnd = propToCol(columnEnd); } } if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_16__["isUndefined"])(rowEnd)) { rowEnd = rowStart; } if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_16__["isUndefined"])(columnEnd)) { columnEnd = columnStart; } if (!keepDirection) { var origRowStart = rowStart; var origColumnStart = columnStart; var origRowEnd = rowEnd; var origColumnEnd = columnEnd; rowStart = Math.min(origRowStart, origRowEnd); columnStart = Math.min(origColumnStart, origColumnEnd); rowEnd = Math.max(origRowStart, origRowEnd); columnEnd = Math.max(origColumnStart, origColumnEnd); } return [rowStart, columnStart, rowEnd, columnEnd]; }; } /** * Function transform selection ranges (produced by `hot.getSelected()` and `hot.getSelectedRange()`) to normalized * data structure. It merges repeated ranges into consecutive coordinates. The returned structure * contains an array of arrays. The single item contains at index 0 visual column index from the selection was * started and at index 1 distance as a count of selected columns. * * @param {Array[]|CellRange[]} selectionRanges Selection ranges produced by Handsontable. * @returns {Array[]} Returns an array of arrays with ranges defines in that schema: * `[[visualColumnStart, distance], [visualColumnStart, distance], ...]`. * The column distances are always created starting from the left (zero index) to the * right (the latest column index). */ function transformSelectionToColumnDistance(selectionRanges) { var selectionType = detectSelectionType(selectionRanges); if (selectionType === SELECTION_TYPE_UNRECOGNIZED || selectionType === SELECTION_TYPE_EMPTY) { return []; } var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType); var unorderedIndexes = new Set(); // Iterate through all ranges and collect all column indexes which are not saved yet. Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__["arrayEach"])(selectionRanges, function (selection) { var _selectionSchemaNorma = selectionSchemaNormalizer(selection), _selectionSchemaNorma2 = _slicedToArray(_selectionSchemaNorma, 4), columnStart = _selectionSchemaNorma2[1], columnEnd = _selectionSchemaNorma2[3]; var columnNonHeaderStart = Math.max(columnStart, 0); var amount = columnEnd - columnNonHeaderStart + 1; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__["arrayEach"])(Array.from(new Array(amount), function (_, i) { return columnNonHeaderStart + i; }), function (index) { if (!unorderedIndexes.has(index)) { unorderedIndexes.add(index); } }); }); // Sort indexes in ascending order to easily detecting non-consecutive columns. var orderedIndexes = Array.from(unorderedIndexes).sort(function (a, b) { return a - b; }); var normalizedColumnRanges = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__["arrayReduce"])(orderedIndexes, function (acc, visualColumnIndex, index, array) { if (index !== 0 && visualColumnIndex === array[index - 1] + 1) { acc[acc.length - 1][1] += 1; } else { acc.push([visualColumnIndex, 1]); } return acc; }, []); return normalizedColumnRanges; } /** * Function transform selection ranges (produced by `hot.getSelected()` and `hot.getSelectedRange()`) to normalized * data structure. It merges repeated ranges into consecutive coordinates. The returned structure * contains an array of arrays. The single item contains at index 0 visual column index from the selection was * started and at index 1 distance as a count of selected columns. * * @param {Array[]|CellRange[]} selectionRanges Selection ranges produced by Handsontable. * @returns {Array[]} Returns an array of arrays with ranges defines in that schema: * `[[visualColumnStart, distance], [visualColumnStart, distance], ...]`. * The column distances are always created starting from the left (zero index) to the * right (the latest column index). */ function transformSelectionToRowDistance(selectionRanges) { var selectionType = detectSelectionType(selectionRanges); if (selectionType === SELECTION_TYPE_UNRECOGNIZED || selectionType === SELECTION_TYPE_EMPTY) { return []; } var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType); var unorderedIndexes = new Set(); // Iterate through all ranges and collect all column indexes which are not saved yet. Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__["arrayEach"])(selectionRanges, function (selection) { var _selectionSchemaNorma3 = selectionSchemaNormalizer(selection), _selectionSchemaNorma4 = _slicedToArray(_selectionSchemaNorma3, 3), rowStart = _selectionSchemaNorma4[0], rowEnd = _selectionSchemaNorma4[2]; var rowNonHeaderStart = Math.max(rowStart, 0); var amount = rowEnd - rowNonHeaderStart + 1; Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__["arrayEach"])(Array.from(new Array(amount), function (_, i) { return rowNonHeaderStart + i; }), function (index) { if (!unorderedIndexes.has(index)) { unorderedIndexes.add(index); } }); }); // Sort indexes in ascending order to easily detecting non-consecutive columns. var orderedIndexes = Array.from(unorderedIndexes).sort(function (a, b) { return a - b; }); var normalizedRowRanges = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__["arrayReduce"])(orderedIndexes, function (acc, rowIndex, index, array) { if (index !== 0 && rowIndex === array[index - 1] + 1) { acc[acc.length - 1][1] += 1; } else { acc.push([rowIndex, 1]); } return acc; }, []); return normalizedRowRanges; } /** * Check if passed value can be treated as valid cell coordinate. The second argument is * used to check if the value doesn't exceed the defined max table rows/columns count. * * @param {number} coord The coordinate to validate (row index or column index). * @param {number} maxTableItemsCount The value that declares the maximum coordinate that is still validatable. * @returns {boolean} */ function isValidCoord(coord) { var maxTableItemsCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity; return typeof coord === 'number' && coord >= 0 && coord < maxTableItemsCount; } /***/ }), /***/ "./node_modules/handsontable/tableView.mjs": /*!*************************************************!*\ !*** ./node_modules/handsontable/tableView.mjs ***! \*************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_number_is_integer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.number.is-integer.js */ "./node_modules/core-js/modules/es.number.is-integer.js"); /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.number.constructor.js */ "./node_modules/core-js/modules/es.number.constructor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./helpers/dom/event.mjs */ "./node_modules/handsontable/helpers/dom/event.mjs"); /* harmony import */ var _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./3rdparty/walkontable/src/index.mjs */ "./node_modules/handsontable/3rdparty/walkontable/src/index.mjs"); /* harmony import */ var _selection_mouseEventHandler_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./selection/mouseEventHandler.mjs */ "./node_modules/handsontable/selection/mouseEventHandler.mjs"); /* harmony import */ var _utils_rootInstance_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./utils/rootInstance.mjs */ "./node_modules/handsontable/utils/rootInstance.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var privatePool = new WeakMap(); /** * @class TableView * @private */ var TableView = /*#__PURE__*/function () { /** * @param {Hanstontable} instance Instance of {@link Handsontable}. */ function TableView(instance) { _classCallCheck(this, TableView); /** * Instance of {@link Handsontable}. * * @private * @type {Handsontable} */ this.instance = instance; /** * Instance of {@link EventManager}. * * @private * @type {EventManager} */ this.eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_16__["default"](instance); /** * Current Handsontable's GridSettings object. * * @private * @type {GridSettings} */ this.settings = instance.getSettings(); /** * Main element. * * @type {HTMLTableSectionElement} */ this.THEAD = void 0; /** * Main element. * * @type {HTMLTableSectionElement} */ this.TBODY = void 0; /** * Main Walkontable instance. * * @type {Walkontable} */ this.wt = void 0; /** * Main Walkontable instance. * * @private * @type {Walkontable} */ this.activeWt = void 0; /** * The flag determines if the `adjustElementsSize` method call was made during * the render suspending. If true, the method has to be triggered once after render * resuming. * * @private * @type {boolean} */ this.postponedAdjustElementsSize = false; privatePool.set(this, { /** * Defines if the text should be selected during mousemove. * * @private * @type {boolean} */ selectionMouseDown: false, /** * @private * @type {boolean} */ mouseDown: void 0, /** * Main element. * * @private * @type {HTMLTableElement} */ table: void 0, /** * Cached width of the rootElement. * * @type {number} */ lastWidth: 0, /** * Cached height of the rootElement. * * @type {number} */ lastHeight: 0 }); this.createElements(); this.registerEvents(); this.initializeWalkontable(); } /** * Renders WalkontableUI. */ _createClass(TableView, [{ key: "render", value: function render() { if (!this.instance.isRenderSuspended()) { if (this.postponedAdjustElementsSize) { this.postponedAdjustElementsSize = false; this.adjustElementsSize(true); } this.wt.draw(!this.instance.forceFullRender); this.instance.forceFullRender = false; this.instance.renderCall = false; } } /** * Adjust overlays elements size and master table size. * * @param {boolean} [force=false] When `true`, it adjust the DOM nodes sizes for all overlays. */ }, { key: "adjustElementsSize", value: function adjustElementsSize() { var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (this.instance.isRenderSuspended()) { this.postponedAdjustElementsSize = true; } else { this.wt.wtOverlays.adjustElementsSize(force); } } /** * Returns td object given coordinates. * * @param {CellCoords} coords Renderable cell coordinates. * @param {boolean} topmost Indicates whether the cell should be calculated from the topmost. * @returns {HTMLTableCellElement|null} */ }, { key: "getCellAtCoords", value: function getCellAtCoords(coords, topmost) { var td = this.wt.getCell(coords, topmost); if (td < 0) { // there was an exit code (cell is out of bounds) return null; } return td; } /** * Scroll viewport to a cell. * * @param {CellCoords} coords Renderable cell coordinates. * @param {boolean} [snapToTop] If `true`, viewport is scrolled to show the cell on the top of the table. * @param {boolean} [snapToRight] If `true`, viewport is scrolled to show the cell on the right side of the table. * @param {boolean} [snapToBottom] If `true`, viewport is scrolled to show the cell on the bottom side of the table. * @param {boolean} [snapToLeft] If `true`, viewport is scrolled to show the cell on the left side of the table. * @returns {boolean} */ }, { key: "scrollViewport", value: function scrollViewport(coords, snapToTop, snapToRight, snapToBottom, snapToLeft) { return this.wt.scrollViewport(coords, snapToTop, snapToRight, snapToBottom, snapToLeft); } /** * Scroll viewport to a column. * * @param {number} column Renderable column index. * @param {boolean} [snapToRight] If `true`, viewport is scrolled to show the cell on the right side of the table. * @param {boolean} [snapToLeft] If `true`, viewport is scrolled to show the cell on the left side of the table. * @returns {boolean} */ }, { key: "scrollViewportHorizontally", value: function scrollViewportHorizontally(column, snapToRight, snapToLeft) { return this.wt.scrollViewportHorizontally(column, snapToRight, snapToLeft); } /** * Scroll viewport to a row. * * @param {number} row Renderable row index. * @param {boolean} [snapToTop] If `true`, viewport is scrolled to show the cell on the top of the table. * @param {boolean} [snapToBottom] If `true`, viewport is scrolled to show the cell on the bottom side of the table. * @returns {boolean} */ }, { key: "scrollViewportVertically", value: function scrollViewportVertically(row, snapToTop, snapToBottom) { return this.wt.scrollViewportVertically(row, snapToTop, snapToBottom); } /** * Prepares DOMElements and adds correct className to the root element. * * @private */ }, { key: "createElements", value: function createElements() { var priv = privatePool.get(this); var _this$instance = this.instance, rootElement = _this$instance.rootElement, rootDocument = _this$instance.rootDocument; var originalStyle = rootElement.getAttribute('style'); if (originalStyle) { rootElement.setAttribute('data-originalstyle', originalStyle); // needed to retrieve original style in jsFiddle link generator in HT examples. may be removed in future versions } Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["addClass"])(rootElement, 'handsontable'); priv.table = rootDocument.createElement('TABLE'); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["addClass"])(priv.table, 'htCore'); if (this.instance.getSettings().tableClassName) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["addClass"])(priv.table, this.instance.getSettings().tableClassName); } this.THEAD = rootDocument.createElement('THEAD'); priv.table.appendChild(this.THEAD); this.TBODY = rootDocument.createElement('TBODY'); priv.table.appendChild(this.TBODY); this.instance.table = priv.table; this.instance.container.insertBefore(priv.table, this.instance.container.firstChild); } /** * Attaches necessary listeners. * * @private */ }, { key: "registerEvents", value: function registerEvents() { var _this = this; var priv = privatePool.get(this); var _this$instance2 = this.instance, rootElement = _this$instance2.rootElement, rootDocument = _this$instance2.rootDocument, selection = _this$instance2.selection; var documentElement = rootDocument.documentElement; this.eventManager.addEventListener(rootElement, 'mousedown', function (event) { priv.selectionMouseDown = true; if (!_this.isTextSelectionAllowed(event.target)) { var rootWindow = _this.instance.rootWindow; Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["clearTextSelection"])(rootWindow); event.preventDefault(); rootWindow.focus(); // make sure that window that contains HOT is active. Important when HOT is in iframe. } }); this.eventManager.addEventListener(rootElement, 'mouseup', function () { priv.selectionMouseDown = false; }); this.eventManager.addEventListener(rootElement, 'mousemove', function (event) { if (priv.selectionMouseDown && !_this.isTextSelectionAllowed(event.target)) { // Clear selection only when fragmentSelection is enabled, otherwise clearing selection breakes the IME editor. if (_this.settings.fragmentSelection) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["clearTextSelection"])(_this.instance.rootWindow); } event.preventDefault(); } }); this.eventManager.addEventListener(documentElement, 'keyup', function (event) { if (selection.isInProgress() && !event.shiftKey) { selection.finish(); } }); this.eventManager.addEventListener(documentElement, 'mouseup', function (event) { if (selection.isInProgress() && Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_17__["isLeftClick"])(event)) { // is left mouse button selection.finish(); } priv.mouseDown = false; if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["isOutsideInput"])(rootDocument.activeElement) || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_17__["isRightClick"])(event)) { _this.instance.unlisten(); } }); this.eventManager.addEventListener(documentElement, 'contextmenu', function (event) { if (selection.isInProgress() && Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_17__["isRightClick"])(event)) { selection.finish(); priv.mouseDown = false; } }); this.eventManager.addEventListener(documentElement, 'touchend', function () { if (selection.isInProgress()) { selection.finish(); } priv.mouseDown = false; }); this.eventManager.addEventListener(documentElement, 'mousedown', function (event) { var originalTarget = event.target; var eventX = event.x || event.clientX; var eventY = event.y || event.clientY; var next = event.target; if (priv.mouseDown || !rootElement || !_this.instance.view) { return; // it must have been started in a cell } // immediate click on "holder" means click on the right side of vertical scrollbar var holder = _this.instance.view.wt.wtTable.holder; if (next === holder) { var scrollbarWidth = Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["getScrollbarWidth"])(rootDocument); if (rootDocument.elementFromPoint(eventX + scrollbarWidth, eventY) !== holder || rootDocument.elementFromPoint(eventX, eventY + scrollbarWidth) !== holder) { return; } } else { while (next !== documentElement) { if (next === null) { if (event.isTargetWebComponent) { break; } // click on something that was a row but now is detached (possibly because your click triggered a rerender) return; } if (next === rootElement) { // click inside container return; } next = next.parentNode; } } // function did not return until here, we have an outside click! var outsideClickDeselects = typeof _this.settings.outsideClickDeselects === 'function' ? _this.settings.outsideClickDeselects(originalTarget) : _this.settings.outsideClickDeselects; if (outsideClickDeselects) { _this.instance.deselectCell(); } else { _this.instance.destroyEditor(false, false); } }); this.eventManager.addEventListener(priv.table, 'selectstart', function (event) { if (_this.settings.fragmentSelection || Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["isInput"])(event.target)) { return; } // https://github.com/handsontable/handsontable/issues/160 // Prevent text from being selected when performing drag down. event.preventDefault(); }); } /** * Translate renderable cell coordinates to visual coordinates. * * @param {CellCoords} coords The cell coordinates. * @returns {CellCoords} */ }, { key: "translateFromRenderableToVisualCoords", value: function translateFromRenderableToVisualCoords(_ref) { var row = _ref.row, col = _ref.col; // TODO: To consider an idea to reusing the CellCoords instance instead creating new one. return _construct(_3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_18__["CellCoords"], _toConsumableArray(this.translateFromRenderableToVisualIndex(row, col))); } /** * Translate renderable row and column indexes to visual row and column indexes. * * @param {number} renderableRow Renderable row index. * @param {number} renderableColumn Renderable columnIndex. * @returns {number[]} */ }, { key: "translateFromRenderableToVisualIndex", value: function translateFromRenderableToVisualIndex(renderableRow, renderableColumn) { // TODO: Some helper may be needed. // We perform translation for indexes (without headers). var visualRow = renderableRow >= 0 ? this.instance.rowIndexMapper.getVisualFromRenderableIndex(renderableRow) : renderableRow; var visualColumn = renderableColumn >= 0 ? this.instance.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn) : renderableColumn; if (visualRow === null) { visualRow = renderableRow; } if (visualColumn === null) { visualColumn = renderableColumn; } return [visualRow, visualColumn]; } /** * Returns the number of renderable indexes. * * @private * @param {IndexMapper} indexMapper The IndexMapper instance for specific axis. * @param {number} maxElements Maximum number of elements (rows or columns). * * @returns {number|*} */ }, { key: "countRenderableIndexes", value: function countRenderableIndexes(indexMapper, maxElements) { var consideredElements = Math.min(indexMapper.getNotTrimmedIndexesLength(), maxElements); // Don't take hidden indexes into account. We are looking just for renderable indexes. var firstNotHiddenIndex = indexMapper.getFirstNotHiddenIndex(consideredElements - 1, -1); // There are no renderable indexes. if (firstNotHiddenIndex === null) { return 0; } return indexMapper.getRenderableFromVisualIndex(firstNotHiddenIndex) + 1; } /** * Returns the number of renderable columns. * * @returns {number} */ }, { key: "countRenderableColumns", value: function countRenderableColumns() { return this.countRenderableIndexes(this.instance.columnIndexMapper, this.settings.maxCols); } /** * Returns the number of renderable rows. * * @returns {number} */ }, { key: "countRenderableRows", value: function countRenderableRows() { return this.countRenderableIndexes(this.instance.rowIndexMapper, this.settings.maxRows); } /** * Returns number of not hidden row indexes counting from the passed starting index. * The counting direction can be controlled by `incrementBy` argument. * * @param {number} visualIndex The visual index from which the counting begins. * @param {number} incrementBy If `-1` then counting is backwards or forward when `1`. * @returns {number} */ }, { key: "countNotHiddenRowIndexes", value: function countNotHiddenRowIndexes(visualIndex, incrementBy) { return this.countNotHiddenIndexes(visualIndex, incrementBy, this.instance.rowIndexMapper, this.countRenderableRows()); } /** * Returns number of not hidden column indexes counting from the passed starting index. * The counting direction can be controlled by `incrementBy` argument. * * @param {number} visualIndex The visual index from which the counting begins. * @param {number} incrementBy If `-1` then counting is backwards or forward when `1`. * @returns {number} */ }, { key: "countNotHiddenColumnIndexes", value: function countNotHiddenColumnIndexes(visualIndex, incrementBy) { return this.countNotHiddenIndexes(visualIndex, incrementBy, this.instance.columnIndexMapper, this.countRenderableColumns()); } /** * Returns number of not hidden indexes counting from the passed starting index. * The counting direction can be controlled by `incrementBy` argument. * * @param {number} visualIndex The visual index from which the counting begins. * @param {number} incrementBy If `-1` then counting is backwards or forward when `1`. * @param {IndexMapper} indexMapper The IndexMapper instance for specific axis. * @param {number} renderableIndexesCount Total count of renderable indexes for specific axis. * @returns {number} */ }, { key: "countNotHiddenIndexes", value: function countNotHiddenIndexes(visualIndex, incrementBy, indexMapper, renderableIndexesCount) { if (isNaN(visualIndex) || visualIndex < 0) { return 0; } var firstVisibleIndex = indexMapper.getFirstNotHiddenIndex(visualIndex, incrementBy); var renderableIndex = indexMapper.getRenderableFromVisualIndex(firstVisibleIndex); if (!Number.isInteger(renderableIndex)) { return 0; } var notHiddenIndexes = 0; if (incrementBy < 0) { // Zero-based numbering for renderable indexes corresponds to a number of not hidden indexes. notHiddenIndexes = renderableIndex + 1; } else if (incrementBy > 0) { notHiddenIndexes = renderableIndexesCount - renderableIndex; } return notHiddenIndexes; } /** * Defines default configuration and initializes WalkOnTable intance. * * @private */ }, { key: "initializeWalkontable", value: function initializeWalkontable() { var _this2 = this; var priv = privatePool.get(this); var walkontableConfig = { externalRowCalculator: this.instance.getPlugin('autoRowSize') && this.instance.getPlugin('autoRowSize').isEnabled(), table: priv.table, isDataViewInstance: function isDataViewInstance() { return Object(_utils_rootInstance_mjs__WEBPACK_IMPORTED_MODULE_20__["isRootInstance"])(_this2.instance); }, preventOverflow: function preventOverflow() { return _this2.settings.preventOverflow; }, preventWheel: function preventWheel() { return _this2.settings.preventWheel; }, stretchH: function stretchH() { return _this2.settings.stretchH; }, data: function data(renderableRow, renderableColumn) { var _this2$instance; return (_this2$instance = _this2.instance).getDataAtCell.apply(_this2$instance, _toConsumableArray(_this2.translateFromRenderableToVisualIndex(renderableRow, renderableColumn))); }, totalRows: function totalRows() { return _this2.countRenderableRows(); }, totalColumns: function totalColumns() { return _this2.countRenderableColumns(); }, // Number of renderable columns for the left overlay. fixedColumnsLeft: function fixedColumnsLeft() { var countCols = _this2.instance.countCols(); var visualFixedColumnsLeft = Math.min(parseInt(_this2.settings.fixedColumnsLeft, 10), countCols) - 1; return _this2.countNotHiddenColumnIndexes(visualFixedColumnsLeft, -1); }, // Number of renderable rows for the top overlay. fixedRowsTop: function fixedRowsTop() { var countRows = _this2.instance.countRows(); var visualFixedRowsTop = Math.min(parseInt(_this2.settings.fixedRowsTop, 10), countRows) - 1; return _this2.countNotHiddenRowIndexes(visualFixedRowsTop, -1); }, // Number of renderable rows for the bottom overlay. fixedRowsBottom: function fixedRowsBottom() { var countRows = _this2.instance.countRows(); var visualFixedRowsBottom = Math.max(countRows - parseInt(_this2.settings.fixedRowsBottom, 10), 0); return _this2.countNotHiddenRowIndexes(visualFixedRowsBottom, 1); }, // Enable the left overlay when conditions are met. shouldRenderLeftOverlay: function shouldRenderLeftOverlay() { return _this2.settings.fixedColumnsLeft > 0 || walkontableConfig.rowHeaders().length > 0; }, // Enable the top overlay when conditions are met. shouldRenderTopOverlay: function shouldRenderTopOverlay() { return _this2.settings.fixedRowsTop > 0 || walkontableConfig.columnHeaders().length > 0; }, // Enable the bottom overlay when conditions are met. shouldRenderBottomOverlay: function shouldRenderBottomOverlay() { return _this2.settings.fixedRowsBottom > 0; }, minSpareRows: function minSpareRows() { return _this2.settings.minSpareRows; }, renderAllRows: this.settings.renderAllRows, rowHeaders: function rowHeaders() { var headerRenderers = []; if (_this2.instance.hasRowHeaders()) { headerRenderers.push(function (renderableRowIndex, TH) { // TODO: Some helper may be needed. // We perform translation for row indexes (without row headers). var visualRowIndex = renderableRowIndex >= 0 ? _this2.instance.rowIndexMapper.getVisualFromRenderableIndex(renderableRowIndex) : renderableRowIndex; _this2.appendRowHeader(visualRowIndex, TH); }); } _this2.instance.runHooks('afterGetRowHeaderRenderers', headerRenderers); return headerRenderers; }, columnHeaders: function columnHeaders() { var headerRenderers = []; if (_this2.instance.hasColHeaders()) { headerRenderers.push(function (renderedColumnIndex, TH) { // TODO: Some helper may be needed. // We perform translation for columns indexes (without column headers). var visualColumnsIndex = renderedColumnIndex >= 0 ? _this2.instance.columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex) : renderedColumnIndex; _this2.appendColHeader(visualColumnsIndex, TH); }); } _this2.instance.runHooks('afterGetColumnHeaderRenderers', headerRenderers); return headerRenderers; }, columnWidth: function columnWidth(renderedColumnIndex) { var visualIndex = _this2.instance.columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex); // It's not a bug that we can't find visual index for some handled by method indexes. The function is called also // for not displayed indexes (beyond the table boundaries), i.e. when `fixedColumnsLeft` > `startCols` (wrong config?) or // scrolling and dataset is empty (scroll should handle that?). return _this2.instance.getColWidth(visualIndex === null ? renderedColumnIndex : visualIndex); }, rowHeight: function rowHeight(renderedRowIndex) { var visualIndex = _this2.instance.rowIndexMapper.getVisualFromRenderableIndex(renderedRowIndex); return _this2.instance.getRowHeight(visualIndex === null ? renderedRowIndex : visualIndex); }, cellRenderer: function cellRenderer(renderedRowIndex, renderedColumnIndex, TD) { var _this2$translateFromR = _this2.translateFromRenderableToVisualIndex(renderedRowIndex, renderedColumnIndex), _this2$translateFromR2 = _slicedToArray(_this2$translateFromR, 2), visualRowIndex = _this2$translateFromR2[0], visualColumnIndex = _this2$translateFromR2[1]; // Coords may be modified. For example, by the `MergeCells` plugin. It should affect cell value and cell meta. var modifiedCellCoords = _this2.instance.runHooks('modifyGetCellCoords', visualRowIndex, visualColumnIndex); var visualRowToCheck = visualRowIndex; var visualColumnToCheck = visualColumnIndex; if (Array.isArray(modifiedCellCoords)) { var _modifiedCellCoords = _slicedToArray(modifiedCellCoords, 2); visualRowToCheck = _modifiedCellCoords[0]; visualColumnToCheck = _modifiedCellCoords[1]; } var cellProperties = _this2.instance.getCellMeta(visualRowToCheck, visualColumnToCheck); var prop = _this2.instance.colToProp(visualColumnToCheck); var value = _this2.instance.getDataAtRowProp(visualRowToCheck, prop); if (_this2.instance.hasHook('beforeValueRender')) { value = _this2.instance.runHooks('beforeValueRender', value, cellProperties); } _this2.instance.runHooks('beforeRenderer', TD, visualRowIndex, visualColumnIndex, prop, value, cellProperties); _this2.instance.getCellRenderer(cellProperties)(_this2.instance, TD, visualRowIndex, visualColumnIndex, prop, value, cellProperties); _this2.instance.runHooks('afterRenderer', TD, visualRowIndex, visualColumnIndex, prop, value, cellProperties); }, selections: this.instance.selection.highlight, hideBorderOnMouseDownOver: function hideBorderOnMouseDownOver() { return _this2.settings.fragmentSelection; }, onWindowResize: function onWindowResize() { if (!_this2.instance || _this2.instance.isDestroyed) { return; } _this2.instance.refreshDimensions(); }, onCellMouseDown: function onCellMouseDown(event, coords, TD, wt) { var visualCoords = _this2.translateFromRenderableToVisualCoords(coords); var blockCalculations = { row: false, column: false, cell: false }; _this2.instance.listen(); _this2.activeWt = wt; priv.mouseDown = true; _this2.instance.runHooks('beforeOnCellMouseDown', event, visualCoords, TD, blockCalculations); if (Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_17__["isImmediatePropagationStopped"])(event)) { return; } Object(_selection_mouseEventHandler_mjs__WEBPACK_IMPORTED_MODULE_19__["handleMouseEvent"])(event, { coords: visualCoords, selection: _this2.instance.selection, controller: blockCalculations }); _this2.instance.runHooks('afterOnCellMouseDown', event, visualCoords, TD); _this2.activeWt = _this2.wt; }, onCellContextMenu: function onCellContextMenu(event, coords, TD, wt) { var visualCoords = _this2.translateFromRenderableToVisualCoords(coords); _this2.activeWt = wt; priv.mouseDown = false; if (_this2.instance.selection.isInProgress()) { _this2.instance.selection.finish(); } _this2.instance.runHooks('beforeOnCellContextMenu', event, visualCoords, TD); if (Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_17__["isImmediatePropagationStopped"])(event)) { return; } _this2.instance.runHooks('afterOnCellContextMenu', event, visualCoords, TD); _this2.activeWt = _this2.wt; }, onCellMouseOut: function onCellMouseOut(event, coords, TD, wt) { var visualCoords = _this2.translateFromRenderableToVisualCoords(coords); _this2.activeWt = wt; _this2.instance.runHooks('beforeOnCellMouseOut', event, visualCoords, TD); if (Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_17__["isImmediatePropagationStopped"])(event)) { return; } _this2.instance.runHooks('afterOnCellMouseOut', event, visualCoords, TD); _this2.activeWt = _this2.wt; }, onCellMouseOver: function onCellMouseOver(event, coords, TD, wt) { var visualCoords = _this2.translateFromRenderableToVisualCoords(coords); var blockCalculations = { row: false, column: false, cell: false }; _this2.activeWt = wt; _this2.instance.runHooks('beforeOnCellMouseOver', event, visualCoords, TD, blockCalculations); if (Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_17__["isImmediatePropagationStopped"])(event)) { return; } if (priv.mouseDown) { Object(_selection_mouseEventHandler_mjs__WEBPACK_IMPORTED_MODULE_19__["handleMouseEvent"])(event, { coords: visualCoords, selection: _this2.instance.selection, controller: blockCalculations }); } _this2.instance.runHooks('afterOnCellMouseOver', event, visualCoords, TD); _this2.activeWt = _this2.wt; }, onCellMouseUp: function onCellMouseUp(event, coords, TD, wt) { var visualCoords = _this2.translateFromRenderableToVisualCoords(coords); _this2.activeWt = wt; _this2.instance.runHooks('beforeOnCellMouseUp', event, visualCoords, TD); // TODO: The second condition check is a workaround. Callback corresponding the method `updateSettings` // disable plugin and enable it again. Disabling plugin closes the menu. Thus, calling the // `updateSettings` in a body of any callback executed right after some context-menu action // breaks the table (#7231). if (Object(_helpers_dom_event_mjs__WEBPACK_IMPORTED_MODULE_17__["isImmediatePropagationStopped"])(event) || _this2.instance.isDestroyed) { return; } _this2.instance.runHooks('afterOnCellMouseUp', event, visualCoords, TD); _this2.activeWt = _this2.wt; }, onCellCornerMouseDown: function onCellCornerMouseDown(event) { event.preventDefault(); _this2.instance.runHooks('afterOnCellCornerMouseDown', event); }, onCellCornerDblClick: function onCellCornerDblClick(event) { event.preventDefault(); _this2.instance.runHooks('afterOnCellCornerDblClick', event); }, beforeDraw: function beforeDraw(force, skipRender) { return _this2.beforeRender(force, skipRender); }, onDraw: function onDraw(force) { return _this2.onDraw(force); }, onScrollVertically: function onScrollVertically() { return _this2.instance.runHooks('afterScrollVertically'); }, onScrollHorizontally: function onScrollHorizontally() { return _this2.instance.runHooks('afterScrollHorizontally'); }, onBeforeRemoveCellClassNames: function onBeforeRemoveCellClassNames() { return _this2.instance.runHooks('beforeRemoveCellClassNames'); }, onBeforeHighlightingRowHeader: function onBeforeHighlightingRowHeader(renderableRow, headerLevel, highlightMeta) { var rowMapper = _this2.instance.rowIndexMapper; var visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow); var newVisualRow = _this2.instance.runHooks('beforeHighlightingRowHeader', visualRow, headerLevel, highlightMeta); return rowMapper.getRenderableFromVisualIndex(rowMapper.getFirstNotHiddenIndex(newVisualRow, 1)); }, onBeforeHighlightingColumnHeader: function onBeforeHighlightingColumnHeader(renderableColumn, headerLevel, highlightMeta) { var columnMapper = _this2.instance.columnIndexMapper; var visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn); var newVisualColumn = _this2.instance.runHooks('beforeHighlightingColumnHeader', visualColumn, headerLevel, highlightMeta); return columnMapper.getRenderableFromVisualIndex(columnMapper.getFirstNotHiddenIndex(newVisualColumn, 1)); }, onAfterDrawSelection: function onAfterDrawSelection(currentRow, currentColumn, layerLevel) { var cornersOfSelection; var _this2$translateFromR3 = _this2.translateFromRenderableToVisualIndex(currentRow, currentColumn), _this2$translateFromR4 = _slicedToArray(_this2$translateFromR3, 2), visualRowIndex = _this2$translateFromR4[0], visualColumnIndex = _this2$translateFromR4[1]; var selectedRange = _this2.instance.selection.getSelectedRange(); var selectionRangeSize = selectedRange.size(); if (selectionRangeSize > 0) { // Selection layers are stored from the "oldest" to the "newest". We should calculate the offset. // Please look at the `SelectedRange` class and it's method for getting selection's layer for more information. var selectionOffset = (layerLevel !== null && layerLevel !== void 0 ? layerLevel : 0) + 1 - selectionRangeSize; var selectionForLayer = selectedRange.peekByIndex(selectionOffset); cornersOfSelection = [selectionForLayer.from.row, selectionForLayer.from.col, selectionForLayer.to.row, selectionForLayer.to.col]; } return _this2.instance.runHooks('afterDrawSelection', visualRowIndex, visualColumnIndex, cornersOfSelection, layerLevel); }, onBeforeDrawBorders: function onBeforeDrawBorders(corners, borderClassName) { var _corners = _slicedToArray(corners, 4), startRenderableRow = _corners[0], startRenderableColumn = _corners[1], endRenderableRow = _corners[2], endRenderableColumn = _corners[3]; var visualCorners = [_this2.instance.rowIndexMapper.getVisualFromRenderableIndex(startRenderableRow), _this2.instance.columnIndexMapper.getVisualFromRenderableIndex(startRenderableColumn), _this2.instance.rowIndexMapper.getVisualFromRenderableIndex(endRenderableRow), _this2.instance.columnIndexMapper.getVisualFromRenderableIndex(endRenderableColumn)]; return _this2.instance.runHooks('beforeDrawBorders', visualCorners, borderClassName); }, onBeforeTouchScroll: function onBeforeTouchScroll() { return _this2.instance.runHooks('beforeTouchScroll'); }, onAfterMomentumScroll: function onAfterMomentumScroll() { return _this2.instance.runHooks('afterMomentumScroll'); }, onBeforeStretchingColumnWidth: function onBeforeStretchingColumnWidth(stretchedWidth, renderedColumnIndex) { var visualColumnIndex = _this2.instance.columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex); return _this2.instance.runHooks('beforeStretchingColumnWidth', stretchedWidth, visualColumnIndex); }, onModifyRowHeaderWidth: function onModifyRowHeaderWidth(rowHeaderWidth) { return _this2.instance.runHooks('modifyRowHeaderWidth', rowHeaderWidth); }, onModifyGetCellCoords: function onModifyGetCellCoords(renderableRowIndex, renderableColumnIndex, topmost) { var rowMapper = _this2.instance.rowIndexMapper; var columnMapper = _this2.instance.columnIndexMapper; // Callback handle also headers. We shouldn't translate them. var visualColumnIndex = renderableColumnIndex >= 0 ? columnMapper.getVisualFromRenderableIndex(renderableColumnIndex) : renderableColumnIndex; var visualRowIndex = renderableRowIndex >= 0 ? rowMapper.getVisualFromRenderableIndex(renderableRowIndex) : renderableRowIndex; var visualIndexes = _this2.instance.runHooks('modifyGetCellCoords', visualRowIndex, visualColumnIndex, topmost); if (Array.isArray(visualIndexes)) { var _visualIndexes = _slicedToArray(visualIndexes, 4), visualRowFrom = _visualIndexes[0], visualColumnFrom = _visualIndexes[1], visualRowTo = _visualIndexes[2], visualColumnTo = _visualIndexes[3]; // Result of the hook is handled by the Walkontable (renderable indexes). return [visualRowFrom >= 0 ? rowMapper.getRenderableFromVisualIndex(rowMapper.getFirstNotHiddenIndex(visualRowFrom, 1)) : visualRowFrom, visualColumnFrom >= 0 ? columnMapper.getRenderableFromVisualIndex(columnMapper.getFirstNotHiddenIndex(visualColumnFrom, 1)) : visualColumnFrom, visualRowTo >= 0 ? rowMapper.getRenderableFromVisualIndex(rowMapper.getFirstNotHiddenIndex(visualRowTo, -1)) : visualRowTo, visualColumnTo >= 0 ? columnMapper.getRenderableFromVisualIndex(columnMapper.getFirstNotHiddenIndex(visualColumnTo, -1)) : visualColumnTo]; } }, viewportRowCalculatorOverride: function viewportRowCalculatorOverride(calc) { var viewportOffset = _this2.settings.viewportRowRenderingOffset; if (viewportOffset === 'auto' && _this2.settings.fixedRowsTop) { viewportOffset = 10; } if (viewportOffset > 0 || viewportOffset === 'auto') { var renderableRows = _this2.countRenderableRows(); var firstRenderedRow = calc.startRow; var lastRenderedRow = calc.endRow; if (typeof viewportOffset === 'number') { calc.startRow = Math.max(firstRenderedRow - viewportOffset, 0); calc.endRow = Math.min(lastRenderedRow + viewportOffset, renderableRows - 1); } else if (viewportOffset === 'auto') { var offset = Math.ceil(lastRenderedRow / renderableRows * 12); calc.startRow = Math.max(firstRenderedRow - offset, 0); calc.endRow = Math.min(lastRenderedRow + offset, renderableRows - 1); } } _this2.instance.runHooks('afterViewportRowCalculatorOverride', calc); }, viewportColumnCalculatorOverride: function viewportColumnCalculatorOverride(calc) { var viewportOffset = _this2.settings.viewportColumnRenderingOffset; if (viewportOffset === 'auto' && _this2.settings.fixedColumnsLeft) { viewportOffset = 10; } if (viewportOffset > 0 || viewportOffset === 'auto') { var renderableColumns = _this2.countRenderableColumns(); var firstRenderedColumn = calc.startColumn; var lastRenderedColumn = calc.endColumn; if (typeof viewportOffset === 'number') { calc.startColumn = Math.max(firstRenderedColumn - viewportOffset, 0); calc.endColumn = Math.min(lastRenderedColumn + viewportOffset, renderableColumns - 1); } if (viewportOffset === 'auto') { var offset = Math.ceil(lastRenderedColumn / renderableColumns * 6); calc.startColumn = Math.max(firstRenderedColumn - offset, 0); calc.endColumn = Math.min(lastRenderedColumn + offset, renderableColumns - 1); } } _this2.instance.runHooks('afterViewportColumnCalculatorOverride', calc); }, rowHeaderWidth: function rowHeaderWidth() { return _this2.settings.rowHeaderWidth; }, columnHeaderHeight: function columnHeaderHeight() { var columnHeaderHeight = _this2.instance.runHooks('modifyColumnHeaderHeight'); return _this2.settings.columnHeaderHeight || columnHeaderHeight; } }; this.instance.runHooks('beforeInitWalkontable', walkontableConfig); this.wt = new _3rdparty_walkontable_src_index_mjs__WEBPACK_IMPORTED_MODULE_18__["default"](walkontableConfig); this.activeWt = this.wt; var spreader = this.wt.wtTable.spreader; // We have to cache width and height after Walkontable initialization. var _this$instance$rootEl = this.instance.rootElement.getBoundingClientRect(), width = _this$instance$rootEl.width, height = _this$instance$rootEl.height; this.setLastSize(width, height); this.eventManager.addEventListener(spreader, 'mousedown', function (event) { // right mouse button exactly on spreader means right click on the right hand side of vertical scrollbar if (event.target === spreader && event.which === 3) { event.stopPropagation(); } }); this.eventManager.addEventListener(spreader, 'contextmenu', function (event) { // right mouse button exactly on spreader means right click on the right hand side of vertical scrollbar if (event.target === spreader && event.which === 3) { event.stopPropagation(); } }); this.eventManager.addEventListener(this.instance.rootDocument.documentElement, 'click', function () { if (_this2.settings.observeDOMVisibility) { if (_this2.wt.drawInterrupted) { _this2.instance.forceFullRender = true; _this2.render(); } } }); } /** * Checks if it's possible to create text selection in element. * * @private * @param {HTMLElement} el The element to check. * @returns {boolean} */ }, { key: "isTextSelectionAllowed", value: function isTextSelectionAllowed(el) { if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["isInput"])(el)) { return true; } var isChildOfTableBody = Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["isChildOf"])(el, this.instance.view.wt.wtTable.spreader); if (this.settings.fragmentSelection === true && isChildOfTableBody) { return true; } if (this.settings.fragmentSelection === 'cell' && this.isSelectedOnlyCell() && isChildOfTableBody) { return true; } if (!this.settings.fragmentSelection && this.isCellEdited() && this.isSelectedOnlyCell()) { return true; } return false; } /** * Checks if user's been called mousedown. * * @private * @returns {boolean} */ }, { key: "isMouseDown", value: function isMouseDown() { return privatePool.get(this).mouseDown; } /** * Check if selected only one cell. * * @private * @returns {boolean} */ }, { key: "isSelectedOnlyCell", value: function isSelectedOnlyCell() { var _this$instance$getSel, _this$instance$getSel2; return (_this$instance$getSel = (_this$instance$getSel2 = this.instance.getSelectedRangeLast()) === null || _this$instance$getSel2 === void 0 ? void 0 : _this$instance$getSel2.isSingle()) !== null && _this$instance$getSel !== void 0 ? _this$instance$getSel : false; } /** * Checks if active cell is editing. * * @private * @returns {boolean} */ }, { key: "isCellEdited", value: function isCellEdited() { var activeEditor = this.instance.getActiveEditor(); return activeEditor && activeEditor.isOpened(); } /** * `beforeDraw` callback. * * @private * @param {boolean} force If `true` rendering was triggered by a change of settings or data or `false` if * rendering was triggered by scrolling or moving selection. * @param {boolean} skipRender Indicates whether the rendering is skipped. */ }, { key: "beforeRender", value: function beforeRender(force, skipRender) { if (force) { // this.instance.forceFullRender = did Handsontable request full render? this.instance.runHooks('beforeRender', this.instance.forceFullRender, skipRender); } } /** * `onDraw` callback. * * @private * @param {boolean} force If `true` rendering was triggered by a change of settings or data or `false` if * rendering was triggered by scrolling or moving selection. */ }, { key: "onDraw", value: function onDraw(force) { if (force) { // this.instance.forceFullRender = did Handsontable request full render? this.instance.runHooks('afterRender', this.instance.forceFullRender); } } /** * Append row header to a TH element. * * @private * @param {number} visualRowIndex The visual row index. * @param {HTMLTableHeaderCellElement} TH The table header element. */ }, { key: "appendRowHeader", value: function appendRowHeader(visualRowIndex, TH) { if (TH.firstChild) { var container = TH.firstChild; if (!Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["hasClass"])(container, 'relative')) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["empty"])(TH); this.appendRowHeader(visualRowIndex, TH); return; } this.updateCellHeader(container.querySelector('.rowHeader'), visualRowIndex, this.instance.getRowHeader); } else { var _this$instance3 = this.instance, rootDocument = _this$instance3.rootDocument, getRowHeader = _this$instance3.getRowHeader; var div = rootDocument.createElement('div'); var span = rootDocument.createElement('span'); div.className = 'relative'; span.className = 'rowHeader'; this.updateCellHeader(span, visualRowIndex, getRowHeader); div.appendChild(span); TH.appendChild(div); } this.instance.runHooks('afterGetRowHeader', visualRowIndex, TH); } /** * Append column header to a TH element. * * @private * @param {number} visualColumnIndex Visual column index. * @param {HTMLTableHeaderCellElement} TH The table header element. */ }, { key: "appendColHeader", value: function appendColHeader(visualColumnIndex, TH) { if (TH.firstChild) { var container = TH.firstChild; if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["hasClass"])(container, 'relative')) { this.updateCellHeader(container.querySelector('.colHeader'), visualColumnIndex, this.instance.getColHeader); } else { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["empty"])(TH); this.appendColHeader(visualColumnIndex, TH); } } else { var rootDocument = this.instance.rootDocument; var div = rootDocument.createElement('div'); var span = rootDocument.createElement('span'); div.className = 'relative'; span.className = 'colHeader'; this.updateCellHeader(span, visualColumnIndex, this.instance.getColHeader); div.appendChild(span); TH.appendChild(div); } this.instance.runHooks('afterGetColHeader', visualColumnIndex, TH); } /** * Updates header cell content. * * @since 0.15.0-beta4 * @param {HTMLElement} element Element to update. * @param {number} index Row index or column index. * @param {Function} content Function which should be returns content for this cell. */ }, { key: "updateCellHeader", value: function updateCellHeader(element, index, content) { var renderedIndex = index; var parentOverlay = this.wt.wtOverlays.getParentOverlay(element) || this.wt; // prevent wrong calculations from SampleGenerator if (element.parentNode) { if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["hasClass"])(element, 'colHeader')) { renderedIndex = parentOverlay.wtTable.columnFilter.sourceToRendered(index); } else if (Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["hasClass"])(element, 'rowHeader')) { renderedIndex = parentOverlay.wtTable.rowFilter.sourceToRendered(index); } } if (renderedIndex > -1) { Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["fastInnerHTML"])(element, content(index)); } else { // workaround for https://github.com/handsontable/handsontable/issues/1946 Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["fastInnerText"])(element, String.fromCharCode(160)); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_15__["addClass"])(element, 'cornerHeader'); } } /** * Given a element's left position relative to the viewport, returns maximum element width until the right * edge of the viewport (before scrollbar). * * @private * @param {number} leftOffset The left offset. * @returns {number} */ }, { key: "maximumVisibleElementWidth", value: function maximumVisibleElementWidth(leftOffset) { var workspaceWidth = this.wt.wtViewport.getWorkspaceWidth(); var maxWidth = workspaceWidth - leftOffset; return maxWidth > 0 ? maxWidth : 0; } /** * Given a element's top position relative to the viewport, returns maximum element height until the bottom * edge of the viewport (before scrollbar). * * @private * @param {number} topOffset The top offset. * @returns {number} */ }, { key: "maximumVisibleElementHeight", value: function maximumVisibleElementHeight(topOffset) { var workspaceHeight = this.wt.wtViewport.getWorkspaceHeight(); var maxHeight = workspaceHeight - topOffset; return maxHeight > 0 ? maxHeight : 0; } /** * Sets new dimensions of the container. * * @param {number} width The table width. * @param {number} height The table height. */ }, { key: "setLastSize", value: function setLastSize(width, height) { var priv = privatePool.get(this); var _ref2 = [width, height]; priv.lastWidth = _ref2[0]; priv.lastHeight = _ref2[1]; } /** * Returns cached dimensions. * * @returns {object} */ }, { key: "getLastSize", value: function getLastSize() { var priv = privatePool.get(this); return { width: priv.lastWidth, height: priv.lastHeight }; } /** * Checks if master overlay is active. * * @private * @returns {boolean} */ }, { key: "mainViewIsActive", value: function mainViewIsActive() { return this.wt === this.activeWt; } /** * Destroyes internal WalkOnTable's instance. Detaches all of the bonded listeners. * * @private */ }, { key: "destroy", value: function destroy() { this.wt.destroy(); this.eventManager.destroy(); } }]); return TableView; }(); /* harmony default export */ __webpack_exports__["default"] = (TableView); /***/ }), /***/ "./node_modules/handsontable/translations/changesObservable/observable.mjs": /*!*********************************************************************************!*\ !*** ./node_modules/handsontable/translations/changesObservable/observable.mjs ***! \*********************************************************************************/ /*! exports provided: ChangesObservable */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangesObservable", function() { return ChangesObservable; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.fill.js */ "./node_modules/core-js/modules/es.array.fill.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var _observer_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./observer.mjs */ "./node_modules/handsontable/translations/changesObservable/observer.mjs"); /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/handsontable/translations/changesObservable/utils.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } /** * The ChangesObservable module is an object that represents a resource that provides * the ability to observe the changes that happened in the index map indexes during * the code running. * * @class ChangesObservable */ var _observers = /*#__PURE__*/new WeakMap(); var _indexMatrix = /*#__PURE__*/new WeakMap(); var _currentIndexState = /*#__PURE__*/new WeakMap(); var _isMatrixIndexesInitialized = /*#__PURE__*/new WeakMap(); var _initialIndexValue = /*#__PURE__*/new WeakMap(); var ChangesObservable = /*#__PURE__*/function () { /** * The list of registered ChangesObserver instances. * * @type {ChangesObserver[]} */ /** * An array with default values that act as a base array that will be compared with * the last saved index state. The changes are generated and immediately send through * the newly created ChangesObserver object. Thanks to that, the observer initially has * all information about what indexes are currently changed. * * @type {Array} */ /** * An array that holds the indexes state that is currently valid. The value is changed on every * index mapper cache update. * * @type {Array} */ /** * The flag determines if the observable is initialized or not. Not initialized object creates * index matrix once while emitting new changes. * * @type {boolean} */ /** * The initial index value allows control from what value the index matrix array will be created. * Changing that value changes how the array diff generates the changes for the initial data * sent to the subscribers. For example, the changes can be triggered by detecting the changes * from `false` to `true` value or vice versa. Generally, it depends on which index map type * the Observable will work with. For "hiding" or "trimming" index types, it will be boolean * values. For various index maps, it can be anything, but I suspect that the most appropriate * initial value will be "undefined" in that case. * * @type {boolean} */ function ChangesObservable() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, initialIndexValue = _ref.initialIndexValue; _classCallCheck(this, ChangesObservable); _observers.set(this, { writable: true, value: new Set() }); _indexMatrix.set(this, { writable: true, value: [] }); _currentIndexState.set(this, { writable: true, value: [] }); _isMatrixIndexesInitialized.set(this, { writable: true, value: false }); _initialIndexValue.set(this, { writable: true, value: false }); _classPrivateFieldSet(this, _initialIndexValue, initialIndexValue !== null && initialIndexValue !== void 0 ? initialIndexValue : false); } /* eslint-disable jsdoc/require-description-complete-sentence */ /** * Creates and returns a new instance of the ChangesObserver object. The resource * allows subscribing to the index changes that during the code running may change. * Changes are emitted as an array of the index change. Each change is represented * separately as an object with `op`, `index`, `oldValue`, and `newValue` props. * * For example: * ``` * [ * { op: 'replace', index: 1, oldValue: false, newValue: true }, * { op: 'replace', index: 3, oldValue: false, newValue: true }, * { op: 'insert', index: 4, oldValue: false, newValue: true }, * ] * // or when the new index map changes have less indexes * [ * { op: 'replace', index: 1, oldValue: false, newValue: true }, * { op: 'remove', index: 4, oldValue: false, newValue: true }, * ] * ``` * * @returns {ChangesObserver} */ /* eslint-enable jsdoc/require-description-complete-sentence */ _createClass(ChangesObservable, [{ key: "createObserver", value: function createObserver() { var _this = this; var observer = new _observer_mjs__WEBPACK_IMPORTED_MODULE_8__["ChangesObserver"](); _classPrivateFieldGet(this, _observers).add(observer); observer.addLocalHook('unsubscribe', function () { _classPrivateFieldGet(_this, _observers).delete(observer); }); observer._writeInitialChanges(Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_9__["arrayDiff"])(_classPrivateFieldGet(this, _indexMatrix), _classPrivateFieldGet(this, _currentIndexState))); return observer; } /** * The method is an entry point for triggering new index map changes. Emitting the * changes triggers comparing algorithm which compares last saved state with a new * state. When there are some differences, the changes are sent to all subscribers. * * @param {Array} indexesState An array with index map state. */ }, { key: "emit", value: function emit(indexesState) { var currentIndexState = _classPrivateFieldGet(this, _currentIndexState); if (!_classPrivateFieldGet(this, _isMatrixIndexesInitialized) || _classPrivateFieldGet(this, _indexMatrix).length !== indexesState.length) { if (indexesState.length === 0) { indexesState = new Array(currentIndexState.length).fill(_classPrivateFieldGet(this, _initialIndexValue)); } else { _classPrivateFieldSet(this, _indexMatrix, new Array(indexesState.length).fill(_classPrivateFieldGet(this, _initialIndexValue))); } if (!_classPrivateFieldGet(this, _isMatrixIndexesInitialized)) { _classPrivateFieldSet(this, _isMatrixIndexesInitialized, true); currentIndexState = _classPrivateFieldGet(this, _indexMatrix); } } var changes = Object(_utils_mjs__WEBPACK_IMPORTED_MODULE_9__["arrayDiff"])(currentIndexState, indexesState); _classPrivateFieldGet(this, _observers).forEach(function (observer) { return observer._write(changes); }); _classPrivateFieldSet(this, _currentIndexState, indexesState); } }]); return ChangesObservable; }(); /***/ }), /***/ "./node_modules/handsontable/translations/changesObservable/observer.mjs": /*!*******************************************************************************!*\ !*** ./node_modules/handsontable/translations/changesObservable/observer.mjs ***! \*******************************************************************************/ /*! exports provided: ChangesObserver */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangesObserver", function() { return ChangesObserver; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/localHooks.mjs */ "./node_modules/handsontable/mixins/localHooks.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } /** * The ChangesObserver module is an object that represents a disposable resource * provided by the ChangesObservable module. * * @class ChangesObserver */ var _currentInitialChanges = /*#__PURE__*/new WeakMap(); var ChangesObserver = /*#__PURE__*/function () { function ChangesObserver() { _classCallCheck(this, ChangesObserver); _currentInitialChanges.set(this, { writable: true, value: [] }); } _createClass(ChangesObserver, [{ key: "subscribe", value: /** * Subscribes to the observer. * * @param {Function} callback A function that will be called when the new changes will appear. * @returns {ChangesObserver} */ function subscribe(callback) { this.addLocalHook('change', callback); this._write(_classPrivateFieldGet(this, _currentInitialChanges)); return this; } /** * Unsubscribes all subscriptions. After the method call, the observer would not produce * any new events. * * @returns {ChangesObserver} */ }, { key: "unsubscribe", value: function unsubscribe() { this.runLocalHooks('unsubscribe'); this.clearLocalHooks(); return this; } /** * The write method is executed by the ChangesObservable module. The module produces all * changes events that are distributed further by the observer. * * @private * @param {object} changes The chunk of changes produced by the ChangesObservable module. * @returns {ChangesObserver} */ }, { key: "_write", value: function _write(changes) { if (changes.length > 0) { this.runLocalHooks('change', changes); } return this; } /** * The write method is executed by the ChangesObservable module. The module produces initial * changes that will be used to notify new subscribers. * * @private * @param {object} initialChanges The chunk of changes produced by the ChangesObservable module. */ }, { key: "_writeInitialChanges", value: function _writeInitialChanges(initialChanges) { _classPrivateFieldSet(this, _currentInitialChanges, initialChanges); } }]); return ChangesObserver; }(); Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_5__["mixin"])(ChangesObserver, _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]); /***/ }), /***/ "./node_modules/handsontable/translations/changesObservable/utils.mjs": /*!****************************************************************************!*\ !*** ./node_modules/handsontable/translations/changesObservable/utils.mjs ***! \****************************************************************************/ /*! exports provided: arrayDiff */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayDiff", function() { return arrayDiff; }); /** * An array diff implementation. The function iterates through the arrays and depends * on the diff results, collect the changes as a list of the objects. * * Each object contains information about the differences in the indexes of the arrays. * The changes also contain data about the new and previous array values. * * @param {Array} baseArray The base array to diff from. * @param {Array} newArray The new array to compare with. * @returns {Array} */ function arrayDiff(baseArray, newArray) { var changes = []; var i = 0; var j = 0; /* eslint-disable no-plusplus */ for (; i < baseArray.length && j < newArray.length; i++, j++) { if (baseArray[i] !== newArray[j]) { changes.push({ op: 'replace', index: j, oldValue: baseArray[i], newValue: newArray[j] }); } } for (; i < newArray.length; i++) { changes.push({ op: 'insert', index: i, oldValue: void 0, newValue: newArray[i] }); } for (; j < baseArray.length; j++) { changes.push({ op: 'remove', index: j, oldValue: baseArray[j], newValue: void 0 }); } return changes; } /***/ }), /***/ "./node_modules/handsontable/translations/index.mjs": /*!**********************************************************!*\ !*** ./node_modules/handsontable/translations/index.mjs ***! \**********************************************************/ /*! exports provided: IndexMapper, getRegisteredMapsCounter, getIncreasedIndexes, getDecreasedIndexes, alterUtilsFactory, IndexesSequence, getListWithInsertedItems, getListWithRemovedItems, HidingMap, IndexMap, LinkedPhysicalIndexToValueMap, PhysicalIndexToValueMap, TrimmingMap, createIndexMap */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _indexMapper_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./indexMapper.mjs */ "./node_modules/handsontable/translations/indexMapper.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IndexMapper", function() { return _indexMapper_mjs__WEBPACK_IMPORTED_MODULE_0__["IndexMapper"]; }); /* harmony import */ var _mapCollections_mapCollection_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mapCollections/mapCollection.mjs */ "./node_modules/handsontable/translations/mapCollections/mapCollection.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRegisteredMapsCounter", function() { return _mapCollections_mapCollection_mjs__WEBPACK_IMPORTED_MODULE_1__["getRegisteredMapsCounter"]; }); /* harmony import */ var _maps_utils_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./maps/utils/index.mjs */ "./node_modules/handsontable/translations/maps/utils/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getIncreasedIndexes", function() { return _maps_utils_index_mjs__WEBPACK_IMPORTED_MODULE_2__["getIncreasedIndexes"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDecreasedIndexes", function() { return _maps_utils_index_mjs__WEBPACK_IMPORTED_MODULE_2__["getDecreasedIndexes"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "alterUtilsFactory", function() { return _maps_utils_index_mjs__WEBPACK_IMPORTED_MODULE_2__["alterUtilsFactory"]; }); /* harmony import */ var _maps_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./maps/index.mjs */ "./node_modules/handsontable/translations/maps/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IndexesSequence", function() { return _maps_index_mjs__WEBPACK_IMPORTED_MODULE_3__["IndexesSequence"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getListWithInsertedItems", function() { return _maps_index_mjs__WEBPACK_IMPORTED_MODULE_3__["getListWithInsertedItems"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getListWithRemovedItems", function() { return _maps_index_mjs__WEBPACK_IMPORTED_MODULE_3__["getListWithRemovedItems"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HidingMap", function() { return _maps_index_mjs__WEBPACK_IMPORTED_MODULE_3__["HidingMap"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IndexMap", function() { return _maps_index_mjs__WEBPACK_IMPORTED_MODULE_3__["IndexMap"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LinkedPhysicalIndexToValueMap", function() { return _maps_index_mjs__WEBPACK_IMPORTED_MODULE_3__["LinkedPhysicalIndexToValueMap"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PhysicalIndexToValueMap", function() { return _maps_index_mjs__WEBPACK_IMPORTED_MODULE_3__["PhysicalIndexToValueMap"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TrimmingMap", function() { return _maps_index_mjs__WEBPACK_IMPORTED_MODULE_3__["TrimmingMap"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createIndexMap", function() { return _maps_index_mjs__WEBPACK_IMPORTED_MODULE_3__["createIndexMap"]; }); /***/ }), /***/ "./node_modules/handsontable/translations/indexMapper.mjs": /*!****************************************************************!*\ !*** ./node_modules/handsontable/translations/indexMapper.mjs ***! \****************************************************************/ /*! exports provided: IndexMapper */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndexMapper", function() { return IndexMapper; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.fill.js */ "./node_modules/core-js/modules/es.array.fill.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _maps_index_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./maps/index.mjs */ "./node_modules/handsontable/translations/maps/index.mjs"); /* harmony import */ var _mapCollections_index_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./mapCollections/index.mjs */ "./node_modules/handsontable/translations/mapCollections/index.mjs"); /* harmony import */ var _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../mixins/localHooks.mjs */ "./node_modules/handsontable/mixins/localHooks.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _changesObservable_observable_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./changesObservable/observable.mjs */ "./node_modules/handsontable/translations/changesObservable/observable.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * @class IndexMapper * @description * * Index mapper stores, registers and manages the indexes on the basis of calculations collected from the subsidiary maps. * It should be seen as a single source of truth (regarding row and column indexes, for example, their sequence, information if they are skipped in the process of rendering (hidden or trimmed), values linked to them) * for any operation that considers CRUD actions such as **insertion**, **movement**, **removal** etc, and is used to properly calculate physical and visual indexes translations in both ways. * It has a built-in cache that is updated only when the data or structure changes. * * **Physical index** is a type of an index from the sequence of indexes assigned to the data source rows or columns * (from 0 to n, where n is number of the cells on the axis of data set). * **Visual index** is a type of an index from the sequence of indexes assigned to rows or columns existing in {@link data-map DataMap} (from 0 to n, where n is number of the cells on the axis of data set). * **Renderable index** is a type of an index from the sequence of indexes assigned to rows or columns whose may be rendered (when they are in a viewport; from 0 to n, where n is number of the cells renderable on the axis). * * There are different kinds of index maps which may be registered in the collections and can be used by a reference. * They also expose public API and trigger two local hooks such as `init` (on initialization) and `change` (on change). * * These are: {@link indexes-sequence IndexesSequence}, {@link physical-index-to-value-map PhysicalIndexToValueMap}, {@link hiding-map HidingMap}, and {@link trimming-map TrimmingMap}. */ var IndexMapper = /*#__PURE__*/function () { function IndexMapper() { var _this = this; _classCallCheck(this, IndexMapper); /** * Map for storing the sequence of indexes. * * It is registered by default and may be used from API methods. * * @private * @type {IndexesSequence} */ this.indexesSequence = new _maps_index_mjs__WEBPACK_IMPORTED_MODULE_17__["IndexesSequence"](); /** * Collection for different trimming maps. Indexes marked as trimmed in any map WILL NOT be included in * the {@link data-map DataMap} and won't be rendered. * * @private * @type {MapCollection} */ this.trimmingMapsCollection = new _mapCollections_index_mjs__WEBPACK_IMPORTED_MODULE_18__["AggregatedCollection"](function (valuesForIndex) { return valuesForIndex.some(function (value) { return value === true; }); }, false); /** * Collection for different hiding maps. Indexes marked as hidden in any map WILL be included in the {@link data-map DataMap}, * but won't be rendered. * * @private * @type {MapCollection} */ this.hidingMapsCollection = new _mapCollections_index_mjs__WEBPACK_IMPORTED_MODULE_18__["AggregatedCollection"](function (valuesForIndex) { return valuesForIndex.some(function (value) { return value === true; }); }, false); /** * Collection for another kind of maps. There are stored mappings from indexes (visual or physical) to values. * * @private * @type {MapCollection} */ this.variousMapsCollection = new _mapCollections_index_mjs__WEBPACK_IMPORTED_MODULE_18__["MapCollection"](); /** * The class instance collects row and column index changes that happen while the Handsontable * is running. The object allows creating observers that you can subscribe. Each event represents * the index change (e.g., insert, removing, change index value), which can be consumed by a * developer to update its logic. * * @private * @type {ChangesObservable} */ this.hidingChangesObservable = new _changesObservable_observable_mjs__WEBPACK_IMPORTED_MODULE_22__["ChangesObservable"]({ initialIndexValue: false }); /** * Cache for list of not trimmed indexes, respecting the indexes sequence (physical indexes). * * Note: Please keep in mind that trimmed index can be also hidden. * * @private * @type {Array} */ this.notTrimmedIndexesCache = []; /** * Cache for list of not hidden indexes, respecting the indexes sequence (physical indexes). * * Note: Please keep in mind that hidden index can be also trimmed. * * @private * @type {Array} */ this.notHiddenIndexesCache = []; /** * Flag determining whether actions performed on index mapper have been batched. It's used for cache management. * * @private * @type {boolean} */ this.isBatched = false; /** * Flag determining whether any action on indexes sequence has been performed. It's used for cache management. * * @private * @type {boolean} */ this.indexesSequenceChanged = false; /** * Flag determining whether any action on trimmed indexes has been performed. It's used for cache management. * * @private * @type {boolean} */ this.trimmedIndexesChanged = false; /** * Flag determining whether any action on hidden indexes has been performed. It's used for cache management. * * @private * @type {boolean} */ this.hiddenIndexesChanged = false; /** * Physical indexes (respecting the sequence of indexes) which may be rendered (when they are in a viewport). * * @private * @type {Array} */ this.renderablePhysicalIndexesCache = []; /** * Visual indexes (native map's value) corresponding to physical indexes (native map's index). * * @private * @type {Map} */ this.fromPhysicalToVisualIndexesCache = new Map(); /** * Visual indexes (native map's value) corresponding to physical indexes (native map's index). * * @private * @type {Map} */ this.fromVisualToRenderableIndexesCache = new Map(); this.indexesSequence.addLocalHook('change', function () { _this.indexesSequenceChanged = true; // Sequence of stored indexes might change. _this.updateCache(); _this.runLocalHooks('change', _this.indexesSequence, null); }); this.trimmingMapsCollection.addLocalHook('change', function (changedMap) { _this.trimmedIndexesChanged = true; // Number of trimmed indexes might change. _this.updateCache(); _this.runLocalHooks('change', changedMap, _this.trimmingMapsCollection); }); this.hidingMapsCollection.addLocalHook('change', function (changedMap) { _this.hiddenIndexesChanged = true; // Number of hidden indexes might change. _this.updateCache(); _this.runLocalHooks('change', changedMap, _this.hidingMapsCollection); }); this.variousMapsCollection.addLocalHook('change', function (changedMap) { _this.runLocalHooks('change', changedMap, _this.variousMapsCollection); }); } /** * Suspends the cache update for this map. The method is helpful to group multiple * operations, which affects the cache. In this case, the cache will be updated once after * calling the `resumeOperations` method. */ _createClass(IndexMapper, [{ key: "suspendOperations", value: function suspendOperations() { this.isBatched = true; } /** * Resumes the cache update for this map. It recalculates the cache and restores the * default behavior where each map modification updates the cache. */ }, { key: "resumeOperations", value: function resumeOperations() { this.isBatched = false; this.updateCache(); } /** * It creates and returns the new instance of the ChangesObserver object. The object * allows listening to the index changes that happen while the Handsontable is running. * * @param {string} indexMapType The index map type which we want to observe. * Currently, only the 'hiding' index map types are observable. * @returns {ChangesObserver} */ }, { key: "createChangesObserver", value: function createChangesObserver(indexMapType) { if (indexMapType !== 'hiding') { throw new Error("Unsupported index map type \"".concat(indexMapType, "\".")); } return this.hidingChangesObservable.createObserver(); } /** * Creates and register the new IndexMap for specified IndexMapper instance. * * @param {string} indexName The uniq index name. * @param {string} mapType The index map type (e.q. "hiding, "trimming", "physicalIndexToValue"). * @param {*} [initValueOrFn] The initial value for the index map. * @returns {IndexMap} */ }, { key: "createAndRegisterIndexMap", value: function createAndRegisterIndexMap(indexName, mapType, initValueOrFn) { return this.registerMap(indexName, Object(_maps_index_mjs__WEBPACK_IMPORTED_MODULE_17__["createIndexMap"])(mapType, initValueOrFn)); } /** * Register map which provide some index mappings. Type of map determining to which collection it will be added. * * @param {string} uniqueName Name of the index map. It should be unique. * @param {IndexMap} indexMap Registered index map updated on items removal and insertion. * @returns {IndexMap} */ }, { key: "registerMap", value: function registerMap(uniqueName, indexMap) { if (this.trimmingMapsCollection.get(uniqueName) || this.hidingMapsCollection.get(uniqueName) || this.variousMapsCollection.get(uniqueName)) { throw Error("Map with name \"".concat(uniqueName, "\" has been already registered.")); } if (indexMap instanceof _maps_index_mjs__WEBPACK_IMPORTED_MODULE_17__["TrimmingMap"]) { this.trimmingMapsCollection.register(uniqueName, indexMap); } else if (indexMap instanceof _maps_index_mjs__WEBPACK_IMPORTED_MODULE_17__["HidingMap"]) { this.hidingMapsCollection.register(uniqueName, indexMap); } else { this.variousMapsCollection.register(uniqueName, indexMap); } var numberOfIndexes = this.getNumberOfIndexes(); /* We initialize map ony when we have full information about number of indexes and the dataset is not empty. Otherwise it's unnecessary. Initialization of empty array would not give any positive changes. After initializing it with number of indexes equal to 0 the map would be still empty. What's more there would be triggered not needed hook (no real change have occurred). Number of indexes is known after loading data (the `loadData` function from the `Core`). */ if (numberOfIndexes > 0) { indexMap.init(numberOfIndexes); } return indexMap; } /** * Unregister a map with given name. * * @param {string} name Name of the index map. */ }, { key: "unregisterMap", value: function unregisterMap(name) { this.trimmingMapsCollection.unregister(name); this.hidingMapsCollection.unregister(name); this.variousMapsCollection.unregister(name); } /** * Unregisters all collected index map instances from all map collection types. */ }, { key: "unregisterAll", value: function unregisterAll() { this.trimmingMapsCollection.unregisterAll(); this.hidingMapsCollection.unregisterAll(); this.variousMapsCollection.unregisterAll(); } /** * Get a physical index corresponding to the given visual index. * * @param {number} visualIndex Visual index. * @returns {number|null} Returns translated index mapped by passed visual index. */ }, { key: "getPhysicalFromVisualIndex", value: function getPhysicalFromVisualIndex(visualIndex) { // Index in the table boundaries provided by the `DataMap`. var physicalIndex = this.notTrimmedIndexesCache[visualIndex]; if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_21__["isDefined"])(physicalIndex)) { return physicalIndex; } return null; } /** * Get a physical index corresponding to the given renderable index. * * @param {number} renderableIndex Renderable index. * @returns {null|number} */ }, { key: "getPhysicalFromRenderableIndex", value: function getPhysicalFromRenderableIndex(renderableIndex) { var physicalIndex = this.renderablePhysicalIndexesCache[renderableIndex]; // Index in the renderable table boundaries. if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_21__["isDefined"])(physicalIndex)) { return physicalIndex; } return null; } /** * Get a visual index corresponding to the given physical index. * * @param {number} physicalIndex Physical index to search. * @returns {number|null} Returns a visual index of the index mapper. */ }, { key: "getVisualFromPhysicalIndex", value: function getVisualFromPhysicalIndex(physicalIndex) { var visualIndex = this.fromPhysicalToVisualIndexesCache.get(physicalIndex); // Index in the table boundaries provided by the `DataMap`. if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_21__["isDefined"])(visualIndex)) { return visualIndex; } return null; } /** * Get a visual index corresponding to the given renderable index. * * @param {number} renderableIndex Renderable index. * @returns {null|number} */ }, { key: "getVisualFromRenderableIndex", value: function getVisualFromRenderableIndex(renderableIndex) { return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(renderableIndex)); } /** * Get a renderable index corresponding to the given visual index. * * @param {number} visualIndex Visual index. * @returns {null|number} */ }, { key: "getRenderableFromVisualIndex", value: function getRenderableFromVisualIndex(visualIndex) { var renderableIndex = this.fromVisualToRenderableIndexesCache.get(visualIndex); // Index in the renderable table boundaries. if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_21__["isDefined"])(renderableIndex)) { return renderableIndex; } return null; } /** * Search for the first visible, not hidden index (represented by a visual index). * * @param {number} fromVisualIndex Visual start index. Starting point for finding destination index. Start point may be destination * point when handled index is NOT hidden. * @param {number} incrementBy We are searching for a next visible indexes by increasing (to be precise, or decreasing) indexes. * This variable represent indexes shift. We are looking for an index: * - for rows: from the left to the right (increasing indexes, then variable should have value 1) or * other way around (decreasing indexes, then variable should have the value -1) * - for columns: from the top to the bottom (increasing indexes, then variable should have value 1) * or other way around (decreasing indexes, then variable should have the value -1). * @param {boolean} searchAlsoOtherWayAround The argument determine if an additional other way around search should be * performed, when the search in the first direction had no effect in finding visual index. * @param {number} indexForNextSearch Visual index for next search, when the flag is truthy. * * @returns {number|null} Visual column index or `null`. */ }, { key: "getFirstNotHiddenIndex", value: function getFirstNotHiddenIndex(fromVisualIndex, incrementBy) { var searchAlsoOtherWayAround = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var indexForNextSearch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fromVisualIndex - incrementBy; var physicalIndex = this.getPhysicalFromVisualIndex(fromVisualIndex); // First or next (it may be end of the table) index is beyond the table boundaries. if (physicalIndex === null) { // Looking for the next index in the opposite direction. This conditional won't be fulfilled when we STARTED // the search from the index beyond the table boundaries. if (searchAlsoOtherWayAround === true && indexForNextSearch !== fromVisualIndex - incrementBy) { return this.getFirstNotHiddenIndex(indexForNextSearch, -incrementBy, false, indexForNextSearch); } return null; } if (this.isHidden(physicalIndex) === false) { return fromVisualIndex; } // Looking for the next index, as the current isn't visible. return this.getFirstNotHiddenIndex(fromVisualIndex + incrementBy, incrementBy, searchAlsoOtherWayAround, indexForNextSearch); } /** * Set default values for all indexes in registered index maps. * * @param {number} [length] Destination length for all stored index maps. */ }, { key: "initToLength", value: function initToLength() { var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getNumberOfIndexes(); this.notTrimmedIndexesCache = _toConsumableArray(new Array(length).keys()); this.notHiddenIndexesCache = _toConsumableArray(new Array(length).keys()); this.suspendOperations(); this.indexesSequence.init(length); this.trimmingMapsCollection.initEvery(length); this.resumeOperations(); // We move initialization of hidden collection to next batch for purpose of working on sequence of already trimmed indexes. this.suspendOperations(); this.hidingMapsCollection.initEvery(length); // It shouldn't reset the cache. this.variousMapsCollection.initEvery(length); this.resumeOperations(); this.runLocalHooks('init'); } /** * Get sequence of indexes. * * @returns {Array} Physical indexes. */ }, { key: "getIndexesSequence", value: function getIndexesSequence() { return this.indexesSequence.getValues(); } /** * Set completely new indexes sequence. * * @param {Array} indexes Physical indexes. */ }, { key: "setIndexesSequence", value: function setIndexesSequence(indexes) { this.indexesSequence.setValues(indexes); } /** * Get all NOT trimmed indexes. * * Note: Indexes marked as trimmed aren't included in a {@link data-map DataMap} and aren't rendered. * * @param {boolean} [readFromCache=true] Determine if read indexes from cache. * @returns {Array} List of physical indexes. Index of this native array is a "visual index", * value of this native array is a "physical index". */ }, { key: "getNotTrimmedIndexes", value: function getNotTrimmedIndexes() { var _this2 = this; var readFromCache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; if (readFromCache === true) { return this.notTrimmedIndexesCache; } var indexesSequence = this.getIndexesSequence(); return indexesSequence.filter(function (physicalIndex) { return _this2.isTrimmed(physicalIndex) === false; }); } /** * Get length of all NOT trimmed indexes. * * Note: Indexes marked as trimmed aren't included in a {@link data-map DataMap} and aren't rendered. * * @returns {number} */ }, { key: "getNotTrimmedIndexesLength", value: function getNotTrimmedIndexesLength() { return this.getNotTrimmedIndexes().length; } /** * Get all NOT hidden indexes. * * Note: Indexes marked as hidden are included in a {@link data-map DataMap}, but aren't rendered. * * @param {boolean} [readFromCache=true] Determine if read indexes from cache. * @returns {Array} List of physical indexes. Please keep in mind that index of this native array IS NOT a "visual index". */ }, { key: "getNotHiddenIndexes", value: function getNotHiddenIndexes() { var _this3 = this; var readFromCache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; if (readFromCache === true) { return this.notHiddenIndexesCache; } var indexesSequence = this.getIndexesSequence(); return indexesSequence.filter(function (physicalIndex) { return _this3.isHidden(physicalIndex) === false; }); } /** * Get length of all NOT hidden indexes. * * Note: Indexes marked as hidden are included in a {@link data-map DataMap}, but aren't rendered. * * @returns {number} */ }, { key: "getNotHiddenIndexesLength", value: function getNotHiddenIndexesLength() { return this.getNotHiddenIndexes().length; } /** * Get list of physical indexes (respecting the sequence of indexes) which may be rendered (when they are in a viewport). * * @param {boolean} [readFromCache=true] Determine if read indexes from cache. * @returns {Array} List of physical indexes. Index of this native array is a "renderable index", * value of this native array is a "physical index". */ }, { key: "getRenderableIndexes", value: function getRenderableIndexes() { var _this4 = this; var readFromCache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; if (readFromCache === true) { return this.renderablePhysicalIndexesCache; } var notTrimmedIndexes = this.getNotTrimmedIndexes(); return notTrimmedIndexes.filter(function (physicalIndex) { return _this4.isHidden(physicalIndex) === false; }); } /** * Get length of all NOT trimmed and NOT hidden indexes. * * @returns {number} */ }, { key: "getRenderableIndexesLength", value: function getRenderableIndexesLength() { return this.getRenderableIndexes().length; } /** * Get number of all indexes. * * @returns {number} */ }, { key: "getNumberOfIndexes", value: function getNumberOfIndexes() { return this.getIndexesSequence().length; } /** * Move indexes in the index mapper. * * @param {number|Array} movedIndexes Visual index(es) to move. * @param {number} finalIndex Visual index being a start index for the moved elements. */ }, { key: "moveIndexes", value: function moveIndexes(movedIndexes, finalIndex) { var _this5 = this; if (typeof movedIndexes === 'number') { movedIndexes = [movedIndexes]; } var physicalMovedIndexes = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayMap"])(movedIndexes, function (visualIndex) { return _this5.getPhysicalFromVisualIndex(visualIndex); }); var notTrimmedIndexesLength = this.getNotTrimmedIndexesLength(); var movedIndexesLength = movedIndexes.length; // Removing indexes without re-indexing. var listWithRemovedItems = Object(_maps_index_mjs__WEBPACK_IMPORTED_MODULE_17__["getListWithRemovedItems"])(this.getIndexesSequence(), physicalMovedIndexes); // When item(s) are moved after the last visible item we assign the last possible index. var destinationPosition = notTrimmedIndexesLength - movedIndexesLength; // Otherwise, we find proper index for inserted item(s). if (finalIndex + movedIndexesLength < notTrimmedIndexesLength) { // Physical index at final index position. var physicalIndex = listWithRemovedItems.filter(function (index) { return _this5.isTrimmed(index) === false; })[finalIndex]; destinationPosition = listWithRemovedItems.indexOf(physicalIndex); } // Adding indexes without re-indexing. this.setIndexesSequence(Object(_maps_index_mjs__WEBPACK_IMPORTED_MODULE_17__["getListWithInsertedItems"])(listWithRemovedItems, destinationPosition, physicalMovedIndexes)); } /** * Get whether index is trimmed. Index marked as trimmed isn't included in a {@link data-map DataMap} and isn't rendered. * * @param {number} physicalIndex Physical index. * @returns {boolean} */ }, { key: "isTrimmed", value: function isTrimmed(physicalIndex) { return this.trimmingMapsCollection.getMergedValueAtIndex(physicalIndex); } /** * Get whether index is hidden. Index marked as hidden is included in a {@link data-map DataMap}, but isn't rendered. * * @param {number} physicalIndex Physical index. * @returns {boolean} */ }, { key: "isHidden", value: function isHidden(physicalIndex) { return this.hidingMapsCollection.getMergedValueAtIndex(physicalIndex); } /** * Insert new indexes and corresponding mapping and update values of the others, for all stored index maps. * * @private * @param {number} firstInsertedVisualIndex First inserted visual index. * @param {number} amountOfIndexes Amount of inserted indexes. */ }, { key: "insertIndexes", value: function insertIndexes(firstInsertedVisualIndex, amountOfIndexes) { var nthVisibleIndex = this.getNotTrimmedIndexes()[firstInsertedVisualIndex]; var firstInsertedPhysicalIndex = Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_21__["isDefined"])(nthVisibleIndex) ? nthVisibleIndex : this.getNumberOfIndexes(); var insertionIndex = this.getIndexesSequence().includes(nthVisibleIndex) ? this.getIndexesSequence().indexOf(nthVisibleIndex) : this.getNumberOfIndexes(); var insertedIndexes = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_16__["arrayMap"])(new Array(amountOfIndexes).fill(firstInsertedPhysicalIndex), function (nextIndex, stepsFromStart) { return nextIndex + stepsFromStart; }); this.suspendOperations(); this.indexesSequence.insert(insertionIndex, insertedIndexes); this.trimmingMapsCollection.insertToEvery(insertionIndex, insertedIndexes); this.hidingMapsCollection.insertToEvery(insertionIndex, insertedIndexes); this.variousMapsCollection.insertToEvery(insertionIndex, insertedIndexes); this.resumeOperations(); } /** * Remove some indexes and corresponding mappings and update values of the others, for all stored index maps. * * @private * @param {Array} removedIndexes List of removed indexes. */ }, { key: "removeIndexes", value: function removeIndexes(removedIndexes) { this.suspendOperations(); this.indexesSequence.remove(removedIndexes); this.trimmingMapsCollection.removeFromEvery(removedIndexes); this.hidingMapsCollection.removeFromEvery(removedIndexes); this.variousMapsCollection.removeFromEvery(removedIndexes); this.resumeOperations(); } /** * Rebuild cache for some indexes. Every action on indexes sequence or indexes skipped in the process of rendering * by default reset cache, thus batching some index maps actions is recommended. * * @private * @param {boolean} [force=false] Determine if force cache update. */ }, { key: "updateCache", value: function updateCache() { var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var anyCachedIndexChanged = this.indexesSequenceChanged || this.trimmedIndexesChanged || this.hiddenIndexesChanged; if (force === true || this.isBatched === false && anyCachedIndexChanged === true) { this.trimmingMapsCollection.updateCache(); this.hidingMapsCollection.updateCache(); this.notTrimmedIndexesCache = this.getNotTrimmedIndexes(false); this.notHiddenIndexesCache = this.getNotHiddenIndexes(false); this.renderablePhysicalIndexesCache = this.getRenderableIndexes(false); this.cacheFromPhysicalToVisualIndexes(); this.cacheFromVisualToRenderabIendexes(); // Currently there's support only for the "hiding" map type. if (this.hiddenIndexesChanged) { this.hidingChangesObservable.emit(this.hidingMapsCollection.getMergedValues()); } this.runLocalHooks('cacheUpdated', { indexesSequenceChanged: this.indexesSequenceChanged, trimmedIndexesChanged: this.trimmedIndexesChanged, hiddenIndexesChanged: this.hiddenIndexesChanged }); this.indexesSequenceChanged = false; this.trimmedIndexesChanged = false; this.hiddenIndexesChanged = false; } } /** * Update cache for translations from physical to visual indexes. * * @private */ }, { key: "cacheFromPhysicalToVisualIndexes", value: function cacheFromPhysicalToVisualIndexes() { var nrOfNotTrimmedIndexes = this.getNotTrimmedIndexesLength(); this.fromPhysicalToVisualIndexesCache.clear(); for (var visualIndex = 0; visualIndex < nrOfNotTrimmedIndexes; visualIndex += 1) { var physicalIndex = this.getPhysicalFromVisualIndex(visualIndex); // Every visual index have corresponding physical index, but some physical indexes may don't have // corresponding visual indexes (physical indexes may represent trimmed indexes, beyond the table boundaries) this.fromPhysicalToVisualIndexesCache.set(physicalIndex, visualIndex); } } /** * Update cache for translations from visual to renderable indexes. * * @private */ }, { key: "cacheFromVisualToRenderabIendexes", value: function cacheFromVisualToRenderabIendexes() { var nrOfRenderableIndexes = this.getRenderableIndexesLength(); this.fromVisualToRenderableIndexesCache.clear(); for (var renderableIndex = 0; renderableIndex < nrOfRenderableIndexes; renderableIndex += 1) { // Can't use getRenderableFromVisualIndex here because we're building the cache here var physicalIndex = this.getPhysicalFromRenderableIndex(renderableIndex); var visualIndex = this.getVisualFromPhysicalIndex(physicalIndex); this.fromVisualToRenderableIndexesCache.set(visualIndex, renderableIndex); } } }]); return IndexMapper; }(); Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_20__["mixin"])(IndexMapper, _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_19__["default"]); /***/ }), /***/ "./node_modules/handsontable/translations/mapCollections/aggregatedCollection.mjs": /*!****************************************************************************************!*\ !*** ./node_modules/handsontable/translations/mapCollections/aggregatedCollection.mjs ***! \****************************************************************************************/ /*! exports provided: AggregatedCollection */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AggregatedCollection", function() { return AggregatedCollection; }); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _mapCollection_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./mapCollection.mjs */ "./node_modules/handsontable/translations/mapCollections/mapCollection.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /** * Collection of maps. This collection aggregate maps with the same type of values. Values from the registered maps * can be used to calculate a single result for particular index. */ var AggregatedCollection = /*#__PURE__*/function (_MapCollection) { _inherits(AggregatedCollection, _MapCollection); var _super = _createSuper(AggregatedCollection); function AggregatedCollection(aggregationFunction, fallbackValue) { var _this; _classCallCheck(this, AggregatedCollection); _this = _super.call(this); /** * List of merged values. Value for each index is calculated using values inside registered maps. * * @type {Array} */ _this.mergedValuesCache = []; /** * Function which do aggregation on the values for particular index. */ _this.aggregationFunction = aggregationFunction; /** * Fallback value when there is no calculated value for particular index. */ _this.fallbackValue = fallbackValue; return _this; } /** * Get merged values for all indexes. * * @param {boolean} [readFromCache=true] Determine if read results from the cache. * @returns {Array} */ _createClass(AggregatedCollection, [{ key: "getMergedValues", value: function getMergedValues() { var readFromCache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; if (readFromCache === true) { return this.mergedValuesCache; } if (this.getLength() === 0) { return []; } // Below variable stores values for every particular map. Example describing situation when we have 2 registered maps, // with length equal to 5. // // +---------+---------------------------------------------+ // | | indexes | // +---------+---------------------------------------------+ // | maps | 0 | 1 | 2 | 3 | 4 | // +---------+----------+-------+-------+-------+----------+ // | 0 | [[ value, value, value, value, value ], | // | 1 | [ value, value, value, value, value ]] | // +---------+----------+-------+-------+-------+----------+ var mapsValuesMatrix = Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_11__["arrayMap"])(this.get(), function (map) { return map.getValues(); }); // Below variable stores values for every particular index. Example describing situation when we have 2 registered maps, // with length equal to 5. // // +---------+---------------------+ // | | maps | // +---------+---------------------+ // | indexes | 0 | 1 | // +---------+----------+----------+ // | 0 | [[ value, value ], | // | 1 | [ value, value ], | // | 2 | [ value, value ], | // | 3 | [ value, value ], | // | 4 | [ value, value ]] | // +---------+----------+----------+ var indexesValuesMatrix = []; var mapsLength = Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_12__["isDefined"])(mapsValuesMatrix[0]) && mapsValuesMatrix[0].length || 0; for (var index = 0; index < mapsLength; index += 1) { var valuesForIndex = []; for (var mapIndex = 0; mapIndex < this.getLength(); mapIndex += 1) { valuesForIndex.push(mapsValuesMatrix[mapIndex][index]); } indexesValuesMatrix.push(valuesForIndex); } return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_11__["arrayMap"])(indexesValuesMatrix, this.aggregationFunction); } /** * Get merged value for particular index. * * @param {number} index Index for which we calculate single result. * @param {boolean} [readFromCache=true] Determine if read results from the cache. * @returns {*} */ }, { key: "getMergedValueAtIndex", value: function getMergedValueAtIndex(index, readFromCache) { var valueAtIndex = this.getMergedValues(readFromCache)[index]; return Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_12__["isDefined"])(valueAtIndex) ? valueAtIndex : this.fallbackValue; } /** * Rebuild cache for the collection. */ }, { key: "updateCache", value: function updateCache() { this.mergedValuesCache = this.getMergedValues(false); } }]); return AggregatedCollection; }(_mapCollection_mjs__WEBPACK_IMPORTED_MODULE_10__["MapCollection"]); /***/ }), /***/ "./node_modules/handsontable/translations/mapCollections/index.mjs": /*!*************************************************************************!*\ !*** ./node_modules/handsontable/translations/mapCollections/index.mjs ***! \*************************************************************************/ /*! exports provided: AggregatedCollection, MapCollection, getRegisteredMapsCounter */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _aggregatedCollection_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./aggregatedCollection.mjs */ "./node_modules/handsontable/translations/mapCollections/aggregatedCollection.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AggregatedCollection", function() { return _aggregatedCollection_mjs__WEBPACK_IMPORTED_MODULE_0__["AggregatedCollection"]; }); /* harmony import */ var _mapCollection_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mapCollection.mjs */ "./node_modules/handsontable/translations/mapCollections/mapCollection.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MapCollection", function() { return _mapCollection_mjs__WEBPACK_IMPORTED_MODULE_1__["MapCollection"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRegisteredMapsCounter", function() { return _mapCollection_mjs__WEBPACK_IMPORTED_MODULE_1__["getRegisteredMapsCounter"]; }); /***/ }), /***/ "./node_modules/handsontable/translations/mapCollections/mapCollection.mjs": /*!*********************************************************************************!*\ !*** ./node_modules/handsontable/translations/mapCollections/mapCollection.mjs ***! \*********************************************************************************/ /*! exports provided: MapCollection, getRegisteredMapsCounter */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MapCollection", function() { return MapCollection; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRegisteredMapsCounter", function() { return getRegisteredMapsCounter; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../mixins/localHooks.mjs */ "./node_modules/handsontable/mixins/localHooks.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } // Counter for checking if there is a memory leak. var registeredMaps = 0; /** * Collection of index maps having unique names. It allow us to perform bulk operations such as init, remove, insert on all index maps that have been registered in the collection. */ var MapCollection = /*#__PURE__*/function () { function MapCollection() { _classCallCheck(this, MapCollection); /** * Collection of index maps. * * @type {Map} */ this.collection = new Map(); } /** * Register custom index map. * * @param {string} uniqueName Unique name of the index map. * @param {IndexMap} indexMap Index map containing miscellaneous (i.e. Meta data, indexes sequence), updated after remove and insert data actions. */ _createClass(MapCollection, [{ key: "register", value: function register(uniqueName, indexMap) { var _this = this; if (this.collection.has(uniqueName) === false) { this.collection.set(uniqueName, indexMap); indexMap.addLocalHook('change', function () { return _this.runLocalHooks('change', indexMap); }); registeredMaps += 1; } } /** * Unregister custom index map. * * @param {string} name Name of the index map. */ }, { key: "unregister", value: function unregister(name) { var indexMap = this.collection.get(name); if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_7__["isDefined"])(indexMap)) { indexMap.destroy(); this.collection.delete(name); this.runLocalHooks('change', indexMap); registeredMaps -= 1; } } /** * Unregisters and destroys all collected index map instances. */ }, { key: "unregisterAll", value: function unregisterAll() { var _this2 = this; this.collection.forEach(function (indexMap, name) { return _this2.unregister(name); }); this.collection.clear(); } /** * Get index map for the provided name. * * @param {string} [name] Name of the index map. * @returns {Array|IndexMap} */ }, { key: "get", value: function get(name) { if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_7__["isUndefined"])(name)) { return Array.from(this.collection.values()); } return this.collection.get(name); } /** * Get collection size. * * @returns {number} */ }, { key: "getLength", value: function getLength() { return this.collection.size; } /** * Remove some indexes and corresponding mappings and update values of the others within all collection's index maps. * * @private * @param {Array} removedIndexes List of removed indexes. */ }, { key: "removeFromEvery", value: function removeFromEvery(removedIndexes) { this.collection.forEach(function (indexMap) { indexMap.remove(removedIndexes); }); } /** * Insert new indexes and corresponding mapping and update values of the others all collection's index maps. * * @private * @param {number} insertionIndex Position inside the actual list. * @param {Array} insertedIndexes List of inserted indexes. */ }, { key: "insertToEvery", value: function insertToEvery(insertionIndex, insertedIndexes) { this.collection.forEach(function (indexMap) { indexMap.insert(insertionIndex, insertedIndexes); }); } /** * Set default values to index maps within collection. * * @param {number} length Destination length for all stored maps. */ }, { key: "initEvery", value: function initEvery(length) { this.collection.forEach(function (indexMap) { indexMap.init(length); }); } }]); return MapCollection; }(); Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_8__["mixin"])(MapCollection, _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]); /** * @returns {number} */ function getRegisteredMapsCounter() { return registeredMaps; } /***/ }), /***/ "./node_modules/handsontable/translations/maps/hidingMap.mjs": /*!*******************************************************************!*\ !*** ./node_modules/handsontable/translations/maps/hidingMap.mjs ***! \*******************************************************************/ /*! exports provided: HidingMap */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HidingMap", function() { return HidingMap; }); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _physicalIndexToValueMap_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./physicalIndexToValueMap.mjs */ "./node_modules/handsontable/translations/maps/physicalIndexToValueMap.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /** * Map for storing mappings from an physical index to a boolean value. It stores information whether physical index is * included in a dataset, but skipped in the process of rendering. */ var HidingMap = /*#__PURE__*/function (_PhysicalIndexToValue) { _inherits(HidingMap, _PhysicalIndexToValue); var _super = _createSuper(HidingMap); function HidingMap() { var initValueOrFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; _classCallCheck(this, HidingMap); return _super.call(this, initValueOrFn); } /** * Get physical indexes which are hidden. * * Note: Indexes marked as hidden are included in a {@link DataMap}, but aren't rendered. * * @returns {Array} */ _createClass(HidingMap, [{ key: "getHiddenIndexes", value: function getHiddenIndexes() { return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_11__["arrayReduce"])(this.getValues(), function (indexesList, isHidden, physicalIndex) { if (isHidden) { indexesList.push(physicalIndex); } return indexesList; }, []); } }]); return HidingMap; }(_physicalIndexToValueMap_mjs__WEBPACK_IMPORTED_MODULE_10__["PhysicalIndexToValueMap"]); /***/ }), /***/ "./node_modules/handsontable/translations/maps/index.mjs": /*!***************************************************************!*\ !*** ./node_modules/handsontable/translations/maps/index.mjs ***! \***************************************************************/ /*! exports provided: IndexesSequence, getListWithInsertedItems, getListWithRemovedItems, HidingMap, IndexMap, LinkedPhysicalIndexToValueMap, PhysicalIndexToValueMap, TrimmingMap, createIndexMap */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIndexMap", function() { return createIndexMap; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _hidingMap_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hidingMap.mjs */ "./node_modules/handsontable/translations/maps/hidingMap.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HidingMap", function() { return _hidingMap_mjs__WEBPACK_IMPORTED_MODULE_5__["HidingMap"]; }); /* harmony import */ var _indexMap_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./indexMap.mjs */ "./node_modules/handsontable/translations/maps/indexMap.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IndexMap", function() { return _indexMap_mjs__WEBPACK_IMPORTED_MODULE_6__["IndexMap"]; }); /* harmony import */ var _linkedPhysicalIndexToValueMap_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./linkedPhysicalIndexToValueMap.mjs */ "./node_modules/handsontable/translations/maps/linkedPhysicalIndexToValueMap.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LinkedPhysicalIndexToValueMap", function() { return _linkedPhysicalIndexToValueMap_mjs__WEBPACK_IMPORTED_MODULE_7__["LinkedPhysicalIndexToValueMap"]; }); /* harmony import */ var _physicalIndexToValueMap_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./physicalIndexToValueMap.mjs */ "./node_modules/handsontable/translations/maps/physicalIndexToValueMap.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PhysicalIndexToValueMap", function() { return _physicalIndexToValueMap_mjs__WEBPACK_IMPORTED_MODULE_8__["PhysicalIndexToValueMap"]; }); /* harmony import */ var _trimmingMap_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./trimmingMap.mjs */ "./node_modules/handsontable/translations/maps/trimmingMap.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TrimmingMap", function() { return _trimmingMap_mjs__WEBPACK_IMPORTED_MODULE_9__["TrimmingMap"]; }); /* harmony import */ var _indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./indexesSequence.mjs */ "./node_modules/handsontable/translations/maps/indexesSequence.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IndexesSequence", function() { return _indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_10__["IndexesSequence"]; }); /* harmony import */ var _utils_indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/indexesSequence.mjs */ "./node_modules/handsontable/translations/maps/utils/indexesSequence.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getListWithInsertedItems", function() { return _utils_indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_11__["getListWithInsertedItems"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getListWithRemovedItems", function() { return _utils_indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_11__["getListWithRemovedItems"]; }); var availableIndexMapTypes = new Map([['hiding', _hidingMap_mjs__WEBPACK_IMPORTED_MODULE_5__["HidingMap"]], ['index', _indexMap_mjs__WEBPACK_IMPORTED_MODULE_6__["IndexMap"]], ['linkedPhysicalIndexToValue', _linkedPhysicalIndexToValueMap_mjs__WEBPACK_IMPORTED_MODULE_7__["LinkedPhysicalIndexToValueMap"]], ['physicalIndexToValue', _physicalIndexToValueMap_mjs__WEBPACK_IMPORTED_MODULE_8__["PhysicalIndexToValueMap"]], ['trimming', _trimmingMap_mjs__WEBPACK_IMPORTED_MODULE_9__["TrimmingMap"]]]); /** * Creates and returns new IndexMap instance. * * @param {string} mapType The type of the map. * @param {*} [initValueOrFn=null] Initial value or function for index map. * @returns {IndexMap} */ function createIndexMap(mapType) { var initValueOrFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; if (!availableIndexMapTypes.has(mapType)) { throw new Error("The provided map type (\"".concat(mapType, "\") does not exist.")); } return new (availableIndexMapTypes.get(mapType))(initValueOrFn); } /***/ }), /***/ "./node_modules/handsontable/translations/maps/indexMap.mjs": /*!******************************************************************!*\ !*** ./node_modules/handsontable/translations/maps/indexMap.mjs ***! \******************************************************************/ /*! exports provided: IndexMap */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndexMap", function() { return IndexMap; }); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_function_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers/function.mjs */ "./node_modules/handsontable/helpers/function.mjs"); /* harmony import */ var _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/localHooks.mjs */ "./node_modules/handsontable/mixins/localHooks.mjs"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * Map for storing mappings from an index to a value. */ var IndexMap = /*#__PURE__*/function () { function IndexMap() { var initValueOrFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; _classCallCheck(this, IndexMap); /** * List of values for particular indexes. * * @private * @type {Array} */ this.indexedValues = []; /** * Initial value or function for each existing index. * * @private * @type {*} */ this.initValueOrFn = initValueOrFn; } /** * Get full list of values for particular indexes. * * @returns {Array} */ _createClass(IndexMap, [{ key: "getValues", value: function getValues() { return this.indexedValues; } /** * Get value for the particular index. * * @param {number} index Index for which value is got. * @returns {*} */ }, { key: "getValueAtIndex", value: function getValueAtIndex(index) { var values = this.indexedValues; if (index < values.length) { return values[index]; } } /** * Set new values for particular indexes. * * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately. * * @param {Array} values List of set values. */ }, { key: "setValues", value: function setValues(values) { this.indexedValues = values.slice(); this.runLocalHooks('change'); } /** * Set new value for the particular index. * * @param {number} index The index. * @param {*} value The value to save. * * Note: Please keep in mind that it is not possible to set value beyond the map (not respecting already set * map's size). Please use the `setValues` method when you would like to extend the map. * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately. * * @returns {boolean} */ }, { key: "setValueAtIndex", value: function setValueAtIndex(index, value) { if (index < this.indexedValues.length) { this.indexedValues[index] = value; this.runLocalHooks('change'); return true; } return false; } /** * Clear all values to the defaults. */ }, { key: "clear", value: function clear() { this.setDefaultValues(); } /** * Get length of the index map. * * @returns {number} */ }, { key: "getLength", value: function getLength() { return this.getValues().length; } /** * Set default values for elements from `0` to `n`, where `n` is equal to the handled variable. * * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately. * * @private * @param {number} [length] Length of list. */ }, { key: "setDefaultValues", value: function setDefaultValues() { var _this = this; var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.indexedValues.length; this.indexedValues.length = 0; if (Object(_helpers_function_mjs__WEBPACK_IMPORTED_MODULE_3__["isFunction"])(this.initValueOrFn)) { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_1__["rangeEach"])(length - 1, function (index) { return _this.indexedValues.push(_this.initValueOrFn(index)); }); } else { Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_1__["rangeEach"])(length - 1, function () { return _this.indexedValues.push(_this.initValueOrFn); }); } this.runLocalHooks('change'); } /** * Initialize list with default values for particular indexes. * * @private * @param {number} length New length of indexed list. * @returns {IndexMap} */ }, { key: "init", value: function init(length) { this.setDefaultValues(length); this.runLocalHooks('init'); return this; } /** * Add values to the list. * * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately. * * @private */ }, { key: "insert", value: function insert() { this.runLocalHooks('change'); } /** * Remove values from the list. * * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately. * * @private */ }, { key: "remove", value: function remove() { this.runLocalHooks('change'); } /** * Destroys the Map instance. */ }, { key: "destroy", value: function destroy() { this.clearLocalHooks(); this.indexedValues = null; this.initValueOrFn = null; } }]); return IndexMap; }(); Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_2__["mixin"])(IndexMap, _mixins_localHooks_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]); /***/ }), /***/ "./node_modules/handsontable/translations/maps/indexesSequence.mjs": /*!*************************************************************************!*\ !*** ./node_modules/handsontable/translations/maps/indexesSequence.mjs ***! \*************************************************************************/ /*! exports provided: IndexesSequence */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndexesSequence", function() { return IndexesSequence; }); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _indexMap_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./indexMap.mjs */ "./node_modules/handsontable/translations/maps/indexMap.mjs"); /* harmony import */ var _utils_indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/indexesSequence.mjs */ "./node_modules/handsontable/translations/maps/utils/indexesSequence.mjs"); /* harmony import */ var _utils_index_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils/index.mjs */ "./node_modules/handsontable/translations/maps/utils/index.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /** * Map for storing mappings from an index to a physical index. * * It also updates the physical indexes (remaining in the map) on remove/add row or column action. */ var IndexesSequence = /*#__PURE__*/function (_IndexMap) { _inherits(IndexesSequence, _IndexMap); var _super = _createSuper(IndexesSequence); function IndexesSequence() { _classCallCheck(this, IndexesSequence); // Not handling custom init function or init value. return _super.call(this, function (index) { return index; }); } /** * Add values to list and reorganize. * * @private * @param {number} insertionIndex Position inside the list. * @param {Array} insertedIndexes List of inserted indexes. */ _createClass(IndexesSequence, [{ key: "insert", value: function insert(insertionIndex, insertedIndexes) { var listAfterUpdate = Object(_utils_index_mjs__WEBPACK_IMPORTED_MODULE_14__["getIncreasedIndexes"])(this.indexedValues, insertedIndexes); this.indexedValues = Object(_utils_indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_13__["getListWithInsertedItems"])(listAfterUpdate, insertionIndex, insertedIndexes); _get(_getPrototypeOf(IndexesSequence.prototype), "insert", this).call(this, insertionIndex, insertedIndexes); } /** * Remove values from the list and reorganize. * * @private * @param {Array} removedIndexes List of removed indexes. */ }, { key: "remove", value: function remove(removedIndexes) { var listAfterUpdate = Object(_utils_indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_13__["getListWithRemovedItems"])(this.indexedValues, removedIndexes); this.indexedValues = Object(_utils_index_mjs__WEBPACK_IMPORTED_MODULE_14__["getDecreasedIndexes"])(listAfterUpdate, removedIndexes); _get(_getPrototypeOf(IndexesSequence.prototype), "remove", this).call(this, removedIndexes); } }]); return IndexesSequence; }(_indexMap_mjs__WEBPACK_IMPORTED_MODULE_12__["IndexMap"]); /***/ }), /***/ "./node_modules/handsontable/translations/maps/linkedPhysicalIndexToValueMap.mjs": /*!***************************************************************************************!*\ !*** ./node_modules/handsontable/translations/maps/linkedPhysicalIndexToValueMap.mjs ***! \***************************************************************************************/ /*! exports provided: LinkedPhysicalIndexToValueMap */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedPhysicalIndexToValueMap", function() { return LinkedPhysicalIndexToValueMap; }); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _indexMap_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./indexMap.mjs */ "./node_modules/handsontable/translations/maps/indexMap.mjs"); /* harmony import */ var _utils_physicallyIndexed_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./utils/physicallyIndexed.mjs */ "./node_modules/handsontable/translations/maps/utils/physicallyIndexed.mjs"); /* harmony import */ var _utils_indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./utils/indexesSequence.mjs */ "./node_modules/handsontable/translations/maps/utils/indexesSequence.mjs"); /* harmony import */ var _utils_actionsOnIndexes_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./utils/actionsOnIndexes.mjs */ "./node_modules/handsontable/translations/maps/utils/actionsOnIndexes.mjs"); /* harmony import */ var _helpers_function_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../helpers/function.mjs */ "./node_modules/handsontable/helpers/function.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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; } /** * Map for storing mappings from an physical index to a value. Those entries are linked and stored in a certain order. * * It does not update stored values on remove/add row or column action. Otherwise, order of entries is updated after * such changes. */ var LinkedPhysicalIndexToValueMap = /*#__PURE__*/function (_IndexMap) { _inherits(LinkedPhysicalIndexToValueMap, _IndexMap); var _super = _createSuper(LinkedPhysicalIndexToValueMap); function LinkedPhysicalIndexToValueMap() { var _this; _classCallCheck(this, LinkedPhysicalIndexToValueMap); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); _defineProperty(_assertThisInitialized(_this), "orderOfIndexes", []); return _this; } _createClass(LinkedPhysicalIndexToValueMap, [{ key: "getValues", value: /** * Get full list of ordered values for particular indexes. * * @returns {Array} */ function getValues() { var _this2 = this; return this.orderOfIndexes.map(function (physicalIndex) { return _this2.indexedValues[physicalIndex]; }); } /** * Set new values for particular indexes. Entries are linked and stored in a certain order. * * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately. * * @param {Array} values List of set values. */ }, { key: "setValues", value: function setValues(values) { this.orderOfIndexes = _toConsumableArray(Array(values.length).keys()); _get(_getPrototypeOf(LinkedPhysicalIndexToValueMap.prototype), "setValues", this).call(this, values); } /** * Set value at index and add it to the linked list of entries. Entries are stored in a certain order. * * Note: Value will be added at the end of the queue. * * @param {number} index The index. * @param {*} value The value to save. * @param {number} position Position to which entry will be added. * * @returns {boolean} */ }, { key: "setValueAtIndex", value: function setValueAtIndex(index, value) { var position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.orderOfIndexes.length; if (index < this.indexedValues.length) { this.indexedValues[index] = value; if (this.orderOfIndexes.includes(index) === false) { this.orderOfIndexes.splice(position, 0, index); } this.runLocalHooks('change'); return true; } return false; } /** * Clear value for particular index. * * @param {number} physicalIndex Physical index. */ }, { key: "clearValue", value: function clearValue(physicalIndex) { this.orderOfIndexes = Object(_utils_indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_22__["getListWithRemovedItems"])(this.orderOfIndexes, [physicalIndex]); if (Object(_helpers_function_mjs__WEBPACK_IMPORTED_MODULE_24__["isFunction"])(this.initValueOrFn)) { _get(_getPrototypeOf(LinkedPhysicalIndexToValueMap.prototype), "setValueAtIndex", this).call(this, physicalIndex, this.initValueOrFn(physicalIndex)); } else { _get(_getPrototypeOf(LinkedPhysicalIndexToValueMap.prototype), "setValueAtIndex", this).call(this, physicalIndex, this.initValueOrFn); } } /** * Get length of the index map. * * @returns {number} */ }, { key: "getLength", value: function getLength() { return this.orderOfIndexes.length; } /** * Set default values for elements from `0` to `n`, where `n` is equal to the handled variable. * * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately. * * @private * @param {number} [length] Length of list. */ }, { key: "setDefaultValues", value: function setDefaultValues() { var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.indexedValues.length; this.orderOfIndexes.length = 0; _get(_getPrototypeOf(LinkedPhysicalIndexToValueMap.prototype), "setDefaultValues", this).call(this, length); } /** * Add values to list and reorganize. It updates list of indexes related to ordered values. * * @private * @param {number} insertionIndex Position inside the list. * @param {Array} insertedIndexes List of inserted indexes. */ }, { key: "insert", value: function insert(insertionIndex, insertedIndexes) { this.indexedValues = Object(_utils_physicallyIndexed_mjs__WEBPACK_IMPORTED_MODULE_21__["getListWithInsertedItems"])(this.indexedValues, insertionIndex, insertedIndexes, this.initValueOrFn); this.orderOfIndexes = Object(_utils_actionsOnIndexes_mjs__WEBPACK_IMPORTED_MODULE_23__["getIncreasedIndexes"])(this.orderOfIndexes, insertedIndexes); _get(_getPrototypeOf(LinkedPhysicalIndexToValueMap.prototype), "insert", this).call(this, insertionIndex, insertedIndexes); } /** * Remove values from the list and reorganize. It updates list of indexes related to ordered values. * * @private * @param {Array} removedIndexes List of removed indexes. */ }, { key: "remove", value: function remove(removedIndexes) { this.indexedValues = Object(_utils_physicallyIndexed_mjs__WEBPACK_IMPORTED_MODULE_21__["getListWithRemovedItems"])(this.indexedValues, removedIndexes); this.orderOfIndexes = Object(_utils_indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_22__["getListWithRemovedItems"])(this.orderOfIndexes, removedIndexes); this.orderOfIndexes = Object(_utils_actionsOnIndexes_mjs__WEBPACK_IMPORTED_MODULE_23__["getDecreasedIndexes"])(this.orderOfIndexes, removedIndexes); _get(_getPrototypeOf(LinkedPhysicalIndexToValueMap.prototype), "remove", this).call(this, removedIndexes); } /** * Get every entry containing index and value, respecting order of indexes. * * @returns {Array} */ }, { key: "getEntries", value: function getEntries() { var _this3 = this; return this.orderOfIndexes.map(function (physicalIndex) { return [physicalIndex, _this3.getValueAtIndex(physicalIndex)]; }); } }]); return LinkedPhysicalIndexToValueMap; }(_indexMap_mjs__WEBPACK_IMPORTED_MODULE_20__["IndexMap"]); /***/ }), /***/ "./node_modules/handsontable/translations/maps/physicalIndexToValueMap.mjs": /*!*********************************************************************************!*\ !*** ./node_modules/handsontable/translations/maps/physicalIndexToValueMap.mjs ***! \*********************************************************************************/ /*! exports provided: PhysicalIndexToValueMap */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PhysicalIndexToValueMap", function() { return PhysicalIndexToValueMap; }); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _indexMap_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./indexMap.mjs */ "./node_modules/handsontable/translations/maps/indexMap.mjs"); /* harmony import */ var _utils_physicallyIndexed_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/physicallyIndexed.mjs */ "./node_modules/handsontable/translations/maps/utils/physicallyIndexed.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /** * Map for storing mappings from an physical index to a value. * * Does not update stored values on remove/add row or column action. */ var PhysicalIndexToValueMap = /*#__PURE__*/function (_IndexMap) { _inherits(PhysicalIndexToValueMap, _IndexMap); var _super = _createSuper(PhysicalIndexToValueMap); function PhysicalIndexToValueMap() { _classCallCheck(this, PhysicalIndexToValueMap); return _super.apply(this, arguments); } _createClass(PhysicalIndexToValueMap, [{ key: "insert", value: /** * Add values to list and reorganize. * * @private * @param {number} insertionIndex Position inside the list. * @param {Array} insertedIndexes List of inserted indexes. */ function insert(insertionIndex, insertedIndexes) { this.indexedValues = Object(_utils_physicallyIndexed_mjs__WEBPACK_IMPORTED_MODULE_13__["getListWithInsertedItems"])(this.indexedValues, insertionIndex, insertedIndexes, this.initValueOrFn); _get(_getPrototypeOf(PhysicalIndexToValueMap.prototype), "insert", this).call(this, insertionIndex, insertedIndexes); } /** * Remove values from the list and reorganize. * * @private * @param {Array} removedIndexes List of removed indexes. */ }, { key: "remove", value: function remove(removedIndexes) { this.indexedValues = Object(_utils_physicallyIndexed_mjs__WEBPACK_IMPORTED_MODULE_13__["getListWithRemovedItems"])(this.indexedValues, removedIndexes); _get(_getPrototypeOf(PhysicalIndexToValueMap.prototype), "remove", this).call(this, removedIndexes); } }]); return PhysicalIndexToValueMap; }(_indexMap_mjs__WEBPACK_IMPORTED_MODULE_12__["IndexMap"]); /***/ }), /***/ "./node_modules/handsontable/translations/maps/trimmingMap.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/translations/maps/trimmingMap.mjs ***! \*********************************************************************/ /*! exports provided: TrimmingMap */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrimmingMap", function() { return TrimmingMap; }); /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js"); /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js"); /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _physicalIndexToValueMap_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./physicalIndexToValueMap.mjs */ "./node_modules/handsontable/translations/maps/physicalIndexToValueMap.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /** * Map for storing mappings from an physical index to a boolean value. It stores information whether physical index is * NOT included in a dataset and skipped in the process of rendering. */ var TrimmingMap = /*#__PURE__*/function (_PhysicalIndexToValue) { _inherits(TrimmingMap, _PhysicalIndexToValue); var _super = _createSuper(TrimmingMap); function TrimmingMap() { var initValueOrFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; _classCallCheck(this, TrimmingMap); return _super.call(this, initValueOrFn); } /** * Get physical indexes which are trimmed. * * Note: Indexes marked as trimmed aren't included in a {@link DataMap} and aren't rendered. * * @returns {Array} */ _createClass(TrimmingMap, [{ key: "getTrimmedIndexes", value: function getTrimmedIndexes() { return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_11__["arrayReduce"])(this.getValues(), function (indexesList, isTrimmed, physicalIndex) { if (isTrimmed) { indexesList.push(physicalIndex); } return indexesList; }, []); } }]); return TrimmingMap; }(_physicalIndexToValueMap_mjs__WEBPACK_IMPORTED_MODULE_10__["PhysicalIndexToValueMap"]); /***/ }), /***/ "./node_modules/handsontable/translations/maps/utils/actionsOnIndexes.mjs": /*!********************************************************************************!*\ !*** ./node_modules/handsontable/translations/maps/utils/actionsOnIndexes.mjs ***! \********************************************************************************/ /*! exports provided: getDecreasedIndexes, getIncreasedIndexes */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDecreasedIndexes", function() { return getDecreasedIndexes; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getIncreasedIndexes", function() { return getIncreasedIndexes; }); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); /** * Transform mappings after removal. * * @private * @param {Array} indexedValues List of values for particular indexes. * @param {Array} removedIndexes List of removed indexes. * @returns {Array} List with decreased indexes. */ function getDecreasedIndexes(indexedValues, removedIndexes) { return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_1__["arrayMap"])(indexedValues, function (index) { return index - removedIndexes.filter(function (removedIndex) { return removedIndex < index; }).length; }); } /** * Transform mappings after insertion. * * @private * @param {Array} indexedValues List of values for particular indexes. * @param {Array} insertedIndexes List of inserted indexes. * @returns {Array} List with increased indexes. */ function getIncreasedIndexes(indexedValues, insertedIndexes) { var firstInsertedIndex = insertedIndexes[0]; var amountOfIndexes = insertedIndexes.length; return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_1__["arrayMap"])(indexedValues, function (index) { if (index >= firstInsertedIndex) { return index + amountOfIndexes; } return index; }); } /***/ }), /***/ "./node_modules/handsontable/translations/maps/utils/index.mjs": /*!*********************************************************************!*\ !*** ./node_modules/handsontable/translations/maps/utils/index.mjs ***! \*********************************************************************/ /*! exports provided: getDecreasedIndexes, getIncreasedIndexes, alterUtilsFactory */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "alterUtilsFactory", function() { return alterUtilsFactory; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var _actionsOnIndexes_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./actionsOnIndexes.mjs */ "./node_modules/handsontable/translations/maps/utils/actionsOnIndexes.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDecreasedIndexes", function() { return _actionsOnIndexes_mjs__WEBPACK_IMPORTED_MODULE_5__["getDecreasedIndexes"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getIncreasedIndexes", function() { return _actionsOnIndexes_mjs__WEBPACK_IMPORTED_MODULE_5__["getIncreasedIndexes"]; }); /* harmony import */ var _indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./indexesSequence.mjs */ "./node_modules/handsontable/translations/maps/utils/indexesSequence.mjs"); /* harmony import */ var _physicallyIndexed_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./physicallyIndexed.mjs */ "./node_modules/handsontable/translations/maps/utils/physicallyIndexed.mjs"); var alterStrategies = new Map([['indexesSequence', { getListWithInsertedItems: _indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_6__["getListWithInsertedItems"], getListWithRemovedItems: _indexesSequence_mjs__WEBPACK_IMPORTED_MODULE_6__["getListWithRemovedItems"] }], ['physicallyIndexed', { getListWithInsertedItems: _physicallyIndexed_mjs__WEBPACK_IMPORTED_MODULE_7__["getListWithInsertedItems"], getListWithRemovedItems: _physicallyIndexed_mjs__WEBPACK_IMPORTED_MODULE_7__["getListWithRemovedItems"] }]]); var alterUtilsFactory = function alterUtilsFactory(indexationStrategy) { if (alterStrategies.has(indexationStrategy) === false) { throw new Error("Alter strategy with ID '".concat(indexationStrategy, "' does not exist.")); } return alterStrategies.get(indexationStrategy); }; /***/ }), /***/ "./node_modules/handsontable/translations/maps/utils/indexesSequence.mjs": /*!*******************************************************************************!*\ !*** ./node_modules/handsontable/translations/maps/utils/indexesSequence.mjs ***! \*******************************************************************************/ /*! exports provided: getListWithInsertedItems, getListWithRemovedItems */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getListWithInsertedItems", function() { return getListWithInsertedItems; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getListWithRemovedItems", function() { return getListWithRemovedItems; }); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /** * Insert new items to the list. * * @private * @param {Array} indexedValues List of values for particular indexes. * @param {number} insertionIndex Position inside the actual list. * @param {Array} insertedIndexes List of inserted indexes. * @returns {Array} List with new mappings. */ function getListWithInsertedItems(indexedValues, insertionIndex, insertedIndexes) { return [].concat(_toConsumableArray(indexedValues.slice(0, insertionIndex)), _toConsumableArray(insertedIndexes), _toConsumableArray(indexedValues.slice(insertionIndex))); } /** * Filter items from the list. * * @private * @param {Array} indexedValues List of values for particular indexes. * @param {Array} removedIndexes List of removed indexes. * @returns {Array} Reduced list of mappings. */ function getListWithRemovedItems(indexedValues, removedIndexes) { return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayFilter"])(indexedValues, function (index) { return removedIndexes.includes(index) === false; }); } /***/ }), /***/ "./node_modules/handsontable/translations/maps/utils/physicallyIndexed.mjs": /*!*********************************************************************************!*\ !*** ./node_modules/handsontable/translations/maps/utils/physicallyIndexed.mjs ***! \*********************************************************************************/ /*! exports provided: getListWithInsertedItems, getListWithRemovedItems */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getListWithInsertedItems", function() { return getListWithInsertedItems; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getListWithRemovedItems", function() { return getListWithRemovedItems; }); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _helpers_function_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../helpers/function.mjs */ "./node_modules/handsontable/helpers/function.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /** * Insert new items to the list. * * @private * @param {Array} indexedValues List of values for particular indexes. * @param {number} insertionIndex Position inside the actual list. * @param {Array} insertedIndexes List of inserted indexes. * @param {*} insertedValuesMapping Mapping which may provide value or function returning value for the specific parameters. * @returns {Array} List with new mappings. */ function getListWithInsertedItems(indexedValues, insertionIndex, insertedIndexes, insertedValuesMapping) { var firstInsertedIndex = insertedIndexes.length ? insertedIndexes[0] : void 0; return [].concat(_toConsumableArray(indexedValues.slice(0, firstInsertedIndex)), _toConsumableArray(insertedIndexes.map(function (insertedIndex, ordinalNumber) { if (Object(_helpers_function_mjs__WEBPACK_IMPORTED_MODULE_14__["isFunction"])(insertedValuesMapping)) { return insertedValuesMapping(insertedIndex, ordinalNumber); } return insertedValuesMapping; })), _toConsumableArray(firstInsertedIndex === void 0 ? [] : indexedValues.slice(firstInsertedIndex))); } /** * Filter items from the list. * * @private * @param {Array} indexedValues List of values for particular indexes. * @param {Array} removedIndexes List of removed indexes. * @returns {Array} Reduced list of mappings. */ function getListWithRemovedItems(indexedValues, removedIndexes) { return Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_15__["arrayFilter"])(indexedValues, function (_, index) { return removedIndexes.includes(index) === false; }); } /***/ }), /***/ "./node_modules/handsontable/utils/dataStructures/linkedList.mjs": /*!***********************************************************************!*\ !*** ./node_modules/handsontable/utils/dataStructures/linkedList.mjs ***! \***********************************************************************/ /*! exports provided: NodeStructure, default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NodeStructure", function() { return NodeStructure; }); 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; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * Refactored implementation of LinkedList (part of javascript-algorithms project) by Github users: * mgechev, AndriiHeonia, Microfed and Jakeh (part of javascript-algorithms project - all project contributors * at repository website). * * Link to repository: https://github.com/mgechev/javascript-algorithms. */ /** * Linked list node. * * @class NodeStructure * @util */ var NodeStructure = function NodeStructure(data) { _classCallCheck(this, NodeStructure); /** * Data of the node. * * @member {object} */ this.data = data; /** * Next node. * * @member {NodeStructure} */ this.next = null; /** * Previous node. * * @member {NodeStructure} */ this.prev = null; }; /** * Linked list. * * @class LinkedList * @util */ var LinkedList = /*#__PURE__*/function () { function LinkedList() { _classCallCheck(this, LinkedList); this.first = null; this.last = null; } /** * Add data to the end of linked list. * * @param {object} data Data which should be added. */ _createClass(LinkedList, [{ key: "push", value: function push(data) { var node = new NodeStructure(data); if (this.first === null) { this.first = node; this.last = node; } else { var temp = this.last; this.last = node; node.prev = temp; temp.next = node; } } /** * Add data to the beginning of linked list. * * @param {object} data Data which should be added. */ }, { key: "unshift", value: function unshift(data) { var node = new NodeStructure(data); if (this.first === null) { this.first = node; this.last = node; } else { var temp = this.first; this.first = node; node.next = temp; temp.prev = node; } } /** * In order traversal of the linked list. * * @param {Function} callback Callback which should be executed on each node. */ }, { key: "inorder", value: function inorder(callback) { var temp = this.first; while (temp) { callback(temp); temp = temp.next; } } /** * Remove data from the linked list. * * @param {object} data Data which should be removed. * @returns {boolean} Returns true if data has been removed. */ }, { key: "remove", value: function remove(data) { if (this.first === null) { return false; } var temp = this.first; var next; var prev; while (temp) { if (temp.data === data) { next = temp.next; prev = temp.prev; if (next) { next.prev = prev; } if (prev) { prev.next = next; } if (temp === this.first) { this.first = next; } if (temp === this.last) { this.last = prev; } return true; } temp = temp.next; } return false; } /** * Check if linked list contains cycle. * * @returns {boolean} Returns true if linked list contains cycle. */ }, { key: "hasCycle", value: function hasCycle() { var fast = this.first; var slow = this.first; while (true) { if (fast === null) { return false; } fast = fast.next; if (fast === null) { return false; } fast = fast.next; slow = slow.next; if (fast === slow) { return true; } } } /** * Return last node from the linked list. * * @returns {NodeStructure} Last node. */ }, { key: "pop", value: function pop() { if (this.last === null) { return null; } var temp = this.last; this.last = this.last.prev; return temp; } /** * Return first node from the linked list. * * @returns {NodeStructure} First node. */ }, { key: "shift", value: function shift() { if (this.first === null) { return null; } var temp = this.first; this.first = this.first.next; return temp; } /** * Reverses the linked list recursively. */ }, { key: "recursiveReverse", value: function recursiveReverse() { /** * @param {*} current The current value. * @param {*} next The next value. */ function inverse(current, next) { if (!next) { return; } inverse(next, next.next); next.next = current; } if (!this.first) { return; } inverse(this.first, this.first.next); this.first.next = null; var temp = this.first; this.first = this.last; this.last = temp; } /** * Reverses the linked list iteratively. */ }, { key: "reverse", value: function reverse() { if (!this.first || !this.first.next) { return; } var current = this.first.next; var prev = this.first; var temp; while (current) { temp = current.next; current.next = prev; prev.prev = current; prev = current; current = temp; } this.first.next = null; this.last.prev = null; temp = this.first; this.first = prev; this.last = temp; } }]); return LinkedList; }(); /* harmony default export */ __webpack_exports__["default"] = (LinkedList); /***/ }), /***/ "./node_modules/handsontable/utils/dataStructures/priorityMap.mjs": /*!************************************************************************!*\ !*** ./node_modules/handsontable/utils/dataStructures/priorityMap.mjs ***! \************************************************************************/ /*! exports provided: ASC, DESC, createPriorityMap */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ASC", function() { return ASC; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DESC", function() { return DESC; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPriorityMap", function() { return createPriorityMap; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.sort.js */ "./node_modules/core-js/modules/es.array.sort.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_function_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../helpers/function.mjs */ "./node_modules/handsontable/helpers/function.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var ASC = 'asc'; var DESC = 'desc'; var ORDER_MAP = new Map([[ASC, [-1, 1]], [DESC, [1, -1]]]); var DEFAULT_ERROR_PRIORITY_EXISTS = function DEFAULT_ERROR_PRIORITY_EXISTS(priority) { return "The priority '".concat(priority, "' is already declared in a map."); }; var DEFAULT_ERROR_PRIORITY_NAN = function DEFAULT_ERROR_PRIORITY_NAN(priority) { return "The priority '".concat(priority, "' is not a number."); }; /** * @typedef {object} PriorityMap * @property {Function} addItem Adds items to the priority map. * @property {Function} getItems Gets items from the passed map in a ASC or DESC order of priorities. */ /** * Creates a new priority map. * * @param {object} config The config for priority map. * @param {Function} config.errorPriorityExists The function to generate a custom error message if priority is already taken. * @param {Function} config.errorPriorityNaN The function to generate a custom error message if priority is not a number. * @returns {PriorityMap} */ function createPriorityMap() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, errorPriorityExists = _ref.errorPriorityExists, errorPriorityNaN = _ref.errorPriorityNaN; var priorityMap = new Map(); errorPriorityExists = Object(_helpers_function_mjs__WEBPACK_IMPORTED_MODULE_14__["isFunction"])(errorPriorityExists) ? errorPriorityExists : DEFAULT_ERROR_PRIORITY_EXISTS; errorPriorityNaN = Object(_helpers_function_mjs__WEBPACK_IMPORTED_MODULE_14__["isFunction"])(errorPriorityNaN) ? errorPriorityNaN : DEFAULT_ERROR_PRIORITY_NAN; /** * Adds items to priority map. Throws an error if `priority` is not a number or if is already added. * * @param {number} priority The priority for adding item. * @param {*} item The adding item. */ function addItem(priority, item) { if (!Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_13__["isNumeric"])(priority)) { throw new Error(errorPriorityNaN(priority)); } if (priorityMap.has(priority)) { throw new Error(errorPriorityExists(priority)); } priorityMap.set(priority, item); } /** * Gets items from the passed map in a ASC or DESC order of priorities. * * @param {string} [order] The order for getting items. ASC is an default. * @returns {*} */ function getItems() { var order = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ASC; var _ref2 = ORDER_MAP.get(order) || ORDER_MAP.get(ASC), _ref3 = _slicedToArray(_ref2, 2), left = _ref3[0], right = _ref3[1]; return _toConsumableArray(priorityMap) // we want to be sure we sort over a priority key // if we are sure we can remove custom compare function // then we should replace next line with a default `.sort()` .sort(function (a, b) { return a[0] < b[0] ? left : right; }).map(function (item) { return item[1]; }); } return { addItem: addItem, getItems: getItems }; } /***/ }), /***/ "./node_modules/handsontable/utils/dataStructures/tree.mjs": /*!*****************************************************************!*\ !*** ./node_modules/handsontable/utils/dataStructures/tree.mjs ***! \*****************************************************************/ /*! exports provided: TRAVERSAL_DF_PRE, depthFirstPreOrder, TRAVERSAL_DF_POST, TRAVERSAL_BF, default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRAVERSAL_DF_PRE", function() { return TRAVERSAL_DF_PRE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "depthFirstPreOrder", function() { return depthFirstPreOrder; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRAVERSAL_DF_POST", function() { return TRAVERSAL_DF_POST; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRAVERSAL_BF", function() { return TRAVERSAL_BF; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TreeNode; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /** * Depth-first pre-order strategy (https://en.wikipedia.org/wiki/Tree_traversal#Pre-order_(NLR)). * * @type {string} */ var TRAVERSAL_DF_PRE = 'DF-pre-order'; /** * @param {Function} callback A callback which will be called on each visited node. * @param {*} context A context to pass through. * @returns {boolean} */ function depthFirstPreOrder(callback, context) { var continueTraverse = callback.call(context, this); for (var i = 0; i < this.childs.length; i++) { if (continueTraverse === false) { return false; } continueTraverse = depthFirstPreOrder.call(this.childs[i], callback, context); } return continueTraverse; } /** * Depth-first post-order strategy (https://en.wikipedia.org/wiki/Tree_traversal#Post-order_(NLR)). * * @type {string} */ var TRAVERSAL_DF_POST = 'DF-post-order'; /** * @param {Function} callback A callback which will be called on each visited node. * @param {*} context A context to pass through. * @returns {boolean} */ function depthFirstPostOrder(callback, context) { for (var i = 0; i < this.childs.length; i++) { var continueTraverse = depthFirstPostOrder.call(this.childs[i], callback, context); if (continueTraverse === false) { return false; } } return callback.call(context, this); } /** * Breadth-first traversal strategy (https://en.wikipedia.org/wiki/Tree_traversal#Breadth-first_search_/_level_order). * * @type {string} */ var TRAVERSAL_BF = 'BF'; /** * @param {Function} callback A callback which will be called on each visited node. * @param {*} context A context to pass through. */ function breadthFirst(callback, context) { var queue = [this]; /** * Internal processor. */ function process() { if (queue.length === 0) { return; } var node = queue.shift(); queue.push.apply(queue, _toConsumableArray(node.childs)); if (callback.call(context, node) !== false) { process(); } } process(); } /** * Default strategy for tree traversal. * * @type {string} */ var DEFAULT_TRAVERSAL_STRATEGY = TRAVERSAL_BF; /** * Collection of all available tree traversal strategies. * * @type {Map} */ var TRAVERSAL_STRATEGIES = new Map([[TRAVERSAL_DF_PRE, depthFirstPreOrder], [TRAVERSAL_DF_POST, depthFirstPostOrder], [TRAVERSAL_BF, breadthFirst]]); /** * */ var TreeNode = /*#__PURE__*/function () { /** * A tree data. * * @type {object} */ /** * A parent node. * * @type {TreeNode} */ /** * A tree leaves. * * @type {TreeNode[]} */ function TreeNode(data) { _classCallCheck(this, TreeNode); _defineProperty(this, "data", {}); _defineProperty(this, "parent", null); _defineProperty(this, "childs", []); this.data = data; } /** * Adds a node to tree leaves. Added node is linked with the parent node through "parent" property. * * @param {TreeNode} node A TreeNode to add. */ _createClass(TreeNode, [{ key: "addChild", value: function addChild(node) { node.parent = this; this.childs.push(node); } /* eslint-disable jsdoc/require-description-complete-sentence */ /** * @memberof TreeNode# * @function cloneTree * * Clones a tree structure deeply. * * For example, for giving a tree structure: * .--(B1)--. * .-(C1) .-(C2)-.----. * (D1) (D2) (D3) (D4) * * Cloning a tree starting from C2 node creates a mirrored tree structure. * .-(C2')-.-----. * (D2') (D3') (D4') * * The cloned tree can be safely modified without affecting the original structure. * After modification, the clone can be merged with a tree using the "replaceTreeWith" method. * * @param {TreeNode} [nodeTree=this] A TreeNode to clone. * @returns {TreeNode} */ /* eslint-enable jsdoc/require-description-complete-sentence */ }, { key: "cloneTree", value: function cloneTree() { var nodeTree = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this; var clonedNode = new TreeNode(_objectSpread({}, nodeTree.data)); for (var i = 0; i < nodeTree.childs.length; i++) { clonedNode.addChild(this.cloneTree(nodeTree.childs[i])); } return clonedNode; } /** * Replaces the current node with a passed tree structure. * * @param {TreeNode} nodeTree A TreeNode to replace with. */ }, { key: "replaceTreeWith", value: function replaceTreeWith(nodeTree) { this.data = _objectSpread({}, nodeTree.data); this.childs = []; for (var i = 0; i < nodeTree.childs.length; i++) { this.addChild(nodeTree.childs[i]); } } /** * Traverses the tree structure through node childs. The walk down traversing supports * a three different strategies. * - Depth-first pre-order strategy (https://en.wikipedia.org/wiki/Tree_traversal#Pre-order_(NLR)); * - Depth-first post-order strategy (https://en.wikipedia.org/wiki/Tree_traversal#Post-order_(NLR)); * - Breadth-first traversal strategy (https://en.wikipedia.org/wiki/Tree_traversal#Breadth-first_search_/_level_order). * * @param {Function} callback The callback function which will be called for each node. * @param {string} [traversalStrategy=DEFAULT_TRAVERSAL_STRATEGY] Traversing strategy. */ }, { key: "walkDown", value: function walkDown(callback) { var traversalStrategy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_TRAVERSAL_STRATEGY; if (!TRAVERSAL_STRATEGIES.has(traversalStrategy)) { throw new Error("Traversal strategy \"".concat(traversalStrategy, "\" does not exist")); } TRAVERSAL_STRATEGIES.get(traversalStrategy).call(this, callback, this); } /** * Traverses the tree structure through node parents. * * @param {Function} callback The callback function which will be called for each node. */ }, { key: "walkUp", value: function walkUp(callback) { var context = this; var process = function process(node) { var continueTraverse = callback.call(context, node); if (continueTraverse !== false && node.parent !== null) { process(node.parent); } }; process(this); } }]); return TreeNode; }(); /***/ }), /***/ "./node_modules/handsontable/utils/dataStructures/uniqueMap.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/utils/dataStructures/uniqueMap.mjs ***! \**********************************************************************/ /*! exports provided: createUniqueMap */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUniqueMap", function() { return createUniqueMap; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.find.js */ "./node_modules/core-js/modules/es.array.find.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _helpers_function_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../helpers/function.mjs */ "./node_modules/handsontable/helpers/function.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var DEFAULT_ERROR_ID_EXISTS = function DEFAULT_ERROR_ID_EXISTS(id) { return "The id '".concat(id, "' is already declared in a map."); }; /** * @typedef {object} UniqueMap * @property {Function} addItem Adds a new item to the unique map. * @property {Function} clear Clears the map. * @property {Function} getId Returns ID for the passed item. * @property {Function} getItem Gets item from the passed ID. * @property {Function} getItems Gets all items from the map. * @property {Function} hasItem Verifies if the passed ID exists in a map. */ /** * Creates a new unique map. * * @param {object} config The config for priority queue. * @param {Function} config.errorIdExists The function to generate custom message if ID is already taken. * @returns {UniqueMap} */ function createUniqueMap() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, errorIdExists = _ref.errorIdExists; var uniqueMap = new Map(); errorIdExists = Object(_helpers_function_mjs__WEBPACK_IMPORTED_MODULE_12__["isFunction"])(errorIdExists) ? errorIdExists : DEFAULT_ERROR_ID_EXISTS; /** * Adds a new item to the unique map. Throws error if `id` is already added. * * @param {*} id The ID of the adding item. * @param {*} item The adding item. */ function addItem(id, item) { if (hasItem(id)) { throw new Error(errorIdExists(id)); } uniqueMap.set(id, item); } /** * Clears the map. */ function clear() { uniqueMap.clear(); } /** * Returns ID for the passed item. * * @param {*} item The item of the getting ID. * @returns {*} */ function getId(item) { var _ref2 = getItems().find(function (_ref4) { var _ref5 = _slicedToArray(_ref4, 2), id = _ref5[0], element = _ref5[1]; if (item === element) { return id; } return false; }) || [null], _ref3 = _slicedToArray(_ref2, 1), itemId = _ref3[0]; return itemId; } /** * Returns item from the passed ID. * * @param {*} id The ID of the getting item. * @returns {*} */ function getItem(id) { return uniqueMap.get(id); } /** * Gets all items from the map. * * @returns {Array} */ function getItems() { return _toConsumableArray(uniqueMap); } /** * Verifies if the passed ID exists in a map. * * @param {*} id The ID to check if registered. * @returns {boolean} */ function hasItem(id) { return uniqueMap.has(id); } return { addItem: addItem, clear: clear, getId: getId, getItem: getItem, getItems: getItems, hasItem: hasItem }; } /***/ }), /***/ "./node_modules/handsontable/utils/dataStructures/uniqueSet.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/utils/dataStructures/uniqueSet.mjs ***! \**********************************************************************/ /*! exports provided: createUniqueSet */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUniqueSet", function() { return createUniqueSet; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _helpers_function_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../helpers/function.mjs */ "./node_modules/handsontable/helpers/function.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } var DEFAULT_ERROR_ITEM_EXISTS = function DEFAULT_ERROR_ITEM_EXISTS(item) { return "'".concat(item, "' value is already declared in a unique set."); }; /** * @typedef {object} UniqueSet * @property {Function} addItem Adds items to the priority set. * @property {Function} getItems Gets items from the set in order of addition. */ /** * Creates a new unique set. * * @param {object} config The config for priority set. * @param {Function} config.errorItemExists The function to generate custom error message if item is already in the set. * @returns {UniqueSet} */ function createUniqueSet() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, errorItemExists = _ref.errorItemExists; var uniqueSet = new Set(); errorItemExists = Object(_helpers_function_mjs__WEBPACK_IMPORTED_MODULE_11__["isFunction"])(errorItemExists) ? errorItemExists : DEFAULT_ERROR_ITEM_EXISTS; /** * Adds items to the unique set. Throws an error if `item` is already added. * * @param {*} item The adding item. */ function addItem(item) { if (uniqueSet.has(item)) { throw new Error(errorItemExists(item)); } uniqueSet.add(item); } /** * Gets items from the set in order of addition. * * @returns {*} */ function getItems() { return _toConsumableArray(uniqueSet); } return { addItem: addItem, getItems: getItems }; } /***/ }), /***/ "./node_modules/handsontable/utils/ghostTable.mjs": /*!********************************************************!*\ !*** ./node_modules/handsontable/utils/ghostTable.mjs ***! \********************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.string.trim.js */ "./node_modules/core-js/modules/es.string.trim.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../helpers/dom/element.mjs */ "./node_modules/handsontable/helpers/dom/element.mjs"); /* harmony import */ var _helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../helpers/array.mjs */ "./node_modules/handsontable/helpers/array.mjs"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * @class GhostTable * @util */ var GhostTable = /*#__PURE__*/function () { function GhostTable(hotInstance) { _classCallCheck(this, GhostTable); /** * Handsontable instance. * * @type {Core} */ this.hot = hotInstance; /** * Container element where every table will be injected. * * @type {HTMLElement|null} */ this.container = null; /** * Flag which determine is table was injected to DOM. * * @type {boolean} */ this.injected = false; /** * Added rows collection. * * @type {Array} */ this.rows = []; /** * Added columns collection. * * @type {Array} */ this.columns = []; /** * Samples prepared for calculations. * * @type {Map} * @default {null} */ this.samples = null; /** * Ghost table settings. * * @type {object} * @default {Object} */ this.settings = { useHeaders: true }; } /** * Add row. * * @param {number} row Row index. * @param {Map} samples Samples Map object. */ _createClass(GhostTable, [{ key: "addRow", value: function addRow(row, samples) { if (this.columns.length) { throw new Error('Doesn\'t support multi-dimensional table'); } if (!this.rows.length) { this.container = this.createContainer(this.hot.rootElement.className); } var rowObject = { row: row }; this.rows.push(rowObject); this.samples = samples; this.table = this.createTable(this.hot.table.className); this.table.colGroup.appendChild(this.createColGroupsCol()); this.table.tr.appendChild(this.createRow(row)); this.container.container.appendChild(this.table.fragment); rowObject.table = this.table.table; } /** * Add a row consisting of the column headers. * * @param {Map} samples A map with sampled table values. */ }, { key: "addColumnHeadersRow", value: function addColumnHeadersRow(samples) { var colHeader = this.hot.getColHeader(0); if (colHeader !== null && colHeader !== void 0) { var rowObject = { row: -1 }; this.rows.push(rowObject); this.container = this.createContainer(this.hot.rootElement.className); this.samples = samples; this.table = this.createTable(this.hot.table.className); this.table.colGroup.appendChild(this.createColGroupsCol()); this.appendColumnHeadersRow(); this.container.container.appendChild(this.table.fragment); rowObject.table = this.table.table; } } /** * Add column. * * @param {number} column Column index. * @param {Map} samples A map with sampled table values. */ }, { key: "addColumn", value: function addColumn(column, samples) { if (this.rows.length) { throw new Error('Doesn\'t support multi-dimensional table'); } if (!this.columns.length) { this.container = this.createContainer(this.hot.rootElement.className); } var columnObject = { col: column }; this.columns.push(columnObject); this.samples = samples; this.table = this.createTable(this.hot.table.className); if (this.getSetting('useHeaders') && this.hot.getColHeader(column) !== null) { // Please keep in mind that the renderable column index equal to the visual columns index for the GhostTable. // We render all columns. this.hot.view.appendColHeader(column, this.table.th); } this.table.tBody.appendChild(this.createCol(column)); this.container.container.appendChild(this.table.fragment); columnObject.table = this.table.table; } /** * Get calculated heights. * * @param {Function} callback Callback which will be fired for each calculated row. */ }, { key: "getHeights", value: function getHeights(callback) { if (!this.injected) { this.injectTable(); } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(this.rows, function (row) { // -1 <- reduce border-top from table callback(row.row, Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_12__["outerHeight"])(row.table) - 1); }); } /** * Get calculated widths. * * @param {Function} callback Callback which will be fired for each calculated column. */ }, { key: "getWidths", value: function getWidths(callback) { if (!this.injected) { this.injectTable(); } Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(this.columns, function (column) { callback(column.col, Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_12__["outerWidth"])(column.table)); }); } /** * Set the Ghost Table settings to the provided object. * * @param {object} settings New Ghost Table Settings. */ }, { key: "setSettings", value: function setSettings(settings) { this.settings = settings; } /** * Set a single setting of the Ghost Table. * * @param {string} name Setting name. * @param {*} value Setting value. */ }, { key: "setSetting", value: function setSetting(name, value) { if (!this.settings) { this.settings = {}; } this.settings[name] = value; } /** * Get the Ghost Table settings. * * @returns {object|null} */ }, { key: "getSettings", value: function getSettings() { return this.settings; } /** * Get a single Ghost Table setting. * * @param {string} name The setting name to get. * @returns {boolean|null} */ }, { key: "getSetting", value: function getSetting(name) { if (this.settings) { return this.settings[name]; } return null; } /** * Create colgroup col elements. * * @returns {DocumentFragment} */ }, { key: "createColGroupsCol", value: function createColGroupsCol() { var _this = this; var fragment = this.hot.rootDocument.createDocumentFragment(); if (this.hot.hasRowHeaders()) { fragment.appendChild(this.createColElement(-1)); } this.samples.forEach(function (sample) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(sample.strings, function (string) { fragment.appendChild(_this.createColElement(string.col)); }); }); return fragment; } /** * Create table row element. * * @param {number} row Row index. * @returns {DocumentFragment} Returns created table row elements. */ }, { key: "createRow", value: function createRow(row) { var _this2 = this; var rootDocument = this.hot.rootDocument; var fragment = rootDocument.createDocumentFragment(); var th = rootDocument.createElement('th'); if (this.hot.hasRowHeaders()) { this.hot.view.appendRowHeader(row, th); fragment.appendChild(th); } this.samples.forEach(function (sample) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(sample.strings, function (string) { var column = string.col; var cellProperties = _this2.hot.getCellMeta(row, column); cellProperties.col = column; cellProperties.row = row; var renderer = _this2.hot.getCellRenderer(cellProperties); var td = rootDocument.createElement('td'); // 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(_this2.hot, td, row, column, _this2.hot.colToProp(column), string.value, cellProperties); fragment.appendChild(td); }); }); return fragment; } /** * Creates DOM elements for headers and appends them to the THEAD element of the table. */ }, { key: "appendColumnHeadersRow", value: function appendColumnHeadersRow() { var _this3 = this; var rootDocument = this.hot.rootDocument; var domFragment = rootDocument.createDocumentFragment(); var columnHeaders = []; if (this.hot.hasRowHeaders()) { var th = rootDocument.createElement('th'); columnHeaders.push([-1, th]); domFragment.appendChild(th); } this.samples.forEach(function (sample) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(sample.strings, function (string) { var column = string.col; var th = rootDocument.createElement('th'); columnHeaders.push([column, th]); domFragment.appendChild(th); }); }); // Appending DOM elements for headers this.table.tHead.appendChild(domFragment); Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(columnHeaders, function (columnHeader) { var _columnHeader = _slicedToArray(columnHeader, 2), column = _columnHeader[0], th = _columnHeader[1]; // Using source method for filling a header with value. _this3.hot.view.appendColHeader(column, th); }); } /** * Create table column elements. * * @param {number} column Column index. * @returns {DocumentFragment} Returns created column table column elements. */ }, { key: "createCol", value: function createCol(column) { var _this4 = this; var rootDocument = this.hot.rootDocument; var fragment = rootDocument.createDocumentFragment(); this.samples.forEach(function (sample) { Object(_helpers_array_mjs__WEBPACK_IMPORTED_MODULE_13__["arrayEach"])(sample.strings, function (string) { var row = string.row; var cellProperties = _this4.hot.getCellMeta(row, column); cellProperties.col = column; cellProperties.row = row; var renderer = _this4.hot.getCellRenderer(cellProperties); var td = rootDocument.createElement('td'); var tr = rootDocument.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); }); }); return fragment; } /** * Remove table from document and reset internal state. */ }, { key: "clean", value: function clean() { this.rows.length = 0; this.rows[-1] = void 0; this.columns.length = 0; if (this.samples) { this.samples.clear(); } this.samples = null; this.removeTable(); } /** * Inject generated table into document. * * @param {HTMLElement} [parent=null] The element to which the ghost table is injected. */ }, { key: "injectTable", value: function injectTable() { var parent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; if (!this.injected) { (parent || this.hot.rootElement).appendChild(this.container.fragment); this.injected = true; } } /** * Remove table from document. */ }, { key: "removeTable", value: function removeTable() { if (this.injected && this.container.container.parentNode) { this.container.container.parentNode.removeChild(this.container.container); this.container = null; this.injected = false; } } /** * Create col element. * * @param {number} column Column index. * @returns {HTMLElement} */ }, { key: "createColElement", value: function createColElement(column) { var col = this.hot.rootDocument.createElement('col'); col.style.width = "".concat(this.hot.view.wt.wtTable.getStretchedColumnWidth(column), "px"); return col; } /** * Create table element. * * @param {string} className The CSS classes to add. * @returns {object} */ }, { key: "createTable", value: function createTable() { var className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; var rootDocument = this.hot.rootDocument; var fragment = rootDocument.createDocumentFragment(); var table = rootDocument.createElement('table'); var tHead = rootDocument.createElement('thead'); var tBody = rootDocument.createElement('tbody'); var colGroup = rootDocument.createElement('colgroup'); var tr = rootDocument.createElement('tr'); var th = rootDocument.createElement('th'); if (this.isVertical()) { table.appendChild(colGroup); } if (this.isHorizontal()) { tr.appendChild(th); tHead.appendChild(tr); table.style.tableLayout = 'auto'; table.style.width = 'auto'; } table.appendChild(tHead); if (this.isVertical()) { tBody.appendChild(tr); } table.appendChild(tBody); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_12__["addClass"])(table, className); fragment.appendChild(table); return { fragment: fragment, table: table, tHead: tHead, tBody: tBody, colGroup: colGroup, tr: tr, th: th }; } /** * Create container for tables. * * @param {string} className The CSS classes to add. * @returns {object} */ }, { key: "createContainer", value: function createContainer() { var className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; var rootDocument = this.hot.rootDocument; var fragment = rootDocument.createDocumentFragment(); var container = rootDocument.createElement('div'); var containerClassName = "htGhostTable htAutoSize ".concat(className.trim()); Object(_helpers_dom_element_mjs__WEBPACK_IMPORTED_MODULE_12__["addClass"])(container, containerClassName); fragment.appendChild(container); return { fragment: fragment, container: container }; } /** * Checks if table is raised vertically (checking rows). * * @returns {boolean} */ }, { key: "isVertical", value: function isVertical() { return !!(this.rows.length && !this.columns.length); } /** * Checks if table is raised horizontally (checking columns). * * @returns {boolean} */ }, { key: "isHorizontal", value: function isHorizontal() { return !!(this.columns.length && !this.rows.length); } }]); return GhostTable; }(); /* harmony default export */ __webpack_exports__["default"] = (GhostTable); /***/ }), /***/ "./node_modules/handsontable/utils/keyStateObserver.mjs": /*!**************************************************************!*\ !*** ./node_modules/handsontable/utils/keyStateObserver.mjs ***! \**************************************************************/ /*! exports provided: _getRefCount, _resetState, isPressed, isPressedCtrlKey, startObserving, stopObserving */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_getRefCount", function() { return _getRefCount; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_resetState", function() { return _resetState; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPressed", function() { return isPressed; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPressedCtrlKey", function() { return isPressedCtrlKey; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startObserving", function() { return startObserving; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stopObserving", function() { return stopObserving; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.set.js */ "./node_modules/core-js/modules/es.set.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var _eventManager_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../eventManager.mjs */ "./node_modules/handsontable/eventManager.mjs"); /* harmony import */ var _helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/unicode.mjs */ "./node_modules/handsontable/helpers/unicode.mjs"); var eventManager = new _eventManager_mjs__WEBPACK_IMPORTED_MODULE_6__["default"](); var pressedKeys = new Set(); var refCount = 0; /** * Begins observing keyboard keys states. * * @param {Document} rootDocument The document owner. */ function startObserving(rootDocument) { if (refCount === 0) { eventManager.addEventListener(rootDocument, 'keydown', function (event) { if (!pressedKeys.has(event.keyCode)) { pressedKeys.add(event.keyCode); } }); eventManager.addEventListener(rootDocument, 'keyup', function (event) { if (pressedKeys.has(event.keyCode)) { pressedKeys.delete(event.keyCode); } }); eventManager.addEventListener(rootDocument, 'visibilitychange', function () { if (rootDocument.hidden) { pressedKeys.clear(); } }); eventManager.addEventListener(rootDocument.defaultView, 'blur', function () { pressedKeys.clear(); }); } refCount += 1; } /** * Stops observing keyboard keys states and clear all previously saved states. */ function stopObserving() { if (refCount > 0) { refCount -= 1; } if (refCount === 0) { _resetState(); } } /** * Remove all listeners attached to the DOM and clear all previously saved states. */ function _resetState() { eventManager.clearEvents(); pressedKeys.clear(); refCount = 0; } /** * Checks if provided keyCode or keyCodes are pressed. * * @param {string} keyCodes The key codes passed as a string defined in helpers/unicode.js file delimited with '|'. * @returns {boolean} */ function isPressed(keyCodes) { return Array.from(pressedKeys.values()).some(function (_keyCode) { return Object(_helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_7__["isKey"])(_keyCode, keyCodes); }); } /** * Checks if ctrl keys are pressed. * * @returns {boolean} */ function isPressedCtrlKey() { var values = Array.from(pressedKeys.values()); return values.some(function (_keyCode) { return Object(_helpers_unicode_mjs__WEBPACK_IMPORTED_MODULE_7__["isCtrlMetaKey"])(_keyCode); }); } /** * Returns reference count. Useful for debugging and testing purposes. * * @returns {number} */ function _getRefCount() { return refCount; } /***/ }), /***/ "./node_modules/handsontable/utils/parseTable.mjs": /*!********************************************************!*\ !*** ./node_modules/handsontable/utils/parseTable.mjs ***! \********************************************************/ /*! exports provided: instanceToHTML, _dataToHTML, htmlToGridSettings */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "instanceToHTML", function() { return instanceToHTML; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_dataToHTML", function() { return _dataToHTML; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "htmlToGridSettings", function() { return htmlToGridSettings; }); /* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.regexp.constructor.js */ "./node_modules/core-js/modules/es.regexp.constructor.js"); /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js"); /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js"); /* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.replace.js */ "./node_modules/core-js/modules/es.string.replace.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.splice.js */ "./node_modules/core-js/modules/es.array.splice.js"); /* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.match.js */ "./node_modules/core-js/modules/es.string.match.js"); /* harmony import */ var core_js_modules_es_array_last_index_of_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.last-index-of.js */ "./node_modules/core-js/modules/es.array.last-index-of.js"); /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ "./node_modules/core-js/modules/es.array.reduce.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.array.find-index.js */ "./node_modules/core-js/modules/es.array.find-index.js"); /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js"); /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } var ESCAPED_HTML_CHARS = { ' ': '\x20', '&': '&', '<': '<', '>': '>' }; var regEscapedChars = new RegExp(Object.keys(ESCAPED_HTML_CHARS).map(function (key) { return "(".concat(key, ")"); }).join('|'), 'gi'); /** * Verifies if node is an HTMLTable element. * * @param {Node} element Node to verify if it's an HTMLTable. * @returns {boolean} */ function isHTMLTable(element) { return (element && element.nodeName || '') === 'TABLE'; } /** * Converts Handsontable into HTMLTableElement. * * @param {Core} instance The Handsontable instance. * @returns {string} OuterHTML of the HTMLTableElement. */ function instanceToHTML(instance) { var hasColumnHeaders = instance.hasColHeaders(); var hasRowHeaders = instance.hasRowHeaders(); var coords = [hasColumnHeaders ? -1 : 0, hasRowHeaders ? -1 : 0, instance.countRows() - 1, instance.countCols() - 1]; var data = instance.getData.apply(instance, coords); var countRows = data.length; var countCols = countRows > 0 ? data[0].length : 0; var TABLE = ['
', '
']; var THEAD = hasColumnHeaders ? ['', ''] : []; var TBODY = ['', '']; var rowModifier = hasRowHeaders ? 1 : 0; var columnModifier = hasColumnHeaders ? 1 : 0; for (var row = 0; row < countRows; row += 1) { var isColumnHeadersRow = hasColumnHeaders && row === 0; var CELLS = []; for (var column = 0; column < countCols; column += 1) { var isRowHeadersColumn = !isColumnHeadersRow && hasRowHeaders && column === 0; var cell = ''; if (isColumnHeadersRow) { cell = "".concat(instance.getColHeader(column - rowModifier), ""); } else if (isRowHeadersColumn) { cell = "".concat(instance.getRowHeader(row - columnModifier), ""); } else { var cellData = data[row][column]; var _instance$getCellMeta = instance.getCellMeta(row - columnModifier, column - rowModifier), hidden = _instance$getCellMeta.hidden, rowspan = _instance$getCellMeta.rowspan, colspan = _instance$getCellMeta.colspan; if (!hidden) { var attrs = []; if (rowspan) { attrs.push("rowspan=\"".concat(rowspan, "\"")); } if (colspan) { attrs.push("colspan=\"".concat(colspan, "\"")); } if (Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_26__["isEmpty"])(cellData)) { cell = ""); } else { var value = cellData.toString().replace('<', '<').replace('>', '>').replace(/((\r\n|\n)?|\r\n|\n)/g, '
\r\n').replace(/\x20/gi, ' ').replace(/\t/gi, ' '); cell = "").concat(value, ""); } } } CELLS.push(cell); } var TR = [''].concat(CELLS, ['']).join(''); if (isColumnHeadersRow) { THEAD.splice(1, 0, TR); } else { TBODY.splice(-1, 0, TR); } } TABLE.splice(1, 0, THEAD.join(''), TBODY.join('')); return TABLE.join(''); } /** * Converts 2D array into HTMLTableElement. * * @param {Array} input Input array which will be converted to HTMLTable. * @returns {string} OuterHTML of the HTMLTableElement. */ // eslint-disable-next-line no-restricted-globals function _dataToHTML(input) { var inputLen = input.length; var result = ['']; for (var row = 0; row < inputLen; row += 1) { var rowData = input[row]; var columnsLen = rowData.length; var columnsResult = []; if (row === 0) { result.push(''); } for (var column = 0; column < columnsLen; column += 1) { var cellData = rowData[column]; var parsedCellData = Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_26__["isEmpty"])(cellData) ? '' : cellData.toString().replace(//g, '>').replace(/((\r\n|\n)?|\r\n|\n)/g, '
\r\n').replace(/\x20/gi, ' ').replace(/\t/gi, ' '); columnsResult.push("
")); } result.push.apply(result, [''].concat(columnsResult, [''])); if (row + 1 === inputLen) { result.push(''); } } result.push('
".concat(parsedCellData, "
'); return result.join(''); } /** * Converts HTMLTable or string into Handsontable configuration object. * * @param {Element|string} element Node element which should contain `...
`. * @param {Document} [rootDocument] The document window owner. * @returns {object} Return configuration object. Contains keys as DefaultSettings. */ // eslint-disable-next-line no-restricted-globals function htmlToGridSettings(element) { var rootDocument = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; var settingsObj = {}; var fragment = rootDocument.createDocumentFragment(); var tempElem = rootDocument.createElement('div'); fragment.appendChild(tempElem); var checkElement = element; if (typeof checkElement === 'string') { var escapedAdjacentHTML = checkElement.replace(/]*?>([\s\S]*?)<\/\s*td>/g, function (cellFragment) { var openingTag = cellFragment.match(/]*?>/g)[0]; var cellValue = cellFragment.substring(openingTag.length, cellFragment.lastIndexOf('<')).replace(/(<(?!br)([^>]+)>)/gi, ''); var closingTag = ''; return "".concat(openingTag).concat(cellValue).concat(closingTag); }); tempElem.insertAdjacentHTML('afterbegin', "".concat(escapedAdjacentHTML)); checkElement = tempElem.querySelector('table'); } if (!checkElement || !isHTMLTable(checkElement)) { return; } var generator = tempElem.querySelector('meta[name$="enerator"]'); var hasRowHeaders = checkElement.querySelector('tbody th') !== null; var trElement = checkElement.querySelector('tr'); var countCols = !trElement ? 0 : Array.from(trElement.cells).reduce(function (cols, cell) { return cols + cell.colSpan; }, 0) - (hasRowHeaders ? 1 : 0); var fixedRowsBottom = checkElement.tFoot && Array.from(checkElement.tFoot.rows) || []; var fixedRowsTop = []; var hasColHeaders = false; var thRowsLen = 0; var countRows = 0; if (checkElement.tHead) { var thRows = Array.from(checkElement.tHead.rows).filter(function (tr) { var isDataRow = tr.querySelector('td') !== null; if (isDataRow) { fixedRowsTop.push(tr); } return !isDataRow; }); thRowsLen = thRows.length; hasColHeaders = thRowsLen > 0; if (thRowsLen > 1) { settingsObj.nestedHeaders = Array.from(thRows).reduce(function (rows, row) { var headersRow = Array.from(row.cells).reduce(function (headers, header, currentIndex) { if (hasRowHeaders && currentIndex === 0) { return headers; } var colspan = header.colSpan, innerHTML = header.innerHTML; var nextHeader = colspan > 1 ? { label: innerHTML, colspan: colspan } : innerHTML; headers.push(nextHeader); return headers; }, []); rows.push(headersRow); return rows; }, []); } else if (hasColHeaders) { settingsObj.colHeaders = Array.from(thRows[0].children).reduce(function (headers, header, index) { if (hasRowHeaders && index === 0) { return headers; } headers.push(header.innerHTML); return headers; }, []); } } if (fixedRowsTop.length) { settingsObj.fixedRowsTop = fixedRowsTop.length; } if (fixedRowsBottom.length) { settingsObj.fixedRowsBottom = fixedRowsBottom.length; } var dataRows = [].concat(fixedRowsTop, _toConsumableArray(Array.from(checkElement.tBodies).reduce(function (sections, section) { sections.push.apply(sections, _toConsumableArray(Array.from(section.rows))); return sections; }, [])), _toConsumableArray(fixedRowsBottom)); countRows = dataRows.length; var dataArr = new Array(countRows); for (var r = 0; r < countRows; r++) { dataArr[r] = new Array(countCols); } var mergeCells = []; var rowHeaders = []; for (var row = 0; row < countRows; row++) { var tr = dataRows[row]; var cells = Array.from(tr.cells); var cellsLen = cells.length; for (var cellId = 0; cellId < cellsLen; cellId++) { var cell = cells[cellId]; var nodeName = cell.nodeName, innerHTML = cell.innerHTML, rowspan = cell.rowSpan, colspan = cell.colSpan; var col = dataArr[row].findIndex(function (value) { return value === void 0; }); if (nodeName === 'TD') { if (rowspan > 1 || colspan > 1) { for (var rstart = row; rstart < row + rowspan; rstart++) { if (rstart < countRows) { for (var cstart = col; cstart < col + colspan; cstart++) { dataArr[rstart][cstart] = null; } } } var styleAttr = cell.getAttribute('style'); var ignoreMerge = styleAttr && styleAttr.includes('mso-ignore:colspan'); if (!ignoreMerge) { mergeCells.push({ col: col, row: row, rowspan: rowspan, colspan: colspan }); } } var cellValue = ''; if (generator && /excel/gi.test(generator.content)) { cellValue = innerHTML.replace(/[\r\n][\x20]{0,2}/g, '\x20').replace(/[\r\n]?[\x20]{0,3}/gim, '\r\n'); } else { cellValue = innerHTML.replace(/[\r\n]?/gim, '\r\n'); } dataArr[row][col] = cellValue.replace(regEscapedChars, function (match) { return ESCAPED_HTML_CHARS[match]; }); } else { rowHeaders.push(innerHTML); } } } if (mergeCells.length) { settingsObj.mergeCells = mergeCells; } if (rowHeaders.length) { settingsObj.rowHeaders = rowHeaders; } if (dataArr.length) { settingsObj.data = dataArr; } return settingsObj; } /***/ }), /***/ "./node_modules/handsontable/utils/rootInstance.mjs": /*!**********************************************************!*\ !*** ./node_modules/handsontable/utils/rootInstance.mjs ***! \**********************************************************/ /*! exports provided: holder, rootInstanceSymbol, registerAsRootInstance, hasValidParameter, isRootInstance */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "holder", function() { return holder; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rootInstanceSymbol", function() { return rootInstanceSymbol; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerAsRootInstance", function() { return registerAsRootInstance; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasValidParameter", function() { return hasValidParameter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRootInstance", function() { return isRootInstance; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_weak_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.weak-map.js */ "./node_modules/core-js/modules/es.weak-map.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); var holder = new WeakMap(); var rootInstanceSymbol = Symbol('rootInstance'); /** * Register an object as a root instance. * * @param {object} object An object to associate with root instance flag. */ function registerAsRootInstance(object) { holder.set(object, true); } /** * Check if the source of the root indication call is valid. * * @param {symbol} rootSymbol A symbol as a source of truth. * @returns {boolean} */ function hasValidParameter(rootSymbol) { return rootSymbol === rootInstanceSymbol; } /** * Check if passed an object was flagged as a root instance. * * @param {object} object An object to check. * @returns {boolean} */ function isRootInstance(object) { return holder.has(object); } /***/ }), /***/ "./node_modules/handsontable/utils/samplesGenerator.mjs": /*!**************************************************************!*\ !*** ./node_modules/handsontable/utils/samplesGenerator.mjs ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js"); /* harmony import */ var _helpers_object_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../helpers/object.mjs */ "./node_modules/handsontable/helpers/object.mjs"); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); /* harmony import */ var _helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../helpers/mixed.mjs */ "./node_modules/handsontable/helpers/mixed.mjs"); 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"); } } 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; } /** * @class SamplesGenerator * @util */ var SamplesGenerator = /*#__PURE__*/function () { function SamplesGenerator(dataFactory) { _classCallCheck(this, SamplesGenerator); /** * Samples prepared for calculations. * * @type {Map} * @default {null} */ this.samples = null; /** * Function which give the data to collect samples. * * @type {Function} */ this.dataFactory = dataFactory; /** * Custom number of samples to take of each value length. * * @type {number} * @default {null} */ this.customSampleCount = null; /** * `true` if duplicate samples collection should be allowed, `false` otherwise. * * @type {boolean} * @default {false} */ this.allowDuplicates = false; } /** * Get the sample count for this instance. * * @returns {number} */ _createClass(SamplesGenerator, [{ key: "getSampleCount", value: function getSampleCount() { if (this.customSampleCount) { return this.customSampleCount; } return SamplesGenerator.SAMPLE_COUNT; } /** * Set the sample count. * * @param {number} sampleCount Number of samples to be collected. */ }, { key: "setSampleCount", value: function setSampleCount(sampleCount) { this.customSampleCount = sampleCount; } /** * Set if the generator should accept duplicate values. * * @param {boolean} allowDuplicates `true` to allow duplicate values. */ }, { key: "setAllowDuplicates", value: function setAllowDuplicates(allowDuplicates) { this.allowDuplicates = allowDuplicates; } /** * Generate samples for row. You can control which area should be sampled by passing `rowRange` object and `colRange` object. * * @param {object|number} rowRange The rows range to generate the samples. * @param {object} colRange The column range to generate the samples. * @returns {object} */ }, { key: "generateRowSamples", value: function generateRowSamples(rowRange, colRange) { return this.generateSamples('row', colRange, rowRange); } /** * Generate samples for column. You can control which area should be sampled by passing `colRange` object and `rowRange` object. * * @param {object} colRange Column index. * @param {object} rowRange Column index. * @returns {object} */ }, { key: "generateColumnSamples", value: function generateColumnSamples(colRange, rowRange) { return this.generateSamples('col', rowRange, colRange); } /** * Generate collection of samples. * * @param {string} type Type to generate. Can be `col` or `row`. * @param {object} range The range to generate the samples. * @param {object|number} specifierRange The range to generate the samples. * @returns {Map} */ }, { key: "generateSamples", value: function generateSamples(type, range, specifierRange) { var _this = this; var samples = new Map(); var _ref = typeof specifierRange === 'number' ? { from: specifierRange, to: specifierRange } : specifierRange, from = _ref.from, to = _ref.to; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_8__["rangeEach"])(from, to, function (index) { var sample = _this.generateSample(type, range, index); samples.set(index, sample); }); return samples; } /** * Generate sample for specified type (`row` or `col`). * * @param {string} type Samples type `row` or `col`. * @param {object} range The range to generate the samples. * @param {number} specifierValue The range to generate the samples. * @returns {Map} */ }, { key: "generateSample", value: function generateSample(type, range, specifierValue) { var _this2 = this; if (type !== 'row' && type !== 'col') { throw new Error('Unsupported sample type'); } var samples = new Map(); var computedKey = type === 'row' ? 'col' : 'row'; var sampledValues = []; Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_8__["rangeEach"])(range.from, range.to, function (index) { var _ref2 = type === 'row' ? _this2.dataFactory(specifierValue, index) : _this2.dataFactory(index, specifierValue), value = _ref2.value, bundleSeed = _ref2.bundleSeed; var hasCustomBundleSeed = typeof bundleSeed === 'string' && bundleSeed.length > 0; var seed; if (hasCustomBundleSeed) { seed = bundleSeed; } else if (Object(_helpers_object_mjs__WEBPACK_IMPORTED_MODULE_7__["isObject"])(value)) { seed = "".concat(Object.keys(value).length); } else if (Array.isArray(value)) { seed = "".concat(value.length); } else { seed = "".concat(Object(_helpers_mixed_mjs__WEBPACK_IMPORTED_MODULE_9__["stringify"])(value).length); } if (!samples.has(seed)) { samples.set(seed, { needed: _this2.getSampleCount(), strings: [] }); } var sample = samples.get(seed); if (sample.needed) { var duplicate = sampledValues.indexOf(value) > -1; if (!duplicate || _this2.allowDuplicates || hasCustomBundleSeed) { sample.strings.push(_defineProperty({ value: value }, computedKey, index)); sampledValues.push(value); sample.needed -= 1; } } }); return samples; } }], [{ key: "SAMPLE_COUNT", get: /** * Number of samples to take of each value length. * * @type {number} */ function get() { return 3; } }]); return SamplesGenerator; }(); /* harmony default export */ __webpack_exports__["default"] = (SamplesGenerator); /***/ }), /***/ "./node_modules/handsontable/utils/sortingAlgorithms/mergeSort.mjs": /*!*************************************************************************!*\ !*** ./node_modules/handsontable/utils/sortingAlgorithms/mergeSort.mjs ***! \*************************************************************************/ /*! exports provided: default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return mergeSort; }); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js"); /* harmony import */ var _dataStructures_linkedList_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dataStructures/linkedList.mjs */ "./node_modules/handsontable/utils/dataStructures/linkedList.mjs"); /** * 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 The first compared element. * @param {*} b The 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; // eslint-disable-line max-len 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 {Function} compareFunction The function with comparision logic. * @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 _dataStructures_linkedList_mjs__WEBPACK_IMPORTED_MODULE_2__["default"](); var rightElements = new _dataStructures_linkedList_mjs__WEBPACK_IMPORTED_MODULE_2__["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]); } if (_i < rightSize) { rightElements.push(array[middleIndex + _i]); } } var i = 0; 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; } /***/ }), /***/ "./node_modules/handsontable/utils/staticRegister.mjs": /*!************************************************************!*\ !*** ./node_modules/handsontable/utils/staticRegister.mjs ***! \************************************************************/ /*! exports provided: collection, default */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "collection", function() { return collection; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return staticRegister; }); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_es_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.map.js */ "./node_modules/core-js/modules/es.map.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } var collection = new Map(); /** * @param {string} namespace The namespace for the storage. * @returns {object} */ 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 specified 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 _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 _toConsumableArray(subCollection.values()); } return { register: register, getItem: getItem, hasItem: hasItem, getNames: getNames, getValues: getValues }; } /***/ }), /***/ "./node_modules/handsontable/validators/autocompleteValidator/autocompleteValidator.mjs": /*!**********************************************************************************************!*\ !*** ./node_modules/handsontable/validators/autocompleteValidator/autocompleteValidator.mjs ***! \**********************************************************************************************/ /*! exports provided: VALIDATOR_TYPE, autocompleteValidator */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VALIDATOR_TYPE", function() { return VALIDATOR_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autocompleteValidator", function() { return autocompleteValidator; }); var VALIDATOR_TYPE = 'autocomplete'; /** * The Autocomplete cell validator. * * @private * @param {*} value Value of edited cell. * @param {Function} callback Callback called with validation result. */ function autocompleteValidator(value, callback) { var valueToValidate = value; if (valueToValidate === null || valueToValidate === void 0) { valueToValidate = ''; } if (this.allowEmpty && valueToValidate === '') { callback(true); return; } if (this.strict && this.source) { if (typeof this.source === 'function') { this.source(valueToValidate, process(valueToValidate, callback)); } else { process(valueToValidate, callback)(this.source); } } else { callback(true); } } autocompleteValidator.VALIDATOR_TYPE = VALIDATOR_TYPE; /** * Function responsible for validation of autocomplete value. * * @param {*} value Value of edited cell. * @param {Function} callback Callback called with validation result. * @returns {Function} */ function process(value, callback) { var originalVal = value; return function (source) { var found = false; for (var s = 0, slen = source.length; s < slen; s++) { if (originalVal === source[s]) { found = true; // perfect match break; } } callback(found); }; } /***/ }), /***/ "./node_modules/handsontable/validators/autocompleteValidator/index.mjs": /*!******************************************************************************!*\ !*** ./node_modules/handsontable/validators/autocompleteValidator/index.mjs ***! \******************************************************************************/ /*! exports provided: VALIDATOR_TYPE, autocompleteValidator */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _autocompleteValidator_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./autocompleteValidator.mjs */ "./node_modules/handsontable/validators/autocompleteValidator/autocompleteValidator.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VALIDATOR_TYPE", function() { return _autocompleteValidator_mjs__WEBPACK_IMPORTED_MODULE_0__["VALIDATOR_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autocompleteValidator", function() { return _autocompleteValidator_mjs__WEBPACK_IMPORTED_MODULE_0__["autocompleteValidator"]; }); /***/ }), /***/ "./node_modules/handsontable/validators/dateValidator/dateValidator.mjs": /*!******************************************************************************!*\ !*** ./node_modules/handsontable/validators/dateValidator/dateValidator.mjs ***! \******************************************************************************/ /*! exports provided: VALIDATOR_TYPE, dateValidator, correctFormat */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VALIDATOR_TYPE", function() { return VALIDATOR_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dateValidator", function() { return dateValidator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "correctFormat", function() { return correctFormat; }); /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js"); /* harmony import */ var core_js_modules_es_string_search_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.string.search.js */ "./node_modules/core-js/modules/es.string.search.js"); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! moment */ "./node_modules/handsontable/node_modules/moment/moment.js"); /* harmony import */ var _editors_registry_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../editors/registry.mjs */ "./node_modules/handsontable/editors/registry.mjs"); /* harmony import */ var _editors_dateEditor_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../editors/dateEditor/index.mjs */ "./node_modules/handsontable/editors/dateEditor/index.mjs"); /* harmony import */ var _helpers_date_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../helpers/date.mjs */ "./node_modules/handsontable/helpers/date.mjs"); var VALIDATOR_TYPE = 'date'; /** * The Date cell validator. * * @private * @param {*} value Value of edited cell. * @param {Function} callback Callback called with validation result. */ function dateValidator(value, callback) { var dateEditor = Object(_editors_registry_mjs__WEBPACK_IMPORTED_MODULE_3__["getEditorInstance"])(_editors_dateEditor_index_mjs__WEBPACK_IMPORTED_MODULE_4__["EDITOR_TYPE"], this.instance); var valueToValidate = value; var valid = true; if (valueToValidate === null || valueToValidate === void 0) { valueToValidate = ''; } var isValidFormat = moment__WEBPACK_IMPORTED_MODULE_2__(valueToValidate, this.dateFormat || dateEditor.defaultDateFormat, true).isValid(); var isValidDate = moment__WEBPACK_IMPORTED_MODULE_2__(new Date(valueToValidate)).isValid() || isValidFormat; if (this.allowEmpty && valueToValidate === '') { isValidDate = true; isValidFormat = true; } if (!isValidDate) { valid = false; } if (!isValidDate && isValidFormat) { valid = true; } if (isValidDate && !isValidFormat) { if (this.correctFormat === true) { // if format correction is enabled var correctedValue = correctFormat(valueToValidate, this.dateFormat); var row = this.instance.toVisualRow(this.row); var column = this.instance.toVisualColumn(this.col); this.instance.setDataAtCell(row, column, correctedValue, 'dateValidator'); valid = true; } else { valid = false; } } callback(valid); } dateValidator.VALIDATOR_TYPE = VALIDATOR_TYPE; /** * Format the given string using moment.js' format feature. * * @param {string} value The value to format. * @param {string} dateFormat The date pattern to format to. * @returns {string} */ function correctFormat(value, dateFormat) { var dateFromDate = moment__WEBPACK_IMPORTED_MODULE_2__(Object(_helpers_date_mjs__WEBPACK_IMPORTED_MODULE_5__["getNormalizedDate"])(value)); var dateFromMoment = moment__WEBPACK_IMPORTED_MODULE_2__(value, dateFormat); var isAlphanumeric = value.search(/[A-z]/g) > -1; var date; if (dateFromDate.isValid() && dateFromDate.format('x') === dateFromMoment.format('x') || !dateFromMoment.isValid() || isAlphanumeric) { date = dateFromDate; } else { date = dateFromMoment; } return date.format(dateFormat); } /***/ }), /***/ "./node_modules/handsontable/validators/dateValidator/index.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/validators/dateValidator/index.mjs ***! \**********************************************************************/ /*! exports provided: VALIDATOR_TYPE, correctFormat, dateValidator */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _dateValidator_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dateValidator.mjs */ "./node_modules/handsontable/validators/dateValidator/dateValidator.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VALIDATOR_TYPE", function() { return _dateValidator_mjs__WEBPACK_IMPORTED_MODULE_0__["VALIDATOR_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "correctFormat", function() { return _dateValidator_mjs__WEBPACK_IMPORTED_MODULE_0__["correctFormat"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dateValidator", function() { return _dateValidator_mjs__WEBPACK_IMPORTED_MODULE_0__["dateValidator"]; }); /***/ }), /***/ "./node_modules/handsontable/validators/index.mjs": /*!********************************************************!*\ !*** ./node_modules/handsontable/validators/index.mjs ***! \********************************************************/ /*! exports provided: autocompleteValidator, AUTOCOMPLETE_VALIDATOR, dateValidator, DATE_VALIDATOR, numericValidator, NUMERIC_VALIDATOR, timeValidator, TIME_VALIDATOR, getRegisteredValidatorNames, getRegisteredValidators, getValidator, hasValidator, registerValidator */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _autocompleteValidator_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./autocompleteValidator/index.mjs */ "./node_modules/handsontable/validators/autocompleteValidator/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autocompleteValidator", function() { return _autocompleteValidator_index_mjs__WEBPACK_IMPORTED_MODULE_0__["autocompleteValidator"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AUTOCOMPLETE_VALIDATOR", function() { return _autocompleteValidator_index_mjs__WEBPACK_IMPORTED_MODULE_0__["VALIDATOR_TYPE"]; }); /* harmony import */ var _dateValidator_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dateValidator/index.mjs */ "./node_modules/handsontable/validators/dateValidator/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dateValidator", function() { return _dateValidator_index_mjs__WEBPACK_IMPORTED_MODULE_1__["dateValidator"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DATE_VALIDATOR", function() { return _dateValidator_index_mjs__WEBPACK_IMPORTED_MODULE_1__["VALIDATOR_TYPE"]; }); /* harmony import */ var _numericValidator_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./numericValidator/index.mjs */ "./node_modules/handsontable/validators/numericValidator/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "numericValidator", function() { return _numericValidator_index_mjs__WEBPACK_IMPORTED_MODULE_2__["numericValidator"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NUMERIC_VALIDATOR", function() { return _numericValidator_index_mjs__WEBPACK_IMPORTED_MODULE_2__["VALIDATOR_TYPE"]; }); /* harmony import */ var _timeValidator_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./timeValidator/index.mjs */ "./node_modules/handsontable/validators/timeValidator/index.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeValidator", function() { return _timeValidator_index_mjs__WEBPACK_IMPORTED_MODULE_3__["timeValidator"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TIME_VALIDATOR", function() { return _timeValidator_index_mjs__WEBPACK_IMPORTED_MODULE_3__["VALIDATOR_TYPE"]; }); /* harmony import */ var _registry_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./registry.mjs */ "./node_modules/handsontable/validators/registry.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRegisteredValidatorNames", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_4__["getRegisteredValidatorNames"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRegisteredValidators", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_4__["getRegisteredValidators"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getValidator", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_4__["getValidator"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasValidator", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_4__["hasValidator"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerValidator", function() { return _registry_mjs__WEBPACK_IMPORTED_MODULE_4__["registerValidator"]; }); /***/ }), /***/ "./node_modules/handsontable/validators/numericValidator/index.mjs": /*!*************************************************************************!*\ !*** ./node_modules/handsontable/validators/numericValidator/index.mjs ***! \*************************************************************************/ /*! exports provided: VALIDATOR_TYPE, numericValidator */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _numericValidator_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./numericValidator.mjs */ "./node_modules/handsontable/validators/numericValidator/numericValidator.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VALIDATOR_TYPE", function() { return _numericValidator_mjs__WEBPACK_IMPORTED_MODULE_0__["VALIDATOR_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "numericValidator", function() { return _numericValidator_mjs__WEBPACK_IMPORTED_MODULE_0__["numericValidator"]; }); /***/ }), /***/ "./node_modules/handsontable/validators/numericValidator/numericValidator.mjs": /*!************************************************************************************!*\ !*** ./node_modules/handsontable/validators/numericValidator/numericValidator.mjs ***! \************************************************************************************/ /*! exports provided: VALIDATOR_TYPE, numericValidator */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VALIDATOR_TYPE", function() { return VALIDATOR_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "numericValidator", function() { return numericValidator; }); /* harmony import */ var _helpers_number_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/number.mjs */ "./node_modules/handsontable/helpers/number.mjs"); var VALIDATOR_TYPE = 'numeric'; /** * The Numeric cell validator. * * @private * @param {*} value Value of edited cell. * @param {Function} callback Callback called with validation result. */ function numericValidator(value, callback) { var valueToValidate = value; if (valueToValidate === null || valueToValidate === void 0) { valueToValidate = ''; } if (this.allowEmpty && valueToValidate === '') { callback(true); } else if (valueToValidate === '') { callback(false); } else { callback(Object(_helpers_number_mjs__WEBPACK_IMPORTED_MODULE_0__["isNumeric"])(value)); } } numericValidator.VALIDATOR_TYPE = VALIDATOR_TYPE; /***/ }), /***/ "./node_modules/handsontable/validators/registry.mjs": /*!***********************************************************!*\ !*** ./node_modules/handsontable/validators/registry.mjs ***! \***********************************************************/ /*! exports provided: registerValidator, getValidator, hasValidator, getRegisteredValidatorNames, getRegisteredValidators */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerValidator", function() { return _register; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getValidator", function() { return _getItem; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasValidator", function() { return hasItem; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRegisteredValidatorNames", function() { return getNames; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRegisteredValidators", function() { return getValues; }); /* harmony import */ var _utils_staticRegister_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/staticRegister.mjs */ "./node_modules/handsontable/utils/staticRegister.mjs"); var _staticRegister = Object(_utils_staticRegister_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])('validators'), register = _staticRegister.register, getItem = _staticRegister.getItem, hasItem = _staticRegister.hasItem, getNames = _staticRegister.getNames, getValues = _staticRegister.getValues; /** * Retrieve validator function. * * @param {string} name Validator identification. * @returns {Function} Returns validator function. */ function _getItem(name) { if (typeof name === 'function') { return name; } if (!hasItem(name)) { throw Error("No registered validator found under \"".concat(name, "\" name")); } return getItem(name); } /** * Register validator under its alias. * * @param {string|Function} name Validator's alias or validator function with its descriptor. * @param {Function} [validator] Validator function. */ function _register(name, validator) { if (typeof name !== 'string') { validator = name; name = validator.VALIDATOR_TYPE; } register(name, validator); } /***/ }), /***/ "./node_modules/handsontable/validators/timeValidator/index.mjs": /*!**********************************************************************!*\ !*** ./node_modules/handsontable/validators/timeValidator/index.mjs ***! \**********************************************************************/ /*! exports provided: VALIDATOR_TYPE, timeValidator */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _timeValidator_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timeValidator.mjs */ "./node_modules/handsontable/validators/timeValidator/timeValidator.mjs"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VALIDATOR_TYPE", function() { return _timeValidator_mjs__WEBPACK_IMPORTED_MODULE_0__["VALIDATOR_TYPE"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeValidator", function() { return _timeValidator_mjs__WEBPACK_IMPORTED_MODULE_0__["timeValidator"]; }); /***/ }), /***/ "./node_modules/handsontable/validators/timeValidator/timeValidator.mjs": /*!******************************************************************************!*\ !*** ./node_modules/handsontable/validators/timeValidator/timeValidator.mjs ***! \******************************************************************************/ /*! exports provided: VALIDATOR_TYPE, timeValidator */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VALIDATOR_TYPE", function() { return VALIDATOR_TYPE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeValidator", function() { return timeValidator; }); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "./node_modules/handsontable/node_modules/moment/moment.js"); // Formats which are correctly parsed to time (supported by momentjs) var STRICT_FORMATS = ['YYYY-MM-DDTHH:mm:ss.SSSZ', 'X', // Unix timestamp 'x' // Unix ms timestamp ]; var VALIDATOR_TYPE = 'time'; /** * The Time cell validator. * * @private * @param {*} value Value of edited cell. * @param {Function} callback Callback called with validation result. */ function timeValidator(value, callback) { var timeFormat = this.timeFormat || 'h:mm:ss a'; var valid = true; var valueToValidate = value; if (valueToValidate === null) { valueToValidate = ''; } valueToValidate = /^\d{3,}$/.test(valueToValidate) ? parseInt(valueToValidate, 10) : valueToValidate; var twoDigitValue = /^\d{1,2}$/.test(valueToValidate); if (twoDigitValue) { valueToValidate += ':00'; } var date = moment__WEBPACK_IMPORTED_MODULE_0__(valueToValidate, STRICT_FORMATS, true).isValid() ? moment__WEBPACK_IMPORTED_MODULE_0__(valueToValidate) : moment__WEBPACK_IMPORTED_MODULE_0__(valueToValidate, timeFormat); var isValidTime = date.isValid(); // is it in the specified format var isValidFormat = moment__WEBPACK_IMPORTED_MODULE_0__(valueToValidate, timeFormat, true).isValid() && !twoDigitValue; if (this.allowEmpty && valueToValidate === '') { isValidTime = true; isValidFormat = true; } if (!isValidTime) { valid = false; } if (!isValidTime && isValidFormat) { valid = true; } if (isValidTime && !isValidFormat) { if (this.correctFormat === true) { // if format correction is enabled var correctedValue = date.format(timeFormat); var row = this.instance.toVisualRow(this.row); var column = this.instance.toVisualColumn(this.col); this.instance.setDataAtCell(row, column, correctedValue, 'timeValidator'); valid = true; } else { valid = false; } } callback(valid); } timeValidator.VALIDATOR_TYPE = VALIDATOR_TYPE; /***/ }), /***/ "./node_modules/jquery-ui-themes/themes/redmond/jquery-ui.min.css": /*!************************************************************************!*\ !*** ./node_modules/jquery-ui-themes/themes/redmond/jquery-ui.min.css ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "./node_modules/jquery-zoom/jquery.zoom.js": /*!*************************************************!*\ !*** ./node_modules/jquery-zoom/jquery.zoom.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports) { /*! Zoom 1.7.21 license: MIT http://www.jacklmoore.com/zoom */ (function ($) { var defaults = { url: false, callback: false, target: false, duration: 120, on: 'mouseover', // other options: grab, click, toggle touch: true, // enables a touch fallback onZoomIn: false, onZoomOut: false, magnify: 1 }; // Core Zoom Logic, independent of event listeners. $.zoom = function(target, source, img, magnify) { var targetHeight, targetWidth, sourceHeight, sourceWidth, xRatio, yRatio, offset, $target = $(target), position = $target.css('position'), $source = $(source); // The parent element needs positioning so that the zoomed element can be correctly positioned within. target.style.position = /(absolute|fixed)/.test(position) ? position : 'relative'; target.style.overflow = 'hidden'; img.style.width = img.style.height = ''; $(img) .addClass('zoomImg') .css({ position: 'absolute', top: 0, left: 0, opacity: 0, width: img.width * magnify, height: img.height * magnify, border: 'none', maxWidth: 'none', maxHeight: 'none' }) .appendTo(target); return { init: function() { targetWidth = $target.outerWidth(); targetHeight = $target.outerHeight(); if (source === target) { sourceWidth = targetWidth; sourceHeight = targetHeight; } else { sourceWidth = $source.outerWidth(); sourceHeight = $source.outerHeight(); } xRatio = (img.width - targetWidth) / sourceWidth; yRatio = (img.height - targetHeight) / sourceHeight; offset = $source.offset(); }, move: function (e) { var left = (e.pageX - offset.left), top = (e.pageY - offset.top); top = Math.max(Math.min(top, sourceHeight), 0); left = Math.max(Math.min(left, sourceWidth), 0); img.style.left = (left * -xRatio) + 'px'; img.style.top = (top * -yRatio) + 'px'; } }; }; $.fn.zoom = function (options) { return this.each(function () { var settings = $.extend({}, defaults, options || {}), //target will display the zoomed image target = settings.target && $(settings.target)[0] || this, //source will provide zoom location info (thumbnail) source = this, $source = $(source), img = document.createElement('img'), $img = $(img), mousemove = 'mousemove.zoom', clicked = false, touched = false; // If a url wasn't specified, look for an image element. if (!settings.url) { var srcElement = source.querySelector('img'); if (srcElement) { settings.url = srcElement.getAttribute('data-src') || srcElement.currentSrc || srcElement.src; } if (!settings.url) { return; } } $source.one('zoom.destroy', function(position, overflow){ $source.off(".zoom"); target.style.position = position; target.style.overflow = overflow; img.onload = null; $img.remove(); }.bind(this, target.style.position, target.style.overflow)); img.onload = function () { var zoom = $.zoom(target, source, img, settings.magnify); function start(e) { zoom.init(); zoom.move(e); // Skip the fade-in for IE8 and lower since it chokes on fading-in // and changing position based on mousemovement at the same time. $img.stop() .fadeTo($.support.opacity ? settings.duration : 0, 1, $.isFunction(settings.onZoomIn) ? settings.onZoomIn.call(img) : false); } function stop() { $img.stop() .fadeTo(settings.duration, 0, $.isFunction(settings.onZoomOut) ? settings.onZoomOut.call(img) : false); } // Mouse events if (settings.on === 'grab') { $source .on('mousedown.zoom', function (e) { if (e.which === 1) { $(document).one('mouseup.zoom', function () { stop(); $(document).off(mousemove, zoom.move); } ); start(e); $(document).on(mousemove, zoom.move); e.preventDefault(); } } ); } else if (settings.on === 'click') { $source.on('click.zoom', function (e) { if (clicked) { // bubble the event up to the document to trigger the unbind. return; } else { clicked = true; start(e); $(document).on(mousemove, zoom.move); $(document).one('click.zoom', function () { stop(); clicked = false; $(document).off(mousemove, zoom.move); } ); return false; } } ); } else if (settings.on === 'toggle') { $source.on('click.zoom', function (e) { if (clicked) { stop(); } else { start(e); } clicked = !clicked; } ); } else if (settings.on === 'mouseover') { zoom.init(); // Preemptively call init because IE7 will fire the mousemove handler before the hover handler. $source .on('mouseenter.zoom', start) .on('mouseleave.zoom', stop) .on(mousemove, zoom.move); } // Touch fallback if (settings.touch) { $source .on('touchstart.zoom', function (e) { e.preventDefault(); if (touched) { touched = false; stop(); } else { touched = true; start( e.originalEvent.touches[0] || e.originalEvent.changedTouches[0] ); } }) .on('touchmove.zoom', function (e) { e.preventDefault(); zoom.move( e.originalEvent.touches[0] || e.originalEvent.changedTouches[0] ); }) .on('touchend.zoom', function (e) { e.preventDefault(); if (touched) { touched = false; stop(); } }); } if ($.isFunction(settings.callback)) { settings.callback.call(img); } }; img.setAttribute('role', 'presentation'); img.alt = ''; img.src = settings.url; }); }; $.fn.zoom.defaults = defaults; }(window.jQuery)); /***/ }), /***/ "./node_modules/jquery.growl/javascripts/jquery.growl.js": /*!***************************************************************!*\ !*** ./node_modules/jquery.growl/javascripts/jquery.growl.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { 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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } // Generated by CoffeeScript 2.1.0 (function () { /* jQuery Growl Copyright 2015 Kevin Sylvestre 1.3.5 */ "use strict"; var $, Animation, Growl; $ = jQuery; Animation = function () { var Animation = function () { function Animation() { _classCallCheck(this, Animation); } _createClass(Animation, null, [{ key: "transition", value: function transition($el) { var el, ref, result, type; el = $el[0]; ref = this.transitions; for (type in ref) { result = ref[type]; if (el.style[type] != null) { return result; } } } }]); return Animation; }(); ; Animation.transitions = { "webkitTransition": "webkitTransitionEnd", "mozTransition": "mozTransitionEnd", "oTransition": "oTransitionEnd", "transition": "transitionend" }; return Animation; }(); Growl = function () { var Growl = function () { _createClass(Growl, null, [{ key: "growl", value: function growl() { var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return new Growl(settings); } }]); function Growl() { var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, Growl); this.render = this.render.bind(this); this.bind = this.bind.bind(this); this.unbind = this.unbind.bind(this); this.mouseEnter = this.mouseEnter.bind(this); this.mouseLeave = this.mouseLeave.bind(this); this.click = this.click.bind(this); this.close = this.close.bind(this); this.cycle = this.cycle.bind(this); this.waitAndDismiss = this.waitAndDismiss.bind(this); this.present = this.present.bind(this); this.dismiss = this.dismiss.bind(this); this.remove = this.remove.bind(this); this.animate = this.animate.bind(this); this.$growls = this.$growls.bind(this); this.$growl = this.$growl.bind(this); this.html = this.html.bind(this); this.content = this.content.bind(this); this.container = this.container.bind(this); this.settings = $.extend({}, Growl.settings, settings); this.initialize(this.settings.location); this.render(); } _createClass(Growl, [{ key: "initialize", value: function initialize(location) { var id; id = 'growls-' + location; return $('body:not(:has(#' + id + '))').append('
'); } }, { key: "render", value: function render() { var $growl; $growl = this.$growl(); this.$growls(this.settings.location).append($growl); if (this.settings.fixed) { this.present(); } else { this.cycle(); } } }, { key: "bind", value: function bind() { var $growl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.$growl(); $growl.on("click", this.click); if (this.settings.delayOnHover) { $growl.on("mouseenter", this.mouseEnter); $growl.on("mouseleave", this.mouseLeave); } return $growl.on("contextmenu", this.close).find("." + this.settings.namespace + "-close").on("click", this.close); } }, { key: "unbind", value: function unbind() { var $growl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.$growl(); $growl.off("click", this.click); if (this.settings.delayOnHover) { $growl.off("mouseenter", this.mouseEnter); $growl.off("mouseleave", this.mouseLeave); } return $growl.off("contextmenu", this.close).find("." + this.settings.namespace + "-close").off("click", this.close); } }, { key: "mouseEnter", value: function mouseEnter(event) { var $growl; $growl = this.$growl(); return $growl.stop(true, true); } }, { key: "mouseLeave", value: function mouseLeave(event) { return this.waitAndDismiss(); } }, { key: "click", value: function click(event) { if (this.settings.url != null) { event.preventDefault(); event.stopPropagation(); return window.open(this.settings.url); } } }, { key: "close", value: function close(event) { var $growl; event.preventDefault(); event.stopPropagation(); $growl = this.$growl(); return $growl.stop().queue(this.dismiss).queue(this.remove); } }, { key: "cycle", value: function cycle() { var $growl; $growl = this.$growl(); return $growl.queue(this.present).queue(this.waitAndDismiss()); } }, { key: "waitAndDismiss", value: function waitAndDismiss() { var $growl; $growl = this.$growl(); return $growl.delay(this.settings.duration).queue(this.dismiss).queue(this.remove); } }, { key: "present", value: function present(callback) { var $growl; $growl = this.$growl(); this.bind($growl); return this.animate($growl, this.settings.namespace + "-incoming", 'out', callback); } }, { key: "dismiss", value: function dismiss(callback) { var $growl; $growl = this.$growl(); this.unbind($growl); return this.animate($growl, this.settings.namespace + "-outgoing", 'in', callback); } }, { key: "remove", value: function remove(callback) { this.$growl().remove(); return typeof callback === "function" ? callback() : void 0; } }, { key: "animate", value: function animate($element, name) { var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'in'; var callback = arguments[3]; var transition; transition = Animation.transition($element); $element[direction === 'in' ? 'removeClass' : 'addClass'](name); $element.offset().position; $element[direction === 'in' ? 'addClass' : 'removeClass'](name); if (callback == null) { return; } if (transition != null) { $element.one(transition, callback); } else { callback(); } } }, { key: "$growls", value: function $growls(location) { var base; if (this.$_growls == null) { this.$_growls = []; } return (base = this.$_growls)[location] != null ? base[location] : base[location] = $('#growls-' + location); } }, { key: "$growl", value: function $growl() { return this.$_growl != null ? this.$_growl : this.$_growl = $(this.html()); } }, { key: "html", value: function html() { return this.container(this.content()); } }, { key: "content", value: function content() { return "
" + this.settings.close + "
\n
" + this.settings.title + "
\n
" + this.settings.message + "
"; } }, { key: "container", value: function container(content) { return "
\n " + content + "\n
"; } }]); return Growl; }(); ; Growl.settings = { namespace: 'growl', duration: 3200, close: "×", location: "default", style: "default", size: "medium", delayOnHover: true }; return Growl; }(); this.Growl = Growl; $.growl = function () { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return Growl.growl(options); }; $.growl.error = function () { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var settings; settings = { title: "Error!", style: "error" }; return $.growl($.extend(settings, options)); }; $.growl.notice = function () { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var settings; settings = { title: "Notice!", style: "notice" }; return $.growl($.extend(settings, options)); }; $.growl.warning = function () { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var settings; settings = { title: "Warning!", style: "warning" }; return $.growl($.extend(settings, options)); }; }).call(this); /***/ }), /***/ "./node_modules/jquery.growl/stylesheets/jquery.growl.css": /*!****************************************************************!*\ !*** ./node_modules/jquery.growl/stylesheets/jquery.growl.css ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "./node_modules/jquery.lighter/javascripts/jquery.lighter.js": /*!*******************************************************************!*\ !*** ./node_modules/jquery.lighter/javascripts/jquery.lighter.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { // Generated by CoffeeScript 1.9.3 /* jQuery Lighter Copyright 2015 Kevin Sylvestre 1.3.4 */ (function() { "use strict"; var $, Animation, Lighter, Slide, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; $ = jQuery; Animation = (function() { function Animation() {} Animation.transitions = { "webkitTransition": "webkitTransitionEnd", "mozTransition": "mozTransitionEnd", "oTransition": "oTransitionEnd", "transition": "transitionend" }; Animation.transition = function($el) { var el, i, len, ref, result, type; for (i = 0, len = $el.length; i < len; i++) { el = $el[i]; ref = this.transitions; for (type in ref) { result = ref[type]; if (el.style[type] != null) { return result; } } } }; Animation.execute = function($el, callback) { var transition; transition = this.transition($el); if (transition != null) { return $el.one(transition, callback); } else { return callback(); } }; return Animation; })(); Slide = (function() { function Slide(url) { this.url = url; } Slide.prototype.type = function() { switch (false) { case !this.url.match(/\.(webp|jpeg|jpg|jpe|gif|png|bmp)$/i): return 'image'; default: return 'unknown'; } }; Slide.prototype.preload = function(callback) { var image; image = new Image(); image.src = this.url; return image.onload = (function(_this) { return function() { _this.dimensions = { width: image.width, height: image.height }; return callback(_this); }; })(this); }; Slide.prototype.$content = function() { return $("").attr({ src: this.url }); }; return Slide; })(); Lighter = (function() { Lighter.namespace = "lighter"; Lighter.prototype.defaults = { loading: '#{Lighter.namespace}-loading', fetched: '#{Lighter.namespace}-fetched', padding: 40, dimensions: { width: 480, height: 480 }, template: "
\n
\n \n ×\n \n \n
\n
\n
\n
\n
\n
\n
\n
" }; Lighter.lighter = function($target, options) { var data; if (options == null) { options = {}; } data = $target.data('_lighter'); if (!data) { $target.data('_lighter', data = new Lighter($target, options)); } return data; }; Lighter.prototype.$ = function(selector) { return this.$el.find(selector); }; function Lighter($target, settings) { if (settings == null) { settings = {}; } this.show = bind(this.show, this); this.hide = bind(this.hide, this); this.observe = bind(this.observe, this); this.keyup = bind(this.keyup, this); this.size = bind(this.size, this); this.align = bind(this.align, this); this.process = bind(this.process, this); this.resize = bind(this.resize, this); this.type = bind(this.type, this); this.prev = bind(this.prev, this); this.next = bind(this.next, this); this.close = bind(this.close, this); this.$ = bind(this.$, this); this.$target = $target; this.settings = $.extend({}, this.defaults, settings); this.$el = $(this.settings.template); this.$overlay = this.$("." + Lighter.namespace + "-overlay"); this.$content = this.$("." + Lighter.namespace + "-content"); this.$container = this.$("." + Lighter.namespace + "-container"); this.$close = this.$("." + Lighter.namespace + "-close"); this.$prev = this.$("." + Lighter.namespace + "-prev"); this.$next = this.$("." + Lighter.namespace + "-next"); this.$body = this.$("." + Lighter.namespace + "-body"); this.dimensions = this.settings.dimensions; this.process(); } Lighter.prototype.close = function(event) { if (event != null) { event.preventDefault(); } if (event != null) { event.stopPropagation(); } return this.hide(); }; Lighter.prototype.next = function(event) { if (event != null) { event.preventDefault(); } return event != null ? event.stopPropagation() : void 0; }; Lighter.prototype.prev = function() { if (typeof event !== "undefined" && event !== null) { event.preventDefault(); } return typeof event !== "undefined" && event !== null ? event.stopPropagation() : void 0; }; Lighter.prototype.type = function(href) { if (href == null) { href = this.href(); } return this.settings.type || (this.href().match(/\.(webp|jpeg|jpg|jpe|gif|png|bmp)$/i) ? "image" : void 0); }; Lighter.prototype.resize = function(dimensions) { this.dimensions = dimensions; return this.align(); }; Lighter.prototype.process = function() { var fetched, loading; fetched = (function(_this) { return function() { return _this.$el.removeClass(Lighter.namespace + "-loading").addClass(Lighter.namespace + "-fetched"); }; })(this); loading = (function(_this) { return function() { return _this.$el.removeClass(Lighter.namespace + "-fetched").addClass(Lighter.namespace + "-loading"); }; })(this); this.slide = new Slide(this.$target.attr("href")); loading(); return this.slide.preload((function(_this) { return function(slide) { _this.resize(slide.dimensions); _this.$content.html(_this.slide.$content()); return fetched(); }; })(this)); }; Lighter.prototype.align = function() { var size; size = this.size(); return this.$container.css({ width: size.width, height: size.height, margin: "-" + (size.height / 2) + "px -" + (size.width / 2) + "px" }); }; Lighter.prototype.size = function() { var ratio; ratio = Math.max(this.dimensions.height / ($(window).height() - this.settings.padding), this.dimensions.width / ($(window).width() - this.settings.padding)); return { width: ratio > 1.0 ? Math.round(this.dimensions.width / ratio) : this.dimensions.width, height: ratio > 1.0 ? Math.round(this.dimensions.height / ratio) : this.dimensions.height }; }; Lighter.prototype.keyup = function(event) { if (event.target.form != null) { return; } if (event.which === 27) { this.close(); } if (event.which === 37) { this.prev(); } if (event.which === 39) { return this.next(); } }; Lighter.prototype.observe = function(method) { if (method == null) { method = 'on'; } $(window)[method]("resize", this.align); $(document)[method]("keyup", this.keyup); this.$overlay[method]("click", this.close); this.$close[method]("click", this.close); this.$next[method]("click", this.next); return this.$prev[method]("click", this.prev); }; Lighter.prototype.hide = function() { var alpha, omega; alpha = (function(_this) { return function() { return _this.observe('off'); }; })(this); omega = (function(_this) { return function() { return _this.$el.remove(); }; })(this); alpha(); this.$el.position(); this.$el.addClass(Lighter.namespace + "-fade"); return Animation.execute(this.$el, omega); }; Lighter.prototype.show = function() { var alpha, omega; omega = (function(_this) { return function() { return _this.observe('on'); }; })(this); alpha = (function(_this) { return function() { return $(document.body).append(_this.$el); }; })(this); alpha(); this.$el.position(); this.$el.removeClass(Lighter.namespace + "-fade"); return Animation.execute(this.$el, omega); }; return Lighter; })(); $.fn.extend({ lighter: function(option) { if (option == null) { option = {}; } return this.each(function() { var $this, action, options; $this = $(this); options = $.extend({}, $.fn.lighter.defaults, typeof option === "object" && option); action = typeof option === "string" ? option : option.action; if (action == null) { action = "show"; } return Lighter.lighter($this, options)[action](); }); } }); $(document).on("click", "[data-lighter]", function(event) { event.preventDefault(); event.stopPropagation(); return $(this).lighter(); }); }).call(this); /***/ }), /***/ "./node_modules/lodash/lodash.js": /*!***************************************!*\ !*** ./node_modules/lodash/lodash.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ ;(function() { /** Used as a safe reference for `undefined` in pre-ES5 environments. */ var undefined; /** Used as the semantic version number. */ var VERSION = '4.17.21'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** Error message constants. */ var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', FUNC_ERROR_TEXT = 'Expected a function', INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; /** Used as default options for `_.truncate`. */ var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = '...'; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /** Used to indicate the type of lazy iteratees. */ var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 1.7976931348623157e+308, NAN = 0 / 0; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; /** Used to associate wrap methods with their bit flags. */ var wrapFlags = [ ['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG] ]; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', asyncTag = '[object AsyncFunction]', boolTag = '[object Boolean]', dateTag = '[object Date]', domExcTag = '[object DOMException]', errorTag = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', nullTag = '[object Null]', objectTag = '[object Object]', promiseTag = '[object Promise]', proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]', undefinedTag = '[object Undefined]', weakMapTag = '[object WeakMap]', weakSetTag = '[object WeakSet]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to match empty string literals in compiled template source. */ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; /** Used to match HTML entities and HTML characters. */ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); /** Used to match template delimiters. */ var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); /** Used to match leading whitespace. */ var reTrimStart = /^\s+/; /** Used to match a single whitespace character. */ var reWhitespace = /\s/; /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; /** Used to match words composed of alphanumeric characters. */ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; /** * Used to validate the `validate` option in `_.template` variable. * * Forbids characters which could potentially change the meaning of the function argument definition: * - "()," (modification of function parameters) * - "=" (default value) * - "[]{}" (destructuring of function parameters) * - "/" (beginning of a comment) * - whitespace */ var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Used to match * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Used to match Latin Unicode letters (excluding mathematical operators). */ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; /** Used to ensure capturing order of template delimiters. */ var reNoMatch = /($^)/; /** Used to match unescaped characters in compiled string literals. */ var reUnescapedString = /['\n\r\u2028\u2029\\]/g; /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = '\\u2700-\\u27bf', rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', rsPunctuationRange = '\\u2000-\\u206f', rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', rsVarRange = '\\ufe0e\\ufe0f', rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; /** Used to compose unicode capture groups. */ var rsApos = "['\u2019]", rsAstral = '[' + rsAstralRange + ']', rsBreak = '[' + rsBreakRange + ']', rsCombo = '[' + rsComboRange + ']', rsDigits = '\\d+', rsDingbat = '[' + rsDingbatRange + ']', rsLower = '[' + rsLowerRange + ']', rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsUpper = '[' + rsUpperRange + ']', rsZWJ = '\\u200d'; /** Used to compose unicode regexes. */ var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match apostrophes. */ var reApos = RegExp(rsApos, 'g'); /** * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). */ var reComboMark = RegExp(rsCombo, 'g'); /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** Used to match complex or compound words. */ var reUnicodeWord = RegExp([ rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, rsUpper + '+' + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji ].join('|'), 'g'); /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); /** Used to detect strings that need a more robust regexp to match words. */ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; /** Used to assign default `context` object properties. */ var contextProps = [ 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' ]; /** Used to make template sourceURLs easier to identify. */ var templateCounter = -1; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; /** Used to map Latin Unicode letters to basic Latin letters. */ var deburredLetters = { // Latin-1 Supplement block. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', '\xc7': 'C', '\xe7': 'c', '\xd0': 'D', '\xf0': 'd', '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', '\xd1': 'N', '\xf1': 'n', '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', '\xc6': 'Ae', '\xe6': 'ae', '\xde': 'Th', '\xfe': 'th', '\xdf': 'ss', // Latin Extended-A block. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', '\u0134': 'J', '\u0135': 'j', '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', '\u0163': 't', '\u0165': 't', '\u0167': 't', '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', '\u0174': 'W', '\u0175': 'w', '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', '\u0132': 'IJ', '\u0133': 'ij', '\u0152': 'Oe', '\u0153': 'oe', '\u0149': "'n", '\u017f': 's' }; /** Used to map characters to HTML entities. */ var htmlEscapes = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; /** Used to map HTML entities to characters. */ var htmlUnescapes = { '&': '&', '<': '<', '>': '>', '"': '"', ''': "'" }; /** Used to escape characters for inclusion in compiled string literals. */ var stringEscapes = { '\\': '\\', "'": "'", '\n': 'n', '\r': 'r', '\u2028': 'u2028', '\u2029': 'u2029' }; /** Built-in method references without a dependency on `root`. */ var freeParseFloat = parseFloat, freeParseInt = parseInt; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); /* Node.js helper references. */ var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /*--------------------------------------------------------------------------*/ /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } /** * A specialized version of `baseAggregator` for arrays. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } /** * A specialized version of `_.forEachRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEachRight(array, iteratee) { var length = array == null ? 0 : array.length; while (length--) { if (iteratee(array[length], length, array) === false) { break; } } return array; } /** * A specialized version of `_.every` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. */ function arrayEvery(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (!predicate(array[index], index, array)) { return false; } } return true; } /** * A specialized version of `_.filter` for arrays without support for * iteratee shorthands. * * @private * @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 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } /** * A specialized version of `_.reduceRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the last element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; } /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } /** * Gets the size of an ASCII `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ var asciiSize = baseProperty('length'); /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function asciiToArray(string) { return string.split(''); } /** * Splits an ASCII `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function asciiWords(string) { return string.match(reAsciiWord) || []; } /** * The base implementation of methods like `_.findKey` and `_.findLastKey`, * without support for iteratee shorthands, which iterates over `collection` * using `eachFunc`. * * @private * @param {Array|Object} collection The collection to inspect. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the found element or its key, else `undefined`. */ function baseFindKey(collection, predicate, eachFunc) { var result; eachFunc(collection, function(value, key, collection) { if (predicate(value, key, collection)) { result = key; return false; } }); return result; } /** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } /** * This function is like `baseIndexOf` except that it accepts a comparator. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @param {Function} comparator The comparator invoked per element. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOfWith(array, value, fromIndex, comparator) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (comparator(array[index], value)) { return index; } } return -1; } /** * The base implementation of `_.isNaN` without support for number objects. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { return value !== value; } /** * The base implementation of `_.mean` and `_.meanBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the mean. */ function baseMean(array, iteratee) { var length = array == null ? 0 : array.length; return length ? (baseSum(array, iteratee) / length) : NAN; } /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.propertyOf` without support for deep paths. * * @private * @param {Object} object The object to query. * @returns {Function} Returns the new accessor function. */ function basePropertyOf(object) { return function(key) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. * @param {boolean} initAccum Specify using the first or last element of * `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; } /** * The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding * values. * * @private * @param {Array} array The array to sort. * @param {Function} comparer The function to define sort order. * @returns {Array} Returns `array`. */ function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } /** * The base implementation of `_.sum` and `_.sumBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the sum. */ function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current = iteratee(array[index]); if (current !== undefined) { result = result === undefined ? current : (result + current); } } return result; } /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } /** * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array * of key-value pairs for `object` corresponding to the property names of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the key-value pairs. */ function baseToPairs(object, props) { return arrayMap(props, function(key) { return [key, object[key]]; }); } /** * The base implementation of `_.trim`. * * @private * @param {string} string The string to trim. * @returns {string} Returns the trimmed string. */ function baseTrim(string) { return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') : string; } /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } /** * The base implementation of `_.values` and `_.valuesIn` which creates an * array of `object` property values corresponding to the property names * of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { return arrayMap(props, function(key) { return object[key]; }); } /** * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { return cache.has(key); } /** * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the first unmatched string symbol. */ function charsStartIndex(strSymbols, chrSymbols) { var index = -1, length = strSymbols.length; while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the last unmatched string symbol. */ function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Gets the number of `placeholder` occurrences in `array`. * * @private * @param {Array} array The array to inspect. * @param {*} placeholder The placeholder to search for. * @returns {number} Returns the placeholder count. */ function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } /** * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A * letters to basic Latin letters. * * @private * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. */ var deburrLetter = basePropertyOf(deburredLetters); /** * Used by `_.escape` to convert characters to HTML entities. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ var escapeHtmlChar = basePropertyOf(htmlEscapes); /** * Used by `_.template` to escape characters for inclusion in compiled string literals. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ function escapeStringChar(chr) { return '\\' + stringEscapes[chr]; } /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function hasUnicode(string) { return reHasUnicode.test(string); } /** * Checks if `string` contains a word composed of Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a word is found, else `false`. */ function hasUnicodeWord(string) { return reHasUnicodeWord.test(string); } /** * Converts `iterator` to an array. * * @private * @param {Object} iterator The iterator to convert. * @returns {Array} Returns the converted array. */ function iteratorToArray(iterator) { var data, result = []; while (!(data = iterator.next()).done) { result.push(data.value); } return result; } /** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key) { result[++index] = [key, value]; }); return result; } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * * @private * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; result[resIndex++] = index; } } return result; } /** * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = value; }); return result; } /** * Converts `set` to its value-value pairs. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the value-value pairs. */ function setToPairs(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = [value, value]; }); return result; } /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } /** * A specialized version of `_.lastIndexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictLastIndexOf(array, value, fromIndex) { var index = fromIndex + 1; while (index--) { if (array[index] === value) { return index; } } return index; } /** * Gets the number of symbols in `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the string size. */ function stringSize(string) { return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); } /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } /** * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace * character of `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the index of the last non-whitespace character. */ function trimmedEndIndex(string) { var index = string.length; while (index-- && reWhitespace.test(string.charAt(index))) {} return index; } /** * Used by `_.unescape` to convert HTML entities to characters. * * @private * @param {string} chr The matched character to unescape. * @returns {string} Returns the unescaped character. */ var unescapeHtmlChar = basePropertyOf(htmlUnescapes); /** * Gets the size of a Unicode `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { ++result; } return result; } /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function unicodeToArray(string) { return string.match(reUnicode) || []; } /** * Splits a Unicode `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function unicodeWords(string) { return string.match(reUnicodeWord) || []; } /*--------------------------------------------------------------------------*/ /** * Create a new pristine `lodash` function using the `context` object. * * @static * @memberOf _ * @since 1.1.0 * @category Util * @param {Object} [context=root] The context object. * @returns {Function} Returns a new `lodash` function. * @example * * _.mixin({ 'foo': _.constant('foo') }); * * var lodash = _.runInContext(); * lodash.mixin({ 'bar': lodash.constant('bar') }); * * _.isFunction(_.foo); * // => true * _.isFunction(_.bar); * // => false * * lodash.isFunction(lodash.foo); * // => false * lodash.isFunction(lodash.bar); * // => true * * // Create a suped-up `defer` in Node.js. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; */ var runInContext = (function runInContext(context) { context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); /** Built-in constructor references. */ var Array = context.Array, Date = context.Date, Error = context.Error, Function = context.Function, Math = context.Math, Object = context.Object, RegExp = context.RegExp, String = context.String, TypeError = context.TypeError; /** Used for built-in method references. */ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = context['__core-js_shared__']; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to generate unique IDs. */ var idCounter = 0; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** Used to restore the original `_` reference in `_.noConflict`. */ var oldDash = root._; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** Built-in value references. */ var Buffer = moduleExports ? context.Buffer : undefined, Symbol = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, symIterator = Symbol ? Symbol.iterator : undefined, symToStringTag = Symbol ? Symbol.toStringTag : undefined; var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); /** Mocked built-ins. */ var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse; /* Built-in method references that are verified to be native. */ var DataView = getNative(context, 'DataView'), Map = getNative(context, 'Map'), Promise = getNative(context, 'Promise'), Set = getNative(context, 'Set'), WeakMap = getNative(context, 'WeakMap'), nativeCreate = getNative(Object, 'create'); /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; /** Used to lookup unminified function names. */ var realNames = {}; /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object which wraps `value` to enable implicit method * chain sequences. Methods that operate on and return arrays, collections, * and functions can be chained together. Methods that retrieve a single value * or may return a primitive value will automatically end the chain sequence * and return the unwrapped value. Otherwise, the value must be unwrapped * with `_#value`. * * Explicit chain sequences, which must be unwrapped with `_#value`, may be * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * * Lazy evaluation allows several methods to support shortcut fusion. * Shortcut fusion is an optimization to merge iteratee calls; this avoids * the creation of intermediate arrays and can greatly reduce the number of * iteratee executions. Sections of a chain sequence qualify for shortcut * fusion if the section is applied to an array and iteratees accept only * one argument. The heuristic for whether a section qualifies for shortcut * fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. * * In addition to lodash methods, wrappers have `Array` and `String` methods. * * The wrapper `Array` methods are: * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` * * The wrapper `String` methods are: * `replace` and `split` * * The wrapper methods that support shortcut fusion are: * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, * `upperFirst`, `value`, and `words` * * @name _ * @constructor * @category Seq * @param {*} value The value to wrap in a `lodash` instance. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2, 3]); * * // Returns an unwrapped value. * wrapped.reduce(_.add); * // => 6 * * // Returns a wrapped value. * var squares = wrapped.map(square); * * _.isArray(squares); * // => false * * _.isArray(squares.value()); * // => true */ function lodash(value) { if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty.call(value, '__wrapped__')) { return wrapperClone(value); } } return new LodashWrapper(value); } /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); /** * The function whose prototype chain sequence wrappers inherit from. * * @private */ function baseLodash() { // No operation performed. } /** * The base constructor for creating `lodash` wrapper objects. * * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined; } /** * By default, the template delimiters used by lodash are like those in * embedded Ruby (ERB) as well as ES2015 template strings. Change the * following template settings to use alternative delimiters. * * @static * @memberOf _ * @type {Object} */ lodash.templateSettings = { /** * Used to detect `data` property values to be HTML-escaped. * * @memberOf _.templateSettings * @type {RegExp} */ 'escape': reEscape, /** * Used to detect code to be evaluated. * * @memberOf _.templateSettings * @type {RegExp} */ 'evaluate': reEvaluate, /** * Used to detect `data` property values to inject. * * @memberOf _.templateSettings * @type {RegExp} */ 'interpolate': reInterpolate, /** * Used to reference the data object in the template text. * * @memberOf _.templateSettings * @type {string} */ 'variable': '', /** * Used to import variables into the compiled template. * * @memberOf _.templateSettings * @type {Object} */ 'imports': { /** * A reference to the `lodash` function. * * @memberOf _.templateSettings.imports * @type {Function} */ '_': lodash } }; // Ensure wrappers are instances of `baseLodash`. lodash.prototype = baseLodash.prototype; lodash.prototype.constructor = lodash; LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; /*------------------------------------------------------------------------*/ /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } /** * Creates a clone of the lazy wrapper object. * * @private * @name clone * @memberOf LazyWrapper * @returns {Object} Returns the cloned `LazyWrapper` object. */ function lazyClone() { var result = new LazyWrapper(this.__wrapped__); result.__actions__ = copyArray(this.__actions__); result.__dir__ = this.__dir__; result.__filtered__ = this.__filtered__; result.__iteratees__ = copyArray(this.__iteratees__); result.__takeCount__ = this.__takeCount__; result.__views__ = copyArray(this.__views__); return result; } /** * Reverses the direction of lazy iteration. * * @private * @name reverse * @memberOf LazyWrapper * @returns {Object} Returns the new reversed `LazyWrapper` object. */ function lazyReverse() { if (this.__filtered__) { var result = new LazyWrapper(this); result.__dir__ = -1; result.__filtered__ = true; } else { result = this.clone(); result.__dir__ *= -1; } return result; } /** * Extracts the unwrapped value from its lazy wrapper. * * @private * @name value * @memberOf LazyWrapper * @returns {*} Returns the unwrapped value. */ function lazyValue() { var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : (start - 1), iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); if (!isArr || (!isRight && arrLength == length && takeCount == length)) { return baseWrapperValue(array, this.__actions__); } var result = []; outer: while (length-- && resIndex < takeCount) { index += dir; var iterIndex = -1, value = array[index]; while (++iterIndex < iterLength) { var data = iteratees[iterIndex], iteratee = data.iteratee, type = data.type, computed = iteratee(value); if (type == LAZY_MAP_FLAG) { value = computed; } else if (!computed) { if (type == LAZY_FILTER_FLAG) { continue outer; } else { break outer; } } } result[resIndex++] = value; } return result; } // Ensure `LazyWrapper` is an instance of `baseLodash`. LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; /*------------------------------------------------------------------------*/ /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /*------------------------------------------------------------------------*/ /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /*------------------------------------------------------------------------*/ /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /*------------------------------------------------------------------------*/ /** * * Creates an array cache object to store unique values. * * @private * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { var index = -1, length = values == null ? 0 : values.length; this.__data__ = new MapCache; while (++index < length) { this.add(values[index]); } } /** * Adds `value` to the array cache. * * @private * @name add * @memberOf SetCache * @alias push * @param {*} value The value to cache. * @returns {Object} Returns the cache instance. */ function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } /** * Checks if `value` is in the array cache. * * @private * @name has * @memberOf SetCache * @param {*} value The value to search for. * @returns {number} Returns `true` if `value` is found, else `false`. */ function setCacheHas(value) { return this.__data__.has(value); } // Add methods to `SetCache`. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; /*------------------------------------------------------------------------*/ /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new ListCache; this.size = 0; } /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } // Add methods to `Stack`. Stack.prototype.clear = stackClear; Stack.prototype['delete'] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; /*------------------------------------------------------------------------*/ /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. isIndex(key, length) ))) { result.push(key); } } return result; } /** * A specialized version of `_.sample` for arrays. * * @private * @param {Array} array The array to sample. * @returns {*} Returns the random element. */ function arraySample(array) { var length = array.length; return length ? array[baseRandom(0, length - 1)] : undefined; } /** * A specialized version of `_.sampleSize` for arrays. * * @private * @param {Array} array The array to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function arraySampleSize(array, n) { return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } /** * A specialized version of `_.shuffle` for arrays. * * @private * @param {Array} array The array to shuffle. * @returns {Array} Returns the new shuffled array. */ function arrayShuffle(array) { return shuffleSelf(copyArray(array)); } /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * Aggregates elements of `collection` on `accumulator` with keys transformed * by `iteratee` and values set by `setter`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function baseAggregator(collection, setter, iteratee, accumulator) { baseEach(collection, function(value, key, collection) { setter(accumulator, value, iteratee(value), collection); }); return accumulator; } /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } /** * The base implementation of `_.assignIn` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } /** * The base implementation of `_.at` without support for individual paths. * * @private * @param {Object} object The object to iterate over. * @param {string[]} paths The property paths to pick. * @returns {Array} Returns the picked elements. */ function baseAt(object, paths) { var index = -1, length = paths.length, result = Array(length), skip = object == null; while (++index < length) { result[index] = skip ? undefined : get(object, paths[index]); } return result; } /** * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. */ function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined) { number = number <= upper ? number : upper; } if (lower !== undefined) { number = number >= lower ? number : lower; } } return number; } /** * The base implementation of `_.clone` and `_.cloneDeep` which tracks * traversed objects. * * @private * @param {*} value The value to clone. * @param {boolean} bitmask The bitmask flags. * 1 - Deep clone * 2 - Flatten inherited properties * 4 - Clone symbols * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ function baseClone(value, bitmask, customizer, key, object, stack) { var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); } if (result !== undefined) { return result; } if (!isObject(value)) { return value; } var isArr = isArray(value); if (isArr) { result = initCloneArray(value); if (!isDeep) { return copyArray(value, result); } } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { result = (isFlat || isFunc) ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result = initCloneByTag(value, tag, isDeep); } } // Check for circular references and return its corresponding clone. stack || (stack = new Stack); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result); if (isSet(value)) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); } else if (isMap(value)) { value.forEach(function(subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); } var keysFunc = isFull ? (isFlat ? getAllKeysIn : getAllKeys) : (isFlat ? keysIn : keys); var props = isArr ? undefined : keysFunc(value); arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } // Recursively populate clone (susceptible to call stack limits). assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } /** * The base implementation of `_.conforms` which doesn't clone `source`. * * @private * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new spec function. */ function baseConforms(source) { var props = keys(source); return function(object) { return baseConformsTo(object, source, props); }; } /** * The base implementation of `_.conformsTo` which accepts `props` to check. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. */ function baseConformsTo(object, source, props) { var length = props.length; if (object == null) { return !length; } object = Object(object); while (length--) { var key = props[length], predicate = source[key], value = object[key]; if ((value === undefined && !(key in object)) || !predicate(value)) { return false; } } return true; } /** * The base implementation of `_.delay` and `_.defer` which accepts `args` * to provide to `func`. * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {Array} args The arguments to provide to `func`. * @returns {number|Object} Returns the timer id or timeout object. */ function baseDelay(func, wait, args) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return setTimeout(function() { func.apply(undefined, args); }, wait); } /** * The base implementation of methods like `_.difference` without support * for excluding multiple arrays or iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Array} values The values to exclude. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. */ function baseDifference(array, values, iteratee, comparator) { var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length; if (!length) { return result; } if (iteratee) { values = arrayMap(values, baseUnary(iteratee)); } if (comparator) { includes = arrayIncludesWith; isCommon = false; } else if (values.length >= LARGE_ARRAY_SIZE) { includes = cacheHas; isCommon = false; values = new SetCache(values); } outer: while (++index < length) { var value = array[index], computed = iteratee == null ? value : iteratee(value); value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values[valuesIndex] === computed) { continue outer; } } result.push(value); } else if (!includes(values, computed, comparator)) { result.push(value); } } return result; } /** * The base implementation of `_.forEach` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEach = createBaseEach(baseForOwn); /** * The base implementation of `_.forEachRight` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEachRight = createBaseEach(baseForOwnRight, true); /** * The base implementation of `_.every` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false` */ function baseEvery(collection, predicate) { var result = true; baseEach(collection, function(value, index, collection) { result = !!predicate(value, index, collection); return result; }); return result; } /** * The base implementation of methods like `_.max` and `_.min` which accepts a * `comparator` to determine the extremum value. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The iteratee invoked per iteration. * @param {Function} comparator The comparator used to compare values. * @returns {*} Returns the extremum value. */ function baseExtremum(array, iteratee, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee(value); if (current != null && (computed === undefined ? (current === current && !isSymbol(current)) : comparator(current, computed) )) { var computed = current, result = value; } } return result; } /** * The base implementation of `_.fill` without an iteratee call guard. * * @private * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. */ function baseFill(array, value, start, end) { var length = array.length; start = toInteger(start); if (start < 0) { start = -start > length ? 0 : (length + start); } end = (end === undefined || end > length) ? length : toInteger(end); if (end < 0) { end += length; } end = start > end ? 0 : toLength(end); while (start < end) { array[start++] = value; } return array; } /** * The base implementation of `_.filter` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { var result = []; baseEach(collection, function(value, index, collection) { if (predicate(value, index, collection)) { result.push(value); } }); return result; } /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); /** * This function is like `baseFor` except that it iterates over properties * in the opposite order. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseForRight = createBaseFor(true); /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return object && baseFor(object, iteratee, keys); } /** * The base implementation of `_.forOwnRight` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwnRight(object, iteratee) { return object && baseForRight(object, iteratee, keys); } /** * The base implementation of `_.functions` which creates an array of * `object` function property names filtered from `props`. * * @private * @param {Object} object The object to inspect. * @param {Array} props The property names to filter. * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { return arrayFilter(props, function(key) { return isFunction(object[key]); }); } /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses * `keysFunc` and `symbolsFunc` to get the enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @param {Function} keysFunc The function to get the keys of `object`. * @param {Function} symbolsFunc The function to get the symbols of `object`. * @returns {Array} Returns the array of property names and symbols. */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } /** * The base implementation of `_.gt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. */ function baseGt(value, other) { return value > other; } /** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } /** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { return object != null && key in Object(object); } /** * The base implementation of `_.inRange` which doesn't coerce arguments. * * @private * @param {number} number The number to check. * @param {number} start The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. */ function baseInRange(number, start, end) { return number >= nativeMin(start, end) && number < nativeMax(start, end); } /** * The base implementation of methods like `_.intersection`, without support * for iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of shared values. */ function baseIntersection(arrays, iteratee, comparator) { var includes = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee) { array = arrayMap(array, baseUnary(iteratee)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new SetCache(othIndex && array) : undefined; } array = arrays[0]; var index = -1, seen = caches[0]; outer: while (++index < length && result.length < maxLength) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator) )) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator)) ) { continue outer; } } if (seen) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.invert` and `_.invertBy` which inverts * `object` with values transformed by `iteratee` and set by `setter`. * * @private * @param {Object} object The object to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform values. * @param {Object} accumulator The initial inverted object. * @returns {Function} Returns `accumulator`. */ function baseInverter(object, setter, iteratee, accumulator) { baseForOwn(object, function(value, key, object) { setter(accumulator, iteratee(value), key, object); }); return accumulator; } /** * The base implementation of `_.invoke` without support for individual * method arguments. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {Array} args The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. */ function baseInvoke(object, path, args) { path = castPath(path, object); object = parent(object, path); var func = object == null ? object : object[toKey(last(path))]; return func == null ? undefined : apply(func, object, args); } /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } /** * The base implementation of `_.isArrayBuffer` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. */ function baseIsArrayBuffer(value) { return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; } /** * The base implementation of `_.isDate` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. */ function baseIsDate(value) { return isObjectLike(value) && baseGetTag(value) == dateTag; } /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } /** * The base implementation of `_.isMap` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ function baseIsMap(value) { return isObjectLike(value) && getTag(value) == mapTag; } /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object) ) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var stack = new Stack; if (customizer) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result )) { return false; } } } return true; } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.isRegExp` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. */ function baseIsRegExp(value) { return isObjectLike(value) && baseGetTag(value) == regexpTag; } /** * The base implementation of `_.isSet` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ function baseIsSet(value) { return isObjectLike(value) && getTag(value) == setTag; } /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity; } if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty.call(object, key) && key != 'constructor') { result.push(key); } } return result; } /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } /** * The base implementation of `_.lt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. */ function baseLt(value, other) { return value < other; } /** * The base implementation of `_.map` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } /** * The base implementation of `_.matches` which doesn't clone `source`. * * @private * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } /** * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue); } return function(object) { var objValue = get(object, path); return (objValue === undefined && objValue === srcValue) ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { stack || (stack = new Stack); if (isObject(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } /** * The base implementation of `_.nth` which doesn't coerce arguments. * * @private * @param {Array} array The array to query. * @param {number} n The index of the element to return. * @returns {*} Returns the nth element of `array`. */ function baseNth(array, n) { var length = array.length; if (!length) { return; } n += n < 0 ? length : 0; return isIndex(n, length) ? array[n] : undefined; } /** * The base implementation of `_.orderBy` without param guards. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. * @param {string[]} orders The sort orders of `iteratees`. * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { if (iteratees.length) { iteratees = arrayMap(iteratees, function(iteratee) { if (isArray(iteratee)) { return function(value) { return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); } } return iteratee; }); } else { iteratees = [identity]; } var index = -1; iteratees = arrayMap(iteratees, baseUnary(getIteratee())); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function(object, other) { return compareMultiple(object, other, orders); }); } /** * The base implementation of `_.pick` without support for individual * property identifiers. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @returns {Object} Returns the new object. */ function basePick(object, paths) { return basePickBy(object, paths, function(value, path) { return hasIn(object, path); }); } /** * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result = {}; while (++index < length) { var path = paths[index], value = baseGet(object, path); if (predicate(value, path)) { baseSet(result, castPath(path, object), value); } } return result; } /** * A specialized version of `baseProperty` which supports deep paths. * * @private * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { return baseGet(object, path); }; } /** * The base implementation of `_.pullAllBy` without support for iteratee * shorthands. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. */ function basePullAll(array, values, iteratee, comparator) { var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array; if (array === values) { values = copyArray(values); } if (iteratee) { seen = arrayMap(array, baseUnary(iteratee)); } while (++index < length) { var fromIndex = 0, value = values[index], computed = iteratee ? iteratee(value) : value; while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { splice.call(seen, fromIndex, 1); } splice.call(array, fromIndex, 1); } } return array; } /** * The base implementation of `_.pullAt` without support for individual * indexes or capturing the removed elements. * * @private * @param {Array} array The array to modify. * @param {number[]} indexes The indexes of elements to remove. * @returns {Array} Returns `array`. */ function basePullAt(array, indexes) { var length = array ? indexes.length : 0, lastIndex = length - 1; while (length--) { var index = indexes[length]; if (length == lastIndex || index !== previous) { var previous = index; if (isIndex(index)) { splice.call(array, index, 1); } else { baseUnset(array, index); } } } return array; } /** * The base implementation of `_.random` without support for returning * floating-point numbers. * * @private * @param {number} lower The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the random number. */ function baseRandom(lower, upper) { return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); } /** * The base implementation of `_.range` and `_.rangeRight` which doesn't * coerce arguments. * * @private * @param {number} start The start of the range. * @param {number} end The end of the range. * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the range of numbers. */ function baseRange(start, end, step, fromRight) { var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length); while (length--) { result[fromRight ? length : ++index] = start; start += step; } return result; } /** * The base implementation of `_.repeat` which doesn't coerce arguments. * * @private * @param {string} string The string to repeat. * @param {number} n The number of times to repeat the string. * @returns {string} Returns the repeated string. */ function baseRepeat(string, n) { var result = ''; if (!string || n < 1 || n > MAX_SAFE_INTEGER) { return result; } // Leverage the exponentiation by squaring algorithm for a faster repeat. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. do { if (n % 2) { result += string; } n = nativeFloor(n / 2); if (n) { string += string; } } while (n); return result; } /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } /** * The base implementation of `_.sample`. * * @private * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. */ function baseSample(collection) { return arraySample(values(collection)); } /** * The base implementation of `_.sampleSize` without param guards. * * @private * @param {Array|Object} collection The collection to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function baseSampleSize(collection, n) { var array = values(collection); return shuffleSelf(array, baseClamp(n, 0, array.length)); } /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (key === '__proto__' || key === 'constructor' || key === 'prototype') { return object; } if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject(objValue) ? objValue : (isIndex(path[index + 1]) ? [] : {}); } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } /** * The base implementation of `setData` without support for hot loop shorting. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; /** * The base implementation of `_.shuffle`. * * @private * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. */ function baseShuffle(collection) { return shuffleSelf(values(collection)); } /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : (length + start); } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } /** * The base implementation of `_.some` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function baseSome(collection, predicate) { var result; baseEach(collection, function(value, index, collection) { result = predicate(value, index, collection); return !result; }); return !!result; } /** * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which * performs a binary search of `array` to determine the index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndex(array, value, retHighest) { var low = 0, high = array == null ? low : array.length; if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { var mid = (low + high) >>> 1, computed = array[mid]; if (computed !== null && !isSymbol(computed) && (retHighest ? (computed <= value) : (computed < value))) { low = mid + 1; } else { high = mid; } } return high; } return baseSortedIndexBy(array, value, identity, retHighest); } /** * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` * which invokes `iteratee` for `value` and each element of `array` to compute * their sort ranking. The iteratee is invoked with one argument; (value). * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} iteratee The iteratee invoked per element. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { var low = 0, high = array == null ? 0 : array.length; if (high === 0) { return 0; } value = iteratee(value); var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined; while (low < high) { var mid = nativeFloor((low + high) / 2), computed = iteratee(array[mid]), othIsDefined = computed !== undefined, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed); if (valIsNaN) { var setLow = retHighest || othIsReflexive; } else if (valIsUndefined) { setLow = othIsReflexive && (retHighest || othIsDefined); } else if (valIsNull) { setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); } else if (valIsSymbol) { setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); } else if (othIsNull || othIsSymbol) { setLow = false; } else { setLow = retHighest ? (computed <= value) : (computed < value); } if (setLow) { low = mid + 1; } else { high = mid; } } return nativeMin(high, MAX_ARRAY_INDEX); } /** * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseSortedUniq(array, iteratee) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; if (!index || !eq(computed, seen)) { var seen = computed; result[resIndex++] = value === 0 ? 0 : value; } } return result; } /** * The base implementation of `_.toNumber` which doesn't ensure correct * conversions of binary, hexadecimal, or octal string values. * * @private * @param {*} value The value to process. * @returns {number} Returns the number. */ function baseToNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } return +value; } /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray(value)) { // Recursively convert values (susceptible to call stack limits). return arrayMap(value, baseToString) + ''; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseUniq(array, iteratee, comparator) { var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result; if (comparator) { isCommon = false; includes = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set = iteratee ? null : createSet(array); if (set) { return setToArray(set); } isCommon = false; includes = cacheHas; seen = new SetCache; } else { seen = iteratee ? [] : result; } outer: while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee) { seen.push(computed); } result.push(value); } else if (!includes(seen, computed, comparator)) { if (seen !== result) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.unset`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The property path to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { path = castPath(path, object); object = parent(object, path); return object == null || delete object[toKey(last(path))]; } /** * The base implementation of `_.update`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to update. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseUpdate(object, path, updater, customizer) { return baseSet(object, path, updater(baseGet(object, path)), customizer); } /** * The base implementation of methods like `_.dropWhile` and `_.takeWhile` * without support for iteratee shorthands. * * @private * @param {Array} array The array to query. * @param {Function} predicate The function invoked per iteration. * @param {boolean} [isDrop] Specify dropping elements instead of taking them. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the slice of `array`. */ function baseWhile(array, predicate, isDrop, fromRight) { var length = array.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); } /** * The base implementation of `wrapperValue` which returns the result of * performing a sequence of actions on the unwrapped `value`, where each * successive action is supplied the return value of the previous. * * @private * @param {*} value The unwrapped value. * @param {Array} actions Actions to perform to resolve the unwrapped value. * @returns {*} Returns the resolved value. */ function baseWrapperValue(value, actions) { var result = value; if (result instanceof LazyWrapper) { result = result.value(); } return arrayReduce(actions, function(result, action) { return action.func.apply(action.thisArg, arrayPush([result], action.args)); }, result); } /** * The base implementation of methods like `_.xor`, without support for * iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of values. */ function baseXor(arrays, iteratee, comparator) { var length = arrays.length; if (length < 2) { return length ? baseUniq(arrays[0]) : []; } var index = -1, result = Array(length); while (++index < length) { var array = arrays[index], othIndex = -1; while (++othIndex < length) { if (othIndex != index) { result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); } } } return baseUniq(baseFlatten(result, 1), iteratee, comparator); } /** * This base implementation of `_.zipObject` which assigns values using `assignFunc`. * * @private * @param {Array} props The property identifiers. * @param {Array} values The property values. * @param {Function} assignFunc The function to assign values. * @returns {Object} Returns the new object. */ function baseZipObject(props, values, assignFunc) { var index = -1, length = props.length, valsLength = values.length, result = {}; while (++index < length) { var value = index < valsLength ? values[index] : undefined; assignFunc(result, props[index], value); } return result; } /** * Casts `value` to an empty array if it's not an array like object. * * @private * @param {*} value The value to inspect. * @returns {Array|Object} Returns the cast array-like object. */ function castArrayLikeObject(value) { return isArrayLikeObject(value) ? value : []; } /** * Casts `value` to `identity` if it's not a function. * * @private * @param {*} value The value to inspect. * @returns {Function} Returns cast function. */ function castFunction(value) { return typeof value == 'function' ? value : identity; } /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } /** * A `baseRest` alias which can be replaced with `identity` by module * replacement plugins. * * @private * @type {Function} * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ var castRest = baseRest; /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */ function castSlice(array, start, end) { var length = array.length; end = end === undefined ? length : end; return (!start && end >= length) ? array : baseSlice(array, start, end); } /** * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). * * @private * @param {number|Object} id The timer id or timeout object of the timer to clear. */ var clearTimeout = ctxClearTimeout || function(id) { return root.clearTimeout(id); }; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } /** * Creates a clone of `dataView`. * * @private * @param {Object} dataView The data view to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned data view. */ function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } /** * Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } /** * Creates a clone of the `symbol` object. * * @private * @param {Object} symbol The symbol object to clone. * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } /** * Compares values to sort them in ascending order. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {number} Returns the sort order indicator for `value`. */ function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || (valIsNull && othIsDefined && othIsReflexive) || (!valIsDefined && othIsReflexive) || !valIsReflexive) { return 1; } if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || (othIsNull && valIsDefined && valIsReflexive) || (!othIsDefined && valIsReflexive) || !othIsReflexive) { return -1; } } return 0; } /** * Used by `_.orderBy` to compare multiple properties of a value to another * and stable sort them. * * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, * specify an order of "desc" for descending or "asc" for ascending sort order * of corresponding values. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {boolean[]|string[]} orders The order to sort by for each property. * @returns {number} Returns the sort order indicator for `object`. */ function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result = compareAscending(objCriteria[index], othCriteria[index]); if (result) { if (index >= ordersLength) { return result; } var order = orders[index]; return result * (order == 'desc' ? -1 : 1); } } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications // that causes it, under certain circumstances, to provide the same value for // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 // for more details. // // This also ensures a stable sort in V8 and other engines. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } /** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } /** * This function is like `composeArgs` except that the arguments composition * is tailored for `_.partialRight`. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } } return result; } /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } /** * Copies own symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } /** * Copies own and inherited symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } /** * Creates a function like `_.groupBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} [initializer] The accumulator object initializer. * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { return function(collection, iteratee) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, getIteratee(iteratee, 2), accumulator); }; } /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } /** * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg`. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } /** * Creates a function like `_.lowerFirst`. * * @private * @param {string} methodName The name of the `String` case method to use. * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { return function(string) { string = toString(string); var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined; var chr = strSymbols ? strSymbols[0] : string.charAt(0); var trailing = strSymbols ? castSlice(strSymbols, 1).join('') : string.slice(1); return chr[methodName]() + trailing; }; } /** * Creates a function like `_.camelCase`. * * @private * @param {Function} callback The function to combine each word. * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } /** * Creates a function that produces an instance of `Ctor` regardless of * whether it was invoked as part of a `new` expression or by `call` or `apply`. * * @private * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { case 0: return new Ctor; case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. return isObject(result) ? result : thisBinding; }; } /** * Creates a function that wraps `func` to enable currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createCurry(func, bitmask, arity) { var Ctor = createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) ? [] : replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); } var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return apply(fn, this, args); } return wrapper; } /** * Creates a `_.find` or `_.findLast` function. * * @private * @param {Function} findIndexFunc The function to find the collection index. * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); if (!isArrayLike(collection)) { var iteratee = getIteratee(predicate, 3); collection = keys(collection); predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } /** * Creates a `_.flow` or `_.flowRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { return flatRest(function(funcs) { var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; if (fromRight) { funcs.reverse(); } while (index--) { var func = funcs[index]; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (prereq && !wrapper && getFuncName(func) == 'wrapper') { var wrapper = new LodashWrapper([], true); } } index = wrapper ? index : length; while (++index < length) { func = funcs[index]; var funcName = getFuncName(func), data = funcName == 'wrapper' ? getData(func) : undefined; if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1 ) { wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); } else { wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; if (wrapper && args.length == 1 && isArray(value)) { return wrapper.plant(value).value(); } var index = 0, result = length ? funcs[index].apply(this, args) : value; while (++index < length) { result = funcs[index].call(this, result); } return result; }; }); } /** * Creates a function that wraps `func` to invoke it with optional `this` * binding of `thisArg`, partial application, and currying. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [partialsRight] The arguments to append to those provided * to the new function. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined : createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary < length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } return wrapper; } /** * Creates a function like `_.invertBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} toIteratee The function to resolve iteratees. * @returns {Function} Returns the new inverter function. */ function createInverter(setter, toIteratee) { return function(object, iteratee) { return baseInverter(object, setter, toIteratee(iteratee), {}); }; } /** * Creates a function that performs a mathematical operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @param {number} [defaultValue] The value used for `undefined` arguments. * @returns {Function} Returns the new mathematical operation function. */ function createMathOperation(operator, defaultValue) { return function(value, other) { var result; if (value === undefined && other === undefined) { return defaultValue; } if (value !== undefined) { result = value; } if (other !== undefined) { if (result === undefined) { return other; } if (typeof value == 'string' || typeof other == 'string') { value = baseToString(value); other = baseToString(other); } else { value = baseToNumber(value); other = baseToNumber(other); } result = operator(value, other); } return result; }; } /** * Creates a function like `_.over`. * * @private * @param {Function} arrayFunc The function to iterate over iteratees. * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { return flatRest(function(iteratees) { iteratees = arrayMap(iteratees, baseUnary(getIteratee())); return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { return apply(iteratee, thisArg, args); }); }); }); } /** * Creates the padding for `string` based on `length`. The `chars` string * is truncated if the number of characters exceeds `length`. * * @private * @param {number} length The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padding for `string`. */ function createPadding(length, chars) { chars = chars === undefined ? ' ' : baseToString(chars); var charsLength = chars.length; if (charsLength < 2) { return charsLength ? baseRepeat(chars, length) : chars; } var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join('') : result.slice(0, length); } /** * Creates a function that wraps `func` to invoke it with the `this` binding * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply(fn, isBind ? thisArg : this, args); } return wrapper; } /** * Creates a `_.range` or `_.rangeRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new range function. */ function createRange(fromRight) { return function(start, end, step) { if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { end = step = undefined; } // Ensure the sign of `-0` is preserved. start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); return baseRange(start, end, step, fromRight); }; } /** * Creates a function that performs a relational operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @returns {Function} Returns the new relational operation function. */ function createRelationalOperation(operator) { return function(value, other) { if (!(typeof value == 'string' && typeof other == 'string')) { value = toNumber(value); other = toNumber(other); } return operator(value, other); }; } /** * Creates a function that wraps `func` to continue currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ]; var result = wrapFunc.apply(undefined, newData); if (isLaziable(func)) { setData(result, newData); } result.placeholder = placeholder; return setWrapToString(result, func, bitmask); } /** * Creates a function like `_.round`. * * @private * @param {string} methodName The name of the `Math` method to use when rounding. * @returns {Function} Returns the new round function. */ function createRound(methodName) { var func = Math[methodName]; return function(number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); if (precision && nativeIsFinite(number)) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details. var pair = (toString(number) + 'e').split('e'), value = func(pair[0] + 'e' + (+pair[1] + precision)); pair = (toString(value) + 'e').split('e'); return +(pair[0] + 'e' + (+pair[1] - precision)); } return func(number); }; } /** * Creates a set object of `values`. * * @private * @param {Array} values The values to add to the set. * @returns {Object} Returns the new set. */ var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { return new Set(values); }; /** * Creates a `_.toPairs` or `_.toPairsIn` function. * * @private * @param {Function} keysFunc The function to get the keys of a given object. * @returns {Function} Returns the new pairs function. */ function createToPairs(keysFunc) { return function(object) { var tag = getTag(object); if (tag == mapTag) { return mapToArray(object); } if (tag == setTag) { return setToPairs(object); } return baseToPairs(object, keysFunc(object)); }; } /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * 512 - `_.flip` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); partials = holders = undefined; } ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); arity = arity === undefined ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var data = isBindKey ? undefined : getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ]; if (data) { mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined ? (isBindKey ? 0 : func.length) : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == WRAP_BIND_FLAG) { var result = createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { result = createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { result = createPartial(func, bitmask, thisArg, partials); } else { result = createHybrid.apply(undefined, newData); } var setter = data ? baseSetData : setData; return setWrapToString(setter(result, newData), func, bitmask); } /** * Used by `_.defaults` to customize its `_.assignIn` use to assign properties * of source objects to the destination object for all destination properties * that resolve to `undefined`. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to assign. * @param {Object} object The parent object of `objValue`. * @returns {*} Returns the value to assign. */ function customDefaultsAssignIn(objValue, srcValue, key, object) { if (objValue === undefined || (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { return srcValue; } return objValue; } /** * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source * objects into destination objects that are passed thru. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to merge. * @param {Object} object The parent object of `objValue`. * @param {Object} source The parent object of `srcValue`. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. * @returns {*} Returns the value to assign. */ function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, objValue); baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); stack['delete'](srcValue); } return objValue; } /** * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain * objects. * * @private * @param {*} value The value to inspect. * @param {string} key The key of the property to inspect. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. */ function customOmitClone(value) { return isPlainObject(value) ? undefined : value; } /** * A specialized version of `baseIsEqualDeep` for arrays with support for * partial deep comparisons. * * @private * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Check that cyclic values are equal. var arrStacked = stack.get(array); var othStacked = stack.get(other); if (arrStacked && othStacked) { return arrStacked == other && othStacked == array; } var index = -1, result = true, seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; stack.set(array, other); stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined) { if (compared) { continue; } result = false; break; } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, function(othValue, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!( arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack) )) { result = false; break; } } stack['delete'](array); stack['delete'](other); return result; } /** * A specialized version of `baseIsEqualDeep` for comparing objects of * the same `toStringTag`. * * **Note:** This function only supports comparing values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if ((object.byteLength != other.byteLength) || (object.byteOffset != other.byteOffset)) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds. // Invalid dates are coerced to `NaN`. return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits). stack.set(object, other); var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack['delete'](object); return result; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } // Check that cyclic values are equal. var objStacked = stack.get(object); var othStacked = stack.get(other); if (objStacked && othStacked) { return objStacked == other && othStacked == object; } var result = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) : compared )) { result = false; break; } skipCtor || (skipCtor = key == 'constructor'); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } stack['delete'](object); stack['delete'](other); return result; } /** * A specialized version of `baseRest` which flattens the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ function flatRest(func) { return setToString(overRest(func, undefined, flatten), func + ''); } /** * Creates an array of own enumerable property names and symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } /** * Creates an array of own and inherited enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } /** * Gets metadata for `func`. * * @private * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ var getData = !metaMap ? noop : function(func) { return metaMap.get(func); }; /** * Gets the name of `func`. * * @private * @param {Function} func The function to query. * @returns {string} Returns the function name. */ function getFuncName(func) { var result = (func.name + ''), array = realNames[result], length = hasOwnProperty.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } /** * Gets the argument placeholder value for `func`. * * @private * @param {Function} func The function to inspect. * @returns {*} Returns the placeholder value. */ function getHolder(func) { var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; return object.placeholder; } /** * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, * this function returns the custom method, otherwise it returns `baseIteratee`. * If arguments are provided, the chosen function is invoked with them and * its result is returned. * * @private * @param {*} [value] The value to convert to an iteratee. * @param {number} [arity] The arity of the created iteratee. * @returns {Function} Returns the chosen function or its result. */ function getIteratee() { var result = lodash.iteratee || iteratee; result = result === iteratee ? baseIteratee : result; return arguments.length ? result(arguments[0], arguments[1]) : result; } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the property names, values, and compare flags of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { var result = keys(object), length = result.length; while (length--) { var key = result[length], value = object[key]; result[length] = [key, value, isStrictComparable(value)]; } return result; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } /** * Creates an array of the own enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbols = !nativeGetSymbols ? stubArray : function(object) { if (object == null) { return []; } object = Object(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; /** * Creates an array of the own and inherited enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); object = getPrototype(object); } return result; }; /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result; }; } /** * Gets the view, applying any `transforms` to the `start` and `end` positions. * * @private * @param {number} start The start of the view. * @param {number} end The end of the view. * @param {Array} transforms The transformations to apply to the view. * @returns {Object} Returns an object containing the `start` and `end` * positions of the view. */ function getView(start, end, transforms) { var index = -1, length = transforms.length; while (++index < length) { var data = transforms[index], size = data.size; switch (data.type) { case 'drop': start += size; break; case 'dropRight': end -= size; break; case 'take': end = nativeMin(end, start + size); break; case 'takeRight': start = nativeMax(start, end - size); break; } } return { 'start': start, 'end': end }; } /** * Extracts wrapper details from the `source` body comment. * * @private * @param {string} source The source to inspect. * @returns {Array} Returns the wrapper details. */ function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } /** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { var length = array.length, result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; result.input = array.input; } return result; } /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototype(object)) : {}; } /** * Initializes an object clone based on its `toStringTag`. * * **Note:** This function only supports cloning values with tags of * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return cloneArrayBuffer(object); case boolTag: case dateTag: return new Ctor(+object); case dataViewTag: return cloneDataView(object, isDeep); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: return new Ctor; case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return new Ctor; case symbolTag: return cloneSymbol(object); } } /** * Inserts wrapper `details` in a comment at the top of the `source` body. * * @private * @param {string} source The source to modify. * @returns {Array} details The details to insert. * @returns {string} Returns the modified source. */ function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; details = details.join(length > 2 ? ', ' : ' '); return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } /** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq(object[index], value); } return false; } /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } /** * Checks if `func` has a lazy counterpart. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` has a lazy counterpart, * else `false`. */ function isLaziable(func) { var funcName = getFuncName(func), other = lodash[funcName]; if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** * Checks if `func` is capable of being masked. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `func` is maskable, else `false`. */ var isMaskable = coreJsData ? isFunction : stubFalse; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` if suitable for strict * equality comparisons, else `false`. */ function isStrictComparable(value) { return value === value && !isObject(value); } /** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined || (key in Object(object))); }; } /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } /** * Merges the function metadata of `source` into `data`. * * Merging metadata reduces the number of wrappers used to invoke a function. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` * may be applied regardless of execution order. Methods like `_.ary` and * `_.rearg` modify function arguments, making the order in which they are * executed important, preventing the merging of metadata. However, we make * an exception for a safe combined case where curried functions have `_.ary` * and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. * @param {Array} source The source metadata. * @returns {Array} Returns `data`. */ function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); var isCombo = ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { return data; } // Use source `thisArg` if available. if (srcBitmask & WRAP_BIND_FLAG) { data[2] = source[2]; // Set when currying a bound function. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; } // Compose partial arguments. var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : value; data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } // Use source `argPos` if available. value = source[7]; if (value) { data[7] = value; } // Use source `ary` if it's smaller. if (srcBitmask & WRAP_ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } // Use source `arity` if one is not provided. if (data[9] == null) { data[9] = source[9]; } // Use source `func` and merge bitmasks. data[0] = source[0]; data[1] = newBitmask; return data; } /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } /** * Gets the parent value at `path` of `object`. * * @private * @param {Object} object The object to query. * @param {Array} path The path to get the parent value of. * @returns {*} Returns the parent value. */ function parent(object, path) { return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); } /** * Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at * the second index is assigned as the second element, and so on. * * @private * @param {Array} array The array to reorder. * @param {Array} indexes The arranged array indexes. * @returns {Array} Returns `array`. */ function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } return array; } /** * Gets the value at `key`, unless `key` is "__proto__" or "constructor". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { if (key === 'constructor' && typeof object[key] === 'function') { return; } if (key == '__proto__') { return; } return object[key]; } /** * Sets metadata for `func`. * * **Note:** If this function becomes hot, i.e. is invoked a lot in a short * period of time, it will trip its breaker and transition to an identity * function to avoid garbage collection pauses in V8. See * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) * for more details. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var setData = shortOut(baseSetData); /** * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @returns {number|Object} Returns the timer id or timeout object. */ var setTimeout = ctxSetTimeout || function(func, wait) { return root.setTimeout(func, wait); }; /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); /** * Sets the `toString` method of `wrapper` to mimic the source of `reference` * with wrapper details in a comment at the top of the source body. * * @private * @param {Function} wrapper The function to modify. * @param {Function} reference The reference function. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Function} Returns `wrapper`. */ function setWrapToString(wrapper, reference, bitmask) { var source = (reference + ''); return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } /** * A specialized version of `_.shuffle` which mutates and sets the size of `array`. * * @private * @param {Array} array The array to shuffle. * @param {number} [size=array.length] The size of `array`. * @returns {Array} Returns `array`. */ function shuffleSelf(array, size) { var index = -1, length = array.length, lastIndex = length - 1; size = size === undefined ? length : size; while (++index < size) { var rand = baseRandom(index, lastIndex), value = array[rand]; array[rand] = array[index]; array[index] = value; } array.length = size; return array; } /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * Updates wrapper `details` based on `bitmask` flags. * * @private * @returns {Array} details The details to modify. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Array} Returns `details`. */ function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = '_.' + pair[0]; if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } /** * Creates a clone of `wrapper`. * * @private * @param {Object} wrapper The wrapper to clone. * @returns {Object} Returns the cloned wrapper. */ function wrapperClone(wrapper) { if (wrapper instanceof LazyWrapper) { return wrapper.clone(); } var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result.__actions__ = copyArray(wrapper.__actions__); result.__index__ = wrapper.__index__; result.__values__ = wrapper.__values__; return result; } /*------------------------------------------------------------------------*/ /** * Creates an array of elements split into groups the length of `size`. * If `array` can't be split evenly, the final chunk will be the remaining * elements. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to process. * @param {number} [size=1] The length of each chunk * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the new array of chunks. * @example * * _.chunk(['a', 'b', 'c', 'd'], 2); * // => [['a', 'b'], ['c', 'd']] * * _.chunk(['a', 'b', 'c', 'd'], 3); * // => [['a', 'b', 'c'], ['d']] */ function chunk(array, size, guard) { if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { size = 1; } else { size = nativeMax(toInteger(size), 0); } var length = array == null ? 0 : array.length; if (!length || size < 1) { return []; } var index = 0, resIndex = 0, result = Array(nativeCeil(length / size)); while (index < length) { result[resIndex++] = baseSlice(array, index, (index += size)); } return result; } /** * Creates an array with all falsey values removed. The values `false`, `null`, * `0`, `""`, `undefined`, and `NaN` are falsey. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to compact. * @returns {Array} Returns the new array of filtered values. * @example * * _.compact([0, 1, false, 2, '', 3]); * // => [1, 2, 3] */ function compact(array) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value) { result[resIndex++] = value; } } return result; } /** * Creates a new array concatenating `array` with any additional arrays * and/or values. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to concatenate. * @param {...*} [values] The values to concatenate. * @returns {Array} Returns the new concatenated array. * @example * * var array = [1]; * var other = _.concat(array, 2, [3], [[4]]); * * console.log(other); * // => [1, 2, 3, [4]] * * console.log(array); * // => [1] */ function concat() { var length = arguments.length; if (!length) { return []; } var args = Array(length - 1), array = arguments[0], index = length; while (index--) { args[index - 1] = arguments[index]; } return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } /** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.without, _.xor * @example * * _.difference([2, 1], [2, 3]); * // => [1] */ var difference = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); /** * This method is like `_.difference` except that it accepts `iteratee` which * is invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * **Note:** Unlike `_.pullAllBy`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2] * * // The `_.property` iteratee shorthand. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var differenceBy = baseRest(function(array, values) { var iteratee = last(values); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.difference` except that it accepts `comparator` * which is invoked to compare elements of `array` to `values`. The order and * references of result values are determined by the first array. The comparator * is invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.pullAllWith`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] */ var differenceWith = baseRest(function(array, values) { var comparator = last(values); if (isArrayLikeObject(comparator)) { comparator = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; }); /** * Creates a slice of `array` with `n` elements dropped from the beginning. * * @static * @memberOf _ * @since 0.5.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.drop([1, 2, 3]); * // => [2, 3] * * _.drop([1, 2, 3], 2); * // => [3] * * _.drop([1, 2, 3], 5); * // => [] * * _.drop([1, 2, 3], 0); * // => [1, 2, 3] */ function drop(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with `n` elements dropped from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.dropRight([1, 2, 3]); * // => [1, 2] * * _.dropRight([1, 2, 3], 2); * // => [1] * * _.dropRight([1, 2, 3], 5); * // => [] * * _.dropRight([1, 2, 3], 0); * // => [1, 2, 3] */ function dropRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` excluding elements dropped from the end. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.dropRightWhile(users, function(o) { return !o.active; }); * // => objects for ['barney'] * * // The `_.matches` iteratee shorthand. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['barney', 'fred'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropRightWhile(users, ['active', false]); * // => objects for ['barney'] * * // The `_.property` iteratee shorthand. * _.dropRightWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; } /** * Creates a slice of `array` excluding elements dropped from the beginning. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.dropWhile(users, function(o) { return !o.active; }); * // => objects for ['pebbles'] * * // The `_.matches` iteratee shorthand. * _.dropWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['fred', 'pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropWhile(users, ['active', false]); * // => objects for ['pebbles'] * * // The `_.property` iteratee shorthand. * _.dropWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true) : []; } /** * Fills elements of `array` with `value` from `start` up to, but not * including, `end`. * * **Note:** This method mutates `array`. * * @static * @memberOf _ * @since 3.2.0 * @category Array * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.fill(array, 'a'); * console.log(array); * // => ['a', 'a', 'a'] * * _.fill(Array(3), 2); * // => [2, 2, 2] * * _.fill([4, 6, 8, 10], '*', 1, 3); * // => [4, '*', '*', 10] */ function fill(array, value, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { start = 0; end = length; } return baseFill(array, value, start, end); } /** * This method is like `_.find` except that it returns the index of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.findIndex(users, function(o) { return o.user == 'barney'; }); * // => 0 * * // The `_.matches` iteratee shorthand. * _.findIndex(users, { 'user': 'fred', 'active': false }); * // => 1 * * // The `_.matchesProperty` iteratee shorthand. * _.findIndex(users, ['active', false]); * // => 0 * * // The `_.property` iteratee shorthand. * _.findIndex(users, 'active'); * // => 2 */ function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseFindIndex(array, getIteratee(predicate, 3), index); } /** * This method is like `_.findIndex` except that it iterates over elements * of `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); * // => 2 * * // The `_.matches` iteratee shorthand. * _.findLastIndex(users, { 'user': 'barney', 'active': true }); * // => 0 * * // The `_.matchesProperty` iteratee shorthand. * _.findLastIndex(users, ['active', false]); * // => 2 * * // The `_.property` iteratee shorthand. * _.findLastIndex(users, 'active'); * // => 0 */ function findLastIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length - 1; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return baseFindIndex(array, getIteratee(predicate, 3), index, true); } /** * Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } /** * Recursively flattens `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flattenDeep([1, [2, [3, [4]], 5]]); * // => [1, 2, 3, 4, 5] */ function flattenDeep(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, INFINITY) : []; } /** * Recursively flatten `array` up to `depth` times. * * @static * @memberOf _ * @since 4.4.0 * @category Array * @param {Array} array The array to flatten. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * var array = [1, [2, [3, [4]], 5]]; * * _.flattenDepth(array, 1); * // => [1, 2, [3, [4]], 5] * * _.flattenDepth(array, 2); * // => [1, 2, 3, [4], 5] */ function flattenDepth(array, depth) { var length = array == null ? 0 : array.length; if (!length) { return []; } depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(array, depth); } /** * The inverse of `_.toPairs`; this method returns an object composed * from key-value `pairs`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} pairs The key-value pairs. * @returns {Object} Returns the new object. * @example * * _.fromPairs([['a', 1], ['b', 2]]); * // => { 'a': 1, 'b': 2 } */ function fromPairs(pairs) { var index = -1, length = pairs == null ? 0 : pairs.length, result = {}; while (++index < length) { var pair = pairs[index]; result[pair[0]] = pair[1]; } return result; } /** * Gets the first element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. * @returns {*} Returns the first element of `array`. * @example * * _.head([1, 2, 3]); * // => 1 * * _.head([]); * // => undefined */ function head(array) { return (array && array.length) ? array[0] : undefined; } /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. If `fromIndex` is negative, it's used as the * offset from the end of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.indexOf([1, 2, 1, 2], 2); * // => 1 * * // Search from the `fromIndex`. * _.indexOf([1, 2, 1, 2], 2, 2); * // => 3 */ function indexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseIndexOf(array, value, index); } /** * Gets all but the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.initial([1, 2, 3]); * // => [1, 2] */ function initial(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 0, -1) : []; } /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersection([2, 1], [2, 3]); * // => [2] */ var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) : []; }); /** * This method is like `_.intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [2.1] * * // The `_.property` iteratee shorthand. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] */ var intersectionBy = baseRest(function(arrays) { var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee === last(mapped)) { iteratee = undefined; } else { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.intersection` except that it accepts `comparator` * which is invoked to compare elements of `arrays`. The order and references * of result values are determined by the first array. The comparator is * invoked with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.intersectionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }] */ var intersectionWith = baseRest(function(arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); comparator = typeof comparator == 'function' ? comparator : undefined; if (comparator) { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, undefined, comparator) : []; }); /** * Converts all elements in `array` into a string separated by `separator`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to convert. * @param {string} [separator=','] The element separator. * @returns {string} Returns the joined string. * @example * * _.join(['a', 'b', 'c'], '~'); * // => 'a~b~c' */ function join(array, separator) { return array == null ? '' : nativeJoin.call(array, separator); } /** * Gets the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. * @example * * _.last([1, 2, 3]); * // => 3 */ function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined; } /** * This method is like `_.indexOf` except that it iterates over elements of * `array` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.lastIndexOf([1, 2, 1, 2], 2); * // => 3 * * // Search from the `fromIndex`. * _.lastIndexOf([1, 2, 1, 2], 2, 2); * // => 1 */ function lastIndexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); } /** * Gets the element at index `n` of `array`. If `n` is negative, the nth * element from the end is returned. * * @static * @memberOf _ * @since 4.11.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=0] The index of the element to return. * @returns {*} Returns the nth element of `array`. * @example * * var array = ['a', 'b', 'c', 'd']; * * _.nth(array, 1); * // => 'b' * * _.nth(array, -2); * // => 'c'; */ function nth(array, n) { return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; } /** * Removes all given values from `array` using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` * to remove elements from an array by predicate. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {...*} [values] The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pull(array, 'a', 'c'); * console.log(array); * // => ['b', 'b'] */ var pull = baseRest(pullAll); /** * This method is like `_.pull` except that it accepts an array of values to remove. * * **Note:** Unlike `_.difference`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pullAll(array, ['a', 'c']); * console.log(array); * // => ['b', 'b'] */ function pullAll(array, values) { return (array && array.length && values && values.length) ? basePullAll(array, values) : array; } /** * This method is like `_.pullAll` except that it accepts `iteratee` which is * invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The iteratee is invoked with one argument: (value). * * **Note:** Unlike `_.differenceBy`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; * * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); * console.log(array); * // => [{ 'x': 2 }] */ function pullAllBy(array, values, iteratee) { return (array && array.length && values && values.length) ? basePullAll(array, values, getIteratee(iteratee, 2)) : array; } /** * This method is like `_.pullAll` except that it accepts `comparator` which * is invoked to compare elements of `array` to `values`. The comparator is * invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.differenceWith`, this method mutates `array`. * * @static * @memberOf _ * @since 4.6.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; * * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); * console.log(array); * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] */ function pullAllWith(array, values, comparator) { return (array && array.length && values && values.length) ? basePullAll(array, values, undefined, comparator) : array; } /** * Removes elements from `array` corresponding to `indexes` and returns an * array of removed elements. * * **Note:** Unlike `_.at`, this method mutates `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to modify. * @param {...(number|number[])} [indexes] The indexes of elements to remove. * @returns {Array} Returns the new array of removed elements. * @example * * var array = ['a', 'b', 'c', 'd']; * var pulled = _.pullAt(array, [1, 3]); * * console.log(array); * // => ['a', 'c'] * * console.log(pulled); * // => ['b', 'd'] */ var pullAt = flatRest(function(array, indexes) { var length = array == null ? 0 : array.length, result = baseAt(array, indexes); basePullAt(array, arrayMap(indexes, function(index) { return isIndex(index, length) ? +index : index; }).sort(compareAscending)); return result; }); /** * Removes all elements from `array` that `predicate` returns truthy for * and returns an array of the removed elements. The predicate is invoked * with three arguments: (value, index, array). * * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` * to pull elements from an array by value. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new array of removed elements. * @example * * var array = [1, 2, 3, 4]; * var evens = _.remove(array, function(n) { * return n % 2 == 0; * }); * * console.log(array); * // => [1, 3] * * console.log(evens); * // => [2, 4] */ function remove(array, predicate) { var result = []; if (!(array && array.length)) { return result; } var index = -1, indexes = [], length = array.length; predicate = getIteratee(predicate, 3); while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result.push(value); indexes.push(index); } } basePullAt(array, indexes); return result; } /** * Reverses `array` so that the first element becomes the last, the second * element becomes the second to last, and so on. * * **Note:** This method mutates `array` and is based on * [`Array#reverse`](https://mdn.io/Array/reverse). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.reverse(array); * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function reverse(array) { return array == null ? array : nativeReverse.call(array); } /** * Creates a slice of `array` from `start` up to, but not including, `end`. * * **Note:** This method is used instead of * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are * returned. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function slice(array, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { start = 0; end = length; } else { start = start == null ? 0 : toInteger(start); end = end === undefined ? length : toInteger(end); } return baseSlice(array, start, end); } /** * Uses a binary search to determine the lowest index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedIndex([30, 50], 40); * // => 1 */ function sortedIndex(array, value) { return baseSortedIndex(array, value); } /** * This method is like `_.sortedIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 0 * * // The `_.property` iteratee shorthand. * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); * // => 0 */ function sortedIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); } /** * This method is like `_.indexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedIndexOf([4, 5, 5, 5, 6], 5); * // => 1 */ function sortedIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value); if (index < length && eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.sortedIndex` except that it returns the highest * index at which `value` should be inserted into `array` in order to * maintain its sort order. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedLastIndex([4, 5, 5, 5, 6], 5); * // => 4 */ function sortedLastIndex(array, value) { return baseSortedIndex(array, value, true); } /** * This method is like `_.sortedLastIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 1 * * // The `_.property` iteratee shorthand. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); * // => 1 */ function sortedLastIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); } /** * This method is like `_.lastIndexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); * // => 3 */ function sortedLastIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value, true) - 1; if (eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.uniq` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniq([1, 1, 2]); * // => [1, 2] */ function sortedUniq(array) { return (array && array.length) ? baseSortedUniq(array) : []; } /** * This method is like `_.uniqBy` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); * // => [1.1, 2.3] */ function sortedUniqBy(array, iteratee) { return (array && array.length) ? baseSortedUniq(array, getIteratee(iteratee, 2)) : []; } /** * Gets all but the first element of `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.tail([1, 2, 3]); * // => [2, 3] */ function tail(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 1, length) : []; } /** * Creates a slice of `array` with `n` elements taken from the beginning. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.take([1, 2, 3]); * // => [1] * * _.take([1, 2, 3], 2); * // => [1, 2] * * _.take([1, 2, 3], 5); * // => [1, 2, 3] * * _.take([1, 2, 3], 0); * // => [] */ function take(array, n, guard) { if (!(array && array.length)) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` with `n` elements taken from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.takeRight([1, 2, 3]); * // => [3] * * _.takeRight([1, 2, 3], 2); * // => [2, 3] * * _.takeRight([1, 2, 3], 5); * // => [1, 2, 3] * * _.takeRight([1, 2, 3], 0); * // => [] */ function takeRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with elements taken from the end. Elements are * taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.takeRightWhile(users, function(o) { return !o.active; }); * // => objects for ['fred', 'pebbles'] * * // The `_.matches` iteratee shorthand. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeRightWhile(users, ['active', false]); * // => objects for ['fred', 'pebbles'] * * // The `_.property` iteratee shorthand. * _.takeRightWhile(users, 'active'); * // => [] */ function takeRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; } /** * Creates a slice of `array` with elements taken from the beginning. Elements * are taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.takeWhile(users, function(o) { return !o.active; }); * // => objects for ['barney', 'fred'] * * // The `_.matches` iteratee shorthand. * _.takeWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeWhile(users, ['active', false]); * // => objects for ['barney', 'fred'] * * // The `_.property` iteratee shorthand. * _.takeWhile(users, 'active'); * // => [] */ function takeWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3)) : []; } /** * Creates an array of unique values, in order, from all given arrays using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of combined values. * @example * * _.union([2], [1, 2]); * // => [2, 1] */ var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); /** * This method is like `_.union` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which uniqueness is computed. Result values are chosen from the first * array in which the value occurs. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * _.unionBy([2.1], [1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ var unionBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); }); /** * This method is like `_.union` except that it accepts `comparator` which * is invoked to compare elements of `arrays`. Result values are chosen from * the first array in which the value occurs. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.unionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var unionWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); }); /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each element * is kept. The order of result values is determined by the order they occur * in the array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniq([2, 1, 2]); * // => [2, 1] */ function uniq(array) { return (array && array.length) ? baseUniq(array) : []; } /** * This method is like `_.uniq` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * uniqueness is computed. The order of result values is determined by the * order they occur in the array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniqBy([2.1, 1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ function uniqBy(array, iteratee) { return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; } /** * This method is like `_.uniq` except that it accepts `comparator` which * is invoked to compare elements of `array`. The order of result values is * determined by the order they occur in the array.The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.uniqWith(objects, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ function uniqWith(array, comparator) { comparator = typeof comparator == 'function' ? comparator : undefined; return (array && array.length) ? baseUniq(array, undefined, comparator) : []; } /** * This method is like `_.zip` except that it accepts an array of grouped * elements and creates an array regrouping the elements to their pre-zip * configuration. * * @static * @memberOf _ * @since 1.2.0 * @category Array * @param {Array} array The array of grouped elements to process. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] * * _.unzip(zipped); * // => [['a', 'b'], [1, 2], [true, false]] */ function unzip(array) { if (!(array && array.length)) { return []; } var length = 0; array = arrayFilter(array, function(group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length); return true; } }); return baseTimes(length, function(index) { return arrayMap(array, baseProperty(index)); }); } /** * This method is like `_.unzip` except that it accepts `iteratee` to specify * how regrouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {Array} array The array of grouped elements to process. * @param {Function} [iteratee=_.identity] The function to combine * regrouped values. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip([1, 2], [10, 20], [100, 200]); * // => [[1, 10, 100], [2, 20, 200]] * * _.unzipWith(zipped, _.add); * // => [3, 30, 300] */ function unzipWith(array, iteratee) { if (!(array && array.length)) { return []; } var result = unzip(array); if (iteratee == null) { return result; } return arrayMap(result, function(group) { return apply(iteratee, undefined, group); }); } /** * Creates an array excluding all given values using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.pull`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...*} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.xor * @example * * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ var without = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; }); /** * Creates an array of unique values that is the * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) * of the given arrays. The order of result values is determined by the order * they occur in the arrays. * * @static * @memberOf _ * @since 2.4.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.without * @example * * _.xor([2, 1], [2, 3]); * // => [1, 3] */ var xor = baseRest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); /** * This method is like `_.xor` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which by which they're compared. The order of result values is determined * by the order they occur in the arrays. The iteratee is invoked with one * argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2, 3.4] * * // The `_.property` iteratee shorthand. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var xorBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); }); /** * This method is like `_.xor` except that it accepts `comparator` which is * invoked to compare elements of `arrays`. The order of result values is * determined by the order they occur in the arrays. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.xorWith(objects, others, _.isEqual); * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var xorWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); }); /** * Creates an array of grouped elements, the first of which contains the * first elements of the given arrays, the second of which contains the * second elements of the given arrays, and so on. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] */ var zip = baseRest(unzip); /** * This method is like `_.fromPairs` except that it accepts two arrays, * one of property identifiers and one of corresponding values. * * @static * @memberOf _ * @since 0.4.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObject(['a', 'b'], [1, 2]); * // => { 'a': 1, 'b': 2 } */ function zipObject(props, values) { return baseZipObject(props || [], values || [], assignValue); } /** * This method is like `_.zipObject` except that it supports property paths. * * @static * @memberOf _ * @since 4.1.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } */ function zipObjectDeep(props, values) { return baseZipObject(props || [], values || [], baseSet); } /** * This method is like `_.zip` except that it accepts `iteratee` to specify * how grouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @param {Function} [iteratee=_.identity] The function to combine * grouped values. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { * return a + b + c; * }); * // => [111, 222] */ var zipWith = baseRest(function(arrays) { var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : undefined; iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; return unzipWith(arrays, iteratee); }); /*------------------------------------------------------------------------*/ /** * Creates a `lodash` wrapper instance that wraps `value` with explicit method * chain sequences enabled. The result of such sequences must be unwrapped * with `_#value`. * * @static * @memberOf _ * @since 1.3.0 * @category Seq * @param {*} value The value to wrap. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'pebbles', 'age': 1 } * ]; * * var youngest = _ * .chain(users) * .sortBy('age') * .map(function(o) { * return o.user + ' is ' + o.age; * }) * .head() * .value(); * // => 'pebbles is 1' */ function chain(value) { var result = lodash(value); result.__chain__ = true; return result; } /** * This method invokes `interceptor` and returns `value`. The interceptor * is invoked with one argument; (value). The purpose of this method is to * "tap into" a method chain sequence in order to modify intermediate results. * * @static * @memberOf _ * @since 0.1.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns `value`. * @example * * _([1, 2, 3]) * .tap(function(array) { * // Mutate input array. * array.pop(); * }) * .reverse() * .value(); * // => [2, 1] */ function tap(value, interceptor) { interceptor(value); return value; } /** * This method is like `_.tap` except that it returns the result of `interceptor`. * The purpose of this method is to "pass thru" values replacing intermediate * results in a method chain sequence. * * @static * @memberOf _ * @since 3.0.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns the result of `interceptor`. * @example * * _(' abc ') * .chain() * .trim() * .thru(function(value) { * return [value]; * }) * .value(); * // => ['abc'] */ function thru(value, interceptor) { return interceptor(value); } /** * This method is the wrapper version of `_.at`. * * @name at * @memberOf _ * @since 1.0.0 * @category Seq * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] */ var wrapperAt = flatRest(function(paths) { var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { return baseAt(object, paths); }; if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { return this.thru(interceptor); } value = value.slice(start, +start + (length ? 1 : 0)); value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); return new LodashWrapper(value, this.__chain__).thru(function(array) { if (length && !array.length) { array.push(undefined); } return array; }); }); /** * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. * * @name chain * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 } * ]; * * // A sequence without explicit chaining. * _(users).head(); * // => { 'user': 'barney', 'age': 36 } * * // A sequence with explicit chaining. * _(users) * .chain() * .head() * .pick('user') * .value(); * // => { 'user': 'barney' } */ function wrapperChain() { return chain(this); } /** * Executes the chain sequence and returns the wrapped result. * * @name commit * @memberOf _ * @since 3.2.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2]; * var wrapped = _(array).push(3); * * console.log(array); * // => [1, 2] * * wrapped = wrapped.commit(); * console.log(array); * // => [1, 2, 3] * * wrapped.last(); * // => 3 * * console.log(array); * // => [1, 2, 3] */ function wrapperCommit() { return new LodashWrapper(this.value(), this.__chain__); } /** * Gets the next value on a wrapped object following the * [iterator protocol](https://mdn.io/iteration_protocols#iterator). * * @name next * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the next iterator value. * @example * * var wrapped = _([1, 2]); * * wrapped.next(); * // => { 'done': false, 'value': 1 } * * wrapped.next(); * // => { 'done': false, 'value': 2 } * * wrapped.next(); * // => { 'done': true, 'value': undefined } */ function wrapperNext() { if (this.__values__ === undefined) { this.__values__ = toArray(this.value()); } var done = this.__index__ >= this.__values__.length, value = done ? undefined : this.__values__[this.__index__++]; return { 'done': done, 'value': value }; } /** * Enables the wrapper to be iterable. * * @name Symbol.iterator * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the wrapper object. * @example * * var wrapped = _([1, 2]); * * wrapped[Symbol.iterator]() === wrapped; * // => true * * Array.from(wrapped); * // => [1, 2] */ function wrapperToIterator() { return this; } /** * Creates a clone of the chain sequence planting `value` as the wrapped value. * * @name plant * @memberOf _ * @since 3.2.0 * @category Seq * @param {*} value The value to plant. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2]).map(square); * var other = wrapped.plant([3, 4]); * * other.value(); * // => [9, 16] * * wrapped.value(); * // => [1, 4] */ function wrapperPlant(value) { var result, parent = this; while (parent instanceof baseLodash) { var clone = wrapperClone(parent); clone.__index__ = 0; clone.__values__ = undefined; if (result) { previous.__wrapped__ = clone; } else { result = clone; } var previous = clone; parent = parent.__wrapped__; } previous.__wrapped__ = value; return result; } /** * This method is the wrapper version of `_.reverse`. * * **Note:** This method mutates the wrapped array. * * @name reverse * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2, 3]; * * _(array).reverse().value() * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function wrapperReverse() { var value = this.__wrapped__; if (value instanceof LazyWrapper) { var wrapped = value; if (this.__actions__.length) { wrapped = new LazyWrapper(this); } wrapped = wrapped.reverse(); wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined }); return new LodashWrapper(wrapped, this.__chain__); } return this.thru(reverse); } /** * Executes the chain sequence to resolve the unwrapped value. * * @name value * @memberOf _ * @since 0.1.0 * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. * @example * * _([1, 2, 3]).value(); * // => [1, 2, 3] */ function wrapperValue() { return baseWrapperValue(this.__wrapped__, this.__actions__); } /*------------------------------------------------------------------------*/ /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the number of times the key was returned by `iteratee`. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.5.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.countBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': 1, '6': 2 } * * // The `_.property` iteratee shorthand. * _.countBy(['one', 'two', 'three'], 'length'); * // => { '3': 2, '5': 1 } */ var countBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { ++result[key]; } else { baseAssignValue(result, key, 1); } }); /** * Checks if `predicate` returns truthy for **all** elements of `collection`. * Iteration is stopped once `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index|key, collection). * * **Note:** This method returns `true` for * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of * elements of empty collections. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. * @example * * _.every([true, 1, null, 'yes'], Boolean); * // => false * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.every(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.every(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.every(users, 'active'); * // => false */ function every(collection, predicate, guard) { var func = isArray(collection) ? arrayEvery : baseEvery; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning an array of all elements * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * **Note:** Unlike `_.remove`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * _.filter(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.filter(users, { 'age': 36, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.filter(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.filter(users, 'active'); * // => objects for ['barney'] * * // Combining several predicates using `_.overEvery` or `_.overSome`. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); * // => objects for ['fred', 'barney'] */ function filter(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning the first element * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false }, * { 'user': 'pebbles', 'age': 1, 'active': true } * ]; * * _.find(users, function(o) { return o.age < 40; }); * // => object for 'barney' * * // The `_.matches` iteratee shorthand. * _.find(users, { 'age': 1, 'active': true }); * // => object for 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.find(users, ['active', false]); * // => object for 'fred' * * // The `_.property` iteratee shorthand. * _.find(users, 'active'); * // => object for 'barney' */ var find = createFind(findIndex); /** * This method is like `_.find` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=collection.length-1] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * _.findLast([1, 2, 3, 4], function(n) { * return n % 2 == 1; * }); * // => 3 */ var findLast = createFind(findLastIndex); /** * Creates a flattened array of values by running each element in `collection` * thru `iteratee` and flattening the mapped results. The iteratee is invoked * with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [n, n]; * } * * _.flatMap([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMap(collection, iteratee) { return baseFlatten(map(collection, iteratee), 1); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDeep([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMapDeep(collection, iteratee) { return baseFlatten(map(collection, iteratee), INFINITY); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results up to `depth` times. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDepth([1, 2], duplicate, 2); * // => [[1, 1], [2, 2]] */ function flatMapDepth(collection, iteratee, depth) { depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(map(collection, iteratee), depth); } /** * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * * **Note:** As with other "Collections" methods, objects with a "length" * property are iterated like arrays. To avoid this behavior use `_.forIn` * or `_.forOwn` for object iteration. * * @static * @memberOf _ * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEachRight * @example * * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.forEach` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @alias eachRight * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEach * @example * * _.forEachRight([1, 2], function(value) { * console.log(value); * }); * // => Logs `2` then `1`. */ function forEachRight(collection, iteratee) { var func = isArray(collection) ? arrayEachRight : baseEachRight; return func(collection, getIteratee(iteratee, 3)); } /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The order of grouped values * is determined by the order they occur in `collection`. The corresponding * value of each key is an array of elements responsible for generating the * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.groupBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': [4.2], '6': [6.1, 6.3] } * * // The `_.property` iteratee shorthand. * _.groupBy(['one', 'two', 'three'], 'length'); * // => { '3': ['one', 'two'], '5': ['three'] } */ var groupBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { result[key].push(value); } else { baseAssignValue(result, key, [value]); } }); /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * * _.includes([1, 2, 3], 1); * // => true * * _.includes([1, 2, 3], 1, 2); * // => false * * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments * are provided to each invoked method. If `path` is a function, it's invoked * for, and `this` bound to, each element in `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array|Function|string} path The path of the method to invoke or * the function invoked per iteration. * @param {...*} [args] The arguments to invoke each method with. * @returns {Array} Returns the array of results. * @example * * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); * // => [[1, 5, 7], [1, 2, 3]] * * _.invokeMap([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] */ var invokeMap = baseRest(function(collection, path, args) { var index = -1, isFunc = typeof path == 'function', result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value) { result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); }); return result; }); /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the last element responsible for generating the key. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * var array = [ * { 'dir': 'left', 'code': 97 }, * { 'dir': 'right', 'code': 100 } * ]; * * _.keyBy(array, function(o) { * return String.fromCharCode(o.code); * }); * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } * * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { baseAssignValue(result, key, value); }); /** * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * * function square(n) { * return n * n; * } * * _.map([4, 8], square); * // => [16, 64] * * _.map({ 'a': 4, 'b': 8 }, square); * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, * { 'user': 'fred' } * ]; * * // The `_.property` iteratee shorthand. * _.map(users, 'user'); * // => ['barney', 'fred'] */ function map(collection, iteratee) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.sortBy` except that it allows specifying the sort * orders of the iteratees to sort by. If `orders` is unspecified, all values * are sorted in ascending order. Otherwise, specify an order of "desc" for * descending or "asc" for ascending sort order of corresponding values. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] * The iteratees to sort by. * @param {string[]} [orders] The sort orders of `iteratees`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 34 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 36 } * ]; * * // Sort by `user` in ascending order and by `age` in descending order. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ function orderBy(collection, iteratees, orders, guard) { if (collection == null) { return []; } if (!isArray(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined : orders; if (!isArray(orders)) { orders = orders == null ? [] : [orders]; } return baseOrderBy(collection, iteratees, orders); } /** * Creates an array of elements split into two groups, the first of which * contains elements `predicate` returns truthy for, the second of which * contains elements `predicate` returns falsey for. The predicate is * invoked with one argument: (value). * * @static * @memberOf _ * @since 3.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the array of grouped elements. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true }, * { 'user': 'pebbles', 'age': 1, 'active': false } * ]; * * _.partition(users, function(o) { return o.active; }); * // => objects for [['fred'], ['barney', 'pebbles']] * * // The `_.matches` iteratee shorthand. * _.partition(users, { 'age': 1, 'active': false }); * // => objects for [['pebbles'], ['barney', 'fred']] * * // The `_.matchesProperty` iteratee shorthand. * _.partition(users, ['active', false]); * // => objects for [['barney', 'pebbles'], ['fred']] * * // The `_.property` iteratee shorthand. * _.partition(users, 'active'); * // => objects for [['fred'], ['barney', 'pebbles']] */ var partition = createAggregator(function(result, value, key) { result[key ? 0 : 1].push(value); }, function() { return [[], []]; }); /** * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.reduce`, `_.reduceRight`, and `_.transform`. * * The guarded methods are: * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, * and `sortBy` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduceRight * @example * * _.reduce([1, 2], function(sum, n) { * return sum + n; * }, 0); * // => 3 * * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * return result; * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ function reduce(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); } /** * This method is like `_.reduce` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduce * @example * * var array = [[0, 1], [2, 3], [4, 5]]; * * _.reduceRight(array, function(flattened, other) { * return flattened.concat(other); * }, []); * // => [4, 5, 2, 3, 0, 1] */ function reduceRight(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); } /** * The opposite of `_.filter`; this method returns the elements of `collection` * that `predicate` does **not** return truthy for. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.filter * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true } * ]; * * _.reject(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.reject(users, { 'age': 40, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.reject(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.reject(users, 'active'); * // => objects for ['barney'] */ function reject(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, negate(getIteratee(predicate, 3))); } /** * Gets a random element from `collection`. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. * @example * * _.sample([1, 2, 3, 4]); * // => 2 */ function sample(collection) { var func = isArray(collection) ? arraySample : baseSample; return func(collection); } /** * Gets `n` random elements at unique keys from `collection` up to the * size of `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @param {number} [n=1] The number of elements to sample. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the random elements. * @example * * _.sampleSize([1, 2, 3], 2); * // => [3, 1] * * _.sampleSize([1, 2, 3], 4); * // => [2, 3, 1] */ function sampleSize(collection, n, guard) { if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } var func = isArray(collection) ? arraySampleSize : baseSampleSize; return func(collection, n); } /** * Creates an array of shuffled values, using a version of the * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. * @example * * _.shuffle([1, 2, 3, 4]); * // => [4, 1, 3, 2] */ function shuffle(collection) { var func = isArray(collection) ? arrayShuffle : baseShuffle; return func(collection); } /** * Gets the size of `collection` by returning its length for array-like * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @returns {number} Returns the collection size. * @example * * _.size([1, 2, 3]); * // => 3 * * _.size({ 'a': 1, 'b': 2 }); * // => 2 * * _.size('pebbles'); * // => 7 */ function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { return isString(collection) ? stringSize(collection) : collection.length; } var tag = getTag(collection); if (tag == mapTag || tag == setTag) { return collection.size; } return baseKeys(collection).length; } /** * Checks if `predicate` returns truthy for **any** element of `collection`. * Iteration is stopped once `predicate` returns truthy. The predicate is * invoked with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. * @example * * _.some([null, 0, 'yes', false], Boolean); * // => true * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.some(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.some(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.some(users, 'active'); * // => true */ function some(collection, predicate, guard) { var func = isArray(collection) ? arraySome : baseSome; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 30 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); /*------------------------------------------------------------------------*/ /** * Gets the timestamp of the number of milliseconds that have elapsed since * the Unix epoch (1 January 1970 00:00:00 UTC). * * @static * @memberOf _ * @since 2.4.0 * @category Date * @returns {number} Returns the timestamp. * @example * * _.defer(function(stamp) { * console.log(_.now() - stamp); * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. */ var now = ctxNow || function() { return root.Date.now(); }; /*------------------------------------------------------------------------*/ /** * The opposite of `_.before`; this method creates a function that invokes * `func` once it's called `n` or more times. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {number} n The number of calls before `func` is invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var saves = ['profile', 'settings']; * * var done = _.after(saves.length, function() { * console.log('done saving!'); * }); * * _.forEach(saves, function(type) { * asyncSave({ 'type': type, 'complete': done }); * }); * // => Logs 'done saving!' after the two async saves have completed. */ function after(n, func) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n < 1) { return func.apply(this, arguments); } }; } /** * Creates a function that invokes `func`, with up to `n` arguments, * ignoring any additional arguments. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @param {number} [n=func.length] The arity cap. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.ary(parseInt, 1)); * // => [6, 8, 10] */ function ary(func, n, guard) { n = guard ? undefined : n; n = (func && n == null) ? func.length : n; return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); } /** * Creates a function that invokes `func`, with the `this` binding and arguments * of the created function, while it's called less than `n` times. Subsequent * calls to the created function return the result of the last `func` invocation. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * jQuery(element).on('click', _.before(5, addContactToList)); * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { var result; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n > 0) { result = func.apply(this, arguments); } if (n <= 1) { func = undefined; } return result; }; } /** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" * property of bound functions. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * * var object = { 'user': 'fred' }; * * var bound = _.bind(greet, object, 'hi'); * bound('!'); * // => 'hi fred!' * * // Bound with placeholders. * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' */ var bind = baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(func, bitmask, thisArg, partials, holders); }); /** * Creates a function that invokes the method at `object[key]` with `partials` * prepended to the arguments it receives. * * This method differs from `_.bind` by allowing bound functions to reference * methods that may be redefined or don't yet exist. See * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) * for more details. * * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * @static * @memberOf _ * @since 0.10.0 * @category Function * @param {Object} object The object to invoke the method on. * @param {string} key The key of the method. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * var object = { * 'user': 'fred', * 'greet': function(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * }; * * var bound = _.bindKey(object, 'greet', 'hi'); * bound('!'); * // => 'hi fred!' * * object.greet = function(greeting, punctuation) { * return greeting + 'ya ' + this.user + punctuation; * }; * * bound('!'); * // => 'hiya fred!' * * // Bound with placeholders. * var bound = _.bindKey(object, 'greet', _, '!'); * bound('hi'); * // => 'hiya fred!' */ var bindKey = baseRest(function(object, key, partials) { var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(key, bitmask, object, partials, holders); }); /** * Creates a function that accepts arguments of `func` and either invokes * `func` returning its result, if at least `arity` number of arguments have * been provided, or returns a function that accepts the remaining `func` * arguments, and so on. The arity of `func` may be specified if `func.length` * is not sufficient. * * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 2.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curry(abc); * * curried(1)(2)(3); * // => [1, 2, 3] * * curried(1, 2)(3); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(1)(_, 3)(2); * // => [1, 2, 3] */ function curry(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curry.placeholder; return result; } /** * This method is like `_.curry` except that arguments are applied to `func` * in the manner of `_.partialRight` instead of `_.partial`. * * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curryRight(abc); * * curried(3)(2)(1); * // => [1, 2, 3] * * curried(2, 3)(1); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(3)(1, _)(2); * // => [1, 2, 3] */ function curryRight(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curryRight.placeholder; return result; } /** * Creates a debounced function that delays invoking `func` until after `wait` * milliseconds have elapsed since the last time the debounced function was * invoked. The debounced function comes with a `cancel` method to cancel * delayed `func` invocations and a `flush` method to immediately invoke them. * Provide `options` to indicate whether `func` should be invoked on the * leading and/or trailing edge of the `wait` timeout. The `func` is invoked * with the last arguments provided to the debounced function. Subsequent * calls to the debounced function return the result of the last `func` * invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the debounced function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to debounce. * @param {number} [wait=0] The number of milliseconds to delay. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=false] * Specify invoking on the leading edge of the timeout. * @param {number} [options.maxWait] * The maximum time `func` is allowed to be delayed before it's invoked. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new debounced function. * @example * * // Avoid costly calculations while the window size is in flux. * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * * // Invoke `sendMail` when clicked, debouncing subsequent calls. * jQuery(element).on('click', _.debounce(sendMail, 300, { * 'leading': true, * 'trailing': false * })); * * // Ensure `batchLog` is invoked once after 1 second of debounced calls. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); * var source = new EventSource('/stream'); * jQuery(source).on('message', debounced); * * // Cancel the trailing debounced invocation. * jQuery(window).on('popstate', debounced.cancel); */ function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; maxing = 'maxWait' in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = 'trailing' in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined; lastInvokeTime = time; result = func.apply(thisArg, args); return result; } function leadingEdge(time) { // Reset any `maxWait` timer. lastInvokeTime = time; // Start the timer for the trailing edge. timerId = setTimeout(timerExpired, wait); // Invoke the leading edge. return leading ? invokeFunc(time) : result; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the // trailing edge, the system time has gone backwards and we're treating // it as the trailing edge, or we've hit the `maxWait` limit. return (lastCallTime === undefined || (timeSinceLastCall >= wait) || (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); } function timerExpired() { var time = now(); if (shouldInvoke(time)) { return trailingEdge(time); } // Restart the timer. timerId = setTimeout(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been // debounced at least once. if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined; return result; } function cancel() { if (timerId !== undefined) { clearTimeout(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } function flush() { return timerId === undefined ? result : trailingEdge(now()); } function debounced() { var time = now(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined) { return leadingEdge(lastCallTime); } if (maxing) { // Handle invocations in a tight loop. clearTimeout(timerId); timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined) { timerId = setTimeout(timerExpired, wait); } return result; } debounced.cancel = cancel; debounced.flush = flush; return debounced; } /** * Defers invoking the `func` until the current call stack has cleared. Any * additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to defer. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.defer(function(text) { * console.log(text); * }, 'deferred'); * // => Logs 'deferred' after one millisecond. */ var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); /** * Invokes `func` after `wait` milliseconds. Any additional arguments are * provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.delay(function(text) { * console.log(text); * }, 1000, 'later'); * // => Logs 'later' after one second. */ var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); /** * Creates a function that invokes `func` with arguments reversed. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to flip arguments for. * @returns {Function} Returns the new flipped function. * @example * * var flipped = _.flip(function() { * return _.toArray(arguments); * }); * * flipped('a', 'b', 'c', 'd'); * // => ['d', 'c', 'b', 'a'] */ function flip(func) { return createWrap(func, WRAP_FLIP_FLAG); } /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = MapCache; /** * Creates a function that negates the result of the predicate `func`. The * `func` predicate is invoked with the `this` binding and arguments of the * created function. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. * @returns {Function} Returns the new negated function. * @example * * function isEven(n) { * return n % 2 == 0; * } * * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); * // => [1, 3, 5] */ function negate(predicate) { if (typeof predicate != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return function() { var args = arguments; switch (args.length) { case 0: return !predicate.call(this); case 1: return !predicate.call(this, args[0]); case 2: return !predicate.call(this, args[0], args[1]); case 3: return !predicate.call(this, args[0], args[1], args[2]); } return !predicate.apply(this, args); }; } /** * Creates a function that is restricted to invoking `func` once. Repeat calls * to the function return the value of the first invocation. The `func` is * invoked with the `this` binding and arguments of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var initialize = _.once(createApplication); * initialize(); * initialize(); * // => `createApplication` is invoked once */ function once(func) { return before(2, func); } /** * Creates a function that invokes `func` with its arguments transformed. * * @static * @since 4.0.0 * @memberOf _ * @category Function * @param {Function} func The function to wrap. * @param {...(Function|Function[])} [transforms=[_.identity]] * The argument transforms. * @returns {Function} Returns the new function. * @example * * function doubled(n) { * return n * 2; * } * * function square(n) { * return n * n; * } * * var func = _.overArgs(function(x, y) { * return [x, y]; * }, [square, doubled]); * * func(9, 3); * // => [81, 6] * * func(10, 5); * // => [100, 10] */ var overArgs = castRest(function(func, transforms) { transforms = (transforms.length == 1 && isArray(transforms[0])) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); var funcsLength = transforms.length; return baseRest(function(args) { var index = -1, length = nativeMin(args.length, funcsLength); while (++index < length) { args[index] = transforms[index].call(this, args[index]); } return apply(func, this, args); }); }); /** * Creates a function that invokes `func` with `partials` prepended to the * arguments it receives. This method is like `_.bind` except it does **not** * alter the `this` binding. * * The `_.partial.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 0.2.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var sayHelloTo = _.partial(greet, 'hello'); * sayHelloTo('fred'); * // => 'hello fred' * * // Partially applied with placeholders. * var greetFred = _.partial(greet, _, 'fred'); * greetFred('hi'); * // => 'hi fred' */ var partial = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partial)); return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); }); /** * This method is like `_.partial` except that partially applied arguments * are appended to the arguments it receives. * * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 1.0.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var greetFred = _.partialRight(greet, 'fred'); * greetFred('hi'); * // => 'hi fred' * * // Partially applied with placeholders. * var sayHelloTo = _.partialRight(greet, 'hello', _); * sayHelloTo('fred'); * // => 'hello fred' */ var partialRight = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); /** * Creates a function that invokes `func` with arguments arranged according * to the specified `indexes` where the argument value at the first index is * provided as the first argument, the argument value at the second index is * provided as the second argument, and so on. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to rearrange arguments for. * @param {...(number|number[])} indexes The arranged argument indexes. * @returns {Function} Returns the new function. * @example * * var rearged = _.rearg(function(a, b, c) { * return [a, b, c]; * }, [2, 0, 1]); * * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ var rearg = flatRest(function(func, indexes) { return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); }); /** * Creates a function that invokes `func` with the `this` binding of the * created function and arguments from `start` and beyond provided as * an array. * * **Note:** This method is based on the * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. * @example * * var say = _.rest(function(what, names) { * return what + ' ' + _.initial(names).join(', ') + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); * }); * * say('hello', 'fred', 'barney', 'pebbles'); * // => 'hello fred, barney, & pebbles' */ function rest(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start === undefined ? start : toInteger(start); return baseRest(func, start); } /** * Creates a function that invokes `func` with the `this` binding of the * create function and an array of arguments much like * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). * * **Note:** This method is based on the * [spread operator](https://mdn.io/spread_operator). * * @static * @memberOf _ * @since 3.2.0 * @category Function * @param {Function} func The function to spread arguments over. * @param {number} [start=0] The start position of the spread. * @returns {Function} Returns the new function. * @example * * var say = _.spread(function(who, what) { * return who + ' says ' + what; * }); * * say(['fred', 'hello']); * // => 'fred says hello' * * var numbers = Promise.all([ * Promise.resolve(40), * Promise.resolve(36) * ]); * * numbers.then(_.spread(function(x, y) { * return x + y; * })); * // => a Promise of 76 */ function spread(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start == null ? 0 : nativeMax(toInteger(start), 0); return baseRest(function(args) { var array = args[start], otherArgs = castSlice(args, 0, start); if (array) { arrayPush(otherArgs, array); } return apply(func, this, otherArgs); }); } /** * Creates a throttled function that only invokes `func` at most once per * every `wait` milliseconds. The throttled function comes with a `cancel` * method to cancel delayed `func` invocations and a `flush` method to * immediately invoke them. Provide `options` to indicate whether `func` * should be invoked on the leading and/or trailing edge of the `wait` * timeout. The `func` is invoked with the last arguments provided to the * throttled function. Subsequent calls to the throttled function return the * result of the last `func` invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the throttled function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.throttle` and `_.debounce`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to throttle. * @param {number} [wait=0] The number of milliseconds to throttle invocations to. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=true] * Specify invoking on the leading edge of the timeout. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new throttled function. * @example * * // Avoid excessively updating the position while scrolling. * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); * jQuery(element).on('click', throttled); * * // Cancel the trailing throttled invocation. * jQuery(window).on('popstate', throttled.cancel); */ function throttle(func, wait, options) { var leading = true, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (isObject(options)) { leading = 'leading' in options ? !!options.leading : leading; trailing = 'trailing' in options ? !!options.trailing : trailing; } return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing }); } /** * Creates a function that accepts up to one argument, ignoring any * additional arguments. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.unary(parseInt)); * // => [6, 8, 10] */ function unary(func) { return ary(func, 1); } /** * Creates a function that provides `value` to `wrapper` as its first * argument. Any additional arguments provided to the function are appended * to those provided to the `wrapper`. The wrapper is invoked with the `this` * binding of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {*} value The value to wrap. * @param {Function} [wrapper=identity] The wrapper function. * @returns {Function} Returns the new function. * @example * * var p = _.wrap(_.escape, function(func, text) { * return '

' + func(text) + '

'; * }); * * p('fred, barney, & pebbles'); * // => '

fred, barney, & pebbles

' */ function wrap(value, wrapper) { return partial(castFunction(wrapper), value); } /*------------------------------------------------------------------------*/ /** * Casts `value` as an array if it's not one. * * @static * @memberOf _ * @since 4.4.0 * @category Lang * @param {*} value The value to inspect. * @returns {Array} Returns the cast array. * @example * * _.castArray(1); * // => [1] * * _.castArray({ 'a': 1 }); * // => [{ 'a': 1 }] * * _.castArray('abc'); * // => ['abc'] * * _.castArray(null); * // => [null] * * _.castArray(undefined); * // => [undefined] * * _.castArray(); * // => [] * * var array = [1, 2, 3]; * console.log(_.castArray(array) === array); * // => true */ function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray(value) ? value : [value]; } /** * Creates a shallow clone of `value`. * * **Note:** This method is loosely based on the * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) * and supports cloning arrays, array buffers, booleans, date objects, maps, * numbers, `Object` objects, regexes, sets, strings, symbols, and typed * arrays. The own enumerable properties of `arguments` objects are cloned * as plain objects. An empty object is returned for uncloneable values such * as error objects, functions, DOM nodes, and WeakMaps. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to clone. * @returns {*} Returns the cloned value. * @see _.cloneDeep * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var shallow = _.clone(objects); * console.log(shallow[0] === objects[0]); * // => true */ function clone(value) { return baseClone(value, CLONE_SYMBOLS_FLAG); } /** * This method is like `_.clone` except that it accepts `customizer` which * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the cloned value. * @see _.cloneDeepWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(false); * } * } * * var el = _.cloneWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 0 */ function cloneWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } /** * This method is like `_.clone` except that it recursively clones `value`. * * @static * @memberOf _ * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. * @see _.clone * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var deep = _.cloneDeep(objects); * console.log(deep[0] === objects[0]); * // => false */ function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } /** * This method is like `_.cloneWith` except that it recursively clones `value`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to recursively clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the deep cloned value. * @see _.cloneWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(true); * } * } * * var el = _.cloneDeepWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 20 */ function cloneDeepWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } /** * Checks if `object` conforms to `source` by invoking the predicate * properties of `source` with the corresponding property values of `object`. * * **Note:** This method is equivalent to `_.conforms` when `source` is * partially applied. * * @static * @memberOf _ * @since 4.14.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); * // => true * * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); * // => false */ function conformsTo(object, source) { return source == null || baseConformsTo(object, source, keys(source)); } /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** * Checks if `value` is greater than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. * @see _.lt * @example * * _.gt(3, 1); * // => true * * _.gt(3, 3); * // => false * * _.gt(1, 3); * // => false */ var gt = createRelationalOperation(baseGt); /** * Checks if `value` is greater than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than or equal to * `other`, else `false`. * @see _.lte * @example * * _.gte(3, 1); * // => true * * _.gte(3, 3); * // => true * * _.gte(1, 3); * // => false */ var gte = createRelationalOperation(function(value, other) { return value >= other; }); /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is classified as an `ArrayBuffer` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. * @example * * _.isArrayBuffer(new ArrayBuffer(2)); * // => true * * _.isArrayBuffer(new Array(2)); * // => false */ var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } /** * Checks if `value` is classified as a boolean primitive or object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * * _.isBoolean(false); * // => true * * _.isBoolean(null); * // => false */ function isBoolean(value) { return value === true || value === false || (isObjectLike(value) && baseGetTag(value) == boolTag); } /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; /** * Checks if `value` is classified as a `Date` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); * // => true * * _.isDate('Mon April 23 2012'); * // => false */ var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; /** * Checks if `value` is likely a DOM element. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. * @example * * _.isElement(document.body); * // => true * * _.isElement(''); * // => false */ function isElement(value) { return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); } /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } return true; } /** * Performs a deep comparison between two values to determine if they are * equivalent. * * **Note:** This method supports comparing arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, * sets, strings, symbols, and typed arrays. `Object` objects are compared * by their own, not inherited, enumerable properties. Functions and DOM * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true * * object === other; * // => false */ function isEqual(value, other) { return baseIsEqual(value, other); } /** * This method is like `_.isEqual` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with up to * six arguments: (objValue, othValue [, index|key, object, other, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, othValue) { * if (isGreeting(objValue) && isGreeting(othValue)) { * return true; * } * } * * var array = ['hello', 'goodbye']; * var other = ['hi', 'goodbye']; * * _.isEqualWith(array, other, customizer); * // => true */ function isEqualWith(value, other, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; var result = customizer ? customizer(value, other) : undefined; return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; } /** * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, * `SyntaxError`, `TypeError`, or `URIError` object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * * _.isError(new Error); * // => true * * _.isError(Error); * // => false */ function isError(value) { if (!isObjectLike(value)) { return false; } var tag = baseGetTag(value); return tag == errorTag || tag == domExcTag || (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); } /** * Checks if `value` is a finite primitive number. * * **Note:** This method is based on * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. * @example * * _.isFinite(3); * // => true * * _.isFinite(Number.MIN_VALUE); * // => true * * _.isFinite(Infinity); * // => false * * _.isFinite('3'); * // => false */ function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); } /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** * Checks if `value` is an integer. * * **Note:** This method is based on * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an integer, else `false`. * @example * * _.isInteger(3); * // => true * * _.isInteger(Number.MIN_VALUE); * // => false * * _.isInteger(Infinity); * // => false * * _.isInteger('3'); * // => false */ function isInteger(value) { return typeof value == 'number' && value == toInteger(value); } /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /** * Checks if `value` is classified as a `Map` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * _.isMap(new Map); * // => true * * _.isMap(new WeakMap); * // => false */ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; /** * Performs a partial deep comparison between `object` and `source` to * determine if `object` contains equivalent property values. * * **Note:** This method is equivalent to `_.matches` when `source` is * partially applied. * * Partial comparisons will match empty array and empty object `source` * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.isMatch(object, { 'b': 2 }); * // => true * * _.isMatch(object, { 'b': 1 }); * // => false */ function isMatch(object, source) { return object === source || baseIsMatch(object, source, getMatchData(source)); } /** * This method is like `_.isMatch` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, srcValue) { * if (isGreeting(objValue) && isGreeting(srcValue)) { * return true; * } * } * * var object = { 'greeting': 'hello' }; * var source = { 'greeting': 'hi' }; * * _.isMatchWith(object, source, customizer); * // => true */ function isMatchWith(object, source, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseIsMatch(object, source, getMatchData(source), customizer); } /** * Checks if `value` is `NaN`. * * **Note:** This method is based on * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for * `undefined` and other non-number values. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. * @example * * _.isNaN(NaN); * // => true * * _.isNaN(new Number(NaN)); * // => true * * isNaN(undefined); * // => true * * _.isNaN(undefined); * // => false */ function isNaN(value) { // An `NaN` primitive is the only value that is not equal to itself. // Perform the `toStringTag` check first to avoid errors with some // ActiveX objects in IE. return isNumber(value) && value != +value; } /** * Checks if `value` is a pristine native function. * * **Note:** This method can't reliably detect native functions in the presence * of the core-js package because core-js circumvents this kind of detection. * Despite multiple requests, the core-js maintainer has made it clear: any * attempt to fix the detection will be obstructed. As a result, we're left * with little choice but to throw an error. Unfortunately, this also affects * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), * which rely on core-js. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. * @example * * _.isNative(Array.prototype.push); * // => true * * _.isNative(_); * // => false */ function isNative(value) { if (isMaskable(value)) { throw new Error(CORE_ERROR_TEXT); } return baseIsNative(value); } /** * Checks if `value` is `null`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `null`, else `false`. * @example * * _.isNull(null); * // => true * * _.isNull(void 0); * // => false */ function isNull(value) { return value === null; } /** * Checks if `value` is `null` or `undefined`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is nullish, else `false`. * @example * * _.isNil(null); * // => true * * _.isNil(void 0); * // => true * * _.isNil(NaN); * // => false */ function isNil(value) { return value == null; } /** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); * // => true * * _.isNumber(Number.MIN_VALUE); * // => true * * _.isNumber(Infinity); * // => true * * _.isNumber('3'); * // => false */ function isNumber(value) { return typeof value == 'number' || (isObjectLike(value) && baseGetTag(value) == numberTag); } /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } /** * Checks if `value` is classified as a `RegExp` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * * _.isRegExp(/abc/); * // => true * * _.isRegExp('/abc/'); * // => false */ var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; /** * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 * double precision number which isn't the result of a rounded unsafe integer. * * **Note:** This method is based on * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. * @example * * _.isSafeInteger(3); * // => true * * _.isSafeInteger(Number.MIN_VALUE); * // => false * * _.isSafeInteger(Infinity); * // => false * * _.isSafeInteger('3'); * // => false */ function isSafeInteger(value) { return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is classified as a `Set` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * _.isSet(new Set); * // => true * * _.isSet(new WeakSet); * // => false */ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && baseGetTag(value) == symbolTag); } /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** * Checks if `value` is `undefined`. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * * _.isUndefined(void 0); * // => true * * _.isUndefined(null); * // => false */ function isUndefined(value) { return value === undefined; } /** * Checks if `value` is classified as a `WeakMap` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. * @example * * _.isWeakMap(new WeakMap); * // => true * * _.isWeakMap(new Map); * // => false */ function isWeakMap(value) { return isObjectLike(value) && getTag(value) == weakMapTag; } /** * Checks if `value` is classified as a `WeakSet` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. * @example * * _.isWeakSet(new WeakSet); * // => true * * _.isWeakSet(new Set); * // => false */ function isWeakSet(value) { return isObjectLike(value) && baseGetTag(value) == weakSetTag; } /** * Checks if `value` is less than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. * @see _.gt * @example * * _.lt(1, 3); * // => true * * _.lt(3, 3); * // => false * * _.lt(3, 1); * // => false */ var lt = createRelationalOperation(baseLt); /** * Checks if `value` is less than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than or equal to * `other`, else `false`. * @see _.gte * @example * * _.lte(1, 3); * // => true * * _.lte(3, 3); * // => true * * _.lte(3, 1); * // => false */ var lte = createRelationalOperation(function(value, other) { return value <= other; }); /** * Converts `value` to an array. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to convert. * @returns {Array} Returns the converted array. * @example * * _.toArray({ 'a': 1, 'b': 2 }); * // => [1, 2] * * _.toArray('abc'); * // => ['a', 'b', 'c'] * * _.toArray(1); * // => [] * * _.toArray(null); * // => [] */ function toArray(value) { if (!value) { return []; } if (isArrayLike(value)) { return isString(value) ? stringToArray(value) : copyArray(value); } if (symIterator && value[symIterator]) { return iteratorToArray(value[symIterator]()); } var tag = getTag(value), func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); return func(value); } /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } return value === value ? value : 0; } /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? (remainder ? result - remainder : result) : 0; } /** * Converts `value` to an integer suitable for use as the length of an * array-like object. * * **Note:** This method is based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toLength(3.2); * // => 3 * * _.toLength(Number.MIN_VALUE); * // => 0 * * _.toLength(Infinity); * // => 4294967295 * * _.toLength('3.2'); * // => 3 */ function toLength(value) { return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; } /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = baseTrim(value); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return copyObject(value, keysIn(value)); } /** * Converts `value` to a safe integer. A safe integer can be compared and * represented correctly. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toSafeInteger(3.2); * // => 3 * * _.toSafeInteger(Number.MIN_VALUE); * // => 0 * * _.toSafeInteger(Infinity); * // => 9007199254740991 * * _.toSafeInteger('3.2'); * // => 3 */ function toSafeInteger(value) { return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : (value === 0 ? value : 0); } /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } /*------------------------------------------------------------------------*/ /** * Assigns own enumerable string keyed properties of source objects to the * destination object. Source objects are applied from left to right. * Subsequent sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object` and is loosely based on * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ * @since 0.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assignIn * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assign({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } for (var key in source) { if (hasOwnProperty.call(source, key)) { assignValue(object, key, source[key]); } } }); /** * This method is like `_.assign` except that it iterates over own and * inherited source properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assign * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); }); /** * This method is like `_.assignIn` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extendWith * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignInWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); /** * This method is like `_.assign` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignInWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keys(source), object, customizer); }); /** * Creates an array of values corresponding to `paths` of `object`. * * @static * @memberOf _ * @since 1.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Array} Returns the picked values. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _.at(object, ['a[0].b.c', 'a[1]']); * // => [3, 4] */ var at = flatRest(baseAt); /** * Creates an object that inherits from the `prototype` object. If a * `properties` object is given, its own enumerable string keyed properties * are assigned to the created object. * * @static * @memberOf _ * @since 2.3.0 * @category Object * @param {Object} prototype The object to inherit from. * @param {Object} [properties] The properties to assign to the object. * @returns {Object} Returns the new object. * @example * * function Shape() { * this.x = 0; * this.y = 0; * } * * function Circle() { * Shape.call(this); * } * * Circle.prototype = _.create(Shape.prototype, { * 'constructor': Circle * }); * * var circle = new Circle; * circle instanceof Circle; * // => true * * circle instanceof Shape; * // => true */ function create(prototype, properties) { var result = baseCreate(prototype); return properties == null ? result : baseAssign(result, properties); } /** * Assigns own and inherited enumerable string keyed properties of source * objects to the destination object for all destination properties that * resolve to `undefined`. Source objects are applied from left to right. * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaultsDeep * @example * * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var defaults = baseRest(function(object, sources) { object = Object(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === undefined || (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { object[key] = source[key]; } } } return object; }); /** * This method is like `_.defaults` except that it recursively assigns * default properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaults * @example * * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); * // => { 'a': { 'b': 2, 'c': 3 } } */ var defaultsDeep = baseRest(function(args) { args.push(undefined, customDefaultsMerge); return apply(mergeWith, undefined, args); }); /** * This method is like `_.find` except that it returns the key of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findKey(users, function(o) { return o.age < 40; }); * // => 'barney' (iteration order is not guaranteed) * * // The `_.matches` iteratee shorthand. * _.findKey(users, { 'age': 1, 'active': true }); * // => 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.findKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findKey(users, 'active'); * // => 'barney' */ function findKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); } /** * This method is like `_.findKey` except that it iterates over elements of * a collection in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findLastKey(users, function(o) { return o.age < 40; }); * // => returns 'pebbles' assuming `_.findKey` returns 'barney' * * // The `_.matches` iteratee shorthand. * _.findLastKey(users, { 'age': 36, 'active': true }); * // => 'barney' * * // The `_.matchesProperty` iteratee shorthand. * _.findLastKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findLastKey(users, 'active'); * // => 'pebbles' */ function findLastKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); } /** * Iterates over own and inherited enumerable string keyed properties of an * object and invokes `iteratee` for each property. The iteratee is invoked * with three arguments: (value, key, object). Iteratee functions may exit * iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forInRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forIn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). */ function forIn(object, iteratee) { return object == null ? object : baseFor(object, getIteratee(iteratee, 3), keysIn); } /** * This method is like `_.forIn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forIn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forInRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. */ function forInRight(object, iteratee) { return object == null ? object : baseForRight(object, getIteratee(iteratee, 3), keysIn); } /** * Iterates over own enumerable string keyed properties of an object and * invokes `iteratee` for each property. The iteratee is invoked with three * arguments: (value, key, object). Iteratee functions may exit iteration * early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwnRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { return object && baseForOwn(object, getIteratee(iteratee, 3)); } /** * This method is like `_.forOwn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwnRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { return object && baseForOwnRight(object, getIteratee(iteratee, 3)); } /** * Creates an array of function property names from own enumerable properties * of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functionsIn * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functions(new Foo); * // => ['a', 'b'] */ function functions(object) { return object == null ? [] : baseFunctions(object, keys(object)); } /** * Creates an array of function property names from own and inherited * enumerable properties of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functions * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functionsIn(new Foo); * // => ['a', 'b', 'c'] */ function functionsIn(object) { return object == null ? [] : baseFunctions(object, keysIn(object)); } /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } /** * Checks if `path` is a direct property of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = { 'a': { 'b': 2 } }; * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * * _.has(object, 'a.b'); * // => true * * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { return object != null && hasPath(object, path, baseHas); } /** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { return object != null && hasPath(object, path, baseHasIn); } /** * Creates an object composed of the inverted keys and values of `object`. * If `object` contains duplicate values, subsequent values overwrite * property assignments of previous values. * * @static * @memberOf _ * @since 0.7.0 * @category Object * @param {Object} object The object to invert. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invert(object); * // => { '1': 'c', '2': 'b' } */ var invert = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } result[value] = key; }, constant(identity)); /** * This method is like `_.invert` except that the inverted object is generated * from the results of running each element of `object` thru `iteratee`. The * corresponding inverted value of each inverted key is an array of keys * responsible for generating the inverted value. The iteratee is invoked * with one argument: (value). * * @static * @memberOf _ * @since 4.1.0 * @category Object * @param {Object} object The object to invert. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invertBy(object); * // => { '1': ['a', 'c'], '2': ['b'] } * * _.invertBy(object, function(value) { * return 'group' + value; * }); * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ var invertBy = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } if (hasOwnProperty.call(result, value)) { result[value].push(key); } else { result[value] = [key]; } }, getIteratee); /** * Invokes the method at `path` of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. * @example * * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; * * _.invoke(object, 'a[0].b.c.slice', 1, 3); * // => [2, 3] */ var invoke = baseRest(baseInvoke); /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } /** * The opposite of `_.mapValues`; this method creates an object with the * same values as `object` and keys generated by running each own enumerable * string keyed property of `object` thru `iteratee`. The iteratee is invoked * with three arguments: (value, key, object). * * @static * @memberOf _ * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapValues * @example * * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { * return key + value; * }); * // => { 'a1': 1, 'b2': 2 } */ function mapKeys(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, iteratee(value, key, object), value); }); return result; } /** * Creates an object with the same keys as `object` and values generated * by running each own enumerable string keyed property of `object` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, key, object). * * @static * @memberOf _ * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapKeys * @example * * var users = { * 'fred': { 'user': 'fred', 'age': 40 }, * 'pebbles': { 'user': 'pebbles', 'age': 1 } * }; * * _.mapValues(users, function(o) { return o.age; }); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) * * // The `_.property` iteratee shorthand. * _.mapValues(users, 'age'); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ function mapValues(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, key, iteratee(value, key, object)); }); return result; } /** * This method is like `_.assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @example * * var object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * * var other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with six arguments: * (objValue, srcValue, key, object, source, stack). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} customizer The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * function customizer(objValue, srcValue) { * if (_.isArray(objValue)) { * return objValue.concat(srcValue); * } * } * * var object = { 'a': [1], 'b': [2] }; * var other = { 'a': [3], 'b': [4] }; * * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } */ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); /** * The opposite of `_.pick`; this method creates an object composed of the * own and inherited enumerable property paths of `object` that are not omitted. * * **Note:** This method is considerably slower than `_.pick`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to omit. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ var omit = flatRest(function(object, paths) { var result = {}; if (object == null) { return result; } var isDeep = false; paths = arrayMap(paths, function(path) { path = castPath(path, object); isDeep || (isDeep = path.length > 1); return path; }); copyObject(object, getAllKeysIn(object), result); if (isDeep) { result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } var length = paths.length; while (length--) { baseUnset(result, paths[length]); } return result; }); /** * The opposite of `_.pickBy`; this method creates an object composed of * the own and inherited enumerable string keyed properties of `object` that * `predicate` doesn't return truthy for. The predicate is invoked with two * arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omitBy(object, _.isNumber); * // => { 'b': '2' } */ function omitBy(object, predicate) { return pickBy(object, negate(getIteratee(predicate))); } /** * Creates an object composed of the picked `object` properties. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); /** * Creates an object composed of the `object` properties `predicate` returns * truthy for. The predicate is invoked with two arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pickBy(object, _.isNumber); * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { if (object == null) { return {}; } var props = arrayMap(getAllKeysIn(object), function(prop) { return [prop]; }); predicate = getIteratee(predicate); return basePickBy(object, props, function(value, path) { return predicate(value, path[0]); }); } /** * This method is like `_.get` except that if the resolved value is a * function it's invoked with the `this` binding of its parent object and * its result is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to resolve. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; * * _.result(object, 'a[0].b.c1'); * // => 3 * * _.result(object, 'a[0].b.c2'); * // => 4 * * _.result(object, 'a[0].b.c3', 'default'); * // => 'default' * * _.result(object, 'a[0].b.c3', _.constant('default')); * // => 'default' */ function result(object, path, defaultValue) { path = castPath(path, object); var index = -1, length = path.length; // Ensure the loop is entered when path is empty. if (!length) { length = 1; object = undefined; } while (++index < length) { var value = object == null ? undefined : object[toKey(path[index])]; if (value === undefined) { index = length; value = defaultValue; } object = isFunction(value) ? value.call(object) : value; } return object; } /** * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.set(object, 'a[0].b.c', 4); * console.log(object.a[0].b.c); * // => 4 * * _.set(object, ['x', '0', 'y', 'z'], 5); * console.log(object.x[0].y.z); * // => 5 */ function set(object, path, value) { return object == null ? object : baseSet(object, path, value); } /** * This method is like `_.set` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.setWith(object, '[0][1]', 'a', Object); * // => { '0': { '1': 'a' } } */ function setWith(object, path, value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseSet(object, path, value, customizer); } /** * Creates an array of own enumerable string keyed-value pairs for `object` * which can be consumed by `_.fromPairs`. If `object` is a map or set, its * entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entries * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairs(new Foo); * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) */ var toPairs = createToPairs(keys); /** * Creates an array of own and inherited enumerable string keyed-value pairs * for `object` which can be consumed by `_.fromPairs`. If `object` is a map * or set, its entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entriesIn * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairsIn(new Foo); * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) */ var toPairsIn = createToPairs(keysIn); /** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own * enumerable string keyed properties thru `iteratee`, with each invocation * potentially mutating the `accumulator` object. If `accumulator` is not * provided, a new object with the same `[[Prototype]]` will be used. The * iteratee is invoked with four arguments: (accumulator, value, key, object). * Iteratee functions may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 1.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The custom accumulator value. * @returns {*} Returns the accumulated value. * @example * * _.transform([2, 3, 4], function(result, n) { * result.push(n *= n); * return n % 2 == 0; * }, []); * // => [4, 9] * * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee = getIteratee(iteratee, 4); if (accumulator == null) { var Ctor = object && object.constructor; if (isArrLike) { accumulator = isArr ? new Ctor : []; } else if (isObject(object)) { accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } else { accumulator = {}; } } (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; } /** * Removes the property at `path` of `object`. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. * @example * * var object = { 'a': [{ 'b': { 'c': 7 } }] }; * _.unset(object, 'a[0].b.c'); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; * * _.unset(object, ['a', '0', 'b', 'c']); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; */ function unset(object, path) { return object == null ? true : baseUnset(object, path); } /** * This method is like `_.set` except that accepts `updater` to produce the * value to set. Use `_.updateWith` to customize `path` creation. The `updater` * is invoked with one argument: (value). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.update(object, 'a[0].b.c', function(n) { return n * n; }); * console.log(object.a[0].b.c); * // => 9 * * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); * console.log(object.x[0].y.z); * // => 0 */ function update(object, path, updater) { return object == null ? object : baseUpdate(object, path, castFunction(updater)); } /** * This method is like `_.update` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.updateWith(object, '[0][1]', _.constant('a'), Object); * // => { '0': { '1': 'a' } } */ function updateWith(object, path, updater, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); } /** * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.values(new Foo); * // => [1, 2] (iteration order is not guaranteed) * * _.values('hi'); * // => ['h', 'i'] */ function values(object) { return object == null ? [] : baseValues(object, keys(object)); } /** * Creates an array of the own and inherited enumerable string keyed property * values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.valuesIn(new Foo); * // => [1, 2, 3] (iteration order is not guaranteed) */ function valuesIn(object) { return object == null ? [] : baseValues(object, keysIn(object)); } /*------------------------------------------------------------------------*/ /** * Clamps `number` within the inclusive `lower` and `upper` bounds. * * @static * @memberOf _ * @since 4.0.0 * @category Number * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. * @example * * _.clamp(-10, -5, 5); * // => -5 * * _.clamp(10, -5, 5); * // => 5 */ function clamp(number, lower, upper) { if (upper === undefined) { upper = lower; lower = undefined; } if (upper !== undefined) { upper = toNumber(upper); upper = upper === upper ? upper : 0; } if (lower !== undefined) { lower = toNumber(lower); lower = lower === lower ? lower : 0; } return baseClamp(toNumber(number), lower, upper); } /** * Checks if `n` is between `start` and up to, but not including, `end`. If * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support * negative ranges. * * @static * @memberOf _ * @since 3.3.0 * @category Number * @param {number} number The number to check. * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. * @see _.range, _.rangeRight * @example * * _.inRange(3, 2, 4); * // => true * * _.inRange(4, 8); * // => true * * _.inRange(4, 2); * // => false * * _.inRange(2, 2); * // => false * * _.inRange(1.2, 2); * // => true * * _.inRange(5.2, 4); * // => false * * _.inRange(-3, -2, -6); * // => true */ function inRange(number, start, end) { start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } number = toNumber(number); return baseInRange(number, start, end); } /** * Produces a random number between the inclusive `lower` and `upper` bounds. * If only one argument is provided a number between `0` and the given number * is returned. If `floating` is `true`, or either `lower` or `upper` are * floats, a floating-point number is returned instead of an integer. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @memberOf _ * @since 0.7.0 * @category Number * @param {number} [lower=0] The lower bound. * @param {number} [upper=1] The upper bound. * @param {boolean} [floating] Specify returning a floating-point number. * @returns {number} Returns the random number. * @example * * _.random(0, 5); * // => an integer between 0 and 5 * * _.random(5); * // => also an integer between 0 and 5 * * _.random(5, true); * // => a floating-point number between 0 and 5 * * _.random(1.2, 5.2); * // => a floating-point number between 1.2 and 5.2 */ function random(lower, upper, floating) { if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { upper = floating = undefined; } if (floating === undefined) { if (typeof upper == 'boolean') { floating = upper; upper = undefined; } else if (typeof lower == 'boolean') { floating = lower; lower = undefined; } } if (lower === undefined && upper === undefined) { lower = 0; upper = 1; } else { lower = toFinite(lower); if (upper === undefined) { upper = lower; lower = 0; } else { upper = toFinite(upper); } } if (lower > upper) { var temp = lower; lower = upper; upper = temp; } if (floating || lower % 1 || upper % 1) { var rand = nativeRandom(); return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); } return baseRandom(lower, upper); } /*------------------------------------------------------------------------*/ /** * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the camel cased string. * @example * * _.camelCase('Foo Bar'); * // => 'fooBar' * * _.camelCase('--foo-bar--'); * // => 'fooBar' * * _.camelCase('__FOO_BAR__'); * // => 'fooBar' */ var camelCase = createCompounder(function(result, word, index) { word = word.toLowerCase(); return result + (index ? capitalize(word) : word); }); /** * Converts the first character of `string` to upper case and the remaining * to lower case. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to capitalize. * @returns {string} Returns the capitalized string. * @example * * _.capitalize('FRED'); * // => 'Fred' */ function capitalize(string) { return upperFirst(toString(string).toLowerCase()); } /** * Deburrs `string` by converting * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) * letters to basic Latin letters and removing * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to deburr. * @returns {string} Returns the deburred string. * @example * * _.deburr('déjà vu'); * // => 'deja vu' */ function deburr(string) { string = toString(string); return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); } /** * Checks if `string` ends with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search up to. * @returns {boolean} Returns `true` if `string` ends with `target`, * else `false`. * @example * * _.endsWith('abc', 'c'); * // => true * * _.endsWith('abc', 'b'); * // => false * * _.endsWith('abc', 'b', 2); * // => true */ function endsWith(string, target, position) { string = toString(string); target = baseToString(target); var length = string.length; position = position === undefined ? length : baseClamp(toInteger(position), 0, length); var end = position; position -= target.length; return position >= 0 && string.slice(position, end) == target; } /** * Converts the characters "&", "<", ">", '"', and "'" in `string` to their * corresponding HTML entities. * * **Note:** No other characters are escaped. To escape additional * characters use a third-party library like [_he_](https://mths.be/he). * * Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't need escaping in HTML and have no special meaning * unless they're part of a tag or unquoted attribute value. See * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * When working with HTML you should always * [quote attribute values](http://wonko.com/post/html-escaping) to reduce * XSS vectors. * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escape('fred, barney, & pebbles'); * // => 'fred, barney, & pebbles' */ function escape(string) { string = toString(string); return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } /** * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escapeRegExp('[lodash](https://lodash.com/)'); * // => '\[lodash\]\(https://lodash\.com/\)' */ function escapeRegExp(string) { string = toString(string); return (string && reHasRegExpChar.test(string)) ? string.replace(reRegExpChar, '\\$&') : string; } /** * Converts `string` to * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the kebab cased string. * @example * * _.kebabCase('Foo Bar'); * // => 'foo-bar' * * _.kebabCase('fooBar'); * // => 'foo-bar' * * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ var kebabCase = createCompounder(function(result, word, index) { return result + (index ? '-' : '') + word.toLowerCase(); }); /** * Converts `string`, as space separated words, to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * * _.lowerCase('--Foo-Bar--'); * // => 'foo bar' * * _.lowerCase('fooBar'); * // => 'foo bar' * * _.lowerCase('__FOO_BAR__'); * // => 'foo bar' */ var lowerCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + word.toLowerCase(); }); /** * Converts the first character of `string` to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.lowerFirst('Fred'); * // => 'fred' * * _.lowerFirst('FRED'); * // => 'fRED' */ var lowerFirst = createCaseFirst('toLowerCase'); /** * Pads `string` on the left and right sides if it's shorter than `length`. * Padding characters are truncated if they can't be evenly divided by `length`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.pad('abc', 8); * // => ' abc ' * * _.pad('abc', 8, '_-'); * // => '_-abc_-_' * * _.pad('abc', 3); * // => 'abc' */ function pad(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; if (!length || strLength >= length) { return string; } var mid = (length - strLength) / 2; return ( createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars) ); } /** * Pads `string` on the right side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padEnd('abc', 6); * // => 'abc ' * * _.padEnd('abc', 6, '_-'); * // => 'abc_-_' * * _.padEnd('abc', 3); * // => 'abc' */ function padEnd(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (string + createPadding(length - strLength, chars)) : string; } /** * Pads `string` on the left side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padStart('abc', 6); * // => ' abc' * * _.padStart('abc', 6, '_-'); * // => '_-_abc' * * _.padStart('abc', 3); * // => 'abc' */ function padStart(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (createPadding(length - strLength, chars) + string) : string; } /** * Converts `string` to an integer of the specified radix. If `radix` is * `undefined` or `0`, a `radix` of `10` is used unless `value` is a * hexadecimal, in which case a `radix` of `16` is used. * * **Note:** This method aligns with the * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. * * @static * @memberOf _ * @since 1.1.0 * @category String * @param {string} string The string to convert. * @param {number} [radix=10] The radix to interpret `value` by. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {number} Returns the converted integer. * @example * * _.parseInt('08'); * // => 8 * * _.map(['6', '08', '10'], _.parseInt); * // => [6, 8, 10] */ function parseInt(string, radix, guard) { if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); } /** * Repeats the given string `n` times. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to repeat. * @param {number} [n=1] The number of times to repeat the string. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the repeated string. * @example * * _.repeat('*', 3); * // => '***' * * _.repeat('abc', 2); * // => 'abcabc' * * _.repeat('abc', 0); * // => '' */ function repeat(string, n, guard) { if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } return baseRepeat(toString(string), n); } /** * Replaces matches for `pattern` in `string` with `replacement`. * * **Note:** This method is based on * [`String#replace`](https://mdn.io/String/replace). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to modify. * @param {RegExp|string} pattern The pattern to replace. * @param {Function|string} replacement The match replacement. * @returns {string} Returns the modified string. * @example * * _.replace('Hi Fred', 'Fred', 'Barney'); * // => 'Hi Barney' */ function replace() { var args = arguments, string = toString(args[0]); return args.length < 3 ? string : string.replace(args[1], args[2]); } /** * Converts `string` to * [snake case](https://en.wikipedia.org/wiki/Snake_case). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the snake cased string. * @example * * _.snakeCase('Foo Bar'); * // => 'foo_bar' * * _.snakeCase('fooBar'); * // => 'foo_bar' * * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' */ var snakeCase = createCompounder(function(result, word, index) { return result + (index ? '_' : '') + word.toLowerCase(); }); /** * Splits `string` by `separator`. * * **Note:** This method is based on * [`String#split`](https://mdn.io/String/split). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to split. * @param {RegExp|string} separator The separator pattern to split by. * @param {number} [limit] The length to truncate results to. * @returns {Array} Returns the string segments. * @example * * _.split('a-b-c', '-', 2); * // => ['a', 'b'] */ function split(string, separator, limit) { if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { separator = limit = undefined; } limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; if (!limit) { return []; } string = toString(string); if (string && ( typeof separator == 'string' || (separator != null && !isRegExp(separator)) )) { separator = baseToString(separator); if (!separator && hasUnicode(string)) { return castSlice(stringToArray(string), 0, limit); } } return string.split(separator, limit); } /** * Converts `string` to * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * * @static * @memberOf _ * @since 3.1.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the start cased string. * @example * * _.startCase('--foo-bar--'); * // => 'Foo Bar' * * _.startCase('fooBar'); * // => 'Foo Bar' * * _.startCase('__FOO_BAR__'); * // => 'FOO BAR' */ var startCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + upperFirst(word); }); /** * Checks if `string` starts with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. * @returns {boolean} Returns `true` if `string` starts with `target`, * else `false`. * @example * * _.startsWith('abc', 'a'); * // => true * * _.startsWith('abc', 'b'); * // => false * * _.startsWith('abc', 'b', 1); * // => true */ function startsWith(string, target, position) { string = toString(string); position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); target = baseToString(target); return string.slice(position, position + target.length) == target; } /** * Creates a compiled template function that can interpolate data properties * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting * object is given, it takes precedence over `_.templateSettings` values. * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) * for easier debugging. * * For more information on precompiling templates see * [lodash's custom builds documentation](https://lodash.com/custom-builds). * * For more information on Chrome extension sandboxes see * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The template string. * @param {Object} [options={}] The options object. * @param {RegExp} [options.escape=_.templateSettings.escape] * The HTML "escape" delimiter. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] * The "evaluate" delimiter. * @param {Object} [options.imports=_.templateSettings.imports] * An object to import into the template as free variables. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] * The "interpolate" delimiter. * @param {string} [options.sourceURL='lodash.templateSources[n]'] * The sourceURL of the compiled template. * @param {string} [options.variable='obj'] * The data object variable name. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the compiled template function. * @example * * // Use the "interpolate" delimiter to create a compiled template. * var compiled = _.template('hello <%= user %>!'); * compiled({ 'user': 'fred' }); * // => 'hello fred!' * * // Use the HTML "escape" delimiter to escape data property values. * var compiled = _.template('<%- value %>'); * compiled({ 'value': '