import single from "./single";
import range from "./range";
import Popup from "../popup";
import "./index.css";

var __vue_render__ = function __vue_render__() {
  var _vm = this;

  var _h = _vm.$createElement;

  var _c = _vm._self._c || _h;

  return _c('Popup', {
    staticClass: "ks-month-popup",
    attrs: {
      "value": _vm.value,
      "position": "bottom",
      "get-container": "body",
      "close-icon-position": "top-left",
      "close-icon": "arrow-left",
      "duration": "0.2",
      "closeable": true
    },
    on: {
      "input": _vm.handleClosePopup,
      "open": _vm.handleOpenPopup
    }
  }, [_vm.type === 'single' ? _c('single', _vm._g(_vm._b({
    ref: "single"
  }, 'single', _vm.$attrs, false), _vm.$listeners)) : _vm._e(), _vm._v(" "), _vm.type === 'range' ? _c('range', _vm._g(_vm._b({
    ref: "range"
  }, 'range', _vm.$attrs, false), _vm.$listeners)) : _vm._e()], 1);
};

var __vue_staticRenderFns__ = [];
export default {
  render: __vue_render__,
  staticRenderFns: __vue_staticRenderFns__,
  components: {
    single: single,
    range: range,
    Popup: Popup
  },
  name: "ks-month",
  props: {
    value: {
      type: Boolean,
      required: true
    },
    type: {
      type: String,
      default: "range"
    }
  },
  methods: {
    handleClosePopup: function handleClosePopup(e) {
      this.$emit("input", e);
      this.$refs[this.type].scrollClear();
    },
    handleOpenPopup: function handleOpenPopup() {
      var _this = this;

      this.$nextTick(function () {
        _this.$refs[_this.type].scrollInto();
      });
    }
  }
};