UNPKG

primevue

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue) [![Join the chat at https://gitter.im/primefaces/primevu

1 lines 10.1 kB
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["tabview"]=t():e["tabview"]=t()})("undefined"!==typeof self?self:this,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(i,a,function(t){return e[t]}.bind(null,a));return i},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]||"",a=e[3];if(!a)return n;if(t&&"function"===typeof btoa){var r=i(a),o=a.sources.map(function(e){return"/*# sourceURL="+a.sourceRoot+e+" */"});return[n].concat(o).concat([r]).join("\n")}return[n].join("\n")}function i(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 i=n(t,e);return t[2]?"@media "+t[2]+"{"+i+"}":i}).join("")},t.i=function(e,n){"string"===typeof e&&(e=[[null,e,""]]);for(var i={},a=0;a<this.length;a++){var r=this[a][0];"number"===typeof r&&(i[r]=!0)}for(a=0;a<e.length;a++){var o=e[a];"number"===typeof o[0]&&i[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),t.push(o))}},t}},2509:function(e,t,n){t=e.exports=n("2350")(!1),t.push([e.i,'.p-tabview{padding:.25em}.p-tabview .p-tabview-nav{margin:0}.p-tabview .p-tabview-nav:after{content:"";display:table;clear:both}.p-tabview .p-tabview-nav li{list-style:none;float:left;position:relative;margin:0 .125em 1px 0;padding:0;white-space:nowrap}.p-tabview .p-tabview-nav li a{float:left;padding:.5em 1em;text-decoration:none}.p-tabview .p-tabview-nav li.p-disabled a,.p-tabview .p-tabview-nav li.p-state-processing a,.p-tabview .p-tabview-nav li.p-tabview-selected a{cursor:text}.p-tabview.p-tabview-collapsible .p-tabview-nav li.p-tabview-selected a,.p-tabview .p-tabview-nav li a{cursor:pointer}.p-tabview .p-tabview-panel{border-width:0;padding:1em;background:none}.p-tabview .p-tabview-nav li{display:block}.p-tabview .p-tabview-nav li .p-tabview-left-icon,.p-tabview .p-tabview-nav li .p-tabview-right-icon,.p-tabview .p-tabview-nav li .p-tabview-title{vertical-align:middle}.p-tabview .p-tabview-nav li .p-tabview-left-icon{margin-right:.25em;vertical-align:middle}.p-tabview .p-tabview-nav li .p-tabview-right-icon{margin-left:.25em;vertical-align:middle}.p-tabview .p-tabview-nav li .p-tabview-close{margin:.5em .3em 0 0;cursor:pointer}.p-tabview.p-tabview-top>.p-tabview-nav li{border-bottom:0;top:1px}.p-tabview.p-tabview-top>.p-tabview-nav{padding:.2em .2em 0}.p-tabview.p-tabview-bottom>.p-tabview-nav{padding:0 .2em .2em}.p-tabview.p-tabview-bottom>.p-tabview-nav li{border-top:0}.p-tabview-left:after,.p-tabview-right:after{clear:both;content:".";display:block;height:0;visibility:hidden}.p-tabview-left>.p-tabview-nav{float:left;width:25%;height:300px;background-image:none;padding-top:1px}.p-tabview-left>.p-tabview-panels{float:right;width:75%}.p-tabview.p-tabview-left>.p-tabview-nav li,.p-tabview.p-tabview-right>.p-tabview-nav li{display:block;float:right;white-space:normal;width:99%}.p-tabview.p-tabview-left>.p-tabview-nav li{margin:0 0 1px 0;border-right:0 none}.p-tabview.p-tabview-right>.p-tabview-nav{float:right;width:25%;height:300px;background-image:none;padding-top:1px}.p-tabview.p-tabview-right>.p-tabview-panels{float:left;width:75%}.p-tabview.p-tabview-right>.p-tabview-nav li{margin:0 0 1px 0;border-left:0 none}.p-rtl .p-tabview .p-tabview-nav li{float:right}',""])},"499e":function(e,t,n){"use strict";function i(e,t){for(var n=[],i={},a=0;a<t.length;a++){var r=t[a],o=r[0],p=r[1],s=r[2],l=r[3],d={id:e+":"+a,css:p,media:s,sourceMap:l};i[o]?i[o].parts.push(d):n.push(i[o]={id:o,parts:[d]})}return n}n.r(t),n.d(t,"default",function(){return f});var a="undefined"!==typeof document;if("undefined"!==typeof DEBUG&&DEBUG&&!a)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 r={},o=a&&(document.head||document.getElementsByTagName("head")[0]),p=null,s=0,l=!1,d=function(){},c=null,u="data-vue-ssr-id",v="undefined"!==typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function f(e,t,n,a){l=n,c=a||{};var o=i(e,t);return b(o),function(t){for(var n=[],a=0;a<o.length;a++){var p=o[a],s=r[p.id];s.refs--,n.push(s)}t?(o=i(e,t),b(o)):o=[];for(a=0;a<n.length;a++){s=n[a];if(0===s.refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete r[s.id]}}}}function b(e){for(var t=0;t<e.length;t++){var n=e[t],i=r[n.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](n.parts[a]);for(;a<n.parts.length;a++)i.parts.push(w(n.parts[a]));i.parts.length>n.parts.length&&(i.parts.length=n.parts.length)}else{var o=[];for(a=0;a<n.parts.length;a++)o.push(w(n.parts[a]));r[n.id]={id:n.id,refs:1,parts:o}}}}function h(){var e=document.createElement("style");return e.type="text/css",o.appendChild(e),e}function w(e){var t,n,i=document.querySelector("style["+u+'~="'+e.id+'"]');if(i){if(l)return d;i.parentNode.removeChild(i)}if(v){var a=s++;i=p||(p=h()),t=m.bind(null,i,a,!1),n=m.bind(null,i,a,!0)}else i=h(),t=y.bind(null,i),n=function(){i.parentNode.removeChild(i)};return t(e),function(i){if(i){if(i.css===e.css&&i.media===e.media&&i.sourceMap===e.sourceMap)return;t(e=i)}else n()}}var g=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function m(e,t,n,i){var a=n?"":i.css;if(e.styleSheet)e.styleSheet.cssText=g(t,a);else{var r=document.createTextNode(a),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(r,o[t]):e.appendChild(r)}}function y(e,t){var n=t.css,i=t.media,a=t.sourceMap;if(i&&e.setAttribute("media",i),c.ssrId&&e.setAttribute(u,t.id),a&&(n+="\n/*# sourceURL="+a.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{while(e.firstChild)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},"4eaf":function(e,t,n){"use strict";var i=n("84f8"),a=n.n(i);a.a},"84f8":function(e,t,n){var i=n("2509");"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var a=n("499e").default;a("a6e1f5dc",i,!0,{sourceMap:!1,shadowMode:!1})},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(i){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(i.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 i;(n.r(t),"undefined"!==typeof window)&&(n("f6fd"),(i=window.document.currentScript)&&(i=i.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(n.p=i[1]));var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"p-tabview p-component p-tabview-top"},[n("ul",{staticClass:"p-tabview-nav p-reset",attrs:{role:"tablist"}},e._l(e.tabs,function(t,i){return n("li",{key:t.header||i,class:["p-unselectable-text",{"p-highlight":t.d_active,"p-disabled":t.disabled}],attrs:{role:"presentation"}},[n("a",{attrs:{role:"tab",tabindex:t.disabled?null:"0"},on:{click:function(n){return e.onTabClick(n,t)},keydown:function(n){return e.onTabKeydown(n,t)}}},[t.header?n("span",{staticClass:"p-tabview-title"},[e._v(e._s(t.header))]):e._e(),t.$scopedSlots.header?n("TabPanelHeaderSlot",{attrs:{tab:t}}):e._e()],1)])}),0),n("div",{staticClass:"p-tabview-panels"},[e._t("default")],2)])},r=[],o={functional:!0,props:{tab:{type:null,default:null}},render:function(e,t){return[t.props.tab.$scopedSlots["header"]()]}},p={data:function(){return{d_children:[]}},mounted:function(){this.d_children=this.$children},methods:{onTabClick:function(e,t){t.disabled||t.d_active||(this.activateTab(t),this.$emit("tab-change",{originalEvent:e,tab:t}))},activateTab:function(e){for(var t=0;t<this.tabs.length;t++){var n=this.tabs[t]===e;this.tabs[t].d_active=n,this.tabs[t].$emit("update:active",n)}},onTabKeydown:function(e,t){13===e.which&&this.onTabClick(e,t)},findActiveTab:function(){for(var e,t=0;t<this.tabs.length;t++){var n=this.tabs[t];if(n.d_active){e=n;break}}return e}},updated:function(){var e=this.findActiveTab();!e&&this.tabs.length&&(this.tabs[0].d_active=!0)},computed:{tabs:function(){return this.d_children.filter(function(e){return-1!==e.$vnode.tag.indexOf("tabpanel")})}},components:{TabPanelHeaderSlot:o}},s=p;n("4eaf");function l(e,t,n,i,a,r,o,p){var s,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),i&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),o?(s=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__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},l._ssrRegister=s):a&&(s=p?function(){a.call(this,this.$root.$options.shadowRoot)}:a),s)if(l.functional){l._injectStyles=s;var d=l.render;l.render=function(e,t){return s.call(t),d(e,t)}}else{var c=l.beforeCreate;l.beforeCreate=c?[].concat(c,s):[s]}return{exports:e,options:l}}var d=l(s,a,r,!1,null,null,null),c=d.exports;t["default"]=c}})["default"]});