浏览代码

Types: add missing definition for TimeSelect

Leopoldthecoder 7 年之前
父节点
当前提交
b3a5981461
共有 3 个文件被更改,包括 59 次插入23 次删除
  1. 5 1
      types/element-ui.d.ts
  2. 3 22
      types/time-picker.d.ts
  3. 51 0
      types/time-select.d.ts

+ 5 - 1
types/element-ui.d.ts

@@ -61,6 +61,7 @@ import { ElTag } from './tag'
 import { ElTabs } from './tabs'
 import { ElTabPane } from './tab-pane'
 import { ElTimePicker } from './time-picker'
+import { ElTimeSelect } from './time-select'
 import { ElTooltip } from './tooltip'
 import { ElTransfer } from './transfer'
 import { ElTree } from './tree'
@@ -270,9 +271,12 @@ export class TabPane extends ElTabPane {}
 /** Tag Component */
 export class Tag extends ElTag {}
 
-/** Time Picker and Time Select Component */
+/** TimePicker Component */
 export class TimePicker extends ElTimePicker {}
 
+/** TimeSelect Component */
+export class TimeSelect extends ElTimeSelect {}
+
 /** Tooltip Component */
 export class Tooltip extends ElTooltip {}
 

+ 3 - 22
types/time-picker.d.ts

@@ -1,6 +1,5 @@
 import { ElementUIComponent, ElementUIComponentSize, ElementUIHorizontalAlignment } from './component'
 
-/** Options when el-time-picker acts like a Time Picker */
 export interface TimePickerOptions {
   /**
    * Available time range.
@@ -13,25 +12,7 @@ export interface TimePickerOptions {
   format?: string
 }
 
-/** Options when el-time-picker acts like a Time Select */
-export interface TimeSelectOptions {
-  /** Start time */
-  start?: string,
-
-  /** End time */
-  end?: string,
-
-  /** Time step */
-  step?: string,
-
-  /** Minimum time, any time before this time will be disabled */
-  minTime?: string,
-
-  /** Maximum time, any time after this time will be disabled */
-  maxTime?: string
-}
-
-/** TimePicker and Time Select Component */
+/** TimePicker Component */
 export declare class ElTimePicker extends ElementUIComponent {
   /** Whether DatePicker is read only */
   readonly: boolean
@@ -57,7 +38,7 @@ export declare class ElTimePicker extends ElementUIComponent {
   /** Placeholder for the end time in range mode */
   endPlaceholder: string
 
-  /** Whether to pick a time range, only works with <el-time-picker> */
+  /** Whether to pick a time range */
   isRange: boolean
 
   /** Value of the picker */
@@ -70,7 +51,7 @@ export declare class ElTimePicker extends ElementUIComponent {
   popperClass: string
 
   /** Additional options, check the table below */
-  pickerOptions: object
+  pickerOptions: TimePickerOptions
 
   /** Range separator */
   rangeSeparator: string

+ 51 - 0
types/time-select.d.ts

@@ -0,0 +1,51 @@
+import { ElementUIComponent, ElementUIComponentSize, ElementUIHorizontalAlignment } from './component'
+
+export interface TimeSelectOptions {
+  /** Start time */
+  start?: string,
+
+  /** End time */
+  end?: string,
+
+  /** Time step */
+  step?: string,
+
+  /** Minimum time, any time before this time will be disabled */
+  minTime?: string,
+
+  /** Maximum time, any time after this time will be disabled */
+  maxTime?: string
+}
+
+/** TimeSelect Component */
+export declare class ElTimeSelect extends ElementUIComponent {
+  /** Whether DatePicker is read only */
+  readonly: boolean
+
+  /** Whether DatePicker is disabled */
+  disabled: boolean
+
+  /** Whether the input is editable */
+  editable: boolean
+
+  /** Whether to show clear button */
+  clearable: boolean
+
+  /** Size of Input */
+  size: ElementUIComponentSize
+
+  /** Placeholder */
+  placeholder: string
+
+  /** Value of the picker */
+  value: string | Date
+
+  /** Alignment */
+  align: ElementUIHorizontalAlignment
+
+  /** Custom class name for TimePicker's dropdown */
+  popperClass: string
+
+  /** Additional options, check the table below */
+  pickerOptions: TimeSelectOptions
+}