<template>
  <MapComponent
    :value="props.value"
    :disabled="props.disabled"
    :record="props.record"
    :placeholder="props.record?.placeholderContent || props.placeholder"
    :readonly="props.readonly"
    @onChange="onChange"
    @onClick="onClick"
    @onBlur="onBlur"
    @onFocus="onFocus"
    @update:value="updateValue"
  ></MapComponent>
</template>

<script setup name="FormMap">
const props = defineProps({
  value: {
    type: String,
    default: ''
  },
  //是否禁用
  disabled: {
    type: Boolean,
    default: false
  },
  record: {
    type: Object,
    default: {}
  },
  placeholder: {
    type: String,
    default: '请选择'
  },
  // 是否只读
  readonly: {
    type: Boolean,
    default: false
  }
});

const emits = defineEmits(['update:value', 'onChange', 'onClick', 'onBlur', 'onFocus']);

const onChange = record => {
  emits('onChange', record);
};
const onClick = record => {
  emits('onClick', record);
};
const onBlur = record => {
  emits('onBlur', record);
};
const onFocus = record => {
  emits('onFocus', record);
};

const updateValue = value => {
  emits('update:value', value);
};
</script>

<style></style>
