Permalink
Browse files

optimize picker/date-picker #210

  • Loading branch information...
warmhug committed Sep 13, 2016
1 parent 1f0dcc4 commit adb5a45ae35e13f64d4f295dd328cf9da45aec57
@@ -15,6 +15,8 @@ interface DatePickerProps {
prefixCls?: string;
pickerPrefixCls?: string;
popupPrefixCls?: string;
dismissText?: string|React.ReactElement<any>; // React.ReactElement only for web
okText?: string|React.ReactElement<any>; // React.ReactElement only for web
}

export default DatePickerProps;
@@ -19,7 +19,7 @@ export default class DatePicker extends React.Component<tsPropsType, any> {

render() {
const { props } = this;
const { children, extra, value, defaultDate } = props;
const { children, value, defaultDate, extra, okText, dismissText, popupPrefixCls } = props;
const extraProps = {
extra: value ? formatFn(this, value) : extra,
};
@@ -37,12 +37,14 @@ export default class DatePicker extends React.Component<tsPropsType, any> {
return (
<PopupDatePicker
datePicker={dataPicker}
{...props}
prefixCls={props.popupPrefixCls}
WrapComponent="div"
transitionName="am-slide-up"
maskTransitionName="am-fade"
{...props}
prefixCls={popupPrefixCls}
date={value || defaultDate}
dismissText={<span className={`${popupPrefixCls}-header-cancel-button`}>{dismissText}</span>}
okText={<span className={`${popupPrefixCls}-header-ok-button`}>{okText}</span>}
>
{React.cloneElement(children,
children.type && children.type.myName === 'ListItem' ? extraProps : {})}
@@ -43,7 +43,7 @@ export default class Picker extends React.Component<tsPropsType, any> {

render() {
const {props} = this;
const {children, value, okText, dismissText, title, extra, popupPrefixCls} = props;
const {children, value, extra, okText, dismissText, popupPrefixCls} = props;
const extraProps = {
extra: this.getSel() || extra,
};
@@ -63,10 +63,9 @@ export default class Picker extends React.Component<tsPropsType, any> {
WrapComponent="div"
transitionName="am-slide-up"
maskTransitionName="am-fade"
{...this.props}
{...props}
prefixCls={popupPrefixCls}
value={value}
title={title}
dismissText={<span className={`${popupPrefixCls}-header-cancel-button`}>{dismissText}</span>}
okText={<span className={`${popupPrefixCls}-header-ok-button`}>{okText}</span>}
>
@@ -24,6 +24,9 @@
white-space: nowrap;
text-overflow: ellipsis;
direction: rtl;
&-selected {
font-size: @font-size-heading;
}
}

&-mask {

0 comments on commit adb5a45

Please sign in to comment.