QuarterHeader.js
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import * as React from 'react';
import Header from '../Header';
import PanelContext from '../../PanelContext';
import { formatValue } from '../../utils/dateUtil';
function QuarterHeader(props) {
var prefixCls = props.prefixCls,
generateConfig = props.generateConfig,
locale = props.locale,
viewDate = props.viewDate,
onNextYear = props.onNextYear,
onPrevYear = props.onPrevYear,
onYearClick = props.onYearClick;
var _React$useContext = React.useContext(PanelContext),
hideHeader = _React$useContext.hideHeader;
if (hideHeader) {
return null;
}
var headerPrefixCls = "".concat(prefixCls, "-header");
return /*#__PURE__*/React.createElement(Header, Object.assign({}, props, {
prefixCls: headerPrefixCls,
onSuperPrev: onPrevYear,
onSuperNext: onNextYear
}), /*#__PURE__*/React.createElement("button", {
type: "button",
onClick: onYearClick,
className: "".concat(prefixCls, "-year-btn")
}, formatValue(viewDate, {
locale: locale,
format: locale.yearFormat,
generateConfig: generateConfig
})));
}
export default QuarterHeader;