{ "pandav:/index.js": { "cubeCode": "Cube('pandav:/com/tabV2/1.2.5',['pandav:/npm/bcore/0.0.18/event','pandav:/npm/react/17.0.2','pandav:/npm/react-dom/17.0.2','pandav:/com/tabV2/1.2.5/Tab.jsx'],function(a,b,c){var d=c('pandav:/npm/bcore/0.0.18/event'),e=c('pandav:/npm/react/17.0.2'),f=c('pandav:/npm/react-dom/17.0.2'),g=c('pandav:/com/tabV2/1.2.5/Tab.jsx');return a.exports=d.extend(function(a,b){this.config={theme:{}},this.container=a,this.apis=b.apis,this.containSize={boxWidth:$(a)&&$(a).width(),boxHeight:$(a)&&$(a).height()},this.init(b)},{init:function(a){this.mergeConfig(a)},mergeConfig:function(a){var b;return a?(b=a,this.config=a):b=this.config,b},updateOptions:function(a){this.render(this._data,a)},data:function(a){return a&&(this._data=a),this._data},resize:function(a,b){this.containSize={boxWidth:a,boxHeight:b},this.render(this._data,this.config)},render:function(a,b){a=this.data(a);var c=this.mergeConfig(b),d=c.options;f.render(e.createElement(g,Object.assign({width:this.containSize.boxWidth,height:this.containSize.boxHeight,emitEvent:this.emit.bind(this),config:d,data:a,id:this.__id})),this.container)},destroy:function(){return!!this.container&&void(f.unmountComponentAtNode(this.container),this.container.innerHTML='')}}),a.exports});", "requires": [ "pandav:/Tab.jsx" ], "buildLevel": 1, "outputDir": "/com/tabV2/1.2.5", "outputPath": "/com/tabV2/1.2.5/index.js", "fileName": "/index.js" }, "pandav:/Tab.jsx": { "cubeCode": "Cube('pandav:/com/tabV2/1.2.5/Tab.jsx',['pandav:/npm/react/17.0.2','pandav:/npm/lodash/4.6.1','pandav:/com/cube-chart/0.0.2','pandav:/com/common-utils/1.0.0'],function(a,b,c){function d(a){\"@babel/helpers - typeof\";return d='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&'function'==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?'symbol':typeof a},d(a)}function e(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function f(a,b){for(var c,d=0;df-g?0:f-g;setTimeout(function(){c.setIndex(d),c.clearTimeout(),c.timeout=setTimeout(function(){return c.animate(c.props)},1e3*h)},0)}},{key:'onClick',value:function b(a){var c=this,d=+a.currentTarget.dataset.id,e=this.props.config.chart.animate,f=e.stay,g=e.interval,h=0>f-g?0:f-g,i=this.props.data||[];this.setIndex(d),this.clearTimeout(),this.timeout=setTimeout(function(){return c.animate(c.props)},1e3*h),this.props.clickCallBack&&this.props.emitEvent('click',i[d])}},{key:'mouseEnter',value:function b(a){var c=this.props.data||[],d=+a.currentTarget.dataset.id;this.props.emitEvent&&this.props.emitEvent('mouseEnter',c[d])}},{key:'mouseLeave',value:function b(a){var c=this.props.data||[],d=+a.currentTarget.dataset.id;this.props.emitEvent&&this.props.emitEvent('mouseLeave',c[d])}},{key:'refresh',value:function b(a){this.data=a.data,this.config=a.config,this.animate(a)}},{key:'getIndex',value:function c(a,b){return isNaN(b)||0>a?0:a>=b?b-1:a}},{key:'getRelativeData',value:function a(){}},{key:'componentWillReceiveProps',value:function c(a,b){this.refresh(a);var d=this.config.chart.currentIndex-1,e=s.isEqual(this.props.data,a.data),f=s.isEqual(this.props.config,a.config);f&&e||this.setIndex(d)}},{key:'dataTogether',value:function b(a){var c=this,d=this.props.data,e=a.callbackValues,f=this.config,g=f.chart,h=f.interaction,i=g.linked,j=g.animate,k=j.stay,l=j.interval;if(i){var m=Object.values(h.callback),n=this.state.currentIndex,o=Object.entries(e)[0];if(o){var p=o[0],q=m.find(function(a){return a.target===p}).origin,r=d.findIndex(function(a){return a[q]==o[1]}),t=0>k-l?0:k-l;/^\\d+(?=\\.{0,1}\\d+$|$)/.test(r)&&!s.isEqual(e,nextCallbackValues)&&n!==index&&(this.setIndex(index),this.clearTimeout(),this.timeout=setTimeout(function(){c.animate(c.props)},1e3*t))}}}},{key:'componentDidUpdate',value:function d(a,b,c){var e=this.props,f=this.props.callbackValues||{},g=e.data,h=a.callbackValues,i=this.config,j=i.chart,k=i.interaction;j.linked&&this.setMoverStyle()}},{key:'animate',value:function a(){var b=this,a=this.config.chart.animate;this.clearTimeout();var c;a.show&&this.data&&0=this.data.length&&(a=0),this.setState({currentIndex:a}),this.getRelativeData(a,this.props),this.handleClickEvents(a)}},{key:'handleClickEvents',value:function b(a){var c=this.props.data||[];this.props.emitEvent&&this.props.emitEvent('click',c[a])}},{key:'clearTimeout',value:function(a){function b(){return a.apply(this,arguments)}return b.toString=function(){return a.toString()},b}(function(){this.selfTimeout&&clearInterval(this.selfTimeout),this.timeout&&clearTimeout(this.timeout),this.selfTimeout=null,this.timeout=null})},{key:'createWebKitScroll',value:function b(a){return a.show?'\\n .TabV2::-webkit-scrollbar-thumb {\\n background: '.concat(a.thumb,';\\n }\\n .TabV2::-webkit-scrollbar-track {\\n background-color: ').concat(a.track,';\\n }\\n .TabV2::-webkit-scrollbar {\\n width: ').concat(a.length,'px;\\n height: ').concat(a.length,'px;\\n }\\n '):null}},{key:'render',value:function a(){var b=this,c=this.state.currentIndex,d=this.props.data||[],e=this.config,f=e.chart,g=e.tabStyle,h=e.tabSeries,i=f.grid,j=f.text,k=f.scrollbar,l=f.radius,m=j.textVertical,n=j.writingMode,o=j.textOverflow,p=j.speed,q=i.GridGap,s=i.gridLayout,u=s.column,B=s.row,C=q.rowGridGap,D=q.columnGridGap,E=g.defaultStyle,F=g.currentStyle;return r.createElement('ul',{ref:function c(a){return b.list=a},className:'TabV2',style:{width:this.props.width,height:this.props.height,display:'grid',gridTemplate:A(h,d,B,u),gridGap:C+'px '+D+'px',overflow:k.show?'scroll':'visible'}},r.createElement('style',null,this.createWebKitScroll(k)),d&&d.map(function(a,d){var e=z(b.props.data,E,F,h.tabseries,d),f=e.style,g=e.currentStyle,i=e.textTranslate,q=e.entityTranslate,s=d===c?g:f,u=s.border,A=s.text,D=s.background,G=s.icon,H=A.textTranslate,I=A.shadow,J=A.textShadowConfig,K=i||H;return r.createElement('li',{onClick:b.onClick.bind(b),onMouseEnter:b.mouseEnter.bind(b),onMouseLeave:b.mouseLeave.bind(b),\"data-id\":d,key:d,style:{minWidth:'-webkit-fill-available',position:'relative',display:'flex',height:k.show?(b.props.height-(B-1)*C)/B:'100%',justifyContent:j.alignItems,alignItems:'center',transition:'all 0.3s linear',background:D,borderRadius:l,border:u.show?''.concat(u.borderWidth,'px solid ').concat(u.borderColor):'',transform:void 0===q?'translate(0, 0)':'translate('.concat(q.x,'px, ').concat(q.y,'px)'),writingMode:n,cursor:'pointer',overflow:'overflow'==o?'visible':'hidden',textAlign:'break-word'==o?y(j.alignItems):'initial'}},G.show&&r.createElement('div',{style:{minWidth:s.icon.size.width,minHeight:s.icon.size.height,background:'url('.concat(s.icon.url,') 0 0/100% 100%'),marginLeft:s.icon.margin.marginLeft,marginRight:s.icon.margin.marginRight}}),'horizontal-tb'==n?'overflow'==o?r.createElement('div',{style:Object.assign(Object.assign({transform:x(K)},v(A.textStyle)),{},{textShadow:w({show:I,textShadow:J}),whiteSpace:'nowrap'})},a.content||''):r.createElement(t,{type:o,speed:p,value:a.content||'',style:Object.assign(Object.assign({justifyContent:j.alignItems},v(A.textStyle)),{},{transform:x(K),textShadow:w({show:I,textShadow:J}),textOrientation:'tb-rl'===n?'upright':''})}):r.createElement('div',{style:Object.assign(Object.assign({position:'absolute',transform:'center'===m?'translate(0,-50%)'+x(K):x(K)},v(A.textStyle)),{},{textShadow:w({show:I,textShadow:J}),top:'top'===m?'0%':'center'===m?'50%':'',bottom:'bottom'===m?'0%':'',textOrientation:'upright'})},a.content||''))}))}},{key:'componentWillUnmount',value:function a(){document.removeEventListener('setIndex_'.concat(this.props.id),this.onAction,!1),this.scrollbar=null,this.clearTimeout()}}]),b}(r.Component);return a.exports=B,a.exports});", "requires": [], "buildLevel": 2, "outputDir": "/com/tabV2/1.2.5", "outputPath": "/com/tabV2/1.2.5/Tab.jsx", "fileName": "/Tab.jsx" } }