import TyComponent from '../common/component'

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

    name: {
      type: [String, Number]
    },
    leftWidth: {
      type: Number,
      value: 0
    },
    rightWidth: {
      type: Number,
      value: 0
    },
    asyncClose: {
      type: Boolean,
      value: false
    },
    disabled: {
      type: Boolean,
      value: false
    }

  },

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

  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleClick({detail}) {
      this.triggerEvent('click', detail)
    },
    handleClose({detail}) {
      this.triggerEvent('close', detail)
    },
    handleOpen({detail}) {
      this.triggerEvent('open', detail)
    },
    close() {
      const swipeCell = this.selectComponent('.ht-swipe-cell')
      swipeCell && swipeCell.close()
    }
  }
})
