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

'use strict';

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

var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var Vue = require('vue');
var checkbox_index = require('../../checkbox/index.js');
var radio_index = require('../../radio/index.js');
var config = require('../../config.js');
require('../../checkbox/group.js');
require('@babel/runtime/helpers/toConsumableArray');
require('../../_chunks/dep-44e6bdf6.js');
require('@babel/runtime/helpers/typeof');
require('lodash/intersection');
require('../../checkbox/checkbox.js');
require('../../utils/render-tnode.js');
require('../../utils/classnames.js');
require('../../checkbox/props.js');
require('../../utils/helper.js');
require('@babel/runtime/helpers/objectWithoutProperties');
require('@babel/runtime/helpers/slicedToArray');
require('lodash/camelCase');
require('../../utils/event.js');
require('../../checkbox/checkbox-group-props.js');
require('../../utils/map-props.js');
require('../../utils/withInstall.js');
require('lodash/capitalize');
require('../../radio/radio.js');
require('../../radio/props.js');
require('../../radio/group.js');
require('lodash/isString');
require('lodash/isNumber');
require('../../radio/radio-group-props.js');
require('../../radio/radio-button.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
var Vue__default = /*#__PURE__*/_interopDefaultLegacy(Vue);

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__default["default"](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_index.Checkbox,
  single: radio_index.Radio
};
var SelectBox = Vue__default["default"].extend({
  name: "".concat(config.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);
        }
      }
    });
  }
});

exports["default"] = SelectBox;
//# sourceMappingURL=select-box.js.map
