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 { Input } from "@alifd/next";
import React, { Component } from 'react';
import cls from 'classnames';
import { Input as NextInput } from '@alifd/next';
import { omitProps } from '../utils/object';
class TextArea extends React.Component {
    render() {
        const _a = this.props, { prefix = 'next-', theme = 'white', className } = _a, otherProps = __rest(_a, ["prefix", "theme", "className"]);
        return (React.createElement(NextInput.TextArea, Object.assign({}, otherProps, { prefix: prefix, className: cls(className, {
                [`${prefix}white`]: theme === 'white',
                [`${prefix}grey`]: theme === 'grey',
            }) })));
    }
}
class Password extends React.Component {
    render() {
        const _a = this.props, { prefix = 'next-', theme = 'white', size = 'medium', className } = _a, otherProps = __rest(_a, ["prefix", "theme", "size", "className"]);
        if (size === 'xs') {
            return (React.createElement(NextInput.Password, Object.assign({}, omitProps(otherProps, ['size']), { prefix: prefix, className: cls(className, {
                    [`${prefix}grey`]: theme === 'grey',
                    [`${prefix}xs`]: size === 'xs',
                    [`${prefix}white`]: theme === 'white',
                }) })));
        }
        return (React.createElement(NextInput.Password, Object.assign({}, otherProps, { prefix: prefix, size: size, className: cls(className, {
                [`${prefix}grey`]: theme === 'grey',
                [`${prefix}white`]: theme === 'white',
            }) })));
    }
}
class Group extends React.Component {
    render() {
        const _a = this.props, { prefix = 'next-', theme = 'white', className } = _a, otherProps = __rest(_a, ["prefix", "theme", "className"]);
        return (React.createElement(NextInput.Group, Object.assign({}, otherProps, { prefix: prefix, className: cls(className, {
                [`${prefix}grey`]: theme === 'grey',
                [`${prefix}white`]: theme === 'white',
            }) })));
    }
}
class Input extends Component {
    render() {
        const _a = this.props, { prefix = 'next-', theme = 'white', size = 'medium', className } = _a, otherProps = __rest(_a, ["prefix", "theme", "size", "className"]);
        if (size === 'xs') {
            return (React.createElement(NextInput, Object.assign({}, omitProps(otherProps, ['size']), { prefix: prefix, className: cls(className, {
                    [`${prefix}grey`]: theme === 'grey',
                    [`${prefix}white`]: theme === 'white',
                    [`${prefix}xs`]: size === 'xs',
                }) })));
        }
        return (React.createElement(NextInput, Object.assign({}, otherProps, { prefix: prefix, size: size, className: cls(className, {
                [`${prefix}grey`]: theme === 'grey',
                [`${prefix}white`]: theme === 'white',
            }) })));
    }
}
Input.TextArea = TextArea;
Input.Group = Group;
Input.Password = Password;
export default Input;
