import TyComponent from '../common/component'

TyComponent({
  /**
   * 组件的属性列表
   */
  properties: {
    show: {
      type: Boolean
    },
    actions: {
      type: Array,
      value: []
    },
    title: {
      type: String
    },
    description: {
      type: String
    },
    zIndex: {
      type: Number,
      value: 100
    },
    cancelText: {
      type: String
    },
    overlay: {
      type: Boolean,
      value: true
    },
    round: {
      type: Boolean,
      value: true
    },
    closeOnClickAction: {
      type: Boolean,
      value: true
    },
    closeOnClickOverlay: {
      type: Boolean,
      value: true
    },
    safeAreaInsetBottom: {
      type: Boolean,
      value: true
    }

  },

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

  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleSelect({detail}) {
      this.triggerEvent('select', detail)
    },
    handleClose({detail}) {
      this.triggerEvent('close', detail)
    },
    handleCancel({detail}) {
      this.triggerEvent('cancel', detail)
    },
    handleClickOverlay({detail}) {
      this.triggerEvent('click-overlay', detail)
    },
  }
})
