import { defineComponent, ref, computed } from 'vue';
import { ElImage } from '../../image/index.mjs';
import { UPDATE_MODEL_EVENT } from '../../../utils/constants.mjs';
import { useRadio } from './radio.mjs';

var script = defineComponent({
  name: "ElRadioItem",
  components: {
    ElImage
  },
  props: {
    modelValue: {
      type: [String, Number, Boolean],
      default: ""
    },
    label: {
      type: [String, Number, Boolean],
      default: ""
    },
    name: {
      type: String,
      default: ""
    },
    iconUrl: {
      type: String,
      default: ""
    }
  },
  setup(props, { emit }) {
    const { isGroup, radioGroup, focus, disabled: disabled2 } = useRadio(props, emit);
    const radioRef = ref();
    const value = computed({
      get() {
        return isGroup.value ? radioGroup.modelValue : props.modelValue;
      },
      set(value2) {
        if (isGroup.value) {
          radioGroup.changeEvent(value2);
          radioRef.value.checked = radioGroup.modelValue === props.label;
        } else {
          emit(UPDATE_MODEL_EVENT, value2);
        }
      }
    });
    return {
      isDisabled: disabled2,
      focus,
      value,
      radioRef
    };
  }
});

export { script as default };
//# sourceMappingURL=radio-item.vue_vue_type_script_lang.mjs.map
