import { extractPropsDefaultValue } from '../_util/utils';
import { CHECK_STRATEGY } from './const';

const treeProps = {
  data: {
    type: Array,
    default() {
      return [];
    }
  },
  defaultExpandAll: {
    type: Boolean,
    default: false
  },
  expandedKeys: {
    type: Array,
    default() {
      return [];
    }
  },
  accordion: {
    type: Boolean,
    default: false
  },
  selectable: {
    type: Boolean,
    default: true
  },
  selectedKeys: {
    type: Array,
    default() {
      return [];
    }
  },
  cascade: {
    type: Boolean,
    default: false
  },
  checkable: {
    type: Boolean,
    default: false
  },
  checkStrictly: {
    type: String,
    default: CHECK_STRATEGY.ALL
  },
  checkedKeys: {
    type: Array,
    default() {
      return [];
    }
  },
  multiple: {
    type: Boolean,
    default: false
  },
  childrenField: {
    type: String,
    default: 'children'
  },
  valueField: {
    type: String,
    default: 'value'
  },
  labelField: {
    type: String,
    default: 'label'
  },
  remote: {
    type: Boolean,
    default: false
  },
  loadData: {
    type: Function
  },
  filterMethod: {
    type: Function
  },
  inline: {
    type: Boolean,
    default: false
  },
  virtualList: {
    type: Boolean,
    default: false
  },
  cancelable: {
    type: Boolean,
    default: true
  },
  draggable: {
    type: Boolean,
    default: false
  },
  filterText: String,
  filterTextHighlight: Boolean
};
const treePropsDefaultValue = extractPropsDefaultValue(treeProps);
const TREE_PROVIDE_KEY = Symbol('FTree');

export { TREE_PROVIDE_KEY, treeProps, treePropsDefaultValue };
