1 | import { VXETableComponent } from './component'
|
2 |
|
3 | /**
|
4 | * 输入框
|
5 | */
|
6 | export declare class Input extends VXETableComponent {
|
7 | /**
|
8 | * 绑定值
|
9 | */
|
10 | value?: string | number | Date;
|
11 | /**
|
12 | * 原生 name 属性
|
13 | */
|
14 | name?: string;
|
15 | /**
|
16 | * 渲染类型
|
17 | */
|
18 | type?: 'text' | 'search' | 'number' | 'integer' | 'float' | 'password' | 'date' | 'time' | 'datetime' | 'week' | 'month' | 'quarter' | 'year';
|
19 | /**
|
20 | * 当有值时,是否在右侧显示清除按钮
|
21 | */
|
22 | clearable?: boolean;
|
23 | /**
|
24 | * 是否只读
|
25 | */
|
26 | readonly?: boolean;
|
27 | /**
|
28 | * 是否禁用
|
29 | */
|
30 | disabled?: boolean;
|
31 | /**
|
32 | * 当值为空时,显示的占位符
|
33 | */
|
34 | placeholder?: string;
|
35 | /**
|
36 | * 原生 maxlength 属性
|
37 | */
|
38 | maxlength?: string | number;
|
39 | /**
|
40 | * 原生 autocomplete 属性
|
41 | */
|
42 | autocomplete?: string;
|
43 | /**
|
44 | * 原生 form 属性
|
45 | */
|
46 | form?: string;
|
47 | /**
|
48 | * 只对 type=date|week|month|quarter|year 有效,有效,设置日期可选范围的最小值
|
49 | */
|
50 | minDate?: string | number | Date;
|
51 | /**
|
52 | * 只对 type=date|week|month|quarter|year 有效,有效,设置日期可选范围的最大值
|
53 | */
|
54 | maxDate?: string | number | Date;
|
55 | /**
|
56 | * 只对 type=week 有效,设置起始周
|
57 | */
|
58 | startWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
59 | /**
|
60 | * 只对 type=date|week|month|quarter|year 有效,输入框中显示的日期格式
|
61 | */
|
62 | labelFormat?: string;
|
63 | /**
|
64 | * 只对 type=date|week|month|quarter|year 有效,绑定值的返回格式,默认返回 Date 类型,如果指定格式则返回字符串
|
65 | */
|
66 | valueFormat?: string;
|
67 | /**
|
68 | * 只对 type=date|week|month|quarter|year 有效,文本框是否允许输入
|
69 | */
|
70 | editable?: string;
|
71 | /**
|
72 | * 只对 type=date|week|month|quarter|year 有效,该方法 Function({ date, type }) 用于返回对应日期显示的节日
|
73 | */
|
74 | festivalMethod?(params: InputDateFestivalParams): InputDateFestivalInfo | void;
|
75 | /**
|
76 | * 只对 type=date|week|month|quarter|year 有效,该方法 Function({date}) 的返回值用来决定该日期是否允许选中
|
77 | */
|
78 | disabledMethod?(params: InputDateDisabledParams): boolean;
|
79 | /**
|
80 | * 只对 type=number|integer|float 有效,最小值
|
81 | */
|
82 | min?: string | number;
|
83 | /**
|
84 | * 只对 type=number|integer|float 有效,最大值
|
85 | */
|
86 | max?: string | number;
|
87 | /**
|
88 | * 只对 type=number|integer|float 有效,数字间隔
|
89 | */
|
90 | step?: string | number;
|
91 | /**
|
92 | * 只对 type=float 有效,小数位数
|
93 | */
|
94 | digits?: string | number;
|
95 | /**
|
96 | * 头部图标
|
97 | */
|
98 | prefixIcon?: string;
|
99 | /**
|
100 | * 尾部图标
|
101 | */
|
102 | suffixIcon?: string;
|
103 | /**
|
104 | * 只对 type=date|week|month|quarter|year 有效,固定显示弹框容器的方向
|
105 | */
|
106 | placement?: string;
|
107 | /**
|
108 | * 只对 type=date|week|month|quarter|year 有效,是否将弹框容器插入于 body 内
|
109 | */
|
110 | transfer?: boolean;
|
111 |
|
112 | /**
|
113 | * 获取焦点
|
114 | */
|
115 | focus(): Promise<any>;
|
116 | /**
|
117 | * 失去焦点
|
118 | */
|
119 | blur(): Promise<any>;
|
120 | }
|
121 |
|
122 | export interface InputDateFestivalParams {
|
123 | date: Date;
|
124 | type: string;
|
125 | }
|
126 |
|
127 | export interface InputDateDisabledParams {
|
128 | date: Date;
|
129 | }
|
130 |
|
131 | /**
|
132 | * 日期节日对象
|
133 | */
|
134 | export interface InputDateFestivalInfo {
|
135 | /**
|
136 | * 节日名称,如果重叠使用逗号隔开
|
137 | */
|
138 | label?: string;
|
139 | /**
|
140 | * 标记为重要节日
|
141 | */
|
142 | important?: boolean;
|
143 | /**
|
144 | * 显示左上角小圆点通知
|
145 | */
|
146 | notice?: boolean;
|
147 | /**
|
148 | * 显示右上角信息
|
149 | */
|
150 | extra?: string | {
|
151 | /**
|
152 | * 显示名称
|
153 | */
|
154 | label?: string;
|
155 | /**
|
156 | * 标记为重要信息
|
157 | */
|
158 | important?: boolean;
|
159 | };
|
160 | }
|