UNPKG

3.52 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/components/GridView/GridView.js"],"names":["GridViewLayout","props","context","className","children","Component","GridView","isFunction","fun","Object","prototype","toString","call","span","dataSource","length","rowStyle","row","map","Math","random","item","render"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEC;;;;AAEA;;;;AAEA;;;;;;;AALA;IAYcA,c,WAAAA,c;;;AACX,4BAAYC,KAAZ,EAAkBC,OAAlB,EAA0B;AAAA;AAAA,qJAChBD,KADgB,EACVC,OADU;AAEzB;;;;iCACO;AACJ,mBACI;AAAA;AAAA,kBAAK,kCAA+B,KAAKD,KAAL,CAAWE,SAAX,IAAsB,EAArD,CAAL;AACK,qBAAKF,KAAL,CAAWG;AADhB,aADJ;AAKH;;;EAViCC,gB;;AAatC;;;;;;;;IAQaC,Q,WAAAA,Q;;;AACT,sBAAYL,KAAZ,EAAkBC,OAAlB,EAA0B;AAAA;;AAAA,+IAChBD,KADgB,EACVC,OADU;;AAAA,eAO1BK,UAP0B,GAOf,UAACC,GAAD,EAAO;AACd,mBAAOC,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,GAA/B,KAAqC,mBAA5C;AACH,SATyB;;AAAA;AAEzB;AACD;;;;;;;;iCAOQ;AAAA;;AACJ,gBAAMK,OAAM,KAAKZ,KAAL,CAAWa,UAAX,IAAuB,KAAKb,KAAL,CAAWa,UAAX,CAAsBC,MAAtB,GAA6B,CAArD,GAAwD,KAAG,KAAKd,KAAL,CAAWa,UAAX,CAAsBC,MAAjF,GAAwF,EAAnG;AACA,mBACA;AAAA;AAAA,yCAAK,2BAAwB,YAAU,KAAKd,KAAL,CAAWe,QAArB,IAA+B,KAAKf,KAAL,CAAWE,SAAlE,CAAL,IAAwF,KAAKF,KAAL,CAAWgB,GAAnG;AAEQ,qBAAKhB,KAAL,CAAWa,UAAX,GAAsB,KAAKb,KAAL,CAAWa,UAAX,CAAsBI,GAAtB,CAA0B,gBAAM;AAClD,2BAAQ;AAAA;AAAA,0BAAK,KAAKC,KAAKC,MAAL,EAAV,EAAyB,MAAMC,KAAKR,IAAL,IAAWA,IAA1C,EAAgD,YAAc,CAACQ,KAAKR,IAAN,GAAW,eAAX,GAA2B,EAAzC,WAA+CQ,KAAKlB,SAAL,IAAgB,EAA/D,CAAhD;AAAsH,+BAAKI,UAAL,CAAgBc,KAAKC,MAArB,IAA6BD,KAAKC,MAAL,EAA7B,GAA2CD,KAAKC;AAAtK,qBAAR;AACH,iBAFqB,CAAtB,GAEG;AAAA;AAAA,sBAAK,MAAM,EAAX;AAAA;AAAA;AAJX,aADA;AASH;;;EAtByBjB,gB","file":"GridView.js","sourcesContent":["\r\n /**********引入系统组件***********/\r\n import React, { Component } from 'react';\r\n import {Row,Col} from \"jdcloudui\";\r\n import \"../GridView/style/GridView.css\";\r\n\r\n /**\r\n * @author RongXiaowei\r\n * @param className 可以不写\r\n * @date 2017-12-11\r\n * @description GridViewLayout\r\n */\r\n\r\n export class GridViewLayout extends Component{\r\n constructor(props,context){\r\n super(props,context)\r\n }\r\n render(){\r\n return (\r\n <div className={`gird-view-layout ${this.props.className||''}`}>\r\n {this.props.children}\r\n </div>\r\n )\r\n }\r\n}\r\n\r\n/**\r\n * @author RongXiaowei\r\n * @param dataSource :[{render,span,className}]\r\n * @param rowStyle :rowEven||rowOdd 隔行变色 {偶数||奇数} 默认奇数\r\n * @date 2017-12-11\r\n * @description GridView\r\n */\r\n\r\nexport class GridView extends Component{\r\n constructor(props,context){\r\n super(props,context)\r\n }\r\n /**\r\n * @param fun\r\n * @return Boolean\r\n */\r\n isFunction=(fun)=>{\r\n return Object.prototype.toString.call(fun)=='[object Function]'\r\n }\r\n render(){\r\n const span=(this.props.dataSource&&this.props.dataSource.length>0)?24/this.props.dataSource.length:24;\r\n return (\r\n <Row className={`gird-view ${\"rowOdd\"||this.props.rowStyle||this.props.className}`} {...this.props.row}>\r\n {\r\n this.props.dataSource?this.props.dataSource.map(item=>{\r\n return <Col key={Math.random()} span={item.span||span} className={`${!item.span?\"gird-col-auto\":\"\"} ${item.className||\"\"}`}>{this.isFunction(item.render)?item.render():item.render}</Col>\r\n }):<Col span={24}>暂时没有信息</Col>\r\n }\r\n </Row>\r\n )\r\n }\r\n}"]}
\No newline at end of file