"use strict";

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
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");
var _store = require("./store");
var _dom = require("../../ui/src/dom");
var _utils = require("../../ui/src/utils");
var _vn = require("../../ui/src/vn");
var _log = require("../../ui/src/log");
var _anime = require("../../ui/src/anime");
var _util = require("./util");
var _loading = _interopRequireDefault(require("../../loading/src/loading"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
var _createComponentLog = (0, _log.createComponentLog)('tree'),
  warnLog = _createComponentLog.warnLog,
  errLog = _createComponentLog.errLog;
var crossListDragRowObj = null;
function eqRowKey(rowKey1, rowKey2) {
  return '' + rowKey1 === '' + rowKey2;
}
function getRowKeyByField(row, keyField) {
  return row ? '' + (row[keyField] || '') : '';
}
function getRowIdByField(row, keyField) {
  if (!row) {
    return '';
  }
  var rowKey = getRowKeyByField(row, keyField);
  return (0, _utils.enModelValue)(rowKey);
}
function createReactData() {
  return {
    scrollYLoad: false,
    bodyHeight: 0,
    headHeight: 0,
    footHeight: 0,
    customHeight: 0,
    customMaxHeight: 0,
    parentHeight: 0,
    topSpaceHeight: 0,
    rowList: [],
    selectRadioRow: null,
    currRowFlag: 1,
    updateCheckboxFlag: 1,
    isAllChecked: false,
    isAllIndeterminate: false,
    insertRowFlag: 1,
    removeRowFlag: 1,
    dragRow: null,
    dragTipText: '',
    isCrossDragRow: false
  };
}
function createInternalData() {
  return {
    resizeObserver: undefined,
    fullData: [],
    afterList: [],
    fullKeyMaps: {},
    rowMaps: {},
    lastScrollLeft: 0,
    lastScrollTop: 0,
    scrollYStore: {
      startIndex: 0,
      endIndex: 0,
      visibleSize: 0,
      offsetSize: 0,
      rowHeight: 0
    },
    currentRow: null,
    selectCheckboxMaps: {},
    insertRowMaps: {},
    removeRowMaps: {}
    // prevDragRow: null,
    // prevDragPos: ''
  };
}
var _default2 = exports.default = /* define-vxe-component start */(0, _comp.defineVxeComponent)({
  name: 'VxeList',
  mixins: [_ui.globalMixins.sizeMixin],
  props: {
    data: Array,
    height: [Number, String],
    maxHeight: [Number, String],
    loading: Boolean,
    className: [String, Function],
    size: {
      type: String,
      default: function _default() {
        return (0, _ui.getConfig)().list.size || (0, _ui.getConfig)().size;
      }
    },
    autoResize: {
      type: Boolean,
      default: function _default() {
        return (0, _ui.getConfig)().list.autoResize;
      }
    },
    syncResize: [Boolean, String, Number],
    showSeq: {
      type: Boolean,
      default: function _default() {
        return (0, _ui.getConfig)().list.showSeq;
      }
    },
    showRadio: {
      type: Boolean,
      default: function _default() {
        return (0, _ui.getConfig)().list.showRadio;
      }
    },
    checkRowKey: [String, Number],
    radioConfig: Object,
    showCheckbox: {
      type: Boolean,
      default: function _default() {
        return (0, _ui.getConfig)().list.showCheckbox;
      }
    },
    checkRowKeys: Array,
    checkboxConfig: Object,
    rowConfig: Object,
    dragConfig: Object,
    menuConfig: Object,
    virtualYConfig: Object,
    scrollY: Object
  },
  data: function data() {
    var xID = _xeUtils.default.uniqueId();
    var reactData = createReactData();
    return Object.assign(Object.assign({}, {}), {
      xID: xID,
      reactData: reactData,
      crossListDragRowInfo: _store.crossListDragRowGlobal,
      reFlag: 0
    });
  },
  computed: Object.assign(Object.assign({}, {}), {
    computeRowOpts: function computeRowOpts() {
      var $xeList = this;
      var props = $xeList;
      return Object.assign({}, (0, _ui.getConfig)().list.rowConfig, props.rowConfig);
    },
    computeDragOpts: function computeDragOpts() {
      var $xeList = this;
      var props = $xeList;
      return Object.assign({}, (0, _ui.getConfig)().list.dragConfig, props.dragConfig);
    },
    computeSYOpts: function computeSYOpts() {
      var $xeList = this;
      var props = $xeList;
      return Object.assign({}, (0, _ui.getConfig)().list.virtualYConfig || (0, _ui.getConfig)().list.scrollY, props.virtualYConfig || props.scrollY);
    },
    computeKeyField: function computeKeyField() {
      var $xeList = this;
      var rowOpts = $xeList.computeRowOpts;
      var keyField = rowOpts.keyField;
      return keyField || '';
    },
    computeIsDrag: function computeIsDrag() {
      var $xeList = this;
      var props = $xeList;
      var dragConfig = props.dragConfig;
      var dragOpts = $xeList.computeDragOpts;
      return dragConfig && (0, _utils.isEnableConf)(dragOpts);
    },
    computeRowHeight: function computeRowHeight() {
      var $xeList = this;
      var rowOpts = $xeList.computeRowOpts;
      var height = rowOpts.height;
      return height;
    },
    computeRadioOpts: function computeRadioOpts() {
      var $xeList = this;
      var props = $xeList;
      return Object.assign({
        showIcon: true
      }, (0, _ui.getConfig)().list.radioConfig, props.radioConfig);
    },
    computeCheckboxOpts: function computeCheckboxOpts() {
      var $xeList = this;
      var props = $xeList;
      return Object.assign({
        showIcon: true
      }, (0, _ui.getConfig)().list.checkboxConfig, props.checkboxConfig);
    },
    computeMenuOpts: function computeMenuOpts() {
      var $xeList = this;
      var props = $xeList;
      return Object.assign({}, (0, _ui.getConfig)().list.menuConfig, props.menuConfig);
    },
    computeWrapperStyles: function computeWrapperStyles() {
      var $xeList = this;
      var rowHeight = $xeList.computeRowHeight;
      var style = {};
      if (rowHeight) {
        style['--vxe-ui-list-row-height'] = (0, _dom.toCssUnit)(rowHeight);
      }
      return style;
    },
    computeVirtualStyles: function computeVirtualStyles() {
      var $xeList = this;
      var props = $xeList;
      var reactData = $xeList.reactData;
      var height = props.height,
        maxHeight = props.maxHeight;
      var customHeight = reactData.customHeight,
        customMaxHeight = reactData.customMaxHeight,
        headHeight = reactData.headHeight,
        footHeight = reactData.footHeight;
      var style = {};
      if (height) {
        style.height = (0, _dom.toCssUnit)(Math.max(20, customHeight - headHeight - footHeight));
      } else if (maxHeight) {
        style.height = 'auto';
        style.maxHeight = (0, _dom.toCssUnit)(Math.max(20, customMaxHeight - headHeight - footHeight));
      }
      return style;
    }
  }),
  methods: {
    //
    // Method
    //
    dispatchEvent: function dispatchEvent(type, params, evnt) {
      var $xeList = this;
      $xeList.$emit(type, (0, _ui.createEvent)(evnt, {
        $list: $xeList
      }, params));
    },
    emitCheckboxMode: function emitCheckboxMode(value) {
      var $xeList = this;
      $xeList.$emit('update:checkRowKeys', value);
    },
    emitRadioMode: function emitRadioMode(value) {
      var $xeList = this;
      $xeList.$emit('update:checkRowKey', value);
    },
    callSlot: function callSlot(slotFunc, params, h) {
      var $xeList = this;
      var slots = $xeList.$scopedSlots;
      if (slotFunc) {
        if (_xeUtils.default.isString(slotFunc)) {
          slotFunc = slots[slotFunc] || null;
        }
        if (_xeUtils.default.isFunction(slotFunc)) {
          return (0, _vn.getSlotVNs)(slotFunc.call($xeList, params, h));
        }
      }
      return [];
    },
    getRowId: function getRowId(row) {
      var $xeList = this;
      var keyField = $xeList.computeKeyField;
      return getRowIdByField(row, keyField);
    },
    updateRadioModeValue: function updateRadioModeValue() {
      var $xeList = this;
      var props = $xeList;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var checkRowKey = props.checkRowKey;
      var fullKeyMaps = internalData.fullKeyMaps;
      if (checkRowKey) {
        var row = fullKeyMaps[checkRowKey];
        reactData.selectRadioRow = row || null;
      } else {
        reactData.selectRadioRow = null;
      }
    },
    updateCheckboxModeValue: function updateCheckboxModeValue() {
      var $xeList = this;
      var props = $xeList;
      var internalData = $xeList.internalData;
      var checkRowKeys = props.checkRowKeys;
      var fullKeyMaps = internalData.fullKeyMaps;
      var keyField = $xeList.computeKeyField;
      var selectMaps = {};
      if (checkRowKeys && checkRowKeys.length) {
        var _iterator = _createForOfIteratorHelper(checkRowKeys),
          _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done;) {
            var rowKey = _step.value;
            var row = fullKeyMaps[rowKey];
            if (row) {
              var rowid = getRowIdByField(row, keyField);
              selectMaps[rowid] = row;
            }
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
      }
      internalData.selectCheckboxMaps = selectMaps;
      $xeList.updateCheckboxStatus();
    },
    updateAfterDataIndex: function updateAfterDataIndex() {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var afterList = internalData.afterList,
        rowMaps = internalData.rowMaps;
      var keyField = $xeList.computeKeyField;
      var vtIndex = 0;
      afterList.forEach(function (item, index) {
        var roweid = getRowIdByField(item, keyField);
        var rowRest = rowMaps[roweid];
        if (rowRest) {
          rowRest._index = vtIndex;
        } else {
          var rest = {
            item: item,
            index: index,
            $index: -1,
            _index: vtIndex
          };
          rowMaps[roweid] = rest;
        }
        vtIndex++;
      });
    },
    cacheRowMap: function cacheRowMap() {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var fullData = internalData.fullData;
      var keyField = $xeList.computeKeyField;
      var keyMaps = {};
      fullData.forEach(function (row) {
        var rowKey = getRowKeyByField(row, keyField);
        keyMaps[rowKey] = row;
      });
      internalData.fullKeyMaps = keyMaps;
    },
    /**
       * 加载数据
       * @param {Array} datas 数据
       */
    loadData: function loadData(datas) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var scrollYStore = internalData.scrollYStore;
      var sYOpts = $xeList.computeSYOpts;
      var fullData = datas ? datas.slice(0) : [];
      Object.assign(scrollYStore, {
        startIndex: 0,
        endIndex: 1,
        visibleSize: 0
      });
      internalData.fullData = fullData;
      internalData.insertRowMaps = {};
      reactData.insertRowFlag++;
      internalData.removeRowMaps = {};
      reactData.removeRowFlag++;
      // 如果gt为0，则总是启用
      reactData.scrollYLoad = !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt <= fullData.length);
      $xeList.cacheRowMap();
      $xeList.handleData(true);
      $xeList.updateRadioModeValue();
      $xeList.updateCheckboxModeValue();
      return $xeList.computeScrollLoad().then(function () {
        $xeList.refreshScroll();
      });
    },
    /**
     * 重新加载数据
     * @param {Array} datas 数据
     */
    reloadData: function reloadData(datas) {
      var $xeList = this;
      $xeList.clearScroll();
      return $xeList.loadData(datas);
    },
    getFullData: function getFullData() {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var fullData = internalData.fullData;
      return fullData;
    },
    calcTableHeight: function calcTableHeight(key) {
      var $xeList = this;
      var props = $xeList;
      var reactData = $xeList.reactData;
      var parentHeight = reactData.parentHeight;
      var val = props[key];
      var num = 0;
      if (val) {
        if (val === '100%' || val === 'auto') {
          num = parentHeight;
        } else {
          if ((0, _dom.isScale)(val)) {
            num = Math.floor((_xeUtils.default.toInteger(val) || 1) / 100 * parentHeight);
          } else {
            num = _xeUtils.default.toNumber(val);
          }
          num = Math.max(40, num);
        }
      }
      return num;
    },
    updateHeight: function updateHeight() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var headEl = $xeList.$refs.refHeaderElem;
      var footEl = $xeList.$refs.refFooterElem;
      reactData.headHeight = headEl ? Math.floor(headEl.offsetHeight) : 0;
      reactData.footHeight = footEl ? Math.floor(footEl.offsetHeight) : 0;
      reactData.customHeight = $xeList.calcTableHeight('height');
      reactData.customMaxHeight = $xeList.calcTableHeight('maxHeight');
    },
    updateYSpace: function updateYSpace() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var scrollYLoad = reactData.scrollYLoad;
      var scrollYStore = internalData.scrollYStore,
        fullData = internalData.fullData;
      reactData.bodyHeight = scrollYLoad ? fullData.length * scrollYStore.rowHeight : 0;
      reactData.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0;
    },
    updateAfterFullData: function updateAfterFullData() {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var fullData = internalData.fullData;
      internalData.afterList = fullData.slice(0);
      $xeList.updateAfterDataIndex();
    },
    handleData: function handleData(force) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var scrollYLoad = reactData.scrollYLoad;
      var fullData = internalData.fullData,
        scrollYStore = internalData.scrollYStore,
        rowMaps = internalData.rowMaps;
      var keyField = $xeList.computeKeyField;
      if (force) {
        // 更新数据，处理筛选和排序
        $xeList.updateAfterFullData();
      }
      var rowList = scrollYLoad ? fullData.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullData.slice(0);
      if (keyField) {
        rowList.forEach(function (item, $index) {
          var rowid = getRowIdByField(item, keyField);
          var rowRest = rowMaps[rowid];
          if (rowRest) {
            rowRest.$index = $index;
          }
        });
      }
      reactData.rowList = rowList;
      return $xeList.$nextTick();
    },
    updateYData: function updateYData() {
      var $xeList = this;
      $xeList.handleData();
      $xeList.updateYSpace();
    },
    computeScrollLoad: function computeScrollLoad() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var browseObj = $xeList.browseObj;
      return $xeList.$nextTick().then(function () {
        var scrollYLoad = reactData.scrollYLoad;
        var scrollYStore = internalData.scrollYStore;
        var virtualBodyElem = $xeList.$refs.refVirtualBody;
        var sYOpts = $xeList.computeSYOpts;
        var rowHeight = 0;
        var firstRowElem;
        if (virtualBodyElem) {
          if (sYOpts.sItem) {
            firstRowElem = virtualBodyElem.querySelector(sYOpts.sItem);
          }
          if (!firstRowElem) {
            firstRowElem = virtualBodyElem.children[0];
          }
        }
        if (firstRowElem) {
          rowHeight = firstRowElem.offsetHeight;
        }
        rowHeight = Math.max(12, rowHeight);
        scrollYStore.rowHeight = rowHeight;
        // 计算 Y 逻辑
        if (scrollYLoad) {
          var scrollBodyElem = $xeList.$refs.refVirtualWrapper;
          var visibleYSize = Math.max(8, Math.ceil(scrollBodyElem.clientHeight / rowHeight));
          var offsetYSize = sYOpts.oSize ? _xeUtils.default.toNumber(sYOpts.oSize) : browseObj.edge ? 10 : 0;
          scrollYStore.offsetSize = offsetYSize;
          scrollYStore.visibleSize = visibleYSize;
          scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
          $xeList.updateYData();
        } else {
          $xeList.updateYSpace();
        }
      });
    },
    /**
     * 清除滚动条
     */
    clearScroll: function clearScroll() {
      var $xeList = this;
      var scrollBodyElem = $xeList.$refs.refVirtualWrapper;
      if (scrollBodyElem) {
        scrollBodyElem.scrollTop = 0;
      }
      return $xeList.$nextTick();
    },
    /**
     * 如果有滚动条，则滚动到对应的位置
     */
    scrollTo: function scrollTo(scrollLeft, scrollTop) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var scrollBodyElem = $xeList.$refs.refVirtualWrapper;
      if (scrollLeft) {
        if (!_xeUtils.default.isNumber(scrollLeft)) {
          scrollTop = scrollLeft.top;
          scrollLeft = scrollLeft.left;
        }
      }
      if (_xeUtils.default.isNumber(scrollLeft)) {
        scrollBodyElem.scrollLeft = scrollLeft;
      }
      if (_xeUtils.default.isNumber(scrollTop)) {
        scrollBodyElem.scrollTop = scrollTop;
      }
      if (reactData.scrollYLoad) {
        return new Promise(function (resolve) {
          setTimeout(function () {
            $xeList.$nextTick(function () {
              resolve();
            });
          }, 50);
        });
      }
      return $xeList.$nextTick();
    },
    /**
     * 刷新滚动条
     */
    refreshScroll: function refreshScroll() {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var lastScrollLeft = internalData.lastScrollLeft,
        lastScrollTop = internalData.lastScrollTop;
      return $xeList.clearScroll().then(function () {
        if (lastScrollLeft || lastScrollTop) {
          internalData.lastScrollLeft = 0;
          internalData.lastScrollTop = 0;
          return scrollTo(lastScrollLeft, lastScrollTop);
        }
      });
    },
    /**
     * 重新计算列表
     */
    recalculate: function recalculate() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var el = $xeList.$refs.refElem;
      if (el) {
        var parentEl = el.parentElement;
        var parentHeight = 0;
        if (parentEl) {
          var parentStyle = getComputedStyle(parentEl);
          parentHeight = parentEl.clientHeight - Math.ceil(_xeUtils.default.toNumber(parentStyle.paddingLeft) + _xeUtils.default.toNumber(parentStyle.paddingRight));
        }
        reactData.parentHeight = parentHeight;
        $xeList.updateHeight();
        if (el.clientWidth && el.clientHeight) {
          return $xeList.computeScrollLoad();
        }
      }
      return $xeList.$nextTick();
    },
    loadYData: function loadYData(evnt) {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var scrollYStore = internalData.scrollYStore;
      var startIndex = scrollYStore.startIndex,
        endIndex = scrollYStore.endIndex,
        visibleSize = scrollYStore.visibleSize,
        offsetSize = scrollYStore.offsetSize,
        rowHeight = scrollYStore.rowHeight;
      var scrollBodyElem = evnt.target;
      var scrollTop = scrollBodyElem.scrollTop;
      var toVisibleIndex = Math.floor(scrollTop / rowHeight);
      var offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize);
      var offsetEndIndex = toVisibleIndex + visibleSize + offsetSize;
      if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
        if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
          scrollYStore.startIndex = offsetStartIndex;
          scrollYStore.endIndex = offsetEndIndex;
          $xeList.updateYData();
        }
      }
    },
    scrollEvent: function scrollEvent(evnt) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var scrollBodyElem = evnt.target;
      var scrollTop = scrollBodyElem.scrollTop;
      var scrollLeft = scrollBodyElem.scrollLeft;
      var isX = scrollLeft !== internalData.lastScrollLeft;
      var isY = scrollTop !== internalData.lastScrollTop;
      internalData.lastScrollTop = scrollTop;
      internalData.lastScrollLeft = scrollLeft;
      if (reactData.scrollYLoad) {
        $xeList.loadYData(evnt);
      }
      $xeList.dispatchEvent('scroll', {
        scrollLeft: scrollLeft,
        scrollTop: scrollTop,
        isX: isX,
        isY: isY
      }, evnt);
    },
    getRowKey: function getRowKey(row) {
      var $xeList = this;
      var keyField = $xeList.computeKeyField;
      return getRowKeyByField(row, keyField);
    },
    eqRowKey: eqRowKey,
    eqRow: function eqRow(row1, row2) {
      var $xeList = this;
      if (row1 && row2) {
        if (row1 === row2) {
          return true;
        }
        return eqRowKey($xeList.getRowId(row1), $xeList.getRowId(row2));
      }
      return false;
    },
    eqRowByKey: function eqRowByKey(row, rowKey) {
      var $xeList = this;
      return row && eqRowKey($xeList.getRowKey(row), rowKey);
    },
    findRow: function findRow(list, row) {
      var $xeList = this;
      return row ? _xeUtils.default.find(list, function (obj) {
        return $xeList.eqRow(obj, row);
      }) : null;
    },
    findRowByKey: function findRowByKey(list, rowId) {
      var $xeList = this;
      var keyField = $xeList.computeKeyField;
      return _xeUtils.default.find(list, function (obj) {
        return eqRowKey(getRowIdByField(obj, keyField), rowId);
      });
    },
    findRowIndexOf: function findRowIndexOf(list, row) {
      var $xeList = this;
      return row ? _xeUtils.default.findIndexOf(list, function (obj) {
        return $xeList.eqRow(obj, row);
      }) : -1;
    },
    findRowIndexOfByKey: function findRowIndexOfByKey(list, rowKey) {
      var $xeList = this;
      var keyField = $xeList.computeKeyField;
      return _xeUtils.default.findIndexOf(list, function (obj) {
        return eqRowKey(getRowIdByField(obj, keyField), rowKey);
      });
    },
    isCheckedByRadioRowKey: function isCheckedByRadioRowKey(rowKey) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var selectRadioRow = reactData.selectRadioRow;
      return $xeList.getRowKey(selectRadioRow) === rowKey;
    },
    isCheckedByRadioRow: function isCheckedByRadioRow(row) {
      var $xeList = this;
      return $xeList.isCheckedByRadioRowKey($xeList.getRowKey(row));
    },
    isCheckedByCheckboxRowKey: function isCheckedByCheckboxRowKey(rowid) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var updateCheckboxFlag = reactData.updateCheckboxFlag;
      var selectCheckboxMaps = internalData.selectCheckboxMaps;
      return !!(updateCheckboxFlag && selectCheckboxMaps[rowid]);
    },
    isCheckedByCheckboxRow: function isCheckedByCheckboxRow(row) {
      var $xeList = this;
      return $xeList.isCheckedByCheckboxRowKey($xeList.getRowKey(row));
    },
    setCurrentRow: function setCurrentRow(row) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      internalData.currentRow = row;
      reactData.currRowFlag++;
      return $xeList.$nextTick();
    },
    setCurrentRowByKey: function setCurrentRowByKey(rowKey) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var fullData = internalData.fullData;
      internalData.currentRow = $xeList.findRowByKey(fullData, rowKey);
      reactData.currRowFlag++;
      return $xeList.$nextTick();
    },
    getCurrentRow: function getCurrentRow() {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var currentRow = internalData.currentRow;
      return currentRow;
    },
    getCurrentRowKey: function getCurrentRowKey() {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var currentRow = internalData.currentRow;
      return currentRow ? $xeList.getRowKey(currentRow) : null;
    },
    clearCurrentRow: function clearCurrentRow() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      internalData.currentRow = null;
      reactData.currRowFlag++;
      return $xeList.$nextTick();
    },
    setRadioRow: function setRadioRow(row) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      reactData.selectRadioRow = row;
      var value = $xeList.getRowKey(row);
      $xeList.emitRadioMode(value);
      return $xeList.$nextTick();
    },
    setRadioRowByKey: function setRadioRowByKey(rowKey) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var fullData = internalData.fullData;
      reactData.selectRadioRow = $xeList.findRowByKey(fullData, rowKey);
      var value = rowKey;
      $xeList.emitRadioMode(value);
      return $xeList.$nextTick();
    },
    getRadioRow: function getRadioRow() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var selectRadioRow = reactData.selectRadioRow;
      return selectRadioRow;
    },
    getRadioRowKey: function getRadioRowKey() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var selectRadioRow = reactData.selectRadioRow;
      return selectRadioRow ? $xeList.getRowKey(selectRadioRow) : null;
    },
    clearRadioRow: function clearRadioRow() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var value = null;
      reactData.selectRadioRow = value;
      $xeList.emitRadioMode(value);
      return $xeList.$nextTick();
    },
    setCheckboxRow: function setCheckboxRow(row, checked) {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var selectCheckboxMaps = internalData.selectCheckboxMaps;
      var keyField = $xeList.computeKeyField;
      var rowList = row ? _xeUtils.default.isArray(row) ? row : [row] : [];
      rowList.forEach(checked ? function (obj) {
        var rowid = getRowIdByField(obj, keyField);
        if (!selectCheckboxMaps[rowid]) {
          selectCheckboxMaps[rowid] = obj;
        }
      } : function (obj) {
        var rowid = getRowIdByField(obj, keyField);
        if (selectCheckboxMaps[rowid]) {
          delete selectCheckboxMaps[rowid];
        }
      });
      var value = $xeList.getCheckboxRowKeys();
      $xeList.emitCheckboxMode(value);
      return $xeList.updateCheckboxStatus();
    },
    setCheckboxRowByKey: function setCheckboxRowByKey(rowKey, checked) {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var selectCheckboxMaps = internalData.selectCheckboxMaps,
        fullKeyMaps = internalData.fullKeyMaps;
      var keyField = $xeList.computeKeyField;
      var rowKeys = rowKey ? _xeUtils.default.isArray(rowKey) ? rowKey : [rowKey] : [];
      rowKeys.forEach(checked ? function (key) {
        var row = fullKeyMaps[key || ''];
        if (row) {
          var rowid = getRowIdByField(row, keyField);
          if (row && !selectCheckboxMaps[rowid]) {
            selectCheckboxMaps[rowid] = row;
          }
        }
      } : function (key) {
        var row = fullKeyMaps[key || ''];
        if (row) {
          var rowid = getRowIdByField(row, keyField);
          if (selectCheckboxMaps[rowid]) {
            delete selectCheckboxMaps[rowid];
          }
        }
      });
      var value = $xeList.getCheckboxRowKeys();
      $xeList.emitCheckboxMode(value);
      return $xeList.updateCheckboxStatus();
    },
    getCheckboxRecords: function getCheckboxRecords() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var updateCheckboxFlag = reactData.updateCheckboxFlag;
      var selectCheckboxMaps = internalData.selectCheckboxMaps;
      var rowList = [];
      if (updateCheckboxFlag) {
        _xeUtils.default.each(selectCheckboxMaps, function (row) {
          if (row) {
            rowList.push(row);
          }
        });
      }
      return rowList;
    },
    getCheckboxRows: function getCheckboxRows() {
      var $xeList = this;
      return $xeList.getCheckboxRecords();
    },
    getCheckboxRowKeys: function getCheckboxRowKeys() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var updateCheckboxFlag = reactData.updateCheckboxFlag;
      var selectCheckboxMaps = internalData.selectCheckboxMaps;
      var keyField = $xeList.computeKeyField;
      var rowKeys = [];
      if (updateCheckboxFlag) {
        _xeUtils.default.each(selectCheckboxMaps, function (row) {
          if (row) {
            var rowKey = getRowKeyByField(row, keyField);
            rowKeys.push(rowKey);
          }
        });
      }
      return rowKeys;
    },
    clearCheckboxRow: function clearCheckboxRow() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      internalData.selectCheckboxMaps = {};
      reactData.updateCheckboxFlag++;
      reactData.isAllChecked = false;
      reactData.isAllIndeterminate = false;
      var value = [];
      $xeList.emitCheckboxMode(value);
      return $xeList.$nextTick();
    },
    setAllCheckboxRow: function setAllCheckboxRow(checked) {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var fullData = internalData.fullData,
        selectCheckboxMaps = internalData.selectCheckboxMaps;
      var keyField = $xeList.computeKeyField;
      if (checked) {
        var value = [];
        var _iterator2 = _createForOfIteratorHelper(fullData),
          _step2;
        try {
          for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
            var row = _step2.value;
            var rowKey = getRowKeyByField(row, keyField);
            var rowid = getRowIdByField(row, keyField);
            selectCheckboxMaps[rowid] = row;
            value.push(rowKey);
          }
        } catch (err) {
          _iterator2.e(err);
        } finally {
          _iterator2.f();
        }
        $xeList.emitCheckboxMode(value);
        return $xeList.updateCheckboxStatus();
      }
      return $xeList.clearCheckboxRow();
    },
    updateCheckboxStatus: function updateCheckboxStatus() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var selectCheckboxMaps = internalData.selectCheckboxMaps,
        fullData = internalData.fullData;
      var keyField = $xeList.computeKeyField;
      var checkboxOpts = $xeList.computeCheckboxOpts;
      var checkMethod = checkboxOpts.checkMethod;
      var hasChecked = false;
      var hasUnchecked = false;
      if (checkMethod) {
        var _iterator3 = _createForOfIteratorHelper(fullData),
          _step3;
        try {
          for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
            var row = _step3.value;
            if (checkMethod({
              row: row,
              $list: $xeList
            })) {
              var rowid = getRowIdByField(row, keyField);
              if (selectCheckboxMaps[rowid]) {
                hasChecked = true;
              } else {
                hasUnchecked = true;
                if (hasChecked) {
                  break;
                }
              }
            }
          }
        } catch (err) {
          _iterator3.e(err);
        } finally {
          _iterator3.f();
        }
      } else {
        var _iterator4 = _createForOfIteratorHelper(fullData),
          _step4;
        try {
          for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
            var _row = _step4.value;
            var _rowid = getRowIdByField(_row, keyField);
            if (selectCheckboxMaps[_rowid]) {
              hasChecked = true;
            } else {
              hasUnchecked = true;
              if (hasChecked) {
                break;
              }
            }
          }
        } catch (err) {
          _iterator4.e(err);
        } finally {
          _iterator4.f();
        }
      }
      reactData.isAllChecked = hasChecked && !hasUnchecked;
      reactData.isAllIndeterminate = hasChecked && hasUnchecked;
      reactData.updateCheckboxFlag++;
      return $xeList.$nextTick();
    },
    changeCheckboxAllEvent: function changeCheckboxAllEvent(evnt) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var isAllChecked = reactData.isAllChecked;
      var isChecked = !isAllChecked;
      if (isChecked) {
        $xeList.setAllCheckboxRow(true);
      } else {
        $xeList.clearCheckboxRow();
      }
      $xeList.dispatchEvent('checkbox-all', {
        checked: isChecked
      }, evnt);
    },
    changeCheckboxEvent: function changeCheckboxEvent(evnt, row) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      evnt.preventDefault();
      evnt.stopPropagation();
      var selectCheckboxMaps = internalData.selectCheckboxMaps;
      var checkboxOpts = $xeList.computeCheckboxOpts;
      var checkMethod = checkboxOpts.checkMethod;
      var rowid = $xeList.getRowKey(row);
      var isDisabled = checkMethod ? !checkMethod({
        $list: $xeList,
        row: row
      }) : false;
      if (isDisabled) {
        return;
      }
      var isChecked = false;
      if (selectCheckboxMaps[rowid]) {
        delete selectCheckboxMaps[rowid];
      } else {
        isChecked = true;
        selectCheckboxMaps[rowid] = row;
      }
      reactData.updateCheckboxFlag++;
      $xeList.updateCheckboxStatus();
      var rowids = _xeUtils.default.keys(selectCheckboxMaps);
      var value = rowids.map(_utils.deModelValue);
      $xeList.emitCheckboxMode(value);
      $xeList.dispatchEvent('checkbox-change', {
        row: row,
        value: value,
        checked: isChecked
      }, evnt);
    },
    changeCurrentEvent: function changeCurrentEvent(evnt, row) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      evnt.preventDefault();
      var rowOpts = $xeList.computeRowOpts;
      var currentMethod = rowOpts.currentMethod;
      var isDisabled = false;
      if (currentMethod) {
        isDisabled = !currentMethod({
          row: row
        });
      }
      if (isDisabled) {
        return;
      }
      var isChecked = true;
      internalData.currentRow = row;
      reactData.currRowFlag++;
      $xeList.dispatchEvent('current-change', {
        row: row,
        checked: isChecked
      }, evnt);
    },
    changeRadioEvent: function changeRadioEvent(evnt, row) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      evnt.preventDefault();
      evnt.stopPropagation();
      var selectRadioRow = reactData.selectRadioRow;
      var radioOpts = $xeList.computeRadioOpts;
      var strict = radioOpts.strict,
        checkMethod = radioOpts.checkMethod;
      var rowKey = $xeList.getRowKey(row);
      var isDisabled = checkMethod ? !checkMethod({
        $list: $xeList,
        row: row
      }) : false;
      if (isDisabled) {
        return;
      }
      var value = rowKey;
      var isChecked = true;
      if (strict) {
        if (selectRadioRow && rowKey === $xeList.getRowKey(selectRadioRow)) {
          isChecked = false;
          reactData.selectRadioRow = null;
        } else {
          reactData.selectRadioRow = row;
        }
      } else {
        reactData.selectRadioRow = row;
      }
      $xeList.emitRadioMode(value);
      $xeList.dispatchEvent('radio-change', {
        row: row,
        value: value,
        checked: isChecked
      }, evnt);
    },
    handleRowDragEndClearStatus: function handleRowDragEndClearStatus() {
      var $xeList = this;
      $xeList.clearRowDragData();
      $xeList.clearCrossListDragStatus();
      $xeList.recalculate();
    },
    clearRowDropOrigin: function clearRowDropOrigin() {
      var $xeList = this;
      var el = $xeList.$refs.refElem;
      if (el) {
        var clss = 'row--drag-origin';
        _xeUtils.default.arrayEach(el.querySelectorAll(".".concat(clss)), function (elem) {
          elem.draggable = false;
          (0, _dom.removeClass)(elem, clss);
        });
      }
    },
    updateRowDropOrigin: function updateRowDropOrigin(row) {
      var $xeList = this;
      var sYOpts = $xeList.computeSYOpts;
      var sItem = sYOpts.sItem;
      var el = $xeList.$refs.refElem;
      if (el) {
        var clss = 'row--drag-origin';
        var rowid = $xeList.getRowId(row);
        _xeUtils.default.arrayEach(el.querySelectorAll(".vxe-list--row[rowid=\"".concat(rowid, "\"]") + (sItem ? "".concat(sItem, "[rowid=\"").concat(rowid, "\"]") : '')), function (elem) {
          (0, _dom.addClass)(elem, clss);
        });
      }
    },
    updateRowDropTipContent: function updateRowDropTipContent(rowEl) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var dragRow = reactData.dragRow;
      var dragOpts = $xeList.computeDragOpts;
      var tooltipMethod = dragOpts.tooltipMethod;
      var rTooltipMethod = tooltipMethod;
      var tipContent = '';
      if (rTooltipMethod) {
        var rtParams = {
          $list: $xeList,
          row: dragRow
        };
        tipContent = "".concat(rTooltipMethod(rtParams) || '');
      } else {
        tipContent = (0, _ui.getI18n)('vxe.list.dragTip', [rowEl.textContent || '']);
      }
      reactData.dragTipText = tipContent;
    },
    hideDropTip: function hideDropTip() {
      var $xeList = this;
      var rdTipEl = $xeList.$refs.refDragTipElem;
      var rdLineEl = $xeList.$refs.refDragRowLineElem;
      if (rdTipEl) {
        rdTipEl.style.display = '';
      }
      if (rdLineEl) {
        rdLineEl.style.display = '';
      }
    },
    clearCrossListDragStatus: function clearCrossListDragStatus() {
      var $xeList = this;
      var crossListDragRowInfo = (0, _store.getCrossListDragRowInfo)($xeList);
      crossListDragRowObj = null;
      crossListDragRowInfo.row = null;
    },
    clearDragStatus: function clearDragStatus() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var dragRow = reactData.dragRow;
      if (dragRow) {
        $xeList.hideDropTip();
        $xeList.clearRowDropOrigin();
        $xeList.clearCrossListDragStatus();
        reactData.dragRow = null;
      }
    },
    handleRowDragMousedownEvent: function handleRowDragMousedownEvent(evnt, params) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var crossListDragRowInfo = (0, _store.getCrossListDragRowInfo)($xeList);
      evnt.stopPropagation();
      var row = params.row;
      var dragConfig = $xeList.computeDragOpts;
      var isCrossListDrag = dragConfig.isCrossListDrag,
        trigger = dragConfig.trigger,
        dragStartMethod = dragConfig.dragStartMethod;
      var dragEl = evnt.currentTarget;
      var rowEl = trigger === 'row' ? dragEl : dragEl.parentElement.parentElement;
      $xeList.clearRowDropOrigin();
      if (dragStartMethod && !dragStartMethod(params)) {
        rowEl.draggable = false;
        reactData.dragRow = null;
        $xeList.hideDropTip();
        return;
      }
      if (isCrossListDrag) {
        crossListDragRowInfo.row = row;
        crossListDragRowObj = {
          $oldList: $xeList,
          $newList: null
        };
      }
      var dragstartEventParams = {
        row: row
      };
      reactData.dragRow = row;
      rowEl.draggable = true;
      $xeList.updateRowDropOrigin(row);
      $xeList.updateRowDropTipContent(rowEl);
      $xeList.dispatchEvent('row-dragstart', dragstartEventParams, evnt);
    },
    handleRowDragMouseupEvent: function handleRowDragMouseupEvent() {
      var $xeList = this;
      $xeList.clearDragStatus();
    },
    showDropTip: function showDropTip(evnt, rowEl, showLine, dragPos) {
      var $xeList = this;
      var wrapperEl = $xeList.$refs.refElem;
      if (!wrapperEl) {
        return;
      }
      var wrapperRect = wrapperEl.getBoundingClientRect();
      var wrapperHeight = wrapperEl.clientHeight;
      if (rowEl) {
        var rdLineEl = $xeList.$refs.refDragRowLineElem;
        if (rdLineEl) {
          if (showLine) {
            var trRect = rowEl.getBoundingClientRect();
            var rowHeight = rowEl.clientHeight;
            var offsetTop = Math.max(1, trRect.y - wrapperRect.y);
            if (offsetTop + rowHeight > wrapperHeight) {
              rowHeight = wrapperHeight - offsetTop;
            }
            rdLineEl.style.display = 'block';
            rdLineEl.style.top = "".concat(offsetTop, "px");
            rdLineEl.style.height = "".concat(rowHeight, "px");
            rdLineEl.setAttribute('drag-pos', dragPos);
          } else {
            rdLineEl.style.display = '';
          }
        }
      }
      var rdTipEl = $xeList.$refs.refDragTipElem;
      if (rdTipEl) {
        rdTipEl.style.display = 'block';
        rdTipEl.style.top = "".concat(Math.min(wrapperEl.clientHeight - wrapperEl.scrollTop - rdTipEl.clientHeight, evnt.clientY - wrapperRect.y), "px");
        rdTipEl.style.left = "".concat(Math.min(wrapperEl.clientWidth - wrapperEl.scrollLeft - rdTipEl.clientWidth - 1, evnt.clientX - wrapperRect.x), "px");
        rdTipEl.setAttribute('drag-status', showLine ? 'normal' : 'disabled');
      }
    },
    clearRowDragData: function clearRowDragData() {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var wrapperEl = $xeList.$refs.refElem;
      var dtClss = ['.vxe-list--row'];
      $xeList.hideDropTip();
      $xeList.clearRowDropOrigin();
      (0, _anime.clearRowAnimate)(wrapperEl, dtClss);
      reactData.dragRow = null;
    },
    handleRowDragSwapEvent: function handleRowDragSwapEvent(evnt, dragRow, prevDragRow, prevDragPos) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var fullData = internalData.fullData;
      var dragConfig = $xeList.computeDragOpts;
      var animation = dragConfig.animation,
        dragEndMethod = dragConfig.dragEndMethod;
      var dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
      var dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
      var el = $xeList.$refs.refElem;
      var errRest = {
        status: false
      };
      if (!(el && prevDragRow && dragRow)) {
        return Promise.resolve(errRest);
      }
      // 判断是否有拖动
      if (prevDragRow !== dragRow) {
        var dragParams = {
          oldRow: dragRow,
          newRow: prevDragRow,
          dragRow: dragRow,
          dragPos: prevDragPos,
          offsetIndex: dragOffsetIndex
        };
        var dragRowid = $xeList.getRowId(dragRow);
        var _dragRowIndex = $xeList.findRowIndexOfByKey(fullData, dragRowid);
        var newRowid = $xeList.getRowKey(prevDragRow);
        var dragRowHeight = 0;
        var dragOffsetTop = -1;
        if (animation) {
          var prevRowEl = el.querySelector(".vxe-list--row[rowid=\"".concat(newRowid, "\"]"));
          var oldRowEl = el.querySelector(".vxe-list--row[rowid=\"".concat(dragRowid, "\"]"));
          var targetRowEl = prevRowEl || oldRowEl;
          if (targetRowEl) {
            dragRowHeight = targetRowEl.offsetHeight;
          }
          if (oldRowEl) {
            dragOffsetTop = oldRowEl.offsetTop;
          }
        }
        var oafIndex = -1;
        var nafIndex = -1;
        return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(function (status) {
          if (!status) {
            return errRest;
          }
          // 移出
          oafIndex = $xeList.findRowIndexOf(fullData, dragRow);
          fullData.splice(oafIndex, 1);
          // 插入
          var pafIndex = $xeList.findRowIndexOf(fullData, prevDragRow);
          nafIndex = pafIndex + dragOffsetIndex;
          fullData.splice(nafIndex, 0, dragRow);
          $xeList.handleData();
          if (reactData.scrollYLoad) {
            $xeList.updateYSpace();
          }
          if (evnt) {
            var dragendEventParams = {
              oldRow: dragRow,
              newRow: prevDragRow,
              dragRow: dragRow,
              dragPos: prevDragPos,
              offsetIndex: dragOffsetIndex,
              _index: {
                newIndex: nafIndex,
                oldIndex: oafIndex
              }
            };
            $xeList.dispatchEvent('row-dragend', dragendEventParams, evnt);
          }
          return $xeList.$nextTick().then(function () {
            if (animation) {
              var rowList = reactData.rowList;
              var _fullData = internalData.fullData;
              var _newRowIndex = $xeList.findRowIndexOfByKey(_fullData, dragRowid);
              var firstRow = _fullData[0];
              var _firstRowIndex = $xeList.findRowIndexOf(_fullData, firstRow);
              var wrapperEl = el;
              if (_firstRowIndex > -1) {
                var _lastRowIndex = _firstRowIndex + _fullData.length;
                var rsIndex = -1;
                var reIndex = -1;
                var offsetRate = 1;
                if (_dragRowIndex < _firstRowIndex) {
                  // 从上往下虚拟拖拽
                  rsIndex = 0;
                  reIndex = _newRowIndex - _firstRowIndex;
                } else if (_dragRowIndex > _lastRowIndex) {
                  // 从下往上虚拟拖拽
                  var $newRowIndex = $xeList.findRowIndexOfByKey(rowList, dragRowid);
                  rsIndex = $newRowIndex + 1;
                  reIndex = _fullData.length;
                  offsetRate = -1;
                } else {
                  if (_newRowIndex > _dragRowIndex) {
                    // 从上往下拖拽
                    rsIndex = _dragRowIndex - _firstRowIndex;
                    reIndex = rsIndex + _newRowIndex - _dragRowIndex;
                  } else {
                    // 从下往上拖拽
                    rsIndex = _newRowIndex - _firstRowIndex;
                    reIndex = rsIndex + _dragRowIndex - _newRowIndex + 1;
                    offsetRate = -1;
                  }
                }
                var dragRangeList = _fullData.slice(rsIndex, reIndex);
                if (dragRangeList.length) {
                  var dtClss = [];
                  dragRangeList.forEach(function (obj) {
                    var rowid = $xeList.getRowId(obj);
                    dtClss.push(".vxe-list--row[rowid=\"".concat(rowid, "\"]"));
                  });
                  var dtTrList = wrapperEl.querySelectorAll(dtClss.join(','));
                  (0, _anime.moveRowAnimateToTb)(dtTrList, offsetRate * dragRowHeight);
                }
              }
              var drClss = [".vxe-list--row[rowid=\"".concat(dragRowid, "\"]")];
              var newDtTrList = wrapperEl.querySelectorAll(drClss.join(','));
              var newTrEl = newDtTrList[0];
              if (dragOffsetTop > -1 && newTrEl) {
                (0, _anime.moveRowAnimateToTb)(newDtTrList, dragOffsetTop - newTrEl.offsetTop);
              }
            }
            $xeList.recalculate();
          }).then(function () {
            return {
              status: true
            };
          });
        }).catch(function () {
          return errRest;
        }).then(function (rest) {
          $xeList.clearRowDragData();
          $xeList.clearCrossListDragStatus();
          return rest;
        });
      }
      $xeList.clearRowDragData();
      $xeList.clearCrossListDragStatus();
      return Promise.resolve(errRest);
    },
    handleRowDragDragstartEvent: function handleRowDragDragstartEvent(evnt) {
      if (evnt.dataTransfer) {
        evnt.dataTransfer.setDragImage((0, _dom.getTpImg)(), 0, 0);
      }
    },
    handleRowDragDragendEvent: function handleRowDragDragendEvent(evnt) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var dragRow = reactData.dragRow;
      var prevDragRow = internalData.prevDragRow,
        prevDragPos = internalData.prevDragPos;
      var dragConfig = $xeList.computeDragOpts;
      var isCrossListDrag = dragConfig.isCrossListDrag;
      // 跨列表拖拽
      if (isCrossListDrag && crossListDragRowObj) {
        var _crossListDragRowObj = crossListDragRowObj,
          $newList = _crossListDragRowObj.$newList;
        if ($newList && $newList.xID !== $xeList.xID) {
          $newList.handleCrossListRowDragInsertEvent(evnt);
          return;
        }
      }
      $xeList.handleRowDragSwapEvent(evnt, dragRow, prevDragRow, prevDragPos);
    },
    handleRowDragDragoverEvent: function handleRowDragDragoverEvent(evnt) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var dragRow = reactData.dragRow;
      var fullData = internalData.fullData;
      if (!dragRow) {
        evnt.preventDefault();
      }
      var rowEl = evnt.currentTarget;
      var rowid = rowEl.getAttribute('rowid') || '';
      var row = $xeList.findRowByKey(fullData, rowid);
      if (row) {
        evnt.preventDefault();
        var offsetY = evnt.clientY - rowEl.getBoundingClientRect().y;
        var dragPos = offsetY < rowEl.clientHeight / 2 ? 'top' : 'bottom';
        internalData.prevDragRow = row;
        internalData.prevDragPos = dragPos;
        if (dragRow && $xeList.getRowId(dragRow) === rowid) {
          $xeList.showDropTip(evnt, rowEl, false, dragPos);
          return;
        }
        var dragOffsetIndex = dragPos === 'bottom' ? 1 : 0;
        var offsetIndex = dragOffsetIndex;
        var dragoverEventParams = {
          oldRow: dragRow,
          targetRow: row,
          dragPos: dragPos,
          dragRow: dragRow,
          offsetIndex: offsetIndex
        };
        $xeList.showDropTip(evnt, rowEl, true, dragPos);
        $xeList.dispatchEvent('row-dragover', dragoverEventParams, evnt);
      }
    },
    handleRowMousedownEvent: function handleRowMousedownEvent(evnt, row) {
      var $xeList = this;
      var dragConfig = $xeList.computeDragOpts;
      var isDrag = $xeList.computeIsDrag;
      var trigger = dragConfig.trigger,
        disabledMethod = dragConfig.disabledMethod;
      var isRowDrag = false;
      if (isDrag) {
        isRowDrag = trigger === 'row';
      }
      var params = {
        row: row,
        $list: $xeList
      };
      if (isRowDrag && !(disabledMethod && disabledMethod(params))) {
        $xeList.handleRowDragMousedownEvent(evnt, params);
      }
    },
    handleRowClickEvent: function handleRowClickEvent(evnt, row) {
      var $xeList = this;
      var props = $xeList;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var showRadio = props.showRadio,
        showCheckbox = props.showCheckbox;
      var currentRow = internalData.currentRow;
      var radioOpts = $xeList.computeRadioOpts;
      var checkboxOpts = $xeList.computeCheckboxOpts;
      var rowOpts = $xeList.computeRowOpts;
      var isCurrent = rowOpts.isCurrent;
      var triggerCurrent = false;
      var triggerRadio = false;
      var triggerCheckbox = false;
      if (isCurrent) {
        triggerCurrent = true;
        $xeList.changeCurrentEvent(evnt, row);
      } else if (currentRow) {
        internalData.currentRow = null;
        reactData.currRowFlag++;
      }
      if (showRadio && radioOpts.trigger === 'row') {
        triggerRadio = true;
        $xeList.changeRadioEvent(evnt, row);
      }
      if (showCheckbox && checkboxOpts.trigger === 'row') {
        triggerCheckbox = true;
        $xeList.changeCheckboxEvent(evnt, row);
      }
      $xeList.dispatchEvent('row-click', {
        row: row,
        triggerCurrent: triggerCurrent,
        triggerRadio: triggerRadio,
        triggerCheckbox: triggerCheckbox
      }, evnt);
    },
    handleRowDblclickEvent: function handleRowDblclickEvent(evnt, row) {
      var $xeList = this;
      $xeList.dispatchEvent('row-dblclick', {
        row: row
      }, evnt);
    },
    insertListRow: function insertListRow(newRecords, isAppend) {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var fullData = internalData.fullData,
        rowMaps = internalData.rowMaps;
      var keyField = $xeList.computeKeyField;
      var funcName = isAppend ? 'push' : 'unshift';
      newRecords.forEach(function (item) {
        var rowid = getRowIdByField(item, keyField);
        var rowRest = (0, _util.getItemCacheObj)(item);
        fullData[funcName](item);
        rowMaps[rowid] = rowRest;
      });
    },
    handleInsertRowAt: function handleInsertRowAt(records, targetRowOrRowKey, isInsertNextRow) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var fullData = internalData.fullData,
        rowMaps = internalData.rowMaps,
        removeRowMaps = internalData.removeRowMaps,
        insertRowMaps = internalData.insertRowMaps;
      var keyField = $xeList.computeKeyField;
      if (!keyField) {
        errLog('vxe.error.reqSupportProp', ['insert() | insertAt() | insertNextAt()', 'row-config.keyField']);
        return Promise.resolve({
          row: null,
          rows: []
        });
      }
      if (!_xeUtils.default.isArray(records)) {
        records = [records];
      }
      var targetRow = targetRowOrRowKey;
      if (_xeUtils.default.isString(targetRowOrRowKey) || _xeUtils.default.isNumber(targetRowOrRowKey)) {
        var rowRest = rowMaps[targetRowOrRowKey];
        if (rowRest) {
          targetRow = rowRest.item;
        }
      }
      if (!records.length) {
        return Promise.resolve({
          row: null,
          rows: []
        });
      }
      var newRecords = records.map(function (record) {
        return _xeUtils.default.assign({}, record);
      });
      if (_xeUtils.default.eqNull(targetRow)) {
        $xeList.insertListRow(newRecords, false);
      } else {
        if (targetRow === -1) {
          $xeList.insertListRow(newRecords, true);
        } else {
          var rowIndex = fullData.findIndex(function (item) {
            return targetRow[keyField] === item[keyField];
          });
          if (rowIndex > -1) {
            newRecords.forEach(function (item) {
              var rowid = getRowIdByField(item, keyField);
              var rowRest = (0, _util.getItemCacheObj)(item);
              rowMaps[rowid] = rowRest;
            });
            var targetIndex = rowIndex;
            if (isInsertNextRow) {
              targetIndex = targetIndex + 1;
            }
            fullData.splice.apply(fullData, [targetIndex, 0].concat(_toConsumableArray(newRecords)));
          } else {
            warnLog('vxe.error.unableInsert');
            $xeList.insertListRow(newRecords, true);
          }
        }
      }
      newRecords.forEach(function (newItem) {
        var rowid = getRowIdByField(newItem, keyField);
        // 如果是被删除的数据，则还原状态
        if (removeRowMaps[rowid]) {
          delete removeRowMaps[rowid];
          if (insertRowMaps[rowid]) {
            delete insertRowMaps[rowid];
          }
        } else {
          insertRowMaps[rowid] = newItem;
        }
      });
      reactData.removeRowFlag++;
      reactData.insertRowFlag++;
      $xeList.cacheRowMap();
      $xeList.handleData(true);
      $xeList.updateAfterDataIndex();
      $xeList.updateCheckboxStatus();
      if (reactData.scrollYLoad) {
        $xeList.updateYSpace();
      }
      return $xeList.$nextTick().then(function () {
        return {
          row: newRecords.length ? newRecords[newRecords.length - 1] : null,
          rows: newRecords
        };
      });
    },
    insert: function insert(records) {
      var $xeList = this;
      return $xeList.handleInsertRowAt(records, null);
    },
    insertAt: function insertAt(records, targetRowOrRowKey) {
      var $xeList = this;
      return $xeList.handleInsertRowAt(records, targetRowOrRowKey);
    },
    insertNextAt: function insertNextAt(records, targetRowOrRowKey) {
      var $xeList = this;
      return $xeList.handleInsertRowAt(records, targetRowOrRowKey, true);
    },
    getInsertRecords: function getInsertRecords() {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var insertRowMaps = internalData.insertRowMaps;
      var insertRecords = [];
      _xeUtils.default.each(insertRowMaps, function (item) {
        insertRecords.push(item);
      });
      return insertRecords;
    },
    isInsertByRow: function isInsertByRow(row) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var rowid = $xeList.getRowId(row);
      return !!reactData.insertRowFlag && !!internalData.insertRowMaps[rowid];
    },
    remove: function remove(rows) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var fullData = internalData.fullData,
        insertRowMaps = internalData.insertRowMaps,
        removeRowMaps = internalData.removeRowMaps;
      var keyField = $xeList.computeKeyField;
      if (!keyField) {
        errLog('vxe.error.reqSupportProp', ['insert() | insertAt() | insertNextAt()', 'row-config.keyField']);
        return Promise.resolve({
          row: null,
          rows: []
        });
      }
      var delList = [];
      if (!rows) {
        rows = fullData;
      } else if (!_xeUtils.default.isArray(rows)) {
        rows = [rows];
      }
      if (!rows.length) {
        return Promise.resolve({
          row: null,
          rows: []
        });
      }
      // 如果是新增，则保存记录
      rows.forEach(function (item) {
        if (!$xeList.isInsertByRow(item)) {
          var rowid = $xeList.getRowId(item);
          removeRowMaps[rowid] = item;
        }
      });
      // 从数据源中移除
      if (fullData === rows) {
        rows = delList = fullData.slice(0);
        internalData.fullData = [];
      } else {
        rows.forEach(function (item) {
          var rowid = $xeList.getRowId(item);
          var rowIndex = _xeUtils.default.findIndexOf(fullData, function (item) {
            return rowid === $xeList.getRowId(item);
          });
          if (rowIndex > -1) {
            var rItems = fullData.splice(rowIndex, 1);
            delList.push(rItems[0]);
          }
        });
      }
      // 从新增中移除已删除的数据
      rows.forEach(function (item) {
        var rowid = $xeList.getRowId(item);
        if (insertRowMaps[rowid]) {
          delete insertRowMaps[rowid];
        }
      });
      reactData.removeRowFlag++;
      reactData.insertRowFlag++;
      $xeList.cacheRowMap();
      $xeList.handleData(true);
      $xeList.updateAfterDataIndex();
      $xeList.updateCheckboxStatus();
      if (reactData.scrollYLoad) {
        $xeList.updateYSpace();
      }
      return $xeList.$nextTick().then(function () {
        return $xeList.recalculate();
      }).then(function () {
        return {
          row: delList.length ? delList[delList.length - 1] : null,
          rows: delList
        };
      });
    },
    getRemoveRecords: function getRemoveRecords() {
      var $xeList = this;
      var internalData = $xeList.internalData;
      var removeRowMaps = internalData.removeRowMaps;
      var removeRecords = [];
      _xeUtils.default.each(removeRowMaps, function (item) {
        removeRecords.push(item);
      });
      return removeRecords;
    },
    isRemoveByRow: function isRemoveByRow(row) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var rowid = $xeList.getRowId(row);
      return !!reactData.removeRowFlag && !!internalData.removeRowMaps[rowid];
    },
    getRecordset: function getRecordset() {
      var $xeList = this;
      return {
        insertRecords: $xeList.getInsertRecords(),
        removeRecords: $xeList.getRemoveRecords()
      };
    },
    handleCrossListRowDragCancelEvent: function handleCrossListRowDragCancelEvent() {
      var $xeList = this;
      $xeList.clearRowDragData();
      $xeList.clearCrossListDragStatus();
    },
    /**
       * 处理跨树拖拽完成
       */
    handleCrossListRowDragFinishEvent: function handleCrossListRowDragFinishEvent(evnt) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var crossListDragRowInfo = (0, _store.getCrossListDragRowInfo)($xeList);
      var rowList = reactData.rowList;
      var rowMaps = internalData.rowMaps;
      var dragOpts = $xeList.computeDragOpts;
      var animation = dragOpts.animation,
        isCrossListDrag = dragOpts.isCrossListDrag;
      var el = $xeList.$refs.refElem;
      if (!el) {
        return;
      }
      if (isCrossListDrag && crossListDragRowObj && crossListDragRowInfo) {
        var dragRow = crossListDragRowInfo.row;
        if (dragRow) {
          var dragRowid = $xeList.getRowId(dragRow);
          var dragRowRest = rowMaps[dragRowid];
          var dragRowHeight = 0;
          var rsIndex = -1;
          if (dragRowRest) {
            if (animation) {
              var oldItemEl = el.querySelector(".vxe-list--row[rowid=\"".concat(dragRowid, "\"]"));
              var targetItemEl = oldItemEl;
              if (targetItemEl) {
                dragRowHeight = targetItemEl.offsetHeight;
              }
            }
            rsIndex = dragRowRest.$index;
          }
          var dragRangeList = rsIndex > -1 && rsIndex < rowList.length - 1 ? rowList.slice(rsIndex + 1) : [];
          var dragList = [dragRow];
          $xeList.remove(dragList).then(function () {
            if (animation && dragRowHeight && dragRangeList.length) {
              var wrapperEl = el;
              var dtClss = [];
              dragRangeList.forEach(function (item) {
                var rowid = $xeList.getRowId(item);
                dtClss.push(".vxe-list--row[rowid=\"".concat(rowid, "\"]"));
              });
              var dtTrList = wrapperEl.querySelectorAll(dtClss.join(','));
              (0, _anime.moveRowAnimateToTb)(dtTrList, dragRowHeight);
            }
          });
          $xeList.dispatchEvent('row-remove-dragend', {
            row: dragRow
          }, evnt);
          $xeList.handleRowDragEndClearStatus();
        }
      }
    },
    /**
       * 处理跨树拖至新的空树
       */
    handleCrossListRowDragoverEmptyEvent: function handleCrossListRowDragoverEmptyEvent(evnt) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var rowList = reactData.rowList;
      var dragOpts = $xeList.computeDragOpts;
      var isCrossListDrag = dragOpts.isCrossListDrag;
      if (isCrossListDrag && crossListDragRowObj && !rowList.length) {
        var _crossListDragRowObj2 = crossListDragRowObj,
          $oldList = _crossListDragRowObj2.$oldList,
          $newList = _crossListDragRowObj2.$newList;
        if ($oldList) {
          var oldListReactData = $oldList;
          if ($oldList.xID !== $xeList.xID) {
            if ($newList && $newList.xID !== $xeList.xID) {
              $newList.hideCrossListRowDropClearStatus();
            }
            evnt.preventDefault();
            $oldList.hideCrossListRowDropClearStatus();
            crossListDragRowObj.$newList = $xeList;
            internalData.prevDragRow = null;
            reactData.dragTipText = oldListReactData.dragTipText;
            $xeList.showDropTip(evnt, evnt.currentTarget, true, '');
          }
        }
      }
    },
    /**
       * 处理跨树拖插入
       */
    handleCrossListRowDragInsertEvent: function handleCrossListRowDragInsertEvent(evnt) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var crossListDragRowInfo = (0, _store.getCrossListDragRowInfo)($xeList);
      var prevDragRow = internalData.prevDragRow,
        prevDragPos = internalData.prevDragPos;
      var dragOpts = $xeList.computeDragOpts;
      var animation = dragOpts.animation,
        isCrossListDrag = dragOpts.isCrossListDrag,
        dragEndMethod = dragOpts.dragEndMethod;
      // 跨表拖拽
      if (isCrossListDrag && crossListDragRowObj && crossListDragRowInfo) {
        var oldRow = crossListDragRowInfo.row;
        var _crossListDragRowObj3 = crossListDragRowObj,
          $oldList = _crossListDragRowObj3.$oldList;
        var el = $xeList.$refs.refElem;
        if (!el) {
          return;
        }
        if ($oldList && oldRow) {
          var dragRow = oldRow;
          var dragOffsetIndex = -1;
          if (prevDragRow) {
            dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
          }
          var dragParams = {
            oldRow: dragRow,
            newRow: prevDragRow,
            dragRow: dragRow,
            dragPos: prevDragPos,
            offsetIndex: dragOffsetIndex
          };
          var errRest = {
            status: false
          };
          Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(function (status) {
            if (!status) {
              if ($oldList) {
                if ($oldList.xID !== $xeList.xID) {
                  $oldList.handleCrossListRowDragCancelEvent(evnt);
                }
              }
              $xeList.handleRowDragEndClearStatus();
              return errRest;
            }
            var insertRest = Promise.resolve();
            var dragList = [dragRow];
            $oldList.handleCrossListRowDragFinishEvent(evnt);
            if (prevDragRow) {
              if (prevDragPos === 'bottom') {
                insertRest = $xeList.insertNextAt(dragList, prevDragRow);
              } else {
                insertRest = $xeList.insertAt(dragList, prevDragRow);
              }
            } else {
              insertRest = $xeList.insert(dragList);
            }
            $xeList.dispatchEvent('row-insert-dragend', {
              oldRow: oldRow,
              newRow: prevDragRow,
              dragRow: dragRow,
              dragPos: prevDragPos,
              offsetIndex: dragOffsetIndex
            }, evnt);
            $xeList.clearRowDragData();
            insertRest.then(function () {
              var rowList = reactData.rowList;
              var rowMaps = internalData.rowMaps;
              var oldRowid = $xeList.getRowId(dragRow);
              var oldRowRest = rowMaps[oldRowid];
              var dragRowHeight = 0;
              var rsIndex = -1;
              if (oldRowRest) {
                if (animation) {
                  var oldItemEl = el.querySelector(".vxe-list--row[rowid=\"".concat(oldRowid, "\"]"));
                  var targetItemEl = oldItemEl;
                  if (targetItemEl) {
                    dragRowHeight = targetItemEl.offsetHeight;
                  }
                }
                rsIndex = oldRowRest.$index;
              }
              var dragRangeList = rsIndex > -1 ? rowList.slice(rsIndex) : [];
              if (animation && dragRowHeight && dragRangeList.length) {
                var wrapperEl = el;
                var dtClss = [];
                dragRangeList.forEach(function (item) {
                  var rowid = $xeList.getRowId(item);
                  dtClss.push(".vxe-list--row[rowid=\"".concat(rowid, "\"]"));
                });
                var dtTrList = wrapperEl.querySelectorAll(dtClss.join(','));
                (0, _anime.moveRowAnimateToTb)(dtTrList, -dragRowHeight);
              }
            });
          });
        }
      }
    },
    hideCrossListRowDropClearStatus: function hideCrossListRowDropClearStatus() {
      var $xeList = this;
      $xeList.hideDropTip();
    },
    handleContextmenuEvent: function handleContextmenuEvent(evnt, row) {
      var $xeList = this;
      var props = $xeList;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var menuConfig = props.menuConfig;
      var menuOpts = $xeList.computeMenuOpts;
      var rowOpts = $xeList.computeRowOpts;
      var isCurrent = rowOpts.isCurrent;
      if (menuConfig ? (0, _utils.isEnableConf)(menuOpts) : menuOpts.enabled) {
        var options = menuOpts.options,
          visibleMethod = menuOpts.visibleMethod;
        if (!visibleMethod || visibleMethod({
          $list: $xeList,
          options: options,
          row: row
        })) {
          if (isCurrent) {
            $xeList.changeCurrentEvent(evnt, row);
          } else if (internalData.currentRow) {
            internalData.currentRow = null;
            reactData.currRowFlag++;
          }
          if (_ui.VxeUI.contextMenu) {
            _ui.VxeUI.contextMenu.openByEvent(evnt, {
              options: options,
              events: {
                optionClick: function optionClick(eventParams) {
                  var option = eventParams.option;
                  var gMenuOpts = _ui.menus.get(option.code);
                  var tmMethod = gMenuOpts ? gMenuOpts.listMenuMethod : null;
                  var params = {
                    menu: option,
                    row: row,
                    $event: evnt,
                    $list: $xeList
                  };
                  if (tmMethod) {
                    tmMethod(params, evnt);
                  }
                  $xeList.dispatchEvent('menu-click', params, eventParams.$event);
                }
              }
            });
          }
        }
      }
      $xeList.dispatchEvent('row-menu', {
        row: row
      }, evnt);
    },
    //
    // Render
    //
    renderDragTip: function renderDragTip(h) {
      var $xeList = this;
      var reactData = $xeList.reactData;
      var dragRow = reactData.dragRow,
        dragTipText = reactData.dragTipText;
      var dragOpts = $xeList.computeDragOpts;
      var isDrag = $xeList.computeIsDrag;
      var dRow = dragRow;
      if (isDrag) {
        return h('div', {
          class: 'vxe-list--drag-wrapper'
        }, [h('div', {
          ref: 'refDragRowLineElem',
          class: ['vxe-list--drag-row-line', {
            'is--guides': dragOpts.showGuidesStatus
          }]
        }), dRow && dragOpts.showDragTip ? h('div', {
          ref: 'refDragTipElem',
          class: 'vxe-list--drag-sort-tip'
        }, [h('div', {
          class: 'vxe-list--drag-sort-tip-wrapper'
        }, [h('div', {
          class: 'vxe-list--drag-sort-tip-status'
        }, [h('span', {
          class: ['vxe-list--drag-sort-tip-normal-status', (0, _ui.getIcon)().LIST_DRAG_STATUS_NODE]
        }), h('span', {
          class: ['vxe-list--drag-sort-tip-disabled-status', (0, _ui.getIcon)().LIST_DRAG_DISABLED]
        })]), h('div', {
          class: 'vxe-list--drag-sort-tip-content'
        }, dragTipText)])]) : (0, _ui.renderEmptyElement)($xeList)]);
      }
      return (0, _ui.renderEmptyElement)($xeList);
    },
    renderRadio: function renderRadio(h, row, rowid, isChecked) {
      var $xeList = this;
      var props = $xeList;
      var showRadio = props.showRadio;
      var radioOpts = $xeList.computeRadioOpts;
      var showIcon = radioOpts.showIcon,
        checkMethod = radioOpts.checkMethod,
        visibleMethod = radioOpts.visibleMethod;
      var isVisible = !visibleMethod || visibleMethod({
        $list: $xeList,
        row: row
      });
      if (showRadio && showIcon && isVisible) {
        var isDisabled = checkMethod ? !checkMethod({
          $list: $xeList,
          row: row
        }) : false;
        return h('div', {
          key: 'ct2',
          class: ['vxe-list--radio-option', {
            'is--checked': isChecked,
            'is--disabled': isDisabled
          }],
          on: {
            click: function click(evnt) {
              if (!isDisabled) {
                $xeList.changeRadioEvent(evnt, row);
              }
            }
          }
        }, [h('span', {
          class: ['vxe-radio--icon', isChecked ? (0, _ui.getIcon)().RADIO_CHECKED : (0, _ui.getIcon)().RADIO_UNCHECKED]
        })]);
      }
      return (0, _ui.renderEmptyElement)($xeList);
    },
    renderCheckbox: function renderCheckbox(h, row, rowid, isChecked) {
      var $xeList = this;
      var props = $xeList;
      var showCheckbox = props.showCheckbox;
      var checkboxOpts = $xeList.computeCheckboxOpts;
      var showIcon = checkboxOpts.showIcon,
        checkMethod = checkboxOpts.checkMethod,
        visibleMethod = checkboxOpts.visibleMethod;
      var isVisible = !visibleMethod || visibleMethod({
        $list: $xeList,
        row: row
      });
      if (showCheckbox && showIcon && isVisible) {
        var isDisabled = checkMethod ? !checkMethod({
          $list: $xeList,
          row: row
        }) : false;
        return h('div', {
          key: 'ct3',
          class: ['vxe-list--checkbox-option', {
            'is--checked': isChecked,
            'is--disabled': isDisabled
          }],
          on: {
            click: function click(evnt) {
              if (!isDisabled) {
                $xeList.changeCheckboxEvent(evnt, row);
              }
            }
          }
        }, [h('span', {
          class: ['vxe-checkbox--icon', isChecked ? (0, _ui.getIcon)().CHECKBOX_CHECKED : (0, _ui.getIcon)().CHECKBOX_UNCHECKED]
        })]);
      }
      return (0, _ui.renderEmptyElement)($xeList);
    },
    renderRow: function renderRow(h, row, rowIndex) {
      var $xeList = this;
      var props = $xeList;
      var reactData = $xeList.reactData;
      var internalData = $xeList.internalData;
      var slots = $xeList.$scopedSlots;
      var showRadio = props.showRadio,
        showCheckbox = props.showCheckbox;
      var selectRadioRow = reactData.selectRadioRow,
        currRowFlag = reactData.currRowFlag,
        updateCheckboxFlag = reactData.updateCheckboxFlag;
      var selectCheckboxMaps = internalData.selectCheckboxMaps,
        currentRow = internalData.currentRow;
      var contentSlot = slots.content;
      var extraSlot = slots.extra;
      var dragOpts = $xeList.computeDragOpts;
      var trigger = dragOpts.trigger,
        icon = dragOpts.icon,
        disabledMethod = dragOpts.disabledMethod,
        visibleMethod = dragOpts.visibleMethod;
      var rowOpts = $xeList.computeRowOpts;
      var useKey = rowOpts.useKey,
        contentField = rowOpts.contentField,
        rowClassName = rowOpts.className,
        isCurrent = rowOpts.isCurrent;
      var isDrag = $xeList.computeIsDrag;
      var keyField = $xeList.computeKeyField;
      var isRowFnCls = rowClassName && _xeUtils.default.isFunction(rowClassName);
      var hasKey = keyField || useKey || isDrag || isCurrent || showRadio || showCheckbox;
      var rowKey = hasKey && keyField ? getRowIdByField(row, keyField) : '';
      var rowid = (0, _utils.enModelValue)(rowKey);
      var rowParams = {
        row: row,
        $list: $xeList
      };
      var isRadioChecked = false;
      if (showRadio) {
        isRadioChecked = selectRadioRow && (row === selectRadioRow || $xeList.eqRowByKey(selectRadioRow, rowKey));
      }
      var isCheckboxChecked = false;
      if (showCheckbox) {
        isCheckboxChecked = !!(updateCheckboxFlag && selectCheckboxMaps[rowid]);
      }
      var ctVNs = [];
      if (showRadio) {
        ctVNs.push($xeList.renderRadio(h, row, rowid, isRadioChecked));
      }
      if (showCheckbox) {
        ctVNs.push($xeList.renderCheckbox(h, row, rowid, isCheckboxChecked));
      }
      var isDragDisabled = false;
      if (isDrag && keyField && (!visibleMethod || visibleMethod(rowParams))) {
        var handleOns = {};
        if (trigger !== 'row') {
          isDragDisabled = !!(disabledMethod && disabledMethod(rowParams));
          handleOns.mousedown = function (evnt) {
            if (!isDragDisabled) {
              $xeList.handleRowDragMousedownEvent(evnt, rowParams);
            }
          };
          handleOns.mouseup = $xeList.handleRowDragMouseupEvent;
        }
        ctVNs.push(h('div', {
          key: 'ct1',
          class: 'vxe-list--row-drag'
        }, [h('span', {
          class: 'vxe-list--drag-handle',
          on: handleOns
        }, [h('i', {
          class: icon || (0, _ui.getIcon)().LIST_DRAG
        })])]));
      }
      ctVNs.push(h('div', {
        key: 'ct5',
        class: 'vxe-list--row-content'
      }, contentSlot ? contentSlot(rowParams) : contentField ? (0, _utils.getText)(row[contentField]) : ''));
      if (extraSlot) {
        ctVNs.push(h('div', {
          key: 'ct7',
          class: 'vxe-list--row-extra'
        }, extraSlot(rowParams)));
      }
      var rowOns = {
        mousedown: function mousedown(evnt) {
          $xeList.handleRowMousedownEvent(evnt, row);
        },
        mouseup: $xeList.handleRowDragMouseupEvent,
        click: function click(evnt) {
          $xeList.handleRowClickEvent(evnt, row);
        },
        dblclick: function dblclick(evnt) {
          $xeList.handleRowDblclickEvent(evnt, row);
        },
        contextmenu: function contextmenu(evnt) {
          $xeList.handleContextmenuEvent(evnt, row);
        }
      };
      // 拖拽行事件
      if (isDrag) {
        rowOns.dragstart = $xeList.handleRowDragDragstartEvent;
        rowOns.dragend = $xeList.handleRowDragDragendEvent;
        rowOns.dragover = $xeList.handleRowDragDragoverEvent;
      }
      return h('div', {
        key: hasKey && keyField ? rowid : rowIndex,
        class: ['vxe-list--row', isRowFnCls ? rowClassName(rowParams) : rowClassName || '', {
          'is--drag-disabled': isDragDisabled,
          'is--current': currRowFlag && currentRow && $xeList.eqRowByKey(currentRow, rowKey),
          'is-radio--checked': isRadioChecked,
          'is-checkbox--checked': isCheckboxChecked
        }],
        attrs: hasKey && keyField ? {
          rowid: rowid
        } : undefined,
        on: rowOns
      }, ctVNs);
    },
    renderVN: function renderVN(h) {
      var $xeList = this;
      var props = $xeList;
      var reactData = $xeList.reactData;
      var slots = $xeList.$scopedSlots;
      var showCheckbox = props.showCheckbox,
        className = props.className,
        loading = props.loading;
      var bodyHeight = reactData.bodyHeight,
        topSpaceHeight = reactData.topSpaceHeight,
        rowList = reactData.rowList,
        isAllChecked = reactData.isAllChecked,
        isAllIndeterminate = reactData.isAllIndeterminate;
      var defaultSlot = slots.default;
      var headerSlot = slots.header;
      var footerSlot = slots.footer;
      var vSize = $xeList.computeSize;
      var wrapperStyles = $xeList.computeWrapperStyles;
      var virtualStyles = $xeList.computeVirtualStyles;
      var radioOpts = $xeList.computeRadioOpts;
      var checkboxOpts = $xeList.computeCheckboxOpts;
      var dragOpts = $xeList.computeDragOpts;
      var trigger = dragOpts.trigger,
        isCrossListDrag = dragOpts.isCrossListDrag;
      var rowOpts = $xeList.computeRowOpts;
      var isHover = rowOpts.isHover,
        padding = rowOpts.padding;
      var showDefChekboxHead = showCheckbox && checkboxOpts.showHeader !== false;
      var leOns = {};
      if (isCrossListDrag && !rowList.length) {
        leOns.dragover = $xeList.handleCrossListRowDragoverEmptyEvent;
      }
      return h('div', {
        ref: 'refElem',
        class: ['vxe-list', className ? _xeUtils.default.isFunction(className) ? className({
          $list: $xeList
        }) : className : '', _defineProperty(_defineProperty({}, "size--".concat(vSize), vSize), 'is--loading', loading)],
        on: leOns,
        style: wrapperStyles
      }, [headerSlot || showDefChekboxHead ? h('div', {
        ref: 'refHeaderElem',
        class: 'vxe-list--header-wrapper'
      }, [showDefChekboxHead ? h('div', {
        class: 'vxe-list--header-left'
      }, [h('div', {
        class: ['vxe-list--checkbox-header', {
          'is--checked': isAllChecked,
          'is--indeterminate': isAllIndeterminate
        }],
        on: {
          click: $xeList.changeCheckboxAllEvent
        }
      }, [h('span', {
        class: ['vxe-checkbox--icon', isAllChecked ? (0, _ui.getIcon)().CHECKBOX_CHECKED : isAllIndeterminate ? (0, _ui.getIcon)().CHECKBOX_INDETERMINATE : (0, _ui.getIcon)().CHECKBOX_UNCHECKED]
      })])]) : (0, _ui.renderEmptyElement)($xeList), headerSlot ? h('div', {
        class: 'vxe-list--header-content'
      }, headerSlot({
        items: rowList,
        $list: $xeList
      })) : (0, _ui.renderEmptyElement)($xeList)]) : (0, _ui.renderEmptyElement)($xeList), h('div', {
        ref: 'refVirtualWrapper',
        class: 'vxe-list--virtual-wrapper',
        style: virtualStyles,
        on: {
          scroll: $xeList.scrollEvent
        }
      }, [h('div', {
        class: 'vxe-list--y-space',
        style: {
          height: bodyHeight ? "".concat(bodyHeight, "px") : ''
        }
      }), h('div', {
        ref: 'refVirtualBody',
        class: ['vxe-list--body', {
          'trigger--row': trigger === 'row',
          'checkbox--highlight': checkboxOpts.highlight,
          'radio--highlight': radioOpts.highlight,
          'row--hover': isHover,
          'is--padding': padding
        }],
        style: {
          marginTop: topSpaceHeight ? "".concat(topSpaceHeight, "px") : ''
        }
      }, defaultSlot ? defaultSlot({
        items: rowList,
        $list: $xeList
      }) : rowList.map(function (row, i) {
        return $xeList.renderRow(h, row, i);
      }))]), footerSlot ? h('div', {
        ref: 'refFooterElem',
        class: 'vxe-list--footer-wrapper'
      }, footerSlot({
        items: rowList,
        $list: $xeList
      })) : (0, _ui.renderEmptyElement)($xeList),
      /**
       * 拖拽提示
       */
      $xeList.renderDragTip(h),
      /**
       * 加载中
       */
      h(_loading.default, {
        class: 'vxe-list--loading',
        props: {
          value: loading
        }
      })]);
    }
  },
  watch: {
    data: function data() {
      var $xeList = this;
      var props = $xeList;
      $xeList.loadData(props.data || []);
    },
    height: function height() {
      var $xeList = this;
      $xeList.reFlag++;
    },
    maxHeight: function maxHeight() {
      var $xeList = this;
      $xeList.reFlag++;
    },
    syncResize: function syncResize() {
      var $xeList = this;
      $xeList.reFlag++;
    },
    computeRowHeight: function computeRowHeight() {
      var $xeList = this;
      $xeList.reFlag++;
    },
    reFlag: function reFlag() {
      var $xeList = this;
      $xeList.$nextTick(function () {
        $xeList.recalculate();
      });
    },
    checkRowKey: function checkRowKey() {
      var $xeList = this;
      $xeList.updateRadioModeValue();
    },
    checkRowKeys: function checkRowKeys() {
      var $xeList = this;
      $xeList.updateCheckboxModeValue();
    }
  },
  created: function created() {
    var $xeList = this;
    var props = $xeList;
    $xeList.internalData = createInternalData();
    $xeList.browseObj = _xeUtils.default.browse();
    $xeList.loadData(props.data || []);
  },
  mounted: function mounted() {
    var $xeList = this;
    var props = $xeList;
    var internalData = $xeList.internalData;
    var showSeq = props.showSeq,
      showRadio = props.showRadio,
      showCheckbox = props.showCheckbox;
    var rowOpts = $xeList.computeRowOpts;
    var useKey = rowOpts.useKey,
      keyField = rowOpts.keyField;
    var isDrag = $xeList.computeIsDrag;
    if (!keyField) {
      if (showSeq) {
        errLog('vxe.error.reqSupportProp', ['show-seq', 'row-config.keyField']);
      }
      if (showRadio) {
        errLog('vxe.error.reqSupportProp', ['show-radio', 'row-config.keyField']);
      }
      if (showCheckbox) {
        errLog('vxe.error.reqSupportProp', ['show-checkbox', 'row-config.keyField']);
      }
      if (isDrag) {
        errLog('vxe.error.reqSupportProp', ['drag-config', 'row-config.keyField']);
      }
    }
    if (useKey && !keyField) {
      errLog('vxe.error.reqSupportProp', ['row-config.useKey', 'row-config.keyField']);
    }
    if (props.autoResize) {
      var el = $xeList.$refs.refElem;
      var resizeObserver = _ui.globalResize.create(function () {
        return $xeList.recalculate();
      });
      resizeObserver.observe(el);
      if (el) {
        resizeObserver.observe(el.parentElement);
      }
      internalData.resizeObserver = resizeObserver;
    }
    $xeList.recalculate();
    _ui.globalEvents.on($xeList, 'resize', $xeList.recalculate);
  },
  activated: function activated() {
    var $xeList = this;
    $xeList.recalculate().then(function () {
      return $xeList.refreshScroll();
    });
  },
  beforeDestroy: function beforeDestroy() {
    var $xeList = this;
    var reactData = $xeList.reactData;
    var internalData = $xeList.internalData;
    var resizeObserver = internalData.resizeObserver;
    if (resizeObserver) {
      resizeObserver.disconnect();
    }
    _ui.globalEvents.off($xeList, 'resize');
    _xeUtils.default.assign(reactData, createReactData());
    _xeUtils.default.assign(internalData, createInternalData());
  },
  render: function render(h) {
    return this.renderVN(h);
  }
});
/* define-vxe-component end */