import _createClass from "@babel/runtime-corejs2/helpers/createClass";
import _inheritsLoose from "../../inheritsLoose";
import _defineProperty from "@babel/runtime-corejs2/helpers/defineProperty";
import Intact from 'intact-angular';
import template from './index.vdt';
import '../../styles/kpc.css';
import './index.css';

var Radio =
/*#__PURE__*/
function (_Intact) {
  _inheritsLoose(Radio, _Intact);

  function Radio() {
    return _Intact.apply(this, arguments) || this;
  }

  var _proto = Radio.prototype;

  _proto.defaults = function defaults() {
    return {
      disabled: false,
      value: false,
      trueValue: true
    };
  };

  _proto.isChecked = function isChecked() {
    return this.get('value') === this.get('trueValue');
  };

  _proto._destroy = function _destroy() {// we should not change data in _destroy
    // if (this.isChecked()) {
    // this.set('value', undefined);
    // }
  };

  _proto._onKeypress = function _onKeypress(e) {
    if (e.keyCode === 13) {
      this.refs.input.click();
    }
  };

  _createClass(Radio, [{
    key: "template",
    get: function get() {
      return template;
    }
  }]);

  return Radio;
}(Intact);

_defineProperty(Radio, "propTypes", {
  disabled: Boolean,
  // declare for camelizing in Vue dom template
  trueValue: undefined
});

export { Radio as default };
export { Radio };