通用评论

1
  1. {"version":3,"sources":["../../../src/components/Editor/Emoji.js"],"names":["Emoji","carousel","next","prev","props","onClick","emojiList","content","i","length","push","slice","node","map","page","index","item","id","url","name","display","React","Component"],"mappings":";;;;;;;;;;;;;;AAAA;;;;AAGA;;;;;;;;;AADA;;;AAEA;AACA;;AAEA;;IAEMA,K;;;;;;;;;;;2BACG;AACL,UAAI,KAAKC,QAAT,EAAmB;AACjB,aAAKA,QAAL,CAAcC,IAAd;AACD;AACF;;;2BAEM;AACL,UAAI,KAAKD,QAAT,EAAmB;AACjB,aAAKA,QAAL,CAAcE,IAAd;AACD;AACF;;;6BAEQ;AAAA;;AAAA,mBACwB,KAAKC,KAD7B;AAAA,UACCC,QADD,UACCA,OADD;AAAA,UACUC,SADV,UACUA,SADV;;AAEP,UAAMC,UAAU,EAAhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAIF,UAAUG,MAA9B,EAAsCD,KAAK,EAA3C,EAA+C;AAC7CD,gBAAQG,IAAR,CAAaJ,UAAUK,KAAV,CAAgBH,CAAhB,EAAmBA,IAAI,EAAvB,CAAb;AACD;;AAED,aACE;AAAA;AAAA;AACE,eAAK,mBAAQ;AACX,mBAAKP,QAAL,GAAgBW,IAAhB;AACD;AAHH;AAKGL,gBAAQM,GAAR,CAAY,UAACC,IAAD,EAAOC,KAAP;AAAA,iBACX;AAAA;AAAA,cAAK,KAAKA,KAAV,EAAiB,WAAU,OAA3B;AACGD,iBAAKD,GAAL,CAAS,UAACG,IAAD,EAAOD,KAAP;AAAA,qBACR;AAAA;AAAA,kBAAK,WAAU,MAAf,EAAsB,KAAKC,KAAKC,EAAhC;AACE,wDAAM,WAAU,QAAhB,GADF;AAEE;AACE,uBAAKD,KAAKE,GADZ;AAEE,uBAAKF,KAAKG,IAFZ;AAGE,yBAAO,EAAEC,SAAS,cAAX,EAHT;AAIE,2BAAS;AAAA,2BAAMf,SAAQW,KAAKG,IAAb,CAAN;AAAA;AAJX;AAFF,eADQ;AAAA,aAAT;AADH,WADW;AAAA,SAAZ;AALH,OADF;AAuBD;;;;EAvDiBE,gBAAMC,S;;kBA0DXtB,K","file":"Emoji.js","sourcesContent":["import React from \"react\";\nimport { Carousel } from \"antd\";\n// import emoji, { prefixUrl } from \"../../emoji\";\nimport \"./Emoji.css\";\n// 每页 20 5*4\n// 共 20 * 3 = 60 (实际是 54)\n\n// class Emoji\n\nclass Emoji extends React.Component {\n next() {\n if (this.carousel) {\n this.carousel.next();\n }\n }\n\n prev() {\n if (this.carousel) {\n this.carousel.prev();\n }\n }\n\n render() {\n const { onClick, emojiList } = this.props;\n const content = [];\n // let curPage = [];\n // for (let i = 0; i < 115; i++) {\n // if (curPage.length < 30) {\n // curPage.push(emoji[i]);\n // } else {\n // content.push(curPage);\n // curPage = [];\n // }\n // }\n // if (curPage.length > 0) {\n // content.push(curPage);\n // }\n for (let i = 0; i < emojiList.length; i += 30) {\n content.push(emojiList.slice(i, i + 30));\n }\n\n return (\n <Carousel\n ref={node => {\n this.carousel = node;\n }}\n >\n {content.map((page, index) => (\n <div key={index} className=\"emoji\">\n {page.map((item, index) => (\n <div className=\"item\" key={item.id}>\n <span className=\"helper\" />\n <img\n src={item.url}\n alt={item.name}\n style={{ display: \"inline-block\" }}\n onClick={() => onClick(item.name)}\n />\n </div>\n ))}\n </div>\n ))}\n </Carousel>\n );\n }\n}\n\nexport default Emoji;\n"]}