浏览代码

DatePicker: prefix icon of input clickable for non-range pickers (#9966)

Eng Philippe 7 年之前
父节点
当前提交
b54ed0a62f
共有 5 个文件被更改,包括 5 次插入12 次删除
  1. 0 1
      examples/docs/en-US/input.md
  2. 0 1
      examples/docs/es/input.md
  3. 5 1
      packages/date-picker/src/picker.vue
  4. 0 1
      types/autocomplete.d.ts
  5. 0 8
      types/input.d.ts

+ 0 - 1
examples/docs/en-US/input.md

@@ -696,7 +696,6 @@ Attribute | Description | Type | Options | Default
 |fetch-suggestions | a method to fetch input suggestions. When suggestions are ready, invoke `callback(data:[])` to return them to Autocomplete | Function(queryString, callback) | — | — |
 | popper-class | custom class name for autocomplete's dropdown | string | — | — |
 | trigger-on-focus | whether show suggestions when input focus | boolean | — | true |
-| on-icon-click | hook function when clicking on the input icon | function | — | — |
 | name | same as `name` in native input | string | — | — |
 | select-when-unmatched | whether to emit a `select` event on enter when there is no autocomplete match | boolean | — | false |
 | label | label text | string | — | — |

+ 0 - 1
examples/docs/es/input.md

@@ -675,7 +675,6 @@ Atributo | Descripción | Tipo | Opciones | Por defecto
 |fetch-suggestions | un método para obtener las sugerencias del input. Cuando las sugerencias estén listas, invocar `callback(data:[])` para devolverlas a Autocomplete | Function(queryString, callback) | — | — |
 | popper-class | nombre personalizado de clase para el dropdown de autocomplete | string | — | — |
 | trigger-on-focus | si se deben mostrar sugerencias cuando el input obtiene el foco | boolean | — | true |
-| on-icon-click | funcion que se invoca cuando se hace click en el icono | function | — | — |
 | name | igual que `name` en el input nativo | string | — | — |
 | select-when-unmatched | si se emite un evento `select` al pulsar enter cuando no hay coincidencia de Autocomplete | boolean | — | false |
 | label | texto de la etiqueta | string | — | — |

+ 5 - 1
packages/date-picker/src/picker.vue

@@ -18,8 +18,12 @@
     @mouseenter.native="handleMouseEnter"
     @mouseleave.native="showClose = false"
     :validateEvent="false"
-    :prefix-icon="triggerClass"
     ref="reference">
+    <i slot="prefix"
+      class="el-input__icon"
+      :class="triggerClass"
+      @click="handleFocus">
+    </i>
     <i slot="suffix"
       class="el-input__icon"
       @click="handleClickIcon"

+ 0 - 1
types/autocomplete.d.ts

@@ -1,5 +1,4 @@
 import { ElementUIComponent } from './component'
-import { IconClickEventHandler } from './input'
 
 export interface FetchSuggestionsCallback {
   /**

+ 0 - 8
types/input.d.ts

@@ -13,11 +13,6 @@ export interface AutoSize {
   maxRows: number
 }
 
-export interface IconClickEventHandler {
-  /** The handler function of on-icon-click property */
-  (this: Window, ev: MouseEvent): any
-}
-
 /** Input Component */
 export declare class ElInput extends ElementUIComponent {
   /** Type of input */
@@ -79,7 +74,4 @@ export declare class ElInput extends ElementUIComponent {
 
   /** Same as form in native input */
   form: string
-
-  /** Hook function when clicking on the input icon */
-  onIconClick: IconClickEventHandler
 }