aa435ecbcbbfee51297fbcd6efd57920.json 4.24 KB
{"ast":null,"code":"import * as React from 'react';\nimport Header from '../Header';\nimport { YEAR_DECADE_COUNT } from '.';\nimport PanelContext from '../../PanelContext';\n\nfunction YearHeader(props) {\n  var prefixCls = props.prefixCls,\n      generateConfig = props.generateConfig,\n      viewDate = props.viewDate,\n      onPrevDecade = props.onPrevDecade,\n      onNextDecade = props.onNextDecade,\n      onDecadeClick = props.onDecadeClick;\n\n  var _React$useContext = React.useContext(PanelContext),\n      hideHeader = _React$useContext.hideHeader;\n\n  if (hideHeader) {\n    return null;\n  }\n\n  var headerPrefixCls = \"\".concat(prefixCls, \"-header\");\n  var yearNumber = generateConfig.getYear(viewDate);\n  var startYear = Math.floor(yearNumber / YEAR_DECADE_COUNT) * YEAR_DECADE_COUNT;\n  var endYear = startYear + YEAR_DECADE_COUNT - 1;\n  return /*#__PURE__*/React.createElement(Header, Object.assign({}, props, {\n    prefixCls: headerPrefixCls,\n    onSuperPrev: onPrevDecade,\n    onSuperNext: onNextDecade\n  }), /*#__PURE__*/React.createElement(\"button\", {\n    type: \"button\",\n    onClick: onDecadeClick,\n    className: \"\".concat(prefixCls, \"-decade-btn\")\n  }, startYear, \"-\", endYear));\n}\n\nexport default YearHeader;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-picker/es/panels/YearPanel/YearHeader.js"],"names":["React","Header","YEAR_DECADE_COUNT","PanelContext","YearHeader","props","prefixCls","generateConfig","viewDate","onPrevDecade","onNextDecade","onDecadeClick","_React$useContext","useContext","hideHeader","headerPrefixCls","concat","yearNumber","getYear","startYear","Math","floor","endYear","createElement","Object","assign","onSuperPrev","onSuperNext","type","onClick","className"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,SAASC,iBAAT,QAAkC,GAAlC;AACA,OAAOC,YAAP,MAAyB,oBAAzB;;AAEA,SAASC,UAAT,C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EG,OAJF,CAJG,CAApB;AASD;;AAED,eAAelB,UAAf","sourcesContent":["import * as React from 'react';\nimport Header from '../Header';\nimport { YEAR_DECADE_COUNT } from '.';\nimport PanelContext from '../../PanelContext';\n\nfunction YearHeader(props) {\n  var prefixCls = props.prefixCls,\n      generateConfig = props.generateConfig,\n      viewDate = props.viewDate,\n      onPrevDecade = props.onPrevDecade,\n      onNextDecade = props.onNextDecade,\n      onDecadeClick = props.onDecadeClick;\n\n  var _React$useContext = React.useContext(PanelContext),\n      hideHeader = _React$useContext.hideHeader;\n\n  if (hideHeader) {\n    return null;\n  }\n\n  var headerPrefixCls = \"\".concat(prefixCls, \"-header\");\n  var yearNumber = generateConfig.getYear(viewDate);\n  var startYear = Math.floor(yearNumber / YEAR_DECADE_COUNT) * YEAR_DECADE_COUNT;\n  var endYear = startYear + YEAR_DECADE_COUNT - 1;\n  return /*#__PURE__*/React.createElement(Header, Object.assign({}, props, {\n    prefixCls: headerPrefixCls,\n    onSuperPrev: onPrevDecade,\n    onSuperNext: onNextDecade\n  }), /*#__PURE__*/React.createElement(\"button\", {\n    type: \"button\",\n    onClick: onDecadeClick,\n    className: \"\".concat(prefixCls, \"-decade-btn\")\n  }, startYear, \"-\", endYear));\n}\n\nexport default YearHeader;"]},"metadata":{},"sourceType":"module"}