// import { Input } from "@alifd/next"; import ConfigProvider from '../config-provider'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import cls from 'classnames'; import { CommonThemeProps } from '../types'; import { GroupProps as NextGroupProps } from '@alifd/next/types/input'; import { Input as NextInput } from '@alifd/next'; import { InputProps as NextInputProps } from '@alifd/next/types/input'; import { PasswordProps as NextPasswordProps } from '@alifd/next/types/input'; import { TextAreaProps as NextTextAreaProps } from '@alifd/next/types/input'; import { getTheme } from '../utils/getTheme'; import { omitProps } from '../utils/object'; interface TextAreaProps extends NextTextAreaProps, CommonThemeProps { } class TextArea extends Component { // contextTypes static contextTypes = { theme: PropTypes.string, }; render() { const { prefix = 'next-', className, ...otherProps } = this.props; const theme = getTheme(this.context, this.props); return ( ); } } interface PasswordProps extends Omit, CommonThemeProps { size?: 'large' | 'medium' | 'small' | 'xs'; } class Password extends Component { // contextTypes static contextTypes = { theme: PropTypes.string, }; render() { const { prefix = 'next-', size = 'medium', className, ...otherProps } = this.props; const theme = getTheme(this.context, this.props); if (size === 'xs') { return ( ); } return ( ); } } interface GroupProps extends NextGroupProps, CommonThemeProps { } class Group extends Component { // contextTypes static contextTypes = { theme: PropTypes.string, }; render() { const { prefix = 'next-', className, ...otherProps } = this.props; const theme = getTheme(this.context, this.props); return ( ); } } interface InputProps extends Omit, CommonThemeProps { size?: 'large' | 'medium' | 'small' | 'xs'; } class Input extends Component { static TextArea = ConfigProvider.config(TextArea); static Group = ConfigProvider.config(Group); static Password = ConfigProvider.config(Password); // contextTypes static contextTypes = { theme: PropTypes.string, }; render() { const { prefix = 'next-', className, size = 'medium', ...otherProps } = this.props; const theme = getTheme(this.context, this.props); if (size === 'xs') { return ( ); } return ( ); } } export default ConfigProvider.config(Input);