import { Empty } from 'ant-design-vue'

const pickerSourceMixin = {
  props: {
    /**
     * 多个数据源时，Tab页的标题
     */
    title: {
      type: String,
      default: undefined,
    },
    /**
     * 多个数据源时，Tab页的图标
     */
    icon: {
      type: String,
      default: undefined,
    },
    /**
     * @ignore
     */
    optionLabel: {
      type: String,
      default: 'name',
    },
    /**
     * @ignore
     */
    optionValue: {
      type: String,
      default: 'id',
    },
    /**
     * @ignore
     */
    render: {
      type: Function,
      default: function(item) {
        return item[this.optionLabel]
      },
    },
    /**
     * @ignore
     */
    single: {
      type: Boolean,
      default: false,
    },
    /**
     * @ignore
     */
    targetKeys: {
      type: Array,
      default: undefined,
    },
    /**
     * @ignore
     */
    selectedKeys: {
      type: Array,
      default: undefined,
    },
    /**
     * @ignore
     */
    itemSelect: {
      type: Function,
      default: () => {},
    },
    /**
     * @ignore
     */
    updateDataSource: {
      type: Function,
      default: () => {},
    },
    /**
     * @ignore
     */
    dataSource: {
      type: Array,
      default: undefined,
    },
    /**
     * @ignore
     */
    itemDblClick: {
      type: Function,
      default: () => {},
    },
    /**
     * @ignore
     */
    searchValue: {
      type: String,
      default: undefined,
    },
    /**
     * @ignore
     */
    updateShowSearch: {
      type: Function,
      default: () => {},
    },
    /**
     * @ignore
     */
    disabledKeys: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      dataLoaded: false,
    }
  },
  beforeCreate() {
    this.simpleImage = Empty.PRESENTED_IMAGE_SIMPLE
  },
  inheritAttrs: false,
}
export default pickerSourceMixin
