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

const cascaderProps = {
  data: {
    type: Array,
    default() {
      return [];
    }
  },
  emptyText: {
    type: String
  },
  expandedKeys: {
    type: Array,
    default() {
      return [];
    }
  },
  selectable: {
    type: Boolean,
    default: true
  },
  selectedKeys: {
    type: Array,
    default() {
      return [];
    }
  },
  cascade: {
    type: Boolean,
    default: true
  },
  checkable: {
    type: Boolean,
    default: false
  },
  checkStrictly: {
    type: String,
    default: CHECK_STRATEGY.CHILD
  },
  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
  },
  cancelable: {
    type: Boolean,
    default: true
  },
  expandTrigger: {
    type: String,
    default: EXPAND_TRIGGER.CLICK
  },
  emitPath: {
    type: Boolean,
    default: false
  },
  initLoadKeys: {
    type: Array,
    default() {
      return [];
    }
  },
  showPath: {
    type: Boolean,
    default: false
  },
  isOpened: {
    type: Boolean,
    default: true
  }
};
const cascaderPropsDefaultValue = extractPropsDefaultValue(cascaderProps);
const CASCADER_PROVIDE_KEY = Symbol('FCascader');

export { CASCADER_PROVIDE_KEY, cascaderProps, cascaderPropsDefaultValue };
