import TyComponent from '../common/component'

TyComponent({
  /**
   * 组件的属性列表
   */
  properties: {

    name: {
      type: String
    },
    value: {
      type: [String, Number],
      value: '最小值'
    },
    min: {
      type: [String, Number],
      value: 1
    },
    max: {
      type: [String, Number],
      value: Number.MAX_SAFE_INTEGER
    },
    step: {
      type: [String, Number],
      value: 1
    },
    integer: {
      type: Boolean,
      value: false
    },
    disabled: {
      type: Boolean,
      value: false
    },
    disableInput: {
      type: Boolean,
      value: false
    },
    asyncChange: {
      type: Boolean,
      value: false
    },
    inputWidth: {
      type: [String, Number],
      value: '32px'
    },
    buttonSize: {
      type: [String, Number],
      value: '28px'
    },
    showPlus: {
      type: Boolean,
      value: true
    },
    showMinus: {
      type: Boolean,
      value: true
    },
    decimalLength: {
      type: Number
    },
    disablePlus: {
      type: Boolean
    },
    disableMinus: {
      type: Boolean
    },
    customClass: {
      type: String
    },
    inputClass: {
      type: String
    },
    plusClass: {
      type: String
    },
    minusClass: {
      type: String
    }

  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleChange({detail}) {
      this.triggerEvent('change', detail)
    },
    handleOverlimit({detail}) {
      this.triggerEvent('overlimit', detail)
    },
    handlePlus({detail}) {
      this.triggerEvent('plus', detail)
    },
    handleMinus({detail}) {
      this.triggerEvent('minus', detail)
    },
    handleFocus({detail}) {
      this.triggerEvent('focus', detail)
    },
    handleBlur({detail}) {
      this.triggerEvent('blur', detail)
    },
  }
})
