1&&void 0!==arguments[1]&&arguments[1],n=V.indexOf(e),o=V.slice(n+1).concat(V.slice(0,n));return t?o.reverse():o}var G={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Y(e,t,n,o){var i=[0,0],r=-1!==["right","left"].indexOf(o),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(I(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var p=/\s*,\s*|\s+/,l=-1!==a?[s.slice(0,a).concat([s[a].split(p)[0]]),[s[a].split(p)[1]].concat(s.slice(a+1))]:[s];return(l=l.map(function(e,o){var i=(1===o?!r:r)?"height":"width",s=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return function(e,t,n,o){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+i[1],s=i[2];if(!r)return e;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=o}return C(a)[t]/100*r}if("vh"===s||"vw"===s)return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*r;return r}(e,i,t,n)})})).forEach(function(e,t){e.forEach(function(n,o){B(n)&&(i[t]+=n*("-"===e[o-1]?-1:1))})}),i}var K={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],o=t.split("-")[1];if(o){var i=e.offsets,r=i.reference,s=i.popper,a=-1!==["bottom","top"].indexOf(n),p=a?"left":"top",l=a?"width":"height",u={start:O({},p,r[p]),end:O({},p,r[p]+r[l]-s[l])};e.offsets.popper=E({},s,u[o])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,o=e.placement,i=e.offsets,r=i.popper,s=i.reference,a=o.split("-")[0],p=void 0;return p=B(+n)?[+n,0]:Y(n,r,s,a),"left"===a?(r.top+=p[0],r.left-=p[1]):"right"===a?(r.top+=p[0],r.left+=p[1]):"top"===a?(r.left+=p[0],r.top-=p[1]):"bottom"===a&&(r.left+=p[0],r.top+=p[1]),e.popper=r,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||d(e.instance.popper);e.instance.reference===n&&(n=d(n));var o=M("transform"),i=e.instance.popper.style,r=i.top,s=i.left,a=i[o];i.top="",i.left="",i[o]="";var p=x(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=r,i.left=s,i[o]=a,t.boundaries=p;var l=t.priority,u=e.offsets.popper,f={primary:function(e){var n=u[e];return u[e]p[e]&&!t.escapeWithReference&&(o=Math.min(u[n],p[e]-("right"===e?u.width:u.height))),O({},n,o)}};return l.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=E({},u,f[t](e))}),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,o=t.reference,i=e.placement.split("-")[0],r=Math.floor,s=-1!==["top","bottom"].indexOf(i),a=s?"right":"bottom",p=s?"left":"top",l=s?"width":"height";return n[a]r(o[a])&&(e.offsets.popper[p]=r(o[a])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!R(e.instance.modifiers,"arrow","keepTogether"))return e;var o=t.element;if("string"==typeof o){if(!(o=e.instance.popper.querySelector(o)))return e}else if(!e.instance.popper.contains(o))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],r=e.offsets,s=r.popper,p=r.reference,l=-1!==["left","right"].indexOf(i),u=l?"height":"width",f=l?"Top":"Left",c=f.toLowerCase(),d=l?"left":"top",h=l?"bottom":"right",v=j(o)[u];p[h]-vs[h]&&(e.offsets.popper[c]+=p[c]+v-s[h]),e.offsets.popper=C(e.offsets.popper);var m=p[c]+p[u]/2-v/2,g=a(e.instance.popper),b=parseFloat(g["margin"+f],10),y=parseFloat(g["border"+f+"Width"],10),_=m-e.offsets.popper[c]-b-y;return _=Math.max(Math.min(s[u]-v,_),0),e.arrowElement=o,e.offsets.arrow=(O(n={},c,Math.round(_)),O(n,d,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(D(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=x(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),o=e.placement.split("-")[0],i=k(o),r=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case G.FLIP:s=[o,i];break;case G.CLOCKWISE:s=q(o);break;case G.COUNTERCLOCKWISE:s=q(o,!0);break;default:s=t.behavior}return s.forEach(function(a,p){if(o!==a||s.length===p+1)return e;o=e.placement.split("-")[0],i=k(o);var l=e.offsets.popper,u=e.offsets.reference,f=Math.floor,c="left"===o&&f(l.right)>f(u.left)||"right"===o&&f(l.left)f(u.top)||"bottom"===o&&f(l.top)f(n.right),v=f(l.top)f(n.bottom),g="left"===o&&d||"right"===o&&h||"top"===o&&v||"bottom"===o&&m,b=-1!==["top","bottom"].indexOf(o),y=!!t.flipVariations&&(b&&"start"===r&&d||b&&"end"===r&&h||!b&&"start"===r&&v||!b&&"end"===r&&m);(c||g||y)&&(e.flipped=!0,(c||g)&&(o=s[p+1]),y&&(r=function(e){return"end"===e?"start":"start"===e?"end":e}(r)),e.placement=o+(r?"-"+r:""),e.offsets.popper=E({},e.offsets.popper,A(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,"flip"))}),e},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],o=e.offsets,i=o.popper,r=o.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return i[s?"left":"top"]=r[n]-(a?i[s?"width":"height"]:0),e.placement=k(t),e.offsets.popper=C(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!R(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=I(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};_(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(o.update)},this.update=r(this.update.bind(this)),this.options=E({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(E({},e.Defaults.modifiers,i.modifiers)).forEach(function(t){o.options.modifiers[t]=E({},e.Defaults.modifiers[t]||{},i.modifiers?i.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return E({name:e},o.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&s(e.onLoad)&&e.onLoad(o.reference,o.popper,o.options,e,o.state)}),this.update();var a=this.options.eventsEnabled;a&&this.enableEventListeners(),this.state.eventsEnabled=a}return w(e,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=S(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=N(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=A(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=P(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,D(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[M("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=z(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return F.call(this)}}]),e}();X.Utils=("undefined"!=typeof window?window:global).PopperUtils,X.placements=U,X.Defaults=K;var J=function(){};function Q(e){return"string"==typeof e&&(e=e.split(" ")),e}function Z(e,t){var n=Q(t),o=void 0;o=e.className instanceof J?Q(e.className.baseVal):Q(e.className),n.forEach(function(e){-1===o.indexOf(e)&&o.push(e)}),e instanceof SVGElement?e.setAttribute("class",o.join(" ")):e.className=o.join(" ")}function ee(e,t){var n=Q(t),o=void 0;o=e.className instanceof J?Q(e.className.baseVal):Q(e.className),n.forEach(function(e){var t=o.indexOf(e);-1!==t&&o.splice(t,1)}),e instanceof SVGElement?e.setAttribute("class",o.join(" ")):e.className=o.join(" ")}"undefined"!=typeof window&&(J=window.SVGAnimatedString);var te=!1;if("undefined"!=typeof window){te=!1;try{var ne=Object.defineProperty({},"passive",{get:function(){te=!0}});window.addEventListener("test",null,ne)}catch(e){}}var oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},re=function(){function e(e,t){for(var n=0;n',trigger:"hover focus",offset:0},pe=[],le=function(){function e(t,n){ie(this,e),ue.call(this),n=se({},ae,n),t.jquery&&(t=t[0]),this.reference=t,this.options=n,this._isOpen=!1,this._init()}return re(e,[{key:"setClasses",value:function(e){this._classes=e}},{key:"setContent",value:function(e){this.options.title=e,this._tooltipNode&&this._setContent(e,this.options)}},{key:"setOptions",value:function(e){var t=!1,n=e&&e.classes||_e.options.defaultClass;this._classes!==n&&(this.setClasses(n),t=!0),e=he(e);var o=!1,i=!1;for(var r in this.options.offset===e.offset&&this.options.placement===e.placement||(o=!0),(this.options.template!==e.template||this.options.trigger!==e.trigger||this.options.container!==e.container||t)&&(i=!0),e)this.options[r]=e[r];if(this._tooltipNode)if(i){var s=this._isOpen;this.dispose(),this._init(),s&&this.show()}else o&&this.popperInstance.update()}},{key:"_init",value:function(){var e="string"==typeof this.options.trigger?this.options.trigger.split(" ").filter(function(e){return-1!==["click","hover","focus"].indexOf(e)}):[];this._isDisposed=!1,this._enableDocumentTouch=-1===e.indexOf("manual"),this._setEventListeners(this.reference,e,this.options)}},{key:"_create",value:function(e,t){var n=window.document.createElement("div");n.innerHTML=t.trim();var o=n.childNodes[0];return o.id="tooltip_"+Math.random().toString(36).substr(2,10),o.setAttribute("aria-hidden","true"),this.options.autoHide&&-1!==this.options.trigger.indexOf("hover")&&(o.addEventListener("mouseenter",this.hide),o.addEventListener("click",this.hide)),o}},{key:"_setContent",value:function(e,t){var n=this;this.asyncContent=!1,this._applyContent(e,t).then(function(){n.popperInstance.update()})}},{key:"_applyContent",value:function(e,t){var n=this;return new Promise(function(o,i){var r=t.html,s=n._tooltipNode,a=s.querySelector(n.options.innerSelector);if(1===e.nodeType){if(r){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(e)}}else{if("function"==typeof e){var p=e();return void(p&&"function"==typeof p.then?(n.asyncContent=!0,t.loadingClass&&Z(s,t.loadingClass),t.loadingContent&&n._applyContent(t.loadingContent,t),p.then(function(e){return t.loadingClass&&ee(s,t.loadingClass),n._applyContent(e,t)}).then(o).catch(i)):n._applyContent(p,t).then(o).catch(i))}r?a.innerHTML=e:a.innerText=e}o()})}},{key:"_show",value:function(e,t){if(t&&"string"==typeof t.container&&!document.querySelector(t.container))return;clearTimeout(this._disposeTimer),delete(t=Object.assign({},t)).offset;var n=!0;this._tooltipNode&&(Z(this._tooltipNode,this._classes),n=!1);var o=this._ensureShown(e,t);return n&&this._tooltipNode&&Z(this._tooltipNode,this._classes),Z(e,["v-tooltip-open"]),o}},{key:"_ensureShown",value:function(e,t){var n=this;if(this._isOpen)return this;if(this._isOpen=!0,pe.push(this),this._tooltipNode)return this._tooltipNode.style.display="",this._tooltipNode.setAttribute("aria-hidden","false"),this.popperInstance.enableEventListeners(),this.popperInstance.update(),this.asyncContent&&this._setContent(t.title,t),this;var o=e.getAttribute("title")||t.title;if(!o)return this;var i=this._create(e,t.template);this._tooltipNode=i,this._setContent(o,t),e.setAttribute("aria-describedby",i.id);var r=this._findContainer(t.container,e);this._append(i,r);var s=se({},t.popperOptions,{placement:t.placement});return s.modifiers=se({},s.modifiers,{arrow:{element:this.options.arrowSelector}}),t.boundariesElement&&(s.modifiers.preventOverflow={boundariesElement:t.boundariesElement}),this.popperInstance=new X(e,i,s),requestAnimationFrame(function(){!n._isDisposed&&n.popperInstance?(n.popperInstance.update(),requestAnimationFrame(function(){n._isDisposed?n.dispose():n._isOpen&&i.setAttribute("aria-hidden","false")})):n.dispose()}),this}},{key:"_noLongerOpen",value:function(){var e=pe.indexOf(this);-1!==e&&pe.splice(e,1)}},{key:"_hide",value:function(){var e=this;if(!this._isOpen)return this;this._isOpen=!1,this._noLongerOpen(),this._tooltipNode.style.display="none",this._tooltipNode.setAttribute("aria-hidden","true"),this.popperInstance.disableEventListeners(),clearTimeout(this._disposeTimer);var t=_e.options.disposeTimeout;return null!==t&&(this._disposeTimer=setTimeout(function(){e._tooltipNode&&(e._tooltipNode.removeEventListener("mouseenter",e.hide),e._tooltipNode.removeEventListener("click",e.hide),e._tooltipNode.parentNode.removeChild(e._tooltipNode),e._tooltipNode=null)},t)),ee(this.reference,["v-tooltip-open"]),this}},{key:"_dispose",value:function(){var e=this;return this._isDisposed=!0,this._events.forEach(function(t){var n=t.func,o=t.event;e.reference.removeEventListener(o,n)}),this._events=[],this._tooltipNode?(this._hide(),this._tooltipNode.removeEventListener("mouseenter",this.hide),this._tooltipNode.removeEventListener("click",this.hide),this.popperInstance.destroy(),this.popperInstance.options.removeOnDestroy||(this._tooltipNode.parentNode.removeChild(this._tooltipNode),this._tooltipNode=null)):this._noLongerOpen(),this}},{key:"_findContainer",value:function(e,t){return"string"==typeof e?e=window.document.querySelector(e):!1===e&&(e=t.parentNode),e}},{key:"_append",value:function(e,t){t.appendChild(e)}},{key:"_setEventListeners",value:function(e,t,n){var o=this,i=[],r=[];t.forEach(function(e){switch(e){case"hover":i.push("mouseenter"),r.push("mouseleave"),o.options.hideOnTargetClick&&r.push("click");break;case"focus":i.push("focus"),r.push("blur"),o.options.hideOnTargetClick&&r.push("click");break;case"click":i.push("click"),r.push("click")}}),i.forEach(function(t){var i=function(t){!0!==o._isOpen&&(t.usedByTooltip=!0,o._scheduleShow(e,n.delay,n,t))};o._events.push({event:t,func:i}),e.addEventListener(t,i)}),r.forEach(function(t){var i=function(t){!0!==t.usedByTooltip&&o._scheduleHide(e,n.delay,n,t)};o._events.push({event:t,func:i}),e.addEventListener(t,i)})}},{key:"_onDocumentTouch",value:function(e){this._enableDocumentTouch&&this._scheduleHide(this.reference,this.options.delay,this.options,e)}},{key:"_scheduleShow",value:function(e,t,n){var o=this,i=t&&t.show||t||0;clearTimeout(this._scheduleTimer),this._scheduleTimer=window.setTimeout(function(){return o._show(e,n)},i)}},{key:"_scheduleHide",value:function(e,t,n,o){var i=this,r=t&&t.hide||t||0;clearTimeout(this._scheduleTimer),this._scheduleTimer=window.setTimeout(function(){if(!1!==i._isOpen&&document.body.contains(i._tooltipNode)){if("mouseleave"===o.type)if(i._setTooltipNodeEvent(o,e,t,n))return;i._hide(e,n)}},r)}}]),e}(),ue=function(){var e=this;this.show=function(){e._show(e.reference,e.options)},this.hide=function(){e._hide()},this.dispose=function(){e._dispose()},this.toggle=function(){return e._isOpen?e.hide():e.show()},this._events=[],this._setTooltipNodeEvent=function(t,n,o,i){var r=t.relatedreference||t.toElement||t.relatedTarget;return!!e._tooltipNode.contains(r)&&(e._tooltipNode.addEventListener(t.type,function o(r){var s=r.relatedreference||r.toElement||r.relatedTarget;e._tooltipNode.removeEventListener(t.type,o),n.contains(s)||e._scheduleHide(n,i.delay,i,r)}),!0)}};"undefined"!=typeof document&&document.addEventListener("touchstart",function(e){for(var t=0;t',defaultArrowSelector:".tooltip-arrow, .tooltip__arrow",defaultInnerSelector:".tooltip-inner, .tooltip__inner",defaultDelay:0,defaultTrigger:"hover focus",defaultOffset:0,defaultContainer:"body",defaultBoundariesElement:void 0,defaultPopperOptions:{},defaultLoadingClass:"tooltip-loading",defaultLoadingContent:"...",autoHide:!0,defaultHideOnTargetClick:!0,disposeTimeout:5e3,popover:{defaultPlacement:"bottom",defaultClass:"vue-popover-theme",defaultBaseClass:"tooltip popover",defaultWrapperClass:"wrapper",defaultInnerClass:"tooltip-inner popover-inner",defaultArrowClass:"tooltip-arrow popover-arrow",defaultDelay:0,defaultTrigger:"click",defaultOffset:0,defaultContainer:"body",defaultBoundariesElement:void 0,defaultPopperOptions:{},defaultAutoHide:!0,defaultHandleResize:!0}};function he(e){var t={placement:void 0!==e.placement?e.placement:_e.options.defaultPlacement,delay:void 0!==e.delay?e.delay:_e.options.defaultDelay,html:void 0!==e.html?e.html:_e.options.defaultHtml,template:void 0!==e.template?e.template:_e.options.defaultTemplate,arrowSelector:void 0!==e.arrowSelector?e.arrowSelector:_e.options.defaultArrowSelector,innerSelector:void 0!==e.innerSelector?e.innerSelector:_e.options.defaultInnerSelector,trigger:void 0!==e.trigger?e.trigger:_e.options.defaultTrigger,offset:void 0!==e.offset?e.offset:_e.options.defaultOffset,container:void 0!==e.container?e.container:_e.options.defaultContainer,boundariesElement:void 0!==e.boundariesElement?e.boundariesElement:_e.options.defaultBoundariesElement,autoHide:void 0!==e.autoHide?e.autoHide:_e.options.autoHide,hideOnTargetClick:void 0!==e.hideOnTargetClick?e.hideOnTargetClick:_e.options.defaultHideOnTargetClick,loadingClass:void 0!==e.loadingClass?e.loadingClass:_e.options.defaultLoadingClass,loadingContent:void 0!==e.loadingContent?e.loadingContent:_e.options.defaultLoadingContent,popperOptions:se({},void 0!==e.popperOptions?e.popperOptions:_e.options.defaultPopperOptions)};if(t.offset){var n=oe(t.offset),o=t.offset;("number"===n||"string"===n&&-1===o.indexOf(","))&&(o="0, "+o),t.popperOptions.modifiers||(t.popperOptions.modifiers={}),t.popperOptions.modifiers.offset={offset:o}}return t}function ve(e,t){for(var n=e.placement,o=0;o2&&void 0!==arguments[2]?arguments[2]:{},o=me(t),i=void 0!==t.classes?t.classes:_e.options.defaultClass,r=se({title:o},he(se({},t,{placement:ve(t,n)}))),s=e._tooltip=new le(e,r);s.setClasses(i),s._vueEl=e;var a=void 0!==t.targetClasses?t.targetClasses:_e.options.defaultTargetClass;return e._tooltipTargetClasses=a,Z(e,a),s}function be(e){e._tooltip&&(e._tooltip.dispose(),delete e._tooltip,delete e._tooltipOldShow),e._tooltipTargetClasses&&(ee(e,e._tooltipTargetClasses),delete e._tooltipTargetClasses)}function ye(e,t){var n=t.value,o=(t.oldValue,t.modifiers),i=me(n);if(i&&fe.enabled){var r=void 0;e._tooltip?((r=e._tooltip).setContent(i),r.setOptions(se({},n,{placement:ve(n,o)}))):r=ge(e,n,o),void 0!==n.show&&n.show!==e._tooltipOldShow&&(e._tooltipOldShow=n.show,n.show?r.show():r.hide())}else be(e)}var _e={options:de,bind:ye,update:ye,unbind:function(e){be(e)}};function we(e){e.addEventListener("click",Ee),e.addEventListener("touchstart",Ce,!!te&&{passive:!0})}function Oe(e){e.removeEventListener("click",Ee),e.removeEventListener("touchstart",Ce),e.removeEventListener("touchend",Te),e.removeEventListener("touchcancel",$e)}function Ee(e){var t=e.currentTarget;e.closePopover=!t.$_vclosepopover_touch,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}function Ce(e){if(1===e.changedTouches.length){var t=e.currentTarget;t.$_vclosepopover_touch=!0;var n=e.changedTouches[0];t.$_vclosepopover_touchPoint=n,t.addEventListener("touchend",Te),t.addEventListener("touchcancel",$e)}}function Te(e){var t=e.currentTarget;if(t.$_vclosepopover_touch=!1,1===e.changedTouches.length){var n=e.changedTouches[0],o=t.$_vclosepopover_touchPoint;e.closePopover=Math.abs(n.screenY-o.screenY)<20&&Math.abs(n.screenX-o.screenX)<20,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}}function $e(e){e.currentTarget.$_vclosepopover_touch=!1}var Le={bind:function(e,t){var n=t.value,o=t.modifiers;e.$_closePopoverModifiers=o,(void 0===n||n)&&we(e)},update:function(e,t){var n=t.value,o=t.oldValue,i=t.modifiers;e.$_closePopoverModifiers=i,n!==o&&(void 0===n||n?we(e):Oe(e))},unbind:function(e){Oe(e)}};var xe=void 0;function Ne(){Ne.init||(Ne.init=!0,xe=-1!==function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var o=e.indexOf("Edge/");return o>0?parseInt(e.substring(o+5,e.indexOf(".",o)),10):-1}())}var Se={render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"resize-observer",attrs:{tabindex:"-1"}})},staticRenderFns:[],_scopeId:"data-v-b329ee4c",name:"resize-observer",methods:{notify:function(){this.$emit("notify")},addResizeHandlers:function(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.notify),this._w===this.$el.offsetWidth&&this._h===this.$el.offsetHeight||this.notify()},removeResizeHandlers:function(){this._resizeObject&&this._resizeObject.onload&&(!xe&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.notify),delete this._resizeObject.onload)}},mounted:function(){var e=this;Ne(),this.$nextTick(function(){e._w=e.$el.offsetWidth,e._h=e.$el.offsetHeight});var t=document.createElement("object");this._resizeObject=t,t.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",xe&&this.$el.appendChild(t),t.data="about:blank",xe||this.$el.appendChild(t)},beforeDestroy:function(){this.removeResizeHandlers()}};var je={version:"0.4.4",install:function(e){e.component("resize-observer",Se)}},ke=null;function Ae(e){var t=_e.options.popover[e];return void 0===t?_e.options[e]:t}"undefined"!=typeof window?ke=window.Vue:"undefined"!=typeof global&&(ke=global.Vue),ke&&ke.use(je);var Ie=!1;"undefined"!=typeof window&&"undefined"!=typeof navigator&&(Ie=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);var Pe=[],De=function(){};"undefined"!=typeof window&&(De=window.Element);var Me={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"v-popover",class:e.cssClass},[n("span",{ref:"trigger",staticClass:"trigger",staticStyle:{display:"inline-block"},attrs:{"aria-describedby":e.popoverId,tabindex:-1!==e.trigger.indexOf("focus")?0:-1}},[e._t("default")],2),e._v(" "),n("div",{ref:"popover",class:[e.popoverBaseClass,e.popoverClass,e.cssClass],style:{visibility:e.isOpen?"visible":"hidden"},attrs:{id:e.popoverId,"aria-hidden":e.isOpen?"false":"true"}},[n("div",{class:e.popoverWrapperClass},[n("div",{ref:"inner",class:e.popoverInnerClass,staticStyle:{position:"relative"}},[n("div",[e._t("popover")],2),e._v(" "),e.handleResize?n("ResizeObserver",{on:{notify:e.$_handleResize}}):e._e()],1),e._v(" "),n("div",{ref:"arrow",class:e.popoverArrowClass})])])])},staticRenderFns:[],name:"VPopover",components:{ResizeObserver:Se},props:{open:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placement:{type:String,default:function(){return Ae("defaultPlacement")}},delay:{type:[String,Number,Object],default:function(){return Ae("defaultDelay")}},offset:{type:[String,Number],default:function(){return Ae("defaultOffset")}},trigger:{type:String,default:function(){return Ae("defaultTrigger")}},container:{type:[String,Object,De],default:function(){return Ae("defaultContainer")}},boundariesElement:{type:De,default:function(){return Ae("defaultBoundariesElement")}},popperOptions:{type:Object,default:function(){return Ae("defaultPopperOptions")}},popoverClass:{type:[String,Array],default:function(){return Ae("defaultClass")}},popoverBaseClass:{type:[String,Array],default:function(){return _e.options.popover.defaultBaseClass}},popoverInnerClass:{type:[String,Array],default:function(){return _e.options.popover.defaultInnerClass}},popoverWrapperClass:{type:[String,Array],default:function(){return _e.options.popover.defaultWrapperClass}},popoverArrowClass:{type:[String,Array],default:function(){return _e.options.popover.defaultArrowClass}},autoHide:{type:Boolean,default:function(){return _e.options.popover.defaultAutoHide}},handleResize:{type:Boolean,default:function(){return _e.options.popover.defaultHandleResize}},openGroup:{type:String,default:null}},data:function(){return{isOpen:!1,id:Math.random().toString(36).substr(2,10)}},computed:{cssClass:function(){return{open:this.isOpen}},popoverId:function(){return"popover_"+this.id}},watch:{open:function(e){e?this.show():this.hide()},disabled:function(e,t){e!==t&&(e?this.hide():this.open&&this.show())},container:function(e){if(this.isOpen&&this.popperInstance){var t=this.$refs.popover,n=this.$refs.trigger,o=this.$_findContainer(this.container,n);if(!o)return void console.warn("No container for popover",this);o.appendChild(t),this.popperInstance.scheduleUpdate()}},trigger:function(e){this.$_removeEventListeners(),this.$_addEventListeners()},placement:function(e){var t=this;this.$_updatePopper(function(){t.popperInstance.options.placement=e})},offset:"$_restartPopper",boundariesElement:"$_restartPopper",popperOptions:{handler:"$_restartPopper",deep:!0}},created:function(){this.$_isDisposed=!1,this.$_mounted=!1,this.$_events=[],this.$_preventOpen=!1},mounted:function(){var e=this.$refs.popover;e.parentNode&&e.parentNode.removeChild(e),this.$_init(),this.open&&this.show()},beforeDestroy:function(){this.dispose()},methods:{show:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.event,o=(t.skipDelay,t.force);!(void 0!==o&&o)&&this.disabled||(this.$_scheduleShow(n),this.$emit("show")),this.$emit("update:open",!0),this.$_beingShowed=!0,requestAnimationFrame(function(){e.$_beingShowed=!1})},hide:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.event;e.skipDelay;this.$_scheduleHide(t),this.$emit("hide"),this.$emit("update:open",!1)},dispose:function(){if(this.$_isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.popperInstance&&(this.popperInstance.destroy(),!this.popperInstance.options.removeOnDestroy)){var e=this.$refs.popover;e.parentNode&&e.parentNode.removeChild(e)}this.$_mounted=!1,this.popperInstance=null,this.isOpen=!1,this.$emit("dispose")},$_init:function(){-1===this.trigger.indexOf("manual")&&this.$_addEventListeners()},$_show:function(){var e=this,t=this.$refs.trigger,n=this.$refs.popover;if(clearTimeout(this.$_disposeTimer),!this.isOpen){if(this.popperInstance&&(this.isOpen=!0,this.popperInstance.enableEventListeners(),this.popperInstance.scheduleUpdate()),!this.$_mounted){var o=this.$_findContainer(this.container,t);if(!o)return void console.warn("No container for popover",this);o.appendChild(n),this.$_mounted=!0}if(!this.popperInstance){var i=se({},this.popperOptions,{placement:this.placement});if(i.modifiers=se({},i.modifiers,{arrow:{element:this.$refs.arrow}}),this.offset){var r=this.$_getOffset();i.modifiers.offset={offset:r}}this.boundariesElement&&(i.modifiers.preventOverflow={boundariesElement:this.boundariesElement}),this.popperInstance=new X(t,n,i),requestAnimationFrame(function(){!e.$_isDisposed&&e.popperInstance?(e.popperInstance.scheduleUpdate(),requestAnimationFrame(function(){e.$_isDisposed?e.dispose():e.isOpen=!0})):e.dispose()})}var s=this.openGroup;if(s)for(var a=void 0,p=0;p1&&void 0!==arguments[1]&&arguments[1];if(clearTimeout(this.$_scheduleTimer),e)this.$_show();else{var t=parseInt(this.delay&&this.delay.show||this.delay||0);this.$_scheduleTimer=setTimeout(this.$_show.bind(this),t)}},$_scheduleHide:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(clearTimeout(this.$_scheduleTimer),n)this.$_hide();else{var o=parseInt(this.delay&&this.delay.hide||this.delay||0);this.$_scheduleTimer=setTimeout(function(){if(e.isOpen){if(t&&"mouseleave"===t.type)if(e.$_setTooltipNodeEvent(t))return;e.$_hide()}},o)}},$_setTooltipNodeEvent:function(e){var t=this,n=this.$refs.trigger,o=this.$refs.popover,i=e.relatedreference||e.toElement||e.relatedTarget;return!!o.contains(i)&&(o.addEventListener(e.type,function i(r){var s=r.relatedreference||r.toElement||r.relatedTarget;o.removeEventListener(e.type,i),n.contains(s)||t.hide({event:r})}),!0)},$_removeEventListeners:function(){var e=this.$refs.trigger;this.$_events.forEach(function(t){var n=t.func,o=t.event;e.removeEventListener(o,n)}),this.$_events=[]},$_updatePopper:function(e){this.popperInstance&&(e(),this.isOpen&&this.popperInstance.scheduleUpdate())},$_restartPopper:function(){if(this.popperInstance){var e=this.isOpen;this.dispose(),this.$_isDisposed=!1,this.$_init(),e&&this.show({skipDelay:!0,force:!0})}},$_handleGlobalClose:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.$_beingShowed||(this.hide({event:e}),e.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),n&&(this.$_preventOpen=!0,setTimeout(function(){t.$_preventOpen=!1},300)))},$_handleResize:function(){this.isOpen&&this.popperInstance&&(this.popperInstance.scheduleUpdate(),this.$emit("resize"))}}};function He(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];requestAnimationFrame(function(){for(var n=void 0,o=0;o-1},ie.prototype.set=function(e,t){var n=this.__data__,o=ue(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this},re.prototype.clear=function(){this.size=0,this.__data__={hash:new oe,map:new(ee||ie),string:new oe}},re.prototype.delete=function(e){var t=_e(this,e).delete(e);return this.size-=t?1:0,t},re.prototype.get=function(e){return _e(this,e).get(e)},re.prototype.has=function(e){return _e(this,e).has(e)},re.prototype.set=function(e,t){var n=_e(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this},se.prototype.clear=function(){this.__data__=new ie,this.size=0},se.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},se.prototype.get=function(e){return this.__data__.get(e)},se.prototype.has=function(e){return this.__data__.has(e)},se.prototype.set=function(e,t){var o=this.__data__;if(o instanceof ie){var i=o.__data__;if(!ee||i.length-1&&e%1==0&&e0){if(++t>=i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(X?function(e,t){return X(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:He);function Te(e,t){return e===t||e!=e&&t!=t}var $e=ve(function(){return arguments}())?ve:function(e){return Ae(e)&&D.call(e,"callee")&&!G.call(e,"callee")},Le=Array.isArray;function xe(e){return null!=e&&je(e.length)&&!Se(e)}var Ne=J||function(){return!1};function Se(e){if(!ke(e))return!1;var t=he(e);return t==l||t==u||t==p||t==d}function je(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ae(e){return null!=e&&"object"==typeof e}var Ie=$?function(e){return function(t){return e(t)}}($):function(e){return Ae(e)&&je(e.length)&&!!g[he(e)]};function Pe(e){return xe(e)?ae(e,!0):ge(e)}var De,Me=(De=function(e,t,n){be(e,t,n)},ye(function(e,t){var n=-1,o=t.length,i=o>1?t[o-1]:void 0,r=o>2?t[2]:void 0;for(i=De.length>3&&"function"==typeof i?(o--,i):void 0,r&&function(e,t,n){if(!ke(n))return!1;var o=typeof t;return!!("number"==o?xe(n)&&Oe(t,n.length):"string"==o&&t in n)&&Te(n[t],e)}(t[0],t[1],r)&&(i=o<3?void 0:i,o=1),e=Object(e);++n1&&void 0!==arguments[1]?arguments[1]:{};if(!We.installed){We.installed=!0;var n={};Be(n,de,t),qe.options=n,_e.options=n,e.directive("tooltip",_e),e.directive("close-popover",Le),e.component("v-popover",Me)}}var Re=_e,Ue=Le,Ve=Me,qe={install:We,get enabled(){return fe.enabled},set enabled(e){fe.enabled=e}},Ge=null;return"undefined"!=typeof window?Ge=window.Vue:"undefined"!=typeof global&&(Ge=global.Vue),Ge&&Ge.use(qe),e.install=We,e.VTooltip=Re,e.VClosePopover=Ue,e.VPopover=Ve,e.default=qe,e.createTooltip=ge,e.destroyTooltip=be,e}({});
diff --git a/dist/v-tooltip.umd.js b/dist/v-tooltip.umd.js
index 229568d9..6e7879b5 100644
--- a/dist/v-tooltip.umd.js
+++ b/dist/v-tooltip.umd.js
@@ -6,7 +6,7 @@
/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
- * @version 1.12.9
+ * @version 1.14.3
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
@@ -29,6 +29,7 @@
* SOFTWARE.
*/
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
+
var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
var timeoutDuration = 0;
for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
@@ -148,13 +149,33 @@ function getScrollParent(element) {
overflowX = _getStyleComputedProp.overflowX,
overflowY = _getStyleComputedProp.overflowY;
- if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) {
+ if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
return element;
}
return getScrollParent(getParentNode(element));
}
+var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
+var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
+
+/**
+ * Determines if the browser is Internet Explorer
+ * @method
+ * @memberof Popper.Utils
+ * @param {Number} version to check
+ * @returns {Boolean} isIE
+ */
+function isIE(version) {
+ if (version === 11) {
+ return isIE11;
+ }
+ if (version === 10) {
+ return isIE10;
+ }
+ return isIE11 || isIE10;
+}
+
/**
* Returns the offset parent of the given element
* @method
@@ -163,16 +184,23 @@ function getScrollParent(element) {
* @returns {Element} offset parent
*/
function getOffsetParent(element) {
+ if (!element) {
+ return document.documentElement;
+ }
+
+ var noOffsetParent = isIE(10) ? document.body : null;
+
// NOTE: 1 DOM access here
- var offsetParent = element && element.offsetParent;
+ var offsetParent = element.offsetParent;
+ // Skip hidden elements which don't have an offsetParent
+ while (offsetParent === noOffsetParent && element.nextElementSibling) {
+ offsetParent = (element = element.nextElementSibling).offsetParent;
+ }
+
var nodeName = offsetParent && offsetParent.nodeName;
if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
- if (element) {
- return element.ownerDocument.documentElement;
- }
-
- return document.documentElement;
+ return element ? element.ownerDocument.documentElement : document.documentElement;
}
// .offsetParent will return the closest TD or TABLE in case
@@ -314,29 +342,14 @@ function getBordersSize(styles, axis) {
return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
}
-/**
- * Tells if you are running Internet Explorer 10
- * @method
- * @memberof Popper.Utils
- * @returns {Boolean} isIE10
- */
-var isIE10 = undefined;
-
-var isIE10$1 = function () {
- if (isIE10 === undefined) {
- isIE10 = navigator.appVersion.indexOf('MSIE 10') !== -1;
- }
- return isIE10;
-};
-
function getSize(axis, body, html, computedStyle) {
- return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE10$1() ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);
+ return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);
}
function getWindowSizes() {
var body = document.body;
var html = document.documentElement;
- var computedStyle = isIE10$1() && getComputedStyle(html);
+ var computedStyle = isIE(10) && getComputedStyle(html);
return {
height: getSize('Height', body, html, computedStyle),
@@ -428,8 +441,8 @@ function getBoundingClientRect(element) {
// IE10 10 FIX: Please, don't ask, the element isn't
// considered in DOM in some circumstances...
// This isn't reproducible in IE10 compatibility mode of IE11
- if (isIE10$1()) {
- try {
+ try {
+ if (isIE(10)) {
rect = element.getBoundingClientRect();
var scrollTop = getScroll(element, 'top');
var scrollLeft = getScroll(element, 'left');
@@ -437,10 +450,10 @@ function getBoundingClientRect(element) {
rect.left += scrollLeft;
rect.bottom += scrollTop;
rect.right += scrollLeft;
- } catch (err) {}
- } else {
- rect = element.getBoundingClientRect();
- }
+ } else {
+ rect = element.getBoundingClientRect();
+ }
+ } catch (e) {}
var result = {
left: rect.left,
@@ -472,7 +485,9 @@ function getBoundingClientRect(element) {
}
function getOffsetRectRelativeToArbitraryNode(children, parent) {
- var isIE10 = isIE10$1();
+ var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
+
+ var isIE10 = isIE(10);
var isHTML = parent.nodeName === 'HTML';
var childrenRect = getBoundingClientRect(children);
var parentRect = getBoundingClientRect(parent);
@@ -482,6 +497,11 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) {
var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
+ // In cases where the parent is fixed, we must ignore negative scroll in offset calc
+ if (fixedPosition && parent.nodeName === 'HTML') {
+ parentRect.top = Math.max(parentRect.top, 0);
+ parentRect.left = Math.max(parentRect.left, 0);
+ }
var offsets = getClientRect({
top: childrenRect.top - parentRect.top - borderTopWidth,
left: childrenRect.left - parentRect.left - borderLeftWidth,
@@ -509,7 +529,7 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) {
offsets.marginLeft = marginLeft;
}
- if (isIE10 ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
+ if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
offsets = includeScroll(offsets, parent);
}
@@ -517,13 +537,15 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) {
}
function getViewportOffsetRectRelativeToArtbitraryNode(element) {
+ var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+
var html = element.ownerDocument.documentElement;
var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
var width = Math.max(html.clientWidth, window.innerWidth || 0);
var height = Math.max(html.clientHeight, window.innerHeight || 0);
- var scrollTop = getScroll(html);
- var scrollLeft = getScroll(html, 'left');
+ var scrollTop = !excludeScroll ? getScroll(html) : 0;
+ var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
var offset = {
top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
@@ -554,6 +576,26 @@ function isFixed(element) {
return isFixed(getParentNode(element));
}
+/**
+ * Finds the first parent of an element that has a transformed property defined
+ * @method
+ * @memberof Popper.Utils
+ * @argument {Element} element
+ * @returns {Element} first transformed parent or documentElement
+ */
+
+function getFixedPositionOffsetParent(element) {
+ // This check is needed to avoid errors in case one of the elements isn't defined for any reason
+ if (!element || !element.parentElement || isIE()) {
+ return document.documentElement;
+ }
+ var el = element.parentElement;
+ while (el && getStyleComputedProperty(el, 'transform') === 'none') {
+ el = el.parentElement;
+ }
+ return el || document.documentElement;
+}
+
/**
* Computed the boundaries limits and return them
* @method
@@ -562,16 +604,20 @@ function isFixed(element) {
* @param {HTMLElement} reference
* @param {number} padding
* @param {HTMLElement} boundariesElement - Element used to define the boundaries
+ * @param {Boolean} fixedPosition - Is in fixed position mode
* @returns {Object} Coordinates of the boundaries
*/
function getBoundaries(popper, reference, padding, boundariesElement) {
+ var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
+
// NOTE: 1 DOM access here
+
var boundaries = { top: 0, left: 0 };
- var offsetParent = findCommonOffsetParent(popper, reference);
+ var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
// Handle viewport case
if (boundariesElement === 'viewport') {
- boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent);
+ boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
} else {
// Handle other cases based on DOM element used as boundaries
var boundariesNode = void 0;
@@ -586,7 +632,7 @@ function getBoundaries(popper, reference, padding, boundariesElement) {
boundariesNode = boundariesElement;
}
- var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent);
+ var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
// In case of HTML, we need a different computation
if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
@@ -687,11 +733,14 @@ function computeAutoPlacement(placement, refRect, popper, reference, boundariesE
* @param {Object} state
* @param {Element} popper - the popper element
* @param {Element} reference - the reference element (the popper will be relative to this)
+ * @param {Element} fixedPosition - is in fixed position mode
* @returns {Object} An object containing the offsets which will be applied to the popper
*/
function getReferenceOffsets(state, popper, reference) {
- var commonOffsetParent = findCommonOffsetParent(popper, reference);
- return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent);
+ var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
+
+ var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
+ return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
}
/**
@@ -864,7 +913,7 @@ function update() {
};
// compute reference element offsets
- data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference);
+ data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
// compute auto placement, store placement inside the data object,
// modifiers will be able to edit `placement` if needed
@@ -874,9 +923,12 @@ function update() {
// store the computed placement inside `originalPlacement`
data.originalPlacement = data.placement;
+ data.positionFixed = this.options.positionFixed;
+
// compute the popper offsets
data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
- data.offsets.popper.position = 'absolute';
+
+ data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
// run the modifiers
data = runModifiers(this.modifiers, data);
@@ -916,7 +968,7 @@ function getSupportedPropertyName(property) {
var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
- for (var i = 0; i < prefixes.length - 1; i++) {
+ for (var i = 0; i < prefixes.length; i++) {
var prefix = prefixes[i];
var toCheck = prefix ? '' + prefix + upperProp : property;
if (typeof document.body.style[toCheck] !== 'undefined') {
@@ -937,9 +989,12 @@ function destroy() {
// touch DOM only if `applyStyle` modifier is enabled
if (isModifierEnabled(this.modifiers, 'applyStyle')) {
this.popper.removeAttribute('x-placement');
- this.popper.style.left = '';
this.popper.style.position = '';
this.popper.style.top = '';
+ this.popper.style.left = '';
+ this.popper.style.right = '';
+ this.popper.style.bottom = '';
+ this.popper.style.willChange = '';
this.popper.style[getSupportedPropertyName('transform')] = '';
}
@@ -1127,12 +1182,12 @@ function applyStyle(data) {
* @method
* @memberof Popper.modifiers
* @param {HTMLElement} reference - The reference element used to position the popper
- * @param {HTMLElement} popper - The HTML element used as popper.
+ * @param {HTMLElement} popper - The HTML element used as popper
* @param {Object} options - Popper.js options
*/
function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
// compute reference element offsets
- var referenceOffsets = getReferenceOffsets(state, popper, reference);
+ var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
// compute auto placement, store placement inside the data object,
// modifiers will be able to edit `placement` if needed
@@ -1143,7 +1198,7 @@ function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
// Apply `position` to popper before anything else because
// without the position applied we can't guarantee correct computations
- setStyles(popper, { position: 'absolute' });
+ setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
return options;
}
@@ -1178,11 +1233,13 @@ function computeStyle(data, options) {
position: popper.position
};
- // floor sides to avoid blurry text
+ // Avoid blurry text by using full pixel integers.
+ // For pixel-perfect positioning, top/bottom prefers rounded
+ // values, while left/right prefers floored values.
var offsets = {
left: Math.floor(popper.left),
- top: Math.floor(popper.top),
- bottom: Math.floor(popper.bottom),
+ top: Math.round(popper.top),
+ bottom: Math.round(popper.bottom),
right: Math.floor(popper.right)
};
@@ -1446,7 +1503,7 @@ function flip(data, options) {
return data;
}
- var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement);
+ var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
var placement = data.placement.split('-')[0];
var placementOpposite = getOppositePlacement(placement);
@@ -1738,7 +1795,27 @@ function preventOverflow(data, options) {
boundariesElement = getOffsetParent(boundariesElement);
}
- var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement);
+ // NOTE: DOM access here
+ // resets the popper's position so that the document size can be calculated excluding
+ // the size of the popper element itself
+ var transformProp = getSupportedPropertyName('transform');
+ var popperStyles = data.instance.popper.style; // assignment to help minification
+ var top = popperStyles.top,
+ left = popperStyles.left,
+ transform = popperStyles[transformProp];
+
+ popperStyles.top = '';
+ popperStyles.left = '';
+ popperStyles[transformProp] = '';
+
+ var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
+
+ // NOTE: DOM access here
+ // restores the original style properties after the offsets have been computed
+ popperStyles.top = top;
+ popperStyles.left = left;
+ popperStyles[transformProp] = transform;
+
options.boundaries = boundaries;
var order = options.priority;
@@ -2235,6 +2312,12 @@ var Defaults = {
*/
placement: 'bottom',
+ /**
+ * Set this to true if you want popper to position it self in 'fixed' mode
+ * @prop {Boolean} positionFixed=false
+ */
+ positionFixed: false,
+
/**
* Whether events (resize, scroll) are initially enabled
* @prop {Boolean} eventsEnabled=true
@@ -2439,6 +2522,11 @@ Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
Popper.placements = placements;
Popper.Defaults = Defaults;
+var SVGAnimatedString = function SVGAnimatedString() {};
+if (typeof window !== 'undefined') {
+ SVGAnimatedString = window.SVGAnimatedString;
+}
+
function convertToArray(value) {
if (typeof value === 'string') {
value = value.split(' ');
@@ -2457,7 +2545,7 @@ function addClasses(el, classes) {
var newClasses = convertToArray(classes);
var classList = void 0;
if (el.className instanceof SVGAnimatedString) {
- classList = Array.from(el.className);
+ classList = convertToArray(el.className.baseVal);
} else {
classList = convertToArray(el.className);
}
@@ -2484,7 +2572,7 @@ function removeClasses(el, classes) {
var newClasses = convertToArray(classes);
var classList = void 0;
if (el.className instanceof SVGAnimatedString) {
- classList = Array.from(el.className);
+ classList = convertToArray(el.className.baseVal);
} else {
classList = convertToArray(el.className);
}
@@ -2862,6 +2950,8 @@ var Tooltip = function () {
addClasses(this._tooltipNode, this._classes);
}
+ addClasses(reference, ['v-tooltip-open']);
+
return result;
}
}, {
@@ -2990,6 +3080,8 @@ var Tooltip = function () {
}, disposeTime);
}
+ removeClasses(this.reference, ['v-tooltip-open']);
+
return this;
}
}, {
@@ -3066,10 +3158,12 @@ var Tooltip = function () {
case 'hover':
directEvents.push('mouseenter');
oppositeEvents.push('mouseleave');
+ if (_this6.options.hideOnTargetClick) oppositeEvents.push('click');
break;
case 'focus':
directEvents.push('focus');
oppositeEvents.push('blur');
+ if (_this6.options.hideOnTargetClick) oppositeEvents.push('click');
break;
case 'click':
directEvents.push('click');
@@ -3186,10 +3280,10 @@ var _initialiseProps = function _initialiseProps() {
this._events = [];
this._setTooltipNodeEvent = function (evt, reference, delay, options) {
- var relatedreference = evt.relatedreference || evt.toElement;
+ var relatedreference = evt.relatedreference || evt.toElement || evt.relatedTarget;
var callback = function callback(evt2) {
- var relatedreference2 = evt2.relatedreference || evt2.toElement;
+ var relatedreference2 = evt2.relatedreference || evt2.toElement || evt2.relatedTarget;
// Remove event listener after call
_this9._tooltipNode.removeEventListener(evt.type, callback);
@@ -3217,8 +3311,9 @@ if (typeof document !== 'undefined') {
openTooltips[i]._onDocumentTouch(event);
}
}, supportsPassive ? {
- passive: true
- } : false);
+ passive: true,
+ capture: true
+ } : true);
}
/**
@@ -3250,6 +3345,8 @@ var defaultOptions = {
defaultClass: 'vue-tooltip-theme',
// Default CSS classes applied to the target element of the tooltip
defaultTargetClass: 'has-tooltip',
+ // Is the content HTML by default?
+ defaultHtml: true,
// Default HTML template of the tooltip element
// It must include `tooltip-arrow` & `tooltip-inner` CSS classes (can be configured, see below)
// Change if the classes conflict with other libraries (for example bootstrap)
@@ -3274,6 +3371,8 @@ var defaultOptions = {
defaultLoadingContent: '...',
// Hide on mouseover tooltip
autoHide: true,
+ // Close tooltip on click on tooltip target?
+ defaultHideOnTargetClick: true,
// Auto destroy tooltip DOM nodes (ms)
disposeTimeout: 5000,
// Options for popover
@@ -3306,6 +3405,7 @@ function getOptions(options) {
var result = {
placement: typeof options.placement !== 'undefined' ? options.placement : directive.options.defaultPlacement,
delay: typeof options.delay !== 'undefined' ? options.delay : directive.options.defaultDelay,
+ html: typeof options.html !== 'undefined' ? options.html : directive.options.defaultHtml,
template: typeof options.template !== 'undefined' ? options.template : directive.options.defaultTemplate,
arrowSelector: typeof options.arrowSelector !== 'undefined' ? options.arrowSelector : directive.options.defaultArrowSelector,
innerSelector: typeof options.innerSelector !== 'undefined' ? options.innerSelector : directive.options.defaultInnerSelector,
@@ -3314,6 +3414,7 @@ function getOptions(options) {
container: typeof options.container !== 'undefined' ? options.container : directive.options.defaultContainer,
boundariesElement: typeof options.boundariesElement !== 'undefined' ? options.boundariesElement : directive.options.defaultBoundariesElement,
autoHide: typeof options.autoHide !== 'undefined' ? options.autoHide : directive.options.autoHide,
+ hideOnTargetClick: typeof options.hideOnTargetClick !== 'undefined' ? options.hideOnTargetClick : directive.options.defaultHideOnTargetClick,
loadingClass: typeof options.loadingClass !== 'undefined' ? options.loadingClass : directive.options.defaultLoadingClass,
loadingContent: typeof options.loadingContent !== 'undefined' ? options.loadingContent : directive.options.defaultLoadingContent,
popperOptions: _extends$1({}, typeof options.popperOptions !== 'undefined' ? options.popperOptions : directive.options.defaultPopperOptions)
@@ -3367,8 +3468,7 @@ function createTooltip(el, value) {
var content = getContent(value);
var classes = typeof value.classes !== 'undefined' ? value.classes : directive.options.defaultClass;
var opts = _extends$1({
- title: content,
- html: true
+ title: content
}, getOptions(_extends$1({}, value, {
placement: getPlacement(value, modifiers)
})));
@@ -3538,12 +3638,12 @@ function getInternetExplorerVersion() {
return -1;
}
-var isIE = void 0;
+var isIE$1 = void 0;
function initCompat() {
if (!initCompat.init) {
initCompat.init = true;
- isIE = getInternetExplorerVersion() !== -1;
+ isIE$1 = getInternetExplorerVersion() !== -1;
}
}
@@ -3564,7 +3664,7 @@ var ResizeObserver = { render: function render() {
},
removeResizeHandlers: function removeResizeHandlers() {
if (this._resizeObject && this._resizeObject.onload) {
- if (!isIE && this._resizeObject.contentDocument) {
+ if (!isIE$1 && this._resizeObject.contentDocument) {
this._resizeObject.contentDocument.defaultView.removeEventListener('resize', this.notify);
}
delete this._resizeObject.onload;
@@ -3584,13 +3684,14 @@ var ResizeObserver = { render: function render() {
this._resizeObject = object;
object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;');
object.setAttribute('aria-hidden', 'true');
+ object.setAttribute('tabindex', -1);
object.onload = this.addResizeHandlers;
object.type = 'text/html';
- if (isIE) {
+ if (isIE$1) {
this.$el.appendChild(object);
}
object.data = 'about:blank';
- if (!isIE) {
+ if (!isIE$1) {
this.$el.appendChild(object);
}
},
@@ -3611,7 +3712,7 @@ function install$1(Vue) {
// Plugin
var plugin$2 = {
// eslint-disable-next-line no-undef
- version: "0.4.3",
+ version: "0.4.4",
install: install$1
};
@@ -3641,10 +3742,15 @@ if (typeof window !== 'undefined' && typeof navigator !== 'undefined') {
var openPopovers = [];
+var Element = function Element() {};
+if (typeof window !== 'undefined') {
+ Element = window.Element;
+}
+
var Popover = { render: function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "v-popover", class: _vm.cssClass }, [_c('span', { ref: "trigger", staticClass: "trigger", staticStyle: { "display": "inline-block" }, attrs: { "aria-describedby": _vm.popoverId } }, [_vm._t("default")], 2), _vm._v(" "), _c('div', { ref: "popover", class: [_vm.popoverBaseClass, _vm.popoverClass, _vm.cssClass], style: {
- display: _vm.isOpen ? '' : 'none'
- }, attrs: { "id": _vm.popoverId, "aria-hidden": _vm.isOpen ? 'false' : 'true' } }, [_c('div', { class: _vm.popoverWrapperClass }, [_c('div', { ref: "arrow", class: _vm.popoverArrowClass }), _vm._v(" "), _c('div', { ref: "inner", class: _vm.popoverInnerClass, staticStyle: { "position": "relative" } }, [_c('div', [_vm._t("popover")], 2), _vm._v(" "), _vm.handleResize ? _c('ResizeObserver', { on: { "notify": _vm.$_handleResize } }) : _vm._e()], 1)])])]);
+ var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "v-popover", class: _vm.cssClass }, [_c('span', { ref: "trigger", staticClass: "trigger", staticStyle: { "display": "inline-block" }, attrs: { "aria-describedby": _vm.popoverId, "tabindex": _vm.trigger.indexOf('focus') !== -1 ? 0 : -1 } }, [_vm._t("default")], 2), _vm._v(" "), _c('div', { ref: "popover", class: [_vm.popoverBaseClass, _vm.popoverClass, _vm.cssClass], style: {
+ visibility: _vm.isOpen ? 'visible' : 'hidden'
+ }, attrs: { "id": _vm.popoverId, "aria-hidden": _vm.isOpen ? 'false' : 'true' } }, [_c('div', { class: _vm.popoverWrapperClass }, [_c('div', { ref: "inner", class: _vm.popoverInnerClass, staticStyle: { "position": "relative" } }, [_c('div', [_vm._t("popover")], 2), _vm._v(" "), _vm.handleResize ? _c('ResizeObserver', { on: { "notify": _vm.$_handleResize } }) : _vm._e()], 1), _vm._v(" "), _c('div', { ref: "arrow", class: _vm.popoverArrowClass })])])]);
}, staticRenderFns: [],
name: 'VPopover',
@@ -3799,36 +3905,23 @@ var Popover = { render: function render() {
}
container.appendChild(popoverNode);
- this.popperInstance.update();
+ this.popperInstance.scheduleUpdate();
}
},
trigger: function trigger(val) {
this.$_removeEventListeners();
this.$_addEventListeners();
},
- offset: function offset(val) {
+ placement: function placement(val) {
var _this = this;
this.$_updatePopper(function () {
- if (val) {
- var offset = _this.$_getOffset();
-
- _this.popperInstance.options.modifiers.offset = {
- offset: offset
- };
- } else {
- _this.popperInstance.options.modifiers.offset = undefined;
- }
+ _this.popperInstance.options.placement = val;
});
},
- placement: function placement(val) {
- var _this2 = this;
- this.$_updatePopper(function () {
- _this2.popperInstance.options.placement = val;
- });
- },
+ offset: '$_restartPopper',
boundariesElement: '$_restartPopper',
@@ -3861,6 +3954,8 @@ var Popover = { render: function render() {
methods: {
show: function show() {
+ var _this2 = this;
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
event = _ref.event,
_ref$skipDelay = _ref.skipDelay,
@@ -3873,6 +3968,10 @@ var Popover = { render: function render() {
this.$emit('show');
}
this.$emit('update:open', true);
+ this.$_beingShowed = true;
+ requestAnimationFrame(function () {
+ _this2.$_beingShowed = false;
+ });
},
hide: function hide() {
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
@@ -3898,6 +3997,8 @@ var Popover = { render: function render() {
}
}
this.$_mounted = false;
+ this.popperInstance = null;
+ this.isOpen = false;
this.$emit('dispose');
},
@@ -3923,7 +4024,7 @@ var Popover = { render: function render() {
if (this.popperInstance) {
this.isOpen = true;
this.popperInstance.enableEventListeners();
- this.popperInstance.update();
+ this.popperInstance.scheduleUpdate();
}
if (!this.$_mounted) {
@@ -3966,7 +4067,7 @@ var Popover = { render: function render() {
// Fix position
requestAnimationFrame(function () {
if (!_this3.$_isDisposed && _this3.popperInstance) {
- _this3.popperInstance.update();
+ _this3.popperInstance.scheduleUpdate();
// Show the tooltip
requestAnimationFrame(function () {
@@ -3995,6 +4096,8 @@ var Popover = { render: function render() {
}
openPopovers.push(this);
+
+ this.$emit('apply-show');
},
$_hide: function $_hide() {
var _this4 = this;
@@ -4026,6 +4129,8 @@ var Popover = { render: function render() {
}
}, disposeTime);
}
+
+ this.$emit('apply-hide');
},
$_findContainer: function $_findContainer(container, reference) {
// if container is a query, get the relative element
@@ -4152,10 +4257,10 @@ var Popover = { render: function render() {
var reference = this.$refs.trigger;
var popoverNode = this.$refs.popover;
- var relatedreference = event.relatedreference || event.toElement;
+ var relatedreference = event.relatedreference || event.toElement || event.relatedTarget;
var callback = function callback(event2) {
- var relatedreference2 = event2.relatedreference || event2.toElement;
+ var relatedreference2 = event2.relatedreference || event2.toElement || event2.relatedTarget;
// Remove event listener after call
popoverNode.removeEventListener(event.type, callback);
@@ -4186,18 +4291,19 @@ var Popover = { render: function render() {
this.$_events = [];
},
$_updatePopper: function $_updatePopper(cb) {
- if (this.isOpen && this.popperInstance) {
+ if (this.popperInstance) {
cb();
- this.popperInstance.update();
+ if (this.isOpen) this.popperInstance.scheduleUpdate();
}
},
$_restartPopper: function $_restartPopper() {
if (this.popperInstance) {
var isOpen = this.isOpen;
this.dispose();
+ this.$_isDisposed = false;
this.$_init();
if (isOpen) {
- this.show();
+ this.show({ skipDelay: true, force: true });
}
}
},
@@ -4206,6 +4312,8 @@ var Popover = { render: function render() {
var touch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+ if (this.$_beingShowed) return;
+
this.hide({ event: event });
if (event.closePopover) {
@@ -4223,7 +4331,7 @@ var Popover = { render: function render() {
},
$_handleResize: function $_handleResize() {
if (this.isOpen && this.popperInstance) {
- this.popperInstance.update();
+ this.popperInstance.scheduleUpdate();
this.$emit('resize');
}
}
@@ -4233,10 +4341,11 @@ var Popover = { render: function render() {
if (typeof document !== 'undefined' && typeof window !== 'undefined') {
if (isIOS) {
document.addEventListener('touchend', handleGlobalTouchend, supportsPassive ? {
- passive: true
- } : false);
+ passive: true,
+ capture: true
+ } : true);
} else {
- window.addEventListener('click', handleGlobalClick);
+ window.addEventListener('click', handleGlobalClick, true);
}
}
@@ -4251,14 +4360,19 @@ function handleGlobalTouchend(event) {
function handleGlobalClose(event) {
var touch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var popover = void 0;
- for (var i = 0; i < openPopovers.length; i++) {
- popover = openPopovers[i];
- var contains = popover.$refs.popover.contains(event.target);
- if (event.closeAllPopover || event.closePopover && contains || popover.autoHide && !contains) {
- popover.$_handleGlobalClose(event, touch);
+ // Delay so that close directive has time to set values
+ requestAnimationFrame(function () {
+ var popover = void 0;
+ for (var i = 0; i < openPopovers.length; i++) {
+ popover = openPopovers[i];
+ if (popover.$refs.popover) {
+ var contains = popover.$refs.popover.contains(event.target);
+ if (event.closeAllPopover || event.closePopover && contains || popover.autoHide && !contains) {
+ popover.$_handleGlobalClose(event, touch);
+ }
+ }
}
- }
+ });
}
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -4273,9 +4387,9 @@ function createCommonjsModule(fn, module) {
var lodash_merge = createCommonjsModule(function (module, exports) {
/**
- * lodash (Custom Build)
+ * Lodash (Custom Build)
* Build: `lodash modularize exports="npm" -o ./`
- * Copyright jQuery Foundation and other contributors
+ * Copyright JS Foundation and other contributors
* Released under MIT license
* Based on Underscore.js 1.8.3
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
@@ -4287,12 +4401,17 @@ var LARGE_ARRAY_SIZE = 200;
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
+/** Used to detect hot functions by number of calls within a span of milliseconds. */
+var HOT_COUNT = 800,
+ HOT_SPAN = 16;
+
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
+ asyncTag = '[object AsyncFunction]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
@@ -4300,12 +4419,13 @@ var argsTag = '[object Arguments]',
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]';
var arrayBufferTag = '[object ArrayBuffer]',
@@ -4326,9 +4446,6 @@ var arrayBufferTag = '[object ArrayBuffer]',
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
-/** Used to match `RegExp` flags from their coerced string values. */
-var reFlags = /\w*$/;
-
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
@@ -4351,22 +4468,6 @@ 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;
-
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
@@ -4391,41 +4492,13 @@ var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
- return freeProcess && freeProcess.binding('util');
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
-/**
- * Adds the key-value `pair` to `map`.
- *
- * @private
- * @param {Object} map The map to modify.
- * @param {Array} pair The key-value pair to add.
- * @returns {Object} Returns `map`.
- */
-function addMapEntry(map, pair) {
- // Don't return `map.set` because it's not chainable in IE 11.
- map.set(pair[0], pair[1]);
- return map;
-}
-
-/**
- * Adds `value` to `set`.
- *
- * @private
- * @param {Object} set The set to modify.
- * @param {*} value The value to add.
- * @returns {Object} Returns `set`.
- */
-function addSetEntry(set, value) {
- // Don't return `set.add` because it's not chainable in IE 11.
- set.add(value);
- return set;
-}
-
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
@@ -4446,71 +4519,6 @@ function apply(func, thisArg, args) {
return func.apply(thisArg, args);
}
-/**
- * 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 ? array.length : 0;
-
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
-}
-
-/**
- * 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 ? array.length : 0;
-
- if (initAccum && length) {
- accumulator = array[++index];
- }
- while (++index < length) {
- accumulator = iteratee(accumulator, array[index], index, array);
- }
- return accumulator;
-}
-
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
@@ -4555,42 +4563,6 @@ function getValue(object, key) {
return object == null ? undefined : object[key];
}
-/**
- * Checks if `value` is a host object in IE < 9.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
- */
-function isHostObject(value) {
- // Many host objects are `Object` objects that can coerce to strings
- // despite having improperly defined `toString` methods.
- var result = false;
- if (value != null && typeof value.toString != 'function') {
- try {
- result = !!(value + '');
- } catch (e) {}
- }
- 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.
*
@@ -4606,20 +4578,17 @@ function overArg(func, transform) {
}
/**
- * Converts `set` to an array of its values.
+ * Gets the value at `key`, unless `key` is "__proto__".
*
* @private
- * @param {Object} set The set to convert.
- * @returns {Array} Returns the values.
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the property to get.
+ * @returns {*} Returns the property value.
*/
-function setToArray(set) {
- var index = -1,
- result = Array(set.size);
-
- set.forEach(function(value) {
- result[++index] = value;
- });
- return result;
+function safeGet(object, key) {
+ return key == '__proto__'
+ ? undefined
+ : object[key];
}
/** Used for built-in method references. */
@@ -4630,27 +4599,27 @@ var arrayProto = Array.prototype,
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
-/** 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 decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
-/** Used to infer the `Object` constructor. */
-var objectCtorString = funcToString.call(Object);
+/** 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 objectToString = objectProto.toString;
+var nativeObjectToString = objectProto.toString;
+
+/** Used to infer the `Object` constructor. */
+var objectCtorString = funcToString.call(Object);
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
@@ -4662,35 +4631,53 @@ var reIsNative = RegExp('^' +
var Buffer = moduleExports ? root.Buffer : undefined,
Symbol = root.Symbol,
Uint8Array = root.Uint8Array,
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
getPrototype = overArg(Object.getPrototypeOf, Object),
objectCreate = Object.create,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
- splice = arrayProto.splice;
+ splice = arrayProto.splice,
+ symToStringTag = Symbol ? Symbol.toStringTag : undefined;
+
+var defineProperty = (function() {
+ try {
+ var func = getNative(Object, 'defineProperty');
+ func({}, '', {});
+ return func;
+ } catch (e) {}
+}());
/* Built-in method references for those with the same name as other `lodash` methods. */
-var nativeGetSymbols = Object.getOwnPropertySymbols,
- nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
- nativeKeys = overArg(Object.keys, Object),
- nativeMax = Math.max;
+var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
+ nativeMax = Math.max,
+ nativeNow = Date.now;
/* Built-in method references that are verified to be native. */
-var DataView = getNative(root, 'DataView'),
- Map = getNative(root, 'Map'),
- Promise = getNative(root, 'Promise'),
- Set = getNative(root, 'Set'),
- WeakMap = getNative(root, 'WeakMap'),
+var Map = getNative(root, 'Map'),
nativeCreate = getNative(Object, 'create');
-/** 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;
+/**
+ * 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;
+ };
+}());
/**
* Creates a hash object.
@@ -4701,7 +4688,7 @@ var symbolProto = Symbol ? Symbol.prototype : undefined,
*/
function Hash(entries) {
var index = -1,
- length = entries ? entries.length : 0;
+ length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
@@ -4719,6 +4706,7 @@ function Hash(entries) {
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
+ this.size = 0;
}
/**
@@ -4732,7 +4720,9 @@ function hashClear() {
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
- return this.has(key) && delete this.__data__[key];
+ var result = this.has(key) && delete this.__data__[key];
+ this.size -= result ? 1 : 0;
+ return result;
}
/**
@@ -4764,7 +4754,7 @@ function hashGet(key) {
*/
function hashHas(key) {
var data = this.__data__;
- return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
+ return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}
/**
@@ -4779,6 +4769,7 @@ function hashHas(key) {
*/
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;
}
@@ -4799,7 +4790,7 @@ Hash.prototype.set = hashSet;
*/
function ListCache(entries) {
var index = -1,
- length = entries ? entries.length : 0;
+ length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
@@ -4817,6 +4808,7 @@ function ListCache(entries) {
*/
function listCacheClear() {
this.__data__ = [];
+ this.size = 0;
}
/**
@@ -4841,6 +4833,7 @@ function listCacheDelete(key) {
} else {
splice.call(data, index, 1);
}
+ --this.size;
return true;
}
@@ -4888,6 +4881,7 @@ function listCacheSet(key, value) {
index = assocIndexOf(data, key);
if (index < 0) {
+ ++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
@@ -4911,7 +4905,7 @@ ListCache.prototype.set = listCacheSet;
*/
function MapCache(entries) {
var index = -1,
- length = entries ? entries.length : 0;
+ length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
@@ -4928,6 +4922,7 @@ function MapCache(entries) {
* @memberOf MapCache
*/
function mapCacheClear() {
+ this.size = 0;
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
@@ -4945,7 +4940,9 @@ function mapCacheClear() {
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
- return getMapData(this, key)['delete'](key);
+ var result = getMapData(this, key)['delete'](key);
+ this.size -= result ? 1 : 0;
+ return result;
}
/**
@@ -4985,7 +4982,11 @@ function mapCacheHas(key) {
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
- getMapData(this, key).set(key, value);
+ var data = getMapData(this, key),
+ size = data.size;
+
+ data.set(key, value);
+ this.size += data.size == size ? 0 : 1;
return this;
}
@@ -5004,7 +5005,8 @@ MapCache.prototype.set = mapCacheSet;
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
- this.__data__ = new ListCache(entries);
+ var data = this.__data__ = new ListCache(entries);
+ this.size = data.size;
}
/**
@@ -5016,6 +5018,7 @@ function Stack(entries) {
*/
function stackClear() {
this.__data__ = new ListCache;
+ this.size = 0;
}
/**
@@ -5028,7 +5031,11 @@ function stackClear() {
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
- return this.__data__['delete'](key);
+ var data = this.__data__,
+ result = data['delete'](key);
+
+ this.size = data.size;
+ return result;
}
/**
@@ -5068,16 +5075,18 @@ function stackHas(key) {
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
- var cache = this.__data__;
- if (cache instanceof ListCache) {
- var pairs = cache.__data__;
+ 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;
}
- cache = this.__data__ = new MapCache(pairs);
+ data = this.__data__ = new MapCache(pairs);
}
- cache.set(key, value);
+ data.set(key, value);
+ this.size = data.size;
return this;
}
@@ -5097,18 +5106,26 @@ Stack.prototype.set = stackSet;
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
- // Safari 9 makes `arguments.length` enumerable in strict mode.
- var result = (isArray(value) || isArguments(value))
- ? baseTimes(value.length, String)
- : [];
-
- var length = result.length,
- skipIndexes = !!length;
+ 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 && (key == 'length' || isIndex(key, length)))) {
+ !(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);
}
}
@@ -5126,8 +5143,8 @@ function arrayLikeKeys(value, inherited) {
*/
function assignMergeValue(object, key, value) {
if ((value !== undefined && !eq(object[key], value)) ||
- (typeof key == 'number' && value === undefined && !(key in object))) {
- object[key] = value;
+ (value === undefined && !(key in object))) {
+ baseAssignValue(object, key, value);
}
}
@@ -5145,7 +5162,7 @@ function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
- object[key] = value;
+ baseAssignValue(object, key, value);
}
}
@@ -5168,130 +5185,65 @@ function assocIndexOf(array, key) {
}
/**
- * The base implementation of `_.assign` without support for multiple sources
- * or `customizer` functions.
+ * The base implementation of `assignValue` and `assignMergeValue` without
+ * value checks.
*
* @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
*/
-function baseAssign(object, source) {
- return object && copyObject(source, keys(source), object);
+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 `_.clone` and `_.cloneDeep` which tracks
- * traversed objects.
+ * 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 {*} value The value to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @param {boolean} [isFull] Specify a clone including 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, isDeep, isFull, customizer, key, object, stack) {
- var result;
- 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)) {
- if (isHostObject(value)) {
- return object ? value : {};
- }
- result = initCloneObject(isFunc ? {} : value);
- if (!isDeep) {
- return copySymbols(value, baseAssign(result, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object ? value : {};
- }
- result = initCloneByTag(value, tag, baseClone, 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 (!isArr) {
- var props = isFull ? getAllKeys(value) : keys(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, isDeep, isFull, customizer, key, value, stack));
- });
- return result;
-}
+ * @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();
/**
- * The base implementation of `_.create` without support for assigning
- * properties to the created object.
+ * The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
- * @param {Object} prototype The object to inherit from.
- * @returns {Object} Returns the new object.
- */
-function baseCreate(proto) {
- return isObject(proto) ? objectCreate(proto) : {};
-}
-
-/**
- * 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.
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
*/
-function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result = keysFunc(object);
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
+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 `getTag`.
+ * The base implementation of `_.isArguments`.
*
* @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
*/
-function baseGetTag(value) {
- return objectToString.call(value);
+function baseIsArguments(value) {
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
}
/**
@@ -5306,7 +5258,7 @@ function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
- var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
@@ -5319,27 +5271,7 @@ function baseIsNative(value) {
*/
function baseIsTypedArray(value) {
return isObjectLike(value) &&
- isLength(value.length) && !!typedArrayTags[objectToString.call(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;
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}
/**
@@ -5379,21 +5311,14 @@ function baseMerge(object, source, srcIndex, customizer, stack) {
if (object === source) {
return;
}
- if (!(isArray(source) || isTypedArray(source))) {
- var props = baseKeysIn(source);
- }
- arrayEach(props || source, function(srcValue, key) {
- if (props) {
- key = srcValue;
- srcValue = source[key];
- }
+ baseFor(source, function(srcValue, key) {
if (isObject(srcValue)) {
stack || (stack = new Stack);
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
}
else {
var newValue = customizer
- ? customizer(object[key], srcValue, (key + ''), object, source, stack)
+ ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
: undefined;
if (newValue === undefined) {
@@ -5401,7 +5326,7 @@ function baseMerge(object, source, srcIndex, customizer, stack) {
}
assignMergeValue(object, key, newValue);
}
- });
+ }, keysIn);
}
/**
@@ -5420,8 +5345,8 @@ function baseMerge(object, source, srcIndex, customizer, stack) {
* counterparts.
*/
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
- var objValue = object[key],
- srcValue = source[key],
+ var objValue = safeGet(object, key),
+ srcValue = safeGet(source, key),
stacked = stack.get(srcValue);
if (stacked) {
@@ -5435,29 +5360,37 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta
var isCommon = newValue === undefined;
if (isCommon) {
+ var isArr = isArray(srcValue),
+ isBuff = !isArr && isBuffer(srcValue),
+ isTyped = !isArr && !isBuff && isTypedArray(srcValue);
+
newValue = srcValue;
- if (isArray(srcValue) || isTypedArray(srcValue)) {
+ if (isArr || isBuff || isTyped) {
if (isArray(objValue)) {
newValue = objValue;
}
else if (isArrayLikeObject(objValue)) {
newValue = copyArray(objValue);
}
- else {
+ else if (isBuff) {
+ isCommon = false;
+ newValue = cloneBuffer(srcValue, true);
+ }
+ else if (isTyped) {
isCommon = false;
- newValue = baseClone(srcValue, true);
+ newValue = cloneTypedArray(srcValue, true);
+ }
+ else {
+ newValue = [];
}
}
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
+ newValue = objValue;
if (isArguments(objValue)) {
newValue = toPlainObject(objValue);
}
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
- isCommon = false;
- newValue = baseClone(srcValue, true);
- }
- else {
- newValue = objValue;
+ newValue = initCloneObject(srcValue);
}
}
else {
@@ -5482,26 +5415,26 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
- 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] = array;
- return apply(func, this, otherArgs);
- };
+ return setToString(overRest(func, start, identity), 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
+ });
+};
+
/**
* Creates a clone of `buffer`.
*
@@ -5514,7 +5447,9 @@ function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
- var result = new buffer.constructor(buffer.length);
+ var length = buffer.length,
+ result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
+
buffer.copy(result);
return result;
}
@@ -5532,71 +5467,6 @@ function cloneArrayBuffer(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 `map`.
- *
- * @private
- * @param {Object} map The map to clone.
- * @param {Function} cloneFunc The function to clone values.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned map.
- */
-function cloneMap(map, isDeep, cloneFunc) {
- var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
- return arrayReduce(array, addMapEntry, new map.constructor);
-}
-
-/**
- * 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 `set`.
- *
- * @private
- * @param {Object} set The set to clone.
- * @param {Function} cloneFunc The function to clone values.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned set.
- */
-function cloneSet(set, isDeep, cloneFunc) {
- var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
- return arrayReduce(array, addSetEntry, new set.constructor);
-}
-
-/**
- * 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`.
*
@@ -5640,6 +5510,7 @@ function copyArray(source, array) {
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object, customizer) {
+ var isNew = !object;
object || (object = {});
var index = -1,
@@ -5652,23 +5523,18 @@ function copyObject(source, props, object, customizer) {
? customizer(object[key], source[key], key, object, source)
: undefined;
- assignValue(object, key, newValue === undefined ? source[key] : newValue);
+ if (newValue === undefined) {
+ newValue = source[key];
+ }
+ if (isNew) {
+ baseAssignValue(object, key, newValue);
+ } else {
+ assignValue(object, key, newValue);
+ }
}
return object;
}
-/**
- * Copies own symbol properties 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);
-}
-
/**
* Creates a function like `_.assign`.
*
@@ -5703,14 +5569,27 @@ function createAssigner(assigner) {
}
/**
- * Creates an array of own enumerable property names and symbols of `object`.
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
*
* @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names and symbols.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
*/
-function getAllKeys(object) {
- return baseGetAllKeys(object, keys, getSymbols);
+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;
+ };
}
/**
@@ -5742,63 +5621,28 @@ function getNative(object, key) {
}
/**
- * Creates an array of the own enumerable symbol properties of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
-var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
-
-/**
- * Gets the `toStringTag` of `value`.
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
+ * @returns {string} Returns the raw `toStringTag`.
*/
-var getTag = baseGetTag;
-
-// Fallback for data views, maps, sets, and weak maps in IE 11,
-// for data views in Edge < 14, and promises in Node.js.
-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 = objectToString.call(value),
- Ctor = result == objectTag ? value.constructor : undefined,
- ctorString = Ctor ? toSource(Ctor) : undefined;
-
- 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;
- };
-}
+function getRawTag(value) {
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
+ tag = value[symToStringTag];
-/**
- * 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 = array.constructor(length);
+ try {
+ value[symToStringTag] = undefined;
+ var unmasked = true;
+ } catch (e) {}
- // Add properties assigned by `RegExp#exec`.
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
- result.index = array.index;
- result.input = array.input;
+ var result = nativeObjectToString.call(value);
+ if (unmasked) {
+ if (isOwn) {
+ value[symToStringTag] = tag;
+ } else {
+ delete value[symToStringTag];
+ }
}
return result;
}
@@ -5816,55 +5660,6 @@ function initCloneObject(object) {
: {};
}
-/**
- * Initializes an object clone based on its `toStringTag`.
- *
- * **Note:** This function only supports cloning values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to clone.
- * @param {string} tag The `toStringTag` of the object to clone.
- * @param {Function} cloneFunc The function to clone values.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the initialized clone.
- */
-function initCloneByTag(object, tag, cloneFunc, 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 cloneMap(object, isDeep, cloneFunc);
-
- case numberTag:
- case stringTag:
- return new Ctor(object);
-
- case regexpTag:
- return cloneRegExp(object);
-
- case setTag:
- return cloneSet(object, isDeep, cloneFunc);
-
- case symbolTag:
- return cloneSymbol(object);
- }
-}
-
/**
* Checks if `value` is a valid array-like index.
*
@@ -5874,10 +5669,13 @@ function initCloneByTag(object, tag, cloneFunc, isDeep) {
* @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 &&
- (typeof value == 'number' || reIsUint.test(value)) &&
- (value > -1 && value % 1 == 0 && value < length);
+ (type == 'number' ||
+ (type != 'symbol' && reIsUint.test(value))) &&
+ (value > -1 && value % 1 == 0 && value < length);
}
/**
@@ -5962,11 +5760,91 @@ function nativeKeysIn(object) {
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);
+ };
+}
+
+/**
+ * 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);
+
+/**
+ * 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);
+ };
+}
+
/**
* Converts `func` to its source code.
*
* @private
- * @param {Function} func The function to process.
+ * @param {Function} func The function to convert.
* @returns {string} Returns the source code.
*/
function toSource(func) {
@@ -6035,11 +5913,10 @@ function eq(value, other) {
* _.isArguments([1, 2, 3]);
* // => false
*/
-function isArguments(value) {
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
- return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
- (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
-}
+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.
@@ -6161,10 +6038,13 @@ var isBuffer = nativeIsBuffer || stubFalse;
* // => false
*/
function isFunction(value) {
+ if (!isObject(value)) {
+ return false;
+ }
// The use of `Object#toString` avoids issues with the `typeof` operator
- // in Safari 8-9 which returns 'object' for typed array and other constructors.
- var tag = isObject(value) ? objectToString.call(value) : '';
- return tag == funcTag || tag == genTag;
+ // 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;
}
/**
@@ -6225,7 +6105,7 @@ function isLength(value) {
*/
function isObject(value) {
var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
+ return value != null && (type == 'object' || type == 'function');
}
/**
@@ -6253,7 +6133,7 @@ function isObject(value) {
* // => false
*/
function isObjectLike(value) {
- return !!value && typeof value == 'object';
+ return value != null && typeof value == 'object';
}
/**
@@ -6285,8 +6165,7 @@ function isObjectLike(value) {
* // => true
*/
function isPlainObject(value) {
- if (!isObjectLike(value) ||
- objectToString.call(value) != objectTag || isHostObject(value)) {
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
@@ -6294,8 +6173,8 @@ function isPlainObject(value) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
- return (typeof Ctor == 'function' &&
- Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
+ return typeof Ctor == 'function' && Ctor instanceof Ctor &&
+ funcToString.call(Ctor) == objectCtorString;
}
/**
@@ -6345,38 +6224,6 @@ function toPlainObject(value) {
return copyObject(value, keysIn(value));
}
-/**
- * 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`.
*
@@ -6440,25 +6287,48 @@ var merge = createAssigner(function(object, source, srcIndex) {
});
/**
- * This method returns a new empty array.
+ * Creates a function that returns `value`.
*
* @static
* @memberOf _
- * @since 4.13.0
+ * @since 2.4.0
* @category Util
- * @returns {Array} Returns the new empty array.
+ * @param {*} value The value to return from the new function.
+ * @returns {Function} Returns the new constant function.
* @example
*
- * var arrays = _.times(2, _.stubArray);
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
*
- * console.log(arrays);
- * // => [[], []]
+ * console.log(objects);
+ * // => [{ 'a': 1 }, { 'a': 1 }]
*
- * console.log(arrays[0] === arrays[1]);
- * // => false
+ * console.log(objects[0] === objects[1]);
+ * // => true
+ */
+function constant(value) {
+ return function() {
+ return value;
+ };
+}
+
+/**
+ * This method returns the first argument it receives.
+ *
+ * @static
+ * @since 0.1.0
+ * @memberOf _
+ * @category Util
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'a': 1 };
+ *
+ * console.log(_.identity(object) === object);
+ * // => true
*/
-function stubArray() {
- return [];
+function identity(value) {
+ return value;
}
/**
diff --git a/package.json b/package.json
index 3267d79e..b48f8d1c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "v-tooltip",
- "version": "2.0.0-rc.31",
+ "version": "2.0.0-rc.32",
"description": "Easy tooltips with Vue 2.x",
"main": "dist/v-tooltip.umd.js",
"module": "dist/v-tooltip.esm.js",