'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../hooks/index.js');
var radio = require('./radio.js');
var useRadio = require('./use-radio.js');
var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
var index = require('../../../hooks/use-namespace/index.js');

const _hoisted_1 = ["value", "name", "disabled"];
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("svg", {
  xmlns: "http://www.w3.org/2000/svg",
  width: "8",
  height: "6",
  viewBox: "0 0 8 6"
}, [
  /* @__PURE__ */ vue.createElementVNode("path", {
    d: "M1.578 2.82802L3.125 4.37502L6.813 0.702521C6.96933 0.546188 7.1595 0.496688 7.3835 0.554021C7.6075 0.611355 7.74817 0.752021 7.8055 0.976021C7.86283 1.20002 7.81333 1.39019 7.657 1.54652L3.5475 5.65602C3.43283 5.77069 3.29217 5.82802 3.1255 5.82802C2.95883 5.82802 2.81817 5.77069 2.7035 5.65602L0.718998 3.67152C0.604665 3.54652 0.547332 3.40586 0.546997 3.24952C0.546665 3.09319 0.606499 2.95519 0.726499 2.83552C0.846499 2.71585 0.987165 2.65602 1.1485 2.65602C1.30983 2.65602 1.453 2.71335 1.578 2.82802Z",
    fill: "currentColor"
  })
], -1);
const __default__ = vue.defineComponent({
  name: "ElRadio"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...__default__,
  props: radio.radioProps,
  emits: radio.radioEmits,
  setup(__props, { emit }) {
    const props = __props;
    const ns = index.useNamespace("radio");
    const { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio.useRadio(props, emit);
    function handleChange() {
      vue.nextTick(() => emit("change", modelValue.value));
    }
    return (_ctx, _cache) => {
      var _a;
      const _component_el_icon = vue.resolveComponent("el-icon");
      return vue.openBlock(), vue.createElementBlock("label", {
        class: vue.normalizeClass([
          vue.unref(ns).b(),
          vue.unref(ns).is("disabled", vue.unref(disabled)),
          vue.unref(ns).is("focus", vue.unref(focus)),
          vue.unref(ns).is("bordered", _ctx.border),
          vue.unref(ns).is("checked", vue.unref(modelValue) === _ctx.label),
          vue.unref(ns).m(vue.unref(size))
        ])
      }, [
        vue.createElementVNode("span", {
          class: vue.normalizeClass([
            vue.unref(ns).e("input"),
            vue.unref(ns).is("disabled", vue.unref(disabled)),
            vue.unref(ns).is("checked", vue.unref(modelValue) === _ctx.label)
          ])
        }, [
          vue.withDirectives(vue.createElementVNode("input", {
            ref_key: "radioRef",
            ref: radioRef,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null),
            class: vue.normalizeClass(vue.unref(ns).e("original")),
            value: _ctx.label,
            name: _ctx.name || ((_a = vue.unref(radioGroup)) == null ? void 0 : _a.name),
            disabled: vue.unref(disabled),
            type: "radio",
            onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
            onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
            onChange: handleChange
          }, null, 42, _hoisted_1), [
            [vue.vModelRadio, vue.unref(modelValue)]
          ]),
          vue.createElementVNode("span", {
            class: vue.normalizeClass(vue.unref(ns).e("inner"))
          }, [
            vue.createVNode(_component_el_icon, null, {
              default: vue.withCtx(() => [
                _hoisted_2
              ]),
              _: 1
            })
          ], 2)
        ], 2),
        vue.createElementVNode("span", {
          class: vue.normalizeClass(vue.unref(ns).e("label")),
          onKeydown: _cache[3] || (_cache[3] = vue.withModifiers(() => {
          }, ["stop"]))
        }, [
          vue.renderSlot(_ctx.$slots, "default", {}, () => [
            vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
          ])
        ], 34)
      ], 2);
    };
  }
});
var Radio = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/kimihiro/workfiles/dingdandao/element-plus/packages/components/radio/src/radio.vue"]]);

exports["default"] = Radio;
//# sourceMappingURL=radio2.js.map
