var _jsxFileName = 'src/datePicker/convientRange.jsx';
/**
 * convientRange.jsx
 *
 * @Author: apple
 * @Date: 2018/6/28 14:34
 */

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

function ConvientRange(props) {
    var _this = this;

    var prefixSlideCls = props.prefixSlideCls,
        convenientRange = props.convenientRange,
        handleSelectRange = props.handleSelectRange,
        selectRangeBar = props.selectRangeBar;

    return React.createElement(
        'ul',
        {
            className: classNames(prefixSlideCls, {
                'overflow-scroll': convenientRange.length >= 12
            }), __source: {
                fileName: _jsxFileName,
                lineNumber: 15
            },
            __self: this
        },
        convenientRange.map(function (item) {
            var label = item.label,
                range = item.range;

            var slideLiCls = prefixSlideCls + '-li';
            if (selectRangeBar === label) {
                slideLiCls += ' ' + prefixSlideCls + '-selected';
            }
            return React.createElement(
                'li',
                {
                    key: label,
                    onClick: function onClick() {
                        return handleSelectRange(range, label);
                    },
                    className: slideLiCls,
                    'data-convient': label, __source: {
                        fileName: _jsxFileName,
                        lineNumber: 26
                    },
                    __self: _this
                },
                label
            );
        })
    );
}

export default ConvientRange;