/**
 * tdesign v0.39.1-alpha.1
 * (c) 2022 tdesign
 * @license MIT
 */

import { h as helper } from '../_chunks/dep-1ec74b8b.js';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import Vue from 'vue';
import { renderContent } from '../utils/render-tnode.js';
import props from './props.js';
import _Radio from './radio.js';
import '@babel/runtime/helpers/typeof';
import 'lodash/isObject';
import '../config.js';
import '../utils/classnames.js';
import '../utils/helper.js';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/helpers/slicedToArray';
import 'lodash/camelCase';
import '../utils/event.js';

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
var _RadioButton = Vue.extend({
  name: "TRadioButton",
  inheritAttrs: false,
  props: _objectSpread({}, props),
  components: {
    Radio: _Radio
  },
  provide: function provide() {
    return {
      radioButton: this
    };
  },
  inject: {
    radioGroup: {
      "default": void 0
    }
  },
  render: function render() {
    var h = arguments[0];
    var $props = this.$props,
        $listeners = this.$listeners,
        radioGroup = this.radioGroup;
    var radioProps = {
      props: _objectSpread({}, $props),
      on: $listeners
    };

    if (radioGroup) {
      radioProps.props.checked = $props.value === radioGroup.value;
      radioProps.props.disabled = $props.disabled === void 0 ? radioGroup.disabled : $props.disabled;
      radioProps.props.name = radioGroup.name;
    }

    return h(_Radio, helper([{}, radioProps]), [renderContent(this, "default", "label")]);
  }
});

export { _RadioButton as default };
//# sourceMappingURL=radio-button.js.map
