44 * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
55 * */
66
7- import { InputProps } from "../input" ;
8- import type { TNode } from "../common" ;
9- import type {
10- MouseEvent ,
11- KeyboardEvent ,
12- FocusEvent ,
13- FormEvent ,
14- CompositionEvent ,
15- } from "react" ;
7+ import { InputProps } from '../input' ;
8+ import type { TNode } from '../common' ;
9+ import type { MouseEvent , KeyboardEvent , FocusEvent , FormEvent , CompositionEvent } from 'react' ;
1610
1711export interface TdInputNumberProps < T = InputNumberValue > {
1812 /**
1913 * 文本内容位置,居左/居中/居右
2014 */
21- align ?: " left" | " center" | " right" ;
15+ align ?: ' left' | ' center' | ' right' ;
2216 /**
2317 * 是否允许输入超过 `max` `min` 范围外的数字。为保障用户体验,仅在失去焦点时进行数字范围矫正。默认允许超出,数字超出范围时,输入框变红提醒
2418 * @default true
@@ -45,10 +39,7 @@ export interface TdInputNumberProps<T = InputNumberValue> {
4539 /**
4640 * 格式化输入框展示值。第二个事件参数 `context.fixedNumber` 表示处理过小数位数 `decimalPlaces` 的数字
4741 */
48- format ?: (
49- value : InputNumberValue ,
50- context ?: { fixedNumber ?: InputNumberValue }
51- ) => InputNumberValue ;
42+ format ?: ( value : InputNumberValue , context ?: { fixedNumber ?: InputNumberValue } ) => InputNumberValue ;
5243 /**
5344 * 透传 Input 输入框组件全部属性
5445 */
@@ -89,12 +80,12 @@ export interface TdInputNumberProps<T = InputNumberValue> {
8980 * 组件尺寸
9081 * @default medium
9182 */
92- size ?: " small" | " medium" | " large" ;
83+ size ?: ' small' | ' medium' | ' large' ;
9384 /**
9485 * 文本框状态
9586 * @default default
9687 */
97- status ?: " default" | " success" | " warning" | " error" ;
88+ status ?: ' default' | ' success' | ' warning' | ' error' ;
9889 /**
9990 * 数值改变步数,可以是小数。如果是大数,请保证数据类型为字符串
10091 * @default 1
@@ -108,7 +99,7 @@ export interface TdInputNumberProps<T = InputNumberValue> {
10899 * 按钮布局
109100 * @default row
110101 */
111- theme ?: " column" | " row" | " normal" ;
102+ theme ?: ' column' | ' row' | ' normal' ;
112103 /**
113104 * 输入框下方提示文本,会根据不同的 `status` 呈现不同的样式
114105 */
@@ -124,60 +115,38 @@ export interface TdInputNumberProps<T = InputNumberValue> {
124115 /**
125116 * 失去焦点时触发
126117 */
127- onBlur ?: (
128- value : InputNumberValue ,
129- context : { e : FocusEvent < HTMLDivElement > }
130- ) => void ;
118+ onBlur ?: ( value : InputNumberValue , context : { e : FocusEvent < HTMLDivElement > } ) => void ;
131119 /**
132120 * 值变化时触发,`type` 表示触发本次变化的来源
133121 */
134122 onChange ?: ( value : T , context : ChangeContext ) => void ;
135123 /**
136124 * 回车键按下时触发
137125 */
138- onEnter ?: (
139- value : InputNumberValue ,
140- context : { e : KeyboardEvent < HTMLDivElement > }
141- ) => void ;
126+ onEnter ?: ( value : InputNumberValue , context : { e : KeyboardEvent < HTMLDivElement > } ) => void ;
142127 /**
143128 * 获取焦点时触发
144129 */
145- onFocus ?: (
146- value : InputNumberValue ,
147- context : { e : FocusEvent < HTMLDivElement > }
148- ) => void ;
130+ onFocus ?: ( value : InputNumberValue , context : { e : FocusEvent < HTMLDivElement > } ) => void ;
149131 /**
150132 * 键盘按下时触发
151133 */
152- onKeydown ?: (
153- value : InputNumberValue ,
154- context : { e : KeyboardEvent < HTMLDivElement > }
155- ) => void ;
134+ onKeydown ?: ( value : InputNumberValue , context : { e : KeyboardEvent < HTMLDivElement > } ) => void ;
156135 /**
157136 * 按下字符键时触发(keydown -> keypress -> keyup)
158137 */
159- onKeypress ?: (
160- value : InputNumberValue ,
161- context : { e : KeyboardEvent < HTMLDivElement > }
162- ) => void ;
138+ onKeypress ?: ( value : InputNumberValue , context : { e : KeyboardEvent < HTMLDivElement > } ) => void ;
163139 /**
164140 * 释放键盘时触发
165141 */
166- onKeyup ?: (
167- value : InputNumberValue ,
168- context : { e : KeyboardEvent < HTMLDivElement > }
169- ) => void ;
142+ onKeyup ?: ( value : InputNumberValue , context : { e : KeyboardEvent < HTMLDivElement > } ) => void ;
170143 /**
171144 * 最大值或最小值校验结束后触发,`exceed-maximum` 表示超出最大值,`below-minimum` 表示小于最小值
172145 */
173- onValidate ?: ( context : {
174- error ?: "exceed-maximum" | "below-minimum" ;
175- } ) => void ;
146+ onValidate ?: ( context : { error ?: 'exceed-maximum' | 'below-minimum' } ) => void ;
176147}
177148
178- export type InputNumberDecimalPlaces =
179- | number
180- | { enableRound : boolean ; places : number } ;
149+ export type InputNumberDecimalPlaces = number | { enableRound : boolean ; places : number } ;
181150
182151export type InputNumberValue = number | string ;
183152
@@ -191,11 +160,4 @@ export interface ChangeContext {
191160 | CompositionEvent < HTMLDivElement > ;
192161}
193162
194- export type ChangeSource =
195- | "add"
196- | "reduce"
197- | "input"
198- | "blur"
199- | "enter"
200- | "clear"
201- | "props" ;
163+ export type ChangeSource = 'add' | 'reduce' | 'input' | 'blur' | 'enter' | 'clear' | 'props' ;
0 commit comments