input-number.d.ts 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. import { EpPropFinalized, EpPropMergeType } from "../../../utils/vue/props/types.js";
  2. import { ComponentSize } from "../../../constants/size.js";
  3. import _default from "./input-number.vue.js";
  4. import * as _$vue from "vue";
  5. import { ExtractPublicPropTypes, HTMLAttributes } from "vue";
  6. //#region ../../packages/components/input-number/src/input-number.d.ts
  7. /**
  8. * @description input-number component props
  9. */
  10. interface InputNumberProps {
  11. /**
  12. * @description same as `id` in native input
  13. */
  14. id?: string;
  15. /**
  16. * @description incremental step
  17. */
  18. step?: number;
  19. /**
  20. * @description whether input value can only be multiple of step
  21. */
  22. stepStrictly?: boolean;
  23. /**
  24. * @description the maximum allowed value
  25. */
  26. max?: number;
  27. /**
  28. * @description the minimum allowed value
  29. */
  30. min?: number;
  31. /**
  32. * @description binding value
  33. */
  34. modelValue?: number | null;
  35. /**
  36. * @description same as `readonly` in native input
  37. */
  38. readonly?: boolean;
  39. /**
  40. * @description whether the component is disabled
  41. */
  42. disabled?: boolean;
  43. /**
  44. * @description size of the component
  45. */
  46. size?: ComponentSize;
  47. /**
  48. * @description whether to enable the control buttons
  49. */
  50. controls?: boolean;
  51. /**
  52. * @description position of the control buttons
  53. */
  54. controlsPosition?: '' | 'right';
  55. /**
  56. * @description value should be set when input box is cleared
  57. */
  58. valueOnClear?: 'min' | 'max' | number | null;
  59. /**
  60. * @description same as `name` in native input
  61. */
  62. name?: string;
  63. /**
  64. * @description same as `placeholder` in native input
  65. */
  66. placeholder?: string;
  67. /**
  68. * @description precision of input value
  69. */
  70. precision?: number;
  71. /**
  72. * @description whether to trigger form validation
  73. */
  74. validateEvent?: boolean;
  75. /**
  76. * @description native aria-label attribute
  77. */
  78. ariaLabel?: string;
  79. /**
  80. * @description native input mode for virtual keyboards
  81. */
  82. inputmode?: HTMLAttributes['inputmode'];
  83. /**
  84. * @description alignment for the inner input text
  85. */
  86. align?: 'left' | 'right' | 'center';
  87. /**
  88. * @description whether to disable scientific notation input (e.g. 'e', 'E')
  89. */
  90. disabledScientific?: boolean;
  91. /**
  92. * @description specifies the format of the value presented in the input
  93. */
  94. formatter?: (value: string) => string;
  95. /**
  96. * @description specifies the value extracted from the formatted input
  97. */
  98. parser?: (value: string) => string;
  99. /**
  100. * @description same as `tabindex` in native input
  101. */
  102. tabindex?: string | number;
  103. }
  104. /**
  105. * @deprecated Removed after 3.0.0, Use `InputNumberProps` instead.
  106. */
  107. declare const inputNumberProps: {
  108. readonly inputmode: EpPropFinalized<(new (...args: any[]) => "search" | "none" | "text" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "none" | "text" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | (((new (...args: any[]) => "search" | "none" | "text" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "none" | "text" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined)) | null)[], unknown, unknown, undefined, boolean>;
  109. readonly align: EpPropFinalized<(new (...args: any[]) => "right" | "left" | "center") | (() => "right" | "left" | "center") | (((new (...args: any[]) => "right" | "left" | "center") | (() => "right" | "left" | "center")) | null)[], unknown, unknown, "center", boolean>;
  110. readonly disabledScientific: BooleanConstructor;
  111. readonly formatter: {
  112. readonly type: _$vue.PropType<Function>;
  113. readonly required: false;
  114. readonly validator: ((val: unknown) => boolean) | undefined;
  115. __epPropKey: true;
  116. };
  117. readonly parser: {
  118. readonly type: _$vue.PropType<Function>;
  119. readonly required: false;
  120. readonly validator: ((val: unknown) => boolean) | undefined;
  121. __epPropKey: true;
  122. };
  123. readonly tabindex: EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 0, boolean>;
  124. readonly ariaLabel: StringConstructor;
  125. readonly id: EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
  126. readonly step: EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
  127. readonly stepStrictly: BooleanConstructor;
  128. readonly max: EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
  129. readonly min: EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
  130. readonly modelValue: {
  131. readonly type: _$vue.PropType<EpPropMergeType<readonly [NumberConstructor, null], unknown, unknown>>;
  132. readonly required: false;
  133. readonly validator: ((val: unknown) => boolean) | undefined;
  134. __epPropKey: true;
  135. };
  136. readonly readonly: BooleanConstructor;
  137. readonly disabled: EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
  138. readonly size: {
  139. readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
  140. readonly required: false;
  141. readonly validator: ((val: unknown) => boolean) | undefined;
  142. __epPropKey: true;
  143. };
  144. readonly controls: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
  145. readonly controlsPosition: EpPropFinalized<StringConstructor, "" | "right", unknown, "", boolean>;
  146. readonly valueOnClear: EpPropFinalized<(new (...args: any[]) => number | "min" | "max") | (() => number | "min" | "max" | null) | (((new (...args: any[]) => number | "min" | "max") | (() => number | "min" | "max" | null)) | null)[], unknown, unknown, null, boolean>;
  147. readonly name: StringConstructor;
  148. readonly placeholder: StringConstructor;
  149. readonly precision: {
  150. readonly type: _$vue.PropType<number>;
  151. readonly required: false;
  152. readonly validator: ((val: unknown) => boolean) | undefined;
  153. __epPropKey: true;
  154. };
  155. readonly validateEvent: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
  156. };
  157. /**
  158. * @deprecated Removed after 3.0.0, Use `InputNumberProps` instead.
  159. */
  160. type InputNumberPropsPublic = ExtractPublicPropTypes<typeof inputNumberProps>;
  161. declare const inputNumberEmits: {
  162. change: (cur: number | undefined, prev: number | undefined) => boolean;
  163. blur: (e: FocusEvent) => boolean;
  164. focus: (e: FocusEvent) => boolean;
  165. input: (val: number | null | undefined) => boolean;
  166. "update:modelValue": (val: number | undefined) => boolean;
  167. };
  168. type InputNumberEmits = typeof inputNumberEmits;
  169. type InputNumberInstance = InstanceType<typeof _default> & unknown;
  170. //#endregion
  171. export { InputNumberEmits, InputNumberInstance, InputNumberProps, InputNumberPropsPublic, inputNumberEmits, inputNumberProps };