feat: datepicker use new icon (#1961)
							parent
							
								
									4e26496697
								
							
						
					
					
						commit
						abeb7cfa67
					
				| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
import Icon from '../icon';
 | 
			
		||||
import CalendarOutlined from '@ant-design/icons-vue/CalendarOutlined';
 | 
			
		||||
import { isValidElement } from '../_util/props-util';
 | 
			
		||||
import { cloneElement } from '../_util/vnode';
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -14,7 +14,7 @@ export default {
 | 
			
		|||
        })
 | 
			
		||||
      ) : (
 | 
			
		||||
        <span class={`${prefixCls}-picker-icon`}>{suffixIcon}</span>
 | 
			
		||||
      )) || <Icon type="calendar" class={`${prefixCls}-picker-icon`} />
 | 
			
		||||
      )) || <CalendarOutlined class={`${prefixCls}-picker-icon`} />
 | 
			
		||||
    );
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@ import RangeCalendar from '../vc-calendar/src/RangeCalendar';
 | 
			
		|||
import VcDatePicker from '../vc-calendar/src/Picker';
 | 
			
		||||
import classNames from 'classnames';
 | 
			
		||||
import shallowequal from 'shallowequal';
 | 
			
		||||
import Icon from '../icon';
 | 
			
		||||
import CloseCircleFilled from '@ant-design/icons-vue/CloseCircleFilled';
 | 
			
		||||
import Tag from '../tag';
 | 
			
		||||
import { ConfigConsumerProps } from '../config-provider';
 | 
			
		||||
import interopDefault from '../_util/interopDefault';
 | 
			
		||||
| 
						 | 
				
			
			@ -373,12 +373,7 @@ export default {
 | 
			
		|||
    const [startValue, endValue] = value;
 | 
			
		||||
    const clearIcon =
 | 
			
		||||
      !props.disabled && props.allowClear && value && (startValue || endValue) ? (
 | 
			
		||||
        <Icon
 | 
			
		||||
          type="close-circle"
 | 
			
		||||
          class={`${prefixCls}-picker-clear`}
 | 
			
		||||
          onClick={this.clearSelection}
 | 
			
		||||
          theme="filled"
 | 
			
		||||
        />
 | 
			
		||||
        <CloseCircleFilled class={`${prefixCls}-picker-clear`} onClick={this.clearSelection} />
 | 
			
		||||
      ) : null;
 | 
			
		||||
 | 
			
		||||
    const inputIcon = <InputIcon suffixIcon={suffixIcon} prefixCls={prefixCls} />;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
import * as moment from 'moment';
 | 
			
		||||
import Calendar from '../vc-calendar';
 | 
			
		||||
import VcDatePicker from '../vc-calendar/src/Picker';
 | 
			
		||||
import Icon from '../icon';
 | 
			
		||||
import CloseCircleFilled from '@ant-design/icons-vue/CloseCircleFilled';
 | 
			
		||||
import { ConfigConsumerProps } from '../config-provider';
 | 
			
		||||
import {
 | 
			
		||||
  hasProp,
 | 
			
		||||
| 
						 | 
				
			
			@ -182,12 +182,7 @@ export default {
 | 
			
		|||
    );
 | 
			
		||||
    const clearIcon =
 | 
			
		||||
      !disabled && allowClear && $data._value ? (
 | 
			
		||||
        <Icon
 | 
			
		||||
          type="close-circle"
 | 
			
		||||
          class={`${prefixCls}-picker-clear`}
 | 
			
		||||
          onClick={this.clearSelection}
 | 
			
		||||
          theme="filled"
 | 
			
		||||
        />
 | 
			
		||||
        <CloseCircleFilled class={`${prefixCls}-picker-clear`} onClick={this.clearSelection} />
 | 
			
		||||
      ) : null;
 | 
			
		||||
 | 
			
		||||
    const inputIcon = <InputIcon suffixIcon={suffixIcon} prefixCls={prefixCls} />;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,3 @@
 | 
			
		|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
 | 
			
		||||
 | 
			
		||||
exports[`DatePicker prop locale should works 1`] = `<span class="ant-calendar-picker"><div class=""><input readonly="true" placeholder="Избери дата" class="ant-calendar-picker-input ant-input"><i aria-label="icon: close-circle" tabindex="-1" class="ant-calendar-picker-clear anticon anticon-close-circle"><svg viewBox="64 64 896 896" data-icon="close-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><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 0 1-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></i><i aria-label="icon: calendar" class="ant-calendar-picker-icon anticon anticon-calendar"><svg viewBox="64 64 896 896" data-icon="calendar" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><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></i></div></span>`;
 | 
			
		||||
exports[`DatePicker prop locale should works 1`] = `<span class="ant-calendar-picker"><div class=""><input readonly="true" placeholder="Избери дата" class="ant-calendar-picker-input ant-input"><span role="img" aria-label="close-circle" tabindex="-1" class="anticon anticon-close-circle ant-calendar-picker-clear"><svg viewBox="64 64 896 896" focusable="false" data-icon="close-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><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 role="img" aria-label="calendar" class="anticon anticon-calendar ant-calendar-picker-icon"><svg viewBox="64 64 896 896" focusable="false" data-icon="calendar" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><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></div></span>`;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
				
			
			@ -231,10 +231,10 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
 | 
			
		|||
</div>
 | 
			
		||||
`;
 | 
			
		||||
 | 
			
		||||
exports[`Picker format by locale date 1`] = `<span class="ant-calendar-picker"><div class=""><input readonly="true" placeholder="请选择日期" class="ant-calendar-picker-input ant-input"><i aria-label="图标: calendar" class="ant-calendar-picker-icon anticon anticon-calendar"><svg viewBox="64 64 896 896" data-icon="calendar" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><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></i></div></span>`;
 | 
			
		||||
exports[`Picker format by locale date 1`] = `<span class="ant-calendar-picker"><div class=""><input readonly="true" placeholder="请选择日期" class="ant-calendar-picker-input ant-input"><span role="img" aria-label="calendar" class="anticon anticon-calendar ant-calendar-picker-icon"><svg viewBox="64 64 896 896" focusable="false" data-icon="calendar" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><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></div></span>`;
 | 
			
		||||
 | 
			
		||||
exports[`Picker format by locale dateTime 1`] = `<span class="ant-calendar-picker"><div class=""><input readonly="true" placeholder="请选择日期" class="ant-calendar-picker-input ant-input"><i aria-label="图标: calendar" class="ant-calendar-picker-icon anticon anticon-calendar"><svg viewBox="64 64 896 896" data-icon="calendar" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><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></i></div></span>`;
 | 
			
		||||
exports[`Picker format by locale dateTime 1`] = `<span class="ant-calendar-picker"><div class=""><input readonly="true" placeholder="请选择日期" class="ant-calendar-picker-input ant-input"><span role="img" aria-label="calendar" class="anticon anticon-calendar ant-calendar-picker-icon"><svg viewBox="64 64 896 896" focusable="false" data-icon="calendar" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><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></div></span>`;
 | 
			
		||||
 | 
			
		||||
exports[`Picker format by locale month 1`] = `<span class="ant-calendar-picker"><div class=""><input readonly="true" placeholder="请选择日期" class="ant-calendar-picker-input ant-input"><i aria-label="图标: calendar" class="ant-calendar-picker-icon anticon anticon-calendar"><svg viewBox="64 64 896 896" data-icon="calendar" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class=""><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></i></div></span>`;
 | 
			
		||||
exports[`Picker format by locale month 1`] = `<span class="ant-calendar-picker"><div class=""><input readonly="true" placeholder="请选择日期" class="ant-calendar-picker-input ant-input"><span role="img" aria-label="calendar" class="anticon anticon-calendar ant-calendar-picker-icon"><svg viewBox="64 64 896 896" focusable="false" data-icon="calendar" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><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></div></span>`;
 | 
			
		||||
 | 
			
		||||
exports[`Picker format by locale week 1`] = `<span class="ant-calendar-picker"><span class="" style="display: inline-block; width: 100%;"><input readonly="true" placeholder="请选择日期" class="ant-calendar-picker-input ant-input"><span class="ant-calendar-picker-icon"></span></span></span>`;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,8 @@ import omit from 'lodash/omit';
 | 
			
		|||
import MonthCalendar from '../vc-calendar/src/MonthCalendar';
 | 
			
		||||
import VcDatePicker from '../vc-calendar/src/Picker';
 | 
			
		||||
import classNames from 'classnames';
 | 
			
		||||
import Icon from '../icon';
 | 
			
		||||
import CloseCircleFilled from '@ant-design/icons-vue/CloseCircleFilled';
 | 
			
		||||
import CalendarOutlined from '@ant-design/icons-vue/CalendarOutlined';
 | 
			
		||||
import { ConfigConsumerProps } from '../config-provider';
 | 
			
		||||
import interopDefault from '../_util/interopDefault';
 | 
			
		||||
import BaseMixin from '../_util/BaseMixin';
 | 
			
		||||
| 
						 | 
				
			
			@ -202,12 +203,7 @@ export default function createPicker(TheCalendar, props) {
 | 
			
		|||
 | 
			
		||||
      const clearIcon =
 | 
			
		||||
        !props.disabled && props.allowClear && value ? (
 | 
			
		||||
          <Icon
 | 
			
		||||
            type="close-circle"
 | 
			
		||||
            class={`${prefixCls}-picker-clear`}
 | 
			
		||||
            onClick={this.clearSelection}
 | 
			
		||||
            theme="filled"
 | 
			
		||||
          />
 | 
			
		||||
          <CloseCircleFilled class={`${prefixCls}-picker-clear`} onClick={this.clearSelection} />
 | 
			
		||||
        ) : null;
 | 
			
		||||
 | 
			
		||||
      const inputIcon = (suffixIcon &&
 | 
			
		||||
| 
						 | 
				
			
			@ -217,7 +213,7 @@ export default function createPicker(TheCalendar, props) {
 | 
			
		|||
          })
 | 
			
		||||
        ) : (
 | 
			
		||||
          <span class={`${prefixCls}-picker-icon`}>{suffixIcon}</span>
 | 
			
		||||
        ))) || <Icon type="calendar" class={`${prefixCls}-picker-icon`} />;
 | 
			
		||||
        ))) || <CalendarOutlined class={`${prefixCls}-picker-icon`} />;
 | 
			
		||||
 | 
			
		||||
      const input = ({ value: inputValue }) => (
 | 
			
		||||
        <div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue