From 27caef1971a14ddf6450b1034ec54a6c095c27f3 Mon Sep 17 00:00:00 2001 From: Igor Ognichenko Date: Wed, 8 Aug 2018 09:52:49 +0300 Subject: [PATCH] build --- dist/js/vue-popper.js | 27 ++++++++++++++++++--------- dist/js/vue-popper.min.js | 2 +- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/dist/js/vue-popper.js b/dist/js/vue-popper.js index 916ba59..e75426f 100644 --- a/dist/js/vue-popper.js +++ b/dist/js/vue-popper.js @@ -115,6 +115,12 @@ }, immediate: true + }, + + disabled: function disabled(value) { + if (!value) { + this.showPopper = false; + } } }, @@ -134,9 +140,13 @@ break; case 'hover': on(this.referenceElm, 'mouseover', this.onMouseOver); + on(this.referenceElm, 'focus', this.onMouseOver); on(this.popper, 'mouseover', this.onMouseOver); + on(this.popper, 'focus', this.onMouseOver); on(this.referenceElm, 'mouseout', this.onMouseOut); + on(this.referenceElm, 'blur', this.onMouseOut); on(this.popper, 'mouseout', this.onMouseOut); + on(this.popper, 'blur', this.onMouseOut); break; } }, @@ -275,6 +285,7 @@ } }; + /* script */ var __vue_script__ = script; /* template */ @@ -302,11 +313,10 @@ var __vue_staticRenderFns__ = []; __vue_render__._withStripped = true; - var __vue_template__ = typeof __vue_render__ !== 'undefined' ? { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ } : {}; /* style */ - var __vue_inject_styles__ = function (inject) { + var __vue_inject_styles__ = function __vue_inject_styles__(inject) { if (!inject) return; - inject("data-v-337baefc_0", { source: "\n.popper {\n width: auto;\n background-color: #fafafa;\n color: #212121;\n text-align: center;\n padding: 2px;\n display: inline-block;\n border-radius: 3px;\n position: absolute;\n font-size: 14px;\n font-weight: normal;\n border: 1px #ebebeb solid;\n z-index: 200000;\n -moz-box-shadow: rgb(58, 58, 58) 0 0 6px 0;\n -webkit-box-shadow: rgb(58, 58, 58) 0 0 6px 0;\n box-shadow: rgb(58, 58, 58) 0 0 6px 0;\n}\n.popper .popper__arrow {\n width: 0;\n height: 0;\n border-style: solid;\n position: absolute;\n margin: 5px;\n}\n.popper[x-placement^=\"top\"] {\n margin-bottom: 5px;\n}\n.popper[x-placement^=\"top\"] .popper__arrow {\n border-width: 5px 5px 0 5px;\n border-color: #fafafa transparent transparent transparent;\n bottom: -5px;\n left: calc(50% - 5px);\n margin-top: 0;\n margin-bottom: 0;\n}\n.popper[x-placement^=\"bottom\"] {\n margin-top: 5px;\n}\n.popper[x-placement^=\"bottom\"] .popper__arrow {\n border-width: 0 5px 5px 5px;\n border-color: transparent transparent #fafafa transparent;\n top: -5px;\n left: calc(50% - 5px);\n margin-top: 0;\n margin-bottom: 0;\n}\n.popper[x-placement^=\"right\"] {\n margin-left: 5px;\n}\n.popper[x-placement^=\"right\"] .popper__arrow {\n border-width: 5px 5px 5px 0;\n border-color: transparent #fafafa transparent transparent;\n left: -5px;\n top: calc(50% - 5px);\n margin-left: 0;\n margin-right: 0;\n}\n.popper[x-placement^=\"left\"] {\n margin-right: 5px;\n}\n.popper[x-placement^=\"left\"] .popper__arrow {\n border-width: 5px 0 5px 5px;\n border-color: transparent transparent transparent #fafafa;\n right: -5px;\n top: calc(50% - 5px);\n margin-left: 0;\n margin-right: 0;\n}\n", map: undefined, media: undefined }); + inject("data-v-4732e5aa_0", { source: "\n.popper {\n width: auto;\n background-color: #fafafa;\n color: #212121;\n text-align: center;\n padding: 2px;\n display: inline-block;\n border-radius: 3px;\n position: absolute;\n font-size: 14px;\n font-weight: normal;\n border: 1px #ebebeb solid;\n z-index: 200000;\n -moz-box-shadow: rgb(58, 58, 58) 0 0 6px 0;\n -webkit-box-shadow: rgb(58, 58, 58) 0 0 6px 0;\n box-shadow: rgb(58, 58, 58) 0 0 6px 0;\n}\n.popper .popper__arrow {\n width: 0;\n height: 0;\n border-style: solid;\n position: absolute;\n margin: 5px;\n}\n.popper[x-placement^=\"top\"] {\n margin-bottom: 5px;\n}\n.popper[x-placement^=\"top\"] .popper__arrow {\n border-width: 5px 5px 0 5px;\n border-color: #fafafa transparent transparent transparent;\n bottom: -5px;\n left: calc(50% - 5px);\n margin-top: 0;\n margin-bottom: 0;\n}\n.popper[x-placement^=\"bottom\"] {\n margin-top: 5px;\n}\n.popper[x-placement^=\"bottom\"] .popper__arrow {\n border-width: 0 5px 5px 5px;\n border-color: transparent transparent #fafafa transparent;\n top: -5px;\n left: calc(50% - 5px);\n margin-top: 0;\n margin-bottom: 0;\n}\n.popper[x-placement^=\"right\"] {\n margin-left: 5px;\n}\n.popper[x-placement^=\"right\"] .popper__arrow {\n border-width: 5px 5px 5px 0;\n border-color: transparent #fafafa transparent transparent;\n left: -5px;\n top: calc(50% - 5px);\n margin-left: 0;\n margin-right: 0;\n}\n.popper[x-placement^=\"left\"] {\n margin-right: 5px;\n}\n.popper[x-placement^=\"left\"] .popper__arrow {\n border-width: 5px 0 5px 5px;\n border-color: transparent transparent transparent #fafafa;\n right: -5px;\n top: calc(50% - 5px);\n margin-left: 0;\n margin-right: 0;\n}\n", map: { "version": 3, "sources": ["/Users/igor/projects/vue-popper/src/component/popper.js.vue"], "names": [], "mappings": ";AACA;EACA,YAAA;EACA,0BAAA;EACA,eAAA;EACA,mBAAA;EACA,aAAA;EACA,sBAAA;EACA,mBAAA;EACA,mBAAA;EACA,gBAAA;EACA,oBAAA;EACA,0BAAA;EACA,gBAAA;EACA,2CAAA;EACA,8CAAA;EACA,sCAAA;CACA;AAEA;EACA,SAAA;EACA,UAAA;EACA,oBAAA;EACA,mBAAA;EACA,YAAA;CACA;AAEA;EACA,mBAAA;CACA;AAEA;EACA,4BAAA;EACA,0DAAA;EACA,aAAA;EACA,sBAAA;EACA,cAAA;EACA,iBAAA;CACA;AAEA;EACA,gBAAA;CACA;AAEA;EACA,4BAAA;EACA,0DAAA;EACA,UAAA;EACA,sBAAA;EACA,cAAA;EACA,iBAAA;CACA;AAEA;EACA,iBAAA;CACA;AAEA;EACA,4BAAA;EACA,0DAAA;EACA,WAAA;EACA,qBAAA;EACA,eAAA;EACA,gBAAA;CACA;AAEA;EACA,kBAAA;CACA;AAEA;EACA,4BAAA;EACA,0DAAA;EACA,YAAA;EACA,qBAAA;EACA,eAAA;EACA,gBAAA;CACA", "file": "popper.js.vue", "sourcesContent": ["\n\n\n\n\n"] }, media: undefined }); }; /* scoped */ var __vue_scope_id__ = undefined; @@ -316,11 +326,10 @@ var __vue_is_functional_template__ = false; /* component normalizer */ function __vue_normalize__(template, style, script$$1, scope, functional, moduleIdentifier, createInjector, createInjectorSSR) { - var component = script$$1 || {}; + var component = (typeof script$$1 === 'function' ? script$$1.options : script$$1) || {}; - { - component.__file = "/Users/igor/projects/vue-popper/src/component/popper.js.vue"; - } + // For security concerns, we use only base name in production mode. + component.__file = "/Users/igor/projects/vue-popper/src/component/popper.js.vue"; if (!component.render) { component.render = template.render; @@ -361,7 +370,7 @@ /* style inject */ function __vue_create_injector__() { var head = document.head || document.getElementsByTagName('head')[0]; - var styles = {}; + var styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {}); var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); return function addStyle(id, css) { @@ -412,7 +421,7 @@ } /* style inject SSR */ - var VuePopper = __vue_normalize__(__vue_template__, __vue_inject_styles__, typeof __vue_script__ === 'undefined' ? {} : __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, typeof __vue_create_injector__ !== 'undefined' ? __vue_create_injector__ : function () {}, typeof __vue_create_injector_ssr__ !== 'undefined' ? __vue_create_injector_ssr__ : function () {}); + var VuePopper = __vue_normalize__({ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, __vue_create_injector__, undefined); return VuePopper; diff --git a/dist/js/vue-popper.min.js b/dist/js/vue-popper.min.js index 1cb81bc..d31a9e3 100644 --- a/dist/js/vue-popper.min.js +++ b/dist/js/vue-popper.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("popper.js")):"function"==typeof define&&define.amd?define(["popper.js"],t):e.VuePopper=t(e.Popper)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t=Object.assign||function(e){for(var t=1;t-1}},delayOnMouseOver:{type:Number,default:10},delayOnMouseOut:{type:Number,default:10},disabled:{type:Boolean,default:!1},content:String,enterActiveClass:String,leaveActiveClass:String,boundariesSelector:String,reference:{},forceShow:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},visibleArrow:{type:Boolean,default:!0},transition:{type:String,default:""},options:{type:Object,default:function(){return{}}}},data:function(){return{referenceElm:null,popperJS:null,showPopper:!1,currentPlacement:"",popperOptions:{placement:"bottom",gpuAcceleration:!1}}},watch:{showPopper:function(e){e?(this.$emit("show"),this.updatePopper()):this.$emit("hide")},forceShow:{handler:function(e){this[e?"doShow":"doClose"]()},immediate:!0}},created:function(){this.appendedArrow=!1,this.appendedToBody=!1,this.popperOptions=t(this.popperOptions,this.options)},mounted:function(){switch(this.referenceElm=this.reference||this.$slots.reference[0].elm,this.popper=this.$slots.default[0].elm,this.trigger){case"click":o(this.referenceElm,"click",this.doToggle),o(document,"click",this.handleDocumentClick);break;case"hover":o(this.referenceElm,"mouseover",this.onMouseOver),o(this.popper,"mouseover",this.onMouseOver),o(this.referenceElm,"mouseout",this.onMouseOut),o(this.popper,"mouseout",this.onMouseOut)}},methods:{doToggle:function(){this.forceShow||(this.showPopper=!this.showPopper)},doShow:function(){this.showPopper=!0},doClose:function(){this.showPopper=!1},doDestroy:function(){this.showPopper||(this.popperJS&&(this.popperJS.destroy(),this.popperJS=null),this.appendedToBody&&(this.appendedToBody=!1,document.body.removeChild(this.popper.parentElement)))},createPopper:function(){var o=this;this.$nextTick(function(){if(o.visibleArrow&&o.appendArrow(o.popper),o.appendToBody&&!o.appendedToBody&&(o.appendedToBody=!0,document.body.appendChild(o.popper.parentElement)),o.popperJS&&o.popperJS.destroy&&o.popperJS.destroy(),o.boundariesSelector){var r=document.querySelector(o.boundariesSelector);r&&(o.popperOptions.modifiers=t({},o.popperOptions.modifiers),o.popperOptions.modifiers.preventOverflow=t({},o.popperOptions.modifiers.preventOverflow),o.popperOptions.modifiers.preventOverflow.boundariesElement=r)}o.popperOptions.onCreate=function(){o.$emit("created",o),o.$nextTick(o.updatePopper)},o.popperJS=new e(o.referenceElm,o.popper,o.popperOptions)})},destroyPopper:function(){r(this.referenceElm,"click",this.doToggle),r(this.referenceElm,"mouseup",this.doClose),r(this.referenceElm,"mousedown",this.doShow),r(this.referenceElm,"focus",this.doShow),r(this.referenceElm,"blur",this.doClose),r(this.referenceElm,"mouseout",this.onMouseOut),r(this.referenceElm,"mouseover",this.onMouseOver),r(document,"click",this.handleDocumentClick),this.showPopper=!1,this.doDestroy()},appendArrow:function(e){if(!this.appendedArrow){this.appendedArrow=!0;var t=document.createElement("div");t.setAttribute("x-arrow",""),t.className="popper__arrow",e.appendChild(t)}},updatePopper:function(){this.popperJS?this.popperJS.scheduleUpdate():this.createPopper()},onMouseOver:function(){var e=this;clearTimeout(this._timer),this._timer=setTimeout(function(){e.showPopper=!0},this.delayOnMouseOver)},onMouseOut:function(){var e=this;clearTimeout(this._timer),this._timer=setTimeout(function(){e.showPopper=!1},this.delayOnMouseOut)},handleDocumentClick:function(e){this.$el&&this.referenceElm&&!this.elementContains(this.$el,e.target)&&!this.elementContains(this.referenceElm,e.target)&&this.popper&&!this.elementContains(this.popper,e.target)&&(this.$emit("documentClick"),this.forceShow||(this.showPopper=!1))},elementContains:function(e,t){return"function"==typeof e.contains&&e.contains(t)}},destroyed:function(){this.destroyPopper()}},p=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("span",[o("transition",{attrs:{name:e.transition,"enter-active-class":e.enterActiveClass,"leave-active-class":e.leaveActiveClass},on:{"after-leave":e.doDestroy}},[o("span",{directives:[{name:"show",rawName:"v-show",value:!e.disabled&&e.showPopper,expression:"!disabled && showPopper"}],ref:"popper"},[e._t("default",[e._v(e._s(e.content))])],2)]),e._v(" "),e._t("reference")],2)};function i(){var e=document.head||document.getElementsByTagName("head")[0],t={},o="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(r,n){if(!document.querySelector('style[data-vue-ssr-id~="'+r+'"]')){var p=o?n.media||"default":r,i=t[p]||(t[p]={ids:[],parts:[],element:void 0});if(!i.ids.includes(r)){var s=n.source,a=i.ids.length;if(i.ids.push(r),n.map&&(s+="\n/*# sourceURL="+n.map.sources[0]+" */",s+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n.map))))+" */"),o&&(i.element=i.element||document.querySelector("style[data-group="+p+"]")),!i.element){var d=i.element=document.createElement("style");d.type="text/css",n.media&&d.setAttribute("media",n.media),o&&(d.setAttribute("data-group",p),d.setAttribute("data-next-index","0")),e.appendChild(d)}if(o&&(a=parseInt(i.element.getAttribute("data-next-index")),i.element.setAttribute("data-next-index",a+1)),i.element.styleSheet)i.parts.push(s),i.element.styleSheet.cssText=i.parts.filter(Boolean).join("\n");else{var c=document.createTextNode(s),l=i.element.childNodes;l[a]&&i.element.removeChild(l[a]),l.length?i.element.insertBefore(c,l[a]):i.element.appendChild(c)}}}}}return function(e,t,o,r,n,p,i,s){var a=o||{};a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,n&&(a.functional=!0)),a._scopeId=r;var d=void 0;if(t&&(d=function(e){t.call(this,i(e))}),void 0!==d)if(a.functional){var c=a.render;a.render=function(e,t){return d.call(t),c(e,t)}}else{var l=a.beforeCreate;a.beforeCreate=l?[].concat(l,d):[d]}return a}({render:p,staticRenderFns:[]},function(e){e&&e("data-v-9c98f0c4_0",{source:"\n.popper{width:auto;background-color:#fafafa;color:#212121;text-align:center;padding:2px;display:inline-block;border-radius:3px;position:absolute;font-size:14px;font-weight:400;border:1px #ebebeb solid;z-index:200000;-moz-box-shadow:#3a3a3a 0 0 6px 0;-webkit-box-shadow:#3a3a3a 0 0 6px 0;box-shadow:#3a3a3a 0 0 6px 0\n}\n.popper .popper__arrow{width:0;height:0;border-style:solid;position:absolute;margin:5px\n}\n.popper[x-placement^=top]{margin-bottom:5px\n}\n.popper[x-placement^=top] .popper__arrow{border-width:5px 5px 0 5px;border-color:#fafafa transparent transparent transparent;bottom:-5px;left:calc(50% - 5px);margin-top:0;margin-bottom:0\n}\n.popper[x-placement^=bottom]{margin-top:5px\n}\n.popper[x-placement^=bottom] .popper__arrow{border-width:0 5px 5px 5px;border-color:transparent transparent #fafafa transparent;top:-5px;left:calc(50% - 5px);margin-top:0;margin-bottom:0\n}\n.popper[x-placement^=right]{margin-left:5px\n}\n.popper[x-placement^=right] .popper__arrow{border-width:5px 5px 5px 0;border-color:transparent #fafafa transparent transparent;left:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0\n}\n.popper[x-placement^=left]{margin-right:5px\n}\n.popper[x-placement^=left] .popper__arrow{border-width:5px 0 5px 5px;border-color:transparent transparent transparent #fafafa;right:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0\n}",map:void 0,media:void 0})},void 0===n?{}:n,void 0,!1,0,i,"undefined"!=typeof __vue_create_injector_ssr__&&__vue_create_injector_ssr__)}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("popper.js")):"function"==typeof define&&define.amd?define(["popper.js"],t):e.VuePopper=t(e.Popper)}(this,function(o){"use strict";o=o&&o.hasOwnProperty("default")?o.default:o;var r=Object.assign||function(e){for(var t=1;t