feat: input add showCount

feat-css-var
tangjinzhou 2022-03-01 10:52:41 +08:00
parent 7c8add9030
commit 85767de396
15 changed files with 209 additions and 106 deletions

View File

@ -1,6 +1,5 @@
import classNames from '../_util/classNames';
import CloseCircleFilled from '@ant-design/icons-vue/CloseCircleFilled';
import { getInputClassName } from './Input';
import PropTypes from '../_util/vue-types';
import { cloneElement } from '../_util/vnode';
import type { PropType, VNode } from 'vue';
@ -8,10 +7,7 @@ import { ref, defineComponent } from 'vue';
import { tuple } from '../_util/type';
import type { Direction, SizeType } from '../config-provider';
import type { MouseEventHandler } from '../_util/EventInterface';
export function hasPrefixSuffix(propsAndSlots: any) {
return !!(propsAndSlots.prefix || propsAndSlots.suffix || propsAndSlots.allowClear);
}
import { getInputClassName, hasPrefixSuffix } from './util';
function hasAddon(propsAndSlots: any) {
return !!(propsAndSlots.addonBefore || propsAndSlots.addonAfter);

View File

@ -13,7 +13,7 @@ import antInputDirective from '../_util/antInputDirective';
import classNames from '../_util/classNames';
import type { InputProps } from './inputProps';
import inputProps from './inputProps';
import type { Direction, SizeType } from '../config-provider';
import { getInputClassName } from './util';
import ClearableLabeledInput from './ClearableLabeledInput';
import { useInjectFormItemContext } from '../form/FormItemContext';
import omit from '../_util/omit';
@ -24,7 +24,7 @@ export function fixControlledValue(value: string | number) {
if (typeof value === 'undefined' || value === null) {
return '';
}
return value;
return String(value);
}
export function resolveOnChange(
@ -73,22 +73,6 @@ export function resolveOnChange(
onChange(event);
}
export function getInputClassName(
prefixCls: string,
bordered: boolean,
size?: SizeType,
disabled?: boolean,
direction?: Direction,
) {
return classNames(prefixCls, {
[`${prefixCls}-sm`]: size === 'small',
[`${prefixCls}-lg`]: size === 'large',
[`${prefixCls}-disabled`]: disabled,
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-borderless`]: !bordered,
});
}
export interface InputFocusOptions extends FocusOptions {
cursor?: 'start' | 'end' | 'all';
}
@ -147,6 +131,9 @@ export default defineComponent({
if (props.value !== undefined) {
stateValue.value = props.value;
}
if (props.disabled) {
focused.value = false;
}
},
);
@ -328,6 +315,38 @@ export default defineComponent({
return withDirectives(inputNode as VNode, [[antInputDirective]]);
};
const renderShowCountSuffix = () => {
const value = stateValue.value;
const { maxlength, suffix = slots.suffix?.(), showCount } = 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
class={classNames(`${prefixCls.value}-show-count-suffix`, {
[`${prefixCls.value}-show-count-has-suffix`]: !!suffix,
})}
>
{dataCount}
</span>
)}
{suffix}
</>
);
}
return null;
};
return () => {
const inputProps: any = {
...attrs,
@ -341,9 +360,9 @@ export default defineComponent({
return (
<ClearableLabeledInput
{...omit(inputProps, ['element', 'valueModifiers'])}
{...omit(inputProps, ['element', 'valueModifiers', 'suffix'])}
ref={clearableInputRef}
v-slots={{ ...slots, element: renderInput }}
v-slots={{ ...slots, element: renderInput, suffix: renderShowCountSuffix }}
/>
);
};

View File

@ -18,6 +18,7 @@ import { useInjectFormItemContext } from '../form/FormItemContext';
import type { FocusEventHandler } from '../_util/EventInterface';
import useConfigInject from '../_util/hooks/useConfigInject';
import omit from '../_util/omit';
import type { VueNode } from '../_util/type';
function fixEmojiLength(value: string, maxLength: number) {
return [...(value || '')].slice(0, maxLength).join('');
@ -195,7 +196,7 @@ export default defineComponent({
if (showCount.value) {
const valueLength = [...mergedValue.value].length;
let dataCount = '';
let dataCount: VueNode = '';
if (typeof showCount.value === 'object') {
dataCount = showCount.value.formatter({ count: valueLength, maxlength });
} else {
@ -212,7 +213,7 @@ export default defineComponent({
customClass,
)}
style={style}
data-count={dataCount}
data-count={typeof dataCount !== 'object' ? dataCount : undefined}
>
{textareaNode}
</div>

View File

@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Input.Search should support custom Button 1`] = `<span class="ant-input-group-wrapper ant-input-search ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><input type="text" class="ant-input"><span class="ant-input-group-addon"><button class="ant-btn ant-input-search-button" type="button"><!----><span>ok</span></button></span></span></span>`;
exports[`Input.Search should support custom Button 1`] = `<span class="ant-input-group-wrapper ant-input-search ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><span class="ant-input-affix-wrapper"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-group-addon"><button class="ant-btn ant-input-search-button" type="button"><!----><span>ok</span></button></span></span></span>`;
exports[`Input.Search should support custom button 1`] = `<span class="ant-input-group-wrapper ant-input-search ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><input type="text" class="ant-input"><span class="ant-input-group-addon"><button class="ant-btn ant-btn-primary ant-input-search-button" type="button"><!----><button type="button">ok</button></button></span></span></span>`;
exports[`Input.Search should support custom button 1`] = `<span class="ant-input-group-wrapper ant-input-search ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><span class="ant-input-affix-wrapper"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-group-addon"><button class="ant-btn ant-btn-primary ant-input-search-button" type="button"><!----><button type="button">ok</button></button></span></span></span>`;

View File

@ -1,23 +1,33 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders ./components/input/demo/addon.vue correctly 1`] = `
<div>
<div style="margin-bottom: 16px;"><span class="ant-input-group-wrapper"><span class="ant-input-wrapper ant-input-group"><span class="ant-input-group-addon">Http://</span><input type="text" class="ant-input"><span class="ant-input-group-addon">.com</span></span></span></div>
<div style="margin-bottom: 16px;"><span class="ant-input-group-wrapper"><span class="ant-input-wrapper ant-input-group"><span class="ant-input-group-addon"><div style="width: 90px;" class="ant-select ant-select-single ant-select-show-arrow"><!----><!----><div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0" readonly="" unselectable="on" type="search"></span><span class="ant-select-selection-item">Http://</span>
<div class="ant-space ant-space-vertical">
<div class="ant-space-item" style="margin-bottom: 8px;"><span class="ant-input-group-wrapper"><span class="ant-input-wrapper ant-input-group"><span class="ant-input-group-addon">Http://</span><span class="ant-input-affix-wrapper"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-group-addon">.com</span></span></span></div>
<!---->
<div class="ant-space-item" style="margin-bottom: 8px;"><span class="ant-input-group-wrapper"><span class="ant-input-wrapper ant-input-group"><span class="ant-input-group-addon"><div style="width: 90px;" class="ant-select ant-select-single ant-select-show-arrow"><!----><!----><div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0" readonly="" unselectable="on" type="search"></span><span class="ant-select-selection-item">Http://</span>
<!---->
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg focusable="false" class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
<!---->
</div></span><input type="text" class="ant-input"><span class="ant-input-group-addon"><div style="width: 80px;" class="ant-select ant-select-single ant-select-show-arrow"><!----><!----><div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0" readonly="" unselectable="on" type="search"></span><span class="ant-select-selection-item">.com</span>
</div></span><span class="ant-input-affix-wrapper"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-group-addon"><div style="width: 80px;" class="ant-select ant-select-single ant-select-show-arrow"><!----><!----><div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0" readonly="" unselectable="on" type="search"></span><span class="ant-select-selection-item">.com</span>
<!---->
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg focusable="false" class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
<!---->
</div></span></span></span></div>
<div style="margin-bottom: 16px;"><span class="ant-input-group-wrapper"><span class="ant-input-wrapper ant-input-group"><!----><input type="text" class="ant-input"><span class="ant-input-group-addon"><span role="img" aria-label="setting" class="anticon anticon-setting"><svg focusable="false" class="" data-icon="setting" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"></path></svg></span></span></span></span></div>
<!---->
<div class="ant-space-item" style="margin-bottom: 8px;"><span class="ant-input-group-wrapper"><span class="ant-input-wrapper ant-input-group"><!----><span class="ant-input-affix-wrapper"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-group-addon"><span role="img" aria-label="setting" class="anticon anticon-setting"><svg focusable="false" class="" data-icon="setting" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"></path></svg></span></span></span></span></div>
<!---->
<div class="ant-space-item"><span class="ant-input-group-wrapper"><span class="ant-input-wrapper ant-input-group"><span class="ant-input-group-addon"><div style="width: 150px;" class="ant-select ant-cascader ant-select-single ant-select-allow-clear ant-select-show-arrow"><!----><!----><div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" readonly="" unselectable="on" type="search"></span>
<!----><span class="ant-select-selection-placeholder">cascader</span>
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg focusable="false" class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
<!---->
</div></span><span class="ant-input-affix-wrapper"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span>
<!----></span></span></div>
<!---->
</div>
`;
exports[`renders ./components/input/demo/allow-clear.vue correctly 1`] = `
<div><span class="ant-input-affix-wrapper"><!----><input placeholder="input with clear icon" type="text" class="ant-input"><span class="ant-input-suffix"><span role="img" tabindex="-1" aria-label="close-circle" class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"><svg focusable="false" class="" data-icon="close-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><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"></path></svg></span>
<div><span class="ant-input-affix-wrapper"><!----><input placeholder="input with clear icon" type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><span role="img" tabindex="-1" aria-label="close-circle" class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon-has-suffix ant-input-clear-icon"><svg focusable="false" class="" data-icon="close-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><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"></path></svg></span>
<!----></span></span><br><br><span class="ant-input-affix-wrapper ant-input-affix-wrapper-textarea-with-clear-btn"><textarea placeholder="textarea with clear icon" class="ant-input"></textarea><span role="img" tabindex="-1" aria-label="close-circle" class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"><svg focusable="false" class="" data-icon="close-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><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"></path></svg></span></span>
</div>
`;
@ -28,23 +38,27 @@ exports[`renders ./components/input/demo/autosize-textarea.vue correctly 1`] = `
</div>
`;
exports[`renders ./components/input/demo/basic.vue correctly 1`] = `<input placeholder="Basic usage" type="text" class="ant-input">`;
exports[`renders ./components/input/demo/basic.vue correctly 1`] = `<span class="ant-input-affix-wrapper"><!----><input placeholder="Basic usage" type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span>`;
exports[`renders ./components/input/demo/borderless.vue correctly 1`] = `<input placeholder="Borderless" type="text" class="ant-input ant-input-borderless">`;
exports[`renders ./components/input/demo/borderless.vue correctly 1`] = `<span class="ant-input-affix-wrapper ant-input-affix-wrapper-borderless"><!----><input placeholder="Borderless" type="text" showcount="false" class="ant-input ant-input-borderless"><span class="ant-input-suffix"><!----><!----></span></span>`;
exports[`renders ./components/input/demo/group.vue correctly 1`] = `
<div><span class="ant-input-group ant-input-group-lg"><div class="ant-row" style="margin-left: -4px; margin-right: -4px;"><div class="ant-col ant-col-5" style="padding-left: 4px; padding-right: 4px;"><input type="text" class="ant-input"></div><div class="ant-col ant-col-8" style="padding-left: 4px; padding-right: 4px;"><input type="text" class="ant-input"></div></div></span><br><span class="ant-input-group ant-input-group-compact"><input type="text" style="width: 20%;" class="ant-input"><input type="text" style="width: 30%;" class="ant-input"></span><br><span class="ant-input-group ant-input-group-compact"><div class="ant-select ant-select-single ant-select-show-arrow"><!----><!----><div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0" readonly="" unselectable="on" type="search"></span><span class="ant-select-selection-item">Zhejiang</span>
<div><span class="ant-input-group ant-input-group-lg"><div class="ant-row" style="margin-left: -4px; margin-right: -4px;"><div class="ant-col ant-col-5" style="padding-left: 4px; padding-right: 4px;"><span class="ant-input-affix-wrapper"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span></div>
<div class="ant-col ant-col-8" style="padding-left: 4px; padding-right: 4px;"><span class="ant-input-affix-wrapper"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span></div>
</div></span><br><span class="ant-input-group ant-input-group-compact"><span class="ant-input-affix-wrapper" style="width: 20%;"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-affix-wrapper" style="width: 30%;"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span></span><br><span class="ant-input-group ant-input-group-compact"><div class="ant-select ant-select-single ant-select-show-arrow"><!----><!----><div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0" readonly="" unselectable="on" type="search"></span><span class="ant-select-selection-item">Zhejiang</span>
<!---->
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg focusable="false" class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
<!---->
</div><span class="ant-input-affix-wrapper" style="width: 50%;"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span></span><br><span class="ant-input-group ant-input-group-compact"><div class="ant-select ant-select-single ant-select-show-arrow"><!----><!----><div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0" readonly="" unselectable="on" type="search"></span><span class="ant-select-selection-item">Option1</span>
<!---->
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg focusable="false" class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
<!---->
</div><span class="ant-input-affix-wrapper" style="width: 50%;"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span></span><br><span class="ant-input-group ant-input-group-compact"><span class="ant-input-affix-wrapper" style="width: 50%;"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span>
<div class="ant-picker" style="width: 50%;">
<div class="ant-picker-input"><input readonly="" placeholder="Select date" title="" size="12" autocomplete="off"><span class="ant-picker-suffix"><span role="img" aria-label="calendar" class="anticon anticon-calendar"><svg focusable="false" class="" data-icon="calendar" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"></path></svg></span></span>
<!---->
</div>
<!---->
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg focusable="false" class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
<!---->
</div><input type="text" style="width: 50%;" class="ant-input"></span><br><span class="ant-input-group ant-input-group-compact"><div class="ant-select ant-select-single ant-select-show-arrow"><!----><!----><div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0" readonly="" unselectable="on" type="search"></span><span class="ant-select-selection-item">Option1</span>
<!---->
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg focusable="false" class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
<!---->
</div><input type="text" style="width: 50%;" class="ant-input"></span><br><span class="ant-input-group ant-input-group-compact"><input type="text" style="width: 50%;" class="ant-input"><div class="ant-picker" style="width: 50%;"><div class="ant-picker-input"><input readonly="" placeholder="Select date" title="" size="12" autocomplete="off"><span class="ant-picker-suffix"><span role="img" aria-label="calendar" class="anticon anticon-calendar"><svg focusable="false" class="" data-icon="calendar" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"></path></svg></span></span>
<!---->
</div>
<!---->
</div></span><br><span class="ant-input-group ant-input-group-compact"><div class="ant-select ant-select-single ant-select-show-arrow"><!----><!----><div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0" readonly="" unselectable="on" type="search"></span><span class="ant-select-selection-item">Option1-1</span>
<!---->
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg focusable="false" class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
@ -61,7 +75,7 @@ exports[`renders ./components/input/demo/group.vue correctly 1`] = `
<!---->
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg focusable="false" class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
<!---->
</div><input placeholder="Minimum" type="text" style="width: 100px; text-align: center;" class="ant-input"><input placeholder="~" type="text" disabled="" style="width: 30px; border-left: 0; pointer-events: none; background-color: rgb(255, 255, 255);" class="ant-input ant-input-disabled"><input placeholder="Maximum" type="text" style="width: 100px; text-align: center; border-left: 0;" class="ant-input"></span><br><span class="ant-input-group ant-input-group-compact"><div class="ant-select ant-select-single ant-select-show-arrow"><!----><!----><div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0" readonly="" unselectable="on" type="search"></span><span class="ant-select-selection-item">Sign Up</span>
</div><span class="ant-input-affix-wrapper" style="width: 100px; text-align: center;"><!----><input placeholder="Minimum" type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-affix-wrapper ant-input-affix-wrapper-disabled" style="width: 30px; border-left: 0; pointer-events: none; background-color: rgb(255, 255, 255);"><!----><input placeholder="~" type="text" disabled="" showcount="false" class="ant-input ant-input-disabled"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-affix-wrapper" style="width: 100px; text-align: center; border-left: 0;"><!----><input placeholder="Maximum" type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span></span><br><span class="ant-input-group ant-input-group-compact"><div class="ant-select ant-select-single ant-select-show-arrow"><!----><!----><div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0" readonly="" unselectable="on" type="search"></span><span class="ant-select-selection-item">Sign Up</span>
<!---->
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg focusable="false" class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
<!---->
@ -86,21 +100,39 @@ exports[`renders ./components/input/demo/group.vue correctly 1`] = `
<!----><span class="ant-select-selection-placeholder">Select Address</span>
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg focusable="false" class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
<!---->
</div></span></div>
</div></span><br><span class="ant-input-group ant-input-group-compact"><span class="ant-input-affix-wrapper" style="width: calc(100% - 200px);"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><button class="ant-btn ant-btn-primary" type="button">
<!----><span>Submit</span>
</button></span><br><span class="ant-input-group ant-input-group-compact"><span class="ant-input-affix-wrapper" style="width: calc(100% - 200px);"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span>
<!----><button class="ant-btn ant-btn-icon-only" type="button"><span role="img" aria-label="copy" class="anticon anticon-copy"><svg focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></span></button></span></div>
`;
exports[`renders ./components/input/demo/password-input.vue correctly 1`] = `<span class="ant-input-affix-wrapper ant-input-password"><!----><input placeholder="input password" type="password" class="ant-input"><span class="ant-input-suffix"><!----><span tabindex="-1" role="img" aria-label="eye-invisible" class="anticon anticon-eye-invisible ant-input-password-icon"><svg focusable="false" class="" data-icon="eye-invisible" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"></path><path d="M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"></path></svg></span></span></span>`;
exports[`renders ./components/input/demo/password-input.vue correctly 1`] = `<span class="ant-input-affix-wrapper ant-input-password"><!----><input placeholder="input password" type="password" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----><span tabindex="-1" role="img" aria-label="eye-invisible" class="anticon anticon-eye-invisible ant-input-password-icon"><svg focusable="false" class="" data-icon="eye-invisible" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"></path><path d="M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"></path></svg></span></span></span>`;
exports[`renders ./components/input/demo/presuffix.vue correctly 1`] = `<div class="components-input-demo-presuffix"><span class="ant-input-affix-wrapper"><span class="ant-input-prefix"><span type="user" role="img" aria-label="user" class="anticon anticon-user"><svg focusable="false" class="" data-icon="user" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"></path></svg></span></span><input placeholder="Basic usage" type="text" class="ant-input"><span class="ant-input-suffix"><!----><!----><span style="color: rgba(0, 0, 0, 0.45);" tabindex="-1" role="img" aria-label="info-circle" class="anticon anticon-info-circle"><svg focusable="false" class="" data-icon="info-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"></path></svg></span></span></span><br><br><span class="ant-input-affix-wrapper"><span class="ant-input-prefix">¥</span><input type="text" class="ant-input"><span class="ant-input-suffix"><!---->RMB</span></span></div>`;
exports[`renders ./components/input/demo/presuffix.vue correctly 1`] = `<div class="components-input-demo-presuffix"><span class="ant-input-affix-wrapper"><span class="ant-input-prefix"><span type="user" role="img" aria-label="user" class="anticon anticon-user"><svg focusable="false" class="" data-icon="user" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"></path></svg></span></span><input placeholder="Basic usage" type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----><!----><span style="color: rgba(0, 0, 0, 0.45);" tabindex="-1" role="img" aria-label="info-circle" class="anticon anticon-info-circle"><svg focusable="false" class="" data-icon="info-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"></path></svg></span></span></span><br><br><span class="ant-input-affix-wrapper"><span class="ant-input-prefix">¥</span><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!---->RMB</span></span></div>`;
exports[`renders ./components/input/demo/search-input.vue correctly 1`] = `<div><span class="ant-input-group-wrapper ant-input-search" style="width: 200px;"><span class="ant-input-wrapper ant-input-group"><!----><input placeholder="input search text" type="text" class="ant-input"><span class="ant-input-group-addon"><button class="ant-btn ant-input-search-button ant-btn-icon-only" type="button"><span role="img" aria-label="search" class="anticon anticon-search"><svg focusable="false" class="" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></button></span></span></span><br><br><span class="ant-input-group-wrapper ant-input-search ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><input placeholder="input search text" type="text" class="ant-input"><span class="ant-input-group-addon"><button class="ant-btn ant-btn-primary ant-input-search-button" type="button"><!----><span role="img" aria-label="search" class="anticon anticon-search"><svg focusable="false" class="" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></button></span></span></span><br><br><span class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><input placeholder="input search text" type="text" class="ant-input ant-input-lg"><span class="ant-input-group-addon"><button class="ant-btn ant-btn-primary ant-btn-lg ant-input-search-button" type="button"><!----><span>Search</span></button></span></span></span><br><br><span class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><input placeholder="input search text" type="text" class="ant-input ant-input-lg"><span class="ant-input-group-addon"><button class="ant-btn ant-btn-lg ant-input-search-button" type="button"><!----><span>Custom</span></button></span></span></span></div>`;
exports[`renders ./components/input/demo/search-input.vue correctly 1`] = `
<div class="ant-space ant-space-vertical">
<div class="ant-space-item" style="margin-bottom: 8px;"><span class="ant-input-group-wrapper ant-input-search" style="width: 200px;"><span class="ant-input-wrapper ant-input-group"><!----><span class="ant-input-affix-wrapper"><!----><input placeholder="input search text" type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-group-addon"><button class="ant-btn ant-input-search-button ant-btn-icon-only" type="button"><span role="img" aria-label="search" class="anticon anticon-search"><svg focusable="false" class="" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></button></span></span></span></div>
<!---->
<div class="ant-space-item" style="margin-bottom: 8px;"><span class="ant-input-group-wrapper ant-input-search ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><span class="ant-input-affix-wrapper"><!----><input placeholder="input search text" type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-group-addon"><button class="ant-btn ant-btn-primary ant-input-search-button" type="button"><!----><span role="img" aria-label="search" class="anticon anticon-search"><svg focusable="false" class="" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></button></span></span></span></div>
<!---->
<div class="ant-space-item" style="margin-bottom: 8px;"><span class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><span class="ant-input-affix-wrapper ant-input-affix-wrapper-lg"><!----><input placeholder="input search text" type="text" showcount="false" class="ant-input ant-input-lg"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-group-addon"><button class="ant-btn ant-btn-primary ant-btn-lg ant-input-search-button" type="button"><!----><span>Search</span></button></span></span></span></div>
<!---->
<div class="ant-space-item"><span class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><span class="ant-input-affix-wrapper ant-input-affix-wrapper-lg"><!----><input placeholder="input search text" type="text" showcount="false" class="ant-input ant-input-lg"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-group-addon"><button class="ant-btn ant-btn-lg ant-input-search-button" type="button"><!----><span>Custom</span></button></span></span></span></div>
<!---->
</div>
`;
exports[`renders ./components/input/demo/search-input-loading.vue correctly 1`] = `<div><span class="ant-input-group-wrapper ant-input-search"><span class="ant-input-wrapper ant-input-group"><!----><input placeholder="input search loading deault" type="text" class="ant-input"><span class="ant-input-group-addon"><button class="ant-btn ant-btn-loading ant-input-search-button ant-btn-icon-only" type="button"><span role="img" aria-label="loading" class="anticon anticon-loading"><svg focusable="false" class="anticon-spin" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="0 0 1024 1024"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span></button></span></span></span><br><br><span class="ant-input-group-wrapper ant-input-search ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><input placeholder="input search loading with enterButton" type="text" class="ant-input"><span class="ant-input-group-addon"><button class="ant-btn ant-btn-primary ant-btn-loading ant-input-search-button" type="button"><span role="img" aria-label="loading" class="anticon anticon-loading"><svg focusable="false" class="anticon-spin" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="0 0 1024 1024"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span><span role="img" aria-label="search" class="anticon anticon-search"><svg focusable="false" class="" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></button></span></span></span></div>`;
exports[`renders ./components/input/demo/search-input-loading.vue correctly 1`] = `<div><span class="ant-input-group-wrapper ant-input-search"><span class="ant-input-wrapper ant-input-group"><!----><span class="ant-input-affix-wrapper"><!----><input placeholder="input search loading deault" type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-group-addon"><button class="ant-btn ant-btn-loading ant-input-search-button ant-btn-icon-only" type="button"><span role="img" aria-label="loading" class="anticon anticon-loading"><svg focusable="false" class="anticon-spin" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="0 0 1024 1024"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span></button></span></span></span><br><br><span class="ant-input-group-wrapper ant-input-search ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><span class="ant-input-affix-wrapper"><!----><input placeholder="input search loading with enterButton" type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-group-addon"><button class="ant-btn ant-btn-primary ant-btn-loading ant-input-search-button" type="button"><span role="img" aria-label="loading" class="anticon anticon-loading"><svg focusable="false" class="anticon-spin" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="0 0 1024 1024"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span><span role="img" aria-label="search" class="anticon anticon-search"><svg focusable="false" class="" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></button></span></span></span></div>`;
exports[`renders ./components/input/demo/show-count.vue correctly 1`] = `<div class="ant-input-textarea ant-input-textarea-show-count" data-count="10 / 100"><textarea class="ant-input"></textarea></div>`;
exports[`renders ./components/input/demo/show-count.vue correctly 1`] = `
<span class="ant-input-affix-wrapper"><!----><input maxlength="20" type="text" showcount="true" class="ant-input"><span class="ant-input-suffix"><!----><span class="ant-input-show-count-suffix">10 / 20</span>
<!----></span></span><br><br>
<div class="ant-input-textarea ant-input-textarea-show-count" data-count="10 / 100"><textarea class="ant-input"></textarea></div>
`;
exports[`renders ./components/input/demo/size.vue correctly 1`] = `<div class="components-input-demo-size"><input placeholder="large size" type="text" class="ant-input ant-input-lg"><input placeholder="default size" type="text" class="ant-input"><input placeholder="small size" type="text" class="ant-input ant-input-sm"></div>`;
exports[`renders ./components/input/demo/size.vue correctly 1`] = `<div class="components-input-demo-size"><span class="ant-input-affix-wrapper ant-input-affix-wrapper-lg"><!----><input placeholder="large size" type="text" showcount="false" class="ant-input ant-input-lg"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-affix-wrapper"><!----><input placeholder="default size" type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span><span class="ant-input-affix-wrapper ant-input-affix-wrapper-sm"><!----><input placeholder="small size" type="text" showcount="false" class="ant-input ant-input-sm"><span class="ant-input-suffix"><!----><!----></span></span></div>`;
exports[`renders ./components/input/demo/textarea.vue correctly 1`] = `<textarea placeholder="Basic usage" rows="4" class="ant-input"></textarea>`;
exports[`renders ./components/input/demo/tooltip.vue correctly 1`] = `<!----><input placeholder="Input a number" type="text" max-length="25" style="width: 120px;" class="ant-input">`;
exports[`renders ./components/input/demo/tooltip.vue correctly 1`] = `<!----><span class="ant-input-affix-wrapper" style="width: 120px;"><!----><input placeholder="Input a number" type="text" showcount="false" max-length="25" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span>`;

View File

@ -1,8 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Input should support maxlength 1`] = `<input maxlength="3" type="text" class="ant-input">`;
exports[`Input should support maxlength 1`] = `<span class="ant-input-affix-wrapper"><!----><input maxlength="3" type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!----></span></span>`;
exports[`Input.Search should support suffix 1`] = `<span class="ant-input-group-wrapper ant-input-search"><span class="ant-input-wrapper ant-input-group"><!----><span class="ant-input-affix-wrapper"><!----><input type="text" class="ant-input"><span class="ant-input-suffix"><!---->suffix</span></span><span class="ant-input-group-addon"><button class="ant-btn ant-input-search-button ant-btn-icon-only" type="button"><span role="img" aria-label="search" class="anticon anticon-search"><svg focusable="false" class="" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></button></span></span></span>`;
exports[`Input.Search should support suffix 1`] = `<span class="ant-input-group-wrapper ant-input-search"><span class="ant-input-wrapper ant-input-group"><!----><span class="ant-input-affix-wrapper"><!----><input type="text" showcount="false" class="ant-input"><span class="ant-input-suffix"><!----><!---->suffix</span></span><span class="ant-input-group-addon"><button class="ant-btn ant-input-search-button ant-btn-icon-only" type="button"><span role="img" aria-label="search" class="anticon anticon-search"><svg focusable="false" class="" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></button></span></span></span>`;
exports[`TextArea should support disabled 1`] = `<textarea disabled="" class="ant-input ant-input-disabled"></textarea>`;

View File

@ -16,36 +16,36 @@ Using pre & post tabs example.
</docs>
<template>
<div>
<div style="margin-bottom: 16px">
<a-input v-model:value="value1" addon-before="Http://" addon-after=".com" />
</div>
<div style="margin-bottom: 16px">
<a-input v-model:value="value2">
<template #addonBefore>
<a-select v-model:value="value3" style="width: 90px">
<a-select-option value="Http://">Http://</a-select-option>
<a-select-option value="Https://">Https://</a-select-option>
</a-select>
</template>
<template #addonAfter>
<a-select v-model:value="value4" style="width: 80px">
<a-select-option value=".com">.com</a-select-option>
<a-select-option value=".jp">.jp</a-select-option>
<a-select-option value=".cn">.cn</a-select-option>
<a-select-option value=".org">.org</a-select-option>
</a-select>
</template>
</a-input>
</div>
<div style="margin-bottom: 16px">
<a-input v-model:value="value5">
<template #addonAfter>
<setting-outlined />
</template>
</a-input>
</div>
</div>
<a-space direction="vertical">
<a-input v-model:value="value1" addon-before="Http://" addon-after=".com" />
<a-input v-model:value="value2">
<template #addonBefore>
<a-select v-model:value="value3" style="width: 90px">
<a-select-option value="Http://">Http://</a-select-option>
<a-select-option value="Https://">Https://</a-select-option>
</a-select>
</template>
<template #addonAfter>
<a-select v-model:value="value4" style="width: 80px">
<a-select-option value=".com">.com</a-select-option>
<a-select-option value=".jp">.jp</a-select-option>
<a-select-option value=".cn">.cn</a-select-option>
<a-select-option value=".org">.org</a-select-option>
</a-select>
</template>
</a-input>
<a-input v-model:value="value5">
<template #addonAfter>
<setting-outlined />
</template>
</a-input>
<a-input v-model:value="value6">
<template #addonBefore>
<a-cascader placeholder="cascader" style="width: 150px" />
</template>
</a-input>
</a-space>
</template>
<script lang="ts">
@ -62,12 +62,14 @@ export default defineComponent({
const value3 = ref<string>('Http://');
const value4 = ref<string>('.com');
const value5 = ref<string>('mysite');
const value6 = ref<string>('mysite');
return {
value1,
value2,
value3,
value4,
value5,
value6,
};
},
});

View File

@ -13,7 +13,7 @@ title:
## en-US
Input.Group example
a-input-group example
Note: You don't need `Col` to control the width in the `compact` mode.
</docs>
@ -115,10 +115,25 @@ Note: You don't need `Col` to control the width in the `compact` mode.
placeholder="Select Address"
/>
</a-input-group>
<br />
<a-input-group compact>
<a-input v-model:value="value19" style="width: calc(100% - 200px)" />
<a-button type="primary">Submit</a-button>
</a-input-group>
<br />
<a-input-group compact>
<a-input v-model:value="value20" style="width: calc(100% - 200px)" />
<a-tooltip title="copy git url">
<a-button>
<template #icon><CopyOutlined /></template>
</a-button>
</a-tooltip>
</a-input-group>
</div>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
import { CopyOutlined } from '@ant-design/icons-vue';
const options = [
{
@ -155,6 +170,9 @@ const options = [
},
];
export default defineComponent({
components: {
CopyOutlined,
},
setup() {
const value1 = ref<string>('0571');
const value2 = ref<string>('26888888');
@ -174,6 +192,8 @@ export default defineComponent({
const value16 = ref<string>('');
const value17 = ref<string>('Home');
const value18 = ref<string[]>([]);
const value19 = ref<string>('https://surely.cool');
const value20 = ref<string>('https://antdv.com');
return {
value1,
@ -195,6 +215,8 @@ export default defineComponent({
value17,
value18,
options,
value19,
value20,
};
},
});

View File

@ -16,23 +16,19 @@ Example of creating a search box by grouping a standard input with a search butt
</docs>
<template>
<div>
<a-space direction="vertical">
<a-input-search
v-model:value="value"
placeholder="input search text"
style="width: 200px"
@search="onSearch"
/>
<br />
<br />
<a-input-search
v-model:value="value"
placeholder="input search text"
enter-button
@search="onSearch"
/>
<br />
<br />
<a-input-search
v-model:value="value"
placeholder="input search text"
@ -40,8 +36,6 @@ Example of creating a search box by grouping a standard input with a search butt
size="large"
@search="onSearch"
/>
<br />
<br />
<a-input-search
v-model:value="value"
placeholder="input search text"
@ -52,7 +46,7 @@ Example of creating a search box by grouping a standard input with a search butt
<a-button>Custom</a-button>
</template>
</a-input-search>
</div>
</a-space>
</template>
<script lang="ts">

View File

@ -2,8 +2,8 @@
---
order: 12
title:
zh-CN: 带字数提示的文本域
en-US: Textarea with character counting
zh-CN: 带字数提示
en-US: With character counting
---
## zh-CN
@ -16,15 +16,20 @@ Show character counting.
</docs>
<template>
<a-textarea v-model:value="value" show-count :maxlength="100" />
<a-input v-model:value="value1" show-count :maxlength="20" />
<br />
<br />
<a-textarea v-model:value="value2" show-count :maxlength="100" />
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
const value = ref<string>('test value');
const value1 = ref<string>('test value');
const value2 = ref<string>('test value');
return {
value,
value1,
value2,
};
},
});

View File

@ -25,6 +25,7 @@ A basic widget for getting the user input is a text field. Keyboard and mouse ca
| disabled | Whether the input is disabled. | boolean | false | |
| id | The ID for input | string | | |
| maxlength | max length | number | | 1.5.0 |
| showCount | Whether show text count | boolean | false | 3.0 |
| prefix | The prefix icon for the Input. | string\|slot | | |
| size | The size of the input box. Note: in the context of a form, the `large` size is used. Available: `large` `default` `small` | string | `default` | |
| suffix | The suffix icon for the Input. | string\|slot | | |

View File

@ -26,6 +26,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/xS9YEJhfe/Input.svg
| disabled | 是否禁用状态,默认为 false | boolean | false | |
| id | 输入框的 id | string | | |
| maxlength | 最大长度 | number | | 1.5.0 |
| showCount | 是否展示字数 | boolean | false | 3.0 |
| prefix | 带有前缀图标的 input | string\|slot | | |
| size | 控件大小。注:标准表单内的输入框大小限制为 `large`。可选 `large` `default` `small` | string | `default` | |
| suffix | 带有后缀图标的 input | string\|slot | | |

View File

@ -2,7 +2,7 @@ import type { ExtractPropTypes, PropType } from 'vue';
import PropTypes from '../_util/vue-types';
import type { SizeType } from '../config-provider';
import omit from '../_util/omit';
import type { LiteralUnion } from '../_util/type';
import type { LiteralUnion, VueNode } from '../_util/type';
export const inputDefaultValue = Symbol() as unknown as string;
const inputProps = {
id: PropTypes.string,
@ -61,6 +61,7 @@ const inputProps = {
maxlength: PropTypes.number,
loading: PropTypes.looseBool,
bordered: PropTypes.looseBool,
showCount: { type: [Boolean, Object] as PropType<boolean | ShowCountProps> },
htmlSize: Number,
onPressEnter: PropTypes.func,
onKeydown: PropTypes.func,
@ -80,13 +81,12 @@ export interface AutoSizeType {
maxRows?: number;
}
export interface ShowCountProps {
formatter: (args: { count: number; maxlength?: number }) => string;
formatter: (args: { count: number; maxlength?: number }) => VueNode;
}
const textAreaProps = {
...omit(inputProps, ['prefix', 'addonBefore', 'addonAfter', 'suffix']),
autosize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
autoSize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
showCount: { type: [Boolean, Object] as PropType<boolean | ShowCountProps> },
onResize: { type: Function as PropType<(size: { width: number; height: number }) => void> },
onCompositionstart: PropTypes.func,
onCompositionend: PropTypes.func,

View File

@ -52,6 +52,14 @@
align-items: center;
}
&-show-count-suffix {
color: @text-color-secondary;
}
&-show-count-has-suffix {
margin-right: 2px;
}
&-prefix {
margin-right: @input-affix-margin;
}

22
components/input/util.ts Normal file
View File

@ -0,0 +1,22 @@
import type { Direction, SizeType } from '../config-provider';
import classNames from '../_util/classNames';
export function getInputClassName(
prefixCls: string,
bordered: boolean,
size?: SizeType,
disabled?: boolean,
direction?: Direction,
) {
return classNames(prefixCls, {
[`${prefixCls}-sm`]: size === 'small',
[`${prefixCls}-lg`]: size === 'large',
[`${prefixCls}-disabled`]: disabled,
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-borderless`]: !bordered,
});
}
export function hasPrefixSuffix(propsAndSlots: any) {
return !!(propsAndSlots.prefix || propsAndSlots.suffix || propsAndSlots.allowClear);
}