var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import ConfigProvider from '../config-provider';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import cls from 'classnames';
import { DatePicker2 as NextDatePicker2 } from '@alifd/next';
import { getTheme } from '../utils/getTheme';
class BdesignRangePicker extends Component {
    render() {
        const _a = this.props, { prefix = 'next-', popupAlign = 'bl tl', className, popupClassName = '' } = _a, otherProps = __rest(_a, ["prefix", "popupAlign", "className", "popupClassName"]);
        const theme = getTheme(this.context, this.props);
        const { RangePicker } = NextDatePicker2;
        return (React.createElement(RangePicker, Object.assign({}, otherProps, { prefix: prefix, popupAlign: popupAlign, popupClassName: `${prefix}${theme} ${popupClassName}`, className: cls(className, {
                [`${prefix}white`]: theme === 'white',
                [`${prefix}grey`]: theme === 'grey',
            }) })));
    }
}
// contextTypes
BdesignRangePicker.contextTypes = {
    theme: PropTypes.string,
};
class BdesignMonthPicker extends Component {
    render() {
        const _a = this.props, { prefix = 'next-', popupAlign = 'bl tl', className, popupClassName = '' } = _a, otherProps = __rest(_a, ["prefix", "popupAlign", "className", "popupClassName"]);
        const theme = getTheme(this.context, this.props);
        const { MonthPicker } = NextDatePicker2;
        return (React.createElement(MonthPicker, Object.assign({}, otherProps, { prefix: prefix, popupAlign: popupAlign, popupClassName: `${prefix}${theme} ${popupClassName}`, className: cls(className, {
                [`${prefix}white`]: theme === 'white',
                [`${prefix}grey`]: theme === 'grey',
            }) })));
    }
}
// contextTypes
BdesignMonthPicker.contextTypes = {
    theme: PropTypes.string,
};
class BdesignYearPicker extends Component {
    render() {
        const _a = this.props, { prefix = 'next-', popupAlign = 'bl tl', className, popupClassName = '' } = _a, otherProps = __rest(_a, ["prefix", "popupAlign", "className", "popupClassName"]);
        const { YearPicker } = NextDatePicker2;
        const theme = getTheme(this.context, this.props);
        return (React.createElement(YearPicker, Object.assign({}, otherProps, { prefix: prefix, popupAlign: popupAlign, popupClassName: `${prefix}${theme} ${popupClassName}`, className: cls(className, {
                [`${prefix}white`]: theme === 'white',
                [`${prefix}grey`]: theme === 'grey',
            }) })));
    }
}
// contextTypes
BdesignYearPicker.contextTypes = {
    theme: PropTypes.string,
};
class BdesignWeekPicker extends Component {
    render() {
        const _a = this.props, { prefix = 'next-', popupAlign = 'bl tl', className, popupClassName = '' } = _a, otherProps = __rest(_a, ["prefix", "popupAlign", "className", "popupClassName"]);
        const { WeekPicker } = NextDatePicker2;
        const theme = getTheme(this.context, this.props);
        return (React.createElement(WeekPicker, Object.assign({}, otherProps, { prefix: prefix, popupAlign: popupAlign, popupClassName: `${prefix}${theme} ${popupClassName}`, className: cls(className, {
                [`${prefix}white`]: theme === 'white',
                [`${prefix}grey`]: theme === 'grey',
            }) })));
    }
}
// contextTypes
BdesignWeekPicker.contextTypes = {
    theme: PropTypes.string,
};
class BdesignQuarterPicker extends Component {
    render() {
        const _a = this.props, { prefix = 'next-', popupAlign = 'bl tl', className, popupClassName = '' } = _a, otherProps = __rest(_a, ["prefix", "popupAlign", "className", "popupClassName"]);
        const { QuarterPicker } = NextDatePicker2;
        const theme = getTheme(this.context, this.props);
        return (React.createElement(QuarterPicker, Object.assign({}, otherProps, { prefix: prefix, popupAlign: popupAlign, popupClassName: `${prefix}${theme} ${popupClassName}`, className: cls(className, {
                [`${prefix}white`]: theme === 'white',
                [`${prefix}grey`]: theme === 'grey',
            }) })));
    }
}
// contextTypes
BdesignQuarterPicker.contextTypes = {
    theme: PropTypes.string,
};
class DatePicker2 extends Component {
    render() {
        const _a = this.props, { prefix = 'next-', popupAlign = 'bl tl', className, popupClassName = '' } = _a, otherProps = __rest(_a, ["prefix", "popupAlign", "className", "popupClassName"]);
        const theme = getTheme(this.context, this.props);
        return (React.createElement(NextDatePicker2, Object.assign({}, otherProps, { prefix: prefix, popupAlign: popupAlign, popupClassName: `${prefix}${theme} ${popupClassName}`, className: cls(className, {
                [`${prefix}white`]: theme === 'white',
                [`${prefix}grey`]: theme === 'grey',
            }) })));
    }
}
DatePicker2.RangePicker = ConfigProvider.config(BdesignRangePicker);
DatePicker2.MonthPicker = ConfigProvider.config(BdesignMonthPicker);
DatePicker2.YearPicker = ConfigProvider.config(BdesignYearPicker);
DatePicker2.WeekPicker = ConfigProvider.config(BdesignWeekPicker);
DatePicker2.QuarterPicker = ConfigProvider.config(BdesignQuarterPicker);
// contextTypes
DatePicker2.contextTypes = {
    theme: PropTypes.string,
};
export default ConfigProvider.config(DatePicker2);
