UNPKG

element-plus

Version:

A Component Library for Vue 3

139 lines (138 loc) 6 kB
import type { ExtractPublicPropTypes, HTMLAttributes } from 'vue'; import type { ComponentSize } from 'element-plus/es/constants'; import type InputNumber from './input-number.vue'; /** * @description input-number component props */ export interface InputNumberProps { /** * @description same as `id` in native input */ id?: string; /** * @description incremental step */ step?: number; /** * @description whether input value can only be multiple of step */ stepStrictly?: boolean; /** * @description the maximum allowed value */ max?: number; /** * @description the minimum allowed value */ min?: number; /** * @description binding value */ modelValue?: number | null; /** * @description same as `readonly` in native input */ readonly?: boolean; /** * @description whether the component is disabled */ disabled?: boolean; /** * @description size of the component */ size?: ComponentSize; /** * @description whether to enable the control buttons */ controls?: boolean; /** * @description position of the control buttons */ controlsPosition?: '' | 'right'; /** * @description value should be set when input box is cleared */ valueOnClear?: 'min' | 'max' | number | null; /** * @description same as `name` in native input */ name?: string; /** * @description same as `placeholder` in native input */ placeholder?: string; /** * @description precision of input value */ precision?: number; /** * @description whether to trigger form validation */ validateEvent?: boolean; /** * @description native aria-label attribute */ ariaLabel?: string; /** * @description native input mode for virtual keyboards */ inputmode?: HTMLAttributes['inputmode']; /** * @description alignment for the inner input text */ align?: 'left' | 'right' | 'center'; /** * @description whether to disable scientific notation input (e.g. 'e', 'E') */ disabledScientific?: boolean; } /** * @deprecated Removed after 3.0.0, Use `InputNumberProps` instead. */ export declare const inputNumberProps: { readonly inputmode: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | ((new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined))[], unknown, unknown, undefined, boolean>; readonly align: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "center" | "left" | "right") | (() => "center" | "left" | "right") | ((new (...args: any[]) => "center" | "left" | "right") | (() => "center" | "left" | "right"))[], unknown, unknown, "center", boolean>; readonly disabledScientific: BooleanConstructor; readonly ariaLabel: StringConstructor; readonly id: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>; readonly step: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>; readonly stepStrictly: BooleanConstructor; readonly max: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>; readonly min: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>; readonly modelValue: { readonly type: import("vue").PropType<any>; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly readonly: BooleanConstructor; readonly disabled: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>; readonly size: { readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly controls: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>; readonly controlsPosition: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "right", unknown, "", boolean>; readonly valueOnClear: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => number | "min" | "max") | (() => number | "min" | "max" | null) | ((new (...args: any[]) => number | "min" | "max") | (() => number | "min" | "max" | null))[], unknown, unknown, null, boolean>; readonly name: StringConstructor; readonly placeholder: StringConstructor; readonly precision: { readonly type: import("vue").PropType<number>; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly validateEvent: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>; }; export type InputNumberPropsPublic = ExtractPublicPropTypes<typeof inputNumberProps>; export declare const inputNumberEmits: { change: (cur: number | undefined, prev: number | undefined) => boolean; blur: (e: FocusEvent) => boolean; focus: (e: FocusEvent) => boolean; input: (val: number | null | undefined) => boolean; "update:modelValue": (val: number | undefined) => boolean; }; export type InputNumberEmits = typeof inputNumberEmits; export type InputNumberInstance = InstanceType<typeof InputNumber> & unknown;