/**
 * tdesign v0.32.0
 * (c) 2021 tdesign
 * @license MIT
 */

import _defineProperty from '@babel/runtime/helpers/defineProperty';
import Vue from 'vue';
import { Checkbox } from '../../checkbox/index.js';
import { Radio } from '../../radio/index.js';
import { prefix } from '../../config.js';
import '../../checkbox/group.js';
import '@babel/runtime/helpers/toConsumableArray';
import '../../_chunks/dep-42d5c87e.js';
import '@babel/runtime/helpers/typeof';
import 'lodash/intersection';
import '../../checkbox/checkbox.js';
import '../../utils/render-tnode.js';
import '../../utils/classnames.js';
import '../../checkbox/props.js';
import '../../utils/helper.js';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/helpers/slicedToArray';
import 'lodash/camelCase';
import '../../utils/event.js';
import '../../checkbox/checkbox-group-props.js';
import '../../utils/map-props.js';
import '../../utils/withInstall.js';
import 'lodash/capitalize';
import './style/css.js';
import '../../checkbox/type.js';
import '../../radio/radio.js';
import '../../radio/props.js';
import '../../radio/group.js';
import 'lodash/isString';
import 'lodash/isNumber';
import '../../radio/radio-group-props.js';
import '../../radio/radio-button.js';
import '../../radio/type.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 inputType = {
  multiple: Checkbox,
  single: Radio
};
var SelectBox = Vue.extend({
  name: "".concat(prefix, "-select-box"),
  props: {
    checked: {
      type: Boolean,
      "default": false
    },
    indeterminate: {
      type: Boolean,
      "default": false
    },
    type: {
      type: String,
      validator: function validator(value) {
        return ["multiple", "single"].includes(value);
      },
      "default": "multiple"
    },
    checkProps: {
      type: Object,
      "default": function _default() {
        return {};
      }
    },
    disabled: {
      type: Boolean,
      "default": false
    },
    index: {
      type: Number,
      "default": -1
    }
  },
  data: function data() {
    return {};
  },
  render: function render(h) {
    var _this = this;

    var checked = this.checked,
        indeterminate = this.indeterminate,
        type = this.type,
        checkProps = this.checkProps,
        disabled = this.disabled,
        $listeners = this.$listeners;
    return h(inputType[type], {
      props: _objectSpread({
        checked: checked
      }, checkProps),
      attrs: {
        style: "display: inline-block",
        indeterminate: indeterminate,
        type: inputType[type],
        disabled: disabled
      },
      on: _objectSpread({}, $listeners),
      nativeOn: {
        click: function click(e) {
          _this.$emit("click", e);
        }
      }
    });
  }
});

export { SelectBox as default };
//# sourceMappingURL=select-box.js.map
