diff --git a/components/config-provider/demo/size.md b/components/config-provider/demo/size.md
index ba640aa5f2..dc66adaa28 100644
--- a/components/config-provider/demo/size.md
+++ b/components/config-provider/demo/size.md
@@ -49,6 +49,9 @@ const FormSizeDemo = () => {
+
+
+
diff --git a/components/image/index.en-US.md b/components/image/index.en-US.md
index 918011c690..5527cfc51e 100644
--- a/components/image/index.en-US.md
+++ b/components/image/index.en-US.md
@@ -31,6 +31,7 @@ Previewable image.
{
visible?: boolean;
onVisibleChange?: (visible, prevVisible) => void;
+ getContainer?: string | HTMLElement | (() => HTMLElement);
}
```
diff --git a/components/image/index.zh-CN.md b/components/image/index.zh-CN.md
index 3c852bc593..3fbcefb438 100644
--- a/components/image/index.zh-CN.md
+++ b/components/image/index.zh-CN.md
@@ -32,6 +32,7 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/D1dXz9PZqa/image.svg
{
visible?: boolean;
onVisibleChange?: (visible, prevVisible) => void;
+ getContainer: string | HTMLElement | (() => HTMLElement);
}
```
diff --git a/components/input/TextArea.tsx b/components/input/TextArea.tsx
index ad93bf0b47..5065771d89 100644
--- a/components/input/TextArea.tsx
+++ b/components/input/TextArea.tsx
@@ -5,12 +5,14 @@ import classNames from 'classnames';
import ClearableLabeledInput from './ClearableLabeledInput';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import { fixControlledValue, resolveOnChange } from './Input';
+import SizeContext, { SizeType } from '../config-provider/SizeContext';
export interface TextAreaProps extends RcTextAreaProps {
allowClear?: boolean;
bordered?: boolean;
showCount?: boolean;
maxLength?: number;
+ size?: SizeType;
}
export interface TextAreaState {
@@ -76,15 +78,17 @@ class TextArea extends React.Component {
resolveOnChange(this.resizableTextArea.textArea, e, this.props.onChange);
};
- renderTextArea = (prefixCls: string, bordered: boolean) => {
- const { showCount, className, style } = this.props;
+ renderTextArea = (prefixCls: string, bordered: boolean, size?: SizeType) => {
+ const { showCount, className, style, size: customizeSize } = this.props;
return (
{
value = hasMaxLength ? value.slice(0, maxLength) : value;
// TextArea
- let textareaNode = (
+ let textareaNode = (size?: SizeType) => (
{
const valueLength = [...value].length;
const dataCount = `${valueLength}${hasMaxLength ? ` / ${maxLength}` : ''}`;
- textareaNode = (
+ textareaNode = (size?: SizeType) => (
{
style={style}
data-count={dataCount}
>
- {textareaNode}
+ {textareaNode(size)}
);
}
- return textareaNode;
+ return {textareaNode};
};
render() {
diff --git a/components/input/__tests__/__snapshots__/textarea.test.js.snap b/components/input/__tests__/__snapshots__/textarea.test.js.snap
index 8b6b05d4cc..313529a898 100644
--- a/components/input/__tests__/__snapshots__/textarea.test.js.snap
+++ b/components/input/__tests__/__snapshots__/textarea.test.js.snap
@@ -263,3 +263,9 @@ exports[`TextArea should support maxLength 1`] = `
maxlength="10"
/>
`;
+
+exports[`TextArea should support size 1`] = `
+
+`;
diff --git a/components/input/__tests__/textarea.test.js b/components/input/__tests__/textarea.test.js
index 3e326cf792..ba608bb735 100644
--- a/components/input/__tests__/textarea.test.js
+++ b/components/input/__tests__/textarea.test.js
@@ -155,6 +155,12 @@ describe('TextArea', () => {
expect(wrapper.find('.ant-input').props().style.background).toBeFalsy();
});
});
+
+ it('should support size', async () => {
+ const wrapper = mount();
+ expect(wrapper.find('textarea').hasClass('ant-input-lg')).toBe(true);
+ expect(wrapper.render()).toMatchSnapshot();
+ });
});
describe('TextArea allowClear', () => {
diff --git a/package.json b/package.json
index 0d35c130a1..47becb3c9c 100644
--- a/package.json
+++ b/package.json
@@ -125,7 +125,7 @@
"rc-drawer": "~4.1.0",
"rc-dropdown": "~3.2.0",
"rc-field-form": "~1.12.0",
- "rc-image": "~3.2.1",
+ "rc-image": "~4.0.0",
"rc-input-number": "~6.1.0",
"rc-mentions": "~1.5.0",
"rc-menu": "~8.8.2",