ol-contextmenu
Advanced tools
Comparing version 4.0.1 to 4.1.0
/*! | ||
* ol-contextmenu - v4.0.1 | ||
* ol-contextmenu - v4.1.0 | ||
* https://github.com/jonataswalker/ol-contextmenu | ||
* Built: Mon Apr 27 2020 07:41:51 GMT-0300 (Brasilia Standard Time) | ||
* Built: Sat Aug 15 2020 10:43:26 GMT-0300 (Brasilia Standard Time) | ||
*/ | ||
@@ -11,7 +11,9 @@ | ||
typeof define === 'function' && define.amd ? define(['ol/control/Control'], factory) : | ||
(global = global || self, global.ContextMenu = factory(global.ol.control.Control)); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ContextMenu = factory(global.ol.control.Control)); | ||
}(this, (function (Control) { 'use strict'; | ||
Control = Control && Object.prototype.hasOwnProperty.call(Control, 'default') ? Control['default'] : Control; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var Control__default = /*#__PURE__*/_interopDefaultLegacy(Control); | ||
var namespace = 'ol-ctx-menu'; | ||
@@ -344,2 +346,6 @@ | ||
this.eventHandler = this.handleEvent.bind(this); | ||
/** | ||
* @type {Function} | ||
*/ | ||
this.eventMapMoveHandler = this.handleMapMoveEvent.bind(this); | ||
return this; | ||
@@ -464,2 +470,4 @@ }; | ||
); | ||
this.map.on('movestart', this.eventMapMoveHandler); | ||
}; | ||
@@ -473,2 +481,4 @@ | ||
); | ||
this.map.un('movestart', this.eventMapMoveHandler); | ||
}; | ||
@@ -503,3 +513,3 @@ | ||
handleEvent: function (e) { | ||
if (this.opened) { | ||
if (this_.opened) { | ||
this_.closeMenu(); | ||
@@ -515,2 +525,6 @@ e.stopPropagation(); | ||
Internal.prototype.handleMapMoveEvent = function handleMapMoveEvent (evt) { | ||
this.closeMenu(); | ||
}; | ||
Internal.prototype.setItemListener = function setItemListener (li, index) { | ||
@@ -809,3 +823,3 @@ var this_ = this; | ||
return Base; | ||
}(Control)); | ||
}(Control__default['default'])); | ||
@@ -812,0 +826,0 @@ return Base; |
/*! | ||
* ol-contextmenu - v4.0.1 | ||
* ol-contextmenu - v4.1.0 | ||
* https://github.com/jonataswalker/ol-contextmenu | ||
* Built: Mon Apr 27 2020 07:41:51 GMT-0300 (Brasilia Standard Time) | ||
* Built: Sat Aug 15 2020 10:43:26 GMT-0300 (Brasilia Standard Time) | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("ol/control/Control")):"function"==typeof define&&define.amd?define(["ol/control/Control"],e):(t=t||self).ContextMenu=e(t.ol.control.Control)}(this,(function(t){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var e="ol-ctx-menu",n={namespace:e,container:e+"-container",separator:e+"-separator",submenu:e+"-submenu",hidden:e+"-hidden",icon:e+"-icon",zoomIn:e+"-zoom-in",zoomOut:e+"-zoom-out",unselectable:"ol-unselectable"},i=n,o="beforeopen",s="open",r="close",a="contextmenu",l={width:150,scrollAt:4,eventType:a,defaultItems:!0},c=[{text:"Zoom In",classname:n.zoomIn+" "+n.icon,callback:function(t,e){var n=e.getView();n.animate({zoom:+n.getZoom()+1,duration:700,center:t.coordinate})}},{text:"Zoom Out",classname:n.zoomOut+" "+n.icon,callback:function(t,e){var n=e.getView();n.animate({zoom:+n.getZoom()-1,duration:700,center:t.coordinate})}}];function h(t,e){if(void 0===e&&(e="Assertion failed"),!t){if("undefined"!=typeof Error)throw new Error(e);throw e}}function p(t){return/^\d+$/.test(t)}function u(t,e){return t.classList?t.classList.contains(e):y(e).test(t.className)}function d(t,e,n){void 0===e&&(e=window.document);var i=Array.prototype.slice,o=[];if(/^(#?[\w-]+|\.[\w-.]+)$/.test(t))switch(t[0]){case"#":o=[m(t.substr(1))];break;case".":o=i.call(e.getElementsByClassName(t.substr(1).replace(/\./g," ")));break;default:o=i.call(e.getElementsByTagName(t))}else o=i.call(e.querySelectorAll(t));return n?o:o[0]}function m(t){return t="#"===t[0]?t.substr(1,t.length):t,document.getElementById(t)}function f(t){var e=document.createDocumentFragment(),n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild);return e}function y(t){return new RegExp("(^|\\s+) "+t+" (\\s+|$)")}function v(t,e,n){t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim(),n&&p(n)&&window.setTimeout((function(){return g(t,e)}),n)}function g(t,e,n){t.classList?t.classList.remove(e):t.className=t.className.replace(y(e)," ").trim(),n&&p(n)&&window.setTimeout((function(){return v(t,e)}),n)}var b=function(t){return this.Base=t,this.map=void 0,this.viewport=void 0,this.coordinateClicked=void 0,this.pixelClicked=void 0,this.lineHeight=0,this.items={},this.opened=!1,this.submenu={left:t.options.width-15+"px",lastLeft:""},this.eventHandler=this.handleEvent.bind(this),this};b.prototype.init=function(t){this.map=t,this.viewport=t.getViewport(),this.setListeners(),this.Base.Html.createMenu(),this.lineHeight=this.getItemsLength()>0?this.Base.container.offsetHeight/this.getItemsLength():this.Base.Html.cloneAndGetLineHeight()},b.prototype.getItemsLength=function(){var t=this,e=0;return Object.keys(this.items).forEach((function(n){t.items[n].submenu||t.items[n].separator||e++})),e},b.prototype.getPixelClicked=function(){return this.pixelClicked},b.prototype.getCoordinateClicked=function(){return this.coordinateClicked},b.prototype.positionContainer=function(t){var e=this,n=this.Base.container,o=this.map.getSize(),s=o[1]-t[1],r=o[0]-t[0],a=n.offsetWidth,l=Math.round(this.lineHeight*this.getItemsLength()),c=d("li."+i.submenu+">div",n,!0);r>=a?(n.style.right="auto",n.style.left=t[0]+5+"px"):(n.style.left="auto",n.style.right="15px"),s>=l?(n.style.bottom="auto",n.style.top=t[1]-10+"px"):(n.style.top="auto",n.style.bottom=0),function t(e,n,i){if(Array.isArray(e))e.forEach((function(e){return t(e,n,i)}));else for(var o=Array.isArray(n)?n:n.split(/\s+/),s=o.length;s--;)u(e,o[s])&&g(e,o[s],i)}(n,i.hidden),c.length&&(this.submenu.lastLeft=r<2*a?"-"+a+"px":this.submenu.left,c.forEach((function(t){var n,i,o,r={w:window.innerWidth||document.documentElement.clientWidth,h:window.innerHeight||document.documentElement.clientHeight},a=(i=(n=t).getBoundingClientRect(),o=document.documentElement,{left:i.left+window.pageXOffset-o.clientLeft,top:i.top+window.pageYOffset-o.clientTop,width:n.offsetWidth,height:n.offsetHeight}),l=a.height,c=s-l;c<0&&(c=l-(r.h-a.top),t.style.top="-"+c+"px"),t.style.left=e.submenu.lastLeft})))},b.prototype.openMenu=function(t,e){this.Base.dispatchEvent({type:s,pixel:t,coordinate:e}),this.opened=!0,this.positionContainer(t)},b.prototype.closeMenu=function(){this.opened=!1,function t(e,n,i){if(Array.isArray(e))e.forEach((function(e){return t(e,n)}));else for(var o=Array.isArray(n)?n:n.split(/\s+/),s=o.length;s--;)u(e,o[s])||v(e,o[s],i)}(this.Base.container,i.hidden),this.Base.dispatchEvent({type:r})},b.prototype.setListeners=function(){this.viewport.addEventListener(this.Base.options.eventType,this.eventHandler,!1)},b.prototype.removeListeners=function(){this.viewport.removeEventListener(this.Base.options.eventType,this.eventHandler,!1)},b.prototype.handleEvent=function(t){var e=this;this.coordinateClicked=this.map.getEventCoordinate(t),this.pixelClicked=this.map.getEventPixel(t),this.Base.dispatchEvent({type:o,pixel:this.pixelClicked,coordinate:this.coordinateClicked}),this.Base.disabled||(this.Base.options.eventType===a&&(t.stopPropagation(),t.preventDefault()),this.openMenu(this.pixelClicked,this.coordinateClicked),t.target.addEventListener("pointerdown",{handleEvent:function(n){this.opened&&(e.closeMenu(),n.stopPropagation(),t.target.removeEventListener(n.type,this,!1))}},!1))},b.prototype.setItemListener=function(t,e){var n,i=this;t&&"function"==typeof this.items[e].callback&&(n=this.items[e].callback,t.addEventListener("click",(function(t){t.preventDefault();var o={coordinate:i.getCoordinateClicked(),data:i.items[e].data||null};i.closeMenu(),n(o,i.map)}),!1))};var C=function(t){return this.Base=t,this.Base.container=this.container=this.createContainer(!0),this};return C.prototype.createContainer=function(t){var e=document.createElement("div"),n=document.createElement("ul"),o=[i.container,i.unselectable];return t&&o.push(i.hidden),e.className=o.join(" "),e.style.width=parseInt(this.Base.options.width,10)+"px",e.appendChild(n),e},C.prototype.createMenu=function(){var t=[];if("items"in this.Base.options?t=this.Base.options.defaultItems?this.Base.options.items.concat(c):this.Base.options.items:this.Base.options.defaultItems&&(t=c),0===t.length)return!1;t.forEach(this.addMenuEntry,this)},C.prototype.addMenuEntry=function(t){var e,n=this;if(t.items&&Array.isArray(t.items)){t.classname=t.classname||"",e=i.submenu,~t.classname.indexOf(e)||(t.classname=t.classname.length?" "+i.submenu:i.submenu);var o=this.generateHtmlAndPublish(this.container,t),s=this.createContainer();s.style.left=this.Base.Internal.submenu.lastLeft||this.Base.Internal.submenu.left,o.appendChild(s),t.items.forEach((function(t){n.generateHtmlAndPublish(s,t,!0)}))}else this.generateHtmlAndPublish(this.container,t)},C.prototype.generateHtmlAndPublish=function(t,e,n){var o,s,r="_"+Math.random().toString(36).substr(2,9),a=!1;return"string"==typeof e&&"-"===e.trim()?(o=f('<li id="'+r+'" class="'+i.separator+'"><hr></li>'),s=[].slice.call(o.childNodes,0)[0],t.firstChild.appendChild(o),a=!0):(e.classname=e.classname||"",o=f("<span>"+e.text+"</span>"),s=document.createElement("li"),e.icon&&(""===e.classname?e.classname=i.icon:-1===e.classname.indexOf(i.icon)&&(e.classname+=" "+i.icon),s.setAttribute("style","background-image:url("+e.icon+")")),s.id=r,s.className=e.classname,s.appendChild(o),t.firstChild.appendChild(s)),this.Base.Internal.items[r]={id:r,submenu:n||0,separator:a,callback:e.callback,data:e.data||null},this.Base.Internal.setItemListener(s,r),s},C.prototype.removeMenuEntry=function(t){var e=d("#"+t,this.container.firstChild);e&&this.container.firstChild.removeChild(e),delete this.Base.Internal.items[t]},C.prototype.cloneAndGetLineHeight=function(){var t=this.container.cloneNode(),e=f("<span>Foo</span>"),n=f("<span>Foo</span>"),i=document.createElement("li"),o=document.createElement("li");i.appendChild(e),o.appendChild(n),t.appendChild(i),t.appendChild(o),this.container.parentNode.appendChild(t);var s=t.offsetHeight/2;return this.container.parentNode.removeChild(t),s},function(t){function e(e){void 0===e&&(e={}),h("object"==typeof e,"@param `opt_options` should be object type!"),this.options=function(t,e){var n={};for(var i in t)n[i]=t[i];for(var o in e)n[o]=e[o];return n}(l,e),this.disabled=!1,this.Internal=new b(this),this.Html=new C(this),t.call(this,{element:this.container})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clear=function(){Object.keys(this.Internal.items).forEach(this.Html.removeMenuEntry,this.Html)},e.prototype.close=function(){this.Internal.closeMenu()},e.prototype.enable=function(){this.disabled=!1},e.prototype.disable=function(){this.disabled=!0},e.prototype.getDefaultItems=function(){return c},e.prototype.countItems=function(){return Object.keys(this.Internal.items).length},e.prototype.extend=function(t){h(Array.isArray(t),"@param `arr` should be an Array."),t.forEach(this.push,this)},e.prototype.isOpen=function(){return this.Internal.opened},e.prototype.updatePosition=function(t){h(Array.isArray(t),"@param `pixel` should be an Array."),this.isOpen()&&this.Internal.positionContainer(t)},e.prototype.pop=function(){var t=Object.keys(this.Internal.items);this.Html.removeMenuEntry(t[t.length-1])},e.prototype.push=function(t){h(null!=t,"@param `item` must be informed."),this.Html.addMenuEntry(t)},e.prototype.shift=function(){this.Html.removeMenuEntry(Object.keys(this.Internal.items)[0])},e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e?this.Internal.init(e,this):this.Internal.removeListeners()},e}(t)})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("ol/control/Control")):"function"==typeof define&&define.amd?define(["ol/control/Control"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).ContextMenu=e(t.ol.control.Control)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),i="ol-ctx-menu",o={namespace:i,container:i+"-container",separator:i+"-separator",submenu:i+"-submenu",hidden:i+"-hidden",icon:i+"-icon",zoomIn:i+"-zoom-in",zoomOut:i+"-zoom-out",unselectable:"ol-unselectable"},s=o,a="beforeopen",r="open",l="close",c="contextmenu",h={width:150,scrollAt:4,eventType:c,defaultItems:!0},p=[{text:"Zoom In",classname:o.zoomIn+" "+o.icon,callback:function(t,e){var n=e.getView();n.animate({zoom:+n.getZoom()+1,duration:700,center:t.coordinate})}},{text:"Zoom Out",classname:o.zoomOut+" "+o.icon,callback:function(t,e){var n=e.getView();n.animate({zoom:+n.getZoom()-1,duration:700,center:t.coordinate})}}];function u(t,e){if(void 0===e&&(e="Assertion failed"),!t){if("undefined"!=typeof Error)throw new Error(e);throw e}}function d(t){return/^\d+$/.test(t)}function m(t,e){return t.classList?t.classList.contains(e):g(e).test(t.className)}function f(t,e,n){void 0===e&&(e=window.document);var i=Array.prototype.slice,o=[];if(/^(#?[\w-]+|\.[\w-.]+)$/.test(t))switch(t[0]){case"#":o=[y(t.substr(1))];break;case".":o=i.call(e.getElementsByClassName(t.substr(1).replace(/\./g," ")));break;default:o=i.call(e.getElementsByTagName(t))}else o=i.call(e.querySelectorAll(t));return n?o:o[0]}function y(t){return t="#"===t[0]?t.substr(1,t.length):t,document.getElementById(t)}function v(t){var e=document.createDocumentFragment(),n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild);return e}function g(t){return new RegExp("(^|\\s+) "+t+" (\\s+|$)")}function b(t,e,n){t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim(),n&&d(n)&&window.setTimeout((function(){return C(t,e)}),n)}function C(t,e,n){t.classList?t.classList.remove(e):t.className=t.className.replace(g(e)," ").trim(),n&&d(n)&&window.setTimeout((function(){return b(t,e)}),n)}var E=function(t){return this.Base=t,this.map=void 0,this.viewport=void 0,this.coordinateClicked=void 0,this.pixelClicked=void 0,this.lineHeight=0,this.items={},this.opened=!1,this.submenu={left:t.options.width-15+"px",lastLeft:""},this.eventHandler=this.handleEvent.bind(this),this.eventMapMoveHandler=this.handleMapMoveEvent.bind(this),this};E.prototype.init=function(t){this.map=t,this.viewport=t.getViewport(),this.setListeners(),this.Base.Html.createMenu(),this.lineHeight=this.getItemsLength()>0?this.Base.container.offsetHeight/this.getItemsLength():this.Base.Html.cloneAndGetLineHeight()},E.prototype.getItemsLength=function(){var t=this,e=0;return Object.keys(this.items).forEach((function(n){t.items[n].submenu||t.items[n].separator||e++})),e},E.prototype.getPixelClicked=function(){return this.pixelClicked},E.prototype.getCoordinateClicked=function(){return this.coordinateClicked},E.prototype.positionContainer=function(t){var e=this,n=this.Base.container,i=this.map.getSize(),o=i[1]-t[1],a=i[0]-t[0],r=n.offsetWidth,l=Math.round(this.lineHeight*this.getItemsLength()),c=f("li."+s.submenu+">div",n,!0);a>=r?(n.style.right="auto",n.style.left=t[0]+5+"px"):(n.style.left="auto",n.style.right="15px"),o>=l?(n.style.bottom="auto",n.style.top=t[1]-10+"px"):(n.style.top="auto",n.style.bottom=0),function t(e,n,i){if(Array.isArray(e))e.forEach((function(e){return t(e,n,i)}));else for(var o=Array.isArray(n)?n:n.split(/\s+/),s=o.length;s--;)m(e,o[s])&&C(e,o[s],i)}(n,s.hidden),c.length&&(this.submenu.lastLeft=a<2*r?"-"+r+"px":this.submenu.left,c.forEach((function(t){var n,i,s,a={w:window.innerWidth||document.documentElement.clientWidth,h:window.innerHeight||document.documentElement.clientHeight},r=(i=(n=t).getBoundingClientRect(),s=document.documentElement,{left:i.left+window.pageXOffset-s.clientLeft,top:i.top+window.pageYOffset-s.clientTop,width:n.offsetWidth,height:n.offsetHeight}),l=r.height,c=o-l;c<0&&(c=l-(a.h-r.top),t.style.top="-"+c+"px"),t.style.left=e.submenu.lastLeft})))},E.prototype.openMenu=function(t,e){this.Base.dispatchEvent({type:r,pixel:t,coordinate:e}),this.opened=!0,this.positionContainer(t)},E.prototype.closeMenu=function(){this.opened=!1,function t(e,n,i){if(Array.isArray(e))e.forEach((function(e){return t(e,n)}));else for(var o=Array.isArray(n)?n:n.split(/\s+/),s=o.length;s--;)m(e,o[s])||b(e,o[s],i)}(this.Base.container,s.hidden),this.Base.dispatchEvent({type:l})},E.prototype.setListeners=function(){this.viewport.addEventListener(this.Base.options.eventType,this.eventHandler,!1),this.map.on("movestart",this.eventMapMoveHandler)},E.prototype.removeListeners=function(){this.viewport.removeEventListener(this.Base.options.eventType,this.eventHandler,!1),this.map.un("movestart",this.eventMapMoveHandler)},E.prototype.handleEvent=function(t){var e=this;this.coordinateClicked=this.map.getEventCoordinate(t),this.pixelClicked=this.map.getEventPixel(t),this.Base.dispatchEvent({type:a,pixel:this.pixelClicked,coordinate:this.coordinateClicked}),this.Base.disabled||(this.Base.options.eventType===c&&(t.stopPropagation(),t.preventDefault()),this.openMenu(this.pixelClicked,this.coordinateClicked),t.target.addEventListener("pointerdown",{handleEvent:function(n){e.opened&&(e.closeMenu(),n.stopPropagation(),t.target.removeEventListener(n.type,this,!1))}},!1))},E.prototype.handleMapMoveEvent=function(t){this.closeMenu()},E.prototype.setItemListener=function(t,e){var n,i=this;t&&"function"==typeof this.items[e].callback&&(n=this.items[e].callback,t.addEventListener("click",(function(t){t.preventDefault();var o={coordinate:i.getCoordinateClicked(),data:i.items[e].data||null};i.closeMenu(),n(o,i.map)}),!1))};var w=function(t){return this.Base=t,this.Base.container=this.container=this.createContainer(!0),this};return w.prototype.createContainer=function(t){var e=document.createElement("div"),n=document.createElement("ul"),i=[s.container,s.unselectable];return t&&i.push(s.hidden),e.className=i.join(" "),e.style.width=parseInt(this.Base.options.width,10)+"px",e.appendChild(n),e},w.prototype.createMenu=function(){var t=[];if("items"in this.Base.options?t=this.Base.options.defaultItems?this.Base.options.items.concat(p):this.Base.options.items:this.Base.options.defaultItems&&(t=p),0===t.length)return!1;t.forEach(this.addMenuEntry,this)},w.prototype.addMenuEntry=function(t){var e,n=this;if(t.items&&Array.isArray(t.items)){t.classname=t.classname||"",e=s.submenu,~t.classname.indexOf(e)||(t.classname=t.classname.length?" "+s.submenu:s.submenu);var i=this.generateHtmlAndPublish(this.container,t),o=this.createContainer();o.style.left=this.Base.Internal.submenu.lastLeft||this.Base.Internal.submenu.left,i.appendChild(o),t.items.forEach((function(t){n.generateHtmlAndPublish(o,t,!0)}))}else this.generateHtmlAndPublish(this.container,t)},w.prototype.generateHtmlAndPublish=function(t,e,n){var i,o,a="_"+Math.random().toString(36).substr(2,9),r=!1;return"string"==typeof e&&"-"===e.trim()?(i=v('<li id="'+a+'" class="'+s.separator+'"><hr></li>'),o=[].slice.call(i.childNodes,0)[0],t.firstChild.appendChild(i),r=!0):(e.classname=e.classname||"",i=v("<span>"+e.text+"</span>"),o=document.createElement("li"),e.icon&&(""===e.classname?e.classname=s.icon:-1===e.classname.indexOf(s.icon)&&(e.classname+=" "+s.icon),o.setAttribute("style","background-image:url("+e.icon+")")),o.id=a,o.className=e.classname,o.appendChild(i),t.firstChild.appendChild(o)),this.Base.Internal.items[a]={id:a,submenu:n||0,separator:r,callback:e.callback,data:e.data||null},this.Base.Internal.setItemListener(o,a),o},w.prototype.removeMenuEntry=function(t){var e=f("#"+t,this.container.firstChild);e&&this.container.firstChild.removeChild(e),delete this.Base.Internal.items[t]},w.prototype.cloneAndGetLineHeight=function(){var t=this.container.cloneNode(),e=v("<span>Foo</span>"),n=v("<span>Foo</span>"),i=document.createElement("li"),o=document.createElement("li");i.appendChild(e),o.appendChild(n),t.appendChild(i),t.appendChild(o),this.container.parentNode.appendChild(t);var s=t.offsetHeight/2;return this.container.parentNode.removeChild(t),s},function(t){function e(e){void 0===e&&(e={}),u("object"==typeof e,"@param `opt_options` should be object type!"),this.options=function(t,e){var n={};for(var i in t)n[i]=t[i];for(var o in e)n[o]=e[o];return n}(h,e),this.disabled=!1,this.Internal=new E(this),this.Html=new w(this),t.call(this,{element:this.container})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clear=function(){Object.keys(this.Internal.items).forEach(this.Html.removeMenuEntry,this.Html)},e.prototype.close=function(){this.Internal.closeMenu()},e.prototype.enable=function(){this.disabled=!1},e.prototype.disable=function(){this.disabled=!0},e.prototype.getDefaultItems=function(){return p},e.prototype.countItems=function(){return Object.keys(this.Internal.items).length},e.prototype.extend=function(t){u(Array.isArray(t),"@param `arr` should be an Array."),t.forEach(this.push,this)},e.prototype.isOpen=function(){return this.Internal.opened},e.prototype.updatePosition=function(t){u(Array.isArray(t),"@param `pixel` should be an Array."),this.isOpen()&&this.Internal.positionContainer(t)},e.prototype.pop=function(){var t=Object.keys(this.Internal.items);this.Html.removeMenuEntry(t[t.length-1])},e.prototype.push=function(t){u(null!=t,"@param `item` must be informed."),this.Html.addMenuEntry(t)},e.prototype.shift=function(){this.Html.removeMenuEntry(Object.keys(this.Internal.items)[0])},e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e?this.Internal.init(e,this):this.Internal.removeListeners()},e}(n.default)})); |
{ | ||
"name": "ol-contextmenu", | ||
"version": "4.0.1", | ||
"version": "4.1.0", | ||
"description": "Custom Context Menu for Openlayers", | ||
@@ -30,27 +30,27 @@ "main": "dist/ol-contextmenu.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.9.0", | ||
"@babel/preset-env": "^7.9.5", | ||
"autoprefixer": "^9.7.6", | ||
"babel-jest": "^25.4.0", | ||
"@babel/core": "^7.11.1", | ||
"@babel/preset-env": "^7.11.0", | ||
"autoprefixer": "^9.8.6", | ||
"babel-jest": "^26.3.0", | ||
"canvas": "^2.6.1", | ||
"eslint": "^6.6.0", | ||
"eslint": "^7.7.0", | ||
"eslint-config-jwalker": "^5.2.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-jest": "^23.8.2", | ||
"eslint-plugin-jest": "^23.20.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"jest": "^25.4.0", | ||
"ol": "^6.3.1", | ||
"jest": "^26.4.0", | ||
"ol": "^6.4.3", | ||
"postcss": "^7.0.27", | ||
"prettier": "^2.0.5", | ||
"rollup": "^2.7.2", | ||
"rollup": "^2.26.0", | ||
"rollup-plugin-buble": "^0.19.8", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-eslint": "^7.0.0", | ||
"rollup-plugin-filesize": "^7.0.0", | ||
"rollup-plugin-filesize": "^9.0.2", | ||
"rollup-plugin-includepaths": "^0.2.3", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-sass": "^1.2.2", | ||
"rollup-plugin-terser": "^5.3.0", | ||
"rollup-plugin-terser": "^7.0.0", | ||
"should": "^13.2.3" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
50975
872