import { FORM_LAYOUT, LABEL_POSITION, FORM_ITEM_ALIGN } from './const';

const formProps = {
  model: Object,
  rules: {
    type: Object,
    default: () => ({})
  },
  layout: {
    type: String,
    default: FORM_LAYOUT.HORIZONTAL
  },
  span: {
    type: Number,
    default: 6
  },
  inlineItemGap: {
    type: [String, Number],
    default: 11
  },
  inlineItemWidth: [String, Number],
  labelPosition: {
    type: String,
    default: LABEL_POSITION.LEFT
  },
  labelWidth: [String, Number],
  labelClass: String,
  showMessage: {
    type: Boolean,
    default: true
  },
  disabled: {
    type: Boolean,
    default: false
  },
  align: {
    type: String,
    default: FORM_ITEM_ALIGN[0]
  }
};
const formItemProps = {
  prop: String,
  value: {
    type: [String, Number, Boolean, Object],
    default: undefined
  },
  label: String,
  labelWidth: [String, Number],
  labelClass: String,
  contentStyle: {
    type: [String, Array, Object],
    default() {
      return {};
    }
  },
  span: {
    type: Number,
    default: null
  },
  showMessage: {
    type: Boolean,
    default: null
  },
  disabled: {
    type: Boolean,
    default: () => undefined
  },
  rules: {
    type: Array,
    default: () => {
      return [];
    }
  },
  align: {
    type: String,
    default: null
  }
};

export { formItemProps, formProps };
