"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _comp = require("../../ui/src/comp");
var _xeUtils = _interopRequireDefault(require("xe-utils"));
var _ui = require("../../ui");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function createReactData() {
  return {};
}
function createInternalData() {
  return {};
}
var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defineVxeComponent)({
  name: 'VxeTransfer',
  props: {
    modelValue: Array,
    options: Array,
    size: {
      type: String,
      default: function _default() {
        return (0, _ui.getConfig)().transfer.size || (0, _ui.getConfig)().size;
      }
    }
  },
  data: function data() {
    var xID = _xeUtils.default.uniqueId();
    var reactData = createReactData();
    return Object.assign(Object.assign({}, {}), {
      xID: xID,
      reactData: reactData
    });
  },
  methods: {
    //
    // Method
    //
    dispatchEvent: function dispatchEvent(type, params, evnt) {
      var $xeTransfer = this;
      $xeTransfer.$emit(type, (0, _ui.createEvent)(evnt, {
        $transfer: $xeTransfer
      }, params));
    },
    emitModel: function emitModel(value) {
      var $xeTransfer = this;
      var _events = $xeTransfer._events;
      if (_events && _events.modelValue) {
        $xeTransfer.$emit('modelValue', value);
      } else {
        $xeTransfer.$emit('model-value', value);
      }
    },
    //
    // Render
    //
    renderVN: function renderVN(h) {
      var $xeTransfer = this;
      var slots = $xeTransfer.$scopedSlots;
      var headerSlot = slots.header;
      var footerSlot = slots.footer;
      return h('div', {
        ref: 'refElem',
        class: 'vxe-transfer'
      }, [headerSlot ? h('div', {
        class: 'vxe-transfer--header'
      }, headerSlot({
        $transfer: $xeTransfer
      })) : (0, _ui.renderEmptyElement)($xeTransfer), h('div'), h('div'), h('div'), footerSlot ? h('div', {
        class: 'vxe-transfer--footer'
      }, footerSlot({
        $transfer: $xeTransfer
      })) : (0, _ui.renderEmptyElement)($xeTransfer)]);
    }
  },
  created: function created() {
    var $xeUpload = this;
    $xeUpload.internalData = createInternalData();
  },
  beforeDestroy: function beforeDestroy() {
    var $xeUpload = this;
    var reactData = $xeUpload.reactData;
    var internalData = $xeUpload.internalData;
    _xeUtils.default.assign(reactData, createReactData());
    _xeUtils.default.assign(internalData, createInternalData());
  },
  render: function render(h) {
    return this.renderVN(h);
  }
});
/* define-vxe-component end */