mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
feat: introduce rc-input (#34206)
* feat: introduce rc-input * fix: export InputRef alias * docs: fix demo * chore: code clean * test: fix lint * test: test coverage * chore: code clean * chore: code clean * test: update snapshot
This commit is contained in:
parent
faff0ec888
commit
bfebb88bdb
@ -107,7 +107,7 @@ exports[`renders ./components/auto-complete/demo/certain-category.md extend cont
|
|||||||
class="ant-select-selection-search"
|
class="ant-select-selection-search"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-select-selection-search-input"
|
class="ant-input-group-wrapper ant-input-search ant-input-search-large ant-select-selection-search-input ant-input-group-wrapper-lg"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-wrapper ant-input-group"
|
class="ant-input-wrapper ant-input-group"
|
||||||
@ -1989,7 +1989,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md extend co
|
|||||||
class="ant-select-selection-search"
|
class="ant-select-selection-search"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button ant-select-selection-search-input"
|
class="ant-input-group-wrapper ant-input-search ant-input-search-large ant-input-search-with-button ant-select-selection-search-input ant-input-group-wrapper-lg"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-wrapper ant-input-group"
|
class="ant-input-wrapper ant-input-group"
|
||||||
|
@ -79,7 +79,7 @@ exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1
|
|||||||
class="ant-select-selection-search"
|
class="ant-select-selection-search"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-select-selection-search-input"
|
class="ant-input-group-wrapper ant-input-search ant-input-search-large ant-select-selection-search-input ant-input-group-wrapper-lg"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-wrapper ant-input-group"
|
class="ant-input-wrapper ant-input-group"
|
||||||
@ -1118,7 +1118,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
|
|||||||
class="ant-select-selection-search"
|
class="ant-select-selection-search"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button ant-select-selection-search-input"
|
class="ant-input-group-wrapper ant-input-search ant-input-search-large ant-input-search-with-button ant-select-selection-search-input ant-input-group-wrapper-lg"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-wrapper ant-input-group"
|
class="ant-input-wrapper ant-input-group"
|
||||||
|
@ -13744,7 +13744,7 @@ exports[`ConfigProvider components Input configProvider componentSize large 1`]
|
|||||||
value=""
|
value=""
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
class="config-input-group-wrapper config-input-group-wrapper-lg config-input-search config-input-search-large"
|
class="config-input-group-wrapper config-input-search config-input-search-large config-input-group-wrapper-lg"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="config-input-wrapper config-input-group"
|
class="config-input-wrapper config-input-group"
|
||||||
@ -13786,11 +13786,11 @@ exports[`ConfigProvider components Input configProvider componentSize large 1`]
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="config-input-affix-wrapper config-input-affix-wrapper-lg config-input-password"
|
class="config-input-affix-wrapper config-input-password config-input-affix-wrapper-lg"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
action="click"
|
action="click"
|
||||||
class="config-input config-input-lg"
|
class="config-input"
|
||||||
type="password"
|
type="password"
|
||||||
value=""
|
value=""
|
||||||
/>
|
/>
|
||||||
|
@ -20704,24 +20704,29 @@ exports[`renders ./components/form/demo/validate-static.md extend context correc
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden ant-input-clear-icon-has-suffix"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon-has-suffix ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="ant-input-feedback-icon"
|
class="ant-input-feedback-icon"
|
||||||
@ -20875,24 +20880,29 @@ exports[`renders ./components/form/demo/validate-static.md extend context correc
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden ant-input-clear-icon-has-suffix"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon-has-suffix ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
aria-label="eye-invisible"
|
aria-label="eye-invisible"
|
||||||
|
@ -8531,24 +8531,29 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden ant-input-clear-icon-has-suffix"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon-has-suffix ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="ant-input-feedback-icon"
|
class="ant-input-feedback-icon"
|
||||||
@ -8702,24 +8707,29 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden ant-input-clear-icon-has-suffix"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon-has-suffix ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
aria-label="eye-invisible"
|
aria-label="eye-invisible"
|
||||||
|
@ -92,7 +92,7 @@ export { default as Form } from './form';
|
|||||||
|
|
||||||
export { default as Grid } from './grid';
|
export { default as Grid } from './grid';
|
||||||
|
|
||||||
export type { InputProps } from './input';
|
export type { InputProps, InputRef } from './input';
|
||||||
export { default as Input } from './input';
|
export { default as Input } from './input';
|
||||||
|
|
||||||
export type { ImageProps } from './image';
|
export type { ImageProps } from './image';
|
||||||
|
@ -8,7 +8,6 @@ import { cloneElement } from '../_util/reactNode';
|
|||||||
import { getMergedStatus, getStatusClassNames, InputStatus } from '../_util/statusUtils';
|
import { getMergedStatus, getStatusClassNames, InputStatus } from '../_util/statusUtils';
|
||||||
import { tuple } from '../_util/type';
|
import { tuple } from '../_util/type';
|
||||||
import type { InputProps } from './Input';
|
import type { InputProps } from './Input';
|
||||||
import { getInputClassName, hasPrefixSuffix } from './utils';
|
|
||||||
|
|
||||||
const ClearableInputType = tuple('text', 'input');
|
const ClearableInputType = tuple('text', 'input');
|
||||||
|
|
||||||
@ -46,21 +45,8 @@ export interface ClearableInputProps extends BasicProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ClearableLabeledInput extends React.Component<ClearableInputProps> {
|
class ClearableLabeledInput extends React.Component<ClearableInputProps> {
|
||||||
/** @private Do Not use out of this class. We do not promise this is always keep. */
|
|
||||||
private containerRef = React.createRef<HTMLSpanElement>();
|
|
||||||
|
|
||||||
onInputMouseUp: React.MouseEventHandler = e => {
|
|
||||||
if (this.containerRef.current?.contains(e.target as Element)) {
|
|
||||||
const { triggerFocus } = this.props;
|
|
||||||
triggerFocus?.();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
renderClearIcon(prefixCls: string) {
|
renderClearIcon(prefixCls: string) {
|
||||||
const { allowClear, value, disabled, readOnly, handleReset, suffix } = this.props;
|
const { value, disabled, readOnly, handleReset, suffix } = this.props;
|
||||||
if (!allowClear) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const needClear = !disabled && !readOnly && value;
|
const needClear = !disabled && !readOnly && value;
|
||||||
const className = `${prefixCls}-clear-icon`;
|
const className = `${prefixCls}-clear-icon`;
|
||||||
return (
|
return (
|
||||||
@ -81,151 +67,6 @@ class ClearableLabeledInput extends React.Component<ClearableInputProps> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderSuffix(prefixCls: string) {
|
|
||||||
const { suffix, allowClear } = this.props;
|
|
||||||
if (suffix || allowClear) {
|
|
||||||
return (
|
|
||||||
<span className={`${prefixCls}-suffix`}>
|
|
||||||
{this.renderClearIcon(prefixCls)}
|
|
||||||
{suffix}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
renderLabeledIcon(
|
|
||||||
prefixCls: string,
|
|
||||||
element: React.ReactElement,
|
|
||||||
statusContext: FormItemStatusContextProps,
|
|
||||||
) {
|
|
||||||
const {
|
|
||||||
focused,
|
|
||||||
value,
|
|
||||||
prefix,
|
|
||||||
className,
|
|
||||||
size,
|
|
||||||
suffix,
|
|
||||||
disabled,
|
|
||||||
allowClear,
|
|
||||||
direction,
|
|
||||||
style,
|
|
||||||
readOnly,
|
|
||||||
bordered,
|
|
||||||
hidden,
|
|
||||||
status: customStatus,
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const { status: contextStatus, hasFeedback } = statusContext;
|
|
||||||
|
|
||||||
if (!hasPrefixSuffix(this.props)) {
|
|
||||||
return cloneElement(element, {
|
|
||||||
value,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const suffixNode = this.renderSuffix(prefixCls);
|
|
||||||
const prefixNode = prefix ? <span className={`${prefixCls}-prefix`}>{prefix}</span> : null;
|
|
||||||
|
|
||||||
const affixWrapperCls = classNames(
|
|
||||||
`${prefixCls}-affix-wrapper`,
|
|
||||||
{
|
|
||||||
[`${prefixCls}-affix-wrapper-focused`]: focused,
|
|
||||||
[`${prefixCls}-affix-wrapper-disabled`]: disabled,
|
|
||||||
[`${prefixCls}-affix-wrapper-sm`]: size === 'small',
|
|
||||||
[`${prefixCls}-affix-wrapper-lg`]: size === 'large',
|
|
||||||
[`${prefixCls}-affix-wrapper-input-with-clear-btn`]: suffix && allowClear && value,
|
|
||||||
[`${prefixCls}-affix-wrapper-rtl`]: direction === 'rtl',
|
|
||||||
[`${prefixCls}-affix-wrapper-readonly`]: readOnly,
|
|
||||||
[`${prefixCls}-affix-wrapper-borderless`]: !bordered,
|
|
||||||
// className will go to addon wrapper
|
|
||||||
[`${className}`]: !hasAddon(this.props) && className,
|
|
||||||
},
|
|
||||||
getStatusClassNames(
|
|
||||||
`${prefixCls}-affix-wrapper`,
|
|
||||||
getMergedStatus(contextStatus, customStatus),
|
|
||||||
hasFeedback,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return (
|
|
||||||
<span
|
|
||||||
ref={this.containerRef}
|
|
||||||
className={affixWrapperCls}
|
|
||||||
style={style}
|
|
||||||
onMouseUp={this.onInputMouseUp}
|
|
||||||
hidden={hidden}
|
|
||||||
>
|
|
||||||
{prefixNode}
|
|
||||||
{cloneElement(element, {
|
|
||||||
style: null,
|
|
||||||
value,
|
|
||||||
className: getInputClassName(prefixCls, bordered, size, disabled),
|
|
||||||
})}
|
|
||||||
{suffixNode}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderInputWithLabel(
|
|
||||||
prefixCls: string,
|
|
||||||
labeledElement: React.ReactElement,
|
|
||||||
statusContext: FormItemStatusContextProps,
|
|
||||||
) {
|
|
||||||
const {
|
|
||||||
addonBefore,
|
|
||||||
addonAfter,
|
|
||||||
style,
|
|
||||||
size,
|
|
||||||
className,
|
|
||||||
direction,
|
|
||||||
hidden,
|
|
||||||
status: customStatus,
|
|
||||||
} = this.props;
|
|
||||||
const { status: contextStatus, hasFeedback } = statusContext;
|
|
||||||
// Not wrap when there is not addons
|
|
||||||
if (!hasAddon(this.props)) {
|
|
||||||
return labeledElement;
|
|
||||||
}
|
|
||||||
|
|
||||||
const wrapperClassName = `${prefixCls}-group`;
|
|
||||||
const addonClassName = `${wrapperClassName}-addon`;
|
|
||||||
const addonBeforeNode = addonBefore ? (
|
|
||||||
<span className={addonClassName}>{addonBefore}</span>
|
|
||||||
) : null;
|
|
||||||
const addonAfterNode = addonAfter ? <span className={addonClassName}>{addonAfter}</span> : null;
|
|
||||||
|
|
||||||
const mergedWrapperClassName = classNames(`${prefixCls}-wrapper`, wrapperClassName, {
|
|
||||||
[`${wrapperClassName}-rtl`]: direction === 'rtl',
|
|
||||||
});
|
|
||||||
|
|
||||||
const mergedGroupClassName = classNames(
|
|
||||||
`${prefixCls}-group-wrapper`,
|
|
||||||
{
|
|
||||||
[`${prefixCls}-group-wrapper-sm`]: size === 'small',
|
|
||||||
[`${prefixCls}-group-wrapper-lg`]: size === 'large',
|
|
||||||
[`${prefixCls}-group-wrapper-rtl`]: direction === 'rtl',
|
|
||||||
},
|
|
||||||
getStatusClassNames(
|
|
||||||
`${prefixCls}-group-wrapper`,
|
|
||||||
getMergedStatus(contextStatus, customStatus),
|
|
||||||
hasFeedback,
|
|
||||||
),
|
|
||||||
className,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Need another wrapper for changing display:table to display:inline-block
|
|
||||||
// and put style prop in wrapper
|
|
||||||
return (
|
|
||||||
<span className={mergedGroupClassName} style={style} hidden={hidden}>
|
|
||||||
<span className={mergedWrapperClassName}>
|
|
||||||
{addonBeforeNode}
|
|
||||||
{cloneElement(labeledElement, { style: null })}
|
|
||||||
{addonAfterNode}
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderTextAreaWithClearIcon(
|
renderTextAreaWithClearIcon(
|
||||||
prefixCls: string,
|
prefixCls: string,
|
||||||
element: React.ReactElement,
|
element: React.ReactElement,
|
||||||
@ -283,11 +124,6 @@ class ClearableLabeledInput extends React.Component<ClearableInputProps> {
|
|||||||
if (inputType === ClearableInputType[0]) {
|
if (inputType === ClearableInputType[0]) {
|
||||||
return this.renderTextAreaWithClearIcon(prefixCls, element, statusContext);
|
return this.renderTextAreaWithClearIcon(prefixCls, element, statusContext);
|
||||||
}
|
}
|
||||||
return this.renderInputWithLabel(
|
|
||||||
prefixCls,
|
|
||||||
this.renderLabeledIcon(prefixCls, element, statusContext),
|
|
||||||
statusContext,
|
|
||||||
);
|
|
||||||
}}
|
}}
|
||||||
</FormItemStatusContext.Consumer>
|
</FormItemStatusContext.Consumer>
|
||||||
);
|
);
|
||||||
|
@ -1,69 +1,25 @@
|
|||||||
import * as React from 'react';
|
import React, { forwardRef, useContext, useEffect, useRef } from 'react';
|
||||||
|
import RcInput, { InputProps as RcInputProps, InputRef } from 'rc-input';
|
||||||
|
import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import omit from 'rc-util/lib/omit';
|
import { composeRef } from 'rc-util/lib/ref';
|
||||||
import { ValidateStatus } from '../form/FormItem';
|
|
||||||
import type Group from './Group';
|
|
||||||
import type Search from './Search';
|
|
||||||
import type TextArea from './TextArea';
|
|
||||||
import type Password from './Password';
|
|
||||||
import { LiteralUnion } from '../_util/type';
|
|
||||||
import ClearableLabeledInput from './ClearableLabeledInput';
|
|
||||||
import { ConfigConsumer, ConfigConsumerProps, DirectionType } from '../config-provider';
|
|
||||||
import SizeContext, { SizeType } from '../config-provider/SizeContext';
|
import SizeContext, { SizeType } from '../config-provider/SizeContext';
|
||||||
import devWarning from '../_util/devWarning';
|
import {
|
||||||
import { getInputClassName, hasPrefixSuffix } from './utils';
|
getFeedbackIcon,
|
||||||
|
getMergedStatus,
|
||||||
|
getStatusClassNames,
|
||||||
|
InputStatus,
|
||||||
|
} from '../_util/statusUtils';
|
||||||
|
import { ConfigContext } from '../config-provider';
|
||||||
import { FormItemStatusContext } from '../form/context';
|
import { FormItemStatusContext } from '../form/context';
|
||||||
import { getFeedbackIcon, InputStatus, getMergedStatus } from '../_util/statusUtils';
|
import { hasPrefixSuffix } from './utils';
|
||||||
|
import devWarning from '../_util/devWarning';
|
||||||
|
|
||||||
export interface InputFocusOptions extends FocusOptions {
|
export interface InputFocusOptions extends FocusOptions {
|
||||||
cursor?: 'start' | 'end' | 'all';
|
cursor?: 'start' | 'end' | 'all';
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ShowCountProps {
|
export type { InputRef };
|
||||||
formatter: (args: { count: number; maxLength?: number }) => React.ReactNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface InputProps
|
|
||||||
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
|
|
||||||
prefixCls?: string;
|
|
||||||
size?: SizeType;
|
|
||||||
// ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#%3Cinput%3E_types
|
|
||||||
type?: LiteralUnion<
|
|
||||||
| 'button'
|
|
||||||
| 'checkbox'
|
|
||||||
| 'color'
|
|
||||||
| 'date'
|
|
||||||
| 'datetime-local'
|
|
||||||
| 'email'
|
|
||||||
| 'file'
|
|
||||||
| 'hidden'
|
|
||||||
| 'image'
|
|
||||||
| 'month'
|
|
||||||
| 'number'
|
|
||||||
| 'password'
|
|
||||||
| 'radio'
|
|
||||||
| 'range'
|
|
||||||
| 'reset'
|
|
||||||
| 'search'
|
|
||||||
| 'submit'
|
|
||||||
| 'tel'
|
|
||||||
| 'text'
|
|
||||||
| 'time'
|
|
||||||
| 'url'
|
|
||||||
| 'week',
|
|
||||||
string
|
|
||||||
>;
|
|
||||||
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
||||||
addonBefore?: React.ReactNode;
|
|
||||||
addonAfter?: React.ReactNode;
|
|
||||||
prefix?: React.ReactNode;
|
|
||||||
suffix?: React.ReactNode;
|
|
||||||
allowClear?: boolean;
|
|
||||||
showCount?: boolean | ShowCountProps;
|
|
||||||
bordered?: boolean;
|
|
||||||
htmlSize?: number;
|
|
||||||
status?: InputStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function fixControlledValue<T>(value: T) {
|
export function fixControlledValue<T>(value: T) {
|
||||||
if (typeof value === 'undefined' || value === null) {
|
if (typeof value === 'undefined' || value === null) {
|
||||||
@ -154,303 +110,133 @@ export function triggerFocus(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface InputState {
|
export interface InputProps
|
||||||
value: any;
|
extends Omit<
|
||||||
focused: boolean;
|
RcInputProps,
|
||||||
/** `value` from prev props */
|
'wrapperClassName' | 'groupClassName' | 'inputClassName' | 'affixWrapperClassName' | 'clearIcon'
|
||||||
prevValue: any;
|
> {
|
||||||
|
size?: SizeType;
|
||||||
|
status?: InputStatus;
|
||||||
|
bordered?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Input extends React.Component<InputProps, InputState> {
|
const Input = forwardRef<InputRef, InputProps>((props, ref) => {
|
||||||
static Group: typeof Group;
|
const {
|
||||||
|
prefixCls: customizePrefixCls,
|
||||||
|
bordered = true,
|
||||||
|
status: customStatus,
|
||||||
|
size: customSize,
|
||||||
|
onBlur,
|
||||||
|
onFocus,
|
||||||
|
suffix,
|
||||||
|
...rest
|
||||||
|
} = props;
|
||||||
|
const { getPrefixCls, direction, input } = React.useContext(ConfigContext);
|
||||||
|
|
||||||
static Search: typeof Search;
|
const prefixCls = getPrefixCls('input', customizePrefixCls);
|
||||||
|
const inputRef = useRef<InputRef>(null);
|
||||||
|
|
||||||
static TextArea: typeof TextArea;
|
// ===================== Status =====================
|
||||||
|
const size = React.useContext(SizeContext);
|
||||||
|
const mergedSize = customSize || size;
|
||||||
|
|
||||||
static Password: typeof Password;
|
// ===================== Status =====================
|
||||||
|
const { status: contextStatus, hasFeedback } = useContext(FormItemStatusContext);
|
||||||
|
const mergedStatus = getMergedStatus(contextStatus, customStatus);
|
||||||
|
|
||||||
static defaultProps = {
|
// ===================== Focus warning =====================
|
||||||
type: 'text',
|
const inputHasPrefixSuffix = hasPrefixSuffix(props);
|
||||||
};
|
const prevHasPrefixSuffix = useRef<boolean>(inputHasPrefixSuffix);
|
||||||
|
useEffect(() => {
|
||||||
input!: HTMLInputElement;
|
if (inputHasPrefixSuffix && !prevHasPrefixSuffix.current) {
|
||||||
|
|
||||||
clearableInput!: ClearableLabeledInput;
|
|
||||||
|
|
||||||
removePasswordTimeout: any;
|
|
||||||
|
|
||||||
direction: DirectionType = 'ltr';
|
|
||||||
|
|
||||||
constructor(props: InputProps) {
|
|
||||||
super(props);
|
|
||||||
const value = typeof props.value === 'undefined' ? props.defaultValue : props.value;
|
|
||||||
this.state = {
|
|
||||||
value,
|
|
||||||
focused: false,
|
|
||||||
// eslint-disable-next-line react/no-unused-state
|
|
||||||
prevValue: props.value,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
static getDerivedStateFromProps(nextProps: InputProps, { prevValue }: InputState) {
|
|
||||||
const newState: Partial<InputState> = { prevValue: nextProps.value };
|
|
||||||
if (nextProps.value !== undefined || prevValue !== nextProps.value) {
|
|
||||||
newState.value = nextProps.value;
|
|
||||||
}
|
|
||||||
if (nextProps.disabled) {
|
|
||||||
newState.focused = false;
|
|
||||||
}
|
|
||||||
return newState;
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
this.clearPasswordValueAttribute();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Since polyfill `getSnapshotBeforeUpdate` need work with `componentDidUpdate`.
|
|
||||||
// We keep an empty function here.
|
|
||||||
componentDidUpdate() {}
|
|
||||||
|
|
||||||
getSnapshotBeforeUpdate(prevProps: InputProps) {
|
|
||||||
if (hasPrefixSuffix(prevProps) !== hasPrefixSuffix(this.props)) {
|
|
||||||
devWarning(
|
devWarning(
|
||||||
this.input !== document.activeElement,
|
document.activeElement === inputRef.current?.input,
|
||||||
'Input',
|
'Input',
|
||||||
`When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ`,
|
`When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return null;
|
prevHasPrefixSuffix.current = inputHasPrefixSuffix;
|
||||||
}
|
}, [inputHasPrefixSuffix]);
|
||||||
|
|
||||||
componentWillUnmount() {
|
// ===================== Remove Password value =====================
|
||||||
if (this.removePasswordTimeout) {
|
const removePasswordTimeoutRef = useRef<number[]>([]);
|
||||||
clearTimeout(this.removePasswordTimeout);
|
const removePasswordTimeout = () => {
|
||||||
}
|
removePasswordTimeoutRef.current.push(
|
||||||
}
|
window.setTimeout(() => {
|
||||||
|
if (
|
||||||
focus = (option?: InputFocusOptions) => {
|
inputRef.current?.input &&
|
||||||
triggerFocus(this.input, option);
|
inputRef.current?.input.getAttribute('type') === 'password' &&
|
||||||
|
inputRef.current?.input.hasAttribute('value')
|
||||||
|
) {
|
||||||
|
inputRef.current?.input.removeAttribute('value');
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
blur() {
|
useEffect(() => {
|
||||||
this.input.blur();
|
removePasswordTimeout();
|
||||||
}
|
return () => removePasswordTimeoutRef.current.forEach(item => window.clearTimeout(item));
|
||||||
|
}, []);
|
||||||
|
|
||||||
setSelectionRange(start: number, end: number, direction?: 'forward' | 'backward' | 'none') {
|
const handleBlur = (e: React.FocusEvent<HTMLInputElement>) => {
|
||||||
this.input.setSelectionRange(start, end, direction);
|
removePasswordTimeout();
|
||||||
}
|
|
||||||
|
|
||||||
select() {
|
|
||||||
this.input.select();
|
|
||||||
}
|
|
||||||
|
|
||||||
saveClearableInput = (input: ClearableLabeledInput) => {
|
|
||||||
this.clearableInput = input;
|
|
||||||
};
|
|
||||||
|
|
||||||
saveInput = (input: HTMLInputElement) => {
|
|
||||||
this.input = input;
|
|
||||||
};
|
|
||||||
|
|
||||||
onFocus: React.FocusEventHandler<HTMLInputElement> = e => {
|
|
||||||
const { onFocus } = this.props;
|
|
||||||
this.setState({ focused: true }, this.clearPasswordValueAttribute);
|
|
||||||
onFocus?.(e);
|
|
||||||
};
|
|
||||||
|
|
||||||
onBlur: React.FocusEventHandler<HTMLInputElement> = e => {
|
|
||||||
const { onBlur } = this.props;
|
|
||||||
this.setState({ focused: false }, this.clearPasswordValueAttribute);
|
|
||||||
onBlur?.(e);
|
onBlur?.(e);
|
||||||
};
|
};
|
||||||
|
|
||||||
setValue(value: string, callback?: () => void) {
|
const handleFocus = (e: React.FocusEvent<HTMLInputElement>) => {
|
||||||
if (this.props.value === undefined) {
|
removePasswordTimeout();
|
||||||
this.setState({ value }, callback);
|
onFocus?.(e);
|
||||||
} else {
|
|
||||||
callback?.();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
handleReset = (e: React.MouseEvent<HTMLElement, MouseEvent>) => {
|
|
||||||
this.setValue('', () => {
|
|
||||||
this.focus();
|
|
||||||
});
|
|
||||||
resolveOnChange(this.input, e, this.props.onChange);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
renderInput = (
|
const suffixNode = (hasFeedback || suffix) && (
|
||||||
prefixCls: string,
|
<>
|
||||||
size: SizeType | undefined,
|
{suffix}
|
||||||
bordered: boolean,
|
{hasFeedback && getFeedbackIcon(prefixCls, mergedStatus)}
|
||||||
status?: ValidateStatus,
|
</>
|
||||||
input: ConfigConsumerProps['input'] = {},
|
);
|
||||||
) => {
|
|
||||||
const {
|
|
||||||
className,
|
|
||||||
addonBefore,
|
|
||||||
addonAfter,
|
|
||||||
size: customizeSize,
|
|
||||||
disabled,
|
|
||||||
htmlSize,
|
|
||||||
} = this.props;
|
|
||||||
// Fix https://fb.me/react-unknown-prop
|
|
||||||
const otherProps = omit(this.props as InputProps & { inputType: any }, [
|
|
||||||
'prefixCls',
|
|
||||||
'onPressEnter',
|
|
||||||
'addonBefore',
|
|
||||||
'addonAfter',
|
|
||||||
'prefix',
|
|
||||||
'suffix',
|
|
||||||
'allowClear',
|
|
||||||
// Input elements must be either controlled or uncontrolled,
|
|
||||||
// specify either the value prop, or the defaultValue prop, but not both.
|
|
||||||
'defaultValue',
|
|
||||||
'size',
|
|
||||||
'inputType',
|
|
||||||
'bordered',
|
|
||||||
'htmlSize',
|
|
||||||
'showCount',
|
|
||||||
'status',
|
|
||||||
]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<input
|
<RcInput
|
||||||
autoComplete={input.autoComplete}
|
ref={composeRef(ref, inputRef)}
|
||||||
{...otherProps}
|
prefixCls={prefixCls}
|
||||||
onChange={this.handleChange}
|
autoComplete={input?.autoComplete}
|
||||||
onFocus={this.onFocus}
|
{...rest}
|
||||||
onBlur={this.onBlur}
|
onBlur={handleBlur}
|
||||||
onKeyDown={this.handleKeyDown}
|
onFocus={handleFocus}
|
||||||
className={classNames(
|
suffix={suffixNode}
|
||||||
getInputClassName(
|
clearIcon={<CloseCircleFilled />}
|
||||||
prefixCls,
|
inputClassName={classNames(
|
||||||
bordered,
|
{
|
||||||
customizeSize || size,
|
[`${prefixCls}-sm`]: mergedSize === 'small',
|
||||||
disabled,
|
[`${prefixCls}-lg`]: mergedSize === 'large',
|
||||||
this.direction,
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||||
status,
|
[`${prefixCls}-borderless`]: !bordered,
|
||||||
),
|
},
|
||||||
{
|
getStatusClassNames(prefixCls, mergedStatus),
|
||||||
[className!]: className && !addonBefore && !addonAfter,
|
)}
|
||||||
},
|
affixWrapperClassName={classNames(
|
||||||
)}
|
{
|
||||||
ref={this.saveInput}
|
[`${prefixCls}-affix-wrapper-sm`]: mergedSize === 'small',
|
||||||
size={htmlSize}
|
[`${prefixCls}-affix-wrapper-lg`]: mergedSize === 'large',
|
||||||
/>
|
[`${prefixCls}-affix-wrapper-rtl`]: direction === 'rtl',
|
||||||
);
|
[`${prefixCls}-affix-wrapper-borderless`]: !bordered,
|
||||||
};
|
},
|
||||||
|
getStatusClassNames(`${prefixCls}-affix-wrapper`, mergedStatus, hasFeedback),
|
||||||
clearPasswordValueAttribute = () => {
|
)}
|
||||||
// https://github.com/ant-design/ant-design/issues/20541
|
wrapperClassName={classNames({
|
||||||
this.removePasswordTimeout = setTimeout(() => {
|
[`${prefixCls}-group-rtl`]: direction === 'rtl',
|
||||||
if (
|
})}
|
||||||
this.input &&
|
groupClassName={classNames(
|
||||||
this.input.getAttribute('type') === 'password' &&
|
{
|
||||||
this.input.hasAttribute('value')
|
[`${prefixCls}-group-wrapper-sm`]: mergedSize === 'small',
|
||||||
) {
|
[`${prefixCls}-group-wrapper-lg`]: mergedSize === 'large',
|
||||||
this.input.removeAttribute('value');
|
[`${prefixCls}-group-wrapper-rtl`]: direction === 'rtl',
|
||||||
}
|
},
|
||||||
});
|
getStatusClassNames(`${prefixCls}-group-wrapper`, mergedStatus, hasFeedback),
|
||||||
};
|
)}
|
||||||
|
/>
|
||||||
handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
);
|
||||||
this.setValue(e.target.value, this.clearPasswordValueAttribute);
|
});
|
||||||
resolveOnChange(this.input, e, this.props.onChange);
|
|
||||||
};
|
|
||||||
|
|
||||||
handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
||||||
const { onPressEnter, onKeyDown } = this.props;
|
|
||||||
if (onPressEnter && e.keyCode === 13) {
|
|
||||||
onPressEnter(e);
|
|
||||||
}
|
|
||||||
onKeyDown?.(e);
|
|
||||||
};
|
|
||||||
|
|
||||||
renderShowCountSuffix = (prefixCls: string) => {
|
|
||||||
const { value } = this.state;
|
|
||||||
const { maxLength, suffix, showCount } = this.props;
|
|
||||||
// Max length value
|
|
||||||
const hasMaxLength = Number(maxLength) > 0;
|
|
||||||
|
|
||||||
if (suffix || showCount) {
|
|
||||||
const valueLength = [...fixControlledValue(value)].length;
|
|
||||||
let dataCount = null;
|
|
||||||
if (typeof showCount === 'object') {
|
|
||||||
dataCount = showCount.formatter({ count: valueLength, maxLength });
|
|
||||||
} else {
|
|
||||||
dataCount = `${valueLength}${hasMaxLength ? ` / ${maxLength}` : ''}`;
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
!!showCount && (
|
|
||||||
<span
|
|
||||||
className={classNames(`${prefixCls}-show-count-suffix`, {
|
|
||||||
[`${prefixCls}-show-count-has-suffix`]: !!suffix,
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
{dataCount}
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
renderSuffix = (prefixCls: string, hasFeedback?: boolean, status?: ValidateStatus) => {
|
|
||||||
const { suffix, showCount } = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
(showCount || suffix || hasFeedback) && (
|
|
||||||
<>
|
|
||||||
{this.renderShowCountSuffix(prefixCls)}
|
|
||||||
{suffix}
|
|
||||||
{hasFeedback && getFeedbackIcon(prefixCls, status)}
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
renderComponent = ({ getPrefixCls, direction, input }: ConfigConsumerProps) => {
|
|
||||||
const { value, focused } = this.state;
|
|
||||||
const { prefixCls: customizePrefixCls, bordered = true, status: customStatus } = this.props;
|
|
||||||
const prefixCls = getPrefixCls('input', customizePrefixCls);
|
|
||||||
this.direction = direction;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<SizeContext.Consumer>
|
|
||||||
{size => (
|
|
||||||
<FormItemStatusContext.Consumer>
|
|
||||||
{({ status: contextStatus, hasFeedback }) => {
|
|
||||||
const mergedStatus = getMergedStatus(contextStatus, customStatus);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ClearableLabeledInput
|
|
||||||
size={size}
|
|
||||||
{...this.props}
|
|
||||||
prefixCls={prefixCls}
|
|
||||||
inputType="input"
|
|
||||||
value={fixControlledValue(value)}
|
|
||||||
element={this.renderInput(prefixCls, size, bordered, mergedStatus, input)}
|
|
||||||
handleReset={this.handleReset}
|
|
||||||
ref={this.saveClearableInput}
|
|
||||||
direction={direction}
|
|
||||||
focused={focused}
|
|
||||||
triggerFocus={this.focus}
|
|
||||||
bordered={bordered}
|
|
||||||
suffix={this.renderSuffix(prefixCls, hasFeedback, mergedStatus)}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</FormItemStatusContext.Consumer>
|
|
||||||
)}
|
|
||||||
</SizeContext.Consumer>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return <ConfigConsumer>{this.renderComponent}</ConfigConsumer>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Input;
|
export default Input;
|
||||||
|
@ -5,8 +5,8 @@ import EyeOutlined from '@ant-design/icons/EyeOutlined';
|
|||||||
import EyeInvisibleOutlined from '@ant-design/icons/EyeInvisibleOutlined';
|
import EyeInvisibleOutlined from '@ant-design/icons/EyeInvisibleOutlined';
|
||||||
|
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
import Input, { InputRef, InputProps } from './Input';
|
||||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||||
import Input, { InputProps } from './Input';
|
|
||||||
|
|
||||||
export interface PasswordProps extends InputProps {
|
export interface PasswordProps extends InputProps {
|
||||||
readonly inputPrefixCls?: string;
|
readonly inputPrefixCls?: string;
|
||||||
@ -20,7 +20,7 @@ const ActionMap: Record<string, string> = {
|
|||||||
hover: 'onMouseOver',
|
hover: 'onMouseOver',
|
||||||
};
|
};
|
||||||
|
|
||||||
const Password = React.forwardRef<any, PasswordProps>((props, ref) => {
|
const Password = React.forwardRef<InputRef, PasswordProps>((props, ref) => {
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
|
|
||||||
const onVisibleChange = () => {
|
const onVisibleChange = () => {
|
||||||
|
@ -2,7 +2,7 @@ import * as React from 'react';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { composeRef } from 'rc-util/lib/ref';
|
import { composeRef } from 'rc-util/lib/ref';
|
||||||
import SearchOutlined from '@ant-design/icons/SearchOutlined';
|
import SearchOutlined from '@ant-design/icons/SearchOutlined';
|
||||||
import Input, { InputProps } from './Input';
|
import Input, { InputProps, InputRef } from './Input';
|
||||||
import Button from '../button';
|
import Button from '../button';
|
||||||
import SizeContext from '../config-provider/SizeContext';
|
import SizeContext from '../config-provider/SizeContext';
|
||||||
import { ConfigContext } from '../config-provider';
|
import { ConfigContext } from '../config-provider';
|
||||||
@ -21,7 +21,7 @@ export interface SearchProps extends InputProps {
|
|||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Search = React.forwardRef<Input, SearchProps>((props, ref) => {
|
const Search = React.forwardRef<InputRef, SearchProps>((props, ref) => {
|
||||||
const {
|
const {
|
||||||
prefixCls: customizePrefixCls,
|
prefixCls: customizePrefixCls,
|
||||||
inputPrefixCls: customizeInputPrefixCls,
|
inputPrefixCls: customizeInputPrefixCls,
|
||||||
@ -42,7 +42,7 @@ const Search = React.forwardRef<Input, SearchProps>((props, ref) => {
|
|||||||
|
|
||||||
const size = customizeSize || contextSize;
|
const size = customizeSize || contextSize;
|
||||||
|
|
||||||
const inputRef = React.useRef<Input>(null);
|
const inputRef = React.useRef<InputRef>(null);
|
||||||
|
|
||||||
const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
if (e && e.target && e.type === 'click' && customOnSearch) {
|
if (e && e.target && e.type === 'click' && customOnSearch) {
|
||||||
@ -61,7 +61,7 @@ const Search = React.forwardRef<Input, SearchProps>((props, ref) => {
|
|||||||
|
|
||||||
const onSearch = (e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLInputElement>) => {
|
const onSearch = (e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLInputElement>) => {
|
||||||
if (customOnSearch) {
|
if (customOnSearch) {
|
||||||
customOnSearch(inputRef.current?.input.value!, e);
|
customOnSearch(inputRef.current?.input?.value!, e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ const Search = React.forwardRef<Input, SearchProps>((props, ref) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Input
|
<Input
|
||||||
ref={composeRef<Input>(inputRef, ref)}
|
ref={composeRef<InputRef>(inputRef, ref)}
|
||||||
onPressEnter={onSearch}
|
onPressEnter={onSearch}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
size={size}
|
size={size}
|
||||||
|
@ -25,7 +25,7 @@ describe('Input.Password', () => {
|
|||||||
|
|
||||||
it('should support size', () => {
|
it('should support size', () => {
|
||||||
const wrapper = mount(<Password size="large" />);
|
const wrapper = mount(<Password size="large" />);
|
||||||
expect(wrapper.find('input').hasClass('ant-input-lg')).toBe(true);
|
expect(wrapper.find('.ant-input-affix-wrapper-lg')).toBeTruthy();
|
||||||
expect(wrapper.render()).toMatchSnapshot();
|
expect(wrapper.render()).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
exports[`Input.Password rtl render component should be rendered correctly in RTL direction 1`] = `
|
exports[`Input.Password rtl render component should be rendered correctly in RTL direction 1`] = `
|
||||||
<span
|
<span
|
||||||
class="ant-input-affix-wrapper ant-input-affix-wrapper-rtl ant-input-password"
|
class="ant-input-affix-wrapper ant-input-password ant-input-affix-wrapper-rtl"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
action="click"
|
action="click"
|
||||||
@ -159,11 +159,11 @@ exports[`Input.Password should change type when click 3`] = `
|
|||||||
|
|
||||||
exports[`Input.Password should support size 1`] = `
|
exports[`Input.Password should support size 1`] = `
|
||||||
<span
|
<span
|
||||||
class="ant-input-affix-wrapper ant-input-affix-wrapper-lg ant-input-password ant-input-password-large"
|
class="ant-input-affix-wrapper ant-input-password ant-input-password-large ant-input-affix-wrapper-lg"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
action="click"
|
action="click"
|
||||||
class="ant-input ant-input-lg"
|
class="ant-input"
|
||||||
type="password"
|
type="password"
|
||||||
value=""
|
value=""
|
||||||
/>
|
/>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
exports[`Input.Search rtl render component should be rendered correctly in RTL direction 1`] = `
|
exports[`Input.Search rtl render component should be rendered correctly in RTL direction 1`] = `
|
||||||
<span
|
<span
|
||||||
class="ant-input-group-wrapper ant-input-group-wrapper-rtl ant-input-search ant-input-search-rtl"
|
class="ant-input-group-wrapper ant-input-search ant-input-search-rtl ant-input-group-wrapper-rtl"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-wrapper ant-input-group ant-input-group-rtl"
|
class="ant-input-wrapper ant-input-group ant-input-group-rtl"
|
||||||
|
@ -4857,24 +4857,29 @@ Array [
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>,
|
</span>,
|
||||||
@ -5004,7 +5009,7 @@ exports[`renders ./components/input/demo/borderless-debug.md extend context corr
|
|||||||
class="ant-input-affix-wrapper ant-input-affix-wrapper-borderless"
|
class="ant-input-affix-wrapper ant-input-affix-wrapper-borderless"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-borderless"
|
class="ant-input"
|
||||||
placeholder="Unbordered"
|
placeholder="Unbordered"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@ -5013,24 +5018,29 @@ exports[`renders ./components/input/demo/borderless-debug.md extend context corr
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -5043,7 +5053,7 @@ exports[`renders ./components/input/demo/borderless-debug.md extend context corr
|
|||||||
¥
|
¥
|
||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-borderless"
|
class="ant-input"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
/>
|
/>
|
||||||
@ -5062,7 +5072,7 @@ exports[`renders ./components/input/demo/borderless-debug.md extend context corr
|
|||||||
¥
|
¥
|
||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-disabled ant-input-borderless"
|
class="ant-input ant-input-disabled"
|
||||||
disabled=""
|
disabled=""
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@ -5485,24 +5495,29 @@ exports[`renders ./components/input/demo/group.md extend context correctly 1`] =
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -5555,24 +5570,29 @@ exports[`renders ./components/input/demo/group.md extend context correctly 1`] =
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -8937,24 +8957,29 @@ exports[`renders ./components/input/demo/search-input.md extend context correctl
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -9018,24 +9043,29 @@ exports[`renders ./components/input/demo/search-input.md extend context correctl
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -9122,7 +9152,7 @@ exports[`renders ./components/input/demo/search-input.md extend context correctl
|
|||||||
style="margin-bottom:8px"
|
style="margin-bottom:8px"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button"
|
class="ant-input-group-wrapper ant-input-search ant-input-search-large ant-input-search-with-button ant-input-group-wrapper-lg"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-wrapper ant-input-group"
|
class="ant-input-wrapper ant-input-group"
|
||||||
@ -9131,7 +9161,7 @@ exports[`renders ./components/input/demo/search-input.md extend context correctl
|
|||||||
class="ant-input-affix-wrapper ant-input-affix-wrapper-lg"
|
class="ant-input-affix-wrapper ant-input-affix-wrapper-lg"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-lg"
|
class="ant-input"
|
||||||
placeholder="input search text"
|
placeholder="input search text"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@ -9140,24 +9170,29 @@ exports[`renders ./components/input/demo/search-input.md extend context correctl
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -9180,7 +9215,7 @@ exports[`renders ./components/input/demo/search-input.md extend context correctl
|
|||||||
class="ant-space-item"
|
class="ant-space-item"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button"
|
class="ant-input-group-wrapper ant-input-search ant-input-search-large ant-input-search-with-button ant-input-group-wrapper-lg"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-wrapper ant-input-group"
|
class="ant-input-wrapper ant-input-group"
|
||||||
@ -9189,7 +9224,7 @@ exports[`renders ./components/input/demo/search-input.md extend context correctl
|
|||||||
class="ant-input-affix-wrapper ant-input-affix-wrapper-lg"
|
class="ant-input-affix-wrapper ant-input-affix-wrapper-lg"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-lg"
|
class="ant-input"
|
||||||
placeholder="input search text"
|
placeholder="input search text"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@ -9336,7 +9371,7 @@ Array [
|
|||||||
<br />,
|
<br />,
|
||||||
<br />,
|
<br />,
|
||||||
<span
|
<span
|
||||||
class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button"
|
class="ant-input-group-wrapper ant-input-search ant-input-search-large ant-input-search-with-button ant-input-group-wrapper-lg"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-wrapper ant-input-group"
|
class="ant-input-wrapper ant-input-group"
|
||||||
@ -9450,7 +9485,7 @@ Array [
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-lg"
|
class="ant-input"
|
||||||
placeholder="large size"
|
placeholder="large size"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@ -9520,7 +9555,7 @@ Array [
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-sm"
|
class="ant-input"
|
||||||
placeholder="small size"
|
placeholder="small size"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
|
@ -1074,24 +1074,29 @@ Array [
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>,
|
</span>,
|
||||||
@ -1221,7 +1226,7 @@ exports[`renders ./components/input/demo/borderless-debug.md correctly 1`] = `
|
|||||||
class="ant-input-affix-wrapper ant-input-affix-wrapper-borderless"
|
class="ant-input-affix-wrapper ant-input-affix-wrapper-borderless"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-borderless"
|
class="ant-input"
|
||||||
placeholder="Unbordered"
|
placeholder="Unbordered"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@ -1230,24 +1235,29 @@ exports[`renders ./components/input/demo/borderless-debug.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -1260,7 +1270,7 @@ exports[`renders ./components/input/demo/borderless-debug.md correctly 1`] = `
|
|||||||
¥
|
¥
|
||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-borderless"
|
class="ant-input"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
/>
|
/>
|
||||||
@ -1279,7 +1289,7 @@ exports[`renders ./components/input/demo/borderless-debug.md correctly 1`] = `
|
|||||||
¥
|
¥
|
||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-disabled ant-input-borderless"
|
class="ant-input ant-input-disabled"
|
||||||
disabled=""
|
disabled=""
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@ -1596,24 +1606,29 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -1666,24 +1681,29 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -2711,24 +2731,29 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -2792,24 +2817,29 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -2896,7 +2926,7 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
|
|||||||
style="margin-bottom:8px"
|
style="margin-bottom:8px"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button"
|
class="ant-input-group-wrapper ant-input-search ant-input-search-large ant-input-search-with-button ant-input-group-wrapper-lg"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-wrapper ant-input-group"
|
class="ant-input-wrapper ant-input-group"
|
||||||
@ -2905,7 +2935,7 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
|
|||||||
class="ant-input-affix-wrapper ant-input-affix-wrapper-lg"
|
class="ant-input-affix-wrapper ant-input-affix-wrapper-lg"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-lg"
|
class="ant-input"
|
||||||
placeholder="input search text"
|
placeholder="input search text"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@ -2914,24 +2944,29 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -2954,7 +2989,7 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
|
|||||||
class="ant-space-item"
|
class="ant-space-item"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button"
|
class="ant-input-group-wrapper ant-input-search ant-input-search-large ant-input-search-with-button ant-input-group-wrapper-lg"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-wrapper ant-input-group"
|
class="ant-input-wrapper ant-input-group"
|
||||||
@ -2963,7 +2998,7 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
|
|||||||
class="ant-input-affix-wrapper ant-input-affix-wrapper-lg"
|
class="ant-input-affix-wrapper ant-input-affix-wrapper-lg"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-lg"
|
class="ant-input"
|
||||||
placeholder="input search text"
|
placeholder="input search text"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@ -3110,7 +3145,7 @@ Array [
|
|||||||
<br />,
|
<br />,
|
||||||
<br />,
|
<br />,
|
||||||
<span
|
<span
|
||||||
class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button"
|
class="ant-input-group-wrapper ant-input-search ant-input-search-large ant-input-search-with-button ant-input-group-wrapper-lg"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-input-wrapper ant-input-group"
|
class="ant-input-wrapper ant-input-group"
|
||||||
@ -3224,7 +3259,7 @@ Array [
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-lg"
|
class="ant-input"
|
||||||
placeholder="large size"
|
placeholder="large size"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
@ -3294,7 +3329,7 @@ Array [
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
class="ant-input ant-input-sm"
|
class="ant-input"
|
||||||
placeholder="small size"
|
placeholder="small size"
|
||||||
type="text"
|
type="text"
|
||||||
value=""
|
value=""
|
||||||
|
@ -13,24 +13,29 @@ exports[`Input allowClear should change type when click 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -49,24 +54,29 @@ exports[`Input allowClear should change type when click 2`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -85,24 +95,29 @@ exports[`Input allowClear should not show icon if defaultValue is undefined, nul
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -121,24 +136,29 @@ exports[`Input allowClear should not show icon if defaultValue is undefined, nul
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -157,24 +177,29 @@ exports[`Input allowClear should not show icon if defaultValue is undefined, nul
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -193,24 +218,29 @@ exports[`Input allowClear should not show icon if value is undefined, null or em
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -229,24 +259,29 @@ exports[`Input allowClear should not show icon if value is undefined, null or em
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -265,24 +300,29 @@ exports[`Input allowClear should not show icon if value is undefined, null or em
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
|
import { spyElementPrototypes } from 'rc-util/lib/test/domHook';
|
||||||
|
import { InputRef } from '../Input';
|
||||||
import Input from '..';
|
import Input from '..';
|
||||||
|
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
@ -30,8 +31,8 @@ describe('Input.Focus', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('start', () => {
|
it('start', () => {
|
||||||
const ref = React.createRef<Input>();
|
const ref = React.createRef<InputRef>();
|
||||||
mount(<Input ref={ref} defaultValue="light" />);
|
mount(<TextArea ref={ref} defaultValue="light" />);
|
||||||
ref.current!.focus({ cursor: 'start' });
|
ref.current!.focus({ cursor: 'start' });
|
||||||
|
|
||||||
expect(focus).toHaveBeenCalled();
|
expect(focus).toHaveBeenCalled();
|
||||||
@ -39,8 +40,8 @@ describe('Input.Focus', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('end', () => {
|
it('end', () => {
|
||||||
const ref = React.createRef<Input>();
|
const ref = React.createRef<InputRef>();
|
||||||
mount(<Input ref={ref} defaultValue="light" />);
|
mount(<TextArea ref={ref} defaultValue="light" />);
|
||||||
ref.current!.focus({ cursor: 'end' });
|
ref.current!.focus({ cursor: 'end' });
|
||||||
|
|
||||||
expect(focus).toHaveBeenCalled();
|
expect(focus).toHaveBeenCalled();
|
||||||
@ -62,6 +63,7 @@ describe('Input.Focus', () => {
|
|||||||
expect(wrapper.exists('.ant-input-affix-wrapper-focused')).toBeTruthy();
|
expect(wrapper.exists('.ant-input-affix-wrapper-focused')).toBeTruthy();
|
||||||
|
|
||||||
wrapper.setProps({ disabled: true });
|
wrapper.setProps({ disabled: true });
|
||||||
|
wrapper.update();
|
||||||
expect(wrapper.exists('.ant-input-affix-wrapper-focused')).toBeFalsy();
|
expect(wrapper.exists('.ant-input-affix-wrapper-focused')).toBeFalsy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,6 @@ import { mount } from 'enzyme';
|
|||||||
// eslint-disable-next-line import/no-unresolved
|
// eslint-disable-next-line import/no-unresolved
|
||||||
import Form from '../../form';
|
import Form from '../../form';
|
||||||
import Input from '..';
|
import Input from '..';
|
||||||
import focusTest from '../../../tests/shared/focusTest';
|
|
||||||
import mountTest from '../../../tests/shared/mountTest';
|
import mountTest from '../../../tests/shared/mountTest';
|
||||||
import rtlTest from '../../../tests/shared/rtlTest';
|
import rtlTest from '../../../tests/shared/rtlTest';
|
||||||
|
|
||||||
@ -18,7 +17,6 @@ describe('Input', () => {
|
|||||||
errorSpy.mockRestore();
|
errorSpy.mockRestore();
|
||||||
});
|
});
|
||||||
|
|
||||||
focusTest(Input);
|
|
||||||
mountTest(Input);
|
mountTest(Input);
|
||||||
mountTest(Input.Group);
|
mountTest(Input.Group);
|
||||||
|
|
||||||
@ -31,8 +29,9 @@ describe('Input', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('select()', () => {
|
it('select()', () => {
|
||||||
const wrapper = mount(<Input />);
|
const ref = React.createRef();
|
||||||
wrapper.instance().select();
|
mount(<Input ref={ref} />);
|
||||||
|
ref.current?.select();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support size', () => {
|
it('should support size', () => {
|
||||||
@ -63,8 +62,8 @@ describe('Input', () => {
|
|||||||
expect(errorSpy).not.toHaveBeenCalled();
|
expect(errorSpy).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
it('trigger warning', () => {
|
it('trigger warning', () => {
|
||||||
const wrapper = mount(<Input />, { attachTo: document.body });
|
const wrapper = mount(<Input />);
|
||||||
wrapper.find('input').instance().focus();
|
wrapper.find('input').first().getDOMNode().focus();
|
||||||
wrapper.setProps({
|
wrapper.setProps({
|
||||||
suffix: 'light',
|
suffix: 'light',
|
||||||
});
|
});
|
||||||
@ -78,10 +77,11 @@ describe('Input', () => {
|
|||||||
it('set mouse cursor position', () => {
|
it('set mouse cursor position', () => {
|
||||||
const defaultValue = '11111';
|
const defaultValue = '11111';
|
||||||
const valLength = defaultValue.length;
|
const valLength = defaultValue.length;
|
||||||
const wrapper = mount(<Input autoFocus defaultValue={defaultValue} />);
|
const ref = React.createRef();
|
||||||
wrapper.instance().setSelectionRange(valLength, valLength);
|
const wrapper = mount(<Input ref={ref} autoFocus defaultValue={defaultValue} />);
|
||||||
expect(wrapper.instance().input.selectionStart).toEqual(5);
|
ref.current?.setSelectionRange(valLength, valLength);
|
||||||
expect(wrapper.instance().input.selectionEnd).toEqual(5);
|
expect(wrapper.find('input').first().getDOMNode().selectionStart).toEqual(5);
|
||||||
|
expect(wrapper.find('input').first().getDOMNode().selectionEnd).toEqual(5);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -486,4 +486,27 @@ describe('TextArea allowClear', () => {
|
|||||||
|
|
||||||
wrapper.unmount();
|
wrapper.unmount();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/ant-design/ant-design/issues/31200
|
||||||
|
it('should not lost focus when clear input', () => {
|
||||||
|
const onBlur = jest.fn();
|
||||||
|
const wrapper = mount(<TextArea allowClear defaultValue="value" onBlur={onBlur} />, {
|
||||||
|
attachTo: document.body,
|
||||||
|
});
|
||||||
|
wrapper.find('textarea').getDOMNode().focus();
|
||||||
|
wrapper.find('.ant-input-clear-icon').at(0).simulate('mouseDown');
|
||||||
|
wrapper.find('.ant-input-clear-icon').at(0).simulate('click');
|
||||||
|
wrapper.find('.ant-input-clear-icon').at(0).simulate('mouseUp');
|
||||||
|
wrapper.find('.ant-input-clear-icon').at(0).simulate('focus');
|
||||||
|
wrapper.find('.ant-input-clear-icon').at(0).getDOMNode().click();
|
||||||
|
expect(onBlur).not.toBeCalled();
|
||||||
|
wrapper.unmount();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should focus text area after clear', () => {
|
||||||
|
const wrapper = mount(<TextArea allowClear defaultValue="111" />, { attachTo: document.body });
|
||||||
|
wrapper.find('.ant-input-clear-icon').at(0).simulate('click');
|
||||||
|
expect(document.activeElement).toBe(wrapper.find('textarea').at(0).getDOMNode());
|
||||||
|
wrapper.unmount();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,15 +1,26 @@
|
|||||||
import Input from './Input';
|
import * as React from 'react';
|
||||||
|
import InternalInput, { InputProps, InputRef } from './Input';
|
||||||
import Group from './Group';
|
import Group from './Group';
|
||||||
import Search from './Search';
|
import Search from './Search';
|
||||||
import TextArea from './TextArea';
|
import TextArea from './TextArea';
|
||||||
import Password from './Password';
|
import Password from './Password';
|
||||||
|
|
||||||
export { InputProps } from './Input';
|
export { InputProps, InputRef } from './Input';
|
||||||
export { GroupProps } from './Group';
|
export { GroupProps } from './Group';
|
||||||
export { SearchProps } from './Search';
|
export { SearchProps } from './Search';
|
||||||
export { TextAreaProps } from './TextArea';
|
export { TextAreaProps } from './TextArea';
|
||||||
export { PasswordProps } from './Password';
|
export { PasswordProps } from './Password';
|
||||||
|
|
||||||
|
interface CompoundedComponent
|
||||||
|
extends React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>> {
|
||||||
|
Group: typeof Group;
|
||||||
|
Search: typeof Search;
|
||||||
|
TextArea: typeof TextArea;
|
||||||
|
Password: typeof Password;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Input = InternalInput as CompoundedComponent;
|
||||||
|
|
||||||
Input.Group = Group;
|
Input.Group = Group;
|
||||||
Input.Search = Search;
|
Input.Search = Search;
|
||||||
Input.TextArea = TextArea;
|
Input.TextArea = TextArea;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
@input-prefix-cls: ~'@{ant-prefix}-input';
|
@input-prefix-cls: ~'@{ant-prefix}-input';
|
||||||
|
|
||||||
// ========================= Input =========================
|
// ========================= Input =========================
|
||||||
.@{iconfont-css-prefix}.@{ant-prefix}-input-clear-icon {
|
.@{ant-prefix}-input-clear-icon {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: @disabled-color;
|
color: @disabled-color;
|
||||||
font-size: @font-size-sm;
|
font-size: @font-size-sm;
|
||||||
|
@ -1,33 +1,7 @@
|
|||||||
import classNames from 'classnames';
|
|
||||||
import { ValidateStatus } from '../form/FormItem';
|
|
||||||
import type { DirectionType } from '../config-provider';
|
|
||||||
import type { SizeType } from '../config-provider/SizeContext';
|
|
||||||
import type { ClearableInputProps } from './ClearableLabeledInput';
|
import type { ClearableInputProps } from './ClearableLabeledInput';
|
||||||
import type { InputProps } from './Input';
|
import type { InputProps } from './Input';
|
||||||
import { getStatusClassNames } from '../_util/statusUtils';
|
|
||||||
|
|
||||||
export function getInputClassName(
|
|
||||||
prefixCls: string,
|
|
||||||
bordered: boolean,
|
|
||||||
size?: SizeType,
|
|
||||||
disabled?: boolean,
|
|
||||||
direction?: DirectionType,
|
|
||||||
status?: ValidateStatus,
|
|
||||||
hasFeedback?: boolean,
|
|
||||||
) {
|
|
||||||
return classNames(
|
|
||||||
prefixCls,
|
|
||||||
{
|
|
||||||
[`${prefixCls}-sm`]: size === 'small',
|
|
||||||
[`${prefixCls}-lg`]: size === 'large',
|
|
||||||
[`${prefixCls}-disabled`]: disabled,
|
|
||||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
||||||
[`${prefixCls}-borderless`]: !bordered,
|
|
||||||
},
|
|
||||||
getStatusClassNames(prefixCls, status, hasFeedback),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// eslint-disable-next-line import/prefer-default-export
|
||||||
export function hasPrefixSuffix(props: InputProps | ClearableInputProps) {
|
export function hasPrefixSuffix(props: InputProps | ClearableInputProps) {
|
||||||
return !!(props.prefix || props.suffix || props.allowClear);
|
return !!(props.prefix || props.suffix || props.allowClear);
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,7 @@ Table with editable cells. When work with `shouldCellUpdate`, please take care o
|
|||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import React, { useContext, useState, useEffect, useRef } from 'react';
|
import React, { useContext, useState, useEffect, useRef } from 'react';
|
||||||
import { Table, Input, Button, Popconfirm, Form } from 'antd';
|
import { Table, Input, Button, Popconfirm, Form, InputRef } from 'antd';
|
||||||
import { FormInstance } from 'antd/lib/form';
|
import { FormInstance } from 'antd/lib/form';
|
||||||
|
|
||||||
const EditableContext = React.createContext<FormInstance<any> | null>(null);
|
const EditableContext = React.createContext<FormInstance<any> | null>(null);
|
||||||
@ -61,7 +61,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
|
|||||||
...restProps
|
...restProps
|
||||||
}) => {
|
}) => {
|
||||||
const [editing, setEditing] = useState(false);
|
const [editing, setEditing] = useState(false);
|
||||||
const inputRef = useRef<Input>(null);
|
const inputRef = useRef<InputRef>(null);
|
||||||
const form = useContext(EditableContext)!;
|
const form = useContext(EditableContext)!;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -225,24 +225,29 @@ exports[`renders ./components/transfer/demo/advanced.md extend context correctly
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -593,24 +598,29 @@ exports[`renders ./components/transfer/demo/advanced.md extend context correctly
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -4626,24 +4636,29 @@ exports[`renders ./components/transfer/demo/search.md extend context correctly 1
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -4974,24 +4989,29 @@ exports[`renders ./components/transfer/demo/search.md extend context correctly 1
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -5810,24 +5830,29 @@ exports[`renders ./components/transfer/demo/status.md extend context correctly 1
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -6158,24 +6183,29 @@ exports[`renders ./components/transfer/demo/status.md extend context correctly 1
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
@ -96,24 +96,29 @@ exports[`renders ./components/transfer/demo/advanced.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -335,24 +340,29 @@ exports[`renders ./components/transfer/demo/advanced.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -2894,24 +2904,29 @@ exports[`renders ./components/transfer/demo/search.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -3113,24 +3128,29 @@ exports[`renders ./components/transfer/demo/search.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -3562,24 +3582,29 @@ exports[`renders ./components/transfer/demo/status.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -3781,24 +3806,29 @@ exports[`renders ./components/transfer/demo/status.md correctly 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
@ -37,24 +37,29 @@ exports[`Transfer.Search should show cross icon when input value exists 1`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon ant-input-clear-icon-hidden"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -97,24 +102,29 @@ exports[`Transfer.Search should show cross icon when input value exists 2`] = `
|
|||||||
class="ant-input-suffix"
|
class="ant-input-suffix"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-label="close-circle"
|
class="ant-input-clear-icon"
|
||||||
class="anticon anticon-close-circle ant-input-clear-icon"
|
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
<svg
|
<span
|
||||||
aria-hidden="true"
|
aria-label="close-circle"
|
||||||
data-icon="close-circle"
|
class="anticon anticon-close-circle"
|
||||||
fill="currentColor"
|
role="img"
|
||||||
focusable="false"
|
|
||||||
height="1em"
|
|
||||||
viewBox="64 64 896 896"
|
|
||||||
width="1em"
|
|
||||||
>
|
>
|
||||||
<path
|
<svg
|
||||||
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
aria-hidden="true"
|
||||||
/>
|
data-icon="close-circle"
|
||||||
</svg>
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
@ -129,6 +129,7 @@
|
|||||||
"rc-dropdown": "~3.3.2",
|
"rc-dropdown": "~3.3.2",
|
||||||
"rc-field-form": "~1.23.0",
|
"rc-field-form": "~1.23.0",
|
||||||
"rc-image": "~5.2.5",
|
"rc-image": "~5.2.5",
|
||||||
|
"rc-input": "^0.0.1-alpha.3",
|
||||||
"rc-input-number": "~7.3.0",
|
"rc-input-number": "~7.3.0",
|
||||||
"rc-mentions": "~1.6.1",
|
"rc-mentions": "~1.6.1",
|
||||||
"rc-menu": "~9.2.1",
|
"rc-menu": "~9.2.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user