"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: 'VxeTableTransfer',
  props: {
    modelValue: Array,
    options: Array,
    size: {
      type: String,
      default: function _default() {
        return (0, _ui.getConfig)().tableTransfer.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 $xeTableTransfer = this;
      $xeTableTransfer.$emit(type, (0, _ui.createEvent)(evnt, {
        $tableTransfer: $xeTableTransfer
      }, params));
    },
    emitModel: function emitModel(value) {
      var $xeTableTransfer = this;
      var _events = $xeTableTransfer._events;
      if (_events && _events.modelValue) {
        $xeTableTransfer.$emit('modelValue', value);
      } else {
        $xeTableTransfer.$emit('model-value', value);
      }
    },
    //
    // Render
    //
    renderVN: function renderVN(h) {
      var $xeTableTransfer = this;
      var slots = $xeTableTransfer.$scopedSlots;
      var defaultSlot = slots.default;
      return h('div', {
        ref: 'refElem',
        class: 'vxe-table-transfer'
      }, defaultSlot ? defaultSlot({}) : []);
    }
  },
  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 */