UNPKG

element-plus

Version:

A Component Library for Vue 3

72 lines (69 loc) 1.6 kB
import { isNil } from 'lodash-unified'; import '../../../utils/index2.mjs'; import '../../../constants/index2.mjs'; import { buildProps } from '../../../utils/vue/props2.mjs'; import { componentSizes } from '../../../constants/size2.mjs'; import { isNumber } from '@vueuse/core'; const inputNumberProps = buildProps({ id: { type: String, default: void 0 }, step: { type: Number, default: 1 }, stepStrictly: { type: Boolean, default: false }, max: { type: Number, default: Number.POSITIVE_INFINITY }, min: { type: Number, default: Number.NEGATIVE_INFINITY }, modelValue: { type: Number }, disabled: { type: Boolean, default: false }, size: { type: String, values: componentSizes }, controls: { type: Boolean, default: true }, controlsPosition: { type: String, default: "", values: ["", "right"] }, valueOnClear: { type: [String, Number, null], validator: (val) => val === null || isNumber(val) || ["min", "max"].includes(val), default: null }, name: String, label: String, placeholder: String, precision: { type: Number, validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10) } }); const inputNumberEmits = { change: (prev, cur) => prev !== cur, blur: (e) => e instanceof FocusEvent, focus: (e) => e instanceof FocusEvent, input: (val) => isNumber(val) || isNil(val), "update:modelValue": (val) => isNumber(val) || isNil(val) }; export { inputNumberEmits, inputNumberProps }; //# sourceMappingURL=input-number3.mjs.map