"use strict";
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "l-radio-group",
  props: {
    allowUncheck: { type: Boolean, default: false },
    disabled: { type: Boolean, default: false },
    name: {},
    value: {},
    defaultValue: {},
    modelValue: {},
    checkedColor: {},
    iconBgColor: {},
    iconBorderColor: {},
    iconDisabledColor: {},
    iconDisabledBgColor: {},
    icon: {},
    size: {},
    iconSize: {},
    fontSize: {},
    gap: {},
    direction: { default: "horizontal" }
  },
  emits: ["change", "update:modelValue"],
  setup(__props, _a) {
    var __emit = _a.emit;
    const emit = __emit;
    const props = __props;
    const innerValue = common_vendor.ref(null);
    const groupValue = common_vendor.computed({
      set(value = null) {
        innerValue.value = value;
        emit("update:modelValue", value);
        emit("change", value);
      },
      get() {
        var _a2, _b, _c;
        return (_c = (_b = (_a2 = props.value) !== null && _a2 !== void 0 ? _a2 : props.modelValue) !== null && _b !== void 0 ? _b : props.defaultValue) !== null && _c !== void 0 ? _c : innerValue.value;
      }
    });
    const handleRadioChange = (val = null) => {
      if (props.allowUncheck && val == groupValue.value) {
        groupValue.value = "";
      } else {
        groupValue.value = val;
      }
    };
    common_vendor.provide("limeRadioGroupProps", props);
    common_vendor.provide("limeRadioGroupValue", groupValue);
    common_vendor.provide("limeRadioGroupChange", handleRadioChange);
    return (_ctx = null, _cache = null) => {
      const __returned__ = {
        a: common_vendor.sei(_ctx.virtualHostId, "view"),
        b: common_vendor.n("l-radio-group--" + _ctx.direction)
      };
      return __returned__;
    };
  }
});
wx.createComponent(_sfc_main);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/lime-radio/components/l-radio-group/l-radio-group.js.map
