primevue
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/primevue)
1 lines • 11.4 kB
JavaScript
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["dock"]=t():e["dock"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({2350:function(e,t){function n(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"===typeof btoa){var i=r(o),c=o.sources.map((function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"}));return[n].concat(c).concat([i]).join("\n")}return[n].join("\n")}function r(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,"+t;return"/*# "+n+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=n(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r})).join("")},t.i=function(e,n){"string"===typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"===typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var c=e[o];"number"===typeof c[0]&&r[c[0]]||(n&&!c[2]?c[2]=n:n&&(c[2]="("+c[2]+") and ("+n+")"),t.push(c))}},t}},"499e":function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],c=i[0],s=i[1],a=i[2],l=i[3],u={id:e+":"+o,css:s,media:a,sourceMap:l};r[c]?r[c].parts.push(u):n.push(r[c]={id:c,parts:[u]})}return n}n.r(t),n.d(t,"default",(function(){return m}));var o="undefined"!==typeof document;if("undefined"!==typeof DEBUG&&DEBUG&&!o)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var i={},c=o&&(document.head||document.getElementsByTagName("head")[0]),s=null,a=0,l=!1,u=function(){},d=null,p="data-vue-ssr-id",f="undefined"!==typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function m(e,t,n,o){l=n,d=o||{};var c=r(e,t);return b(c),function(t){for(var n=[],o=0;o<c.length;o++){var s=c[o],a=i[s.id];a.refs--,n.push(a)}t?(c=r(e,t),b(c)):c=[];for(o=0;o<n.length;o++){a=n[o];if(0===a.refs){for(var l=0;l<a.parts.length;l++)a.parts[l]();delete i[a.id]}}}}function b(e){for(var t=0;t<e.length;t++){var n=e[t],r=i[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(v(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var c=[];for(o=0;o<n.parts.length;o++)c.push(v(n.parts[o]));i[n.id]={id:n.id,refs:1,parts:c}}}}function h(){var e=document.createElement("style");return e.type="text/css",c.appendChild(e),e}function v(e){var t,n,r=document.querySelector("style["+p+'~="'+e.id+'"]');if(r){if(l)return u;r.parentNode.removeChild(r)}if(f){var o=a++;r=s||(s=h()),t=g.bind(null,r,o,!1),n=g.bind(null,r,o,!0)}else r=h(),t=x.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}var k=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function g(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=k(t,o);else{var i=document.createTextNode(o),c=e.childNodes;c[t]&&e.removeChild(c[t]),c.length?e.insertBefore(i,c[t]):e.appendChild(i)}}function x(e,t){var n=t.css,r=t.media,o=t.sourceMap;if(r&&e.setAttribute("media",r),d.ssrId&&e.setAttribute(p,t.id),o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{while(e.firstChild)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},bc3d:function(e,t,n){"use strict";n("bd49")},bd49:function(e,t,n){var r=n("e7ef");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var o=n("499e").default;o("7629d807",r,!0,{sourceMap:!1,shadowMode:!1})},e7ef:function(e,t,n){t=e.exports=n("2350")(!1),t.push([e.i,".p-dock{position:absolute;z-index:1;pointer-events:none}.p-dock,.p-dock-list{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.p-dock-list{margin:0;padding:0;list-style:none;pointer-events:auto}.p-dock-item{-webkit-transition:all .2s cubic-bezier(.4,0,.2,1);transition:all .2s cubic-bezier(.4,0,.2,1);will-change:transform}.p-dock-action{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:relative;overflow:hidden;cursor:default}.p-dock-item-second-next,.p-dock-item-second-prev{-webkit-transform:scale(1.2);transform:scale(1.2)}.p-dock-item-next,.p-dock-item-prev{-webkit-transform:scale(1.4);transform:scale(1.4)}.p-dock-item-current{-webkit-transform:scale(1.6);transform:scale(1.6);z-index:1}.p-dock-top{left:0;top:0;width:100%}.p-dock-top .p-dock-item{-webkit-transform-origin:center top;transform-origin:center top}.p-dock-bottom{left:0;bottom:0;width:100%}.p-dock-bottom .p-dock-item{-webkit-transform-origin:center bottom;transform-origin:center bottom}.p-dock-right{right:0;top:0;height:100%}.p-dock-right .p-dock-item{-webkit-transform-origin:center right;transform-origin:center right}.p-dock-right .p-dock-list{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.p-dock-left{left:0;top:0;height:100%}.p-dock-left .p-dock-item{-webkit-transform-origin:center left;transform-origin:center left}.p-dock-left .p-dock-list{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}",""])},f6fd:function(e,t){(function(e){var t="currentScript",n=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(r){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(e in n)if(n[e].src==t||"interactive"==n[e].readyState)return n[e];return null}}})})(document)},fb15:function(e,t,n){"use strict";var r;(n.r(t),"undefined"!==typeof window)&&(n("f6fd"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.containerClass,style:e.styles},[n("DockSub",{attrs:{model:e.model,templates:e.$scopedSlots}})],1)},i=[],c=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ul",{ref:"list",staticClass:"p-dock-list",attrs:{role:"menu"},on:{mouseleave:e.onListMouseLeave}},e._l(e.model,(function(t,r){return n("li",{key:r,class:e.itemClass(r),attrs:{role:"none"},on:{mouseenter:function(t){return e.onItemMouseEnter(r)}}},[e.templates["item"]?n("DockSubTemplate",{attrs:{item:t,template:e.templates["item"]}}):[t.to&&!t.disabled?n("router-link",{attrs:{to:t.to,custom:""},scopedSlots:e._u([{key:"default",fn:function(r){var o=r.href;return[n("a",{class:["p-dock-action",{"p-disabled":t.disabled}],attrs:{href:o,role:"menuitem",target:t.target,"data-pr-tooltip":t.label},on:{click:function(n){return e.onItemClick(e.e,t)}}},["string"===typeof t.icon?[n("span",{directives:[{name:"ripple",rawName:"v-ripple"}],class:["p-dock-action-icon",t.icon]})]:n("DockSubIconTemplate",{attrs:{icon:t.icon}})],2)]}}],null,!0)}):n("a",{class:["p-dock-action",{"p-disabled":t.disabled}],attrs:{href:t.url||"#",role:"menuitem",target:t.target,"data-pr-tooltip":t.label},on:{click:function(n){return e.onItemClick(n,t)}}},["string"===typeof t.icon?[n("span",{directives:[{name:"ripple",rawName:"v-ripple"}],class:["p-dock-action-icon",t.icon]})]:n("DockSubIconTemplate",{attrs:{icon:t.icon}})],2)]],2)})),0)},s=[],a={functional:!0,props:{icon:{type:null,default:null}},render:function(e,t){return[t.props["icon"]()]}},l={functional:!0,props:{item:{type:null,default:null},template:{type:null,default:null}},render:function(e,t){var n=t.props.template({item:t.props.item});return[n]}},u={name:"DockSub",props:{model:{type:Array,default:null},templates:{type:null,default:null}},data:function(){return{currentIndex:-3}},methods:{onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(e){this.currentIndex=e},onItemClick:function(e,t){t.command&&t.command({originalEvent:e,item:t}),e.preventDefault()},itemClass:function(e){return["p-dock-item",{"p-dock-item-second-prev":this.currentIndex-2===e,"p-dock-item-prev":this.currentIndex-1===e,"p-dock-item-current":this.currentIndex===e,"p-dock-item-next":this.currentIndex+1===e,"p-dock-item-second-next":this.currentIndex+2===e}]}},components:{DockSubIconTemplate:a,DockSubTemplate:l}},d=u;function p(e,t,n,r,o,i,c,s){var a,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),c?(a=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(c)},l._ssrRegister=a):o&&(a=s?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),a)if(l.functional){l._injectStyles=a;var u=l.render;l.render=function(e,t){return a.call(t),u(e,t)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,a):[a]}return{exports:e,options:l}}var f=p(d,c,s,!1,null,null,null),m=f.exports,b={name:"Dock",props:{position:{type:String,default:"bottom"},model:null,className:null,styles:null},data:function(){return{currentIndex:-3}},methods:{onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(e){this.currentIndex=e},onItemClick:function(e,t){t.command&&t.command({originalEvent:e,item:t}),e.preventDefault()},itemClass:function(e){return["p-dock-item",{"p-dock-item-second-prev":this.currentIndex-2===e,"p-dock-item-prev":this.currentIndex-1===e,"p-dock-item-current":this.currentIndex===e,"p-dock-item-next":this.currentIndex+1===e,"p-dock-item-second-next":this.currentIndex+2===e}]}},computed:{containerClass:function(){return["p-dock p-component","p-dock-".concat(this.position),this.className]}},components:{DockSub:m}},h=b,v=(n("bc3d"),p(h,o,i,!1,null,null,null)),k=v.exports;t["default"]=k}})["default"]}));