import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, normalizeStyle, toDisplayString } from 'vue';
import { ElRadio } from 'element-plus';

"use strict";
const __default__ = defineComponent({
  name: "me-form-radio"
});
var script = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    title: { type: String, required: true, default: "" },
    desc: { type: String, required: true, default: "" },
    radio: { type: Boolean, required: true, default: false },
    width: { type: String, required: true, default: "150px" },
    top: { type: Boolean, required: true, default: false },
    gap: { type: String, required: true, default: "30px" },
    size: { type: String, required: false, default: "normal" },
    disabled: { type: Boolean, required: false, default: false }
  },
  setup(__props) {
    ;
    const props = __props;
    const formRadioStyle = computed(() => {
      return {
        "--me-form-radio-padding": props.size == "small" ? "4px" : "10px",
        "--el-radio-input-display": props.radio ? "flex" : "none",
        "--is-checked-display": props.radio ? "none" : "flex",
        "--is-checked-before-width": props.size == "small" ? "10px" : "14px",
        "--is-checked-before-height": props.size == "small" ? "4px" : "6px",
        "--is-checked-before-top": props.top ? "0" : "auto",
        "--is-checked-before-bottom": props.size == "small" ? "5px" : "7px",
        "--is-checked-before-right": props.size == "small" ? "0" : "2px",
        "--is-checked-border-bottom": borderBottomStyle.value,
        "--is-checked-border-top": borderTopStyle.value,
        "--is-checked-border-width": borderWidth.value,
        "margin-right": props.gap
      };
    });
    const borderWidth = computed(() => {
      if (props.size == "small") {
        return "20px";
      } else {
        return "30px";
      }
    });
    const borderBottomStyle = computed(() => {
      if (props.disabled) {
        return props.top ? "0" : `${borderWidth.value} solid var(--el-disabled-border-color)`;
      } else {
        return props.top ? "0" : `${borderWidth.value} solid #206bc4`;
      }
    });
    const borderTopStyle = computed(() => {
      if (props.disabled) {
        return props.top ? `${borderWidth.value} solid var(--el-disabled-border-color)` : "0";
      } else {
        return props.top ? `${borderWidth.value} solid #206bc4` : "0";
      }
    });
    const disabledStyle = computed(() => {
      if (props.disabled) {
        return {
          backgroundColor: "var(--el-disabled-bg-color)",
          color: "var(--el-disabled-text-color)",
          borderColor: "var(--el-disabled-border-color)",
          boxShadow: "none"
        };
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(ElRadio), mergeProps(_ctx.$attrs, {
        class: "me-form-radio",
        style: { width: __props.width, ...disabledStyle.value, ...formRadioStyle.value }
      }), {
        default: withCtx(() => [
          createElementVNode(
            "div",
            {
              class: "text-primary",
              style: normalizeStyle({ ...disabledStyle.value })
            },
            toDisplayString(__props.title),
            5
            /* TEXT, STYLE */
          ),
          createElementVNode(
            "div",
            {
              class: "text-secondary",
              style: normalizeStyle({ ...disabledStyle.value })
            },
            toDisplayString(__props.desc),
            5
            /* TEXT, STYLE */
          )
        ]),
        _: 1
        /* STABLE */
      }, 16, ["style"]);
    };
  }
});

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