import { buildProps, definePropType } from '@kankan/utils'
import type { ExtractPropTypes } from 'vue'

export const rangProps = buildProps({
    type: {
        type: String,
    },
    name: {
        type: String,
    },
    disabled: {
        type: Boolean,
        default: false,
    },
    modelValue: {
        type: String,
        required: false,
        default: '',
    },
    placeholder: {
        type: String,
        default: '请输入',
    },
    maxlength: {
        type: definePropType<number | string>([Number, String]),
    },
    readonly: {
        type: Boolean,
        default: false,
    },
    other: {
        type: Object,
        default: () => ({}),
    },
    right: {
        type: Boolean,
    },
    className: {
        type: String,
    },
    labelValue: {
        type: String,
        require: false,
    },
    dbhide: {
        type: Boolean,
        default: true,
    },
    inInput: {
        type: Boolean,
        default: true,
    },
    ctrl: {
        type: Boolean,
        default: true,
    },
    step: {
        type: Number,
        require: true,
        default: 1,
    },
    min: {
        type: definePropType<number | string>([Number, String]),
        require: false,
    },
    max: {
        type: definePropType<number | string>([Number, String]),
        require: false,
    },
    limit: {
        type: Number,
        default: 0,
    },
    inch: {
        type: [Boolean, String],
        default: false,
    },
    rangeInput: {
        type: Boolean,
        default: true,
    },
    rangeTips: {
        type: Boolean,
        default: false,
    },
})

export type RangProps = ExtractPropTypes<typeof rangProps>
