UNPKG

jiku-ui

Version:

A Component Library for Vue.js.

2 lines (1 loc) 4.29 kB
module.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));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=114)}({0:function(e,t,n){"use strict";function i(e,t,n,i,o,s,r,a){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),r?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:e,options:c}}n.d(t,"a",(function(){return i}))},114:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"hn-collapse-item",class:{"is-active":e.isActive,"is-disabled":e.disabled}},[n("div",{attrs:{role:"tab","aria-expanded":e.isActive,"aria-controls":"hn-collapse-content-"+e.id,"aria-describedby":"hn-collapse-content-"+e.id}},[n("div",{staticClass:"hn-collapse-item__header",class:{focusing:e.focusing,"is-active":e.isActive},attrs:{role:"button",id:"hn-collapse-head-"+e.id,tabindex:e.disabled?void 0:0},on:{click:e.handleHeaderClick,keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),e.handleEnterClick(t))},focus:e.handleFocus,blur:function(t){e.focusing=!1}}},[e._t("title",[e._v(e._s(e.title))]),n("i",{staticClass:"hn-collapse-item__arrow hn-icon-arrow-right",class:{"is-active":e.isActive}})],2)]),n("hn-collapse-transition",[n("div",{directives:[{name:"show",rawName:"v-show",value:e.isActive,expression:"isActive"}],staticClass:"hn-collapse-item__wrap",attrs:{role:"tabpanel","aria-hidden":!e.isActive,"aria-labelledby":"hn-collapse-head-"+e.id,id:"hn-collapse-content-"+e.id}},[n("div",{staticClass:"hn-collapse-item__content"},[e._t("default")],2)])])],1)};i._withStripped=!0;var o=n(21),s=n.n(o),r=n(4),a=n.n(r),l=n(3),c={name:"HnCollapseItem",componentName:"HnCollapseItem",mixins:[a.a],components:{HnCollapseTransition:s.a},data:function(){return{contentWrapStyle:{height:"auto",display:"block"},contentHeight:0,focusing:!1,isClick:!1,id:Object(l.generateId)()}},inject:["collapse"],props:{title:String,name:{type:[String,Number],default:function(){return this._uid}},disabled:Boolean},computed:{isActive:function(){return this.collapse.activeNames.indexOf(this.name)>-1}},methods:{handleFocus:function(){var e=this;setTimeout((function(){e.isClick?e.isClick=!1:e.focusing=!0}),50)},handleHeaderClick:function(){this.disabled||(this.dispatch("HnCollapse","item-click",this),this.focusing=!1,this.isClick=!0)},handleEnterClick:function(){this.dispatch("HnCollapse","item-click",this)}}},u=n(0),d=Object(u.a)(c,i,[],!1,null,null,null);d.options.__file="packages/collapse/src/collapse-item.vue";var p=d.exports;p.install=function(e){e.component(p.name,p)};t.default=p},21:function(e,t){e.exports=require("jiku-ui/lib/transitions/collapse-transition")},3:function(e,t){e.exports=require("jiku-ui/lib/utils/util")},4:function(e,t){e.exports=require("jiku-ui/lib/mixins/emitter")}}).default;