UNPKG

choerodon-ui

Version:

An enterprise-class UI design language and React-based implementation

62 lines (59 loc) 1.49 kB
import PropTypes from 'prop-types'; import noop from 'lodash/noop'; import enUs from '../locale/en_US'; export default { propTypes: { className: PropTypes.string, locale: PropTypes.object, style: PropTypes.object, visible: PropTypes.bool, onSelect: PropTypes.func, prefixCls: PropTypes.string, onChange: PropTypes.func, onOk: PropTypes.func }, getDefaultProps: function getDefaultProps() { return { locale: enUs, style: {}, visible: true, prefixCls: 'rc-calendar', className: '', onSelect: noop, onChange: noop, onClear: noop, renderFooter: function renderFooter() { return null; }, renderSidebar: function renderSidebar() { return null; } }; }, shouldComponentUpdate: function shouldComponentUpdate(nextProps) { return this.props.visible || nextProps.visible; }, getFormat: function getFormat() { var format = this.props.format; var _this$props = this.props, locale = _this$props.locale, timePicker = _this$props.timePicker; if (!format) { if (timePicker) { format = locale.dateTimeFormat; } else { format = locale.dateFormat; } } return format; }, focus: function focus() { if (this.rootInstance) { this.rootInstance.focus(); } }, saveRoot: function saveRoot(root) { this.rootInstance = root; } }; //# sourceMappingURL=CommonMixin.js.map